OSDN Git Service

dismiss the volume shade if the a11y stream goes away
authorJulia Reynolds <juliacr@google.com>
Tue, 8 Aug 2017 16:41:04 +0000 (12:41 -0400)
committerJulia Reynolds <juliacr@google.com>
Tue, 8 Aug 2017 16:44:07 +0000 (12:44 -0400)
... if the active stream was the a11y stream

Test: turn talkback on, change volume, turn talkback off before
the volume panel goes away
Fixes: 63252708

Change-Id: I5e03b17fd7408d28471919c45c910e634b415bbc

packages/SystemUI/src/com/android/systemui/volume/Events.java
packages/SystemUI/src/com/android/systemui/volume/VolumeDialogImpl.java

index 8ed4fca..49a12f4 100644 (file)
@@ -79,14 +79,16 @@ public class Events {
     public static final int DISMISS_REASON_SCREEN_OFF = 4;
     public static final int DISMISS_REASON_SETTINGS_CLICKED = 5;
     public static final int DISMISS_REASON_DONE_CLICKED = 6;
+    public static final int DISMISS_STREAM_GONE = 7;
     public static final String[] DISMISS_REASONS = {
-        "unknown",
-        "touch_outside",
-        "volume_controller",
-        "timeout",
-        "screen_off",
-        "settings_clicked",
-        "done_clicked",
+            "unknown",
+            "touch_outside",
+            "volume_controller",
+            "timeout",
+            "screen_off",
+            "settings_clicked",
+            "done_clicked",
+            "a11y_stream_changed"
     };
 
     public static final int SHOW_REASON_UNKNOWN = 0;
index bc8c566..7f5c595 100644 (file)
@@ -1059,7 +1059,12 @@ public class VolumeDialogImpl implements VolumeDialog, TunerService.Tunable {
         public void onAccessibilityModeChanged(Boolean showA11yStream) {
             boolean show = showA11yStream == null ? false : showA11yStream;
             mShowA11yStream = show;
-            updateRowsH(getActiveRow());
+            VolumeRow activeRow = getActiveRow();
+            if (!mShowA11yStream && AudioManager.STREAM_ACCESSIBILITY == activeRow.stream) {
+                dismissH(Events.DISMISS_STREAM_GONE);
+            } else {
+                updateRowsH(activeRow);
+            }
 
         }
     };