diff options
author | John Spurlock <jspurlock@google.com> | 2014-10-29 11:13:01 -0400 |
---|---|---|
committer | John Spurlock <jspurlock@google.com> | 2014-10-29 11:13:01 -0400 |
commit | 42bfc9ab00ffefc2cfb20e089ebfcb7d3b4ac521 (patch) | |
tree | f44b00bef542f934e6997551f7d21057ab8b1ea3 /packages/SystemUI/src/com/android/systemui/power | |
parent | b9e290c7136fb7c76b7238426ccd598dec2d2643 (diff) | |
download | frameworks_base-42bfc9ab00ffefc2cfb20e089ebfcb7d3b4ac521.zip frameworks_base-42bfc9ab00ffefc2cfb20e089ebfcb7d3b4ac521.tar.gz frameworks_base-42bfc9ab00ffefc2cfb20e089ebfcb7d3b4ac521.tar.bz2 |
PowerUI: Suppress warning on incremental drops.
If the user explicitly dismisses the warning notification,
don't update the notification until the next threshold value.
Bug: 17691122
Change-Id: I840f33f787f1dd6f217de543a291bc9f65b1b046
Diffstat (limited to 'packages/SystemUI/src/com/android/systemui/power')
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/power/PowerNotificationWarnings.java | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/power/PowerNotificationWarnings.java b/packages/SystemUI/src/com/android/systemui/power/PowerNotificationWarnings.java index f5df1a9..4391bfc 100644 --- a/packages/SystemUI/src/com/android/systemui/power/PowerNotificationWarnings.java +++ b/packages/SystemUI/src/com/android/systemui/power/PowerNotificationWarnings.java @@ -66,6 +66,7 @@ public class PowerNotificationWarnings implements PowerUI.WarningsUI { private static final String ACTION_SHOW_BATTERY_SETTINGS = "PNW.batterySettings"; private static final String ACTION_START_SAVER = "PNW.startSaver"; private static final String ACTION_STOP_SAVER = "PNW.stopSaver"; + private static final String ACTION_DISMISSED_WARNING = "PNW.dismissedWarning"; private static final AudioAttributes AUDIO_ATTRIBUTES = new AudioAttributes.Builder() .setContentType(AudioAttributes.CONTENT_TYPE_SONIFICATION) @@ -180,6 +181,7 @@ public class PowerNotificationWarnings implements PowerUI.WarningsUI { .setContentTitle(mContext.getString(R.string.battery_low_title)) .setContentText(mContext.getString(textRes, percentage)) .setOnlyAlertOnce(true) + .setDeleteIntent(pendingBroadcast(ACTION_DISMISSED_WARNING)) .setPriority(Notification.PRIORITY_MAX) .setVisibility(Notification.VISIBILITY_PUBLIC) .setColor(mContext.getResources().getColor( @@ -374,6 +376,7 @@ public class PowerNotificationWarnings implements PowerUI.WarningsUI { filter.addAction(ACTION_SHOW_BATTERY_SETTINGS); filter.addAction(ACTION_START_SAVER); filter.addAction(ACTION_STOP_SAVER); + filter.addAction(ACTION_DISMISSED_WARNING); mContext.registerReceiverAsUser(this, UserHandle.ALL, filter, null, mHandler); } @@ -391,6 +394,8 @@ public class PowerNotificationWarnings implements PowerUI.WarningsUI { dismissSaverNotification(); dismissLowBatteryNotification(); setSaverMode(false); + } else if (action.equals(ACTION_DISMISSED_WARNING)) { + dismissLowBatteryWarning(); } } } |