If the preference dialog gets dismissed on a non-ab-device it still
tries to set performance mode.
Add a check to prevent that and only set performance mode on A/B devices.
Change-Id: I6290eb80550b4cfc8a012f94bdf228af7d4fc416
Signed-off-by: Alexander Martinz <amartinz@shiftphones.com>
2020-04-03 16:18:18.286 28742-28742/org.lineageos.updater E/WindowManager: android.view.WindowLeaked: Activity org.lineageos.updater.UpdatesActivity has leaked window DecorView@5dd12b3[UpdatesActivity] that was originally added here
at android.view.ViewRootImpl.<init>(ViewRootImpl.java:621)
at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:377)
at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:96)
at android.app.Dialog.show(Dialog.java:342)
at androidx.appcompat.app.AlertDialog$Builder.show(AlertDialog.java:1009)
at org.lineageos.updater.UpdatesListAdapter.showInfoDialog(UpdatesListAdapter.java:552)
at org.lineageos.updater.UpdatesListAdapter.lambda$setButtonAction$5$UpdatesListAdapter(UpdatesListAdapter.java:375)
at org.lineageos.updater.-$$Lambda$UpdatesListAdapter$xtQzmsol8pO3BlYZkbKcb5gVAq4.onClick(Unknown Source:2)
at org.lineageos.updater.UpdatesListAdapter.lambda$setButtonAction$9(UpdatesListAdapter.java:408)
at org.lineageos.updater.-$$Lambda$UpdatesListAdapter$M4hRQyNgJseuHrw6EfkhK_yrGK8.onClick(Unknown Source:2)
at android.view.View.performClick(View.java:7259)
at android.view.View.performClickInternal(View.java:7236)
at android.view.View.access$3600(View.java:801)
at android.view.View$PerformClick.run(View.java:27896)
at android.os.Handler.handleCallback(Handler.java:883)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7397)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:491)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:935)
Change-Id: I7877b02b8526c7c12331a660a7ac934d02656e6f
Signed-off-by: Alexander Martinz <amartinz@shiftphones.com>
BatteryManager#BATTERY_PLUGGED_ANY is hidden and actually just
a combination of all public available plugged values.
Recreate the hidden field instead of using it directly.
This unbreaks Android Studio builds.
Change-Id: I4754ce7544dab22306eeac03c3e9f26b650094d2
Signed-off-by: Alexander Martinz <amartinz@shiftphones.com>
* After moving from the generic /upgrade.html url to a device specific
one, updater needs to display that instead
Change-Id: If9fc6bddfab206a97283f2080ea4df0cbb742a7d
* This replaces auto update check switch with a dropdown with 4 options:
* Never
* Once a day
* Once a week (default)
* Once a month
Change-Id: I4bcae4c013a5d44958f9c54d641e64aac3062a8b
This change sets LOCAL_SDK_VERSION for all packages where
this is possible without breaking the build, and
LOCAL_PRIVATE_PLATFORM_APIS := true otherwise.
Setting one of these two will be made required soon, and this
is a change in preparation for that. Not setting LOCAL_SDK_VERSION
makes the app implicitly depend on the bootclasspath, which is
often not required. This change effectively makes depending on
private apis opt-in rather than opt-out.
Bug: 73535841
Change-Id: Iabb0556dc1c80c7fc7f6c76d61d5e441b03cdce0
* We are getting permission denial when sending Intent.ACTION_REBOOT
broadcast, using pm.reboot() instead works just fine.
Change-Id: I38d0ad8cc5f4c9362fd5baf7476e14bff56616dd
* After update is complete button is being handled in
handleNotActiveStatus instead of handleActiveStatus.
Change-Id: I6a4df580f93b71fd12e902801125acae668ec991
* Lower default value by 10%
* Decrease the level by another 10% if charging
* Always allow installation in case device doesn't have a battery
* Show the requirements in the alert dialog
Change-Id: Iebb10220612006fbd096eb474cf3034ef52144b3