Merge "Revert "Add async register/unregister APIs in Settings/UserSettingsProxy."" into main
diff --git a/AconfigFlags.bp b/AconfigFlags.bp
index 2d05606..96d6f32 100644
--- a/AconfigFlags.bp
+++ b/AconfigFlags.bp
@@ -307,6 +307,11 @@
     defaults: ["framework-minus-apex-aconfig-java-defaults"],
 }
 
+cc_aconfig_library {
+    name: "android_security_flags_aconfig_c_lib",
+    aconfig_declarations: "android.security.flags-aconfig",
+}
+
 // UsageStats
 aconfig_declarations {
     name: "android.app.usage.flags-aconfig",
diff --git a/DREAM_MANAGER_OWNERS b/DREAM_MANAGER_OWNERS
deleted file mode 100644
index 48bde60..0000000
--- a/DREAM_MANAGER_OWNERS
+++ /dev/null
@@ -1 +0,0 @@
-brycelee@google.com
diff --git a/core/java/android/app/OWNERS b/core/java/android/app/OWNERS
index 2e38c06..0fad979 100644
--- a/core/java/android/app/OWNERS
+++ b/core/java/android/app/OWNERS
@@ -61,7 +61,7 @@
 per-file ComponentCaller.java = file:COMPONENT_CALLER_OWNERS
 
 # DreamManager
-per-file DreamManager.java = file:/DREAM_MANAGER_OWNERS
+per-file DreamManager.java = file:/core/java/android/service/dreams/OWNERS
 
 # GrammaticalInflectionManager
 per-file *GrammaticalInflection* = file:/services/core/java/com/android/server/grammaticalinflection/OWNERS
diff --git a/core/java/android/service/dreams/OWNERS b/core/java/android/service/dreams/OWNERS
index 77bcee8..119ca55 100644
--- a/core/java/android/service/dreams/OWNERS
+++ b/core/java/android/service/dreams/OWNERS
@@ -1,10 +1,11 @@
-# Bug component: 78010
+# Bug component: 66910
 
 brycelee@google.com
-dsandler@google.com
-galinap@google.com
-jjaggi@google.com
 lusilva@google.com
-michaelwr@google.com
-santoscordon@google.com
 wxyz@google.com
+justinkoh@google.com
+
+rgl@google.com
+santoscordon@google.com
+
+dsandler@google.com
diff --git a/core/proto/android/nfc/apdu_service_info.proto b/core/proto/android/nfc/apdu_service_info.proto
index fd110c4..9efdfcb 100644
--- a/core/proto/android/nfc/apdu_service_info.proto
+++ b/core/proto/android/nfc/apdu_service_info.proto
@@ -27,6 +27,20 @@
 message ApduServiceInfoProto {
     option (.android.msg_privacy).dest = DEST_EXPLICIT;
 
+    message AutoTransactMapping {
+        option (.android.msg_privacy).dest = DEST_EXPLICIT;
+
+        optional string aid = 1;
+        optional bool should_auto_transact = 2;
+    }
+
+    message AutoTransactPattern {
+        option (.android.msg_privacy).dest = DEST_EXPLICIT;
+
+        optional string regexp_pattern = 1;
+        optional bool should_auto_transact = 2;
+    }
+
     optional .android.content.ComponentNameProto component_name = 1;
     optional string description = 2;
     optional bool on_host = 3;
@@ -35,4 +49,7 @@
     repeated AidGroupProto static_aid_groups = 6;
     repeated AidGroupProto dynamic_aid_groups = 7;
     optional string settings_activity_name = 8;
+    optional bool should_default_to_observe_mode = 9;
+    repeated AutoTransactMapping auto_transact_mapping = 10;
+    repeated AutoTransactPattern auto_transact_patterns = 11;
 }
diff --git a/libs/hwui/Properties.cpp b/libs/hwui/Properties.cpp
index 325bdd6..5d3bc89 100644
--- a/libs/hwui/Properties.cpp
+++ b/libs/hwui/Properties.cpp
@@ -39,6 +39,9 @@
 constexpr bool hdr_10bit_plus() {
     return false;
 }
+constexpr bool initialize_gl_always() {
+    return false;
+}
 }  // namespace hwui_flags
 #endif
 
@@ -257,5 +260,9 @@
     return drawingEnabled == DrawingEnabled::On;
 }
 
+bool Properties::initializeGlAlways() {
+    return base::GetBoolProperty(PROPERTY_INITIALIZE_GL_ALWAYS, hwui_flags::initialize_gl_always());
+}
+
 }  // namespace uirenderer
 }  // namespace android
diff --git a/libs/hwui/Properties.h b/libs/hwui/Properties.h
index c1510d9..d3176f6 100644
--- a/libs/hwui/Properties.h
+++ b/libs/hwui/Properties.h
@@ -229,6 +229,11 @@
 
 #define PROPERTY_8BIT_HDR_HEADROOM "debug.hwui.8bit_hdr_headroom"
 
+/**
+ * Whether to initialize GL even when HWUI is running Vulkan.
+ */
+#define PROPERTY_INITIALIZE_GL_ALWAYS "debug.hwui.initialize_gl_always"
+
 ///////////////////////////////////////////////////////////////////////////////
 // Misc
 ///////////////////////////////////////////////////////////////////////////////
@@ -368,6 +373,8 @@
     static bool isDrawingEnabled();
     static void setDrawingEnabled(bool enable);
 
+    static bool initializeGlAlways();
+
 private:
     static StretchEffectBehavior stretchEffectBehavior;
     static ProfileType sProfileType;
diff --git a/libs/hwui/aconfig/hwui_flags.aconfig b/libs/hwui/aconfig/hwui_flags.aconfig
index 50f8b39..cd3ae53 100644
--- a/libs/hwui/aconfig/hwui_flags.aconfig
+++ b/libs/hwui/aconfig/hwui_flags.aconfig
@@ -90,3 +90,10 @@
   description: "Add canvas#drawRegion API"
   bug: "318612129"
 }
+
+flag {
+  name: "initialize_gl_always"
+  namespace: "core_graphics"
+  description: "Initialize GL even when HWUI is set to use Vulkan. This improves app startup time for apps using GL."
+  bug: "335172671"
+}
diff --git a/libs/hwui/apex/jni_runtime.cpp b/libs/hwui/apex/jni_runtime.cpp
index 6ace396..15b2bac 100644
--- a/libs/hwui/apex/jni_runtime.cpp
+++ b/libs/hwui/apex/jni_runtime.cpp
@@ -192,5 +192,14 @@
         // Preload Vulkan driver if HWUI renders with Vulkan backend.
         uint32_t apiVersion;
         vkEnumerateInstanceVersion(&apiVersion);
+
+        if (Properties::initializeGlAlways()) {
+            // Even though HWUI is rendering with Vulkan, some apps still use
+            // GL. Preload GL driver just in case. Since this happens prior to
+            // forking from the zygote, apps that do not use GL are unaffected.
+            // Any memory that (E)GL uses for this call is in shared memory,
+            // and this call only happens once.
+            eglGetDisplay(EGL_DEFAULT_DISPLAY);
+        }
     }
 }
diff --git a/nfc/java/android/nfc/cardemulation/ApduServiceInfo.java b/nfc/java/android/nfc/cardemulation/ApduServiceInfo.java
index 88704da..3cf0a4d 100644
--- a/nfc/java/android/nfc/cardemulation/ApduServiceInfo.java
+++ b/nfc/java/android/nfc/cardemulation/ApduServiceInfo.java
@@ -1084,6 +1084,27 @@
             proto.end(token);
         }
         proto.write(ApduServiceInfoProto.SETTINGS_ACTIVITY_NAME, mSettingsActivityName);
+        proto.write(ApduServiceInfoProto.SHOULD_DEFAULT_TO_OBSERVE_MODE,
+                mShouldDefaultToObserveMode);
+        {
+            long token = proto.start(ApduServiceInfoProto.AUTO_TRANSACT_MAPPING);
+            for (Map.Entry<String, Boolean> entry : mAutoTransact.entrySet()) {
+                proto.write(ApduServiceInfoProto.AutoTransactMapping.AID, entry.getKey());
+                proto.write(ApduServiceInfoProto.AutoTransactMapping.SHOULD_AUTO_TRANSACT,
+                        entry.getValue());
+            }
+            proto.end(token);
+        }
+        {
+            long token = proto.start(ApduServiceInfoProto.AUTO_TRANSACT_PATTERNS);
+            for (Map.Entry<Pattern, Boolean> entry : mAutoTransactPatterns.entrySet()) {
+                proto.write(ApduServiceInfoProto.AutoTransactPattern.REGEXP_PATTERN,
+                        entry.getKey().pattern());
+                proto.write(ApduServiceInfoProto.AutoTransactPattern.SHOULD_AUTO_TRANSACT,
+                        entry.getValue());
+            }
+            proto.end(token);
+        }
     }
 
     private static final Pattern AID_PATTERN = Pattern.compile("[0-9A-Fa-f]{10,32}\\*?\\#?");
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/ambient/touch/ShadeTouchHandlerTest.java b/packages/SystemUI/multivalentTests/src/com/android/systemui/ambient/touch/ShadeTouchHandlerTest.java
index 27bffd0..04b930e 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/ambient/touch/ShadeTouchHandlerTest.java
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/ambient/touch/ShadeTouchHandlerTest.java
@@ -18,9 +18,13 @@
 
 import static com.google.common.truth.Truth.assertThat;
 
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.Mockito.never;
+import static org.mockito.Mockito.times;
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
 
+import android.app.DreamManager;
 import android.view.GestureDetector;
 import android.view.MotionEvent;
 
@@ -36,6 +40,7 @@
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.mockito.ArgumentCaptor;
+import org.mockito.Captor;
 import org.mockito.Mock;
 import org.mockito.Mockito;
 import org.mockito.MockitoAnnotations;
@@ -52,63 +57,104 @@
     ShadeViewController mShadeViewController;
 
     @Mock
+    DreamManager mDreamManager;
+
+    @Mock
     TouchHandler.TouchSession mTouchSession;
 
     ShadeTouchHandler mTouchHandler;
 
+    @Captor
+    ArgumentCaptor<GestureDetector.OnGestureListener> mGestureListenerCaptor;
+    @Captor
+    ArgumentCaptor<InputChannelCompat.InputEventListener> mInputListenerCaptor;
+
     private static final int TOUCH_HEIGHT = 20;
 
     @Before
     public void setup() {
         MockitoAnnotations.initMocks(this);
+
         mTouchHandler = new ShadeTouchHandler(Optional.of(mCentralSurfaces), mShadeViewController,
-                TOUCH_HEIGHT);
+                mDreamManager, TOUCH_HEIGHT);
+    }
+
+    // Verifies that a swipe down in the gesture region is captured by the shade touch handler.
+    @Test
+    public void testSwipeDown_captured() {
+        final boolean captured = swipe(Direction.DOWN);
+
+        assertThat(captured).isTrue();
+    }
+
+    // Verifies that a swipe in the upward direction is not catpured.
+    @Test
+    public void testSwipeUp_notCaptured() {
+        final boolean captured = swipe(Direction.UP);
+
+        // Motion events not captured as the swipe is going in the wrong direction.
+        assertThat(captured).isFalse();
+    }
+
+    // Verifies that a swipe down forwards captured touches to central surfaces for handling.
+    @Test
+    public void testSwipeDown_sentToCentralSurfaces() {
+        swipe(Direction.DOWN);
+
+        // Both motion events are sent for the shade window to process.
+        verify(mCentralSurfaces, times(2)).handleExternalShadeWindowTouch(any());
+    }
+
+    // Verifies that a swipe down forwards captured touches to central surfaces for handling.
+    @Test
+    public void testSwipeDown_dreaming_sentToShadeView() {
+        when(mDreamManager.isDreaming()).thenReturn(true);
+
+        swipe(Direction.DOWN);
+
+        // Both motion events are sent for the shade window to process.
+        verify(mShadeViewController, times(2)).handleExternalTouch(any());
+    }
+
+    // Verifies that a swipe down is not forwarded to the shade window.
+    @Test
+    public void testSwipeUp_touchesNotSent() {
+        swipe(Direction.UP);
+
+        // Motion events are not sent for the shade window to process as the swipe is going in the
+        // wrong direction.
+        verify(mCentralSurfaces, never()).handleExternalShadeWindowTouch(any());
     }
 
     /**
-     * Verify that touches aren't handled when the bouncer is showing.
+     * Simulates a swipe in the given direction and returns true if the touch was intercepted by the
+     * touch handler's gesture listener.
+     * <p>
+     * Swipe down starts from a Y coordinate of 0 and goes downward. Swipe up starts from the edge
+     * of the gesture region, {@link #TOUCH_HEIGHT}, and goes upward to 0.
      */
