OSDN Git Service

Fix "auto battery saver notification comes back"
authorMakoto Onuki <omakoto@google.com>
Fri, 13 Apr 2018 22:53:57 +0000 (15:53 -0700)
committerMakoto Onuki <omakoto@google.com>
Fri, 13 Apr 2018 22:53:57 +0000 (15:53 -0700)
Bug: 78017511
Test: Manual:
- Run them:
adb shell settings delete global low_power
adb shell settings delete global low_power_sticky
adb shell settings delete global low_power_trigger_level
adb shell settings delete secure low_power_manual_activation_count
adb shell settings delete secure low_power_warning_acknowledged
adb shell settings delete secure suppress_auto_battery_saver_suggestion
- Unplug
- Toggle BS 4 times -> the "Tap to schedule battery saver" notification shows up
- Dismiss the notification
- Wait until the battery percent drops
- Make sure the notification stays dismissed.

Change-Id: I82cbd0110ab5d140c9e9b5b449577040e51032c6

packages/SystemUI/src/com/android/systemui/power/PowerNotificationWarnings.java

index 40ce69b..d860fc5 100644 (file)
@@ -533,6 +533,7 @@ public class PowerNotificationWarnings implements PowerUI.WarningsUI {
             filter.addAction(ACTION_SHOW_AUTO_SAVER_SUGGESTION);
             filter.addAction(ACTION_ENABLE_AUTO_SAVER);
             filter.addAction(ACTION_AUTO_SAVER_NO_THANKS);
+            filter.addAction(ACTION_DISMISS_AUTO_SAVER_SUGGESTION);
             mContext.registerReceiverAsUser(this, UserHandle.ALL, filter,
                     android.Manifest.permission.DEVICE_POWER, mHandler);
         }