Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enable power warning for emulators #14299

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public void showPowerCheckDialog() {

AlertDialog sut = activity.buildPowerCheckDialog();

activity.runOnUiThread(sut::show);
activity.runOnUiThread(activity::showPowerCheckDialog);

getInstrumentation().waitForIdleSync();
shortSleep();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import androidx.drawerlayout.widget.DrawerLayout
import androidx.lifecycle.Lifecycle
import androidx.recyclerview.widget.GridLayoutManager
import com.google.android.material.dialog.MaterialAlertDialogBuilder
import com.nextcloud.client.appinfo.AppInfo
import com.nextcloud.client.core.Clock
import com.nextcloud.client.device.PowerManagementService
import com.nextcloud.client.di.Injectable
Expand Down Expand Up @@ -143,6 +144,9 @@ class SyncedFoldersActivity :
@Inject
lateinit var syncedFolderProvider: SyncedFolderProvider

@Inject
lateinit var appInfo: AppInfo

lateinit var binding: SyncedFoldersLayoutBinding
lateinit var adapter: SyncedFolderAdapter

Expand Down Expand Up @@ -816,7 +820,10 @@ class SyncedFoldersActivity :
}

private fun showBatteryOptimizationInfo() {
if (powerManagementService.isPowerSavingExclusionAvailable || checkIfBatteryOptimizationEnabled()) {
if (powerManagementService.isPowerSavingExclusionAvailable ||
checkIfBatteryOptimizationEnabled() ||
appInfo.isDebugBuild
) {
val alertDialogBuilder = MaterialAlertDialogBuilder(this, R.style.Theme_ownCloud_Dialog)
.setTitle(getString(R.string.battery_optimization_title))
.setMessage(getString(R.string.battery_optimization_message))
Expand Down
Loading