-    @Test
-    public void testInactiveOnBouncer() {
-        when(mCentralSurfaces.isBouncerShowing()).thenReturn(true);
+    private boolean swipe(Direction direction) {
+        Mockito.clearInvocations(mTouchSession);
         mTouchHandler.onSessionStart(mTouchSession);
-        verify(mTouchSession).pop();
+
+        verify(mTouchSession).registerGestureListener(mGestureListenerCaptor.capture());
+        verify(mTouchSession).registerInputListener(mInputListenerCaptor.capture());
+
+        final float startY = direction == Direction.UP ? TOUCH_HEIGHT : 0;
+        final float endY = direction == Direction.UP ? 0 : TOUCH_HEIGHT;
+
+        // Send touches to the input and gesture listener.
+        final MotionEvent event1 = MotionEvent.obtain(0, 0, MotionEvent.ACTION_MOVE, 0, startY, 0);
+        final MotionEvent event2 = MotionEvent.obtain(0, 0, MotionEvent.ACTION_MOVE, 0, endY, 0);
+        mInputListenerCaptor.getValue().onInputEvent(event1);
+        mInputListenerCaptor.getValue().onInputEvent(event2);
+        final boolean captured = mGestureListenerCaptor.getValue().onScroll(event1, event2, 0,
+                startY - endY);
+
+        return captured;
     }
 
-    /**
-     * Make sure {@link ShadeTouchHandler}
-     */
-    @Test
-    public void testTouchPilferingOnScroll() {
-        final MotionEvent motionEvent1 = Mockito.mock(MotionEvent.class);
-        final MotionEvent motionEvent2 = Mockito.mock(MotionEvent.class);
-
-        final ArgumentCaptor<GestureDetector.OnGestureListener> gestureListenerArgumentCaptor =
-                ArgumentCaptor.forClass(GestureDetector.OnGestureListener.class);
-
-        mTouchHandler.onSessionStart(mTouchSession);
-        verify(mTouchSession).registerGestureListener(gestureListenerArgumentCaptor.capture());
-
-        assertThat(gestureListenerArgumentCaptor.getValue()
-                .onScroll(motionEvent1, motionEvent2, 1, 1))
-                .isTrue();
+    private enum Direction {
+        DOWN, UP,
     }
-
-    /**
-     * Ensure touches are propagated to the {@link ShadeViewController}.
-     */
-    @Test
-    public void testEventPropagation() {
-        final MotionEvent motionEvent = Mockito.mock(MotionEvent.class);
-
-        final ArgumentCaptor<InputChannelCompat.InputEventListener>
-                inputEventListenerArgumentCaptor =
-                    ArgumentCaptor.forClass(InputChannelCompat.InputEventListener.class);
-
-        mTouchHandler.onSessionStart(mTouchSession);
-        verify(mTouchSession).registerInputListener(inputEventListenerArgumentCaptor.capture());
-        inputEventListenerArgumentCaptor.getValue().onInputEvent(motionEvent);
-        verify(mShadeViewController).handleExternalTouch(motionEvent);
-    }
-
 }
diff --git a/packages/SystemUI/res/drawable/audio_bars_playing.xml b/packages/SystemUI/res/drawable/audio_bars_playing.xml
new file mode 100644
index 0000000..6a6706a
--- /dev/null
+++ b/packages/SystemUI/res/drawable/audio_bars_playing.xml
@@ -0,0 +1,457 @@
+<!--
+  ~ Copyright (C) 2024 The Android Open Source Project
+  ~
+  ~ Licensed under the Apache License, Version 2.0 (the "License");
+  ~ you may not use this file except in compliance with the License.
+  ~ You may obtain a copy of the License at
+  ~
+  ~      http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing, software
+  ~ distributed under the License is distributed on an "AS IS" BASIS,
+  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  ~ See the License for the specific language governing permissions and
+  ~ limitations under the License.
+  -->
+<animated-vector xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:aapt="http://schemas.android.com/aapt">
+    <target android:name="_R_G_L_4_G_D_0_P_0">
+        <aapt:attr name="android:animation">
+            <set android:ordering="together">
+                <objectAnimator
+                    android:duration="283"
+                    android:propertyName="pathData"
+                    android:startOffset="0"
+                    android:valueFrom="M-37.16 -5.87 C-33.94,-5.87 -31.32,-3.32 -31.2,-0.13 C-31.2,-0.06 -31.2,0.02 -31.2,0.09 C-31.2,0.16 -31.2,0.23 -31.2,0.29 C-31.31,3.49 -33.94,6.05 -37.16,6.05 C-40.39,6.05 -43.01,3.49 -43.12,0.29 C-43.12,0.23 -43.12,0.16 -43.12,0.09 C-43.12,0.01 -43.12,-0.07 -43.12,-0.15 C-42.99,-3.33 -40.37,-5.87 -37.16,-5.87c "
+                    android:valueTo="M-37.16 -13.39 C-33.94,-13.39 -31.32,-10.83 -31.2,-7.64 C-31.2,-7.57 -31.2,0.02 -31.2,0.09 C-31.2,0.16 -31.2,6.79 -31.2,6.86 C-31.31,10.05 -33.94,12.61 -37.16,12.61 C-40.39,12.61 -43.01,10.05 -43.12,6.85 C-43.12,6.79 -43.12,0.16 -43.12,0.09 C-43.12,0.01 -43.12,-7.58 -43.12,-7.66 C-42.99,-10.84 -40.37,-13.39 -37.16,-13.39c "
+                    android:valueType="pathType">
+                    <aapt:attr name="android:interpolator">
+                        <pathInterpolator android:pathData="M 0.0,0.0 c0.333,0 0.667,1 1.0,1.0" />
+                    </aapt:attr>
+                </objectAnimator>
+                <objectAnimator
+                    android:duration="433"
+                    android:propertyName="pathData"
+                    android:startOffset="283"
+                    android:valueFrom="M-37.16 -13.39 C-33.94,-13.39 -31.32,-10.83 -31.2,-7.64 C-31.2,-7.57 -31.2,0.02 -31.2,0.09 C-31.2,0.16 -31.2,6.79 -31.2,6.86 C-31.31,10.05 -33.94,12.61 -37.16,12.61 C-40.39,12.61 -43.01,10.05 -43.12,6.85 C-43.12,6.79 -43.12,0.16 -43.12,0.09 C-43.12,0.01 -43.12,-7.58 -43.12,-7.66 C-42.99,-10.84 -40.37,-13.39 -37.16,-13.39c "
+                    android:valueTo="M-37.16 -5.87 C-33.94,-5.87 -31.32,-3.32 -31.2,-0.13 C-31.2,-0.06 -31.2,0.02 -31.2,0.09 C-31.2,0.16 -31.2,0.23 -31.2,0.29 C-31.31,3.49 -33.94,6.05 -37.16,6.05 C-40.39,6.05 -43.01,3.49 -43.12,0.29 C-43.12,0.23 -43.12,0.16 -43.12,0.09 C-43.12,0.01 -43.12,-0.07 -43.12,-0.15 C-42.99,-3.33 -40.37,-5.87 -37.16,-5.87c "
+                    android:valueType="pathType">
+                    <aapt:attr name="android:interpolator">
+                        <pathInterpolator android:pathData="M 0.0,0.0 c0.333,0 0.667,1 1.0,1.0" />
+                    </aapt:attr>
+                </objectAnimator>
+                <objectAnimator
+                    android:duration="417"
+                    android:propertyName="pathData"
+                    android:startOffset="717"
+                    android:valueFrom="M-37.16 -5.87 C-33.94,-5.87 -31.32,-3.32 -31.2,-0.13 C-31.2,-0.06 -31.2,0.02 -31.2,0.09 C-31.2,0.16 -31.2,0.23 -31.2,0.29 C-31.31,3.49 -33.94,6.05 -37.16,6.05 C-40.39,6.05 -43.01,3.49 -43.12,0.29 C-43.12,0.23 -43.12,0.16 -43.12,0.09 C-43.12,0.01 -43.12,-0.07 -43.12,-0.15 C-42.99,-3.33 -40.37,-5.87 -37.16,-5.87c "
+                    android:valueTo="M-37.16 -13.39 C-33.94,-13.39 -31.32,-10.83 -31.2,-7.64 C-31.2,-7.57 -31.2,0.02 -31.2,0.09 C-31.2,0.16 -31.2,6.79 -31.2,6.86 C-31.31,10.05 -33.94,12.61 -37.16,12.61 C-40.39,12.61 -43.01,10.05 -43.12,6.85 C-43.12,6.79 -43.12,0.16 -43.12,0.09 C-43.12,0.01 -43.12,-7.58 -43.12,-7.66 C-42.99,-10.84 -40.37,-13.39 -37.16,-13.39c "
+                    android:valueType="pathType">
+                    <aapt:attr name="android:interpolator">
+                        <pathInterpolator android:pathData="M 0.0,0.0 c0.333,0 0.667,1 1.0,1.0" />
+                    </aapt:attr>
+                </objectAnimator>
+                <objectAnimator
+                    android:duration="467"
+                    android:propertyName="pathData"
+                    android:startOffset="1133"
+                    android:valueFrom="M-37.16 -13.39 C-33.94,-13.39 -31.32,-10.83 -31.2,-7.64 C-31.2,-7.57 -31.2,0.02 -31.2,0.09 C-31.2,0.16 -31.2,6.79 -31.2,6.86 C-31.31,10.05 -33.94,12.61 -37.16,12.61 C-40.39,12.61 -43.01,10.05 -43.12,6.85 C-43.12,6.79 -43.12,0.16 -43.12,0.09 C-43.12,0.01 -43.12,-7.58 -43.12,-7.66 C-42.99,-10.84 -40.37,-13.39 -37.16,-13.39c "
+                    android:valueTo="M-37.16 -5.87 C-33.94,-5.87 -31.32,-3.32 -31.2,-0.13 C-31.2,-0.06 -31.2,0.02 -31.2,0.09 C-31.2,0.16 -31.2,0.23 -31.2,0.29 C-31.31,3.49 -33.94,6.05 -37.16,6.05 C-40.39,6.05 -43.01,3.49 -43.12,0.29 C-43.12,0.23 -43.12,0.16 -43.12,0.09 C-43.12,0.01 -43.12,-0.07 -43.12,-0.15 C-42.99,-3.33 -40.37,-5.87 -37.16,-5.87c "
+                    android:valueType="pathType">
+                    <aapt:attr name="android:interpolator">
+                        <pathInterpolator android:pathData="M 0.0,0.0 c0.333,0 0.667,1 1.0,1.0" />
+                    </aapt:attr>
+                </objectAnimator>
+                <objectAnimator
+                    android:duration="433"
+                    android:propertyName="pathData"
+                    android:startOffset="1600"
+                    android:valueFrom="M-37.16 -5.87 C-33.94,-5.87 -31.32,-3.32 -31.2,-0.13 C-31.2,-0.06 -31.2,0.02 -31.2,0.09 C-31.2,0.16 -31.2,0.23 -31.2,0.29 C-31.31,3.49 -33.94,6.05 -37.16,6.05 C-40.39,6.05 -43.01,3.49 -43.12,0.29 C-43.12,0.23 -43.12,0.16 -43.12,0.09 C-43.12,0.01 -43.12,-0.07 -43.12,-0.15 C-42.99,-3.33 -40.37,-5.87 -37.16,-5.87c "
+                    android:valueTo="M-37.16 -13.39 C-33.94,-13.39 -31.32,-10.83 -31.2,-7.64 C-31.2,-7.57 -31.2,0.02 -31.2,0.09 C-31.2,0.16 -31.2,6.79 -31.2,6.86 C-31.31,10.05 -33.94,12.61 -37.16,12.61 C-40.39,12.61 -43.01,10.05 -43.12,6.85 C-43.12,6.79 -43.12,0.16 -43.12,0.09 C-43.12,0.01 -43.12,-7.58 -43.12,-7.66 C-42.99,-10.84 -40.37,-13.39 -37.16,-13.39c "
+                    android:valueType="pathType">
+                    <aapt:attr name="android:interpolator">
+                        <pathInterpolator android:pathData="M 0.0,0.0 c0.333,0 0.667,1 1.0,1.0" />
+                    </aapt:attr>
+                </objectAnimator>
+                <objectAnimator
+                    android:duration="517"
+                    android:propertyName="pathData"
+                    android:startOffset="2033"
+                    android:valueFrom="M-37.16 -13.39 C-33.94,-13.39 -31.32,-10.83 -31.2,-7.64 C-31.2,-7.57 -31.2,0.02 -31.2,0.09 C-31.2,0.16 -31.2,6.79 -31.2,6.86 C-31.31,10.05 -33.94,12.61 -37.16,12.61 C-40.39,12.61 -43.01,10.05 -43.12,6.85 C-43.12,6.79 -43.12,0.16 -43.12,0.09 C-43.12,0.01 -43.12,-7.58 -43.12,-7.66 C-42.99,-10.84 -40.37,-13.39 -37.16,-13.39c "
+                    android:valueTo="M-37.16 -5.87 C-33.94,-5.87 -31.32,-3.32 -31.2,-0.13 C-31.2,-0.06 -31.2,0.02 -31.2,0.09 C-31.2,0.16 -31.2,0.23 -31.2,0.29 C-31.31,3.49 -33.94,6.05 -37.16,6.05 C-40.39,6.05 -43.01,3.49 -43.12,0.29 C-43.12,0.23 -43.12,0.16 -43.12,0.09 C-43.12,0.01 -43.12,-0.07 -43.12,-0.15 C-42.99,-3.33 -40.37,-5.87 -37.16,-5.87c "
+                    android:valueType="pathType">
+                    <aapt:attr name="android:interpolator">
+                        <pathInterpolator android:pathData="M 0.0,0.0 c0.333,0 0.667,1 1.0,1.0" />
+                    </aapt:attr>
+                </objectAnimator>
+            </set>
+        </aapt:attr>
+    </target>
+    <target android:name="_R_G_L_3_G_D_0_P_0">
+        <aapt:attr name="android:animation">
+            <set android:ordering="together">
+                <objectAnimator
+                    android:duration="367"
+                    android:propertyName="pathData"
+                    android:startOffset="0"
+                    android:valueFrom="M-37.16 -5.87 C-33.94,-5.87 -31.32,-3.32 -31.2,-0.13 C-31.2,-0.06 -31.2,0.02 -31.2,0.09 C-31.2,0.16 -31.2,0.23 -31.2,0.29 C-31.31,3.49 -33.94,6.05 -37.16,6.05 C-40.39,6.05 -43.01,3.49 -43.12,0.29 C-43.12,0.23 -43.12,0.16 -43.12,0.09 C-43.12,0.01 -43.12,-0.07 -43.12,-0.15 C-42.99,-3.33 -40.37,-5.87 -37.16,-5.87c "
+                    android:valueTo="M-37.16 -18.51 C-33.94,-18.51 -31.32,-15.96 -31.2,-12.77 C-31.2,-12.7 -31.2,0.02 -31.2,0.09 C-31.2,0.16 -31.2,13.16 -31.2,13.23 C-31.31,16.43 -33.94,18.99 -37.16,18.99 C-40.39,18.99 -43.01,16.43 -43.12,13.23 C-43.12,13.16 -43.12,0.16 -43.12,0.09 C-43.12,0.01 -43.12,-12.71 -43.12,-12.78 C-42.99,-15.97 -40.37,-18.51 -37.16,-18.51c "
+                    android:valueType="pathType">
+                    <aapt:attr name="android:interpolator">
+                        <pathInterpolator android:pathData="M 0.0,0.0 c0.333,0 0.667,1 1.0,1.0" />
+                    </aapt:attr>
+                </objectAnimator>
+                <objectAnimator
+                    android:duration="433"
+                    android:propertyName="pathData"
+                    android:startOffset="367"
+                    android:valueFrom="M-37.16 -18.51 C-33.94,-18.51 -31.32,-15.96 -31.2,-12.77 C-31.2,-12.7 -31.2,0.02 -31.2,0.09 C-31.2,0.16 -31.2,13.16 -31.2,13.23 C-31.31,16.43 -33.94,18.99 -37.16,18.99 C-40.39,18.99 -43.01,16.43 -43.12,13.23 C-43.12,13.16 -43.12,0.16 -43.12,0.09 C-43.12,0.01 -43.12,-12.71 -43.12,-12.78 C-42.99,-15.97 -40.37,-18.51 -37.16,-18.51c "
+                    android:valueTo="M-37.16 -9.14 C-33.94,-9.14 -31.32,-6.58 -31.2,-3.39 C-31.2,-3.32 -31.2,0.02 -31.2,0.09 C-31.2,0.16 -31.2,3.79 -31.2,3.86 C-31.31,7.05 -33.94,9.61 -37.16,9.61 C-40.39,9.61 -43.01,7.05 -43.12,3.85 C-43.12,3.79 -43.12,0.16 -43.12,0.09 C-43.12,0.01 -43.12,-3.33 -43.12,-3.41 C-42.99,-6.59 -40.37,-9.14 -37.16,-9.14c "
+                    android:valueType="pathType">
+                    <aapt:attr name="android:interpolator">
+                        <pathInterpolator android:pathData="M 0.0,0.0 c0.333,0 0.667,1 1.0,1.0" />
+                    </aapt:attr>
+                </objectAnimator>
+                <objectAnimator
+                    android:duration="417"
+                    android:propertyName="pathData"
+                    android:startOffset="800"
+                    android:valueFrom="M-37.16 -9.14 C-33.94,-9.14 -31.32,-6.58 -31.2,-3.39 C-31.2,-3.32 -31.2,0.02 -31.2,0.09 C-31.2,0.16 -31.2,3.79 -31.2,3.86 C-31.31,7.05 -33.94,9.61 -37.16,9.61 C-40.39,9.61 -43.01,7.05 -43.12,3.85 C-43.12,3.79 -43.12,0.16 -43.12,0.09 C-43.12,0.01 -43.12,-3.33 -43.12,-3.41 C-42.99,-6.59 -40.37,-9.14 -37.16,-9.14c "
+                    android:valueTo="M-37.16 -18.51 C-33.94,-18.51 -31.32,-15.96 -31.2,-12.77 C-31.2,-12.7 -31.2,0.02 -31.2,0.09 C-31.2,0.16 -31.2,13.16 -31.2,13.23 C-31.31,16.43 -33.94,18.99 -37.16,18.99 C-40.39,18.99 -43.01,16.43 -43.12,13.23 C-43.12,13.16 -43.12,0.16 -43.12,0.09 C-43.12,0.01 -43.12,-12.71 -43.12,-12.78 C-42.99,-15.97 -40.37,-18.51 -37.16,-18.51c "
+                    android:valueType="pathType">
+                    <aapt:attr name="android:interpolator">
+                        <pathInterpolator android:pathData="M 0.0,0.0 c0.333,0 0.667,1 1.0,1.0" />
+                    </aapt:attr>
+                </objectAnimator>
+                <objectAnimator
+                    android:duration="467"
+                    android:propertyName="pathData"
+                    android:startOffset="1217"
+                    android:valueFrom="M-37.16 -18.51 C-33.94,-18.51 -31.32,-15.96 -31.2,-12.77 C-31.2,-12.7 -31.2,0.02 -31.2,0.09 C-31.2,0.16 -31.2,13.16 -31.2,13.23 C-31.31,16.43 -33.94,18.99 -37.16,18.99 C-40.39,18.99 -43.01,16.43 -43.12,13.23 C-43.12,13.16 -43.12,0.16 -43.12,0.09 C-43.12,0.01 -43.12,-12.71 -43.12,-12.78 C-42.99,-15.97 -40.37,-18.51 -37.16,-18.51c "
+                    android:valueTo="M-37.16 -9.14 C-33.94,-9.14 -31.32,-6.58 -31.2,-3.39 C-31.2,-3.32 -31.2,0.02 -31.2,0.09 C-31.2,0.16 -31.2,3.79 -31.2,3.86 C-31.31,7.05 -33.94,9.61 -37.16,9.61 C-40.39,9.61 -43.01,7.05 -43.12,3.85 C-43.12,3.79 -43.12,0.16 -43.12,0.09 C-43.12,0.01 -43.12,-3.33 -43.12,-3.41 C-42.99,-6.59 -40.37,-9.14 -37.16,-9.14c "
+                    android:valueType="pathType">
+                    <aapt:attr name="android:interpolator">
+                        <pathInterpolator android:pathData="M 0.0,0.0 c0.333,0 0.667,1 1.0,1.0" />
+                    </aapt:attr>
+                </objectAnimator>
+                <objectAnimator
+                    android:duration="450"
+                    android:propertyName="pathData"
+                    android:startOffset="1683"
+                    android:valueFrom="M-37.16 -9.14 C-33.94,-9.14 -31.32,-6.58 -31.2,-3.39 C-31.2,-3.32 -31.2,0.02 -31.2,0.09 C-31.2,0.16 -31.2,3.79 -31.2,3.86 C-31.31,7.05 -33.94,9.61 -37.16,9.61 C-40.39,9.61 -43.01,7.05 -43.12,3.85 C-43.12,3.79 -43.12,0.16 -43.12,0.09 C-43.12,0.01 -43.12,-3.33 -43.12,-3.41 C-42.99,-6.59 -40.37,-9.14 -37.16,-9.14c "
+                    android:valueTo="M-37.16 -18.51 C-33.94,-18.51 -31.32,-15.96 -31.2,-12.77 C-31.2,-12.7 -31.2,0.02 -31.2,0.09 C-31.2,0.16 -31.2,13.16 -31.2,13.23 C-31.31,16.43 -33.94,18.99 -37.16,18.99 C-40.39,18.99 -43.01,16.43 -43.12,13.23 C-43.12,13.16 -43.12,0.16 -43.12,0.09 C-43.12,0.01 -43.12,-12.71 -43.12,-12.78 C-42.99,-15.97 -40.37,-18.51 -37.16,-18.51c "
+                    android:valueType="pathType">
+                    <aapt:attr name="android:interpolator">
+                        <pathInterpolator android:pathData="M 0.0,0.0 c0.333,0 0.667,1 1.0,1.0" />
+                    </aapt:attr>
+                </objectAnimator>
+                <objectAnimator
+                    android:duration="417"
+                    android:propertyName="pathData"
+                    android:startOffset="2133"
+                    android:valueFrom="M-37.16 -18.51 C-33.94,-18.51 -31.32,-15.96 -31.2,-12.77 C-31.2,-12.7 -31.2,0.02 -31.2,0.09 C-31.2,0.16 -31.2,13.16 -31.2,13.23 C-31.31,16.43 -33.94,18.99 -37.16,18.99 C-40.39,18.99 -43.01,16.43 -43.12,13.23 C-43.12,13.16 -43.12,0.16 -43.12,0.09 C-43.12,0.01 -43.12,-12.71 -43.12,-12.78 C-42.99,-15.97 -40.37,-18.51 -37.16,-18.51c "
+                    android:valueTo="M-37.16 -5.87 C-33.94,-5.87 -31.32,-3.32 -31.2,-0.13 C-31.2,-0.06 -31.2,0.02 -31.2,0.09 C-31.2,0.16 -31.2,0.23 -31.2,0.29 C-31.31,3.49 -33.94,6.05 -37.16,6.05 C-40.39,6.05 -43.01,3.49 -43.12,0.29 C-43.12,0.23 -43.12,0.16 -43.12,0.09 C-43.12,0.01 -43.12,-0.07 -43.12,-0.15 C-42.99,-3.33 -40.37,-5.87 -37.16,-5.87c "
+                    android:valueType="pathType">
+                    <aapt:attr name="android:interpolator">
+                        <pathInterpolator android:pathData="M 0.0,0.0 c0.333,0 0.667,1 1.0,1.0" />
+                    </aapt:attr>
+                </objectAnimator>
+            </set>
+        </aapt:attr>
+    </target>
+    <target android:name="_R_G_L_2_G_D_0_P_0">
+        <aapt:attr name="android:animation">
+            <set android:ordering="together">
+                <objectAnimator
+                    android:duration="433"
+                    android:propertyName="pathData"
+                    android:startOffset="0"
+                    android:valueFrom="M-37.16 -5.87 C-33.94,-5.87 -31.32,-3.32 -31.2,-0.13 C-31.2,-0.06 -31.2,0.02 -31.2,0.09 C-31.2,0.16 -31.2,0.23 -31.2,0.29 C-31.31,3.49 -33.94,6.05 -37.16,6.05 C-40.39,6.05 -43.01,3.49 -43.12,0.29 C-43.12,0.23 -43.12,0.16 -43.12,0.09 C-43.12,0.01 -43.12,-0.07 -43.12,-0.15 C-42.99,-3.33 -40.37,-5.87 -37.16,-5.87c "
+                    android:valueTo="M-37.16 -25.01 C-33.94,-25.01 -31.32,-22.46 -31.2,-19.27 C-31.2,-19.2 -31.2,0.02 -31.2,0.09 C-31.2,0.16 -31.2,19.54 -31.2,19.6 C-31.31,22.8 -33.94,25.36 -37.16,25.36 C-40.39,25.36 -43.01,22.8 -43.12,19.6 C-43.12,19.54 -43.12,0.16 -43.12,0.09 C-43.12,0.01 -43.12,-19.21 -43.12,-19.28 C-42.99,-22.47 -40.37,-25.01 -37.16,-25.01c "
+                    android:valueType="pathType">
+                    <aapt:attr name="android:interpolator">
+                        <pathInterpolator android:pathData="M 0.0,0.0 c0.333,0 0.667,1 1.0,1.0" />
+                    </aapt:attr>
+                </objectAnimator>
+                <objectAnimator
+                    android:duration="450"
+                    android:propertyName="pathData"
+                    android:startOffset="433"
+                    android:valueFrom="M-37.16 -25.01 C-33.94,-25.01 -31.32,-22.46 -31.2,-19.27 C-31.2,-19.2 -31.2,0.02 -31.2,0.09 C-31.2,0.16 -31.2,19.54 -31.2,19.6 C-31.31,22.8 -33.94,25.36 -37.16,25.36 C-40.39,25.36 -43.01,22.8 -43.12,19.6 C-43.12,19.54 -43.12,0.16 -43.12,0.09 C-43.12,0.01 -43.12,-19.21 -43.12,-19.28 C-42.99,-22.47 -40.37,-25.01 -37.16,-25.01c "
+                    android:valueTo="M-37.16 -15.76 C-33.94,-15.76 -31.32,-13.21 -31.2,-10.02 C-31.2,-9.95 -31.2,0.02 -31.2,0.09 C-31.2,0.16 -31.2,10.54 -31.2,10.61 C-31.31,13.8 -33.94,16.36 -37.16,16.36 C-40.39,16.36 -43.01,13.8 -43.12,10.6 C-43.12,10.54 -43.12,0.16 -43.12,0.09 C-43.12,0.01 -43.12,-9.96 -43.12,-10.03 C-42.99,-13.22 -40.37,-15.76 -37.16,-15.76c "
+                    android:valueType="pathType">
+                    <aapt:attr name="android:interpolator">
+                        <pathInterpolator android:pathData="M 0.0,0.0 c0.333,0 0.833,1 1.0,1.0" />
+                    </aapt:attr>
+                </objectAnimator>
+                <objectAnimator
+                    android:duration="417"
+                    android:propertyName="pathData"
+                    android:startOffset="883"
+                    android:valueFrom="M-37.16 -15.76 C-33.94,-15.76 -31.32,-13.21 -31.2,-10.02 C-31.2,-9.95 -31.2,0.02 -31.2,0.09 C-31.2,0.16 -31.2,10.54 -31.2,10.61 C-31.31,13.8 -33.94,16.36 -37.16,16.36 C-40.39,16.36 -43.01,13.8 -43.12,10.6 C-43.12,10.54 -43.12,0.16 -43.12,0.09 C-43.12,0.01 -43.12,-9.96 -43.12,-10.03 C-42.99,-13.22 -40.37,-15.76 -37.16,-15.76c "
+                    android:valueTo="M-37.16 -25.01 C-33.94,-25.01 -31.32,-22.46 -31.2,-19.27 C-31.2,-19.2 -31.2,0.02 -31.2,0.09 C-31.2,0.16 -31.2,19.54 -31.2,19.6 C-31.31,22.8 -33.94,25.36 -37.16,25.36 C-40.39,25.36 -43.01,22.8 -43.12,19.6 C-43.12,19.54 -43.12,0.16 -43.12,0.09 C-43.12,0.01 -43.12,-19.21 -43.12,-19.28 C-42.99,-22.47 -40.37,-25.01 -37.16,-25.01c "
+                    android:valueType="pathType">
+                    <aapt:attr name="android:interpolator">
+                        <pathInterpolator android:pathData="M 0.0,0.0 c0.167,0 0.667,1 1.0,1.0" />
+                    </aapt:attr>
+                </objectAnimator>
+                <objectAnimator
+                    android:duration="467"
+                    android:propertyName="pathData"
+                    android:startOffset="1300"
+                    android:valueFrom="M-37.16 -25.01 C-33.94,-25.01 -31.32,-22.46 -31.2,-19.27 C-31.2,-19.2 -31.2,0.02 -31.2,0.09 C-31.2,0.16 -31.2,19.54 -31.2,19.6 C-31.31,22.8 -33.94,25.36 -37.16,25.36 C-40.39,25.36 -43.01,22.8 -43.12,19.6 C-43.12,19.54 -43.12,0.16 -43.12,0.09 C-43.12,0.01 -43.12,-19.21 -43.12,-19.28 C-42.99,-22.47 -40.37,-25.01 -37.16,-25.01c "
+                    android:valueTo="M-37.16 -15.76 C-33.94,-15.76 -31.32,-13.21 -31.2,-10.02 C-31.2,-9.95 -31.2,0.02 -31.2,0.09 C-31.2,0.16 -31.2,10.54 -31.2,10.61 C-31.31,13.8 -33.94,16.36 -37.16,16.36 C-40.39,16.36 -43.01,13.8 -43.12,10.6 C-43.12,10.54 -43.12,0.16 -43.12,0.09 C-43.12,0.01 -43.12,-9.96 -43.12,-10.03 C-42.99,-13.22 -40.37,-15.76 -37.16,-15.76c "
+                    android:valueType="pathType">
+                    <aapt:attr name="android:interpolator">
+                        <pathInterpolator android:pathData="M 0.0,0.0 c0.333,0 0.833,1 1.0,1.0" />
+                    </aapt:attr>
+                </objectAnimator>
+                <objectAnimator
+                    android:duration="433"
+                    android:propertyName="pathData"
+                    android:startOffset="1767"
+                    android:valueFrom="M-37.16 -15.76 C-33.94,-15.76 -31.32,-13.21 -31.2,-10.02 C-31.2,-9.95 -31.2,0.02 -31.2,0.09 C-31.2,0.16 -31.2,10.54 -31.2,10.61 C-31.31,13.8 -33.94,16.36 -37.16,16.36 C-40.39,16.36 -43.01,13.8 -43.12,10.6 C-43.12,10.54 -43.12,0.16 -43.12,0.09 C-43.12,0.01 -43.12,-9.96 -43.12,-10.03 C-42.99,-13.22 -40.37,-15.76 -37.16,-15.76c "
+                    android:valueTo="M-37.16 -25.01 C-33.94,-25.01 -31.32,-22.46 -31.2,-19.27 C-31.2,-19.2 -31.2,0.02 -31.2,0.09 C-31.2,0.16 -31.2,19.54 -31.2,19.6 C-31.31,22.8 -33.94,25.36 -37.16,25.36 C-40.39,25.36 -43.01,22.8 -43.12,19.6 C-43.12,19.54 -43.12,0.16 -43.12,0.09 C-43.12,0.01 -43.12,-19.21 -43.12,-19.28 C-42.99,-22.47 -40.37,-25.01 -37.16,-25.01c "
+                    android:valueType="pathType">
+                    <aapt:attr name="android:interpolator">
+                        <pathInterpolator android:pathData="M 0.0,0.0 c0.167,0 0.667,1 1.0,1.0" />
+                    </aapt:attr>
+                </objectAnimator>
+                <objectAnimator
+                    android:duration="350"
+                    android:propertyName="pathData"
+                    android:startOffset="2200"
+                    android:valueFrom="M-37.16 -25.01 C-33.94,-25.01 -31.32,-22.46 -31.2,-19.27 C-31.2,-19.2 -31.2,0.02 -31.2,0.09 C-31.2,0.16 -31.2,19.54 -31.2,19.6 C-31.31,22.8 -33.94,25.36 -37.16,25.36 C-40.39,25.36 -43.01,22.8 -43.12,19.6 C-43.12,19.54 -43.12,0.16 -43.12,0.09 C-43.12,0.01 -43.12,-19.21 -43.12,-19.28 C-42.99,-22.47 -40.37,-25.01 -37.16,-25.01c "
+                    android:valueTo="M-37.16 -5.87 C-33.94,-5.87 -31.32,-3.32 -31.2,-0.13 C-31.2,-0.06 -31.2,0.02 -31.2,0.09 C-31.2,0.16 -31.2,0.23 -31.2,0.29 C-31.31,3.49 -33.94,6.05 -37.16,6.05 C-40.39,6.05 -43.01,3.49 -43.12,0.29 C-43.12,0.23 -43.12,0.16 -43.12,0.09 C-43.12,0.01 -43.12,-0.07 -43.12,-0.15 C-42.99,-3.33 -40.37,-5.87 -37.16,-5.87c "
+                    android:valueType="pathType">
+                    <aapt:attr name="android:interpolator">
+                        <pathInterpolator android:pathData="M 0.0,0.0 c0.333,0 0.667,1 1.0,1.0" />
+                    </aapt:attr>
+                </objectAnimator>
+            </set>
+        </aapt:attr>
+    </target>
+    <target android:name="_R_G_L_1_G_D_0_P_0">
+        <aapt:attr name="android:animation">
+            <set android:ordering="together">
+                <objectAnimator
+                    android:duration="500"
+                    android:propertyName="pathData"
+                    android:startOffset="0"
+                    android:valueFrom="M-37.16 -5.87 C-33.94,-5.87 -31.32,-3.32 -31.2,-0.13 C-31.2,-0.06 -31.2,0.02 -31.2,0.09 C-31.2,0.16 -31.2,0.23 -31.2,0.29 C-31.31,3.49 -33.94,6.05 -37.16,6.05 C-40.39,6.05 -43.01,3.49 -43.12,0.29 C-43.12,0.23 -43.12,0.16 -43.12,0.09 C-43.12,0.01 -43.12,-0.07 -43.12,-0.15 C-42.99,-3.33 -40.37,-5.87 -37.16,-5.87c "
+                    android:valueTo="M-37.16 -38.14 C-33.94,-38.14 -31.32,-35.58 -31.2,-32.39 C-31.2,-32.32 -31.2,0.02 -31.2,0.09 C-31.2,0.16 -31.2,32.04 -31.2,32.1 C-31.31,35.3 -33.94,37.86 -37.16,37.86 C-40.39,37.86 -43.01,35.3 -43.12,32.1 C-43.12,32.04 -43.12,0.16 -43.12,0.09 C-43.12,0.01 -43.12,-32.33 -43.12,-32.41 C-42.99,-35.59 -40.37,-38.14 -37.16,-38.14c "
+                    android:valueType="pathType">
+                    <aapt:attr name="android:interpolator">
+                        <pathInterpolator android:pathData="M 0.0,0.0 c0.333,0 0.667,1 1.0,1.0" />
+                    </aapt:attr>
+                </objectAnimator>
+                <objectAnimator
+                    android:duration="467"
+                    android:propertyName="pathData"
+                    android:startOffset="500"
+                    android:valueFrom="M-37.16 -38.14 C-33.94,-38.14 -31.32,-35.58 -31.2,-32.39 C-31.2,-32.32 -31.2,0.02 -31.2,0.09 C-31.2,0.16 -31.2,32.04 -31.2,32.1 C-31.31,35.3 -33.94,37.86 -37.16,37.86 C-40.39,37.86 -43.01,35.3 -43.12,32.1 C-43.12,32.04 -43.12,0.16 -43.12,0.09 C-43.12,0.01 -43.12,-32.33 -43.12,-32.41 C-42.99,-35.59 -40.37,-38.14 -37.16,-38.14c "
+                    android:valueTo="M-37.16 -19.01 C-33.94,-19.01 -31.32,-16.46 -31.2,-13.27 C-31.2,-13.2 -31.2,0.02 -31.2,0.09 C-31.2,0.16 -31.2,13.66 -31.2,13.73 C-31.31,16.93 -33.94,19.49 -37.16,19.49 C-40.39,19.49 -43.01,16.93 -43.12,13.73 C-43.12,13.66 -43.12,0.16 -43.12,0.09 C-43.12,0.01 -43.12,-13.21 -43.12,-13.28 C-42.99,-16.47 -40.37,-19.01 -37.16,-19.01c "
+                    android:valueType="pathType">
+                    <aapt:attr name="android:interpolator">
+                        <pathInterpolator android:pathData="M 0.0,0.0 c0.333,0 0.833,1 1.0,1.0" />
+                    </aapt:attr>
+                </objectAnimator>
+                <objectAnimator
+                    android:duration="383"
+                    android:propertyName="pathData"
+                    android:startOffset="967"
+                    android:valueFrom="M-37.16 -19.01 C-33.94,-19.01 -31.32,-16.46 -31.2,-13.27 C-31.2,-13.2 -31.2,0.02 -31.2,0.09 C-31.2,0.16 -31.2,13.66 -31.2,13.73 C-31.31,16.93 -33.94,19.49 -37.16,19.49 C-40.39,19.49 -43.01,16.93 -43.12,13.73 C-43.12,13.66 -43.12,0.16 -43.12,0.09 C-43.12,0.01 -43.12,-13.21 -43.12,-13.28 C-42.99,-16.47 -40.37,-19.01 -37.16,-19.01c "
+                    android:valueTo="M-37.16 -38.14 C-33.94,-38.14 -31.32,-35.58 -31.2,-32.39 C-31.2,-32.32 -31.2,0.02 -31.2,0.09 C-31.2,0.16 -31.2,32.04 -31.2,32.1 C-31.31,35.3 -33.94,37.86 -37.16,37.86 C-40.39,37.86 -43.01,35.3 -43.12,32.1 C-43.12,32.04 -43.12,0.16 -43.12,0.09 C-43.12,0.01 -43.12,-32.33 -43.12,-32.41 C-42.99,-35.59 -40.37,-38.14 -37.16,-38.14c "
+                    android:valueType="pathType">
+                    <aapt:attr name="android:interpolator">
+                        <pathInterpolator android:pathData="M 0.0,0.0 c0.167,0 0.667,1 1.0,1.0" />
+                    </aapt:attr>
+                </objectAnimator>
+                <objectAnimator
+                    android:duration="467"
+                    android:propertyName="pathData"
+                    android:startOffset="1350"
+                    android:valueFrom="M-37.16 -38.14 C-33.94,-38.14 -31.32,-35.58 -31.2,-32.39 C-31.2,-32.32 -31.2,0.02 -31.2,0.09 C-31.2,0.16 -31.2,32.04 -31.2,32.1 C-31.31,35.3 -33.94,37.86 -37.16,37.86 C-40.39,37.86 -43.01,35.3 -43.12,32.1 C-43.12,32.04 -43.12,0.16 -43.12,0.09 C-43.12,0.01 -43.12,-32.33 -43.12,-32.41 C-42.99,-35.59 -40.37,-38.14 -37.16,-38.14c "
+                    android:valueTo="M-37.16 -19.01 C-33.94,-19.01 -31.32,-16.46 -31.2,-13.27 C-31.2,-13.2 -31.2,0.02 -31.2,0.09 C-31.2,0.16 -31.2,13.66 -31.2,13.73 C-31.31,16.93 -33.94,19.49 -37.16,19.49 C-40.39,19.49 -43.01,16.93 -43.12,13.73 C-43.12,13.66 -43.12,0.16 -43.12,0.09 C-43.12,0.01 -43.12,-13.21 -43.12,-13.28 C-42.99,-16.47 -40.37,-19.01 -37.16,-19.01c "
+                    android:valueType="pathType">
+                    <aapt:attr name="android:interpolator">
+                        <pathInterpolator android:pathData="M 0.0,0.0 c0.333,0 0.833,1 1.0,1.0" />
+                    </aapt:attr>
+                </objectAnimator>
+                <objectAnimator
+                    android:duration="433"
+                    android:propertyName="pathData"
+                    android:startOffset="1817"
+                    android:valueFrom="M-37.16 -19.01 C-33.94,-19.01 -31.32,-16.46 -31.2,-13.27 C-31.2,-13.2 -31.2,0.02 -31.2,0.09 C-31.2,0.16 -31.2,13.66 -31.2,13.73 C-31.31,16.93 -33.94,19.49 -37.16,19.49 C-40.39,19.49 -43.01,16.93 -43.12,13.73 C-43.12,13.66 -43.12,0.16 -43.12,0.09 C-43.12,0.01 -43.12,-13.21 -43.12,-13.28 C-42.99,-16.47 -40.37,-19.01 -37.16,-19.01c "
+                    android:valueTo="M-37.16 -38.14 C-33.94,-38.14 -31.32,-35.58 -31.2,-32.39 C-31.2,-32.32 -31.2,0.02 -31.2,0.09 C-31.2,0.16 -31.2,32.04 -31.2,32.1 C-31.31,35.3 -33.94,37.86 -37.16,37.86 C-40.39,37.86 -43.01,35.3 -43.12,32.1 C-43.12,32.04 -43.12,0.16 -43.12,0.09 C-43.12,0.01 -43.12,-32.33 -43.12,-32.41 C-42.99,-35.59 -40.37,-38.14 -37.16,-38.14c "
+                    android:valueType="pathType">
+                    <aapt:attr name="android:interpolator">
+                        <pathInterpolator android:pathData="M 0.0,0.0 c0.167,0 0.667,1 1.0,1.0" />
+                    </aapt:attr>
+                </objectAnimator>
+                <objectAnimator
+                    android:duration="300"
+                    android:propertyName="pathData"
+                    android:startOffset="2250"
+                    android:valueFrom="M-37.16 -38.14 C-33.94,-38.14 -31.32,-35.58 -31.2,-32.39 C-31.2,-32.32 -31.2,0.02 -31.2,0.09 C-31.2,0.16 -31.2,32.04 -31.2,32.1 C-31.31,35.3 -33.94,37.86 -37.16,37.86 C-40.39,37.86 -43.01,35.3 -43.12,32.1 C-43.12,32.04 -43.12,0.16 -43.12,0.09 C-43.12,0.01 -43.12,-32.33 -43.12,-32.41 C-42.99,-35.59 -40.37,-38.14 -37.16,-38.14c "
+                    android:valueTo="M-37.16 -5.87 C-33.94,-5.87 -31.32,-3.32 -31.2,-0.13 C-31.2,-0.06 -31.2,0.02 -31.2,0.09 C-31.2,0.16 -31.2,0.23 -31.2,0.29 C-31.31,3.49 -33.94,6.05 -37.16,6.05 C-40.39,6.05 -43.01,3.49 -43.12,0.29 C-43.12,0.23 -43.12,0.16 -43.12,0.09 C-43.12,0.01 -43.12,-0.07 -43.12,-0.15 C-42.99,-3.33 -40.37,-5.87 -37.16,-5.87c "
+                    android:valueType="pathType">
+                    <aapt:attr name="android:interpolator">
+                        <pathInterpolator android:pathData="M 0.0,0.0 c0.333,0 0.667,1 1.0,1.0" />
+                    </aapt:attr>
+                </objectAnimator>
+            </set>
+        </aapt:attr>
+    </target>
+    <target android:name="_R_G_L_0_G_D_0_P_0">
+        <aapt:attr name="android:animation">
+            <set android:ordering="together">
+                <objectAnimator
+                    android:duration="533"
+                    android:propertyName="pathData"
+                    android:startOffset="0"
+                    android:valueFrom="M-37.16 -5.87 C-33.94,-5.87 -31.32,-3.32 -31.2,-0.13 C-31.2,-0.06 -31.2,0.02 -31.2,0.09 C-31.2,0.16 -31.2,0.23 -31.2,0.29 C-31.31,3.49 -33.94,6.05 -37.16,6.05 C-40.39,6.05 -43.01,3.49 -43.12,0.29 C-43.12,0.23 -43.12,0.16 -43.12,0.09 C-43.12,0.01 -43.12,-0.07 -43.12,-0.15 C-42.99,-3.33 -40.37,-5.87 -37.16,-5.87c "
+                    android:valueTo="M-37.16 -22.64 C-33.94,-22.64 -31.32,-20.08 -31.2,-16.89 C-31.2,-16.82 -31.2,0.02 -31.2,0.09 C-31.2,0.16 -31.2,17.41 -31.2,17.48 C-31.31,20.68 -33.94,23.24 -37.16,23.24 C-40.39,23.24 -43.01,20.68 -43.12,17.48 C-43.12,17.41 -43.12,0.16 -43.12,0.09 C-43.12,0.01 -43.12,-16.83 -43.12,-16.91 C-42.99,-20.09 -40.37,-22.64 -37.16,-22.64c "
+                    android:valueType="pathType">
+                    <aapt:attr name="android:interpolator">
+                        <pathInterpolator android:pathData="M 0.0,0.0 c0.333,0 0.667,1 1.0,1.0" />
+                    </aapt:attr>
+                </objectAnimator>
+                <objectAnimator
+                    android:duration="433"
+                    android:propertyName="pathData"
+                    android:startOffset="533"
+                    android:valueFrom="M-37.16 -22.64 C-33.94,-22.64 -31.32,-20.08 -31.2,-16.89 C-31.2,-16.82 -31.2,0.02 -31.2,0.09 C-31.2,0.16 -31.2,17.41 -31.2,17.48 C-31.31,20.68 -33.94,23.24 -37.16,23.24 C-40.39,23.24 -43.01,20.68 -43.12,17.48 C-43.12,17.41 -43.12,0.16 -43.12,0.09 C-43.12,0.01 -43.12,-16.83 -43.12,-16.91 C-42.99,-20.09 -40.37,-22.64 -37.16,-22.64c "
+                    android:valueTo="M-37.18 -14.01 C-33.96,-14.01 -31.33,-11.46 -31.22,-8.27 C-31.22,-8.2 -31.2,0.02 -31.2,0.09 C-31.2,0.16 -31.2,8.54 -31.2,8.61 C-31.31,11.8 -33.94,14.36 -37.16,14.36 C-40.39,14.36 -43.01,11.8 -43.12,8.6 C-43.12,8.54 -43.12,0.16 -43.12,0.09 C-43.12,0.01 -43.14,-8.21 -43.13,-8.28 C-43.01,-11.47 -40.39,-14.01 -37.18,-14.01c "
+                    android:valueType="pathType">
+                    <aapt:attr name="android:interpolator">
+                        <pathInterpolator android:pathData="M 0.0,0.0 c0.333,0 0.833,1 1.0,1.0" />
+                    </aapt:attr>
+                </objectAnimator>
+                <objectAnimator
+                    android:duration="417"
+                    android:propertyName="pathData"
+                    android:startOffset="967"
+                    android:valueFrom="M-37.18 -14.01 C-33.96,-14.01 -31.33,-11.46 -31.22,-8.27 C-31.22,-8.2 -31.2,0.02 -31.2,0.09 C-31.2,0.16 -31.2,8.54 -31.2,8.61 C-31.31,11.8 -33.94,14.36 -37.16,14.36 C-40.39,14.36 -43.01,11.8 -43.12,8.6 C-43.12,8.54 -43.12,0.16 -43.12,0.09 C-43.12,0.01 -43.14,-8.21 -43.13,-8.28 C-43.01,-11.47 -40.39,-14.01 -37.18,-14.01c "
+                    android:valueTo="M-37.16 -22.64 C-33.94,-22.64 -31.32,-20.08 -31.2,-16.89 C-31.2,-16.82 -31.2,0.02 -31.2,0.09 C-31.2,0.16 -31.2,17.41 -31.2,17.48 C-31.31,20.68 -33.94,23.24 -37.16,23.24 C-40.39,23.24 -43.01,20.68 -43.12,17.48 C-43.12,17.41 -43.12,0.16 -43.12,0.09 C-43.12,0.01 -43.12,-16.83 -43.12,-16.91 C-42.99,-20.09 -40.37,-22.64 -37.16,-22.64c "
+                    android:valueType="pathType">
+                    <aapt:attr name="android:interpolator">
+                        <pathInterpolator android:pathData="M 0.0,0.0 c0.167,0 0.667,1 1.0,1.0" />
+                    </aapt:attr>
+                </objectAnimator>
+                <objectAnimator
+                    android:duration="483"
+                    android:propertyName="pathData"
+                    android:startOffset="1383"
+                    android:valueFrom="M-37.16 -22.64 C-33.94,-22.64 -31.32,-20.08 -31.2,-16.89 C-31.2,-16.82 -31.2,0.02 -31.2,0.09 C-31.2,0.16 -31.2,17.41 -31.2,17.48 C-31.31,20.68 -33.94,23.24 -37.16,23.24 C-40.39,23.24 -43.01,20.68 -43.12,17.48 C-43.12,17.41 -43.12,0.16 -43.12,0.09 C-43.12,0.01 -43.12,-16.83 -43.12,-16.91 C-42.99,-20.09 -40.37,-22.64 -37.16,-22.64c "
+                    android:valueTo="M-37.18 -14.01 C-33.96,-14.01 -31.33,-11.46 -31.22,-8.27 C-31.22,-8.2 -31.2,0.02 -31.2,0.09 C-31.2,0.16 -31.2,8.54 -31.2,8.61 C-31.31,11.8 -33.94,14.36 -37.16,14.36 C-40.39,14.36 -43.01,11.8 -43.12,8.6 C-43.12,8.54 -43.12,0.16 -43.12,0.09 C-43.12,0.01 -43.14,-8.21 -43.13,-8.28 C-43.01,-11.47 -40.39,-14.01 -37.18,-14.01c "
+                    android:valueType="pathType">
+                    <aapt:attr name="android:interpolator">
+                        <pathInterpolator android:pathData="M 0.0,0.0 c0.333,0 0.833,1 1.0,1.0" />
+                    </aapt:attr>
+                </objectAnimator>
+                <objectAnimator
+                    android:duration="417"
+                    android:propertyName="pathData"
+                    android:startOffset="1867"
+                    android:valueFrom="M-37.18 -14.01 C-33.96,-14.01 -31.33,-11.46 -31.22,-8.27 C-31.22,-8.2 -31.2,0.02 -31.2,0.09 C-31.2,0.16 -31.2,8.54 -31.2,8.61 C-31.31,11.8 -33.94,14.36 -37.16,14.36 C-40.39,14.36 -43.01,11.8 -43.12,8.6 C-43.12,8.54 -43.12,0.16 -43.12,0.09 C-43.12,0.01 -43.14,-8.21 -43.13,-8.28 C-43.01,-11.47 -40.39,-14.01 -37.18,-14.01c "
+                    android:valueTo="M-37.16 -22.64 C-33.94,-22.64 -31.32,-20.08 -31.2,-16.89 C-31.2,-16.82 -31.2,0.02 -31.2,0.09 C-31.2,0.16 -31.2,17.41 -31.2,17.48 C-31.31,20.68 -33.94,23.24 -37.16,23.24 C-40.39,23.24 -43.01,20.68 -43.12,17.48 C-43.12,17.41 -43.12,0.16 -43.12,0.09 C-43.12,0.01 -43.12,-16.83 -43.12,-16.91 C-42.99,-20.09 -40.37,-22.64 -37.16,-22.64c "
+                    android:valueType="pathType">
+                    <aapt:attr name="android:interpolator">
+                        <pathInterpolator android:pathData="M 0.0,0.0 c0.167,0 0.667,1 1.0,1.0" />
+                    </aapt:attr>
+                </objectAnimator>
+                <objectAnimator
+                    android:duration="267"
+                    android:propertyName="pathData"
+                    android:startOffset="2283"
+                    android:valueFrom="M-37.16 -22.64 C-33.94,-22.64 -31.32,-20.08 -31.2,-16.89 C-31.2,-16.82 -31.2,0.02 -31.2,0.09 C-31.2,0.16 -31.2,17.41 -31.2,17.48 C-31.31,20.68 -33.94,23.24 -37.16,23.24 C-40.39,23.24 -43.01,20.68 -43.12,17.48 C-43.12,17.41 -43.12,0.16 -43.12,0.09 C-43.12,0.01 -43.12,-16.83 -43.12,-16.91 C-42.99,-20.09 -40.37,-22.64 -37.16,-22.64c "
+                    android:valueTo="M-37.16 -5.87 C-33.94,-5.87 -31.32,-3.32 -31.2,-0.13 C-31.2,-0.06 -31.2,0.02 -31.2,0.09 C-31.2,0.16 -31.2,0.23 -31.2,0.29 C-31.31,3.49 -33.94,6.05 -37.16,6.05 C-40.39,6.05 -43.01,3.49 -43.12,0.29 C-43.12,0.23 -43.12,0.16 -43.12,0.09 C-43.12,0.01 -43.12,-0.07 -43.12,-0.15 C-42.99,-3.33 -40.37,-5.87 -37.16,-5.87c "
+                    android:valueType="pathType">
+                    <aapt:attr name="android:interpolator">
+                        <pathInterpolator android:pathData="M 0.0,0.0 c0.333,0 0.667,1 1.0,1.0" />
+                    </aapt:attr>
+                </objectAnimator>
+            </set>
+        </aapt:attr>
+    </target>
+    <target android:name="time_group">
+        <aapt:attr name="android:animation">
+            <set android:ordering="together">
+                <objectAnimator
+                    android:duration="2567"
+                    android:propertyName="translateX"
+                    android:startOffset="0"
+                    android:valueFrom="0"
+                    android:valueTo="1"
+                    android:valueType="floatType" />
+            </set>
+        </aapt:attr>
+    </target>
+    <aapt:attr name="android:drawable">
+        <vector
+            android:width="168dp"
+            android:height="168dp"
+            android:viewportHeight="168"
+            android:viewportWidth="168">
+            <group android:name="_R_G">
+                <group
+                    android:name="_R_G_L_4_G"
+                    android:translateX="84.411"
+                    android:translateY="83.911">
+                    <path
+                        android:name="_R_G_L_4_G_D_0_P_0"
+                        android:fillAlpha="1"
+                        android:fillColor="#ffffff"
+                        android:fillType="nonZero"
+                        android:pathData=" M-37.16 -5.87 C-33.94,-5.87 -31.32,-3.32 -31.2,-0.13 C-31.2,-0.06 -31.2,0.02 -31.2,0.09 C-31.2,0.16 -31.2,0.23 -31.2,0.29 C-31.31,3.49 -33.94,6.05 -37.16,6.05 C-40.39,6.05 -43.01,3.49 -43.12,0.29 C-43.12,0.23 -43.12,0.16 -43.12,0.09 C-43.12,0.01 -43.12,-0.07 -43.12,-0.15 C-42.99,-3.33 -40.37,-5.87 -37.16,-5.87c " />
+                </group>
+                <group
+                    android:name="_R_G_L_3_G"
+                    android:translateX="121.161"
+                    android:translateY="83.911">
+                    <path
+                        android:name="_R_G_L_3_G_D_0_P_0"
+                        android:fillAlpha="1"
+                        android:fillColor="#ffffff"
+                        android:fillType="nonZero"
+                        android:pathData=" M-37.16 -5.87 C-33.94,-5.87 -31.32,-3.32 -31.2,-0.13 C-31.2,-0.06 -31.2,0.02 -31.2,0.09 C-31.2,0.16 -31.2,0.23 -31.2,0.29 C-31.31,3.49 -33.94,6.05 -37.16,6.05 C-40.39,6.05 -43.01,3.49 -43.12,0.29 C-43.12,0.23 -43.12,0.16 -43.12,0.09 C-43.12,0.01 -43.12,-0.07 -43.12,-0.15 C-42.99,-3.33 -40.37,-5.87 -37.16,-5.87c " />
+                </group>
+                <group
+                    android:name="_R_G_L_2_G"
+                    android:translateX="102.911"
+                    android:translateY="83.911">
+                    <path
+                        android:name="_R_G_L_2_G_D_0_P_0"
+                        android:fillAlpha="1"
+                        android:fillColor="#ffffff"
+                        android:fillType="nonZero"
+                        android:pathData=" M-37.16 -5.87 C-33.94,-5.87 -31.32,-3.32 -31.2,-0.13 C-31.2,-0.06 -31.2,0.02 -31.2,0.09 C-31.2,0.16 -31.2,0.23 -31.2,0.29 C-31.31,3.49 -33.94,6.05 -37.16,6.05 C-40.39,6.05 -43.01,3.49 -43.12,0.29 C-43.12,0.23 -43.12,0.16 -43.12,0.09 C-43.12,0.01 -43.12,-0.07 -43.12,-0.15 C-42.99,-3.33 -40.37,-5.87 -37.16,-5.87c " />
+                </group>
+                <group
+                    android:name="_R_G_L_1_G"
+                    android:translateX="139.661"
+                    android:translateY="83.911">
+                    <path
+                        android:name="_R_G_L_1_G_D_0_P_0"
+                        android:fillAlpha="1"
+                        android:fillColor="#ffffff"
+                        android:fillType="nonZero"
+                        android:pathData=" M-37.16 -5.87 C-33.94,-5.87 -31.32,-3.32 -31.2,-0.13 C-31.2,-0.06 -31.2,0.02 -31.2,0.09 C-31.2,0.16 -31.2,0.23 -31.2,0.29 C-31.31,3.49 -33.94,6.05 -37.16,6.05 C-40.39,6.05 -43.01,3.49 -43.12,0.29 C-43.12,0.23 -43.12,0.16 -43.12,0.09 C-43.12,0.01 -43.12,-0.07 -43.12,-0.15 C-42.99,-3.33 -40.37,-5.87 -37.16,-5.87c " />
+                </group>
+                <group
+                    android:name="_R_G_L_0_G"
+                    android:translateX="157.911"
+                    android:translateY="83.911">
+                    <path
+                        android:name="_R_G_L_0_G_D_0_P_0"
+                        android:fillAlpha="1"
+                        android:fillColor="#ffffff"
+                        android:fillType="nonZero"
+                        android:pathData=" M-37.16 -5.87 C-33.94,-5.87 -31.32,-3.32 -31.2,-0.13 C-31.2,-0.06 -31.2,0.02 -31.2,0.09 C-31.2,0.16 -31.2,0.23 -31.2,0.29 C-31.31,3.49 -33.94,6.05 -37.16,6.05 C-40.39,6.05 -43.01,3.49 -43.12,0.29 C-43.12,0.23 -43.12,0.16 -43.12,0.09 C-43.12,0.01 -43.12,-0.07 -43.12,-0.15 C-42.99,-3.33 -40.37,-5.87 -37.16,-5.87c " />
+                </group>
+            </group>
+            <group android:name="time_group" />
+        </vector>
+    </aapt:attr>
+</animated-vector>
\ No newline at end of file
diff --git a/packages/SystemUI/res/layout/volume_dialog.xml b/packages/SystemUI/res/layout/volume_dialog.xml
index 39a1f1f..ad56216 100644
--- a/packages/SystemUI/res/layout/volume_dialog.xml
+++ b/packages/SystemUI/res/layout/volume_dialog.xml
@@ -13,9 +13,7 @@
      See the License for the specific language governing permissions and
      limitations under the License.
 -->
-<FrameLayout
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:sysui="http://schemas.android.com/apk/res-auto"
+<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:androidprv="http://schemas.android.com/apk/prv/res/android"
     android:id="@+id/volume_dialog_container"
     android:layout_width="wrap_content"
@@ -96,16 +94,18 @@
                     android:paddingLeft="@dimen/volume_dialog_ringer_rows_padding"
                     android:paddingBottom="@dimen/volume_dialog_ringer_rows_padding"
                     android:paddingRight="@dimen/volume_dialog_ringer_rows_padding">
+
                     <com.android.keyguard.AlphaOptimizedImageButton
                         android:id="@+id/settings"
-                        android:src="@drawable/horizontal_ellipsis"
                         android:layout_width="@dimen/volume_dialog_tap_target_size"
                         android:layout_height="@dimen/volume_dialog_tap_target_size"
                         android:layout_gravity="center"
-                        android:contentDescription="@string/accessibility_volume_settings"
                         android:background="@drawable/ripple_drawable_20dp"
-                        android:tint="?androidprv:attr/colorAccent"
-                        android:soundEffectsEnabled="false" />
+                        android:contentDescription="@string/accessibility_volume_settings"
+                        android:scaleType="centerInside"
+                        android:soundEffectsEnabled="false"
+                        android:src="@drawable/horizontal_ellipsis"
+                        android:tint="?androidprv:attr/colorAccent" />
                 </FrameLayout>
             </LinearLayout>
 
diff --git a/packages/SystemUI/src/com/android/systemui/ambient/touch/ShadeTouchHandler.java b/packages/SystemUI/src/com/android/systemui/ambient/touch/ShadeTouchHandler.java
index 9ef9938..fcd7ef5 100644
--- a/packages/SystemUI/src/com/android/systemui/ambient/touch/ShadeTouchHandler.java
+++ b/packages/SystemUI/src/com/android/systemui/ambient/touch/ShadeTouchHandler.java
@@ -18,11 +18,15 @@
 
 import static com.android.systemui.ambient.touch.dagger.ShadeModule.NOTIFICATION_SHADE_GESTURE_INITIATION_HEIGHT;
 
+import android.app.DreamManager;
 import android.graphics.Rect;
 import android.graphics.Region;
 import android.view.GestureDetector;
 import android.view.MotionEvent;
 
+import androidx.annotation.NonNull;
+
+import com.android.systemui.Flags;
 import com.android.systemui.shade.ShadeViewController;
 import com.android.systemui.statusbar.phone.CentralSurfaces;
 
@@ -38,28 +42,39 @@
 public class ShadeTouchHandler implements TouchHandler {
     private final Optional<CentralSurfaces> mSurfaces;
     private final ShadeViewController mShadeViewController;
+    private final DreamManager mDreamManager;
     private final int mInitiationHeight;
 
+    /**
+     * Tracks whether or not we are capturing a given touch. Will be null before and after a touch.
+     */
+    private Boolean mCapture;
+
     @Inject
     ShadeTouchHandler(Optional<CentralSurfaces> centralSurfaces,
             ShadeViewController shadeViewController,
+            DreamManager dreamManager,
             @Named(NOTIFICATION_SHADE_GESTURE_INITIATION_HEIGHT) int initiationHeight) {
         mSurfaces = centralSurfaces;
         mShadeViewController = shadeViewController;
+        mDreamManager = dreamManager;
         mInitiationHeight = initiationHeight;
     }
 
     @Override
     public void onSessionStart(TouchSession session) {
-        if (mSurfaces.map(CentralSurfaces::isBouncerShowing).orElse(false)) {
+        if (mSurfaces.isEmpty()) {
             session.pop();
             return;
         }
 
-        session.registerInputListener(ev -> {
-            mShadeViewController.handleExternalTouch((MotionEvent) ev);
+        session.registerCallback(() -> mCapture = null);
 
+        session.registerInputListener(ev -> {
             if (ev instanceof MotionEvent) {
+                if (mCapture != null && mCapture) {
+                    sendTouchEvent((MotionEvent) ev);
+                }
                 if (((MotionEvent) ev).getAction() == MotionEvent.ACTION_UP) {
                     session.pop();
                 }
@@ -68,19 +83,41 @@
 
         session.registerGestureListener(new GestureDetector.SimpleOnGestureListener() {
             @Override
-            public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX,
+            public boolean onScroll(MotionEvent e1, @NonNull MotionEvent e2, float distanceX,
                     float distanceY) {
-                return true;
+                if (mCapture == null) {
+                    // Only capture swipes that are going downwards.
+                    mCapture = Math.abs(distanceY) > Math.abs(distanceX) && distanceY < 0;
+                    if (mCapture) {
+                        // Send the initial touches over, as the input listener has already
+                        // processed these touches.
+                        sendTouchEvent(e1);
+                        sendTouchEvent(e2);
+                    }
+                }
+                return mCapture;
             }
 
             @Override
-            public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX,
+            public boolean onFling(MotionEvent e1, @NonNull MotionEvent e2, float velocityX,
                     float velocityY) {
-                return true;
+                return mCapture;
             }
         });
     }
 
+    private void sendTouchEvent(MotionEvent event) {
+        if (Flags.communalHub() && !mDreamManager.isDreaming()) {
+            // Send touches to central surfaces only when on the glanceable hub while not dreaming.
+            // While sending touches where while dreaming will open the shade, the shade
+            // while closing if opened then closed in the same gesture.
+            mSurfaces.get().handleExternalShadeWindowTouch(event);
+        } else {
+            // Send touches to the shade view when dreaming.
+            mShadeViewController.handleExternalTouch(event);
+        }
+    }
+
     @Override
     public void getTouchInitiationRegion(Rect bounds, Region region, Rect exclusionRect) {
         final Rect outBounds = new Rect(bounds);
diff --git a/packages/SystemUI/src/com/android/systemui/qs/panels/ui/compose/PartitionedGridLayout.kt b/packages/SystemUI/src/com/android/systemui/qs/panels/ui/compose/PartitionedGridLayout.kt
index d600767..e1b21ef 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/panels/ui/compose/PartitionedGridLayout.kt
+++ b/packages/SystemUI/src/com/android/systemui/qs/panels/ui/compose/PartitionedGridLayout.kt
@@ -284,7 +284,7 @@
         Box(
             Modifier.fillMaxWidth()
                 .background(
-                    color = MaterialTheme.colorScheme.surfaceVariant,
+                    color = MaterialTheme.colorScheme.background,
                     alpha = { 1f },
                     shape = RoundedCornerShape(dimensionResource(R.dimen.qs_corner_radius))
                 )
diff --git a/packages/SystemUI/src/com/android/systemui/qs/panels/ui/compose/Tile.kt b/packages/SystemUI/src/com/android/systemui/qs/panels/ui/compose/Tile.kt
index f776bf0..e4fbb4b 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/panels/ui/compose/Tile.kt
+++ b/packages/SystemUI/src/com/android/systemui/qs/panels/ui/compose/Tile.kt
@@ -17,6 +17,8 @@
 package com.android.systemui.qs.panels.ui.compose
 
 import android.graphics.drawable.Animatable
+import android.service.quicksettings.Tile.STATE_ACTIVE
+import android.service.quicksettings.Tile.STATE_INACTIVE
 import android.text.TextUtils
 import androidx.appcompat.content.res.AppCompatResources
 import androidx.compose.animation.graphics.ExperimentalAnimationGraphicsApi
@@ -49,6 +51,7 @@
 import androidx.compose.material.icons.filled.Add
 import androidx.compose.material.icons.filled.Remove
 import androidx.compose.material3.Icon
+import androidx.compose.material3.MaterialTheme
 import androidx.compose.material3.Text
 import androidx.compose.runtime.Composable
 import androidx.compose.runtime.LaunchedEffect
@@ -75,14 +78,11 @@
 import androidx.compose.ui.unit.dp
 import androidx.lifecycle.compose.collectAsStateWithLifecycle
 import com.android.compose.animation.Expandable
-import com.android.compose.theme.colorAttr
 import com.android.systemui.common.shared.model.Icon
 import com.android.systemui.common.ui.compose.Icon
 import com.android.systemui.common.ui.compose.load
-import com.android.systemui.qs.panels.ui.viewmodel.ActiveTileColorAttributes
 import com.android.systemui.qs.panels.ui.viewmodel.AvailableEditActions
 import com.android.systemui.qs.panels.ui.viewmodel.EditTileViewModel
-import com.android.systemui.qs.panels.ui.viewmodel.TileColorAttributes
 import com.android.systemui.qs.panels.ui.viewmodel.TileUiState
 import com.android.systemui.qs.panels.ui.viewmodel.TileViewModel
 import com.android.systemui.qs.panels.ui.viewmodel.toUiState
@@ -108,10 +108,12 @@
         tile.state
             .mapLatest { it.toUiState() }
             .collectAsStateWithLifecycle(tile.currentState.toUiState())
+    val colors = TileDefaults.getColorForState(state.state)
+
     val context = LocalContext.current
 
     Expandable(
-        color = colorAttr(state.colors.background),
+        color = colors.background,
         shape = RoundedCornerShape(dimensionResource(R.dimen.qs_corner_radius)),
     ) {
         Row(
@@ -121,7 +123,7 @@
                         onClick = { tile.onClick(it) },
                         onLongClick = { tile.onLongClick(it) }
                     )
-                    .tileModifier(state.colors),
+                    .tileModifier(colors),
             verticalAlignment = Alignment.CenterVertically,
             horizontalArrangement = tileHorizontalArrangement(iconOnly),
         ) {
@@ -139,7 +141,7 @@
                 label = state.label.toString(),
                 secondaryLabel = state.secondaryLabel.toString(),
                 icon = icon,
-                colors = state.colors,
+                colors = colors,
                 iconOnly = iconOnly,
                 showLabels = showLabels,
             )
@@ -292,7 +294,7 @@
     modifier: Modifier = Modifier,
 ) {
     val label = tileViewModel.label.load() ?: tileViewModel.tileSpec.spec
-    val colors = ActiveTileColorAttributes
+    val colors = TileDefaults.inactiveTileColors()
 
     Row(
         modifier = modifier.tileModifier(colors).semantics { this.contentDescription = label },
@@ -361,10 +363,10 @@
 }
 
 @Composable
-private fun Modifier.tileModifier(colors: TileColorAttributes): Modifier {
+private fun Modifier.tileModifier(colors: TileColors): Modifier {
     return fillMaxWidth()
         .clip(RoundedCornerShape(dimensionResource(R.dimen.qs_corner_radius)))
-        .background(colorAttr(colors.background))
+        .background(colors.background)
         .padding(horizontal = dimensionResource(id = R.dimen.qs_label_container_margin))
 }
 
@@ -387,7 +389,7 @@
     label: String,
     secondaryLabel: String?,
     icon: Icon,
-    colors: TileColorAttributes,
+    colors: TileColors,
     iconOnly: Boolean,
     showLabels: Boolean = false,
     animateIconToEnd: Boolean = false,
@@ -397,13 +399,13 @@
         verticalArrangement = Arrangement.Center,
         modifier = Modifier.fillMaxHeight()
     ) {
-        TileIcon(icon, colorAttr(colors.icon), animateIconToEnd)
+        TileIcon(icon, colors.icon, animateIconToEnd)
 
         if (iconOnly && showLabels) {
             Text(
                 label,
                 maxLines = 2,
-                color = colorAttr(colors.label),
+                color = colors.label,
                 overflow = TextOverflow.Ellipsis,
                 textAlign = TextAlign.Center,
             )
@@ -414,13 +416,13 @@
         Column(verticalArrangement = Arrangement.Center, modifier = Modifier.fillMaxHeight()) {
             Text(
                 label,
-                color = colorAttr(colors.label),
+                color = colors.label,
                 modifier = Modifier.basicMarquee(),
             )
             if (!TextUtils.isEmpty(secondaryLabel)) {
                 Text(
                     secondaryLabel ?: "",
-                    color = colorAttr(colors.secondaryLabel),
+                    color = colors.secondaryLabel,
                     modifier = Modifier.basicMarquee(),
                 )
             }
@@ -431,12 +433,55 @@
 @Composable
 fun tileHeight(iconWithLabel: Boolean = false): Dp {
     return if (iconWithLabel) {
-        TileDimensions.IconTileWithLabelHeight
+        TileDefaults.IconTileWithLabelHeight
     } else {
         dimensionResource(id = R.dimen.qs_tile_height)
     }
 }
 
-private object TileDimensions {
+private data class TileColors(
+    val background: Color,
+    val label: Color,
+    val secondaryLabel: Color,
+    val icon: Color,
+)
+
+private object TileDefaults {
     val IconTileWithLabelHeight = 100.dp
+
+    @Composable
+    fun activeTileColors(): TileColors =
+        TileColors(
+            background = MaterialTheme.colorScheme.primary,
+            label = MaterialTheme.colorScheme.onPrimary,
+            secondaryLabel = MaterialTheme.colorScheme.onPrimary,
+            icon = MaterialTheme.colorScheme.onPrimary,
+        )
+
+    @Composable
+    fun inactiveTileColors(): TileColors =
+        TileColors(
+            background = MaterialTheme.colorScheme.surfaceVariant,
+            label = MaterialTheme.colorScheme.onSurfaceVariant,
+            secondaryLabel = MaterialTheme.colorScheme.onSurfaceVariant,
+            icon = MaterialTheme.colorScheme.onSurfaceVariant,
+        )
+
+    @Composable
+    fun unavailableTileColors(): TileColors =
+        TileColors(
+            background = MaterialTheme.colorScheme.surface,
+            label = MaterialTheme.colorScheme.onSurface,
+            secondaryLabel = MaterialTheme.colorScheme.onSurface,
+            icon = MaterialTheme.colorScheme.onSurface,
+        )
+
+    @Composable
+    fun getColorForState(state: Int): TileColors {
+        return when (state) {
+            STATE_ACTIVE -> activeTileColors()
+            STATE_INACTIVE -> inactiveTileColors()
+            else -> unavailableTileColors()
+        }
+    }
 }
diff --git a/packages/SystemUI/src/com/android/systemui/qs/panels/ui/viewmodel/TileColorAttributes.kt b/packages/SystemUI/src/com/android/systemui/qs/panels/ui/viewmodel/TileColorAttributes.kt
deleted file mode 100644
index 1290bf3..0000000
--- a/packages/SystemUI/src/com/android/systemui/qs/panels/ui/viewmodel/TileColorAttributes.kt
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Copyright (C) 2024 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.systemui.qs.panels.ui.viewmodel
-
-import android.service.quicksettings.Tile
-import androidx.annotation.AttrRes
-import com.android.systemui.plugins.qs.QSTile
-import com.android.systemui.res.R
-
-data class TileColorAttributes(
-    @AttrRes val background: Int = 0,
-    @AttrRes val label: Int = 0,
-    @AttrRes val secondaryLabel: Int = 0,
-    @AttrRes val icon: Int = 0,
-)
-
-val ActiveTileColorAttributes =
-    TileColorAttributes(
-        background = R.attr.shadeActive,
-        label = R.attr.onShadeActive,
-        secondaryLabel = R.attr.onShadeActiveVariant,
-        icon = R.attr.onShadeActive,
-    )
-
-val InactiveTileColorAttributes =
-    TileColorAttributes(
-        background = R.attr.shadeInactive,
-        label = R.attr.onShadeInactive,
-        secondaryLabel = R.attr.onShadeInactiveVariant,
-        icon = R.attr.onShadeInactiveVariant,
-    )
-
-val UnavailableTileColorAttributes =
-    TileColorAttributes(
-        background = R.attr.shadeDisabled,
-        label = R.attr.outline,
-        secondaryLabel = R.attr.outline,
-        icon = R.attr.outline,
-    )
-
-fun QSTile.State.colors(): TileColorAttributes =
-    when (state) {
-        Tile.STATE_UNAVAILABLE -> UnavailableTileColorAttributes
-        Tile.STATE_ACTIVE -> ActiveTileColorAttributes
-        Tile.STATE_INACTIVE -> InactiveTileColorAttributes
-        else -> TileColorAttributes()
-    }
diff --git a/packages/SystemUI/src/com/android/systemui/qs/panels/ui/viewmodel/TileUiState.kt b/packages/SystemUI/src/com/android/systemui/qs/panels/ui/viewmodel/TileUiState.kt
index 58d07c3..578a292 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/panels/ui/viewmodel/TileUiState.kt
+++ b/packages/SystemUI/src/com/android/systemui/qs/panels/ui/viewmodel/TileUiState.kt
@@ -22,7 +22,7 @@
 data class TileUiState(
     val label: CharSequence,
     val secondaryLabel: CharSequence,
-    val colors: TileColorAttributes,
+    val state: Int,
     val icon: Supplier<QSTile.Icon>,
 )
 
@@ -30,7 +30,7 @@
     return TileUiState(
         label ?: "",
         secondaryLabel ?: "",
-        colors(),
+        state,
         icon?.let { Supplier { icon } } ?: iconSupplier,
     )
 }
diff --git a/packages/SystemUI/src/com/android/systemui/shade/GlanceableHubContainerController.kt b/packages/SystemUI/src/com/android/systemui/shade/GlanceableHubContainerController.kt
index bf0843b..2def6c7 100644
--- a/packages/SystemUI/src/com/android/systemui/shade/GlanceableHubContainerController.kt
+++ b/packages/SystemUI/src/com/android/systemui/shade/GlanceableHubContainerController.kt
@@ -157,9 +157,15 @@
     private var anyBouncerShowing = false
 
     /**
-     * True if the shade is fully expanded, meaning the hub should not receive any touch input.
+     * True if the shade is fully expanded and the user is not interacting with it anymore, meaning
+     * the hub should not receive any touch input.
      *
-     * Tracks [ShadeInteractor.isAnyFullyExpanded].
+     * We need to not pause the touch handling lifecycle as soon as the shade opens because if the
+     * user swipes down, then back up without lifting their finger, the lifecycle will be paused
+     * then resumed, and resuming force-stops all active touch sessions. This means the shade will
+     * not receive the end of the gesture and will be stuck open.
+     *
+     * Based on [ShadeInteractor.isAnyFullyExpanded] and [ShadeInteractor.isUserInteracting].
      */
     private var shadeShowing = false
 
diff --git a/packages/SystemUI/src/com/android/systemui/shade/NotificationShadeWindowViewController.java b/packages/SystemUI/src/com/android/systemui/shade/NotificationShadeWindowViewController.java
index 6efa633..c01b7b6 100644
--- a/packages/SystemUI/src/com/android/systemui/shade/NotificationShadeWindowViewController.java
+++ b/packages/SystemUI/src/com/android/systemui/shade/NotificationShadeWindowViewController.java
@@ -138,6 +138,11 @@
     private final PanelExpansionInteractor mPanelExpansionInteractor;
     private final ShadeExpansionStateManager mShadeExpansionStateManager;
 
+    /**
+     * If {@code true}, an external touch sent in {@link #handleExternalTouch(MotionEvent)} has been
+     * intercepted and all future touch events for the gesture should be processed by this view.
+     */
+    private boolean mExternalTouchIntercepted = false;
     private boolean mIsTrackingBarGesture = false;
     private boolean mIsOcclusionTransitionRunning = false;
     private DisableSubpixelTextTransitionListener mDisableSubpixelTextTransitionListener;
@@ -255,11 +260,28 @@
     }
 
     /**
-     * Handle a touch event while dreaming by forwarding the event to the content view.
+     * Handle a touch event while dreaming or on the hub by forwarding the event to the content
+     * view.
+     * <p>
+     * Since important logic for handling touches lives in the dispatch/intercept phases, we
+     * simulate going through all of these stages before sending onTouchEvent if intercepted.
+     *
      * @param event The event to forward.
      */
-    public void handleDreamTouch(MotionEvent event) {
-        mView.dispatchTouchEvent(event);
+    public void handleExternalTouch(MotionEvent event) {
+        if (event.getActionMasked() == MotionEvent.ACTION_DOWN) {
+            mExternalTouchIntercepted = false;
+        }
+
+        if (!mView.dispatchTouchEvent(event)) {
+            return;
+        }
+        if (!mExternalTouchIntercepted) {
+            mExternalTouchIntercepted = mView.onInterceptTouchEvent(event);
+        }
+        if (mExternalTouchIntercepted) {
+            mView.onTouchEvent(event);
+        }
     }
 
     /** Inflates the {@link R.layout#status_bar_expanded} layout and sets it up. */
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/KeyboardShortcuts.java b/packages/SystemUI/src/com/android/systemui/statusbar/KeyboardShortcuts.java
index c742f641..5c4a63c 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/KeyboardShortcuts.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/KeyboardShortcuts.java
@@ -455,7 +455,7 @@
         if (mReceivedAppShortcutGroups == null || mReceivedImeShortcutGroups == null) {
             return;
         }
-        List<KeyboardShortcutGroup> shortcutGroups = mReceivedAppShortcutGroups;
+        List<KeyboardShortcutGroup> shortcutGroups = new ArrayList<>(mReceivedAppShortcutGroups);
         shortcutGroups.addAll(mReceivedImeShortcutGroups);
         mReceivedAppShortcutGroups = null;
         mReceivedImeShortcutGroups = null;
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/KeyguardIndicationController.java b/packages/SystemUI/src/com/android/systemui/statusbar/KeyguardIndicationController.java
index 47939ae..337ffa4 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/KeyguardIndicationController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/KeyguardIndicationController.java
@@ -20,6 +20,7 @@
 import static android.app.admin.DevicePolicyManager.DEVICE_OWNER_TYPE_FINANCED;
 import static android.app.admin.DevicePolicyResources.Strings.SystemUi.KEYGUARD_MANAGEMENT_DISCLOSURE;
 import static android.app.admin.DevicePolicyResources.Strings.SystemUi.KEYGUARD_NAMED_MANAGEMENT_DISCLOSURE;
+import static android.hardware.biometrics.BiometricFaceConstants.FACE_ACQUIRED_START;
 import static android.hardware.biometrics.BiometricFaceConstants.FACE_ACQUIRED_TOO_DARK;
 import static android.hardware.biometrics.BiometricFaceConstants.FACE_ERROR_TIMEOUT;
 import static android.hardware.biometrics.BiometricSourceType.FACE;
@@ -1296,6 +1297,12 @@
         @Override
         public void onBiometricAcquired(BiometricSourceType biometricSourceType, int acquireInfo) {
             if (biometricSourceType == FACE) {
+                if (acquireInfo == FACE_ACQUIRED_START) {
+                    // Let's hide any previous messages when authentication starts, otherwise
+                    // multiple auth attempts would overlap.
+                    hideBiometricMessage();
+                    mBiometricErrorMessageToShowOnScreenOn = null;
+                }
                 mFaceAcquiredMessageDeferral.processFrame(acquireInfo);
             }
         }
@@ -1485,13 +1492,6 @@
         @Override
         public void onBiometricRunningStateChanged(boolean running,
                 BiometricSourceType biometricSourceType) {
-            if (running && biometricSourceType == FACE) {
-                // Let's hide any previous messages when authentication starts, otherwise
-                // multiple auth attempts would overlap.
-                hideBiometricMessage();
-                mBiometricErrorMessageToShowOnScreenOn = null;
-            }
-
             if (!running && biometricSourceType == FACE) {
                 showTrustAgentErrorMessage(mTrustAgentErrorMessage);
             }
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfaces.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfaces.java
index 05a4391..7434891 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfaces.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfaces.java
@@ -288,11 +288,12 @@
     void awakenDreams();
 
     /**
-     * Handle a touch event while dreaming when the touch was initiated within a prescribed
-     * swipeable area. This method is provided for cases where swiping in certain areas of a dream
-     * should be handled by CentralSurfaces instead (e.g. swiping communal hub open).
+     * Handle a touch event while dreaming or on the glanceable hub when the touch was initiated
+     * within a prescribed swipeable area. This method is provided for cases where swiping in
+     * certain areas should be handled by CentralSurfaces instead (e.g. swiping hub open, opening
+     * the notification shade over dream or hub).
      */
-    void handleDreamTouch(MotionEvent event);
+    void handleExternalShadeWindowTouch(MotionEvent event);
 
     boolean isBouncerShowing();
 
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesEmptyImpl.kt b/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesEmptyImpl.kt
index a7b5484..906baa2 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesEmptyImpl.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesEmptyImpl.kt
@@ -80,7 +80,7 @@
     override fun updateScrimController() {}
     override fun shouldIgnoreTouch() = false
     override fun isDeviceInteractive() = false
-    override fun handleDreamTouch(event: MotionEvent?) {}
+    override fun handleExternalShadeWindowTouch(event: MotionEvent?) {}
     override fun handleCommunalHubTouch(event: MotionEvent?) {}
     override fun awakenDreams() {}
     override fun isBouncerShowing() = false
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java
index 7567f36..42680ab 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java
@@ -2954,8 +2954,8 @@
     };
 
     @Override
-    public void handleDreamTouch(MotionEvent event) {
-        getNotificationShadeWindowViewController().handleDreamTouch(event);
+    public void handleExternalShadeWindowTouch(MotionEvent event) {
+        getNotificationShadeWindowViewController().handleExternalTouch(event);
     }
 
     @Override
diff --git a/packages/SystemUI/src/com/android/systemui/volume/VolumeDialogImpl.java b/packages/SystemUI/src/com/android/systemui/volume/VolumeDialogImpl.java
index ce5545c..e613216 100644
--- a/packages/SystemUI/src/com/android/systemui/volume/VolumeDialogImpl.java
+++ b/packages/SystemUI/src/com/android/systemui/volume/VolumeDialogImpl.java
@@ -136,6 +136,7 @@
 import com.android.systemui.util.RoundedCornerProgressDrawable;
 import com.android.systemui.util.settings.SecureSettings;
 import com.android.systemui.volume.domain.interactor.VolumePanelNavigationInteractor;
+import com.android.systemui.volume.ui.binder.VolumeDialogMenuIconBinder;
 import com.android.systemui.volume.ui.navigation.VolumeNavigator;
 
 import dagger.Lazy;
@@ -311,6 +312,7 @@
     private int mDialogTimeoutMillis;
     private final VibratorHelper mVibratorHelper;
     private final com.android.systemui.util.time.SystemClock mSystemClock;
+    private final VolumeDialogMenuIconBinder mVolumeDialogMenuIconBinder;
 
     public VolumeDialogImpl(
             Context context,
@@ -329,6 +331,7 @@
             DumpManager dumpManager,
             Lazy<SecureSettings> secureSettings,
             VibratorHelper vibratorHelper,
+            VolumeDialogMenuIconBinder volumeDialogMenuIconBinder,
             com.android.systemui.util.time.SystemClock systemClock) {
         mContext =
                 new ContextThemeWrapper(context, R.style.volume_dialog_theme);
@@ -361,6 +364,7 @@
         mVolumePanelNavigationInteractor = volumePanelNavigationInteractor;
         mVolumeNavigator = volumeNavigator;
         mSecureSettings = secureSettings;
+        mVolumeDialogMenuIconBinder = volumeDialogMenuIconBinder;
         mDialogTimeoutMillis = DIALOG_TIMEOUT_MILLIS;
 
         dumpManager.registerDumpable("VolumeDialogImpl", this);
@@ -436,6 +440,7 @@
         if (mDevicePostureController != null) {
             mDevicePostureController.removeCallback(mDevicePostureControllerCallback);
         }
+        mVolumeDialogMenuIconBinder.destroy();
     }
 
     @Override
@@ -671,6 +676,7 @@
 
         mSettingsView = mDialog.findViewById(R.id.settings_container);
         mSettingsIcon = mDialog.findViewById(R.id.settings);
+        mVolumeDialogMenuIconBinder.bind(mSettingsIcon);
 
         if (mRows.isEmpty()) {
             if (!AudioSystem.isSingleVolume(mContext)) {
diff --git a/packages/SystemUI/src/com/android/systemui/volume/VolumeDialogModule.kt b/packages/SystemUI/src/com/android/systemui/volume/VolumeDialogModule.kt
new file mode 100644
index 0000000..54dc3db
--- /dev/null
+++ b/packages/SystemUI/src/com/android/systemui/volume/VolumeDialogModule.kt
@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.systemui.volume
+
+import com.android.systemui.volume.panel.shared.flag.VolumePanelFlag
+import com.android.systemui.volume.ui.viewmodel.AnimatedVolumeMenuIconViewModel
+import com.android.systemui.volume.ui.viewmodel.StaticVolumeMenuIconViewModel
+import com.android.systemui.volume.ui.viewmodel.VolumeMenuIconViewModel
+import dagger.Lazy
+import dagger.Module
+import dagger.Provides
+
+@Module
+interface VolumeDialogModule {
+
+    companion object {
+
+        @Provides
+        fun provideVolumeMenuIconViewModel(
+            volumePanelFlag: VolumePanelFlag,
+            static: Lazy<StaticVolumeMenuIconViewModel>,
+            animated: Lazy<AnimatedVolumeMenuIconViewModel>,
+        ): VolumeMenuIconViewModel {
+            return if (volumePanelFlag.canUseNewVolumePanel()) {
+                    animated
+                } else {
+                    static
+                }
+                .get()
+        }
+    }
+}
diff --git a/packages/SystemUI/src/com/android/systemui/volume/dagger/VolumeModule.java b/packages/SystemUI/src/com/android/systemui/volume/dagger/VolumeModule.java
index dc1e8cf..fd68bfb 100644
--- a/packages/SystemUI/src/com/android/systemui/volume/dagger/VolumeModule.java
+++ b/packages/SystemUI/src/com/android/systemui/volume/dagger/VolumeModule.java
@@ -38,11 +38,13 @@
 import com.android.systemui.volume.VolumeComponent;
 import com.android.systemui.volume.VolumeDialogComponent;
 import com.android.systemui.volume.VolumeDialogImpl;
+import com.android.systemui.volume.VolumeDialogModule;
 import com.android.systemui.volume.VolumePanelDialogReceiver;
 import com.android.systemui.volume.VolumeUI;
 import com.android.systemui.volume.domain.interactor.VolumePanelNavigationInteractor;
 import com.android.systemui.volume.panel.dagger.VolumePanelComponent;
 import com.android.systemui.volume.panel.dagger.factory.VolumePanelComponentFactory;
+import com.android.systemui.volume.ui.binder.VolumeDialogMenuIconBinder;
 import com.android.systemui.volume.ui.navigation.VolumeNavigator;
 
 import dagger.Binds;
@@ -61,6 +63,7 @@
                 CaptioningModule.class,
                 MediaDevicesModule.class,
                 SpatializerModule.class,
+                VolumeDialogModule.class,
         },
         subcomponents = {
                 VolumePanelComponent.class
@@ -112,6 +115,7 @@
             DumpManager dumpManager,
             Lazy<SecureSettings> secureSettings,
             VibratorHelper vibratorHelper,
+            VolumeDialogMenuIconBinder volumeDialogMenuIconBinder,
             SystemClock systemClock) {
         VolumeDialogImpl impl = new VolumeDialogImpl(
                 context,
@@ -130,6 +134,7 @@
                 dumpManager,
                 secureSettings,
                 vibratorHelper,
+                volumeDialogMenuIconBinder,
                 systemClock);
         impl.setStreamImportant(AudioManager.STREAM_SYSTEM, false);
         impl.setAutomute(true);
diff --git a/packages/SystemUI/src/com/android/systemui/volume/panel/component/mediaoutput/domain/interactor/MediaDeviceSessionInteractor.kt b/packages/SystemUI/src/com/android/systemui/volume/panel/component/mediaoutput/domain/interactor/MediaDeviceSessionInteractor.kt
index 6e1ebc8..12e624ca 100644
--- a/packages/SystemUI/src/com/android/systemui/volume/panel/component/mediaoutput/domain/interactor/MediaDeviceSessionInteractor.kt
+++ b/packages/SystemUI/src/com/android/systemui/volume/panel/component/mediaoutput/domain/interactor/MediaDeviceSessionInteractor.kt
@@ -19,10 +19,10 @@
 import android.media.session.MediaController
 import android.media.session.PlaybackState
 import com.android.settingslib.volume.data.repository.MediaControllerRepository
+import com.android.systemui.dagger.SysUISingleton
 import com.android.systemui.dagger.qualifiers.Background
 import com.android.systemui.volume.panel.component.mediaoutput.domain.model.MediaControllerChangeModel
 import com.android.systemui.volume.panel.component.mediaoutput.shared.model.MediaDeviceSession
-import com.android.systemui.volume.panel.dagger.scope.VolumePanelScope
 import javax.inject.Inject
 import kotlin.coroutines.CoroutineContext
 import kotlinx.coroutines.ExperimentalCoroutinesApi
@@ -38,7 +38,7 @@
 
 /** Allows to observe and change [MediaDeviceSession] state. */
 @OptIn(ExperimentalCoroutinesApi::class)
-@VolumePanelScope
+@SysUISingleton
 class MediaDeviceSessionInteractor
 @Inject
 constructor(
diff --git a/packages/SystemUI/src/com/android/systemui/volume/panel/component/mediaoutput/domain/interactor/MediaOutputInteractor.kt b/packages/SystemUI/src/com/android/systemui/volume/panel/component/mediaoutput/domain/interactor/MediaOutputInteractor.kt
index 31a8977..8282210 100644
--- a/packages/SystemUI/src/com/android/systemui/volume/panel/component/mediaoutput/domain/interactor/MediaOutputInteractor.kt
+++ b/packages/SystemUI/src/com/android/systemui/volume/panel/component/mediaoutput/domain/interactor/MediaOutputInteractor.kt
@@ -23,11 +23,12 @@
 import com.android.settingslib.media.MediaDevice
 import com.android.settingslib.volume.data.repository.LocalMediaRepository
 import com.android.settingslib.volume.data.repository.MediaControllerRepository
+import com.android.systemui.dagger.SysUISingleton
+import com.android.systemui.dagger.qualifiers.Application
 import com.android.systemui.dagger.qualifiers.Background
 import com.android.systemui.volume.panel.component.mediaoutput.data.repository.LocalMediaRepositoryFactory
 import com.android.systemui.volume.panel.component.mediaoutput.domain.model.MediaDeviceSessions
 import com.android.systemui.volume.panel.component.mediaoutput.shared.model.MediaDeviceSession
-import com.android.systemui.volume.panel.dagger.scope.VolumePanelScope
 import com.android.systemui.volume.panel.shared.model.Result
 import com.android.systemui.volume.panel.shared.model.filterData
 import com.android.systemui.volume.panel.shared.model.wrapInResult
@@ -52,13 +53,13 @@
 
 /** Provides observable models about the current media session state. */
 @OptIn(ExperimentalCoroutinesApi::class)
-@VolumePanelScope
+@SysUISingleton
 class MediaOutputInteractor
 @Inject
 constructor(
     private val localMediaRepositoryFactory: LocalMediaRepositoryFactory,
     private val packageManager: PackageManager,
-    @VolumePanelScope private val coroutineScope: CoroutineScope,
+    @Application private val coroutineScope: CoroutineScope,
     @Background private val backgroundCoroutineContext: CoroutineContext,
     mediaControllerRepository: MediaControllerRepository,
     private val mediaControllerInteractor: MediaControllerInteractor,
@@ -74,7 +75,7 @@
                     .onStart { emit(activeSessions) }
             }
             .map { getMediaControllers(it) }
-            .stateIn(coroutineScope, SharingStarted.Eagerly, MediaControllers(null, null))
+            .stateIn(coroutineScope, SharingStarted.WhileSubscribed(), MediaControllers(null, null))
 
     /** [MediaDeviceSessions] that contains currently active sessions. */
     val activeMediaDeviceSessions: Flow<MediaDeviceSessions> =
@@ -85,7 +86,11 @@
                     remote = it.remote?.mediaDeviceSession()
                 )
             }
-            .stateIn(coroutineScope, SharingStarted.Eagerly, MediaDeviceSessions(null, null))
+            .stateIn(
+                coroutineScope,
+                SharingStarted.WhileSubscribed(),
+                MediaDeviceSessions(null, null)
+            )
 
     /** Returns the default [MediaDeviceSession] from [activeMediaDeviceSessions] */
     val defaultActiveMediaSession: StateFlow<Result<MediaDeviceSession?>> =
@@ -100,7 +105,7 @@
             }
             .wrapInResult()
             .flowOn(backgroundCoroutineContext)
-            .stateIn(coroutineScope, SharingStarted.Eagerly, Result.Loading())
+            .stateIn(coroutineScope, SharingStarted.WhileSubscribed(), Result.Loading())
 
     private val localMediaRepository: Flow<LocalMediaRepository> =
         defaultActiveMediaSession
diff --git a/packages/SystemUI/src/com/android/systemui/volume/ui/binder/VolumeDialogMenuIconBinder.kt b/packages/SystemUI/src/com/android/systemui/volume/ui/binder/VolumeDialogMenuIconBinder.kt
new file mode 100644
index 0000000..a352e28
--- /dev/null
+++ b/packages/SystemUI/src/com/android/systemui/volume/ui/binder/VolumeDialogMenuIconBinder.kt
@@ -0,0 +1,79 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.systemui.volume.ui.binder
+
+import android.animation.ValueAnimator
+import android.graphics.drawable.Animatable2
+import android.widget.ImageView
+import androidx.core.animation.doOnEnd
+import com.android.systemui.common.shared.model.Icon
+import com.android.systemui.common.ui.binder.IconViewBinder
+import com.android.systemui.dagger.qualifiers.Application
+import com.android.systemui.statusbar.CrossFadeHelper
+import com.android.systemui.volume.ui.viewmodel.VolumeMenuIconViewModel
+import javax.inject.Inject
+import kotlin.coroutines.resume
+import kotlinx.coroutines.CoroutineScope
+import kotlinx.coroutines.Job
+import kotlinx.coroutines.flow.collectLatest
+import kotlinx.coroutines.launch
+import kotlinx.coroutines.suspendCancellableCoroutine
+
+/** Binds volume dialog menu button icon. */
+class VolumeDialogMenuIconBinder
+@Inject
+constructor(
+    @Application private val coroutineScope: CoroutineScope,
+    private val viewModel: VolumeMenuIconViewModel,
+) {
+
+    private var job: Job? = null
+
+    fun bind(iconImageView: ImageView?) {
+        job?.cancel()
+        job =
+            iconImageView?.let { imageView ->
+                coroutineScope.launch {
+                    viewModel.icon.collectLatest { icon ->
+                        animate { CrossFadeHelper.fadeOut(imageView, it) }
+                        IconViewBinder.bind(icon, imageView)
+                        if (icon is Icon.Loaded && icon.drawable is Animatable2) {
+                            icon.drawable.start()
+                        }
+                        animate { CrossFadeHelper.fadeIn(imageView, it) }
+                    }
+                }
+            }
+    }
+
+    private suspend fun animate(update: (value: Float) -> Unit) =
+        suspendCancellableCoroutine { continuation ->
+            val anim = ValueAnimator.ofFloat(0f, 1f)
+            anim.start()
+            anim.addUpdateListener { update(it.animatedValue as Float) }
+            anim.doOnEnd { continuation.resume(Unit) }
+            continuation.invokeOnCancellation {
+                anim.removeAllListeners()
+                anim.cancel()
+            }
+        }
+
+    fun destroy() {
+        job?.cancel()
+        job = null
+    }
+}
diff --git a/packages/SystemUI/src/com/android/systemui/volume/ui/viewmodel/VolumeMenuIconViewModel.kt b/packages/SystemUI/src/com/android/systemui/volume/ui/viewmodel/VolumeMenuIconViewModel.kt
new file mode 100644
index 0000000..0bd3adb
--- /dev/null
+++ b/packages/SystemUI/src/com/android/systemui/volume/ui/viewmodel/VolumeMenuIconViewModel.kt
@@ -0,0 +1,81 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.systemui.volume.ui.viewmodel
+
+import android.annotation.SuppressLint
+import android.content.Context
+import com.android.systemui.common.shared.model.Icon
+import com.android.systemui.dagger.qualifiers.Application
+import com.android.systemui.res.R
+import com.android.systemui.util.drawable.LoopedAnimatable2DrawableWrapper
+import com.android.systemui.volume.panel.component.mediaoutput.domain.interactor.MediaDeviceSessionInteractor
+import com.android.systemui.volume.panel.component.mediaoutput.domain.interactor.MediaOutputInteractor
+import com.android.systemui.volume.panel.shared.model.filterData
+import javax.inject.Inject
+import kotlinx.coroutines.ExperimentalCoroutinesApi
+import kotlinx.coroutines.flow.Flow
+import kotlinx.coroutines.flow.distinctUntilChangedBy
+import kotlinx.coroutines.flow.flatMapLatest
+import kotlinx.coroutines.flow.flowOf
+import kotlinx.coroutines.flow.mapLatest
+
+/** View Model that provides an icon for the menu button of the volume dialog. */
+interface VolumeMenuIconViewModel {
+
+    val icon: Flow<Icon>
+}
+
+@OptIn(ExperimentalCoroutinesApi::class)
+@SuppressLint("UseCompatLoadingForDrawables")
+class AnimatedVolumeMenuIconViewModel
+@Inject
+constructor(
+    @Application private val context: Context,
+    private val mediaOutputInteractor: MediaOutputInteractor,
+    private val mediaDeviceSessionInteractor: MediaDeviceSessionInteractor,
+) : VolumeMenuIconViewModel {
+
+    override val icon: Flow<Icon>
+        get() =
+            mediaOutputInteractor.defaultActiveMediaSession
+                .filterData()
+                .flatMapLatest { session ->
+                    if (session == null) {
+                        flowOf(null)
+                    } else {
+                        mediaDeviceSessionInteractor.playbackState(session)
+                    }
+                }
+                .distinctUntilChangedBy { it?.isActive }
+                .mapLatest { playbackState ->
+                    if (playbackState?.isActive == true) {
+                        Icon.Loaded(
+                            LoopedAnimatable2DrawableWrapper.fromDrawable(
+                                context.getDrawable(R.drawable.audio_bars_playing)!!
+                            ),
+                            null,
+                        )
+                    } else {
+                        Icon.Resource(R.drawable.horizontal_ellipsis, null)
+                    }
+                }
+}
+
+class StaticVolumeMenuIconViewModel @Inject constructor() : VolumeMenuIconViewModel {
+
+    override val icon: Flow<Icon> = flowOf(Icon.Resource(R.drawable.horizontal_ellipsis, null))
+}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/shade/NotificationShadeWindowViewControllerTest.kt b/packages/SystemUI/tests/src/com/android/systemui/shade/NotificationShadeWindowViewControllerTest.kt
index 4a867a8..586adbd 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/shade/NotificationShadeWindowViewControllerTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/shade/NotificationShadeWindowViewControllerTest.kt
@@ -519,6 +519,46 @@
     }
 
     @Test
+    fun handleExternalTouch_intercepted_sendsOnTouch() {
+        // Accept dispatch and also intercept.
+        whenever(view.dispatchTouchEvent(any())).thenReturn(true)
+        whenever(view.onInterceptTouchEvent(any())).thenReturn(true)
+
+        underTest.handleExternalTouch(DOWN_EVENT)
+        underTest.handleExternalTouch(MOVE_EVENT)
+
+        // Once intercepted, both events are sent to the view.
+        verify(view).onTouchEvent(DOWN_EVENT)
+        verify(view).onTouchEvent(MOVE_EVENT)
+    }
+
+    @Test
+    fun handleExternalTouch_notDispatched_interceptNotCalled() {
+        // Don't accept dispatch
+        whenever(view.dispatchTouchEvent(any())).thenReturn(false)
+
+        underTest.handleExternalTouch(DOWN_EVENT)
+
+        // Interception is not offered.
+        verify(view, never()).onInterceptTouchEvent(any())
+    }
+
+    @Test
+    fun handleExternalTouch_notIntercepted_onTouchNotSent() {
+        // Accept dispatch, but don't dispatch
+        whenever(view.dispatchTouchEvent(any())).thenReturn(true)
+        whenever(view.onInterceptTouchEvent(any())).thenReturn(false)
+
+        underTest.handleExternalTouch(DOWN_EVENT)
+        underTest.handleExternalTouch(MOVE_EVENT)
+
+        // Interception offered for both events, but onTouchEvent is never called.
+        verify(view).onInterceptTouchEvent(DOWN_EVENT)
+        verify(view).onInterceptTouchEvent(MOVE_EVENT)
+        verify(view, never()).onTouchEvent(any())
+    }
+
+    @Test
     fun testGetKeyguardMessageArea() =
         testScope.runTest {
             underTest.keyguardMessageArea
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/KeyboardShortcutsTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/KeyboardShortcutsTest.java
index 2b3f139..6ad8b8b 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/KeyboardShortcutsTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/KeyboardShortcutsTest.java
@@ -18,12 +18,16 @@
 
 import static com.google.common.truth.Truth.assertThat;
 
+import static org.mockito.ArgumentMatchers.eq;
 import static org.mockito.Mockito.any;
 import static org.mockito.Mockito.anyInt;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
 
+import static java.util.Collections.singletonList;
+
+import android.annotation.Nullable;
 import android.app.Dialog;
 import android.graphics.drawable.Icon;
 import android.os.Handler;
@@ -44,11 +48,13 @@
 import org.junit.runner.RunWith;
 import org.mockito.ArgumentCaptor;
 import org.mockito.Mock;
+import org.mockito.invocation.InvocationOnMock;
 import org.mockito.junit.MockitoJUnit;
 import org.mockito.junit.MockitoRule;
+import org.mockito.stubbing.Answer;
 
 import java.util.Arrays;
-import java.util.Collections;
+import java.util.List;
 
 @SmallTest
 @RunWith(AndroidJUnit4.class)
@@ -56,7 +62,7 @@
 
     @Rule public MockitoRule mockito = MockitoJUnit.rule();
 
-    private static int DEVICE_ID = 1;
+    private static final int DEVICE_ID = 1;
     private KeyboardShortcuts mKeyboardShortcuts;
 
     @Mock private Dialog mDialog;
@@ -66,26 +72,35 @@
     @Before
     public void setUp() {
         mKeyboardShortcuts = new KeyboardShortcuts(mContext, mWindowManager);
-        mKeyboardShortcuts.sInstance = mKeyboardShortcuts;
+        KeyboardShortcuts.sInstance = mKeyboardShortcuts;
         mKeyboardShortcuts.mKeyboardShortcutsDialog = mDialog;
         mKeyboardShortcuts.mContext = mContext;
         mKeyboardShortcuts.mBackgroundHandler = mHandler;
+        when(mHandler.post(any()))
+                .thenAnswer(
+                        new Answer<>() {
+                            @Override
+                            public Object answer(InvocationOnMock invocation) {
+                                ((Runnable) invocation.getArgument(0)).run();
+                                return null;
+                            }
+                        });
     }
 
     @Test
     public void toggle_isShowingTrue_instanceShouldBeNull() {
         when(mDialog.isShowing()).thenReturn(true);
 
-        mKeyboardShortcuts.toggle(mContext, DEVICE_ID);
+        KeyboardShortcuts.toggle(mContext, DEVICE_ID);
 
-        assertThat(mKeyboardShortcuts.sInstance).isNull();
+        assertThat(KeyboardShortcuts.sInstance).isNull();
     }
 
     @Test
     public void toggle_isShowingFalse_showKeyboardShortcuts() {
         when(mDialog.isShowing()).thenReturn(false);
 
-        mKeyboardShortcuts.toggle(mContext, DEVICE_ID);
+        KeyboardShortcuts.toggle(mContext, DEVICE_ID);
 
         verify(mWindowManager).requestAppKeyboardShortcuts(any(), anyInt());
         verify(mWindowManager).requestImeKeyboardShortcuts(any(), anyInt());
@@ -95,7 +110,7 @@
     public void sanitiseShortcuts_clearsIcons() {
         KeyboardShortcutGroup group = createKeyboardShortcutGroupForIconTests();
 
-        KeyboardShortcuts.sanitiseShortcuts(Collections.singletonList(group));
+        KeyboardShortcuts.sanitiseShortcuts(singletonList(group));
 
         verify(group.getItems().get(0)).clearIcon();
         verify(group.getItems().get(1)).clearIcon();
@@ -106,7 +121,7 @@
         KeyboardShortcutGroup group = createKeyboardShortcutGroupForIconTests();
         group.setPackageName(null);
 
-        KeyboardShortcuts.sanitiseShortcuts(Collections.singletonList(group));
+        KeyboardShortcuts.sanitiseShortcuts(singletonList(group));
 
         verify(group.getItems().get(0)).clearIcon();
         verify(group.getItems().get(1)).clearIcon();
@@ -116,16 +131,9 @@
     @EnableFlags(Flags.FLAG_VALIDATE_KEYBOARD_SHORTCUT_HELPER_ICON_URI)
     public void requestAppKeyboardShortcuts_callback_sanitisesIcons() {
         KeyboardShortcutGroup group = createKeyboardShortcutGroupForIconTests();
+        KeyboardShortcuts.toggle(mContext, DEVICE_ID);
 
-        mKeyboardShortcuts.toggle(mContext, DEVICE_ID);
-
-        ArgumentCaptor<WindowManager.KeyboardShortcutsReceiver> callbackCaptor =
-                ArgumentCaptor.forClass(WindowManager.KeyboardShortcutsReceiver.class);
-        ArgumentCaptor<Runnable> handlerRunnableCaptor = ArgumentCaptor.forClass(Runnable.class);
-        verify(mWindowManager).requestAppKeyboardShortcuts(callbackCaptor.capture(), anyInt());
-        callbackCaptor.getValue().onKeyboardShortcutsReceived(Collections.singletonList(group));
-        verify(mHandler).post(handlerRunnableCaptor.capture());
-        handlerRunnableCaptor.getValue().run();
+        emitAppShortcuts(singletonList(group), DEVICE_ID);
 
         verify(group.getItems().get(0)).clearIcon();
         verify(group.getItems().get(1)).clearIcon();
@@ -135,20 +143,38 @@
     @EnableFlags(Flags.FLAG_VALIDATE_KEYBOARD_SHORTCUT_HELPER_ICON_URI)
     public void requestImeKeyboardShortcuts_callback_sanitisesIcons() {
         KeyboardShortcutGroup group = createKeyboardShortcutGroupForIconTests();
+        KeyboardShortcuts.toggle(mContext, DEVICE_ID);
 
-        mKeyboardShortcuts.toggle(mContext, DEVICE_ID);
-
-        ArgumentCaptor<WindowManager.KeyboardShortcutsReceiver> callbackCaptor =
-                ArgumentCaptor.forClass(WindowManager.KeyboardShortcutsReceiver.class);
-        ArgumentCaptor<Runnable> handlerRunnableCaptor = ArgumentCaptor.forClass(Runnable.class);
-        verify(mWindowManager).requestImeKeyboardShortcuts(callbackCaptor.capture(), anyInt());
-        callbackCaptor.getValue().onKeyboardShortcutsReceived(Collections.singletonList(group));
-        verify(mHandler).post(handlerRunnableCaptor.capture());
-        handlerRunnableCaptor.getValue().run();
+        emitImeShortcuts(singletonList(group), DEVICE_ID);
 
         verify(group.getItems().get(0)).clearIcon();
         verify(group.getItems().get(1)).clearIcon();
+    }
 
+    @Test
+    public void onImeAndAppShortcutsReceived_appShortcutsNull_doesNotCrash() {
+        KeyboardShortcutGroup group = createKeyboardShortcutGroupForIconTests();
+        KeyboardShortcuts.toggle(mContext, DEVICE_ID);
+
+        emitImeShortcuts(singletonList(group), DEVICE_ID);
+        emitAppShortcuts(/* groups= */ null, DEVICE_ID);
+    }
+
+    @Test
+    public void onImeAndAppShortcutsReceived_imeShortcutsNull_doesNotCrash() {
+        KeyboardShortcutGroup group = createKeyboardShortcutGroupForIconTests();
+        KeyboardShortcuts.toggle(mContext, DEVICE_ID);
+
+        emitAppShortcuts(singletonList(group), DEVICE_ID);
+        emitImeShortcuts(/* groups= */ null, DEVICE_ID);
+    }
+
+    @Test
+    public void onImeAndAppShortcutsReceived_bothNull_doesNotCrash() {
+        KeyboardShortcuts.toggle(mContext, DEVICE_ID);
+
+        emitImeShortcuts(/* groups= */ null, DEVICE_ID);
+        emitAppShortcuts(/* groups= */ null, DEVICE_ID);
     }
 
     private KeyboardShortcutGroup createKeyboardShortcutGroupForIconTests() {
@@ -159,9 +185,23 @@
         when(info1.getIcon()).thenReturn(icon);
         when(info2.getIcon()).thenReturn(icon);
 
-        KeyboardShortcutGroup group = new KeyboardShortcutGroup("label",
-                Arrays.asList(new KeyboardShortcutInfo[]{ info1, info2}));
+        KeyboardShortcutGroup group =
+                new KeyboardShortcutGroup("label", Arrays.asList(info1, info2));
         group.setPackageName("com.example");
         return group;
     }
+
+    private void emitImeShortcuts(@Nullable List<KeyboardShortcutGroup> groups, int deviceId) {
+        ArgumentCaptor<WindowManager.KeyboardShortcutsReceiver> callbackCaptor =
+                ArgumentCaptor.forClass(WindowManager.KeyboardShortcutsReceiver.class);
+        verify(mWindowManager).requestImeKeyboardShortcuts(callbackCaptor.capture(), eq(deviceId));
+        callbackCaptor.getValue().onKeyboardShortcutsReceived(groups);
+    }
+
+    private void emitAppShortcuts(@Nullable List<KeyboardShortcutGroup> groups, int deviceId) {
+        ArgumentCaptor<WindowManager.KeyboardShortcutsReceiver> callbackCaptor =
+                ArgumentCaptor.forClass(WindowManager.KeyboardShortcutsReceiver.class);
+        verify(mWindowManager).requestAppKeyboardShortcuts(callbackCaptor.capture(), eq(deviceId));
+        callbackCaptor.getValue().onKeyboardShortcutsReceived(groups);
+    }
 }
diff --git a/packages/SystemUI/tests/src/com/android/systemui/volume/VolumeDialogImplTest.java b/packages/SystemUI/tests/src/com/android/systemui/volume/VolumeDialogImplTest.java
index 05d07e5..dbdbe65 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/volume/VolumeDialogImplTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/volume/VolumeDialogImplTest.java
@@ -87,6 +87,7 @@
 import com.android.systemui.util.settings.SecureSettings;
 import com.android.systemui.util.time.FakeSystemClock;
 import com.android.systemui.volume.domain.interactor.VolumePanelNavigationInteractor;
+import com.android.systemui.volume.ui.binder.VolumeDialogMenuIconBinder;
 import com.android.systemui.volume.ui.navigation.VolumeNavigator;
 
 import dagger.Lazy;
@@ -148,6 +149,8 @@
     private VolumePanelNavigationInteractor mVolumePanelNavigationInteractor;
     @Mock
     private VolumeNavigator mVolumeNavigator;
+    @Mock
+    private VolumeDialogMenuIconBinder mVolumeDialogMenuIconBinder;
 
     private final CsdWarningDialog.Factory mCsdWarningDialogFactory =
             new CsdWarningDialog.Factory() {
@@ -211,6 +214,7 @@
                 mDumpManager,
                 mLazySecureSettings,
                 mVibratorHelper,
+                mVolumeDialogMenuIconBinder,
                 new FakeSystemClock());
         mDialog.init(0, null);
         State state = createShellState();
diff --git a/ravenwood/OWNERS b/ravenwood/OWNERS
index a90328c..badfca0 100644
--- a/ravenwood/OWNERS
+++ b/ravenwood/OWNERS
@@ -2,6 +2,7 @@
 
 jsharkey@google.com
 omakoto@google.com
+dplotnikov@google.com
 
 per-file ravenwood-annotation-allowed-classes.txt = dplotnikov@google.com
 per-file texts/ravenwood-annotation-allowed-classes.txt = dplotnikov@google.com
diff --git a/ravenwood/test-authors.md b/ravenwood/test-authors.md
index 2ab43bb..0a0b200 100644
--- a/ravenwood/test-authors.md
+++ b/ravenwood/test-authors.md
@@ -6,6 +6,20 @@
 
 When writing tests under Ravenwood, all Android API symbols associated with your declared `sdk_version` are available to link against using, but unsupported APIs will throw an exception.  This design choice enables mocking of unsupported APIs, and supports sharing of test code to build “bivalent” test suites that run against either Ravenwood or a traditional device.
 
+## Manually running tests
+
+To run all Ravenwood tests, use:
+
+```
+./frameworks/base/ravenwood/scripts/run-ravenwood-tests.sh
+```
+
+To run a specific test, use "atest" as normal, selecting the test from a Ravenwood suite such as:
+
+```
+atest CtsOsTestCasesRavenwood:ParcelTest\#testSetDataCapacityNegative
+```
+
 ## Typical test structure
 
 Below are the typical steps needed to add a straightforward “small” unit test:
diff --git a/services/core/java/com/android/server/am/ActivityManagerService.java b/services/core/java/com/android/server/am/ActivityManagerService.java
index 2600f10..2e08f55 100644
--- a/services/core/java/com/android/server/am/ActivityManagerService.java
+++ b/services/core/java/com/android/server/am/ActivityManagerService.java
@@ -10424,11 +10424,6 @@
     public void onShellCommand(FileDescriptor in, FileDescriptor out,
             FileDescriptor err, String[] args, ShellCallback callback,
             ResultReceiver resultReceiver) {
-        final int callingUid = Binder.getCallingUid();
-        if (callingUid != ROOT_UID && callingUid != Process.SHELL_UID) {
-            resultReceiver.send(-1, null);
-            throw new SecurityException("Shell commands are only callable by root or shell");
-        }
         (new ActivityManagerShellCommand(this, false)).exec(
                 this, in, out, err, args, callback, resultReceiver);
     }
diff --git a/services/core/java/com/android/server/clipboard/ClipboardService.java b/services/core/java/com/android/server/clipboard/ClipboardService.java
index 4c3020f..0afca92 100644
--- a/services/core/java/com/android/server/clipboard/ClipboardService.java
+++ b/services/core/java/com/android/server/clipboard/ClipboardService.java
@@ -30,7 +30,6 @@
 import android.annotation.UserIdInt;
 import android.annotation.WorkerThread;
 import android.app.ActivityManagerInternal;
-import android.app.AppGlobals;
 import android.app.AppOpsManager;
 import android.app.IUriGrantsManager;
 import android.app.KeyguardManager;
@@ -48,9 +47,8 @@
 import android.content.IOnPrimaryClipChangedListener;
 import android.content.Intent;
 import android.content.IntentFilter;
-import android.content.pm.IPackageManager;
-import android.content.pm.PackageInfo;
 import android.content.pm.PackageManager;
+import android.content.pm.PackageManagerInternal;
 import android.content.pm.UserInfo;
 import android.graphics.drawable.Drawable;
 import android.hardware.display.DisplayManager;
@@ -1247,20 +1245,13 @@
 
     @GuardedBy("mLock")
     private void addActiveOwnerLocked(int uid, int deviceId, String pkg) {
-        final IPackageManager pm = AppGlobals.getPackageManager();
+        final PackageManagerInternal pm = LocalServices.getService(PackageManagerInternal.class);
         final int targetUserHandle = UserHandle.getCallingUserId();
         final long oldIdentity = Binder.clearCallingIdentity();
         try {
-            PackageInfo pi = pm.getPackageInfo(pkg, 0, targetUserHandle);
-            if (pi == null) {
-                throw new IllegalArgumentException("Unknown package " + pkg);
+            if (!pm.isSameApp(pkg, 0, uid, targetUserHandle)) {
+                throw new SecurityException("Calling uid " + uid + " does not own package " + pkg);
             }
-            if (!UserHandle.isSameApp(pi.applicationInfo.uid, uid)) {
-                throw new SecurityException("Calling uid " + uid
-                        + " does not own package " + pkg);
-            }
-        } catch (RemoteException e) {
-            // Can't happen; the package manager is in the same process
         } finally {
             Binder.restoreCallingIdentity(oldIdentity);
         }
diff --git a/services/core/java/com/android/server/display/DisplayPowerController.java b/services/core/java/com/android/server/display/DisplayPowerController.java
index 60d0353..195a516 100644
--- a/services/core/java/com/android/server/display/DisplayPowerController.java
+++ b/services/core/java/com/android/server/display/DisplayPowerController.java
@@ -159,7 +159,7 @@
     private static final int MSG_STATSD_HBM_BRIGHTNESS = 11;
     private static final int MSG_SWITCH_USER = 12;
     private static final int MSG_BOOT_COMPLETED = 13;
-    private static final int MSG_SET_DWBC_STRONG_MODE = 14;
+    private static final int MSG_SWITCH_AUTOBRIGHTNESS_MODE = 14;
     private static final int MSG_SET_DWBC_COLOR_OVERRIDE = 15;
     private static final int MSG_SET_DWBC_LOGGING_ENABLED = 16;
     private static final int MSG_SET_BRIGHTNESS_FROM_OFFLOAD = 17;
@@ -1184,15 +1184,9 @@
     @Override
     public void setAutomaticScreenBrightnessMode(
             @AutomaticBrightnessController.AutomaticBrightnessMode int mode) {
-        boolean isIdle = mode == AUTO_BRIGHTNESS_MODE_IDLE;
-        if (mAutomaticBrightnessController != null) {
-            // Set sendUpdate to true to make sure that updatePowerState() gets called
-            mAutomaticBrightnessController.switchMode(mode, /* sendUpdate= */ true);
-            setAnimatorRampSpeeds(isIdle);
-        }
         Message msg = mHandler.obtainMessage();
-        msg.what = MSG_SET_DWBC_STRONG_MODE;
-        msg.arg1 = isIdle ? 1 : 0;
+        msg.what = MSG_SWITCH_AUTOBRIGHTNESS_MODE;
+        msg.arg1 = mode;
         mHandler.sendMessageAtTime(msg, mClock.uptimeMillis());
     }
 
@@ -1866,7 +1860,7 @@
 
     private void setDwbcStrongMode(int arg) {
         if (mDisplayWhiteBalanceController != null) {
-            final boolean isIdle = (arg == 1);
+            final boolean isIdle = (arg == AUTO_BRIGHTNESS_MODE_IDLE);
             mDisplayWhiteBalanceController.setStrongModeEnabled(isIdle);
         }
     }
@@ -3032,7 +3026,12 @@
                     updatePowerState();
                     break;
 
-                case MSG_SET_DWBC_STRONG_MODE:
+                case MSG_SWITCH_AUTOBRIGHTNESS_MODE:
+                    boolean isIdle = msg.arg1 == AUTO_BRIGHTNESS_MODE_IDLE;
+                    if (mAutomaticBrightnessController != null) {
+                        mAutomaticBrightnessController.switchMode(msg.arg1, /* sendUpdate= */ true);
+                        setAnimatorRampSpeeds(isIdle);
+                    }
                     setDwbcStrongMode(msg.arg1);
                     break;
 
diff --git a/services/core/java/com/android/server/display/mode/Vote.java b/services/core/java/com/android/server/display/mode/Vote.java
index 1ec469c..cacc8b4 100644
--- a/services/core/java/com/android/server/display/mode/Vote.java
+++ b/services/core/java/com/android/server/display/mode/Vote.java
@@ -16,10 +16,13 @@
 
 package com.android.server.display.mode;
 
+import android.annotation.IntDef;
 import android.annotation.NonNull;
 
 import com.android.server.display.config.SupportedModeData;
 
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
 import java.util.ArrayList;
 import java.util.List;
 
@@ -132,15 +135,40 @@
     // to function, so this needs to be the highest priority of all votes.
     int PRIORITY_UDFPS = 20;
 
+    @IntDef(prefix = { "PRIORITY_" }, value = {
+            PRIORITY_DEFAULT_RENDER_FRAME_RATE,
+            PRIORITY_FLICKER_REFRESH_RATE,
+            PRIORITY_HIGH_BRIGHTNESS_MODE,
+            PRIORITY_USER_SETTING_MIN_RENDER_FRAME_RATE,
+            PRIORITY_USER_SETTING_DISPLAY_PREFERRED_SIZE,
+            PRIORITY_APP_REQUEST_RENDER_FRAME_RATE_RANGE,
+            PRIORITY_APP_REQUEST_BASE_MODE_REFRESH_RATE,
+            PRIORITY_APP_REQUEST_SIZE,
+            PRIORITY_USER_SETTING_PEAK_REFRESH_RATE,
+            PRIORITY_USER_SETTING_PEAK_RENDER_FRAME_RATE,
+            PRIORITY_SYNCHRONIZED_REFRESH_RATE,
+            PRIORITY_LIMIT_MODE,
+            PRIORITY_AUTH_OPTIMIZER_RENDER_FRAME_RATE,
+            PRIORITY_LAYOUT_LIMITED_FRAME_RATE,
+            PRIORITY_SYSTEM_REQUESTED_MODES,
+            PRIORITY_LOW_POWER_MODE_MODES,
+            PRIORITY_LOW_POWER_MODE_RENDER_RATE,
+            PRIORITY_FLICKER_REFRESH_RATE_SWITCH,
+            PRIORITY_SKIN_TEMPERATURE,
+            PRIORITY_PROXIMITY,
+            PRIORITY_UDFPS
+    })
+    @Retention(RetentionPolicy.SOURCE)
+    @interface Priority {}
+
     // Whenever a new priority is added, remember to update MIN_PRIORITY, MAX_PRIORITY, and
     // APP_REQUEST_REFRESH_RATE_RANGE_PRIORITY_CUTOFF, as well as priorityToString.
-
-    int MIN_PRIORITY = PRIORITY_DEFAULT_RENDER_FRAME_RATE;
-    int MAX_PRIORITY = PRIORITY_UDFPS;
+    @Priority int MIN_PRIORITY = PRIORITY_DEFAULT_RENDER_FRAME_RATE;
+    @Priority int MAX_PRIORITY = PRIORITY_UDFPS;
 
     // The cutoff for the app request refresh rate range. Votes with priorities lower than this
     // value will not be considered when constructing the app request refresh rate range.
-    int APP_REQUEST_REFRESH_RATE_RANGE_PRIORITY_CUTOFF =
+    @Priority int APP_REQUEST_REFRESH_RATE_RANGE_PRIORITY_CUTOFF =
             PRIORITY_APP_REQUEST_RENDER_FRAME_RATE_RANGE;
 
     /**
diff --git a/services/core/java/com/android/server/display/mode/VotesStorage.java b/services/core/java/com/android/server/display/mode/VotesStorage.java
index 6becf1c..d41ef65 100644
--- a/services/core/java/com/android/server/display/mode/VotesStorage.java
+++ b/services/core/java/com/android/server/display/mode/VotesStorage.java
@@ -79,12 +79,12 @@
     }
 
     /** updates vote storage for all displays */
-    void updateGlobalVote(int priority, @Nullable Vote vote) {
+    void updateGlobalVote(@Vote.Priority int priority, @Nullable Vote vote) {
         updateVote(GLOBAL_ID, priority, vote);
     }
 
     /** updates vote storage */
-    void updateVote(int displayId, int priority, @Nullable Vote vote) {
+    void updateVote(int displayId, @Vote.Priority int priority, @Nullable Vote vote) {
         if (mLoggingEnabled) {
             Slog.i(TAG, "updateVoteLocked(displayId=" + displayId
                     + ", priority=" + Vote.priorityToString(priority)
@@ -126,7 +126,7 @@
     }
 
     /** removes all votes with certain priority from vote storage */
-    void removeAllVotesForPriority(int priority) {
+    void removeAllVotesForPriority(@Vote.Priority int priority) {
         if (mLoggingEnabled) {
             Slog.i(TAG, "removeAllVotesForPriority(priority="
                     + Vote.priorityToString(priority) + ")");
diff --git a/services/core/java/com/android/server/dreams/OWNERS b/services/core/java/com/android/server/dreams/OWNERS
index 7302f6e..b9286f8 100644
--- a/services/core/java/com/android/server/dreams/OWNERS
+++ b/services/core/java/com/android/server/dreams/OWNERS
@@ -1,4 +1,3 @@
-brycelee@google.com
-dsandler@android.com
-michaelwr@google.com
-roosa@google.com
+# Bug component: 66910
+include /core/java/android/service/dreams/OWNERS
+
diff --git a/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java b/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java
index fb5f5ae..8665a39 100644
--- a/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java
+++ b/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java
@@ -2695,25 +2695,27 @@
         final boolean canImeDrawsImeNavBar =
                 mImeDrawsImeNavBarRes != null && mImeDrawsImeNavBarRes.get() && hasNavigationBar;
         final boolean shouldShowImeSwitcherWhenImeIsShown = shouldShowImeSwitcherLocked(
-                InputMethodService.IME_ACTIVE | InputMethodService.IME_VISIBLE);
+                InputMethodService.IME_ACTIVE | InputMethodService.IME_VISIBLE,
+                mCurrentUserId);
         return (canImeDrawsImeNavBar ? InputMethodNavButtonFlags.IME_DRAWS_IME_NAV_BAR : 0)
                 | (shouldShowImeSwitcherWhenImeIsShown
                 ? InputMethodNavButtonFlags.SHOW_IME_SWITCHER_WHEN_IME_IS_SHOWN : 0);
     }
 
     @GuardedBy("ImfLock.class")
-    private boolean shouldShowImeSwitcherLocked(int visibility) {
+    private boolean shouldShowImeSwitcherLocked(int visibility, @UserIdInt int userId) {
         if (!mShowOngoingImeSwitcherForPhones) return false;
         // When the IME switcher dialog is shown, the IME switcher button should be hidden.
+        // TODO(b/305849394): Make mMenuController multi-user aware.
         if (mMenuController.getSwitchingDialogLocked() != null) return false;
         // When we are switching IMEs, the IME switcher button should be hidden.
-        final var bindingController = getInputMethodBindingController(mCurrentUserId);
+        final var bindingController = getInputMethodBindingController(userId);
         if (!Objects.equals(bindingController.getCurId(),
                 bindingController.getSelectedMethodId())) {
             return false;
         }
         if (mWindowManagerInternal.isKeyguardShowingAndNotOccluded()
-                && mWindowManagerInternal.isKeyguardSecure(mCurrentUserId)) {
+                && mWindowManagerInternal.isKeyguardSecure(userId)) {
             return false;
         }
         if ((visibility & InputMethodService.IME_ACTIVE) == 0
@@ -2730,7 +2732,7 @@
             return false;
         }
 
-        final InputMethodSettings settings = InputMethodSettingsRepository.get(mCurrentUserId);
+        final InputMethodSettings settings = InputMethodSettingsRepository.get(userId);
         List<InputMethodInfo> imes = settings.getEnabledInputMethodListWithFilter(
                 InputMethodInfo::shouldShowInInputMethodPicker);
         final int numImes = imes.size();
@@ -2845,14 +2847,22 @@
     // Caution! This method is called in this class. Handle multi-user carefully
     @GuardedBy("ImfLock.class")
     private void updateSystemUiLocked(int vis, int backDisposition) {
-        if (getCurTokenLocked() == null) {
+        updateSystemUiLocked(vis, backDisposition, mCurrentUserId);
+    }
+
+    @GuardedBy("ImfLock.class")
+    private void updateSystemUiLocked(int vis, int backDisposition, @UserIdInt int userId) {
+        final var bindingController = getInputMethodBindingController(userId);
+        final var curToken = bindingController.getCurToken();
+        if (curToken == null) {
             return;
         }
+        final int curTokenDisplayId = bindingController.getCurTokenDisplayId();
         if (DEBUG) {
             Slog.d(TAG, "IME window vis: " + vis
                     + " active: " + (vis & InputMethodService.IME_ACTIVE)
                     + " inv: " + (vis & InputMethodService.IME_INVISIBLE)
-                    + " displayId: " + getCurTokenDisplayIdLocked());
+                    + " displayId: " + curTokenDisplayId);
         }
         final IBinder focusedWindowToken = mImeBindingState != null
                 ? mImeBindingState.mFocusedWindow : null;
@@ -2871,17 +2881,18 @@
             } else {
                 vis &= ~InputMethodService.IME_VISIBLE_IMPERCEPTIBLE;
             }
-            final var curId = getInputMethodBindingController(mCurrentUserId).getCurId();
+            final var curId = bindingController.getCurId();
+            // TODO(b/305849394): Make mMenuController multi-user aware.
             if (mMenuController.getSwitchingDialogLocked() != null
-                    || !Objects.equals(curId, getSelectedMethodIdLocked())) {
+                    || !Objects.equals(curId, bindingController.getSelectedMethodId())) {
                 // When the IME switcher dialog is shown, or we are switching IMEs,
                 // the back button should be in the default state (as if the IME is not shown).
                 backDisposition = InputMethodService.BACK_DISPOSITION_ADJUST_NOTHING;
             }
-            final boolean needsToShowImeSwitcher = shouldShowImeSwitcherLocked(vis);
+            final boolean needsToShowImeSwitcher = shouldShowImeSwitcherLocked(vis, userId);
             if (mStatusBarManagerInternal != null) {
-                mStatusBarManagerInternal.setImeWindowStatus(getCurTokenDisplayIdLocked(),
-                        getCurTokenLocked(), vis, backDisposition, needsToShowImeSwitcher);
+                mStatusBarManagerInternal.setImeWindowStatus(curTokenDisplayId,
+                        curToken, vis, backDisposition, needsToShowImeSwitcher);
             }
         } finally {
             Binder.restoreCallingIdentity(ident);
diff --git a/services/core/java/com/android/server/wm/ActivityTaskManagerService.java b/services/core/java/com/android/server/wm/ActivityTaskManagerService.java
index 3aa63af..0f5b6c5 100644
--- a/services/core/java/com/android/server/wm/ActivityTaskManagerService.java
+++ b/services/core/java/com/android/server/wm/ActivityTaskManagerService.java
@@ -1439,6 +1439,8 @@
                 resultTo.removeResultsLocked(r, resultWho, requestCode);
             }
 
+            final int origCallingUid = Binder.getCallingUid();
+            final int origCallingPid = Binder.getCallingPid();
             final long origId = Binder.clearCallingIdentity();
             // TODO(b/64750076): Check if calling pid should really be -1.
             try {
@@ -1446,13 +1448,14 @@
                     options = new SafeActivityOptions(ActivityOptions.makeBasic());
                 }
 
-                // Fixes b/230492947
+                // Fixes b/230492947 b/337726734
                 // Prevents background activity launch through #startNextMatchingActivity
-                // An activity going into the background could still go back to the foreground
-                // if the intent used matches both:
-                // - the activity in the background
-                // - a second activity.
-                options.getOptions(r).setAvoidMoveToFront();
+                // launchedFromUid of the calling activity represents the app that launches it.
+                // It may have BAL privileges (i.e. the Launcher App). Using its identity to
+                // launch to launch next matching activity causes BAL.
+                // Change the realCallingUid to the calling activity's uid.
+                // In ActivityStarter, when caller is set, the callingUid and callingPid are
+                // ignored. So now both callingUid and realCallingUid is set to the caller app.
                 final int res = getActivityStartController()
                         .obtainStarter(intent, "startNextMatchingActivity")
                         .setCaller(r.app.getThread())
@@ -1465,8 +1468,8 @@
                         .setCallingUid(r.launchedFromUid)
                         .setCallingPackage(r.launchedFromPackage)
                         .setCallingFeatureId(r.launchedFromFeatureId)
-                        .setRealCallingPid(-1)
-                        .setRealCallingUid(r.launchedFromUid)
+                        .setRealCallingPid(origCallingPid)
+                        .setRealCallingUid(origCallingUid)
                         .setActivityOptions(options)
                         .setUserId(userId)
                         .execute();
diff --git a/services/devicepolicy/java/com/android/server/devicepolicy/PolicyDefinition.java b/services/devicepolicy/java/com/android/server/devicepolicy/PolicyDefinition.java
index a0ea4e9..901cafa 100644
--- a/services/devicepolicy/java/com/android/server/devicepolicy/PolicyDefinition.java
+++ b/services/devicepolicy/java/com/android/server/devicepolicy/PolicyDefinition.java
@@ -240,7 +240,7 @@
                     POLICY_FLAG_LOCAL_ONLY_POLICY | POLICY_FLAG_INHERITABLE
                             | POLICY_FLAG_NON_COEXISTABLE_POLICY
                             | POLICY_FLAG_SKIP_ENFORCEMENT_IF_UNCHANGED,
-                    PolicyEnforcerCallbacks::noOp,
+                    PolicyEnforcerCallbacks::setApplicationRestrictions,
                     new BundlePolicySerializer());
 
     /**
diff --git a/services/tests/displayservicetests/src/com/android/server/display/DisplayPowerControllerTest.java b/services/tests/displayservicetests/src/com/android/server/display/DisplayPowerControllerTest.java
index 8fd1e6b..efa224f 100644
--- a/services/tests/displayservicetests/src/com/android/server/display/DisplayPowerControllerTest.java
+++ b/services/tests/displayservicetests/src/com/android/server/display/DisplayPowerControllerTest.java
@@ -39,6 +39,7 @@
 import static org.mockito.Mockito.reset;
 import static org.mockito.Mockito.spy;
 import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verifyNoMoreInteractions;
 import static org.mockito.Mockito.when;
 
 import android.app.ActivityManager;
@@ -1284,14 +1285,37 @@
 
     @Test
     public void testDwbcCallsHappenOnHandler() {
+        when(mDisplayManagerFlagsMock.isAdaptiveTone1Enabled()).thenReturn(true);
         mHolder = createDisplayPowerController(DISPLAY_ID, UNIQUE_ID);
 
-        mHolder.dpc.setAutomaticScreenBrightnessMode(AUTO_BRIGHTNESS_MODE_IDLE);
-        verify(mDisplayWhiteBalanceControllerMock, never()).setStrongModeEnabled(true);
+        // Send a display power request
+        DisplayPowerRequest dpr = new DisplayPowerRequest();
+        dpr.policy = DisplayPowerRequest.POLICY_BRIGHT;
+        dpr.useProximitySensor = true;
+        mHolder.dpc.requestPowerState(dpr, false /* waitForNegativeProximity */);
+
+        // Run updatePowerState
+        advanceTime(1);
+
+        setUpDisplay(DISPLAY_ID, "new_unique_id", mHolder.display, mock(DisplayDevice.class),
+                mHolder.config, /* isEnabled= */ true);
 
         // dispatch handler looper
         advanceTime(1);
-        verify(mDisplayWhiteBalanceControllerMock, times(1)).setStrongModeEnabled(true);
+        clearInvocations(mDisplayWhiteBalanceControllerMock, mHolder.automaticBrightnessController,
+                mHolder.animator);
+        mHolder.dpc.setAutomaticScreenBrightnessMode(AUTO_BRIGHTNESS_MODE_IDLE);
+        verifyNoMoreInteractions(mDisplayWhiteBalanceControllerMock,
+                mHolder.automaticBrightnessController,
+                mHolder.animator);
+
+        // dispatch handler looper
+        advanceTime(1);
+        verify(mHolder.automaticBrightnessController).switchMode(AUTO_BRIGHTNESS_MODE_IDLE,
+                /* sendUpdate= */ true);
+        verify(mHolder.animator).setAnimationTimeLimits(BRIGHTNESS_RAMP_INCREASE_MAX_IDLE,
+                BRIGHTNESS_RAMP_DECREASE_MAX_IDLE);
+        verify(mDisplayWhiteBalanceControllerMock).setStrongModeEnabled(true);
     }
 
     @Test
@@ -1506,6 +1530,9 @@
         // switch to idle mode
         mHolder.dpc.setAutomaticScreenBrightnessMode(AUTO_BRIGHTNESS_MODE_IDLE);
 
+        // Process the MSG_SWITCH_AUTOBRIGHTNESS_MODE event
+        advanceTime(1);
+
         // A second time when switching to idle mode.
         verify(mHolder.animator, times(2)).setAnimationTimeLimits(BRIGHTNESS_RAMP_INCREASE_MAX,
                 BRIGHTNESS_RAMP_DECREASE_MAX);
@@ -1532,6 +1559,8 @@
         // switch to idle mode
         mHolder.dpc.setAutomaticScreenBrightnessMode(AUTO_BRIGHTNESS_MODE_IDLE);
 
+        // Process the MSG_SWITCH_AUTOBRIGHTNESS_MODE event
+        advanceTime(1);
         verify(mHolder.animator).setAnimationTimeLimits(BRIGHTNESS_RAMP_INCREASE_MAX_IDLE,
                 BRIGHTNESS_RAMP_DECREASE_MAX_IDLE);
     }
diff --git a/services/tests/displayservicetests/src/com/android/server/display/mode/VotesStorageTest.java b/services/tests/displayservicetests/src/com/android/server/display/mode/VotesStorageTest.java
index a248d6de..0125ddb 100644
--- a/services/tests/displayservicetests/src/com/android/server/display/mode/VotesStorageTest.java
+++ b/services/tests/displayservicetests/src/com/android/server/display/mode/VotesStorageTest.java
@@ -38,10 +38,10 @@
 @RunWith(AndroidJUnit4.class)
 public class VotesStorageTest {
     private static final int DISPLAY_ID = 100;
-    private static final int PRIORITY = Vote.PRIORITY_APP_REQUEST_SIZE;
+    private static final @Vote.Priority int PRIORITY = Vote.PRIORITY_APP_REQUEST_SIZE;
     private static final Vote VOTE = Vote.forDisableRefreshRateSwitching();
     private static final int DISPLAY_ID_OTHER = 101;
-    private static final int PRIORITY_OTHER = Vote.PRIORITY_FLICKER_REFRESH_RATE;
+    private static final @Vote.Priority int PRIORITY_OTHER = Vote.PRIORITY_FLICKER_REFRESH_RATE;
     private static final Vote VOTE_OTHER = Vote.forBaseModeRefreshRate(10f);
 
     @Mock