summaryrefslogtreecommitdiffstats
path: root/packages/SystemUI/src
diff options
context:
space:
mode:
authorJohn Spurlock <jspurlock@google.com>2015-05-19 12:26:25 -0400
committerJohn Spurlock <jspurlock@google.com>2015-05-19 12:26:25 -0400
commite56efa71bbb71b65ffdc37313c2745bff9ab912e (patch)
treec443ae2d0cb7fd43487fc971c0f27c9349a29498 /packages/SystemUI/src
parente20b22feb32d82a50a933141ecb8d03457a66f11 (diff)
downloadframeworks_base-e56efa71bbb71b65ffdc37313c2745bff9ab912e.zip
frameworks_base-e56efa71bbb71b65ffdc37313c2745bff9ab912e.tar.gz
frameworks_base-e56efa71bbb71b65ffdc37313c2745bff9ab912e.tar.bz2
Volume: Dialog should not interfere when not showing.
Also dump volume dialog controller state properly as part of the sysui service dump. Bug: 21207717 Change-Id: I5146d4159d9b017bc91852b91a585725821c19d9
Diffstat (limited to 'packages/SystemUI/src')
-rw-r--r--packages/SystemUI/src/com/android/systemui/volume/VolumeDialog.java2
-rw-r--r--packages/SystemUI/src/com/android/systemui/volume/VolumeDialogController.java40
2 files changed, 31 insertions, 11 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/volume/VolumeDialog.java b/packages/SystemUI/src/com/android/systemui/volume/VolumeDialog.java
index 6e0ca3c..1c6462e 100644
--- a/packages/SystemUI/src/com/android/systemui/volume/VolumeDialog.java
+++ b/packages/SystemUI/src/com/android/systemui/volume/VolumeDialog.java
@@ -724,7 +724,7 @@ public class VolumeDialog {
}
row.slider.setProgress(newProgress);
}
- if (mAutomute) {
+ if (mAutomute && mShowing) {
if (vlevel == 0 && !row.ss.muted && row.stream == AudioManager.STREAM_MUSIC) {
mController.setStreamMute(row.stream, true);
}
diff --git a/packages/SystemUI/src/com/android/systemui/volume/VolumeDialogController.java b/packages/SystemUI/src/com/android/systemui/volume/VolumeDialogController.java
index 3a8081f..c6d9e46 100644
--- a/packages/SystemUI/src/com/android/systemui/volume/VolumeDialogController.java
+++ b/packages/SystemUI/src/com/android/systemui/volume/VolumeDialogController.java
@@ -180,7 +180,7 @@ public class VolumeDialogController {
pw.print(" mEnabled: "); pw.println(mEnabled);
pw.print(" mDestroyed: "); pw.println(mDestroyed);
pw.print(" mVolumePolicy: "); pw.println(mVolumePolicy);
- pw.print(" mEnabled: "); pw.println(mEnabled);
+ pw.print(" mState: "); pw.println(mState.toString(4));
pw.print(" mShowDndTile: "); pw.println(mShowDndTile);
pw.print(" mHasVibrator: "); pw.println(mHasVibrator);
pw.print(" mRemoteStreams: "); pw.println(mMediaSessionsCallbacksW.mRemoteStreams
@@ -960,25 +960,45 @@ public class VolumeDialogController {
@Override
public String toString() {
+ return toString(0);
+ }
+
+ public String toString(int indent) {
final StringBuilder sb = new StringBuilder("{");
+ if (indent > 0) sep(sb, indent);
for (int i = 0; i < states.size(); i++) {
- if (i > 0) sb.append(',');
+ if (i > 0) {
+ sep(sb, indent);
+ }
final int stream = states.keyAt(i);
final StreamState ss = states.valueAt(i);
sb.append(AudioSystem.streamToString(stream)).append(":").append(ss.level)
- .append("[").append(ss.levelMin).append("..").append(ss.levelMax);
+ .append('[').append(ss.levelMin).append("..").append(ss.levelMax)
+ .append(']');
if (ss.muted) sb.append(" [MUTED]");
}
- sb.append(",ringerModeExternal:").append(ringerModeExternal);
- sb.append(",ringerModeInternal:").append(ringerModeInternal);
- sb.append(",zenMode:").append(zenMode);
- sb.append(",effectsSuppressor:").append(effectsSuppressor);
- sb.append(",effectsSuppressorName:").append(effectsSuppressorName);
- sb.append(",zenModeConfig:").append(zenModeConfig);
- sb.append(",activeStream:").append(activeStream);
+ sep(sb, indent); sb.append("ringerModeExternal:").append(ringerModeExternal);
+ sep(sb, indent); sb.append("ringerModeInternal:").append(ringerModeInternal);
+ sep(sb, indent); sb.append("zenMode:").append(zenMode);
+ sep(sb, indent); sb.append("effectsSuppressor:").append(effectsSuppressor);
+ sep(sb, indent); sb.append("effectsSuppressorName:").append(effectsSuppressorName);
+ sep(sb, indent); sb.append("zenModeConfig:").append(zenModeConfig);
+ sep(sb, indent); sb.append("activeStream:").append(activeStream);
+ if (indent > 0) sep(sb, indent);
return sb.append('}').toString();
}
+ private static void sep(StringBuilder sb, int indent) {
+ if (indent > 0) {
+ sb.append('\n');
+ for (int i = 0; i < indent; i++) {
+ sb.append(' ');
+ }
+ } else {
+ sb.append(',');
+ }
+ }
+
public Condition getManualExitCondition() {
return zenModeConfig != null && zenModeConfig.manualRule != null
? zenModeConfig.manualRule.condition : null;