summaryrefslogtreecommitdiffstats
path: root/packages/SystemUI/src/com/android/systemui/power
diff options
context:
space:
mode:
authorJohn Spurlock <jspurlock@google.com>2014-08-25 15:45:43 -0400
committerJohn Spurlock <jspurlock@google.com>2014-08-25 15:45:43 -0400
commit7290d192c8a0c1a19ef3c298f2eeab63e82190a8 (patch)
tree061d9b5f9284cd974854827785b0f378cbebcae4 /packages/SystemUI/src/com/android/systemui/power
parent6adf1588fd2bccb8cf95a9c3456230bba805fab9 (diff)
downloadframeworks_base-7290d192c8a0c1a19ef3c298f2eeab63e82190a8.zip
frameworks_base-7290d192c8a0c1a19ef3c298f2eeab63e82190a8.tar.gz
frameworks_base-7290d192c8a0c1a19ef3c298f2eeab63e82190a8.tar.bz2
PowerUI: Don't play sound on every update below level.
There are many paths to update the power notification. Use PowerUI's playSound as a tripwire, and reset the value once applied. Bug:17253062 Change-Id: Ica6a4c621f7047f8b52dee82cbfe1db5bc08247e
Diffstat (limited to 'packages/SystemUI/src/com/android/systemui/power')
-rw-r--r--packages/SystemUI/src/com/android/systemui/power/PowerNotificationWarnings.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/power/PowerNotificationWarnings.java b/packages/SystemUI/src/com/android/systemui/power/PowerNotificationWarnings.java
index bd1ef7a..4c7f8ec 100644
--- a/packages/SystemUI/src/com/android/systemui/power/PowerNotificationWarnings.java
+++ b/packages/SystemUI/src/com/android/systemui/power/PowerNotificationWarnings.java
@@ -193,6 +193,7 @@ public class PowerNotificationWarnings implements PowerUI.WarningsUI {
}
if (mPlaySound) {
attachLowBatterySound(nb);
+ mPlaySound = false;
}
final Notification n = nb.build();
if (n.headsUpContentView != null) {
@@ -283,7 +284,7 @@ public class PowerNotificationWarnings implements PowerUI.WarningsUI {
public void showLowBatteryWarning(boolean playSound) {
Slog.i(TAG,
"show low battery warning: level=" + mBatteryLevel
- + " [" + mBucket + "]");
+ + " [" + mBucket + "] playSound=" + playSound);
mPlaySound = playSound;
mWarning = true;
updateNotification();