Fix "auto battery saver notification comes back"

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
This commit is contained in:
Makoto Onuki
2018-04-13 15:53:57 -07:00
parent d55a940e9f
commit 5ac8d5e3ce

View 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);
}