OSDN Git Service

Selectively show zen footer.
authorJulia Reynolds <juliacr@google.com>
Tue, 8 Sep 2015 17:41:45 +0000 (13:41 -0400)
committerJulia Reynolds <juliacr@google.com>
Tue, 8 Sep 2015 17:41:45 +0000 (13:41 -0400)
Only show zen footer if the active stream is affected by the current
zen mode.

Bug: 23844466
Change-Id: I08770882f12f11c3458e1e48a287139480ae7aa3

packages/SystemUI/src/com/android/systemui/volume/VolumeDialog.java

index 6475cbf..b2f527e 100644 (file)
@@ -104,6 +104,7 @@ public class VolumeDialog {
     private final SpTexts mSpTexts;
     private final SparseBooleanArray mDynamic = new SparseBooleanArray();
     private final KeyguardManager mKeyguard;
+    private final AudioManager mAudioManager;
     private final int mExpandButtonAnimationDuration;
     private final ZenFooter mZenFooter;
     private final LayoutTransition mLayoutTransition;
@@ -136,6 +137,7 @@ public class VolumeDialog {
         mCallback = callback;
         mSpTexts = new SpTexts(mContext);
         mKeyguard = (KeyguardManager) context.getSystemService(Context.KEYGUARD_SERVICE);
+        mAudioManager = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
 
         mDialog = new CustomDialog(mContext);
 
@@ -649,7 +651,8 @@ public class VolumeDialog {
     private void updateFooterH() {
         if (D.BUG) Log.d(TAG, "updateFooterH");
         final boolean wasVisible = mZenFooter.getVisibility() == View.VISIBLE;
-        final boolean visible = mState.zenMode != Global.ZEN_MODE_OFF;
+        final boolean visible = mState.zenMode != Global.ZEN_MODE_OFF
+                && mAudioManager.isStreamAffectedByRingerMode(mActiveStream);
         if (wasVisible != visible && !visible) {
             prepareForCollapse();
         }