diff --git a/AconfigFlags.bp b/AconfigFlags.bp
index 38ade2f..45e33ce 100644
--- a/AconfigFlags.bp
+++ b/AconfigFlags.bp
@@ -808,21 +808,6 @@
     defaults: ["framework-minus-apex-aconfig-java-defaults"],
 }
 
-// OnDeviceIntelligence
-aconfig_declarations {
-    name: "android.app.ondeviceintelligence-aconfig",
-    exportable: true,
-    package: "android.app.ondeviceintelligence.flags",
-    container: "system",
-    srcs: ["core/java/android/app/ondeviceintelligence/flags/ondevice_intelligence.aconfig"],
-}
-
-java_aconfig_library {
-    name: "android.app.ondeviceintelligence-aconfig-java",
-    aconfig_declarations: "android.app.ondeviceintelligence-aconfig",
-    defaults: ["framework-minus-apex-aconfig-java-defaults"],
-}
-
 // Permissions
 aconfig_declarations {
     name: "android.permission.flags-aconfig",
@@ -1482,6 +1467,13 @@
     defaults: ["framework-minus-apex-aconfig-java-defaults"],
 }
 
+java_aconfig_library {
+    name: "android.appwidget.flags-aconfig-java-host",
+    aconfig_declarations: "android.appwidget.flags-aconfig",
+    host_supported: true,
+    defaults: ["framework-minus-apex-aconfig-java-defaults"],
+}
+
 // App
 aconfig_declarations {
     name: "android.server.app.flags-aconfig",
diff --git a/Android.bp b/Android.bp
index a525583b8..529da53 100644
--- a/Android.bp
+++ b/Android.bp
@@ -446,6 +446,9 @@
         default: [
             "framework-platformcrashrecovery.impl",
         ],
+    }) + select(release_flag("RELEASE_ONDEVICE_INTELLIGENCE_MODULE"), {
+        true: [],
+        default: ["framework-ondeviceintelligence-platform.impl"],
     }),
     sdk_version: "core_platform",
     installable: false,
@@ -489,6 +492,7 @@
     apex_available: ["//apex_available:platform"],
     visibility: [
         "//frameworks/base:__subpackages__",
+        "//packages/modules/NeuralNetworks:__subpackages__",
     ],
     compile_dex: false,
     headers_only: true,
@@ -584,6 +588,9 @@
         default: [
             "framework-platformcrashrecovery-compat-config",
         ],
+    }) + select(release_flag("RELEASE_ONDEVICE_INTELLIGENCE_MODULE"), {
+        true: [],
+        default: ["framework-ondeviceintelligence-platform-compat-config"],
     }),
 }
 
diff --git a/api/Android.bp b/api/Android.bp
index 7326203..14c2766 100644
--- a/api/Android.bp
+++ b/api/Android.bp
@@ -105,6 +105,13 @@
         default: [
             "framework-platformcrashrecovery",
         ],
+    }) + select(release_flag("RELEASE_ONDEVICE_INTELLIGENCE_MODULE"), {
+        true: [
+            "framework-ondeviceintelligence",
+        ],
+        default: [
+            "framework-ondeviceintelligence-platform",
+        ],
     }) + select(release_flag("RELEASE_RANGING_STACK"), {
         true: [
             "framework-ranging",
@@ -119,7 +126,12 @@
         "service-permission",
         "service-rkp",
         "service-sdksandbox",
-    ] + select(soong_config_variable("ANDROID", "release_crashrecovery_module"), {
+    ] + select(release_flag("RELEASE_ONDEVICE_INTELLIGENCE_MODULE"), {
+        true: [
+            "service-ondeviceintelligence",
+        ],
+        default: [],
+    }) + select(soong_config_variable("ANDROID", "release_crashrecovery_module"), {
         "true": [
             "service-crashrecovery",
         ],
@@ -478,6 +490,7 @@
         "//frameworks/base/location",
         "//frameworks/base/packages/CrashRecovery/framework",
         "//frameworks/base/nfc",
+        "//packages/modules/NeuralNetworks:__subpackages__",
     ],
     plugins: ["error_prone_android_framework"],
     errorprone: {
diff --git a/api/api.go b/api/api.go
index 5ca24de..e4d783e 100644
--- a/api/api.go
+++ b/api/api.go
@@ -29,6 +29,7 @@
 const virtualization = "framework-virtualization"
 const location = "framework-location"
 const platformCrashrecovery = "framework-platformcrashrecovery"
+const ondeviceintelligence = "framework-ondeviceintelligence-platform"
 
 var core_libraries_modules = []string{art, conscrypt, i18n}
 
@@ -40,7 +41,7 @@
 // APIs.
 // In addition, the modules in this list are allowed to contribute to test APIs
 // stubs.
-var non_updatable_modules = []string{virtualization, location, platformCrashrecovery}
+var non_updatable_modules = []string{virtualization, location, platformCrashrecovery, ondeviceintelligence}
 
 // The intention behind this soong plugin is to generate a number of "merged"
 // API-related modules that would otherwise require a large amount of very
diff --git a/boot/Android.bp b/boot/Android.bp
index 6eead42..eaa984a 100644
--- a/boot/Android.bp
+++ b/boot/Android.bp
@@ -31,6 +31,7 @@
         "car_bootclasspath_fragment",
         "nfc_apex_bootclasspath_fragment",
         "release_crashrecovery_module",
+        "release_ondevice_intelligence_module",
         "release_package_profiling_module",
     ],
     properties: [
@@ -176,6 +177,15 @@
                 },
             ],
         },
+        release_ondevice_intelligence_module: {
+            fragments: [
+                // only used when ondeviceintelligence is moved to neuralnetworks module
+                {
+                    apex: "com.android.neuralnetworks",
+                    module: "com.android.ondeviceintelligence-bootclasspath-fragment",
+                },
+            ],
+        },
         release_package_profiling_module: {
             fragments: [
                 // only used if profiling is enabled.
diff --git a/core/api/current.txt b/core/api/current.txt
index 7eba68f..30323c0 100644
--- a/core/api/current.txt
+++ b/core/api/current.txt
@@ -6482,6 +6482,7 @@
     method public String getSortKey();
     method public long getTimeoutAfter();
     method public boolean hasImage();
+    method @FlaggedApi("android.app.api_rich_ongoing") public boolean hasPromotableCharacteristics();
     method public void writeToParcel(android.os.Parcel, int);
     field public static final android.media.AudioAttributes AUDIO_ATTRIBUTES_DEFAULT;
     field public static final int BADGE_ICON_LARGE = 2; // 0x2
@@ -27169,6 +27170,15 @@
 
 package android.media.quality {
 
+  @FlaggedApi("android.media.tv.flags.media_quality_fw") public final class ActiveProcessingPicture implements android.os.Parcelable {
+    ctor public ActiveProcessingPicture(int, @NonNull String);
+    method public int describeContents();
+    method public int getId();
+    method @NonNull public String getProfileId();
+    method public void writeToParcel(@NonNull android.os.Parcel, int);
+    field @NonNull public static final android.os.Parcelable.Creator<android.media.quality.ActiveProcessingPicture> CREATOR;
+  }
+
   @FlaggedApi("android.media.tv.flags.media_quality_fw") public final class AmbientBacklightEvent implements android.os.Parcelable {
     ctor public AmbientBacklightEvent(int, @Nullable android.media.quality.AmbientBacklightMetadata);
     method public int describeContents();
@@ -27255,13 +27265,14 @@
   }
 
   @FlaggedApi("android.media.tv.flags.media_quality_fw") public final class MediaQualityManager {
+    method public void addActiveProcessingPictureListener(@NonNull java.util.concurrent.Executor, @NonNull android.media.quality.MediaQualityManager.ActiveProcessingPictureListener);
     method public void createPictureProfile(@NonNull android.media.quality.PictureProfile);
     method public void createSoundProfile(@NonNull android.media.quality.SoundProfile);
-    method @NonNull public java.util.List<android.media.quality.PictureProfile> getAvailablePictureProfiles();
-    method @NonNull public java.util.List<android.media.quality.SoundProfile> getAvailableSoundProfiles();
+    method @NonNull public java.util.List<android.media.quality.PictureProfile> getAvailablePictureProfiles(boolean);
+    method @NonNull public java.util.List<android.media.quality.SoundProfile> getAvailableSoundProfiles(boolean);
     method @NonNull public java.util.List<android.media.quality.ParamCapability> getParamCapabilities(@NonNull java.util.List<java.lang.String>);
-    method @Nullable public android.media.quality.PictureProfile getPictureProfile(int, @NonNull String);
-    method @Nullable public android.media.quality.SoundProfile getSoundProfile(int, @NonNull String);
+    method @Nullable public android.media.quality.PictureProfile getPictureProfile(int, @NonNull String, boolean);
+    method @Nullable public android.media.quality.SoundProfile getSoundProfile(int, @NonNull String, boolean);
     method public boolean isAmbientBacklightEnabled();
     method public boolean isAutoPictureQualityEnabled();
     method public boolean isAutoSoundQualityEnabled();
@@ -27269,6 +27280,7 @@
     method public void registerAmbientBacklightCallback(@NonNull java.util.concurrent.Executor, @NonNull android.media.quality.MediaQualityManager.AmbientBacklightCallback);
     method public void registerPictureProfileCallback(@NonNull java.util.concurrent.Executor, @NonNull android.media.quality.MediaQualityManager.PictureProfileCallback);
     method public void registerSoundProfileCallback(@NonNull java.util.concurrent.Executor, @NonNull android.media.quality.MediaQualityManager.SoundProfileCallback);
+    method public void removeActiveProcessingPictureListener(@NonNull android.media.quality.MediaQualityManager.ActiveProcessingPictureListener);
     method public void removePictureProfile(@NonNull String);
     method public void removeSoundProfile(@NonNull String);
     method public void setAmbientBacklightEnabled(boolean);
@@ -27280,6 +27292,10 @@
     method public void updateSoundProfile(@NonNull String, @NonNull android.media.quality.SoundProfile);
   }
 
+  public static interface MediaQualityManager.ActiveProcessingPictureListener {
+    method public void onActiveProcessingPicturesChanged(@NonNull java.util.List<android.media.quality.ActiveProcessingPicture>);
+  }
+
   public abstract static class MediaQualityManager.AmbientBacklightCallback {
     ctor public MediaQualityManager.AmbientBacklightCallback();
     method public void onAmbientBacklightEvent(@NonNull android.media.quality.AmbientBacklightEvent);
@@ -27287,7 +27303,7 @@
 
   public abstract static class MediaQualityManager.PictureProfileCallback {
     ctor public MediaQualityManager.PictureProfileCallback();
-    method public void onError(int);
+    method public void onError(@Nullable String, int);
     method public void onParamCapabilitiesChanged(@Nullable String, @NonNull java.util.List<android.media.quality.ParamCapability>);
     method public void onPictureProfileAdded(@NonNull String, @NonNull android.media.quality.PictureProfile);
     method public void onPictureProfileRemoved(@NonNull String, @NonNull android.media.quality.PictureProfile);
@@ -27296,7 +27312,7 @@
 
   public abstract static class MediaQualityManager.SoundProfileCallback {
     ctor public MediaQualityManager.SoundProfileCallback();
-    method public void onError(int);
+    method public void onError(@Nullable String, int);
     method public void onParamCapabilitiesChanged(@Nullable String, @NonNull java.util.List<android.media.quality.ParamCapability>);
     method public void onSoundProfileAdded(@NonNull String, @NonNull android.media.quality.SoundProfile);
     method public void onSoundProfileRemoved(@NonNull String, @NonNull android.media.quality.SoundProfile);
@@ -34750,6 +34766,8 @@
     method public boolean hasMessages(android.os.Handler, Object, int);
     method public boolean hasMessages(android.os.Handler, Object, Runnable);
     method public android.os.Message next();
+    method @FlaggedApi("android.os.message_queue_testability") @Nullable public Long peekWhen();
+    method @FlaggedApi("android.os.message_queue_testability") @Nullable public android.os.Message pop();
     method public void recycle(android.os.Message);
     method public void release();
   }
@@ -41029,7 +41047,7 @@
     field public static final int TYPE_DATASET_SELECTED = 0; // 0x0
     field public static final int TYPE_SAVE_SHOWN = 3; // 0x3
     field public static final int TYPE_VIEW_REQUESTED_AUTOFILL = 6; // 0x6
-    field @FlaggedApi("android.service.autofill.autofill_w_metrics") public static final int UI_TYPE_CREDMAN = 4; // 0x4
+    field @FlaggedApi("android.service.autofill.autofill_w_metrics") public static final int UI_TYPE_CREDENTIAL_MANAGER = 4; // 0x4
     field public static final int UI_TYPE_DIALOG = 3; // 0x3
     field public static final int UI_TYPE_INLINE = 2; // 0x2
     field public static final int UI_TYPE_MENU = 1; // 0x1
@@ -45021,6 +45039,7 @@
     field public static final String KEY_RCS_CONFIG_SERVER_URL_STRING = "rcs_config_server_url_string";
     field public static final String KEY_READ_ONLY_APN_FIELDS_STRING_ARRAY = "read_only_apn_fields_string_array";
     field public static final String KEY_READ_ONLY_APN_TYPES_STRING_ARRAY = "read_only_apn_types_string_array";
+    field @FlaggedApi("com.android.internal.telephony.flags.satellite_system_apis") public static final String KEY_REGIONAL_SATELLITE_EARFCN_BUNDLE = "regional_satellite_earfcn_bundle";
     field @FlaggedApi("com.android.internal.telephony.flags.satellite_system_apis") public static final String KEY_REMOVE_SATELLITE_PLMN_IN_MANUAL_NETWORK_SCAN_BOOL = "remove_satellite_plmn_in_manual_network_scan_bool";
     field public static final String KEY_REQUIRE_ENTITLEMENT_CHECKS_BOOL = "require_entitlement_checks_bool";
     field @Deprecated public static final String KEY_RESTART_RADIO_ON_PDP_FAIL_REGULAR_DEACTIVATION_BOOL = "restart_radio_on_pdp_fail_regular_deactivation_bool";
@@ -45034,6 +45053,7 @@
     field @FlaggedApi("com.android.internal.telephony.flags.carrier_enabled_satellite_flag") public static final String KEY_SATELLITE_ATTACH_SUPPORTED_BOOL = "satellite_attach_supported_bool";
     field @FlaggedApi("com.android.internal.telephony.flags.carrier_enabled_satellite_flag") public static final String KEY_SATELLITE_CONNECTION_HYSTERESIS_SEC_INT = "satellite_connection_hysteresis_sec_int";
     field @FlaggedApi("com.android.internal.telephony.flags.satellite_system_apis") public static final String KEY_SATELLITE_DATA_SUPPORT_MODE_INT = "satellite_data_support_mode_int";
+    field @FlaggedApi("com.android.internal.telephony.flags.satellite_system_apis") public static final String KEY_SATELLITE_DISPLAY_NAME_STRING = "satellite_display_name_string";
     field @FlaggedApi("com.android.internal.telephony.flags.satellite_system_apis") public static final String KEY_SATELLITE_ENTITLEMENT_APP_NAME_STRING = "satellite_entitlement_app_name_string";
     field @FlaggedApi("com.android.internal.telephony.flags.carrier_enabled_satellite_flag") public static final String KEY_SATELLITE_ENTITLEMENT_STATUS_REFRESH_DAYS_INT = "satellite_entitlement_status_refresh_days_int";
     field @FlaggedApi("com.android.internal.telephony.flags.carrier_enabled_satellite_flag") public static final String KEY_SATELLITE_ENTITLEMENT_SUPPORTED_BOOL = "satellite_entitlement_supported_bool";
@@ -45045,6 +45065,8 @@
     field @FlaggedApi("com.android.internal.telephony.flags.carrier_roaming_nb_iot_ntn") public static final String KEY_SATELLITE_ROAMING_P2P_SMS_SUPPORTED_BOOL = "satellite_roaming_p2p_sms_supported_bool";
     field @FlaggedApi("com.android.internal.telephony.flags.carrier_roaming_nb_iot_ntn") public static final String KEY_SATELLITE_ROAMING_SCREEN_OFF_INACTIVITY_TIMEOUT_SEC_INT = "satellite_roaming_screen_off_inactivity_timeout_sec_int";
     field @FlaggedApi("com.android.internal.telephony.flags.satellite_system_apis") public static final String KEY_SATELLITE_ROAMING_TURN_OFF_SESSION_FOR_EMERGENCY_CALL_BOOL = "satellite_roaming_turn_off_session_for_emergency_call_bool";
+    field @FlaggedApi("com.android.internal.telephony.flags.satellite_system_apis") public static final String KEY_SATELLITE_SOS_MAX_DATAGRAM_SIZE_BYTES_INT = "satellite_sos_max_datagram_size_bytes_int";
+    field @FlaggedApi("com.android.internal.telephony.flags.satellite_system_apis") public static final String KEY_SATELLITE_SUPPORTED_MSG_APPS_STRING_ARRAY = "satellite_supported_msg_apps_string_array";
     field public static final String KEY_SHOW_4G_FOR_3G_DATA_ICON_BOOL = "show_4g_for_3g_data_icon_bool";
     field public static final String KEY_SHOW_4G_FOR_LTE_DATA_ICON_BOOL = "show_4g_for_lte_data_icon_bool";
     field public static final String KEY_SHOW_APN_SETTING_CDMA_BOOL = "show_apn_setting_cdma_bool";
@@ -47440,6 +47462,7 @@
     field public static final long NETWORK_TYPE_BITMASK_IWLAN = 131072L; // 0x20000L
     field public static final long NETWORK_TYPE_BITMASK_LTE = 4096L; // 0x1000L
     field @Deprecated public static final long NETWORK_TYPE_BITMASK_LTE_CA = 262144L; // 0x40000L
+    field @FlaggedApi("com.android.internal.telephony.flags.satellite_system_apis") public static final long NETWORK_TYPE_BITMASK_NB_IOT_NTN = 1048576L; // 0x100000L
     field public static final long NETWORK_TYPE_BITMASK_NR = 524288L; // 0x80000L
     field public static final long NETWORK_TYPE_BITMASK_TD_SCDMA = 65536L; // 0x10000L
     field public static final long NETWORK_TYPE_BITMASK_UMTS = 4L; // 0x4L
@@ -47459,6 +47482,7 @@
     field @Deprecated public static final int NETWORK_TYPE_IDEN = 11; // 0xb
     field public static final int NETWORK_TYPE_IWLAN = 18; // 0x12
     field public static final int NETWORK_TYPE_LTE = 13; // 0xd
+    field @FlaggedApi("com.android.internal.telephony.flags.satellite_system_apis") public static final int NETWORK_TYPE_NB_IOT_NTN = 21; // 0x15
     field public static final int NETWORK_TYPE_NR = 20; // 0x14
     field public static final int NETWORK_TYPE_TD_SCDMA = 17; // 0x11
     field public static final int NETWORK_TYPE_UMTS = 3; // 0x3
@@ -55227,8 +55251,8 @@
     method public abstract void setTransformation(android.graphics.Matrix);
     method public abstract void setVisibility(int);
     method public abstract void setWebDomain(@Nullable String);
-    field @FlaggedApi("android.service.autofill.autofill_w_metrics") public static final String EXTRA_VIRTUAL_STRUCTURE_TYPE = "android.view.ViewStructure.extra.VIRTUAL_STRUCTURE_TYPE";
-    field @FlaggedApi("android.service.autofill.autofill_w_metrics") public static final String EXTRA_VIRTUAL_STRUCTURE_VERSION_NUMBER = "android.view.ViewStructure.extra.VIRTUAL_STRUCTURE_VERSION_NUMBER";
+    field @FlaggedApi("android.service.autofill.autofill_w_metrics") public static final String EXTRA_VIRTUAL_STRUCTURE_TYPE = "android.view.extra.VIRTUAL_STRUCTURE_TYPE";
+    field @FlaggedApi("android.service.autofill.autofill_w_metrics") public static final String EXTRA_VIRTUAL_STRUCTURE_VERSION_NUMBER = "android.view.extra.VIRTUAL_STRUCTURE_VERSION_NUMBER";
   }
 
   public abstract static class ViewStructure.HtmlInfo {
diff --git a/core/api/lint-baseline.txt b/core/api/lint-baseline.txt
index ad5bd31..e71dffa 100644
--- a/core/api/lint-baseline.txt
+++ b/core/api/lint-baseline.txt
@@ -1,10 +1,4 @@
 // Baseline format: 1.0
-ActionValue: android.view.ViewStructure#EXTRA_VIRTUAL_STRUCTURE_TYPE:
-    Inconsistent extra value; expected `android.view.extra.VIRTUAL_STRUCTURE_TYPE`, was `android.view.ViewStructure.extra.VIRTUAL_STRUCTURE_TYPE`
-ActionValue: android.view.ViewStructure#EXTRA_VIRTUAL_STRUCTURE_VERSION_NUMBER:
-    Inconsistent extra value; expected `android.view.extra.VIRTUAL_STRUCTURE_VERSION_NUMBER`, was `android.view.ViewStructure.extra.VIRTUAL_STRUCTURE_VERSION_NUMBER`
-
-
 BroadcastBehavior: android.app.AlarmManager#ACTION_NEXT_ALARM_CLOCK_CHANGED:
     Field 'ACTION_NEXT_ALARM_CLOCK_CHANGED' is missing @BroadcastBehavior
 BroadcastBehavior: android.app.AlarmManager#ACTION_SCHEDULE_EXACT_ALARM_PERMISSION_STATE_CHANGED:
@@ -1191,10 +1185,6 @@
     New API must be flagged with @FlaggedApi: field android.R.dimen.system_corner_radius_xlarge
 UnflaggedApi: android.R.dimen#system_corner_radius_xsmall:
     New API must be flagged with @FlaggedApi: field android.R.dimen.system_corner_radius_xsmall
-UnflaggedApi: android.R.integer#status_bar_notification_info_maxnum:
-    Changes from not deprecated to deprecated must be flagged with @FlaggedApi: field android.R.integer.status_bar_notification_info_maxnum
-UnflaggedApi: android.R.string#status_bar_notification_info_overflow:
-    Changes from not deprecated to deprecated must be flagged with @FlaggedApi: field android.R.string.status_bar_notification_info_overflow
 UnflaggedApi: android.accessibilityservice.AccessibilityService#OVERLAY_RESULT_INTERNAL_ERROR:
     New API must be flagged with @FlaggedApi: field android.accessibilityservice.AccessibilityService.OVERLAY_RESULT_INTERNAL_ERROR
 UnflaggedApi: android.accessibilityservice.AccessibilityService#OVERLAY_RESULT_INVALID:
diff --git a/core/api/system-current.txt b/core/api/system-current.txt
index edb30bd..4a4776d 100644
--- a/core/api/system-current.txt
+++ b/core/api/system-current.txt
@@ -328,6 +328,7 @@
     field public static final String READ_RUNTIME_PROFILES = "android.permission.READ_RUNTIME_PROFILES";
     field public static final String READ_SAFETY_CENTER_STATUS = "android.permission.READ_SAFETY_CENTER_STATUS";
     field public static final String READ_SEARCH_INDEXABLES = "android.permission.READ_SEARCH_INDEXABLES";
+    field @FlaggedApi("com.android.internal.telephony.flags.subscription_plan_allow_status_and_end_date") public static final String READ_SUBSCRIPTION_PLANS = "android.permission.READ_SUBSCRIPTION_PLANS";
     field @FlaggedApi("android.app.system_terms_of_address_enabled") public static final String READ_SYSTEM_GRAMMATICAL_GENDER = "android.permission.READ_SYSTEM_GRAMMATICAL_GENDER";
     field public static final String READ_SYSTEM_UPDATE_INFO = "android.permission.READ_SYSTEM_UPDATE_INFO";
     field public static final String READ_WALLPAPER_INTERNAL = "android.permission.READ_WALLPAPER_INTERNAL";
@@ -2276,149 +2277,6 @@
 
 }
 
-package android.app.ondeviceintelligence {
-
-  @FlaggedApi("android.app.ondeviceintelligence.flags.enable_on_device_intelligence") public interface DownloadCallback {
-    method public void onDownloadCompleted(@NonNull android.os.PersistableBundle);
-    method public void onDownloadFailed(int, @Nullable String, @NonNull android.os.PersistableBundle);
-    method public default void onDownloadProgress(long);
-    method public default void onDownloadStarted(long);
-    field public static final int DOWNLOAD_FAILURE_STATUS_DOWNLOADING = 3; // 0x3
-    field public static final int DOWNLOAD_FAILURE_STATUS_NETWORK_FAILURE = 2; // 0x2
-    field public static final int DOWNLOAD_FAILURE_STATUS_NOT_ENOUGH_DISK_SPACE = 1; // 0x1
-    field public static final int DOWNLOAD_FAILURE_STATUS_UNAVAILABLE = 4; // 0x4
-    field public static final int DOWNLOAD_FAILURE_STATUS_UNKNOWN = 0; // 0x0
-  }
-
-  @FlaggedApi("android.app.ondeviceintelligence.flags.enable_on_device_intelligence") public final class Feature implements android.os.Parcelable {
-    method public int describeContents();
-    method @NonNull public android.os.PersistableBundle getFeatureParams();
-    method public int getId();
-    method @Nullable public String getModelName();
-    method @Nullable public String getName();
-    method public int getType();
-    method public int getVariant();
-    method public void writeToParcel(@NonNull android.os.Parcel, int);
-    field @NonNull public static final android.os.Parcelable.Creator<android.app.ondeviceintelligence.Feature> CREATOR;
-  }
-
-  public static final class Feature.Builder {
-    ctor public Feature.Builder(int);
-    method @NonNull public android.app.ondeviceintelligence.Feature build();
-    method @NonNull public android.app.ondeviceintelligence.Feature.Builder setFeatureParams(@NonNull android.os.PersistableBundle);
-    method @NonNull public android.app.ondeviceintelligence.Feature.Builder setModelName(@NonNull String);
-    method @NonNull public android.app.ondeviceintelligence.Feature.Builder setName(@NonNull String);
-    method @NonNull public android.app.ondeviceintelligence.Feature.Builder setType(int);
-    method @NonNull public android.app.ondeviceintelligence.Feature.Builder setVariant(int);
-  }
-
-  @FlaggedApi("android.app.ondeviceintelligence.flags.enable_on_device_intelligence") public final class FeatureDetails implements android.os.Parcelable {
-    ctor public FeatureDetails(int, @NonNull android.os.PersistableBundle);
-    ctor public FeatureDetails(int);
-    method public int describeContents();
-    method @NonNull public android.os.PersistableBundle getFeatureDetailParams();
-    method public int getFeatureStatus();
-    method public void writeToParcel(@NonNull android.os.Parcel, int);
-    field @NonNull public static final android.os.Parcelable.Creator<android.app.ondeviceintelligence.FeatureDetails> CREATOR;
-    field public static final int FEATURE_STATUS_AVAILABLE = 3; // 0x3
-    field public static final int FEATURE_STATUS_DOWNLOADABLE = 1; // 0x1
-    field public static final int FEATURE_STATUS_DOWNLOADING = 2; // 0x2
-    field public static final int FEATURE_STATUS_SERVICE_UNAVAILABLE = 4; // 0x4
-    field public static final int FEATURE_STATUS_UNAVAILABLE = 0; // 0x0
-  }
-
-  @FlaggedApi("android.app.ondeviceintelligence.flags.enable_on_device_intelligence_module") public final class InferenceInfo implements android.os.Parcelable {
-    method public int describeContents();
-    method public long getEndTimeMillis();
-    method public long getStartTimeMillis();
-    method public long getSuspendedTimeMillis();
-    method public int getUid();
-    method public void writeToParcel(@NonNull android.os.Parcel, int);
-    field @NonNull public static final android.os.Parcelable.Creator<android.app.ondeviceintelligence.InferenceInfo> CREATOR;
-  }
-
-  public static final class InferenceInfo.Builder {
-    ctor public InferenceInfo.Builder(int);
-    method @NonNull public android.app.ondeviceintelligence.InferenceInfo build();
-    method @NonNull public android.app.ondeviceintelligence.InferenceInfo.Builder setEndTimeMillis(long);
-    method @NonNull public android.app.ondeviceintelligence.InferenceInfo.Builder setStartTimeMillis(long);
-    method @NonNull public android.app.ondeviceintelligence.InferenceInfo.Builder setSuspendedTimeMillis(long);
-  }
-
-  @FlaggedApi("android.app.ondeviceintelligence.flags.enable_on_device_intelligence") public class OnDeviceIntelligenceException extends java.lang.Exception {
-    ctor public OnDeviceIntelligenceException(int, @NonNull String, @NonNull android.os.PersistableBundle);
-    ctor public OnDeviceIntelligenceException(int, @NonNull android.os.PersistableBundle);
-    ctor public OnDeviceIntelligenceException(int, @NonNull String);
-    ctor public OnDeviceIntelligenceException(int);
-    method public int getErrorCode();
-    method @NonNull public android.os.PersistableBundle getErrorParams();
-    field public static final int ON_DEVICE_INTELLIGENCE_SERVICE_UNAVAILABLE = 100; // 0x64
-    field public static final int PROCESSING_ERROR_BAD_DATA = 2; // 0x2
-    field public static final int PROCESSING_ERROR_BAD_REQUEST = 3; // 0x3
-    field public static final int PROCESSING_ERROR_BUSY = 9; // 0x9
-    field public static final int PROCESSING_ERROR_CANCELLED = 7; // 0x7
-    field public static final int PROCESSING_ERROR_COMPUTE_ERROR = 5; // 0x5
-    field public static final int PROCESSING_ERROR_INTERNAL = 14; // 0xe
-    field public static final int PROCESSING_ERROR_IPC_ERROR = 6; // 0x6
-    field public static final int PROCESSING_ERROR_NOT_AVAILABLE = 8; // 0x8
-    field public static final int PROCESSING_ERROR_REQUEST_NOT_SAFE = 4; // 0x4
-    field public static final int PROCESSING_ERROR_REQUEST_TOO_LARGE = 12; // 0xc
-    field public static final int PROCESSING_ERROR_RESPONSE_NOT_SAFE = 11; // 0xb
-    field public static final int PROCESSING_ERROR_SAFETY_ERROR = 10; // 0xa
-    field public static final int PROCESSING_ERROR_SERVICE_UNAVAILABLE = 15; // 0xf
-    field public static final int PROCESSING_ERROR_SUSPENDED = 13; // 0xd
-    field public static final int PROCESSING_ERROR_UNKNOWN = 1; // 0x1
-    field public static final int PROCESSING_UPDATE_STATUS_CONNECTION_FAILED = 200; // 0xc8
-  }
-
-  @FlaggedApi("android.app.ondeviceintelligence.flags.enable_on_device_intelligence") public final class OnDeviceIntelligenceManager {
-    method @RequiresPermission(android.Manifest.permission.USE_ON_DEVICE_INTELLIGENCE) public void getFeature(int, @NonNull java.util.concurrent.Executor, @NonNull android.os.OutcomeReceiver<android.app.ondeviceintelligence.Feature,android.app.ondeviceintelligence.OnDeviceIntelligenceException>);
-    method @RequiresPermission(android.Manifest.permission.USE_ON_DEVICE_INTELLIGENCE) public void getFeatureDetails(@NonNull android.app.ondeviceintelligence.Feature, @NonNull java.util.concurrent.Executor, @NonNull android.os.OutcomeReceiver<android.app.ondeviceintelligence.FeatureDetails,android.app.ondeviceintelligence.OnDeviceIntelligenceException>);
-    method @FlaggedApi("android.app.ondeviceintelligence.flags.enable_on_device_intelligence_module") @NonNull @RequiresPermission(android.Manifest.permission.DUMP) public java.util.List<android.app.ondeviceintelligence.InferenceInfo> getLatestInferenceInfo(long);
-    method @Nullable @RequiresPermission(android.Manifest.permission.USE_ON_DEVICE_INTELLIGENCE) public String getRemoteServicePackageName();
-    method @RequiresPermission(android.Manifest.permission.USE_ON_DEVICE_INTELLIGENCE) public void getVersion(@NonNull java.util.concurrent.Executor, @NonNull java.util.function.LongConsumer);
-    method @RequiresPermission(android.Manifest.permission.USE_ON_DEVICE_INTELLIGENCE) public void listFeatures(@NonNull java.util.concurrent.Executor, @NonNull android.os.OutcomeReceiver<java.util.List<android.app.ondeviceintelligence.Feature>,android.app.ondeviceintelligence.OnDeviceIntelligenceException>);
-    method @RequiresPermission(android.Manifest.permission.USE_ON_DEVICE_INTELLIGENCE) public void processRequest(@NonNull android.app.ondeviceintelligence.Feature, @NonNull android.os.Bundle, int, @Nullable android.os.CancellationSignal, @Nullable android.app.ondeviceintelligence.ProcessingSignal, @NonNull java.util.concurrent.Executor, @NonNull android.app.ondeviceintelligence.ProcessingCallback);
-    method @RequiresPermission(android.Manifest.permission.USE_ON_DEVICE_INTELLIGENCE) public void processRequestStreaming(@NonNull android.app.ondeviceintelligence.Feature, @NonNull android.os.Bundle, int, @Nullable android.os.CancellationSignal, @Nullable android.app.ondeviceintelligence.ProcessingSignal, @NonNull java.util.concurrent.Executor, @NonNull android.app.ondeviceintelligence.StreamingProcessingCallback);
-    method @RequiresPermission(android.Manifest.permission.USE_ON_DEVICE_INTELLIGENCE) public void requestFeatureDownload(@NonNull android.app.ondeviceintelligence.Feature, @Nullable android.os.CancellationSignal, @NonNull java.util.concurrent.Executor, @NonNull android.app.ondeviceintelligence.DownloadCallback);
-    method @RequiresPermission(android.Manifest.permission.USE_ON_DEVICE_INTELLIGENCE) public void requestTokenInfo(@NonNull android.app.ondeviceintelligence.Feature, @NonNull android.os.Bundle, @Nullable android.os.CancellationSignal, @NonNull java.util.concurrent.Executor, @NonNull android.os.OutcomeReceiver<android.app.ondeviceintelligence.TokenInfo,android.app.ondeviceintelligence.OnDeviceIntelligenceException>);
-    field public static final int REQUEST_TYPE_EMBEDDINGS = 2; // 0x2
-    field public static final int REQUEST_TYPE_INFERENCE = 0; // 0x0
-    field public static final int REQUEST_TYPE_PREPARE = 1; // 0x1
-  }
-
-  @FlaggedApi("android.app.ondeviceintelligence.flags.enable_on_device_intelligence") public interface ProcessingCallback {
-    method public default void onDataAugmentRequest(@NonNull android.os.Bundle, @NonNull java.util.function.Consumer<android.os.Bundle>);
-    method public void onError(@NonNull android.app.ondeviceintelligence.OnDeviceIntelligenceException);
-    method public void onResult(@NonNull android.os.Bundle);
-  }
-
-  @FlaggedApi("android.app.ondeviceintelligence.flags.enable_on_device_intelligence") public final class ProcessingSignal {
-    ctor public ProcessingSignal();
-    method public void sendSignal(@NonNull android.os.PersistableBundle);
-    method public void setOnProcessingSignalCallback(@NonNull java.util.concurrent.Executor, @Nullable android.app.ondeviceintelligence.ProcessingSignal.OnProcessingSignalCallback);
-  }
-
-  public static interface ProcessingSignal.OnProcessingSignalCallback {
-    method public void onSignalReceived(@NonNull android.os.PersistableBundle);
-  }
-
-  @FlaggedApi("android.app.ondeviceintelligence.flags.enable_on_device_intelligence") public interface StreamingProcessingCallback extends android.app.ondeviceintelligence.ProcessingCallback {
-    method public void onPartialResult(@NonNull android.os.Bundle);
-  }
-
-  @FlaggedApi("android.app.ondeviceintelligence.flags.enable_on_device_intelligence") public final class TokenInfo implements android.os.Parcelable {
-    ctor public TokenInfo(long, @NonNull android.os.PersistableBundle);
-    ctor public TokenInfo(long);
-    method public int describeContents();
-    method public long getCount();
-    method @NonNull public android.os.PersistableBundle getInfoParams();
-    method public void writeToParcel(@NonNull android.os.Parcel, int);
-    field @NonNull public static final android.os.Parcelable.Creator<android.app.ondeviceintelligence.TokenInfo> CREATOR;
-  }
-
-}
-
 package android.app.people {
 
   public final class PeopleManager {
@@ -8129,12 +7987,13 @@
 package android.media.quality {
 
   @FlaggedApi("android.media.tv.flags.media_quality_fw") public final class MediaQualityManager {
+    method public void addGlobalActiveProcessingPictureListener(@NonNull java.util.concurrent.Executor, @NonNull android.media.quality.MediaQualityManager.ActiveProcessingPictureListener);
     method @NonNull public java.util.List<java.lang.String> getPictureProfileAllowList();
     method @NonNull public java.util.List<java.lang.String> getPictureProfilePackageNames();
-    method @NonNull public java.util.List<android.media.quality.PictureProfile> getPictureProfilesByPackage(@NonNull String);
+    method @NonNull public java.util.List<android.media.quality.PictureProfile> getPictureProfilesByPackage(@NonNull String, boolean);
     method @NonNull public java.util.List<java.lang.String> getSoundProfileAllowList();
     method @NonNull public java.util.List<java.lang.String> getSoundProfilePackageNames();
-    method @NonNull public java.util.List<android.media.quality.SoundProfile> getSoundProfilesByPackage(@NonNull String);
+    method @NonNull public java.util.List<android.media.quality.SoundProfile> getSoundProfilesByPackage(@NonNull String, boolean);
     method public void setAutoPictureQualityEnabled(boolean);
     method public void setAutoSoundQualityEnabled(boolean);
     method public boolean setDefaultPictureProfile(@Nullable String);
@@ -13791,39 +13650,6 @@
 
 }
 
-package android.service.ondeviceintelligence {
-
-  @FlaggedApi("android.app.ondeviceintelligence.flags.enable_on_device_intelligence") public abstract class OnDeviceIntelligenceService extends android.app.Service {
-    ctor public OnDeviceIntelligenceService();
-    method @Nullable public final android.os.IBinder onBind(@NonNull android.content.Intent);
-    method public abstract void onDownloadFeature(int, @NonNull android.app.ondeviceintelligence.Feature, @Nullable android.os.CancellationSignal, @NonNull android.app.ondeviceintelligence.DownloadCallback);
-    method public abstract void onGetFeature(int, int, @NonNull android.os.OutcomeReceiver<android.app.ondeviceintelligence.Feature,android.app.ondeviceintelligence.OnDeviceIntelligenceException>);
-    method public abstract void onGetFeatureDetails(int, @NonNull android.app.ondeviceintelligence.Feature, @NonNull android.os.OutcomeReceiver<android.app.ondeviceintelligence.FeatureDetails,android.app.ondeviceintelligence.OnDeviceIntelligenceException>);
-    method public abstract void onGetReadOnlyFeatureFileDescriptorMap(@NonNull android.app.ondeviceintelligence.Feature, @NonNull java.util.function.Consumer<java.util.Map<java.lang.String,android.os.ParcelFileDescriptor>>);
-    method public abstract void onGetVersion(@NonNull java.util.function.LongConsumer);
-    method public abstract void onInferenceServiceConnected();
-    method public abstract void onInferenceServiceDisconnected();
-    method public abstract void onListFeatures(int, @NonNull android.os.OutcomeReceiver<java.util.List<android.app.ondeviceintelligence.Feature>,android.app.ondeviceintelligence.OnDeviceIntelligenceException>);
-    method public final void updateProcessingState(@NonNull android.os.Bundle, @NonNull java.util.concurrent.Executor, @NonNull android.os.OutcomeReceiver<android.os.PersistableBundle,android.app.ondeviceintelligence.OnDeviceIntelligenceException>);
-    field public static final String SERVICE_INTERFACE = "android.service.ondeviceintelligence.OnDeviceIntelligenceService";
-  }
-
-  @FlaggedApi("android.app.ondeviceintelligence.flags.enable_on_device_intelligence") public abstract class OnDeviceSandboxedInferenceService extends android.app.Service {
-    ctor public OnDeviceSandboxedInferenceService();
-    method public final void fetchFeatureFileDescriptorMap(@NonNull android.app.ondeviceintelligence.Feature, @NonNull java.util.concurrent.Executor, @NonNull java.util.function.Consumer<java.util.Map<java.lang.String,android.os.ParcelFileDescriptor>>);
-    method @NonNull public java.util.concurrent.Executor getCallbackExecutor();
-    method public final void getReadOnlyFileDescriptor(@NonNull String, @NonNull java.util.concurrent.Executor, @NonNull java.util.function.Consumer<android.os.ParcelFileDescriptor>) throws java.io.FileNotFoundException;
-    method @Nullable public final android.os.IBinder onBind(@NonNull android.content.Intent);
-    method @NonNull public abstract void onProcessRequest(int, @NonNull android.app.ondeviceintelligence.Feature, @NonNull android.os.Bundle, int, @Nullable android.os.CancellationSignal, @Nullable android.app.ondeviceintelligence.ProcessingSignal, @NonNull android.app.ondeviceintelligence.ProcessingCallback);
-    method @NonNull public abstract void onProcessRequestStreaming(int, @NonNull android.app.ondeviceintelligence.Feature, @NonNull android.os.Bundle, int, @Nullable android.os.CancellationSignal, @Nullable android.app.ondeviceintelligence.ProcessingSignal, @NonNull android.app.ondeviceintelligence.StreamingProcessingCallback);
-    method @NonNull public abstract void onTokenInfoRequest(int, @NonNull android.app.ondeviceintelligence.Feature, @NonNull android.os.Bundle, @Nullable android.os.CancellationSignal, @NonNull android.os.OutcomeReceiver<android.app.ondeviceintelligence.TokenInfo,android.app.ondeviceintelligence.OnDeviceIntelligenceException>);
-    method public abstract void onUpdateProcessingState(@NonNull android.os.Bundle, @NonNull android.os.OutcomeReceiver<android.os.PersistableBundle,android.app.ondeviceintelligence.OnDeviceIntelligenceException>);
-    method public final java.io.FileInputStream openFileInput(@NonNull String) throws java.io.FileNotFoundException;
-    field public static final String SERVICE_INTERFACE = "android.service.ondeviceintelligence.OnDeviceSandboxedInferenceService";
-  }
-
-}
-
 package android.service.persistentdata {
 
   @FlaggedApi("android.security.frp_enforcement") public class PersistentDataBlockManager {
@@ -18825,6 +18651,10 @@
     method @FlaggedApi("com.android.internal.telephony.flags.oem_enabled_satellite_flag") public void onSatelliteDatagramReceived(long, @NonNull android.telephony.satellite.SatelliteDatagram, int, @NonNull java.util.function.Consumer<java.lang.Void>);
   }
 
+  @FlaggedApi("com.android.internal.telephony.flags.satellite_system_apis") public interface SatelliteDisallowedReasonsCallback {
+    method public void onSatelliteDisallowedReasonsChanged(@NonNull int[]);
+  }
+
   @FlaggedApi("com.android.internal.telephony.flags.satellite_system_apis") public final class SatelliteInfo implements android.os.Parcelable {
     method public int describeContents();
     method @NonNull public java.util.List<java.lang.Integer> getBands();
@@ -18840,6 +18670,7 @@
     method @FlaggedApi("com.android.internal.telephony.flags.satellite_system_apis") @RequiresPermission(android.Manifest.permission.SATELLITE_COMMUNICATION) public void deprovisionSatellite(@NonNull java.util.List<android.telephony.satellite.SatelliteSubscriberInfo>, @NonNull java.util.concurrent.Executor, @NonNull android.os.OutcomeReceiver<java.lang.Boolean,android.telephony.satellite.SatelliteManager.SatelliteException>);
     method @FlaggedApi("com.android.internal.telephony.flags.oem_enabled_satellite_flag") @RequiresPermission(android.Manifest.permission.SATELLITE_COMMUNICATION) public void deprovisionService(@NonNull String, @NonNull java.util.concurrent.Executor, @NonNull java.util.function.Consumer<java.lang.Integer>);
     method @FlaggedApi("com.android.internal.telephony.flags.carrier_enabled_satellite_flag") @NonNull @RequiresPermission(android.Manifest.permission.SATELLITE_COMMUNICATION) public java.util.Set<java.lang.Integer> getAttachRestrictionReasonsForCarrier(int);
+    method @FlaggedApi("com.android.internal.telephony.flags.satellite_system_apis") @NonNull @RequiresPermission(android.Manifest.permission.SATELLITE_COMMUNICATION) public int[] getSatelliteDisallowedReasons();
     method @FlaggedApi("com.android.internal.telephony.flags.carrier_enabled_satellite_flag") @NonNull @RequiresPermission(android.Manifest.permission.SATELLITE_COMMUNICATION) public java.util.List<java.lang.String> getSatellitePlmnsForCarrier(int);
     method @FlaggedApi("com.android.internal.telephony.flags.oem_enabled_satellite_flag") @RequiresPermission(android.Manifest.permission.SATELLITE_COMMUNICATION) public void pollPendingDatagrams(@NonNull java.util.concurrent.Executor, @NonNull java.util.function.Consumer<java.lang.Integer>);
     method @FlaggedApi("com.android.internal.telephony.flags.satellite_system_apis") @RequiresPermission(android.Manifest.permission.SATELLITE_COMMUNICATION) public void provisionSatellite(@NonNull java.util.List<android.telephony.satellite.SatelliteSubscriberInfo>, @NonNull java.util.concurrent.Executor, @NonNull android.os.OutcomeReceiver<java.lang.Boolean,android.telephony.satellite.SatelliteManager.SatelliteException>);
@@ -18850,6 +18681,8 @@
     method @FlaggedApi("com.android.internal.telephony.flags.oem_enabled_satellite_flag") @RequiresPermission(android.Manifest.permission.SATELLITE_COMMUNICATION) public int registerForModemStateChanged(@NonNull java.util.concurrent.Executor, @NonNull android.telephony.satellite.SatelliteModemStateCallback);
     method @FlaggedApi("com.android.internal.telephony.flags.oem_enabled_satellite_flag") @RequiresPermission(android.Manifest.permission.SATELLITE_COMMUNICATION) public void registerForNtnSignalStrengthChanged(@NonNull java.util.concurrent.Executor, @NonNull android.telephony.satellite.NtnSignalStrengthCallback);
     method @FlaggedApi("com.android.internal.telephony.flags.oem_enabled_satellite_flag") @RequiresPermission(android.Manifest.permission.SATELLITE_COMMUNICATION) public int registerForProvisionStateChanged(@NonNull java.util.concurrent.Executor, @NonNull android.telephony.satellite.SatelliteProvisionStateCallback);
+    method @FlaggedApi("com.android.internal.telephony.flags.satellite_system_apis") @RequiresPermission(android.Manifest.permission.SATELLITE_COMMUNICATION) public void registerForSatelliteDisallowedReasonsChanged(@NonNull java.util.concurrent.Executor, @NonNull android.telephony.satellite.SatelliteDisallowedReasonsCallback);
+    method @FlaggedApi("com.android.internal.telephony.flags.satellite_system_apis") @RequiresPermission(android.Manifest.permission.SATELLITE_COMMUNICATION) public int registerForSelectedNbIotSatelliteSubscriptionChanged(@NonNull java.util.concurrent.Executor, @NonNull android.telephony.satellite.SelectedNbIotSatelliteSubscriptionCallback);
     method @FlaggedApi("com.android.internal.telephony.flags.satellite_system_apis") @RequiresPermission(android.Manifest.permission.SATELLITE_COMMUNICATION) public int registerForSupportedStateChanged(@NonNull java.util.concurrent.Executor, @NonNull android.telephony.satellite.SatelliteSupportedStateCallback);
     method @FlaggedApi("com.android.internal.telephony.flags.carrier_enabled_satellite_flag") @RequiresPermission(android.Manifest.permission.SATELLITE_COMMUNICATION) public void removeAttachRestrictionForCarrier(int, int, @NonNull java.util.concurrent.Executor, @NonNull java.util.function.Consumer<java.lang.Integer>);
     method @FlaggedApi("com.android.internal.telephony.flags.carrier_enabled_satellite_flag") @RequiresPermission(android.Manifest.permission.SATELLITE_COMMUNICATION) public void requestAttachEnabledForCarrier(int, boolean, @NonNull java.util.concurrent.Executor, @NonNull java.util.function.Consumer<java.lang.Integer>);
@@ -18863,7 +18696,10 @@
     method @FlaggedApi("com.android.internal.telephony.flags.oem_enabled_satellite_flag") @RequiresPermission(android.Manifest.permission.SATELLITE_COMMUNICATION) public void requestIsProvisioned(@NonNull java.util.concurrent.Executor, @NonNull android.os.OutcomeReceiver<java.lang.Boolean,android.telephony.satellite.SatelliteManager.SatelliteException>);
     method @FlaggedApi("com.android.internal.telephony.flags.oem_enabled_satellite_flag") public void requestIsSupported(@NonNull java.util.concurrent.Executor, @NonNull android.os.OutcomeReceiver<java.lang.Boolean,android.telephony.satellite.SatelliteManager.SatelliteException>);
     method @FlaggedApi("com.android.internal.telephony.flags.oem_enabled_satellite_flag") @RequiresPermission(android.Manifest.permission.SATELLITE_COMMUNICATION) public void requestNtnSignalStrength(@NonNull java.util.concurrent.Executor, @NonNull android.os.OutcomeReceiver<android.telephony.satellite.NtnSignalStrength,android.telephony.satellite.SatelliteManager.SatelliteException>);
+    method @FlaggedApi("com.android.internal.telephony.flags.satellite_system_apis") @RequiresPermission(android.Manifest.permission.SATELLITE_COMMUNICATION) public void requestSatelliteAccessConfigurationForCurrentLocation(@NonNull java.util.concurrent.Executor, @NonNull android.os.OutcomeReceiver<android.telephony.satellite.SatelliteAccessConfiguration,android.telephony.satellite.SatelliteManager.SatelliteException>);
+    method @FlaggedApi("com.android.internal.telephony.flags.satellite_system_apis") @RequiresPermission(android.Manifest.permission.SATELLITE_COMMUNICATION) public void requestSatelliteDisplayName(@NonNull java.util.concurrent.Executor, @NonNull android.os.OutcomeReceiver<java.lang.CharSequence,android.telephony.satellite.SatelliteManager.SatelliteException>);
     method @FlaggedApi("com.android.internal.telephony.flags.satellite_system_apis") @RequiresPermission(android.Manifest.permission.SATELLITE_COMMUNICATION) public void requestSatelliteSubscriberProvisionStatus(@NonNull java.util.concurrent.Executor, @NonNull android.os.OutcomeReceiver<java.util.List<android.telephony.satellite.SatelliteSubscriberProvisionStatus>,android.telephony.satellite.SatelliteManager.SatelliteException>);
+    method @FlaggedApi("com.android.internal.telephony.flags.satellite_system_apis") @RequiresPermission(android.Manifest.permission.SATELLITE_COMMUNICATION) public void requestSelectedNbIotSatelliteSubscriptionId(@NonNull java.util.concurrent.Executor, @NonNull android.os.OutcomeReceiver<java.lang.Integer,android.telephony.satellite.SatelliteManager.SatelliteException>);
     method @FlaggedApi("com.android.internal.telephony.flags.oem_enabled_satellite_flag") @RequiresPermission(android.Manifest.permission.SATELLITE_COMMUNICATION) public void requestTimeForNextSatelliteVisibility(@NonNull java.util.concurrent.Executor, @NonNull android.os.OutcomeReceiver<java.time.Duration,android.telephony.satellite.SatelliteManager.SatelliteException>);
     method @FlaggedApi("com.android.internal.telephony.flags.oem_enabled_satellite_flag") @RequiresPermission(android.Manifest.permission.SATELLITE_COMMUNICATION) public void sendDatagram(int, @NonNull android.telephony.satellite.SatelliteDatagram, boolean, @NonNull java.util.concurrent.Executor, @NonNull java.util.function.Consumer<java.lang.Integer>);
     method @FlaggedApi("com.android.internal.telephony.flags.oem_enabled_satellite_flag") @RequiresPermission(android.Manifest.permission.SATELLITE_COMMUNICATION) public void setDeviceAlignedWithSatellite(boolean);
@@ -18875,6 +18711,8 @@
     method @FlaggedApi("com.android.internal.telephony.flags.oem_enabled_satellite_flag") @RequiresPermission(android.Manifest.permission.SATELLITE_COMMUNICATION) public void unregisterForModemStateChanged(@NonNull android.telephony.satellite.SatelliteModemStateCallback);
     method @FlaggedApi("com.android.internal.telephony.flags.oem_enabled_satellite_flag") @RequiresPermission(android.Manifest.permission.SATELLITE_COMMUNICATION) public void unregisterForNtnSignalStrengthChanged(@NonNull android.telephony.satellite.NtnSignalStrengthCallback);
     method @FlaggedApi("com.android.internal.telephony.flags.oem_enabled_satellite_flag") @RequiresPermission(android.Manifest.permission.SATELLITE_COMMUNICATION) public void unregisterForProvisionStateChanged(@NonNull android.telephony.satellite.SatelliteProvisionStateCallback);
+    method @FlaggedApi("com.android.internal.telephony.flags.satellite_system_apis") @RequiresPermission(android.Manifest.permission.SATELLITE_COMMUNICATION) public void unregisterForSatelliteDisallowedReasonsChanged(@NonNull android.telephony.satellite.SatelliteDisallowedReasonsCallback);
+    method @FlaggedApi("com.android.internal.telephony.flags.satellite_system_apis") @RequiresPermission(android.Manifest.permission.SATELLITE_COMMUNICATION) public void unregisterForSelectedNbIotSatelliteSubscriptionChanged(@NonNull android.telephony.satellite.SelectedNbIotSatelliteSubscriptionCallback);
     method @FlaggedApi("com.android.internal.telephony.flags.satellite_system_apis") @RequiresPermission(android.Manifest.permission.SATELLITE_COMMUNICATION) public void unregisterForSupportedStateChanged(@NonNull android.telephony.satellite.SatelliteSupportedStateCallback);
     field @FlaggedApi("com.android.internal.telephony.flags.satellite_system_apis") public static final String ACTION_SATELLITE_START_NON_EMERGENCY_SESSION = "android.telephony.satellite.action.SATELLITE_START_NON_EMERGENCY_SESSION";
     field @FlaggedApi("com.android.internal.telephony.flags.satellite_system_apis") public static final String ACTION_SATELLITE_SUBSCRIBER_ID_LIST_CHANGED = "android.telephony.satellite.action.SATELLITE_SUBSCRIBER_ID_LIST_CHANGED";
@@ -18946,6 +18784,7 @@
     field @FlaggedApi("com.android.internal.telephony.flags.oem_enabled_satellite_flag") public static final int SATELLITE_RESULT_NOT_REACHABLE = 18; // 0x12
     field @FlaggedApi("com.android.internal.telephony.flags.oem_enabled_satellite_flag") public static final int SATELLITE_RESULT_NOT_SUPPORTED = 20; // 0x14
     field @FlaggedApi("com.android.internal.telephony.flags.oem_enabled_satellite_flag") public static final int SATELLITE_RESULT_NO_RESOURCES = 12; // 0xc
+    field @FlaggedApi("com.android.internal.telephony.flags.satellite_system_apis") public static final int SATELLITE_RESULT_NO_VALID_SATELLITE_SUBSCRIPTION = 30; // 0x1e
     field @FlaggedApi("com.android.internal.telephony.flags.oem_enabled_satellite_flag") public static final int SATELLITE_RESULT_RADIO_NOT_AVAILABLE = 10; // 0xa
     field @FlaggedApi("com.android.internal.telephony.flags.oem_enabled_satellite_flag") public static final int SATELLITE_RESULT_REQUEST_ABORTED = 15; // 0xf
     field @FlaggedApi("com.android.internal.telephony.flags.oem_enabled_satellite_flag") public static final int SATELLITE_RESULT_REQUEST_FAILED = 9; // 0x9
@@ -19048,6 +18887,10 @@
     method @FlaggedApi("com.android.internal.telephony.flags.satellite_system_apis") public default void onSendDatagramStateChanged(int, int, int, int);
   }
 
+  @FlaggedApi("com.android.internal.telephony.flags.satellite_system_apis") public interface SelectedNbIotSatelliteSubscriptionCallback {
+    method public void onSelectedNbIotSatelliteSubscriptionChanged(int);
+  }
+
   @FlaggedApi("com.android.internal.telephony.flags.satellite_system_apis") public final class SystemSelectionSpecifier implements android.os.Parcelable {
     method public int describeContents();
     method @NonNull public int[] getBands();
diff --git a/core/api/test-current.txt b/core/api/test-current.txt
index 0a806c7..6230a59 100644
--- a/core/api/test-current.txt
+++ b/core/api/test-current.txt
@@ -3247,14 +3247,6 @@
 
 }
 
-package android.service.ondeviceintelligence {
-
-  @FlaggedApi("android.app.ondeviceintelligence.flags.enable_on_device_intelligence") public abstract class OnDeviceIntelligenceService extends android.app.Service {
-    method public void onReady();
-  }
-
-}
-
 package android.service.quickaccesswallet {
 
   public interface QuickAccessWalletClient extends java.io.Closeable {
diff --git a/core/api/test-lint-baseline.txt b/core/api/test-lint-baseline.txt
index 9140bdf..349b4ed 100644
--- a/core/api/test-lint-baseline.txt
+++ b/core/api/test-lint-baseline.txt
@@ -1,10 +1,4 @@
 // Baseline format: 1.0
-ActionValue: android.view.contentcapture.ViewNode.ViewStructureImpl#EXTRA_VIRTUAL_STRUCTURE_TYPE:
-    Inconsistent extra value; expected `android.view.contentcapture.extra.VIRTUAL_STRUCTURE_TYPE`, was `android.view.ViewStructure.extra.VIRTUAL_STRUCTURE_TYPE`
-ActionValue: android.view.contentcapture.ViewNode.ViewStructureImpl#EXTRA_VIRTUAL_STRUCTURE_VERSION_NUMBER:
-    Inconsistent extra value; expected `android.view.contentcapture.extra.VIRTUAL_STRUCTURE_VERSION_NUMBER`, was `android.view.ViewStructure.extra.VIRTUAL_STRUCTURE_VERSION_NUMBER`
-
-
 BannedThrow: android.os.vibrator.persistence.VibrationXmlSerializer#serialize(android.os.VibrationEffect, java.io.Writer):
     Methods must not throw unchecked exceptions
 
diff --git a/core/java/android/app/ActivityManager.java b/core/java/android/app/ActivityManager.java
index 33ba058..69d3e8d 100644
--- a/core/java/android/app/ActivityManager.java
+++ b/core/java/android/app/ActivityManager.java
@@ -1189,6 +1189,18 @@
         return procState == PROCESS_STATE_FOREGROUND_SERVICE;
     }
 
+    /** @hide Should this process state be considered jank perceptible? */
+    public static final boolean isProcStateJankPerceptible(int procState) {
+        if (Flags.jankPerceptibleNarrow()) {
+            return procState == PROCESS_STATE_PERSISTENT_UI
+                || procState == PROCESS_STATE_TOP
+                || procState == PROCESS_STATE_IMPORTANT_FOREGROUND
+                || procState == PROCESS_STATE_TOP_SLEEPING;
+        } else {
+            return !isProcStateCached(procState);
+        }
+    }
+
     /** @hide requestType for assist context: only basic information. */
     public static final int ASSIST_CONTEXT_BASIC = 0;
 
diff --git a/core/java/android/app/ActivityManagerInternal.java b/core/java/android/app/ActivityManagerInternal.java
index eccb6ff..abdfb535 100644
--- a/core/java/android/app/ActivityManagerInternal.java
+++ b/core/java/android/app/ActivityManagerInternal.java
@@ -44,6 +44,8 @@
 import android.os.PowerExemptionManager.TempAllowListType;
 import android.os.TransactionTooLargeException;
 import android.os.WorkSource;
+import android.os.instrumentation.IOffsetCallback;
+import android.os.instrumentation.MethodDescriptor;
 import android.util.ArraySet;
 import android.util.Pair;
 
@@ -1352,6 +1354,14 @@
             String reason, int exitInfoReason);
 
     /**
+     * Queries the offset data for a given method on a process.
+     * @hide
+     */
+    public abstract void getExecutableMethodFileOffsets(@NonNull String processName,
+            int pid, int uid, @NonNull MethodDescriptor methodDescriptor,
+            @NonNull IOffsetCallback callback);
+
+    /**
      * Add a creator token for all embedded intents (stored as extra) of the given intent.
      *
      * @param intent The given intent
diff --git a/core/java/android/app/ActivityThread.java b/core/java/android/app/ActivityThread.java
index 27661ce..48b74f2 100644
--- a/core/java/android/app/ActivityThread.java
+++ b/core/java/android/app/ActivityThread.java
@@ -165,6 +165,10 @@
 import android.os.Trace;
 import android.os.UserHandle;
 import android.os.UserManager;
+import android.os.instrumentation.ExecutableMethodFileOffsets;
+import android.os.instrumentation.IOffsetCallback;
+import android.os.instrumentation.MethodDescriptor;
+import android.os.instrumentation.MethodDescriptorParser;
 import android.permission.IPermissionManager;
 import android.provider.BlockedNumberContract;
 import android.provider.CalendarContract;
@@ -2236,6 +2240,29 @@
             args.arg6 = uiTranslationSpec;
             sendMessage(H.UPDATE_UI_TRANSLATION_STATE, args);
         }
+
+        @Override
+        public void getExecutableMethodFileOffsets(
+                @NonNull MethodDescriptor methodDescriptor,
+                @NonNull IOffsetCallback resultCallback) {
+            Method method = MethodDescriptorParser.parseMethodDescriptor(
+                    getClass().getClassLoader(), methodDescriptor);
+            VMDebug.ExecutableMethodFileOffsets location =
+                    VMDebug.getExecutableMethodFileOffsets(method);
+            try {
+                if (location == null) {
+                    resultCallback.onResult(null);
+                    return;
+                }
+                ExecutableMethodFileOffsets ret = new ExecutableMethodFileOffsets();
+                ret.containerPath = location.getContainerPath();
+                ret.containerOffset = location.getContainerOffset();
+                ret.methodOffset = location.getMethodOffset();
+                resultCallback.onResult(ret);
+            } catch (RemoteException e) {
+                throw e.rethrowFromSystemServer();
+            }
+        }
     }
 
     private @NonNull SafeCancellationTransport createSafeCancellationTransport(
@@ -3918,12 +3945,7 @@
             if (mLastProcessState == processState) {
                 return;
             }
-            // Do not issue a transitional GC if we are transitioning between 2 cached states.
-            // Only update if the state flips between cached and uncached or vice versa
-            if (ActivityManager.isProcStateCached(mLastProcessState)
-                    != ActivityManager.isProcStateCached(processState)) {
-                updateVmProcessState(processState);
-            }
+            updateVmProcessState(mLastProcessState, processState);
             mLastProcessState = processState;
             if (localLOGV) {
                 Slog.i(TAG, "******************* PROCESS STATE CHANGED TO: " + processState
@@ -3932,18 +3954,21 @@
         }
     }
 
+    /** Converts a process state to a VM process state. */
+    private static int toVmProcessState(int processState) {
+        final int state = ActivityManager.isProcStateJankPerceptible(processState)
+                ? VM_PROCESS_STATE_JANK_PERCEPTIBLE
+                : VM_PROCESS_STATE_JANK_IMPERCEPTIBLE;
+        return state;
+    }
+
     /** Update VM state based on ActivityManager.PROCESS_STATE_* constants. */
-    // Currently ART VM only uses state updates for Transitional GC, and thus
-    // this function initiates a Transitional GC for transitions into Cached apps states.
-    private void updateVmProcessState(int processState) {
-        // Only a transition into Cached state should result in a Transitional GC request
-        // to the ART runtime. Update VM state to JANK_IMPERCEPTIBLE in that case.
-        // Note that there are 4 possible cached states currently, all of which are
-        // JANK_IMPERCEPTIBLE from GC point of view.
-        final int state = ActivityManager.isProcStateCached(processState)
-                ? VM_PROCESS_STATE_JANK_IMPERCEPTIBLE
-                : VM_PROCESS_STATE_JANK_PERCEPTIBLE;
-        VMRuntime.getRuntime().updateProcessState(state);
+    private void updateVmProcessState(int lastProcessState, int newProcessState) {
+        final int state = toVmProcessState(newProcessState);
+        if (lastProcessState == PROCESS_STATE_UNKNOWN
+                || state != toVmProcessState(lastProcessState)) {
+            VMRuntime.getRuntime().updateProcessState(state);
+        }
     }
 
     @Override
diff --git a/core/java/android/app/IApplicationThread.aidl b/core/java/android/app/IApplicationThread.aidl
index 06d01ec..063501b 100644
--- a/core/java/android/app/IApplicationThread.aidl
+++ b/core/java/android/app/IApplicationThread.aidl
@@ -46,6 +46,8 @@
 import android.os.PersistableBundle;
 import android.os.RemoteCallback;
 import android.os.SharedMemory;
+import android.os.instrumentation.IOffsetCallback;
+import android.os.instrumentation.MethodDescriptor;
 import android.view.autofill.AutofillId;
 import android.view.translation.TranslationSpec;
 import android.view.translation.UiTranslationSpec;
@@ -183,4 +185,6 @@
     void scheduleTimeoutService(IBinder token, int startId);
     void scheduleTimeoutServiceForType(IBinder token, int startId, int fgsType);
     void schedulePing(in RemoteCallback pong);
+    void getExecutableMethodFileOffsets(in MethodDescriptor methodDescriptor,
+            in IOffsetCallback resultCallback);
 }
diff --git a/core/java/android/app/Notification.java b/core/java/android/app/Notification.java
index a4d8a5c..7e998d9 100644
--- a/core/java/android/app/Notification.java
+++ b/core/java/android/app/Notification.java
@@ -3221,7 +3221,6 @@
     /**
      * @hide
      */
-    @FlaggedApi(Flags.FLAG_UI_RICH_ONGOING)
     public boolean containsCustomViews() {
         return contentView != null
                 || bigContentView != null
@@ -3235,7 +3234,6 @@
     /**
      * @hide
      */
-    @FlaggedApi(Flags.FLAG_UI_RICH_ONGOING)
     public boolean hasTitle() {
         return extras != null
                 && (!TextUtils.isEmpty(extras.getCharSequence(EXTRA_TITLE))
@@ -3245,7 +3243,7 @@
     /**
      * @hide
      */
-    @FlaggedApi(Flags.FLAG_UI_RICH_ONGOING)
+    @FlaggedApi(Flags.FLAG_API_RICH_ONGOING)
     public boolean hasPromotableStyle() {
         final Class<? extends Style> notificationStyle = getNotificationStyle();
 
@@ -3257,11 +3255,16 @@
     }
 
     /**
-     * @hide
+     * Returns whether the notification has all the characteristics that make it eligible for
+     * {@link #FLAG_PROMOTED_ONGOING}. This method does not factor in other criteria such user
+     * preferences for the app or channel. If this returns true, it does not guarantee that the
+     * notification will be assigned FLAG_PROMOTED_ONGOING by the system, but if this returns false,
+     * it will not.
      */
-    @FlaggedApi(Flags.FLAG_UI_RICH_ONGOING)
+    @FlaggedApi(Flags.FLAG_API_RICH_ONGOING)
     public boolean hasPromotableCharacteristics() {
         return isColorizedRequested()
+                && isOngoingEvent()
                 && hasTitle()
                 && !isGroupSummary()
                 && !containsCustomViews()
@@ -4158,6 +4161,13 @@
     /**
      * @hide
      */
+    public boolean isOngoingEvent() {
+        return (flags & FLAG_ONGOING_EVENT) != 0;
+    }
+
+    /**
+     * @hide
+     */
     public boolean hasCompletedProgress() {
         // not a progress notification; can't be complete
         if (!extras.containsKey(EXTRA_PROGRESS)
diff --git a/core/java/android/app/SystemServiceRegistry.java b/core/java/android/app/SystemServiceRegistry.java
index f357836e..248e0433 100644
--- a/core/java/android/app/SystemServiceRegistry.java
+++ b/core/java/android/app/SystemServiceRegistry.java
@@ -42,8 +42,7 @@
 import android.app.contextualsearch.ContextualSearchManager;
 import android.app.ecm.EnhancedConfirmationFrameworkInitializer;
 import android.app.job.JobSchedulerFrameworkInitializer;
-import android.app.ondeviceintelligence.IOnDeviceIntelligenceManager;
-import android.app.ondeviceintelligence.OnDeviceIntelligenceManager;
+import android.app.ondeviceintelligence.OnDeviceIntelligenceFrameworkInitializer;
 import android.app.people.PeopleManager;
 import android.app.prediction.AppPredictionManager;
 import android.app.role.RoleFrameworkInitializer;
@@ -1692,19 +1691,6 @@
                         throw new ServiceNotFoundException(Context.WEARABLE_SENSING_SERVICE);
                     }});
 
-        registerService(Context.ON_DEVICE_INTELLIGENCE_SERVICE, OnDeviceIntelligenceManager.class,
-                new CachedServiceFetcher<OnDeviceIntelligenceManager>() {
-                    @Override
-                    public OnDeviceIntelligenceManager createService(ContextImpl ctx)
-                            throws ServiceNotFoundException {
-                        IBinder iBinder = ServiceManager.getServiceOrThrow(
-                                Context.ON_DEVICE_INTELLIGENCE_SERVICE);
-                        IOnDeviceIntelligenceManager manager =
-                                IOnDeviceIntelligenceManager.Stub.asInterface(iBinder);
-                        return new OnDeviceIntelligenceManager(ctx.getOuterContext(), manager);
-                    }
-                });
-
         registerService(Context.GRAMMATICAL_INFLECTION_SERVICE, GrammaticalInflectionManager.class,
                 new CachedServiceFetcher<GrammaticalInflectionManager>() {
                     @Override
@@ -1849,6 +1835,7 @@
             ConnectivityFrameworkInitializerTiramisu.registerServiceWrappers();
             NearbyFrameworkInitializer.registerServiceWrappers();
             OnDevicePersonalizationFrameworkInitializer.registerServiceWrappers();
+            OnDeviceIntelligenceFrameworkInitializer.registerServiceWrappers();
             DeviceLockFrameworkInitializer.registerServiceWrappers();
             VirtualizationFrameworkInitializer.registerServiceWrappers();
             ConnectivityFrameworkInitializerBaklava.registerServiceWrappers();
diff --git a/core/java/android/app/activity_manager.aconfig b/core/java/android/app/activity_manager.aconfig
index bea3010..720e045 100644
--- a/core/java/android/app/activity_manager.aconfig
+++ b/core/java/android/app/activity_manager.aconfig
@@ -156,3 +156,10 @@
      bug: "362537357"
      is_exported: true
 }
+
+flag {
+    name: "jank_perceptible_narrow"
+    namespace: "system_performance"
+    description: "Narrow the scope of Jank Perceptible"
+    bug: "304837972"
+}
diff --git a/core/java/android/app/ondeviceintelligence/InferenceInfo.aidl b/core/java/android/app/ondeviceintelligence/InferenceInfo.aidl
deleted file mode 100644
index 6d70fc4..0000000
--- a/core/java/android/app/ondeviceintelligence/InferenceInfo.aidl
+++ /dev/null
@@ -1,22 +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 android.app.ondeviceintelligence;
-
-/**
-  * @hide
-  */
-parcelable InferenceInfo;
diff --git a/core/java/android/app/ondeviceintelligence/OWNERS b/core/java/android/app/ondeviceintelligence/OWNERS
deleted file mode 100644
index 85e9e65..0000000
--- a/core/java/android/app/ondeviceintelligence/OWNERS
+++ /dev/null
@@ -1,6 +0,0 @@
-# Bug component: 1363385
-
-sandeepbandaru@google.com
-shivanker@google.com
-hackz@google.com
-volnov@google.com
diff --git a/core/java/android/app/ondeviceintelligence/flags/ondevice_intelligence.aconfig b/core/java/android/app/ondeviceintelligence/flags/ondevice_intelligence.aconfig
deleted file mode 100644
index 74a96c8..0000000
--- a/core/java/android/app/ondeviceintelligence/flags/ondevice_intelligence.aconfig
+++ /dev/null
@@ -1,17 +0,0 @@
-package: "android.app.ondeviceintelligence.flags"
-container: "system"
-
-flag {
-    name: "enable_on_device_intelligence"
-    is_exported: true
-    namespace: "ondeviceintelligence"
-    description: "Make methods on OnDeviceIntelligenceManager available for local inference."
-    bug: "304755128"
-}
-flag {
-    name: "enable_on_device_intelligence_module"
-    is_exported: true
-    namespace: "ondeviceintelligence"
-    description: "Enable migration to mainline module and related changes."
-    bug: "376427781"
-}
\ No newline at end of file
diff --git a/core/java/android/companion/DeviceId.java b/core/java/android/companion/DeviceId.java
index f66a1ae..d9514a0 100644
--- a/core/java/android/companion/DeviceId.java
+++ b/core/java/android/companion/DeviceId.java
@@ -154,6 +154,10 @@
 
     /**
      * A builder for {@link DeviceId}
+     *
+     * <p>Calling apps must provide at least one of the following to identify
+     * the device: a custom ID using {@link #setCustomId(String)}, or a MAC address using
+     * {@link #setMacAddress(MacAddress)}.</p>
      */
     public static final class Builder extends OneTimeUseBuilder<DeviceId> {
         private String mCustomId;
diff --git a/core/java/android/content/pm/TEST_MAPPING b/core/java/android/content/pm/TEST_MAPPING
index 44f2a4c..23f1ff8 100644
--- a/core/java/android/content/pm/TEST_MAPPING
+++ b/core/java/android/content/pm/TEST_MAPPING
@@ -158,6 +158,17 @@
             ]
         },
         {
+            "name": "CtsPackageInstallerCUJUpdateOwnerShipTestCases",
+            "options":[
+               {
+                   "exclude-annotation":"androidx.test.filters.FlakyTest"
+               },
+               {
+                   "exclude-annotation":"org.junit.Ignore"
+               }
+            ]
+        },
+        {
             "name": "CtsPackageInstallerCUJUpdateSelfTestCases",
             "options":[
                {
diff --git a/core/java/android/hardware/contexthub/HubEndpointSession.java b/core/java/android/hardware/contexthub/HubEndpointSession.java
index b8af398..77f937e 100644
--- a/core/java/android/hardware/contexthub/HubEndpointSession.java
+++ b/core/java/android/hardware/contexthub/HubEndpointSession.java
@@ -69,6 +69,8 @@
      * @return For messages that does not require a response, the transaction will immediately
      *     complete. For messages that requires a response, the transaction will complete after
      *     receiving the response for the message.
+     * @throws SecurityException if the application doesn't have the right permissions to send this
+     *     message.
      */
     @NonNull
     @RequiresPermission(android.Manifest.permission.ACCESS_CONTEXT_HUB)
diff --git a/core/java/android/hardware/location/ContextHubManager.java b/core/java/android/hardware/location/ContextHubManager.java
index 310e1a6..d9888ad 100644
--- a/core/java/android/hardware/location/ContextHubManager.java
+++ b/core/java/android/hardware/location/ContextHubManager.java
@@ -841,6 +841,7 @@
      * @param endpointId The identifier of the hub endpoint.
      * @param callback The callback to be invoked.
      * @param executor The executor to invoke the callback on.
+     * @throws UnsupportedOperationException If the operation is not supported.
      */
     @RequiresPermission(android.Manifest.permission.ACCESS_CONTEXT_HUB)
     @FlaggedApi(Flags.FLAG_OFFLOAD_API)
@@ -881,6 +882,7 @@
      * @param callback The callback to be invoked.
      * @param executor The executor to invoke the callback on.
      * @throws IllegalArgumentException if the serviceDescriptor is empty.
+     * @throws UnsupportedOperationException If the operation is not supported.
      */
     @RequiresPermission(android.Manifest.permission.ACCESS_CONTEXT_HUB)
     @FlaggedApi(Flags.FLAG_OFFLOAD_API)
@@ -911,6 +913,7 @@
      *
      * @param callback The callback previously registered.
      * @throws IllegalArgumentException If the callback was not previously registered.
+     * @throws UnsupportedOperationException If the operation is not supported.
      */
     @RequiresPermission(android.Manifest.permission.ACCESS_CONTEXT_HUB)
     @FlaggedApi(Flags.FLAG_OFFLOAD_API)
@@ -1311,6 +1314,8 @@
      *     endpoint discovery results (e.g. from {@link ContextHubManager#findEndpoints(long)}).
      * @param serviceDescriptor A string that describes the service associated with this session.
      *     The information will be sent to the destination as part of open request.
+     * @throws IllegalStateException if hubEndpoint was not successfully registered, or if there is
+     *     insufficient capacity for creating a session.
      */
     @RequiresPermission(android.Manifest.permission.ACCESS_CONTEXT_HUB)
     @FlaggedApi(Flags.FLAG_OFFLOAD_API)
diff --git a/core/java/android/net/EventLogTags.logtags b/core/java/android/net/EventLogTags.logtags
index d5ed014..32953c9 100644
--- a/core/java/android/net/EventLogTags.logtags
+++ b/core/java/android/net/EventLogTags.logtags
@@ -1,4 +1,4 @@
-# See system/core/logcat/event.logtags for a description of the format of this file.
+# See system/logging/logcat/event.logtags for a description of the format of this file.
 
 option java_package android.net
 
diff --git a/core/java/android/os/CombinedMessageQueue/MessageQueue.java b/core/java/android/os/CombinedMessageQueue/MessageQueue.java
index 804e8fa..11b80ce 100644
--- a/core/java/android/os/CombinedMessageQueue/MessageQueue.java
+++ b/core/java/android/os/CombinedMessageQueue/MessageQueue.java
@@ -18,6 +18,8 @@
 
 import android.annotation.IntDef;
 import android.annotation.NonNull;
+import android.annotation.Nullable;
+import android.annotation.SuppressLint;
 import android.annotation.TestApi;
 import android.app.ActivityThread;
 import android.app.Instrumentation;
@@ -27,11 +29,14 @@
 import android.ravenwood.annotation.RavenwoodKeepWholeClass;
 import android.ravenwood.annotation.RavenwoodRedirect;
 import android.ravenwood.annotation.RavenwoodRedirectionClass;
+import android.ravenwood.annotation.RavenwoodReplace;
+import android.ravenwood.annotation.RavenwoodThrow;
 import android.util.Log;
 import android.util.Printer;
 import android.util.SparseArray;
 import android.util.proto.ProtoOutputStream;
 
+import com.android.internal.annotations.GuardedBy;
 import com.android.internal.ravenwood.RavenwoodEnvironment;
 
 import dalvik.annotation.optimization.NeverCompile;
@@ -174,6 +179,28 @@
         }
     }
 
+    @RavenwoodReplace
+    private static void throwIfNotTest() {
+        final ActivityThread activityThread = ActivityThread.currentActivityThread();
+        if (activityThread == null) {
+            // Only tests can reach here.
+            return;
+        }
+        final Instrumentation instrumentation = activityThread.getInstrumentation();
+        if (instrumentation == null) {
+            // Only tests can reach here.
+            return;
+        }
+        if (instrumentation.isInstrumenting()) {
+            return;
+        }
+        throw new IllegalStateException("Test-only API called not from a test!");
+    }
+
+    private static void throwIfNotTest$ravenwood() {
+        return;
+    }
+
     private static boolean isInstrumenting() {
         final ActivityThread activityThread = ActivityThread.currentActivityThread();
         if (activityThread == null) {
@@ -203,12 +230,9 @@
 
     private static final class MatchDeliverableMessages extends MessageCompare {
         @Override
-        public boolean compareMessage(Message m, Handler h, int what, Object object, Runnable r,
+        public boolean compareMessage(MessageNode n, Handler h, int what, Object object, Runnable r,
                 long when) {
-            if (m.when <= when) {
-                return true;
-            }
-            return false;
+            return n.mMessage.when <= when;
         }
     }
     private final MatchDeliverableMessages mMatchDeliverableMessages =
@@ -355,7 +379,7 @@
      * @see OnFileDescriptorEventListener
      * @see #removeOnFileDescriptorEventListener
      */
-    @android.ravenwood.annotation.RavenwoodThrow(blockedBy = android.os.ParcelFileDescriptor.class)
+    @RavenwoodThrow(blockedBy = android.os.ParcelFileDescriptor.class)
     public void addOnFileDescriptorEventListener(@NonNull FileDescriptor fd,
             @OnFileDescriptorEventListener.Events int events,
             @NonNull OnFileDescriptorEventListener listener) {
@@ -389,7 +413,7 @@
      * @see OnFileDescriptorEventListener
      * @see #addOnFileDescriptorEventListener
      */
-    @android.ravenwood.annotation.RavenwoodThrow(blockedBy = android.os.ParcelFileDescriptor.class)
+    @RavenwoodThrow(blockedBy = android.os.ParcelFileDescriptor.class)
     public void removeOnFileDescriptorEventListener(@NonNull FileDescriptor fd) {
         if (fd == null) {
             throw new IllegalArgumentException("fd must not be null");
@@ -405,7 +429,7 @@
         }
     }
 
-    @android.ravenwood.annotation.RavenwoodThrow(blockedBy = android.os.ParcelFileDescriptor.class)
+    @RavenwoodThrow(blockedBy = android.os.ParcelFileDescriptor.class)
     private void updateOnFileDescriptorEventListenerLocked(FileDescriptor fd, int events,
             OnFileDescriptorEventListener listener) {
         final int fdNum = fd.getInt$();
@@ -528,7 +552,7 @@
     /* This is only read/written from the Looper thread. For use with Concurrent MQ */
     private int mNextPollTimeoutMillis;
     private boolean mMessageDirectlyQueued;
-    private Message nextMessage() {
+    private Message nextMessage(boolean peek) {
         int i = 0;
 
         while (true) {
@@ -690,7 +714,7 @@
             if (sState.compareAndSet(this, sStackStateActive, nextOp)) {
                 mMessageCounts.clearCounts();
                 if (found != null) {
-                    if (!removeFromPriorityQueue(found)) {
+                    if (!peek && !removeFromPriorityQueue(found)) {
                         /*
                          * RemoveMessages() might be able to pull messages out from under us
                          * However we can detect that here and just loop around if it happens.
@@ -724,7 +748,7 @@
             mMessageDirectlyQueued = false;
             nativePollOnce(ptr, mNextPollTimeoutMillis);
 
-            Message msg = nextMessage();
+            Message msg = nextMessage(false);
             if (msg != null) {
                 msg.markInUse();
                 return msg;
@@ -1043,8 +1067,9 @@
         }
 
         @Override
-        public boolean compareMessage(Message m, Handler h, int what, Object object, Runnable r,
+        public boolean compareMessage(MessageNode n, Handler h, int what, Object object, Runnable r,
                 long when) {
+            final Message m = n.mMessage;
             if (m.target == null && m.arg1 == mBarrierToken) {
                 return true;
             }
@@ -1247,10 +1272,92 @@
         return true;
     }
 
+    private Message legacyPeekOrPop(boolean peek) {
+        synchronized (this) {
+            // Try to retrieve the next message.  Return if found.
+            final long now = SystemClock.uptimeMillis();
+            Message prevMsg = null;
+            Message msg = mMessages;
+            if (msg != null && msg.target == null) {
+                // Stalled by a barrier.  Find the next asynchronous message in the queue.
+                do {
+                    prevMsg = msg;
+                    msg = msg.next;
+                } while (msg != null && !msg.isAsynchronous());
+            }
+            if (msg != null) {
+                if (now >= msg.when) {
+                    // Got a message.
+                    mBlocked = false;
+                    if (peek) {
+                        return msg;
+                    }
+                    if (prevMsg != null) {
+                        prevMsg.next = msg.next;
+                        if (prevMsg.next == null) {
+                            mLast = prevMsg;
+                        }
+                    } else {
+                        mMessages = msg.next;
+                        if (msg.next == null) {
+                            mLast = null;
+                        }
+                    }
+                    msg.next = null;
+                    msg.markInUse();
+                    if (msg.isAsynchronous()) {
+                        mAsyncMessageCount--;
+                    }
+                    if (TRACE) {
+                        Trace.setCounter("MQ.Delivered", mMessagesDelivered.incrementAndGet());
+                    }
+                    return msg;
+                }
+            }
+        }
+        return null;
+    }
+
+    /**
+     * Get the timestamp of the next executable message in our priority queue.
+     * Returns null if there are no messages ready for delivery.
+     *
+     * Caller must ensure that this doesn't race 'next' from the Looper thread.
+     */
+    @SuppressLint("VisiblySynchronized") // Legacy MessageQueue synchronizes on this
+    Long peekWhenForTest() {
+        throwIfNotTest();
+        Message ret;
+        if (mUseConcurrent) {
+            ret = nextMessage(true);
+        } else {
+            ret = legacyPeekOrPop(true);
+        }
+        return ret != null ? ret.when : null;
+    }
+
+    /**
+     * Return the next executable message in our priority queue.
+     * Returns null if there are no messages ready for delivery
+     *
+     * Caller must ensure that this doesn't race 'next' from the Looper thread.
+     */
+    @SuppressLint("VisiblySynchronized") // Legacy MessageQueue synchronizes on this
+    @Nullable
+    Message popForTest() {
+        throwIfNotTest();
+        if (mUseConcurrent) {
+            return nextMessage(false);
+        } else {
+            return legacyPeekOrPop(false);
+        }
+    }
+
     private static final class MatchHandlerWhatAndObject extends MessageCompare {
         @Override
-        public boolean compareMessage(Message m, Handler h, int what, Object object, Runnable r,
+        public boolean compareMessage(MessageNode n, Handler h, int what, Object object, Runnable r,
                 long when) {
+            final Message m = n.mMessage;
             if (m.target == h && m.what == what && (object == null || m.obj == object)) {
                 return true;
             }
@@ -1281,8 +1388,9 @@
 
     private static final class MatchHandlerWhatAndObjectEquals extends MessageCompare {
         @Override
-        public boolean compareMessage(Message m, Handler h, int what, Object object, Runnable r,
+        public boolean compareMessage(MessageNode n, Handler h, int what, Object object, Runnable r,
                 long when) {
+            final Message m = n.mMessage;
             if (m.target == h && m.what == what && (object == null || object.equals(m.obj))) {
                 return true;
             }
@@ -1314,8 +1422,9 @@
 
     private static final class MatchHandlerRunnableAndObject extends MessageCompare {
         @Override
-        public boolean compareMessage(Message m, Handler h, int what, Object object, Runnable r,
+        public boolean compareMessage(MessageNode n, Handler h, int what, Object object, Runnable r,
                 long when) {
+            final Message m = n.mMessage;
             if (m.target == h && m.callback == r && (object == null || m.obj == object)) {
                 return true;
             }
@@ -1348,12 +1457,9 @@
 
     private static final class MatchHandler extends MessageCompare {
         @Override
-        public boolean compareMessage(Message m, Handler h, int what, Object object, Runnable r,
+        public boolean compareMessage(MessageNode n, Handler h, int what, Object object, Runnable r,
                 long when) {
-            if (m.target == h) {
-                return true;
-            }
-            return false;
+            return n.mMessage.target == h;
         }
     }
     private final MatchHandler mMatchHandler = new MatchHandler();
@@ -1531,8 +1637,9 @@
 
     private static final class MatchHandlerRunnableAndObjectEquals extends MessageCompare {
         @Override
-        public boolean compareMessage(Message m, Handler h, int what, Object object, Runnable r,
+        public boolean compareMessage(MessageNode n, Handler h, int what, Object object, Runnable r,
                 long when) {
+            final Message m = n.mMessage;
             if (m.target == h && m.callback == r && (object == null || object.equals(m.obj))) {
                 return true;
             }
@@ -1594,8 +1701,9 @@
 
     private static final class MatchHandlerAndObject extends MessageCompare {
         @Override
-        public boolean compareMessage(Message m, Handler h, int what, Object object, Runnable r,
+        public boolean compareMessage(MessageNode n, Handler h, int what, Object object, Runnable r,
                 long when) {
+            final Message m = n.mMessage;
             if (m.target == h && (object == null || m.obj == object)) {
                 return true;
             }
@@ -1655,8 +1763,9 @@
 
     private static final class MatchHandlerAndObjectEquals extends MessageCompare {
         @Override
-        public boolean compareMessage(Message m, Handler h, int what, Object object, Runnable r,
+        public boolean compareMessage(MessageNode n, Handler h, int what, Object object, Runnable r,
                 long when) {
+            final Message m = n.mMessage;
             if (m.target == h && (object == null || object.equals(m.obj))) {
                 return true;
             }
@@ -1762,7 +1871,7 @@
 
     private static final class MatchAllMessages extends MessageCompare {
         @Override
-        public boolean compareMessage(Message m, Handler h, int what, Object object, Runnable r,
+        public boolean compareMessage(MessageNode n, Handler h, int what, Object object, Runnable r,
                 long when) {
             return true;
         }
@@ -1774,9 +1883,10 @@
 
     private static final class MatchAllFutureMessages extends MessageCompare {
         @Override
-        public boolean compareMessage(Message m, Handler h, int what, Object object, Runnable r,
+        public boolean compareMessage(MessageNode n, Handler h, int what, Object object, Runnable r,
                 long when) {
-            if (m.when > when) {
+            final Message m = n.mMessage;
+                    if (m.when > when) {
                 return true;
             }
             return false;
@@ -2482,7 +2592,7 @@
      * This class is used to find matches for hasMessages() and removeMessages()
      */
     private abstract static class MessageCompare {
-        public abstract boolean compareMessage(Message m, Handler h, int what, Object object,
+        public abstract boolean compareMessage(MessageNode n, Handler h, int what, Object object,
                 Runnable r, long when);
     }
 
@@ -2517,7 +2627,7 @@
         MessageNode p = (MessageNode) top;
 
         while (true) {
-            if (compare.compareMessage(p.mMessage, h, what, object, r, when)) {
+            if (compare.compareMessage(p, h, what, object, r, when)) {
                 found = true;
                 if (DEBUG) {
                     Log.d(TAG_C, "stackHasMessages node matches");
@@ -2562,7 +2672,7 @@
         while (iterator.hasNext()) {
             MessageNode msg = iterator.next();
 
-            if (compare.compareMessage(msg.mMessage, h, what, object, r, when)) {
+            if (compare.compareMessage(msg, h, what, object, r, when)) {
                 if (removeMatches) {
                     found = true;
                     if (queue.remove(msg)) {
diff --git a/core/java/android/os/ConcurrentMessageQueue/MessageQueue.java b/core/java/android/os/ConcurrentMessageQueue/MessageQueue.java
index c2a47d7..47778ed 100644
--- a/core/java/android/os/ConcurrentMessageQueue/MessageQueue.java
+++ b/core/java/android/os/ConcurrentMessageQueue/MessageQueue.java
@@ -16,9 +16,12 @@
 
 package android.os;
 
+import android.annotation.FlaggedApi;
 import android.annotation.IntDef;
 import android.annotation.NonNull;
 import android.annotation.TestApi;
+import android.app.ActivityThread;
+import android.app.Instrumentation;
 import android.ravenwood.annotation.RavenwoodKeepWholeClass;
 import android.ravenwood.annotation.RavenwoodRedirect;
 import android.ravenwood.annotation.RavenwoodRedirectionClass;
@@ -364,6 +367,28 @@
         mPtr = nativeInit();
     }
 
+    @android.ravenwood.annotation.RavenwoodReplace
+    private static void throwIfNotTest() {
+        final ActivityThread activityThread = ActivityThread.currentActivityThread();
+        if (activityThread == null) {
+            // Only tests can reach here.
+            return;
+        }
+        final Instrumentation instrumentation = activityThread.getInstrumentation();
+        if (instrumentation == null) {
+            // Only tests can reach here.
+            return;
+        }
+        if (instrumentation.isInstrumenting()) {
+            return;
+        }
+        throw new IllegalStateException("Test-only API called not from a test!");
+    }
+
+    private static void throwIfNotTest$ravenwood() {
+        return;
+    }
+
     @Override
     protected void finalize() throws Throwable {
         try {
@@ -384,8 +409,9 @@
 
     private static final class MatchDeliverableMessages extends MessageCompare {
         @Override
-        public boolean compareMessage(Message m, Handler h, int what, Object object, Runnable r,
-                long when) {
+        public boolean compareMessage(MessageNode n, Handler h, int what, Object object,
+                Runnable r, long when) {
+            final Message m = n.mMessage;
             if (m.when <= when) {
                 return true;
             }
@@ -562,7 +588,7 @@
     private static final AtomicLong mMessagesDelivered = new AtomicLong();
     private boolean mMessageDirectlyQueued;
 
-    private Message nextMessage() {
+    private Message nextMessage(boolean peek) {
         int i = 0;
 
         while (true) {
@@ -724,7 +750,7 @@
             if (sState.compareAndSet(this, sStackStateActive, nextOp)) {
                 mMessageCounts.clearCounts();
                 if (found != null) {
-                    if (!removeFromPriorityQueue(found)) {
+                    if (!peek && !removeFromPriorityQueue(found)) {
                         /*
                          * RemoveMessages() might be able to pull messages out from under us
                          * However we can detect that here and just loop around if it happens.
@@ -993,8 +1019,9 @@
         }
 
         @Override
-        public boolean compareMessage(Message m, Handler h, int what, Object object, Runnable r,
-                long when) {
+        public boolean compareMessage(MessageNode n, Handler h, int what, Object object,
+                Runnable r, long when) {
+            final Message m = n.mMessage;
             if (m.target == null && m.arg1 == mBarrierToken) {
                 return true;
             }
@@ -1039,6 +1066,47 @@
         }
     }
 
+    private static final class MatchEarliestMessage extends MessageCompare {
+        MessageNode mEarliest = null;
+
+        @Override
+        public boolean compareMessage(MessageNode n, Handler h, int what, Object object,
+                Runnable r, long when) {
+            final Message m = n.mMessage;
+            if (mEarliest == null || mEarliest.mMessage.when > m.when) {
+                mEarliest = n;
+            }
+
+            return false;
+        }
+    }
+
+    /**
+     * Get the timestamp of the next executable message in our priority queue.
+     * Returns null if there are no messages ready for delivery.
+     *
+     * Caller must ensure that this doesn't race 'next' from the Looper thread.
+     */
+    @SuppressLint("VisiblySynchronized") // Legacy MessageQueue synchronizes on this
+    Long peekWhenForTest() {
+        throwIfNotTest();
+        Message ret = nextMessage(true);
+        return ret != null ? ret.when : null;
+    }
+
+    /**
+     * Return the next executable message in our priority queue.
+     * Returns null if there are no messages ready for delivery
+     *
+     * Caller must ensure that this doesn't race 'next' from the Looper thread.
+     */
+    @SuppressLint("VisiblySynchronized") // Legacy MessageQueue synchronizes on this
+    @Nullable
+    Message popForTest() {
+        throwIfNotTest();
+        return nextMessage(false);
+    }
+
     private StateNode getStateNode(StackNode node) {
         if (node.isMessageNode()) {
             return ((MessageNode) node).mBottomOfStack;
@@ -1058,7 +1126,7 @@
      * This class is used to find matches for hasMessages() and removeMessages()
      */
     private abstract static class MessageCompare {
-        public abstract boolean compareMessage(Message m, Handler h, int what, Object object,
+        public abstract boolean compareMessage(MessageNode n, Handler h, int what, Object object,
                 Runnable r, long when);
     }
 
@@ -1167,8 +1235,9 @@
 
     private static final class MatchHandlerWhatAndObject extends MessageCompare {
         @Override
-        public boolean compareMessage(Message m, Handler h, int what, Object object, Runnable r,
-                long when) {
+        public boolean compareMessage(MessageNode n, Handler h, int what, Object object,
+                Runnable r, long when) {
+            final Message m = n.mMessage;
             if (m.target == h && m.what == what && (object == null || m.obj == object)) {
                 return true;
             }
@@ -1187,8 +1256,9 @@
 
     private static final class MatchHandlerWhatAndObjectEquals extends MessageCompare {
         @Override
-        public boolean compareMessage(Message m, Handler h, int what, Object object, Runnable r,
+        public boolean compareMessage(MessageNode n, Handler h, int what, Object object, Runnable r,
                 long when) {
+            final Message m = n.mMessage;
             if (m.target == h && m.what == what && (object == null || object.equals(m.obj))) {
                 return true;
             }
@@ -1208,8 +1278,9 @@
 
     private static final class MatchHandlerRunnableAndObject extends MessageCompare {
         @Override
-        public boolean compareMessage(Message m, Handler h, int what, Object object, Runnable r,
-                long when) {
+        public boolean compareMessage(MessageNode n, Handler h, int what, Object object,
+                Runnable r, long when) {
+            final Message m = n.mMessage;
             if (m.target == h && m.callback == r && (object == null || m.obj == object)) {
                 return true;
             }
@@ -1229,8 +1300,9 @@
 
     private static final class MatchHandler extends MessageCompare {
         @Override
-        public boolean compareMessage(Message m, Handler h, int what, Object object, Runnable r,
-                long when) {
+        public boolean compareMessage(MessageNode n, Handler h, int what, Object object,
+                Runnable r, long when) {
+            final Message m = n.mMessage;
             if (m.target == h) {
                 return true;
             }
@@ -1268,8 +1340,9 @@
 
     private static final class MatchHandlerRunnableAndObjectEquals extends MessageCompare {
         @Override
-        public boolean compareMessage(Message m, Handler h, int what, Object object, Runnable r,
-                long when) {
+        public boolean compareMessage(MessageNode n, Handler h, int what, Object object,
+                Runnable r, long when) {
+            final Message m = n.mMessage;
             if (m.target == h && m.callback == r && (object == null || object.equals(m.obj))) {
                 return true;
             }
@@ -1287,8 +1360,9 @@
 
     private static final class MatchHandlerAndObject extends MessageCompare {
         @Override
-        public boolean compareMessage(Message m, Handler h, int what, Object object, Runnable r,
-                long when) {
+        public boolean compareMessage(MessageNode n, Handler h, int what, Object object,
+                Runnable r, long when) {
+            final Message m = n.mMessage;
             if (m.target == h && (object == null || m.obj == object)) {
                 return true;
             }
@@ -1305,8 +1379,9 @@
 
     private static final class MatchHandlerAndObjectEquals extends MessageCompare {
         @Override
-        public boolean compareMessage(Message m, Handler h, int what, Object object, Runnable r,
-                long when) {
+        public boolean compareMessage(MessageNode n, Handler h, int what, Object object,
+                Runnable r, long when) {
+            final Message m = n.mMessage;
             if (m.target == h && (object == null || object.equals(m.obj))) {
                 return true;
             }
@@ -1324,8 +1399,8 @@
 
     private static final class MatchAllMessages extends MessageCompare {
         @Override
-        public boolean compareMessage(Message m, Handler h, int what, Object object, Runnable r,
-                long when) {
+        public boolean compareMessage(MessageNode n, Handler h, int what, Object object,
+                Runnable r, long when) {
             return true;
         }
     }
@@ -1336,8 +1411,9 @@
 
     private static final class MatchAllFutureMessages extends MessageCompare {
         @Override
-        public boolean compareMessage(Message m, Handler h, int what, Object object, Runnable r,
-                long when) {
+        public boolean compareMessage(MessageNode n, Handler h, int what, Object object,
+                Runnable r, long when) {
+            final Message m = n.mMessage;
             if (m.when > when) {
                 return true;
             }
diff --git a/core/java/android/os/LegacyMessageQueue/MessageQueue.java b/core/java/android/os/LegacyMessageQueue/MessageQueue.java
index cae82d0..f49acd1 100644
--- a/core/java/android/os/LegacyMessageQueue/MessageQueue.java
+++ b/core/java/android/os/LegacyMessageQueue/MessageQueue.java
@@ -16,9 +16,14 @@
 
 package android.os;
 
+import android.annotation.FlaggedApi;
 import android.annotation.IntDef;
 import android.annotation.NonNull;
+import android.annotation.Nullable;
+import android.annotation.SuppressLint;
 import android.annotation.TestApi;
+import android.app.ActivityThread;
+import android.app.Instrumentation;
 import android.compat.annotation.UnsupportedAppUsage;
 import android.ravenwood.annotation.RavenwoodKeepWholeClass;
 import android.ravenwood.annotation.RavenwoodRedirect;
@@ -99,6 +104,28 @@
         mPtr = nativeInit();
     }
 
+    @android.ravenwood.annotation.RavenwoodReplace
+    private static void throwIfNotTest() {
+        final ActivityThread activityThread = ActivityThread.currentActivityThread();
+        if (activityThread == null) {
+            // Only tests can reach here.
+            return;
+        }
+        final Instrumentation instrumentation = activityThread.getInstrumentation();
+        if (instrumentation == null) {
+            // Only tests can reach here.
+            return;
+        }
+        if (instrumentation.isInstrumenting()) {
+            return;
+        }
+        throw new IllegalStateException("Test-only API called not from a test!");
+    }
+
+    private static void throwIfNotTest$ravenwood() {
+        return;
+    }
+
     @Override
     protected void finalize() throws Throwable {
         try {
@@ -713,6 +740,78 @@
         return true;
     }
 
+    private Message legacyPeekOrPop(boolean peek) {
+        synchronized (this) {
+            // Try to retrieve the next message.  Return if found.
+            final long now = SystemClock.uptimeMillis();
+            Message prevMsg = null;
+            Message msg = mMessages;
+            if (msg != null && msg.target == null) {
+                // Stalled by a barrier.  Find the next asynchronous message in the queue.
+                do {
+                    prevMsg = msg;
+                    msg = msg.next;
+                } while (msg != null && !msg.isAsynchronous());
+            }
+            if (msg != null) {
+                if (now >= msg.when) {
+                    // Got a message.
+                    mBlocked = false;
+                    if (peek) {
+                        return msg;
+                    }
+                    if (prevMsg != null) {
+                        prevMsg.next = msg.next;
+                        if (prevMsg.next == null) {
+                            mLast = prevMsg;
+                        }
+                    } else {
+                        mMessages = msg.next;
+                        if (msg.next == null) {
+                            mLast = null;
+                        }
+                    }
+                    msg.next = null;
+                    msg.markInUse();
+                    if (msg.isAsynchronous()) {
+                        mAsyncMessageCount--;
+                    }
+                    if (TRACE) {
+                        Trace.setCounter("MQ.Delivered", mMessagesDelivered.incrementAndGet());
+                    }
+                    return msg;
+                }
+            }
+        }
+        return null;
+    }
+
+    /**
+     * Get the timestamp of the next executable message in our priority queue.
+     * Returns null if there are no messages ready for delivery.
+     *
+     * Caller must ensure that this doesn't race 'next' from the Looper thread.
+     */
+    @SuppressLint("VisiblySynchronized") // Legacy MessageQueue synchronizes on this
+    Long peekWhenForTest() {
+        throwIfNotTest();
+        Message ret = legacyPeekOrPop(true);
+        return ret != null ? ret.when : null;
+    }
+
+    /**
+     * Return the next executable message in our priority queue.
+     * Returns null if there are no messages ready for delivery
+     *
+     * Caller must ensure that this doesn't race 'next' from the Looper thread.
+     */
+    @SuppressLint("VisiblySynchronized") // Legacy MessageQueue synchronizes on this
+    @Nullable
+    Message popForTest() {
+        throwIfNotTest();
+        return legacyPeekOrPop(false);
+    }
+
     boolean hasMessages(Handler h, int what, Object object) {
         if (h == null) {
             return false;
diff --git a/core/java/android/os/Parcel.java b/core/java/android/os/Parcel.java
index 6855d95..d7e7ff2 100644
--- a/core/java/android/os/Parcel.java
+++ b/core/java/android/os/Parcel.java
@@ -932,6 +932,12 @@
 
     /**
      * Report whether the parcel contains any marshalled file descriptors.
+     *
+     * WARNING: Parcelable definitions change over time. Unless you define
+     * a Parcelable yourself OR the Parcelable explicitly guarantees that
+     * it would never include such objects, you should not expect the return
+     * value to stay the same, and your code should continue to work even
+     * if the return value changes.
      */
     public boolean hasFileDescriptors() {
         assertNotRecycled();
@@ -942,6 +948,12 @@
      * Report whether the parcel contains any marshalled file descriptors in the range defined by
      * {@code offset} and {@code length}.
      *
+     * WARNING: Parcelable definitions change over time. Unless you define
+     * a Parcelable yourself OR the Parcelable explicitly guarantees that
+     * it would never include such objects, you should not expect the return
+     * value to stay the same, and your code should continue to work even
+     * if the return value changes.
+     *
      * @param offset The offset from which the range starts. Should be between 0 and
      *     {@link #dataSize()}.
      * @param length The length of the range. Should be between 0 and {@link #dataSize()} - {@code
@@ -963,6 +975,12 @@
      * <p>For most cases, it will use the self-reported {@link Parcelable#describeContents()} method
      * for that.
      *
+     * WARNING: Parcelable definitions change over time. Unless you define
+     * a Parcelable yourself OR the Parcelable explicitly guarantees that
+     * it would never include such objects, you should not expect the return
+     * value to stay the same, and your code should continue to work even
+     * if the return value changes.
+     *
      * @throws IllegalArgumentException if you provide any object not supported by above methods
      *     (including if the unsupported object is inside a nested container).
      *
@@ -1032,6 +1050,13 @@
      *
      * @throws UnsupportedOperationException if binder kernel driver was disabled or if method was
      *                                       invoked in case of Binder RPC protocol.
+     *
+     * WARNING: Parcelable definitions change over time. Unless you define
+     * a Parcelable yourself OR the Parcelable explicitly guarantees that
+     * it would never include such objects, you should not expect the return
+     * value to stay the same, and your code should continue to work even
+     * if the return value changes.
+     *
      * @hide
      */
     public boolean hasBinders() {
@@ -1043,6 +1068,12 @@
      * Report whether the parcel contains any marshalled {@link IBinder} objects in the range
      * defined by {@code offset} and {@code length}.
      *
+     * WARNING: Parcelable definitions change over time. Unless you define
+     * a Parcelable yourself OR the Parcelable explicitly guarantees that
+     * it would never include such objects, you should not expect the return
+     * value to stay the same, and your code should continue to work even
+     * if the return value changes.
+     *
      * @param offset The offset from which the range starts. Should be between 0 and
      *               {@link #dataSize()}.
      * @param length The length of the range. Should be between 0 and {@link #dataSize()} - {@code
diff --git a/core/java/android/os/TestLooperManager.java b/core/java/android/os/TestLooperManager.java
index 4b16c1d..e673e17 100644
--- a/core/java/android/os/TestLooperManager.java
+++ b/core/java/android/os/TestLooperManager.java
@@ -14,6 +14,8 @@
 
 package android.os;
 
+import android.annotation.FlaggedApi;
+import android.annotation.Nullable;
 import android.util.ArraySet;
 
 import java.util.concurrent.LinkedBlockingQueue;
@@ -93,9 +95,36 @@
     }
 
     /**
-     * Releases the looper to continue standard looping and processing of messages,
-     * no further interactions with TestLooperManager will be allowed after
-     * release() has been called.
+     * Returns the next message that should be executed by this queue, and removes it from the
+     * queue. If the queue is empty or no messages are deliverable, returns null.
+     * This method never blocks.
+     *
+     * <p>Callers should always call {@link #recycle(Message)} on the message when all interactions
+     * with it have completed.
+     */
+    @FlaggedApi(Flags.FLAG_MESSAGE_QUEUE_TESTABILITY)
+    @Nullable
+    public Message pop() {
+        checkReleased();
+        return mQueue.popForTest();
+    }
+
+    /**
+     * Returns the values of {@link Message#when} of the next message that should be executed by
+     * this queue. If the queue is empty or no messages are deliverable, returns null.
+     * This method never blocks.
+     */
+    @FlaggedApi(Flags.FLAG_MESSAGE_QUEUE_TESTABILITY)
+    @SuppressWarnings("AutoBoxing")  // box the primitive long, or return null to indicate no value
+    @Nullable
+    public Long peekWhen() {
+        checkReleased();
+        return mQueue.peekWhenForTest();
+    }
+
+    /**
+     * Releases the looper to continue standard looping and processing of messages, no further
+     * interactions with TestLooperManager will be allowed after release() has been called.
      */
     public void release() {
         synchronized (sHeldLoopers) {
diff --git a/core/java/android/os/instrumentation/IDynamicInstrumentationManager.aidl b/core/java/android/os/instrumentation/IDynamicInstrumentationManager.aidl
index c45c51d..af56bfe 100644
--- a/core/java/android/os/instrumentation/IDynamicInstrumentationManager.aidl
+++ b/core/java/android/os/instrumentation/IDynamicInstrumentationManager.aidl
@@ -16,7 +16,7 @@
 
 package android.os.instrumentation;
 
-import android.os.instrumentation.ExecutableMethodFileOffsets;
+import android.os.instrumentation.IOffsetCallback;
 import android.os.instrumentation.MethodDescriptor;
 import android.os.instrumentation.TargetProcess;
 
@@ -28,6 +28,7 @@
 interface IDynamicInstrumentationManager {
     /** Provides ART metadata about the described compiled method within the target process */
     @PermissionManuallyEnforced
-    @nullable ExecutableMethodFileOffsets getExecutableMethodFileOffsets(
-            in TargetProcess targetProcess, in MethodDescriptor methodDescriptor);
+    void getExecutableMethodFileOffsets(
+            in TargetProcess targetProcess, in MethodDescriptor methodDescriptor,
+            in IOffsetCallback callback);
 }
diff --git a/core/java/android/app/ondeviceintelligence/FeatureDetails.aidl b/core/java/android/os/instrumentation/IOffsetCallback.aidl
similarity index 61%
copy from core/java/android/app/ondeviceintelligence/FeatureDetails.aidl
copy to core/java/android/os/instrumentation/IOffsetCallback.aidl
index 0589bf8..a28c93f 100644
--- a/core/java/android/app/ondeviceintelligence/FeatureDetails.aidl
+++ b/core/java/android/os/instrumentation/IOffsetCallback.aidl
@@ -5,7 +5,7 @@
  * 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
+ *      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,
@@ -14,9 +14,15 @@
  * limitations under the License.
  */
 
-package android.app.ondeviceintelligence;
+package android.os.instrumentation;
+
+import android.os.instrumentation.ExecutableMethodFileOffsets;
 
 /**
-  * @hide
-  */
-parcelable FeatureDetails;
+ * System private API for providing dynamic instrumentation offset results.
+ *
+ * {@hide}
+ */
+oneway interface IOffsetCallback {
+    void onResult(in @nullable ExecutableMethodFileOffsets offsets);
+}
diff --git a/core/java/android/os/instrumentation/MethodDescriptorParser.java b/core/java/android/os/instrumentation/MethodDescriptorParser.java
new file mode 100644
index 0000000..57fc44f
--- /dev/null
+++ b/core/java/android/os/instrumentation/MethodDescriptorParser.java
@@ -0,0 +1,82 @@
+/*
+ * 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 android.os.instrumentation;
+
+import android.annotation.NonNull;
+
+import java.lang.reflect.Method;
+
+/**
+ * A utility class for dynamic instrumentation / uprobestats.
+ *
+ * @hide
+ */
+public final class MethodDescriptorParser {
+
+    /**
+     * Parses a {@link MethodDescriptor} (in string representation) into a {@link Method}.
+     */
+    public static Method parseMethodDescriptor(ClassLoader classLoader,
+            @NonNull MethodDescriptor descriptor) {
+        try {
+            Class<?> javaClass = classLoader.loadClass(descriptor.fullyQualifiedClassName);
+            Class<?>[] parameters = new Class[descriptor.fullyQualifiedParameters.length];
+            for (int i = 0; i < descriptor.fullyQualifiedParameters.length; i++) {
+                String typeName = descriptor.fullyQualifiedParameters[i];
+                boolean isArrayType = typeName.endsWith("[]");
+                if (isArrayType) {
+                    typeName = typeName.substring(0, typeName.length() - 2);
+                }
+                switch (typeName) {
+                    case "boolean":
+                        parameters[i] = isArrayType ? boolean.class.arrayType() : boolean.class;
+                        break;
+                    case "byte":
+                        parameters[i] = isArrayType ? byte.class.arrayType() : byte.class;
+                        break;
+                    case "char":
+                        parameters[i] = isArrayType ? char.class.arrayType() : char.class;
+                        break;
+                    case "short":
+                        parameters[i] = isArrayType ? short.class.arrayType() : short.class;
+                        break;
+                    case "int":
+                        parameters[i] = isArrayType ? int.class.arrayType() : int.class;
+                        break;
+                    case "long":
+                        parameters[i] = isArrayType ? long.class.arrayType() : long.class;
+                        break;
+                    case "float":
+                        parameters[i] = isArrayType ? float.class.arrayType() : float.class;
+                        break;
+                    case "double":
+                        parameters[i] = isArrayType ? double.class.arrayType() : double.class;
+                        break;
+                    default:
+                        parameters[i] = isArrayType ? classLoader.loadClass(typeName).arrayType()
+                                : classLoader.loadClass(typeName);
+                }
+            }
+
+            return javaClass.getDeclaredMethod(descriptor.methodName, parameters);
+        } catch (ClassNotFoundException | NoSuchMethodException e) {
+            throw new IllegalArgumentException(
+                    "The specified method cannot be found. Is this descriptor valid? "
+                            + descriptor, e);
+        }
+    }
+}
diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java
index 9935be2..4acb631 100644
--- a/core/java/android/provider/Settings.java
+++ b/core/java/android/provider/Settings.java
@@ -10042,6 +10042,12 @@
                 "minimal_post_processing_allowed";
 
         /**
+         * Whether to mirror the built-in display on all connected displays.
+         * @hide
+         */
+        public static final String MIRROR_BUILT_IN_DISPLAY = "mirror_built_in_display";
+
+        /**
          * No mode switching will happen.
          *
          * @see #MATCH_CONTENT_FRAME_RATE
diff --git a/core/java/android/service/autofill/FillEventHistory.java b/core/java/android/service/autofill/FillEventHistory.java
index fba8e42..6d62a2c 100644
--- a/core/java/android/service/autofill/FillEventHistory.java
+++ b/core/java/android/service/autofill/FillEventHistory.java
@@ -341,7 +341,7 @@
 
         /** Credential Manager suggestions are shown instead of Autofill suggestion */
         @FlaggedApi(FLAG_AUTOFILL_W_METRICS)
-        public static final int UI_TYPE_CREDMAN = 4;
+        public static final int UI_TYPE_CREDENTIAL_MANAGER = 4;
 
         /** @hide */
         @IntDef(prefix = { "UI_TYPE_" }, value = {
diff --git a/core/java/android/service/ondeviceintelligence/OWNERS b/core/java/android/service/ondeviceintelligence/OWNERS
deleted file mode 100644
index 09774f7..0000000
--- a/core/java/android/service/ondeviceintelligence/OWNERS
+++ /dev/null
@@ -1 +0,0 @@
-file:/core/java/android/app/ondeviceintelligence/OWNERS
diff --git a/core/java/android/speech/tts/EventLogTags.logtags b/core/java/android/speech/tts/EventLogTags.logtags
index e209a28..5ba2bae 100644
--- a/core/java/android/speech/tts/EventLogTags.logtags
+++ b/core/java/android/speech/tts/EventLogTags.logtags
@@ -1,4 +1,4 @@
-# See system/core/logcat/event.logtags for a description of the format of this file.
+# See system/logging/logcat/event.logtags for a description of the format of this file.
 
 option java_package android.speech.tts;
 
diff --git a/core/java/android/view/Display.java b/core/java/android/view/Display.java
index c9d560c..802bddd 100644
--- a/core/java/android/view/Display.java
+++ b/core/java/android/view/Display.java
@@ -1301,17 +1301,23 @@
     }
 
     /**
-     * Represents the {@link FrameRateCategory} for the Normal frame rate
+     * Normal category determines the framework's recommended normal frame rate.
+     * Opt for this normal rate unless a higher frame rate significantly enhances
+     * the user experience.
      *
-     * @see FrameRateCategory
+     * @see #getSuggestedFrameRate(int)
+     * @see #FRAME_RATE_CATEGORY_HIGH
      */
     @FlaggedApi(FLAG_ENABLE_GET_SUGGESTED_FRAME_RATE)
     public static final int FRAME_RATE_CATEGORY_NORMAL = 0;
 
     /**
-     * Represents the {@link FrameRateCategory} for the High frame rate
+     * High category determines the framework's recommended high frame rate.
+     * Opt for this high rate when a higher frame rate significantly enhances
+     * the user experience.
      *
-     * @see FrameRateCategory
+     * @see #getSuggestedFrameRate(int)
+     * @see #FRAME_RATE_CATEGORY_NORMAL
      */
     @FlaggedApi(FLAG_ENABLE_GET_SUGGESTED_FRAME_RATE)
     public static final int FRAME_RATE_CATEGORY_HIGH = 1;
@@ -1332,22 +1338,17 @@
      *
      * <p> For example, an animation that does not require fast render rates can use
      * the {@link #FRAME_RATE_CATEGORY_NORMAL} to get the suggested frame rate.
-     * The suggested frame rate then can be used in the
-     * {@link Surface.FrameRateParams.Builder#setDesiredRateRange} for desiredMinRate.
      *
      * <pre>{@code
      *  float desiredMinRate = display.getSuggestedFrameRate(FRAME_RATE_CATEGORY_NORMAL);
-     *  Surface.FrameRateParams params = new Surface.FrameRateParams.Builder().
-     *                                      setDesiredRateRange(desiredMinRate, Float.MAX).build();
-     *  surface.setFrameRate(params);
+     *  surface.setFrameRate(desiredMinRate, Surface.FRAME_RATE_COMPATIBILITY_DEFAULT);
      * }</pre>
      * </p>
      *
      * @param category either {@link #FRAME_RATE_CATEGORY_NORMAL}
      *                 or {@link #FRAME_RATE_CATEGORY_HIGH}
      *
-     * @see Surface#setFrameRate(Surface.FrameRateParams)
-     * @see SurfaceControl.Transaction#setFrameRate(SurfaceControl, Surface.FrameRateParams)
+     * @see Surface#setFrameRate(float, int)
      * @throws IllegalArgumentException when category is not {@link #FRAME_RATE_CATEGORY_NORMAL}
      * or {@link #FRAME_RATE_CATEGORY_HIGH}
      */
diff --git a/core/java/android/view/ViewConfiguration.java b/core/java/android/view/ViewConfiguration.java
index 63bf392..9e97a8e 100644
--- a/core/java/android/view/ViewConfiguration.java
+++ b/core/java/android/view/ViewConfiguration.java
@@ -591,7 +591,7 @@
                 res.getBoolean(
                         com.android.internal.R.bool.config_viewBasedRotaryEncoderHapticsEnabled);
         mViewTouchScreenHapticScrollFeedbackEnabled =
-                Flags.enableTouchScrollFeedback()
+                Flags.enableScrollFeedbackForTouch()
                         ? res.getBoolean(
                         com.android.internal.R.bool
                                 .config_viewTouchScreenHapticScrollFeedbackEnabled)
diff --git a/core/java/android/view/ViewStructure.java b/core/java/android/view/ViewStructure.java
index 1be7f48..43a946a 100644
--- a/core/java/android/view/ViewStructure.java
+++ b/core/java/android/view/ViewStructure.java
@@ -87,8 +87,12 @@
      * <p>This value is added to mainly help with debugging purpose.
      */
     @FlaggedApi(FLAG_AUTOFILL_W_METRICS)
+    @SuppressWarnings(
+            "ActionValue") // Lint expects this as
+                           // android.view.contentcapture.extra.VIRTUAL_STRUCTURE_VERSION_NUMBER
+                           // but should not have contentcapture
     public static final String EXTRA_VIRTUAL_STRUCTURE_TYPE =
-            "android.view.ViewStructure.extra.VIRTUAL_STRUCTURE_TYPE";
+            "android.view.extra.VIRTUAL_STRUCTURE_TYPE";
 
     /**
      * Key used for specifying the version of the view that generated the virtual structure for
@@ -98,8 +102,12 @@
      * "104.0.5112.69", then the value should be "104.0.5112.69"
      */
     @FlaggedApi(FLAG_AUTOFILL_W_METRICS)
+    @SuppressWarnings(
+            "ActionValue") // Lint expects this as
+                           // android.view.contentcapture.extra.VIRTUAL_STRUCTURE_TYPE
+                           // but should not have contentcapture
     public static final String EXTRA_VIRTUAL_STRUCTURE_VERSION_NUMBER =
-            "android.view.ViewStructure.extra.VIRTUAL_STRUCTURE_VERSION_NUMBER";
+            "android.view.extra.VIRTUAL_STRUCTURE_VERSION_NUMBER";
 
     /**
      * Set the identifier for this view.
diff --git a/core/java/android/view/flags/scroll_feedback_flags.aconfig b/core/java/android/view/flags/scroll_feedback_flags.aconfig
index ebda4d4..ddf6ff1 100644
--- a/core/java/android/view/flags/scroll_feedback_flags.aconfig
+++ b/core/java/android/view/flags/scroll_feedback_flags.aconfig
@@ -17,10 +17,10 @@
 }
 
 flag {
-    namespace: "toolkit"
-    name: "enable_touch_scroll_feedback"
+    namespace: "wear_frameworks"
+    name: "enable_scroll_feedback_for_touch"
     description: "Enables touchscreen haptic scroll feedback"
-    bug: "331830899"
+    bug: "382135785"
     is_fixed_read_only: true
 }
 
diff --git a/core/java/android/webkit/EventLogTags.logtags b/core/java/android/webkit/EventLogTags.logtags
index a90aebd..8bbd5a9 100644
--- a/core/java/android/webkit/EventLogTags.logtags
+++ b/core/java/android/webkit/EventLogTags.logtags
@@ -1,4 +1,4 @@
-# See system/core/logcat/event.logtags for a description of the format of this file.
+# See system/logging/logcat/event.logtags for a description of the format of this file.
 
 option java_package android.webkit;
 
diff --git a/core/java/android/widget/AbsListView.java b/core/java/android/widget/AbsListView.java
index 3c854ea..0721fd3 100644
--- a/core/java/android/widget/AbsListView.java
+++ b/core/java/android/widget/AbsListView.java
@@ -16,7 +16,7 @@
 
 package android.widget;
 
-import static android.view.flags.Flags.enableTouchScrollFeedback;
+import static android.view.flags.Flags.enableScrollFeedbackForTouch;
 import static android.view.flags.Flags.scrollFeedbackApi;
 import static android.view.flags.Flags.viewVelocityApi;
 
@@ -3737,7 +3737,7 @@
                     atEdge = trackMotionScroll(deltaY, incrementalDeltaY);
 
                     // TODO: b/360198915 - Add unit testing for using ScrollFeedbackProvider
-                    if (enableTouchScrollFeedback()) {
+                    if (enableScrollFeedbackForTouch()) {
                         initHapticScrollFeedbackProviderIfNotExists();
                         mHapticScrollFeedbackProvider.onScrollProgress(
                                 vtev.getDeviceId(), vtev.getSource(), MotionEvent.AXIS_Y,
@@ -3779,7 +3779,7 @@
                                     mTouchMode = TOUCH_MODE_OVERSCROLL;
                                 }
 
-                                if (enableTouchScrollFeedback()) {
+                                if (enableScrollFeedbackForTouch()) {
                                     initHapticScrollFeedbackProviderIfNotExists();
                                     mHapticScrollFeedbackProvider.onScrollLimit(
                                             vtev.getDeviceId(), vtev.getSource(),
diff --git a/core/java/android/widget/ScrollView.java b/core/java/android/widget/ScrollView.java
index 511c832..184933f 100644
--- a/core/java/android/widget/ScrollView.java
+++ b/core/java/android/widget/ScrollView.java
@@ -16,7 +16,7 @@
 
 package android.widget;
 
-import static android.view.flags.Flags.enableTouchScrollFeedback;
+import static android.view.flags.Flags.enableScrollFeedbackForTouch;
 import static android.view.flags.Flags.viewVelocityApi;
 
 import android.annotation.ColorInt;
@@ -909,7 +909,7 @@
                 }
 
                 // TODO: b/360198915 - Add unit tests.
-                if (enableTouchScrollFeedback()) {
+                if (enableScrollFeedbackForTouch()) {
                     if (hitTopLimit || hitBottomLimit) {
                         initHapticScrollFeedbackProviderIfNotExists();
                         mHapticScrollFeedbackProvider.onScrollLimit(vtev.getDeviceId(),
diff --git a/core/java/android/window/flags/lse_desktop_experience.aconfig b/core/java/android/window/flags/lse_desktop_experience.aconfig
index 8ebc1ed..a04071a 100644
--- a/core/java/android/window/flags/lse_desktop_experience.aconfig
+++ b/core/java/android/window/flags/lse_desktop_experience.aconfig
@@ -449,6 +449,14 @@
 }
 
 flag {
+    name: "reparent_window_token_api"
+    namespace: "lse_desktop_experience"
+    description: "Allows to reparent a window token to a different display"
+    is_fixed_read_only: true
+    bug: "381258683"
+}
+
+flag {
     name: "enable_desktop_windowing_hsum"
     namespace: "lse_desktop_experience"
     description: "Enables HSUM on desktop mode."
diff --git a/core/java/com/android/internal/jank/EventLogTags.logtags b/core/java/com/android/internal/jank/EventLogTags.logtags
index 66ee131..dfec499 100644
--- a/core/java/com/android/internal/jank/EventLogTags.logtags
+++ b/core/java/com/android/internal/jank/EventLogTags.logtags
@@ -1,4 +1,4 @@
-# See system/core/logcat/event.logtags for a description of the format of this file.
+# See system/logging/logcat/event.logtags for a description of the format of this file.
 
 option java_package com.android.internal.jank;
 
diff --git a/core/java/com/android/internal/util/ArrayUtils.java b/core/java/com/android/internal/util/ArrayUtils.java
index 1e965c5d..bda7547 100644
--- a/core/java/com/android/internal/util/ArrayUtils.java
+++ b/core/java/com/android/internal/util/ArrayUtils.java
@@ -20,6 +20,7 @@
 import android.annotation.Nullable;
 import android.compat.annotation.UnsupportedAppUsage;
 import android.os.Build;
+import android.ravenwood.annotation.RavenwoodReplace;
 import android.util.ArraySet;
 import android.util.EmptyArray;
 
@@ -39,6 +40,10 @@
 
 /**
  * Static utility methods for arrays that aren't already included in {@link java.util.Arrays}.
+ * <p>
+ * Test with:
+ * <code>atest FrameworksUtilTests:com.android.internal.util.ArrayUtilsTest</code>
+ * <code>atest FrameworksUtilTestsRavenwood:com.android.internal.util.ArrayUtilsTest</code>
  */
 @android.ravenwood.annotation.RavenwoodKeepWholeClass
 public class ArrayUtils {
@@ -85,6 +90,69 @@
     }
 
     /**
+     * This is like <code>new byte[length]</code>, but it allocates the array as non-movable. This
+     * prevents copies of the data from being left on the Java heap as a result of heap compaction.
+     * Use this when the array will contain sensitive data such as a password or cryptographic key
+     * that needs to be wiped from memory when no longer needed. The owner of the array is still
+     * responsible for the zeroization; {@link #zeroize(byte[])} should be used to do so.
+     *
+     * @param length the length of the array to allocate
+     * @return the new array
+     */
+    public static byte[] newNonMovableByteArray(int length) {
+        return (byte[]) VMRuntime.getRuntime().newNonMovableArray(byte.class, length);
+    }
+
+    /**
+     * Like {@link #newNonMovableByteArray(int)}, but allocates a char array.
+     *
+     * @param length the length of the array to allocate
+     * @return the new array
+     */
+    public static char[] newNonMovableCharArray(int length) {
+        return (char[]) VMRuntime.getRuntime().newNonMovableArray(char.class, length);
+    }
+
+    /**
+     * Zeroizes a byte array as securely as possible. Use this when the array contains sensitive
+     * data such as a password or cryptographic key.
+     * <p>
+     * This zeroizes the array in a way that is guaranteed to not be optimized out by the compiler.
+     * If supported by the architecture, it zeroizes the data not just in the L1 data cache but also
+     * in other levels of the memory hierarchy up to and including main memory (but not above that).
+     * <p>
+     * This works on any <code>byte[]</code>, but to ensure that copies of the array aren't left on
+     * the Java heap the array should have been allocated with {@link #newNonMovableByteArray(int)}.
+     * Use on other arrays might also introduce performance anomalies.
+     *
+     * @param array the array to zeroize. If null, this method has no effect.
+     */
+    @RavenwoodReplace public static native void zeroize(byte[] array);
+
+    /**
+     * Replacement of the above method for host-side unit testing that doesn't support JNI yet.
+     */
+    public static void zeroize$ravenwood(byte[] array) {
+        if (array != null) {
+            Arrays.fill(array, (byte) 0);
+        }
+    }
+
+    /**
+     * Like {@link #zeroize(byte[])}, but for char arrays.
+     */
+    @RavenwoodReplace public static native void zeroize(char[] array);
+
+    /**
+     * Replacement of the above method for host-side unit testing that doesn't support JNI yet.
+     */
+    public static void zeroize$ravenwood(char[] array) {
+        if (array != null) {
+            Arrays.fill(array, (char) 0);
+        }
+    }
+
+    /**
      * Checks if the beginnings of two byte arrays are equal.
      *
      * @param array1 the first byte array
diff --git a/core/jni/Android.bp b/core/jni/Android.bp
index b39bacd..8e3303a 100644
--- a/core/jni/Android.bp
+++ b/core/jni/Android.bp
@@ -92,6 +92,7 @@
         "android_view_VelocityTracker.cpp",
         "android_view_VerifiedKeyEvent.cpp",
         "android_view_VerifiedMotionEvent.cpp",
+        "com_android_internal_util_ArrayUtils.cpp",
         "com_android_internal_util_VirtualRefBasePtr.cpp",
         "core_jni_helpers.cpp",
         ":deviceproductinfoconstants_aidl",
diff --git a/core/jni/AndroidRuntime.cpp b/core/jni/AndroidRuntime.cpp
index ac187b0..78d69f0 100644
--- a/core/jni/AndroidRuntime.cpp
+++ b/core/jni/AndroidRuntime.cpp
@@ -220,6 +220,7 @@
 extern int register_com_android_internal_os_ZygoteCommandBuffer(JNIEnv *env);
 extern int register_com_android_internal_os_ZygoteInit(JNIEnv *env);
 extern int register_com_android_internal_security_VerityUtils(JNIEnv* env);
+extern int register_com_android_internal_util_ArrayUtils(JNIEnv* env);
 extern int register_com_android_internal_util_VirtualRefBasePtr(JNIEnv *env);
 extern int register_android_window_WindowInfosListener(JNIEnv* env);
 extern int register_android_window_ScreenCapture(JNIEnv* env);
@@ -1621,6 +1622,7 @@
         REG_JNI(register_com_android_internal_os_ZygoteCommandBuffer),
         REG_JNI(register_com_android_internal_os_ZygoteInit),
         REG_JNI(register_com_android_internal_security_VerityUtils),
+        REG_JNI(register_com_android_internal_util_ArrayUtils),
         REG_JNI(register_com_android_internal_util_VirtualRefBasePtr),
         REG_JNI(register_android_hardware_Camera),
         REG_JNI(register_android_hardware_camera2_CameraMetadata),
diff --git a/core/jni/com_android_internal_content_NativeLibraryHelper.cpp b/core/jni/com_android_internal_content_NativeLibraryHelper.cpp
index b2eeff3..f40cfd9f 100644
--- a/core/jni/com_android_internal_content_NativeLibraryHelper.cpp
+++ b/core/jni/com_android_internal_content_NativeLibraryHelper.cpp
@@ -532,7 +532,12 @@
     static const size_t kPageSize = getpagesize();
 
     // App compat is only applicable on 16kb-page-size devices.
-    return kPageSize == 0x4000;
+    if (kPageSize != 0x4000) {
+        return false;
+    }
+
+    // Explicit disabled status for app compat
+    return !android::base::GetBoolProperty("pm.16kb.app_compat.disabled", false);
 }
 
 static jint
diff --git a/core/jni/com_android_internal_util_ArrayUtils.cpp b/core/jni/com_android_internal_util_ArrayUtils.cpp
new file mode 100644
index 0000000..c706258
--- /dev/null
+++ b/core/jni/com_android_internal_util_ArrayUtils.cpp
@@ -0,0 +1,119 @@
+/*
+ * 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.
+ */
+
+#define LOG_TAG "ArrayUtils"
+
+#include <android-base/logging.h>
+#include <jni.h>
+#include <nativehelper/JNIHelp.h>
+#include <string.h>
+#include <unistd.h>
+#include <utils/Log.h>
+
+namespace android {
+
+static size_t GetCacheLineSize() {
+    long size = sysconf(_SC_LEVEL1_DCACHE_LINESIZE);
+    if (size <= 0) {
+        ALOGE("Unable to determine L1 data cache line size. Assuming 32 bytes");
+        return 32;
+    }
+    // The cache line size should always be a power of 2.
+    CHECK((size & (size - 1)) == 0);
+
+    return size;
+}
+
+static void CleanCacheLineContainingAddress(const uint8_t* p) {
+#if defined(__aarch64__)
+    // 'dc cvac' stands for "Data Cache line Clean by Virtual Address to point-of-Coherency".
+    // It writes the cache line back to the "point-of-coherency", i.e. main memory.
+    asm volatile("dc cvac, %0" ::"r"(p));
+#elif defined(__i386__) || defined(__x86_64__)
+    asm volatile("clflush (%0)" ::"r"(p));
+#elif defined(__riscv)
+    // This should eventually work, but it is not ready to be enabled yet:
+    //  1.) The Android emulator needs to add support for zicbom.
+    //  2.) Kernel needs to enable zicbom in usermode.
+    //  3.) Android clang needs to add zicbom to the target.
+    // asm volatile("cbo.clean (%0)" ::"r"(p));
+#elif defined(__arm__)
+    // arm32 has a cacheflush() syscall, but it is undocumented and only flushes the icache.
+    // It is not the same as cacheflush(2) as documented in the Linux man-pages project.
+#else
+#error "Unknown architecture"
+#endif
+}
+
+static void CleanDataCache(const uint8_t* p, size_t buffer_size, size_t cache_line_size) {
+    // Clean the first line that overlaps the buffer.
+    CleanCacheLineContainingAddress(p);
+    // Clean any additional lines that overlap the buffer.  Use cache-line-aligned addresses to
+    // ensure that (a) the last cache line gets flushed, and (b) no cache line is flushed twice.
+    for (size_t i = cache_line_size - ((uintptr_t)p & (cache_line_size - 1)); i < buffer_size;
+         i += cache_line_size) {
+        CleanCacheLineContainingAddress(p + i);
+    }
+}
+
+static void ZeroizePrimitiveArray(JNIEnv* env, jclass clazz, jarray array, size_t component_len) {
+    static const size_t cache_line_size = GetCacheLineSize();
+
+    if (array == nullptr) {
+        return;
+    }
+
+    size_t buffer_size = env->GetArrayLength(array) * component_len;
+    if (buffer_size == 0) {
+        return;
+    }
+
+    // ART guarantees that GetPrimitiveArrayCritical never copies.
+    jboolean isCopy;
+    void* elems = env->GetPrimitiveArrayCritical(array, &isCopy);
+    CHECK(!isCopy);
+
+#ifdef __BIONIC__
+    memset_explicit(elems, 0, buffer_size);
+#else
+    memset(elems, 0, buffer_size);
+#endif
+    // Clean the data cache so that the data gets zeroized in main memory right away.  Without this,
+    // it might not be written to main memory until the cache line happens to be evicted.
+    CleanDataCache(static_cast<const uint8_t*>(elems), buffer_size, cache_line_size);
+
+    env->ReleasePrimitiveArrayCritical(array, elems, /* mode= */ 0);
+}
+
+static void ZeroizeByteArray(JNIEnv* env, jclass clazz, jbyteArray array) {
+    ZeroizePrimitiveArray(env, clazz, array, sizeof(jbyte));
+}
+
+static void ZeroizeCharArray(JNIEnv* env, jclass clazz, jcharArray array) {
+    ZeroizePrimitiveArray(env, clazz, array, sizeof(jchar));
+}
+
+static const JNINativeMethod sMethods[] = {
+        {"zeroize", "([B)V", (void*)ZeroizeByteArray},
+        {"zeroize", "([C)V", (void*)ZeroizeCharArray},
+};
+
+int register_com_android_internal_util_ArrayUtils(JNIEnv* env) {
+    return jniRegisterNativeMethods(env, "com/android/internal/util/ArrayUtils", sMethods,
+                                    NELEM(sMethods));
+}
+
+} // namespace android
diff --git a/core/res/Android.bp b/core/res/Android.bp
index 903d08b..be4fb8b 100644
--- a/core/res/Android.bp
+++ b/core/res/Android.bp
@@ -179,6 +179,7 @@
         "art-aconfig-flags",
         "ranging_aconfig_flags",
         "aconfig_settingslib_flags",
+        "telephony_flags",
     ],
 }
 
diff --git a/core/res/AndroidManifest.xml b/core/res/AndroidManifest.xml
index d0a5318..6b05690 100644
--- a/core/res/AndroidManifest.xml
+++ b/core/res/AndroidManifest.xml
@@ -7042,6 +7042,13 @@
     <permission android:name="android.permission.MANAGE_SUBSCRIPTION_PLANS"
         android:protectionLevel="signature|privileged" />
 
+    <!-- @SystemApi @hide Allows for reading subscription plan fields for status and end date.
+         @FlaggedApi(com.android.internal.telephony.flags.Flags.FLAG_SUBSCRIPTION_PLAN_ALLOW_STATUS_AND_END_DATE)
+    -->
+    <permission android:name="android.permission.READ_SUBSCRIPTION_PLANS"
+        android:protectionLevel="signature|privileged"
+        android:featureFlag="com.android.internal.telephony.flags.subscription_plan_allow_status_and_end_date" />
+
     <!-- C2DM permission.
          @hide Used internally.
      -->
diff --git a/core/res/res/layout/notification_2025_template_collapsed_base.xml b/core/res/res/layout/notification_2025_template_collapsed_base.xml
index 09c02c9..76c810b 100644
--- a/core/res/res/layout/notification_2025_template_collapsed_base.xml
+++ b/core/res/res/layout/notification_2025_template_collapsed_base.xml
@@ -28,8 +28,8 @@
         android:id="@+id/left_icon"
         android:layout_width="@dimen/notification_2025_left_icon_size"
         android:layout_height="@dimen/notification_2025_left_icon_size"
-        android:layout_gravity="center_vertical|start"
-        android:layout_marginStart="@dimen/notification_left_icon_start"
+        android:layout_alignParentStart="true"
+        android:layout_margin="@dimen/notification_2025_margin"
         android:background="@drawable/notification_large_icon_outline"
         android:clipToOutline="true"
         android:importantForAccessibility="no"
@@ -41,8 +41,8 @@
         android:id="@+id/icon"
         android:layout_width="@dimen/notification_2025_icon_circle_size"
         android:layout_height="@dimen/notification_2025_icon_circle_size"
-        android:layout_gravity="center_vertical|start"
-        android:layout_marginStart="@dimen/notification_icon_circle_start"
+        android:layout_alignParentStart="true"
+        android:layout_margin="@dimen/notification_2025_margin"
         android:background="@drawable/notification_icon_circle"
         android:padding="@dimen/notification_2025_icon_circle_padding"
         android:maxDrawableWidth="@dimen/notification_2025_icon_circle_size"
diff --git a/core/res/res/layout/notification_2025_template_collapsed_media.xml b/core/res/res/layout/notification_2025_template_collapsed_media.xml
index f539105..2e0a7af 100644
--- a/core/res/res/layout/notification_2025_template_collapsed_media.xml
+++ b/core/res/res/layout/notification_2025_template_collapsed_media.xml
@@ -32,8 +32,8 @@
         android:id="@+id/left_icon"
         android:layout_width="@dimen/notification_2025_left_icon_size"
         android:layout_height="@dimen/notification_2025_left_icon_size"
-        android:layout_gravity="center_vertical|start"
-        android:layout_marginStart="@dimen/notification_left_icon_start"
+        android:layout_alignParentStart="true"
+        android:layout_margin="@dimen/notification_2025_margin"
         android:background="@drawable/notification_large_icon_outline"
         android:clipToOutline="true"
         android:importantForAccessibility="no"
@@ -45,8 +45,8 @@
         android:id="@+id/icon"
         android:layout_width="@dimen/notification_2025_icon_circle_size"
         android:layout_height="@dimen/notification_2025_icon_circle_size"
-        android:layout_gravity="center_vertical|start"
-        android:layout_marginStart="@dimen/notification_icon_circle_start"
+        android:layout_alignParentStart="true"
+        android:layout_margin="@dimen/notification_2025_margin"
         android:background="@drawable/notification_icon_circle"
         android:padding="@dimen/notification_2025_icon_circle_padding"
         />
diff --git a/core/res/res/layout/notification_2025_template_collapsed_messaging.xml b/core/res/res/layout/notification_2025_template_collapsed_messaging.xml
index ddf3ebc..f644ade 100644
--- a/core/res/res/layout/notification_2025_template_collapsed_messaging.xml
+++ b/core/res/res/layout/notification_2025_template_collapsed_messaging.xml
@@ -46,8 +46,8 @@
                 android:id="@+id/left_icon"
                 android:layout_width="@dimen/notification_2025_left_icon_size"
                 android:layout_height="@dimen/notification_2025_left_icon_size"
-                android:layout_gravity="center_vertical|start"
-                android:layout_marginStart="@dimen/notification_left_icon_start"
+                android:layout_alignParentStart="true"
+                android:layout_margin="@dimen/notification_2025_margin"
                 android:background="@drawable/notification_large_icon_outline"
                 android:clipToOutline="true"
                 android:importantForAccessibility="no"
@@ -59,8 +59,8 @@
                 android:id="@+id/icon"
                 android:layout_width="@dimen/notification_2025_icon_circle_size"
                 android:layout_height="@dimen/notification_2025_icon_circle_size"
-                android:layout_gravity="center_vertical|start"
-                android:layout_marginStart="@dimen/notification_icon_circle_start"
+                android:layout_alignParentStart="true"
+                android:layout_margin="@dimen/notification_2025_margin"
                 android:background="@drawable/notification_icon_circle"
                 android:padding="@dimen/notification_2025_icon_circle_padding"
                 />
diff --git a/core/res/res/layout/notification_2025_template_header.xml b/core/res/res/layout/notification_2025_template_header.xml
index b7fe454..63872af 100644
--- a/core/res/res/layout/notification_2025_template_header.xml
+++ b/core/res/res/layout/notification_2025_template_header.xml
@@ -33,8 +33,7 @@
         android:layout_width="@dimen/notification_2025_left_icon_size"
         android:layout_height="@dimen/notification_2025_left_icon_size"
         android:layout_alignParentStart="true"
-        android:layout_centerVertical="true"
-        android:layout_marginStart="@dimen/notification_left_icon_start"
+        android:layout_margin="@dimen/notification_2025_margin"
         android:background="@drawable/notification_large_icon_outline"
         android:clipToOutline="true"
         android:importantForAccessibility="no"
@@ -47,8 +46,7 @@
         android:layout_width="@dimen/notification_2025_icon_circle_size"
         android:layout_height="@dimen/notification_2025_icon_circle_size"
         android:layout_alignParentStart="true"
-        android:layout_centerVertical="true"
-        android:layout_marginStart="@dimen/notification_icon_circle_start"
+        android:layout_margin="@dimen/notification_2025_margin"
         android:background="@drawable/notification_icon_circle"
         android:padding="@dimen/notification_2025_icon_circle_padding"
         android:maxDrawableWidth="@dimen/notification_2025_icon_circle_size"
diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml
index 13c125c..53b47622 100644
--- a/core/res/res/values/config.xml
+++ b/core/res/res/values/config.xml
@@ -4228,13 +4228,12 @@
          must match the value of config_cameraLaunchGestureSensorType in OEM's HAL -->
     <string translatable="false" name="config_cameraLaunchGestureSensorStringType"></string>
 
-    <!-- Allow the gesture to double tap the power button to trigger a target action. -->
-    <bool name="config_doubleTapPowerGestureEnabled">true</bool>
     <!-- Allow the gesture to double tap the power button twice to start the camera while the device
          is non-interactive. -->
     <bool name="config_cameraDoubleTapPowerGestureEnabled">true</bool>
-    <!-- Allow the gesture to double tap the power button twice to launch the wallet. -->
-    <bool name="config_walletDoubleTapPowerGestureEnabled">true</bool>
+
+    <!-- Allow the gesture to double tap the power button to trigger a target action. -->
+    <bool name="config_doubleTapPowerGestureEnabled">true</bool>
     <!-- Default target action for double tap of the power button gesture.
          0: Launch camera
          1: Launch wallet -->
diff --git a/core/res/res/values/config_telephony.xml b/core/res/res/values/config_telephony.xml
index bb76b9f..196da29 100644
--- a/core/res/res/values/config_telephony.xml
+++ b/core/res/res/values/config_telephony.xml
@@ -496,4 +496,8 @@
          not connected state. -->
     <bool name="config_satellite_allow_check_message_in_not_connected">false</bool>
     <java-symbol type="bool" name="config_satellite_allow_check_message_in_not_connected" />
+
+    <!-- Whether to allow TN scanning during satellite session. -->
+    <bool name="config_satellite_allow_tn_scanning_during_satellite_session">true</bool>
+    <java-symbol type="bool" name="config_satellite_allow_tn_scanning_during_satellite_session" />
 </resources>
diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml
index 7e8a2e9..28de553 100644
--- a/core/res/res/values/symbols.xml
+++ b/core/res/res/values/symbols.xml
@@ -3161,9 +3161,8 @@
   <java-symbol type="string" name="config_cameraLaunchGestureSensorStringType" />
   <java-symbol type="integer" name="config_cameraLiftTriggerSensorType" />
   <java-symbol type="string" name="config_cameraLiftTriggerSensorStringType" />
-  <java-symbol type="bool" name="config_doubleTapPowerGestureEnabled" />
   <java-symbol type="bool" name="config_cameraDoubleTapPowerGestureEnabled" />
-  <java-symbol type="bool" name="config_walletDoubleTapPowerGestureEnabled" />
+  <java-symbol type="bool" name="config_doubleTapPowerGestureEnabled" />
   <java-symbol type="integer" name="config_defaultDoubleTapPowerGestureAction" />
   <java-symbol type="bool" name="config_emergencyGestureEnabled" />
   <java-symbol type="bool" name="config_defaultEmergencyGestureEnabled" />
diff --git a/core/tests/coretests/src/android/app/NotificationTest.java b/core/tests/coretests/src/android/app/NotificationTest.java
index 63e678d..9effeec 100644
--- a/core/tests/coretests/src/android/app/NotificationTest.java
+++ b/core/tests/coretests/src/android/app/NotificationTest.java
@@ -467,12 +467,25 @@
                 .setStyle(new Notification.BigTextStyle().setBigContentTitle("BIG"))
                 .setColor(Color.WHITE)
                 .setColorized(true)
+                .setOngoing(true)
                 .build();
         assertThat(n.hasPromotableCharacteristics()).isTrue();
     }
 
     @Test
     @EnableFlags(Flags.FLAG_UI_RICH_ONGOING)
+    public void testHasPromotableCharacteristics_notOngoing() {
+        Notification n = new Notification.Builder(mContext, "test")
+                .setSmallIcon(android.R.drawable.sym_def_app_icon)
+                .setStyle(new Notification.BigTextStyle().setBigContentTitle("BIG"))
+                .setColor(Color.WHITE)
+                .setColorized(true)
+                .build();
+        assertThat(n.hasPromotableCharacteristics()).isFalse();
+    }
+
+    @Test
+    @EnableFlags(Flags.FLAG_UI_RICH_ONGOING)
     public void testHasPromotableCharacteristics_wrongStyle() {
         Notification n = new Notification.Builder(mContext, "test")
                 .setSmallIcon(android.R.drawable.sym_def_app_icon)
@@ -480,6 +493,7 @@
                 .setContentTitle("TITLE")
                 .setColor(Color.WHITE)
                 .setColorized(true)
+                .setOngoing(true)
                 .build();
         assertThat(n.hasPromotableCharacteristics()).isFalse();
     }
@@ -491,6 +505,7 @@
                 .setSmallIcon(android.R.drawable.sym_def_app_icon)
                 .setStyle(new Notification.BigTextStyle().setBigContentTitle("BIG"))
                 .setColor(Color.WHITE)
+                .setOngoing(true)
                 .build();
         assertThat(n.hasPromotableCharacteristics()).isFalse();
     }
@@ -503,6 +518,7 @@
                 .setStyle(new Notification.BigTextStyle())
                 .setColor(Color.WHITE)
                 .setColorized(true)
+                .setOngoing(true)
                 .build();
         assertThat(n.hasPromotableCharacteristics()).isFalse();
     }
@@ -515,6 +531,7 @@
                 .setStyle(new Notification.BigTextStyle().setBigContentTitle("BIG"))
                 .setColor(Color.WHITE)
                 .setColorized(true)
+                .setOngoing(true)
                 .setGroup("someGroup")
                 .setGroupSummary(true)
                 .build();
diff --git a/core/tests/coretests/src/android/os/TestLooperManagerTest.java b/core/tests/coretests/src/android/os/TestLooperManagerTest.java
deleted file mode 100644
index 4d64a3a..0000000
--- a/core/tests/coretests/src/android/os/TestLooperManagerTest.java
+++ /dev/null
@@ -1,91 +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 android.os;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-
-import android.platform.test.ravenwood.RavenwoodRule;
-
-import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.platform.app.InstrumentationRegistry;
-
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.TimeUnit;
-
-@RunWith(AndroidJUnit4.class)
-public class TestLooperManagerTest {
-    private static final String TAG = "TestLooperManagerTest";
-
-    @Rule
-    public final RavenwoodRule mRavenwood = new RavenwoodRule.Builder()
-            .setProvideMainThread(true)
-            .build();
-
-    @Test
-    public void testMainThread() throws Exception {
-        doTest(Looper.getMainLooper());
-    }
-
-    @Test
-    public void testCustomThread() throws Exception {
-        final HandlerThread thread = new HandlerThread(TAG);
-        thread.start();
-        doTest(thread.getLooper());
-    }
-
-    private void doTest(Looper looper) throws Exception {
-        final TestLooperManager tlm =
-                InstrumentationRegistry.getInstrumentation().acquireLooperManager(looper);
-
-        final Handler handler = new Handler(looper);
-        final CountDownLatch latch = new CountDownLatch(1);
-
-        assertFalse(tlm.hasMessages(handler, null, 42));
-
-        handler.sendEmptyMessage(42);
-        handler.post(() -> {
-            latch.countDown();
-        });
-        assertTrue(tlm.hasMessages(handler, null, 42));
-        assertFalse(latch.await(100, TimeUnit.MILLISECONDS));
-
-        final Message first = tlm.next();
-        assertEquals(42, first.what);
-        assertNull(first.callback);
-        tlm.execute(first);
-        assertFalse(tlm.hasMessages(handler, null, 42));
-        assertFalse(latch.await(100, TimeUnit.MILLISECONDS));
-        tlm.recycle(first);
-
-        final Message second = tlm.next();
-        assertNotNull(second.callback);
-        tlm.execute(second);
-        assertFalse(tlm.hasMessages(handler, null, 42));
-        assertTrue(latch.await(100, TimeUnit.MILLISECONDS));
-        tlm.recycle(second);
-
-        tlm.release();
-    }
-}
diff --git a/core/tests/utiltests/src/com/android/internal/util/ArrayUtilsTest.java b/core/tests/utiltests/src/com/android/internal/util/ArrayUtilsTest.java
index 3b9f35b..e6586b3 100644
--- a/core/tests/utiltests/src/com/android/internal/util/ArrayUtilsTest.java
+++ b/core/tests/utiltests/src/com/android/internal/util/ArrayUtilsTest.java
@@ -496,4 +496,58 @@
             // expected
         }
     }
+
+    // Note: the zeroize() tests only test the behavior that can be tested from a Java test.
+    // They do not verify that no copy of the data is left anywhere.
+
+    @Test
+    @SmallTest
+    public void testZeroizeNonMovableByteArray() {
+        final int length = 10;
+        byte[] array = ArrayUtils.newNonMovableByteArray(length);
+        assertArrayEquals(array, new byte[length]);
+        Arrays.fill(array, (byte) 0xff);
+        ArrayUtils.zeroize(array);
+        assertArrayEquals(array, new byte[length]);
+    }
+
+    @Test
+    @SmallTest
+    public void testZeroizeRegularByteArray() {
+        final int length = 10;
+        byte[] array = new byte[length];
+        assertArrayEquals(array, new byte[length]);
+        Arrays.fill(array, (byte) 0xff);
+        ArrayUtils.zeroize(array);
+        assertArrayEquals(array, new byte[length]);
+    }
+
+    @Test
+    @SmallTest
+    public void testZeroizeNonMovableCharArray() {
+        final int length = 10;
+        char[] array = ArrayUtils.newNonMovableCharArray(length);
+        assertArrayEquals(array, new char[length]);
+        Arrays.fill(array, (char) 0xff);
+        ArrayUtils.zeroize(array);
+        assertArrayEquals(array, new char[length]);
+    }
+
+    @Test
+    @SmallTest
+    public void testZeroizeRegularCharArray() {
+        final int length = 10;
+        char[] array = new char[length];
+        assertArrayEquals(array, new char[length]);
+        Arrays.fill(array, (char) 0xff);
+        ArrayUtils.zeroize(array);
+        assertArrayEquals(array, new char[length]);
+    }
+
+    @Test
+    @SmallTest
+    public void testZeroize_acceptsNull() {
+        ArrayUtils.zeroize((byte[]) null);
+        ArrayUtils.zeroize((char[]) null);
+    }
 }
diff --git a/libs/WindowManager/Jetpack/src/androidx/window/extensions/embedding/JetpackTaskFragmentOrganizer.java b/libs/WindowManager/Jetpack/src/androidx/window/extensions/embedding/JetpackTaskFragmentOrganizer.java
index 9ea2943..f0613ce 100644
--- a/libs/WindowManager/Jetpack/src/androidx/window/extensions/embedding/JetpackTaskFragmentOrganizer.java
+++ b/libs/WindowManager/Jetpack/src/androidx/window/extensions/embedding/JetpackTaskFragmentOrganizer.java
@@ -398,27 +398,23 @@
                 new TaskFragmentAnimationParams.Builder();
         final int animationBackgroundColor = getAnimationBackgroundColor(splitAttributes);
         builder.setAnimationBackgroundColor(animationBackgroundColor);
-        if (Flags.activityEmbeddingAnimationCustomizationFlag()) {
-            final int openAnimationResId =
-                    splitAttributes.getAnimationParams().getOpenAnimationResId();
-            builder.setOpenAnimationResId(openAnimationResId);
-            final int closeAnimationResId =
-                    splitAttributes.getAnimationParams().getCloseAnimationResId();
-            builder.setCloseAnimationResId(closeAnimationResId);
-            final int changeAnimationResId =
-                    splitAttributes.getAnimationParams().getChangeAnimationResId();
-            builder.setChangeAnimationResId(changeAnimationResId);
-        }
+        final int openAnimationResId =
+                splitAttributes.getAnimationParams().getOpenAnimationResId();
+        builder.setOpenAnimationResId(openAnimationResId);
+        final int closeAnimationResId =
+                splitAttributes.getAnimationParams().getCloseAnimationResId();
+        builder.setCloseAnimationResId(closeAnimationResId);
+        final int changeAnimationResId =
+                splitAttributes.getAnimationParams().getChangeAnimationResId();
+        builder.setChangeAnimationResId(changeAnimationResId);
         return builder.build();
     }
 
     @ColorInt
     private static int getAnimationBackgroundColor(@NonNull SplitAttributes splitAttributes) {
         int animationBackgroundColor = DEFAULT_ANIMATION_BACKGROUND_COLOR;
-        AnimationBackground animationBackground = splitAttributes.getAnimationBackground();
-        if (Flags.activityEmbeddingAnimationCustomizationFlag()) {
-            animationBackground = splitAttributes.getAnimationParams().getAnimationBackground();
-        }
+        final AnimationBackground animationBackground =
+            splitAttributes.getAnimationParams().getAnimationBackground();
         if (animationBackground instanceof AnimationBackground.ColorBackground colorBackground) {
             animationBackgroundColor = colorBackground.getColor();
         }
diff --git a/libs/WindowManager/Shell/multivalentTests/src/com/android/wm/shell/bubbles/BubblePositionerTest.kt b/libs/WindowManager/Shell/multivalentTests/src/com/android/wm/shell/bubbles/BubblePositionerTest.kt
index b38d00da..1d0c505 100644
--- a/libs/WindowManager/Shell/multivalentTests/src/com/android/wm/shell/bubbles/BubblePositionerTest.kt
+++ b/libs/WindowManager/Shell/multivalentTests/src/com/android/wm/shell/bubbles/BubblePositionerTest.kt
@@ -602,8 +602,72 @@
         testGetBubbleBarExpandedViewBounds(onLeft = false, isOverflow = true)
     }
 
+    @Test
+    fun getExpandedViewContainerPadding_largeScreen_fitsMaxViewWidth() {
+        val expandedViewWidth = context.resources.getDimensionPixelSize(
+            R.dimen.bubble_expanded_view_largescreen_width
+        )
+        // set the screen size so that it is wide enough to fit the maximum width size
+        val screenWidth = expandedViewWidth * 2
+        positioner.update(
+            defaultDeviceConfig.copy(
+                windowBounds = Rect(0, 0, screenWidth, 2000),
+                isLargeScreen = true,
+                isLandscape = false
+            )
+        )
+        val paddings =
+            positioner.getExpandedViewContainerPadding(/* onLeft= */ true, /* isOverflow= */ false)
+
+        val padding = context.resources.getDimensionPixelSize(
+            R.dimen.bubble_expanded_view_largescreen_landscape_padding
+        )
+        val right = screenWidth - expandedViewWidth - padding
+        assertThat(paddings).isEqualTo(intArrayOf(padding - positioner.pointerSize, 0, right, 0))
+    }
+
+    @Test
+    fun getExpandedViewContainerPadding_largeScreen_doesNotFitMaxViewWidth() {
+        positioner.update(
+            defaultDeviceConfig.copy(
+                windowBounds = Rect(0, 0, 600, 2000),
+                isLargeScreen = true,
+                isLandscape = false
+            )
+        )
+        val paddings =
+            positioner.getExpandedViewContainerPadding(/* onLeft= */ true, /* isOverflow= */ false)
+
+        val padding = context.resources.getDimensionPixelSize(
+            R.dimen.bubble_expanded_view_largescreen_landscape_padding
+        )
+        // the screen is not wide enough to fit the maximum width size, so the view fills the screen
+        // minus left and right padding
+        assertThat(paddings).isEqualTo(intArrayOf(padding - positioner.pointerSize, 0, padding, 0))
+    }
+
+    @Test
+    fun getExpandedViewContainerPadding_smallTablet() {
+        val screenWidth = 500
+        positioner.update(
+            defaultDeviceConfig.copy(
+                windowBounds = Rect(0, 0, screenWidth, 2000),
+                isLargeScreen = true,
+                isSmallTablet = true,
+                isLandscape = false
+            )
+        )
+        val paddings =
+            positioner.getExpandedViewContainerPadding(/* onLeft= */ true, /* isOverflow= */ false)
+
+        // for small tablets, the view width is set to be 0.72 * screen width
+        val viewWidth = (screenWidth * 0.72).toInt()
+        val padding = (screenWidth - viewWidth) / 2
+        assertThat(paddings).isEqualTo(intArrayOf(padding - positioner.pointerSize, 0, padding, 0))
+    }
+
     private fun testGetBubbleBarExpandedViewBounds(onLeft: Boolean, isOverflow: Boolean) {
-        positioner.setShowingInBubbleBar(true)
+        positioner.isShowingInBubbleBar = true
         val windowBounds = Rect(0, 0, 2000, 2600)
         val insets = Insets.of(10, 20, 5, 15)
         val deviceConfig =
diff --git a/libs/WindowManager/Shell/shared/src/com/android/wm/shell/shared/desktopmode/DesktopModeStatus.java b/libs/WindowManager/Shell/shared/src/com/android/wm/shell/shared/desktopmode/DesktopModeStatus.java
index 04c17e5..a5205ee 100644
--- a/libs/WindowManager/Shell/shared/src/com/android/wm/shell/shared/desktopmode/DesktopModeStatus.java
+++ b/libs/WindowManager/Shell/shared/src/com/android/wm/shell/shared/desktopmode/DesktopModeStatus.java
@@ -162,6 +162,21 @@
     }
 
     /**
+     * Return the maximum size of the window decoration surface control view host pool, or zero if
+     * there should be no pooling.
+     */
+    public static int getWindowDecorScvhPoolSize(@NonNull Context context) {
+        if (!Flags.enableDesktopWindowingScvhCacheBugFix()) return 0;
+        final int maxTaskLimit = getMaxTaskLimit(context);
+        if (maxTaskLimit > 0) {
+            return maxTaskLimit;
+        }
+        // TODO: b/368032552 - task limit equal to 0 means unlimited. Figure out what the pool
+        //  size should be in that case.
+        return 0;
+    }
+
+    /**
      * Return {@code true} if the current device supports desktop mode.
      */
     @VisibleForTesting
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/activityembedding/ActivityEmbeddingAnimationRunner.java b/libs/WindowManager/Shell/src/com/android/wm/shell/activityembedding/ActivityEmbeddingAnimationRunner.java
index d2cef4b..f269b38 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/activityembedding/ActivityEmbeddingAnimationRunner.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/activityembedding/ActivityEmbeddingAnimationRunner.java
@@ -268,10 +268,7 @@
             final Animation animation =
                     animationProvider.get(info, change, openingWholeScreenBounds);
             if (shouldUseJumpCutForAnimation(animation)) {
-                if (Flags.activityEmbeddingAnimationCustomizationFlag()) {
-                    return new ArrayList<>();
-                }
-                continue;
+                return new ArrayList<>();
             }
             final ActivityEmbeddingAnimationAdapter adapter = createOpenCloseAnimationAdapter(
                     info, change, animation, openingWholeScreenBounds);
@@ -296,10 +293,7 @@
             final Animation animation =
                     animationProvider.get(info, change, closingWholeScreenBounds);
             if (shouldUseJumpCutForAnimation(animation)) {
-                if (Flags.activityEmbeddingAnimationCustomizationFlag()) {
-                    return new ArrayList<>();
-                }
-                continue;
+                return new ArrayList<>();
             }
             final ActivityEmbeddingAnimationAdapter adapter = createOpenCloseAnimationAdapter(
                     info, change, animation, closingWholeScreenBounds);
@@ -455,11 +449,9 @@
             final Animation[] animations =
                     mAnimationSpec.createChangeBoundsChangeAnimations(info, change, parentBounds);
             // Jump cut if either animation has zero for duration.
-            if (Flags.activityEmbeddingAnimationCustomizationFlag()) {
-                for (Animation animation : animations) {
-                    if (shouldUseJumpCutForAnimation(animation)) {
-                        return new ArrayList<>();
-                    }
+            for (Animation animation : animations) {
+                if (shouldUseJumpCutForAnimation(animation)) {
+                    return new ArrayList<>();
                 }
             }
             // Keep track as we might need to add background color for the animation.
@@ -516,10 +508,8 @@
                         mAnimationSpec.createChangeBoundsOpenAnimation(info, change, parentBounds);
                 shouldShowBackgroundColor = false;
             }
-            if (Flags.activityEmbeddingAnimationCustomizationFlag()) {
-                if (shouldUseJumpCutForAnimation(animation)) {
-                    return new ArrayList<>();
-                }
+            if (shouldUseJumpCutForAnimation(animation)) {
+                return new ArrayList<>();
             }
             adapters.add(new ActivityEmbeddingAnimationAdapter(animation, change,
                     TransitionUtil.getRootFor(change, info)));
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/activityembedding/ActivityEmbeddingAnimationSpec.java b/libs/WindowManager/Shell/src/com/android/wm/shell/activityembedding/ActivityEmbeddingAnimationSpec.java
index 3046307..77799e9 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/activityembedding/ActivityEmbeddingAnimationSpec.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/activityembedding/ActivityEmbeddingAnimationSpec.java
@@ -96,11 +96,9 @@
     @NonNull
     Animation createChangeBoundsOpenAnimation(@NonNull TransitionInfo info,
             @NonNull TransitionInfo.Change change, @NonNull Rect parentBounds) {
-        if (Flags.activityEmbeddingAnimationCustomizationFlag()) {
-            final Animation customAnimation = loadCustomAnimation(info, change, TRANSIT_CHANGE);
-            if (customAnimation != null) {
-                return customAnimation;
-            }
+        final Animation customAnimation = loadCustomAnimation(info, change, TRANSIT_CHANGE);
+        if (customAnimation != null) {
+            return customAnimation;
         }
         // Use end bounds for opening.
         final Rect bounds = change.getEndAbsBounds();
@@ -130,11 +128,9 @@
     @NonNull
     Animation createChangeBoundsCloseAnimation(@NonNull TransitionInfo info,
             @NonNull TransitionInfo.Change change, @NonNull Rect parentBounds) {
-        if (Flags.activityEmbeddingAnimationCustomizationFlag()) {
-            final Animation customAnimation = loadCustomAnimation(info, change, TRANSIT_CHANGE);
-            if (customAnimation != null) {
-                return customAnimation;
-            }
+        final Animation customAnimation = loadCustomAnimation(info, change, TRANSIT_CHANGE);
+        if (customAnimation != null) {
+            return customAnimation;
         }
         // Use start bounds for closing.
         final Rect bounds = change.getStartAbsBounds();
@@ -168,14 +164,12 @@
     @NonNull
     Animation[] createChangeBoundsChangeAnimations(@NonNull TransitionInfo info,
             @NonNull TransitionInfo.Change change, @NonNull Rect parentBounds) {
-        if (Flags.activityEmbeddingAnimationCustomizationFlag()) {
-            // TODO(b/293658614): Support more complicated animations that may need more than a noop
-            // animation as the start leash.
-            final Animation noopAnimation = createNoopAnimation(change);
-            final Animation customAnimation = loadCustomAnimation(info, change, TRANSIT_CHANGE);
-            if (customAnimation != null) {
-                return new Animation[]{noopAnimation, customAnimation};
-            }
+        // TODO(b/293658614): Support more complicated animations that may need more than a noop
+        // animation as the start leash.
+        final Animation noopAnimation = createNoopAnimation(change);
+        final Animation customAnimation = loadCustomAnimation(info, change, TRANSIT_CHANGE);
+        if (customAnimation != null) {
+            return new Animation[]{noopAnimation, customAnimation};
         }
         // Both start bounds and end bounds are in screen coordinates. We will post translate
         // to the local coordinates in ActivityEmbeddingAnimationAdapter#onAnimationUpdate
@@ -320,13 +314,9 @@
         }
 
         final Animation anim;
-        if (Flags.activityEmbeddingAnimationCustomizationFlag()) {
-            // TODO(b/293658614): Consider allowing custom animations from non-default packages.
-            // Enforce limiting to animations from the default "android" package for now.
-            anim = mTransitionAnimation.loadDefaultAnimationRes(resId);
-        } else {
-            anim = mTransitionAnimation.loadAnimationRes(options.getPackageName(), resId);
-        }
+        // TODO(b/293658614): Consider allowing custom animations from non-default packages.
+        // Enforce limiting to animations from the default "android" package for now.
+        anim = mTransitionAnimation.loadDefaultAnimationRes(resId);
         if (anim != null) {
             return anim;
         }
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/back/BackAnimationController.java b/libs/WindowManager/Shell/src/com/android/wm/shell/back/BackAnimationController.java
index c024840..673d8b3 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/back/BackAnimationController.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/back/BackAnimationController.java
@@ -731,6 +731,8 @@
             callback.onBackStarted(backEvent);
             if (mBackTransitionHandler.canHandOffAnimation()) {
                 callback.setHandoffHandler(mHandoffHandler);
+            } else {
+                callback.setHandoffHandler(null);
             }
             mOnBackStartDispatched = true;
         } catch (RemoteException e) {
@@ -1273,14 +1275,6 @@
                 @NonNull SurfaceControl.Transaction st,
                 @NonNull SurfaceControl.Transaction ft,
                 @NonNull Transitions.TransitionFinishCallback finishCallback) {
-            final boolean isPrepareTransition =
-                    info.getType() == WindowManager.TRANSIT_PREPARE_BACK_NAVIGATION;
-            if (isPrepareTransition) {
-                if (checkTakeoverFlags()) {
-                    mTakeoverHandler = mTransitions.getHandlerForTakeover(transition, info);
-                }
-                kickStartAnimation();
-            }
             // Both mShellExecutor and Transitions#mMainExecutor are ShellMainThread, so we don't
             // need to post to ShellExecutor when called.
             if (info.getType() == WindowManager.TRANSIT_CLOSE_PREPARE_BACK_NAVIGATION) {
@@ -1308,7 +1302,8 @@
                     // animation never start, consume directly
                     applyAndFinish(st, ft, finishCallback);
                     return true;
-                } else if (mClosePrepareTransition == null && isPrepareTransition) {
+                } else if (mClosePrepareTransition == null
+                        && info.getType() == WindowManager.TRANSIT_PREPARE_BACK_NAVIGATION) {
                     // Gesture animation was cancelled before prepare transition ready, create
                     // the close prepare transition
                     createClosePrepareTransition();
@@ -1316,6 +1311,10 @@
             }
 
             if (handlePrepareTransition(info, st, ft, finishCallback)) {
+                if (checkTakeoverFlags()) {
+                    mTakeoverHandler = mTransitions.getHandlerForTakeover(transition, info);
+                }
+                kickStartAnimation();
                 return true;
             }
             return handleCloseTransition(info, st, ft, finishCallback);
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubblePositioner.java b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubblePositioner.java
index 0fd4206..de85d9a 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubblePositioner.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubblePositioner.java
@@ -163,8 +163,11 @@
             mExpandedViewLargeScreenWidth = (int) (bounds.width()
                     * EXPANDED_VIEW_SMALL_TABLET_WIDTH_PERCENT);
         } else {
-            mExpandedViewLargeScreenWidth =
-                    res.getDimensionPixelSize(R.dimen.bubble_expanded_view_largescreen_width);
+            int expandedViewLargeScreenSpacing = res.getDimensionPixelSize(
+                    R.dimen.bubble_expanded_view_largescreen_landscape_padding);
+            mExpandedViewLargeScreenWidth = Math.min(
+                    res.getDimensionPixelSize(R.dimen.bubble_expanded_view_largescreen_width),
+                    bounds.width() - expandedViewLargeScreenSpacing * 2);
         }
         if (mDeviceConfig.isLargeScreen()) {
             if (mDeviceConfig.isSmallTablet()) {
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/common/BoostExecutor.kt b/libs/WindowManager/Shell/src/com/android/wm/shell/common/BoostExecutor.kt
new file mode 100644
index 0000000..498d0e4
--- /dev/null
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/common/BoostExecutor.kt
@@ -0,0 +1,47 @@
+/*
+ * 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.wm.shell.common
+
+import android.os.Looper
+import java.util.concurrent.Executor
+
+/** Executor implementation which can be boosted temporarily to a different thread priority.  */
+interface BoostExecutor : Executor {
+    /**
+     * Requests that the executor is boosted until {@link #resetBoost()} is called.
+     */
+    fun setBoost() {}
+
+    /**
+     * Requests that the executor is not boosted (only resets if there are no other boost requests
+     * in progress).
+     */
+    fun resetBoost() {}
+
+    /**
+     * Returns whether the executor is boosted.
+     */
+    fun isBoosted() : Boolean {
+        return false
+    }
+
+    /**
+     * Returns the looper for this executor.
+     */
+    fun getLooper() : Looper? {
+        return Looper.myLooper()
+    }
+}
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/common/HandlerExecutor.java b/libs/WindowManager/Shell/src/com/android/wm/shell/common/HandlerExecutor.java
index 736d954..803f16c 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/common/HandlerExecutor.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/common/HandlerExecutor.java
@@ -16,15 +16,50 @@
 
 package com.android.wm.shell.common;
 
+import static android.os.Process.THREAD_PRIORITY_DEFAULT;
+import static android.os.Process.setThreadPriority;
+
 import android.annotation.NonNull;
 import android.os.Handler;
+import android.os.HandlerThread;
+import android.os.Looper;
+
+import androidx.annotation.VisibleForTesting;
+
+import java.util.function.BiConsumer;
 
 /** Executor implementation which is backed by a Handler. */
 public class HandlerExecutor implements ShellExecutor {
+    @NonNull
     private final Handler mHandler;
+    // See android.os.Process#THREAD_PRIORITY_*
+    private final int mDefaultThreadPriority;
+    private final int mBoostedThreadPriority;
+    // Number of current requests to boost thread priority
+    private int mBoostCount;
+    private final Object mBoostLock = new Object();
+    // Default function for setting thread priority (tid, priority)
+    private BiConsumer<Integer, Integer> mSetThreadPriorityFn =
+            HandlerExecutor::setThreadPriorityInternal;
 
     public HandlerExecutor(@NonNull Handler handler) {
+        this(handler, THREAD_PRIORITY_DEFAULT, THREAD_PRIORITY_DEFAULT);
+    }
+
+    /**
+     * Used only if this executor can be boosted, if so, it can be boosted to the given
+     * {@param boostPriority}.
+     */
+    public HandlerExecutor(@NonNull Handler handler, int defaultThreadPriority,
+            int boostedThreadPriority) {
         mHandler = handler;
+        mDefaultThreadPriority = defaultThreadPriority;
+        mBoostedThreadPriority = boostedThreadPriority;
+    }
+
+    @VisibleForTesting
+    void replaceSetThreadPriorityFn(BiConsumer<Integer, Integer> setThreadPriorityFn) {
+        mSetThreadPriorityFn = setThreadPriorityFn;
     }
 
     @Override
@@ -56,9 +91,54 @@
     }
 
     @Override
+    public void setBoost() {
+        synchronized (mBoostLock) {
+            if (mDefaultThreadPriority == mBoostedThreadPriority) {
+                // Nothing to boost
+                return;
+            }
+            if (mBoostCount == 0) {
+                mSetThreadPriorityFn.accept(
+                        ((HandlerThread) mHandler.getLooper().getThread()).getThreadId(),
+                        mBoostedThreadPriority);
+            }
+            mBoostCount++;
+        }
+    }
+
+    @Override
+    public void resetBoost() {
+        synchronized (mBoostLock) {
+            mBoostCount--;
+            if (mBoostCount == 0) {
+                mSetThreadPriorityFn.accept(
+                        ((HandlerThread) mHandler.getLooper().getThread()).getThreadId(),
+                        mDefaultThreadPriority);
+            }
+        }
+    }
+
+    @Override
+    public boolean isBoosted() {
+        synchronized (mBoostLock) {
+            return mBoostCount > 0;
+        }
+    }
+
+    @Override
+    @NonNull
+    public Looper getLooper() {
+        return mHandler.getLooper();
+    }
+
+    @Override
     public void assertCurrentThread() {
         if (!mHandler.getLooper().isCurrentThread()) {
             throw new IllegalStateException("must be called on " + mHandler);
         }
     }
+
+    private static void setThreadPriorityInternal(Integer tid, Integer priority) {
+        setThreadPriority(tid, priority);
+    }
 }
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/common/ShellExecutor.java b/libs/WindowManager/Shell/src/com/android/wm/shell/common/ShellExecutor.java
index 2c2961f..9e5071e 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/common/ShellExecutor.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/common/ShellExecutor.java
@@ -18,15 +18,15 @@
 
 import java.lang.reflect.Array;
 import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.Executor;
 import java.util.concurrent.TimeUnit;
 import java.util.function.Supplier;
 
 /**
  * Super basic Executor interface that adds support for delayed execution and removing callbacks.
- * Intended to wrap Handler while better-supporting testing.
+ * Intended to wrap Handler while better-supporting testing.  Not every ShellExecutor implementation
+ * may support boosting.
  */
-public interface ShellExecutor extends Executor {
+public interface ShellExecutor extends BoostExecutor {
 
     /**
      * Executes the given runnable. If the caller is running on the same looper as this executor,
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/compatui/letterbox/LetterboxCommandHandler.kt b/libs/WindowManager/Shell/src/com/android/wm/shell/compatui/letterbox/LetterboxCommandHandler.kt
index 819b110..2d0a3f5 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/compatui/letterbox/LetterboxCommandHandler.kt
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/compatui/letterbox/LetterboxCommandHandler.kt
@@ -67,8 +67,8 @@
             return false
         }
         return when (args.size) {
-            1 -> onShellDisplayCommand(args[0], pw)
-            2 -> onShellUpdateCommand(args[0], args[1], pw)
+            1 -> onNoParamsCommand(args[0], pw)
+            2 -> onSingleParamCommand(args[0], args[1], pw)
             else -> {
                 pw.println("Invalid command: " + args[0])
                 return false
@@ -89,11 +89,17 @@
                     $prefix      name, for example, @android:color/system_accent2_50.
                     $prefix backgroundColorReset"
                     $prefix      Resets the background color to the default value."
+                    $prefix cornerRadius"
+                    $prefix      Corners radius (in pixels) for activities in the letterbox mode."
+                    $prefix      If cornerRadius < 0, it will be ignored and corners of the"
+                    $prefix      activity won't be rounded."
+                    $prefix cornerRadiusReset"
+                    $prefix      Resets the rounded corners radius to the default value."
                 """.trimIndent()
         )
     }
 
-    private fun onShellUpdateCommand(command: String, value: String, pw: PrintWriter): Boolean {
+    private fun onSingleParamCommand(command: String, value: String, pw: PrintWriter): Boolean {
         when (command) {
             "backgroundColor" -> {
                 return invokeWhenValid(
@@ -120,10 +126,17 @@
                 }
             )
 
-            "backgroundColorReset" -> {
-                letterboxConfiguration.resetLetterboxBackgroundColor()
-                return true
-            }
+            "cornerRadius" -> return invokeWhenValid(
+                pw,
+                value,
+                ::strToInt{ it >= 0 },
+                { radius ->
+                    letterboxConfiguration.setLetterboxActivityCornersRadius(radius)
+                },
+                { r ->
+                    "$r is not a valid radius. It must be an integer >= 0."
+                }
+            )
 
             else -> {
                 pw.println("Invalid command: $value")
@@ -132,7 +145,7 @@
         }
     }
 
-    private fun onShellDisplayCommand(command: String, pw: PrintWriter): Boolean {
+    private fun onNoParamsCommand(command: String, pw: PrintWriter): Boolean {
         when (command) {
             "backgroundColor" -> {
                 pw.println(
@@ -144,6 +157,24 @@
                 return true
             }
 
+            "backgroundColorReset" -> {
+                letterboxConfiguration.resetLetterboxBackgroundColor()
+                return true
+            }
+
+            "cornerRadius" -> {
+                pw.println(
+                    "    Rounded corners radius: " +
+                        "${letterboxConfiguration.getLetterboxActivityCornersRadius()} px."
+                )
+                return true
+            }
+
+            "cornerRadiusReset" -> {
+                letterboxConfiguration.resetLetterboxActivityCornersRadius()
+                return true
+            }
+
             else -> {
                 pw.println("Invalid command: $command")
                 return false
@@ -181,4 +212,15 @@
         } catch (e: IllegalArgumentException) {
             null
         }
+
+    // Converts a String to Int which if possible or it returns null otherwise.
+    // If a predicate is set, it also returns [null] if the predicate evaluate to [false].
+    private fun strToInt(predicate: (Int) -> Boolean = { _ -> true }): (String) -> Int? = { str ->
+        try {
+            val value = str.toInt()
+            if (predicate(value)) value else null
+        } catch (e: IllegalArgumentException) {
+            null
+        }
+    }
 }
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/dagger/WMShellConcurrencyModule.java b/libs/WindowManager/Shell/src/com/android/wm/shell/dagger/WMShellConcurrencyModule.java
index c5644a8..d7ddbde 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/dagger/WMShellConcurrencyModule.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/dagger/WMShellConcurrencyModule.java
@@ -18,6 +18,7 @@
 
 import static android.os.Process.THREAD_PRIORITY_BACKGROUND;
 import static android.os.Process.THREAD_PRIORITY_DISPLAY;
+import static android.os.Process.THREAD_PRIORITY_FOREGROUND;
 import static android.os.Process.THREAD_PRIORITY_TOP_APP_BOOST;
 
 import android.content.Context;
@@ -205,13 +206,14 @@
     }
 
     /**
-     * Provides a Shell background thread Executor for low priority background tasks.
+     * Provides a Shell background thread Executor for low priority background tasks.  The thread
+     * may also be boosted to THREAD_PRIORITY_FOREGROUND if necessary.
      */
     @WMSingleton
     @Provides
     @ShellBackgroundThread
     public static ShellExecutor provideSharedBackgroundExecutor(
             @ShellBackgroundThread Handler handler) {
-        return new HandlerExecutor(handler);
+        return new HandlerExecutor(handler, THREAD_PRIORITY_BACKGROUND, THREAD_PRIORITY_FOREGROUND);
     }
 }
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/dagger/WMShellModule.java b/libs/WindowManager/Shell/src/com/android/wm/shell/dagger/WMShellModule.java
index 86e0d08..f9e3be9 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/dagger/WMShellModule.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/dagger/WMShellModule.java
@@ -152,6 +152,7 @@
 import com.android.wm.shell.windowdecor.WindowDecorViewModel;
 import com.android.wm.shell.windowdecor.additionalviewcontainer.AdditionalSystemViewContainer;
 import com.android.wm.shell.windowdecor.common.viewhost.DefaultWindowDecorViewHostSupplier;
+import com.android.wm.shell.windowdecor.common.viewhost.PooledWindowDecorViewHostSupplier;
 import com.android.wm.shell.windowdecor.common.viewhost.WindowDecorViewHost;
 import com.android.wm.shell.windowdecor.common.viewhost.WindowDecorViewHostSupplier;
 import com.android.wm.shell.windowdecor.education.DesktopWindowingEducationPromoController;
@@ -347,7 +348,12 @@
     @WMSingleton
     @Provides
     static WindowDecorViewHostSupplier<WindowDecorViewHost> provideWindowDecorViewHostSupplier(
+            @NonNull Context context,
             @ShellMainThread @NonNull CoroutineScope mainScope) {
+        final int poolSize = DesktopModeStatus.getWindowDecorScvhPoolSize(context);
+        if (DesktopModeStatus.canEnterDesktopModeOrShowAppHandle(context) && poolSize > 0) {
+            return new PooledWindowDecorViewHostSupplier(mainScope, poolSize);
+        }
         return new DefaultWindowDecorViewHostSupplier(mainScope);
     }
 
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopMixedTransitionHandler.kt b/libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopMixedTransitionHandler.kt
index 7764688..50187d5 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopMixedTransitionHandler.kt
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopMixedTransitionHandler.kt
@@ -77,6 +77,10 @@
     override fun startMinimizedModeTransition(wct: WindowContainerTransaction?): IBinder =
         freeformTaskTransitionHandler.startMinimizedModeTransition(wct)
 
+    /** Delegates starting PiP transition to [FreeformTaskTransitionHandler]. */
+    override fun startPipTransition(wct: WindowContainerTransaction?): IBinder =
+        freeformTaskTransitionHandler.startPipTransition(wct)
+
     /** Starts close transition and handles or delegates desktop task close animation. */
     override fun startRemoveTransition(wct: WindowContainerTransaction?): IBinder {
         if (
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopModeVisualIndicator.java b/libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopModeVisualIndicator.java
index 80d8ecc..cd37113 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopModeVisualIndicator.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopModeVisualIndicator.java
@@ -53,6 +53,7 @@
 import androidx.annotation.VisibleForTesting;
 
 import com.android.internal.policy.SystemBarUtils;
+import com.android.window.flags.Flags;
 import com.android.wm.shell.R;
 import com.android.wm.shell.RootTaskDisplayAreaOrganizer;
 import com.android.wm.shell.common.DisplayController;
@@ -245,9 +246,17 @@
         final SurfaceControl.Transaction t = new SurfaceControl.Transaction();
         final Resources resources = mContext.getResources();
         final DisplayMetrics metrics = resources.getDisplayMetrics();
-        final int screenWidth = metrics.widthPixels;
-        final int screenHeight = metrics.heightPixels;
-
+        final int screenWidth;
+        final int screenHeight;
+        if (Flags.enableBugFixesForSecondaryDisplay()) {
+            final DisplayLayout displayLayout =
+                    mDisplayController.getDisplayLayout(mTaskInfo.displayId);
+            screenWidth = displayLayout.width();
+            screenHeight = displayLayout.height();
+        } else {
+            screenWidth = metrics.widthPixels;
+            screenHeight = metrics.heightPixels;
+        }
         mView = new View(mContext);
         final SurfaceControl.Builder builder = new SurfaceControl.Builder();
         mRootTdaOrganizer.attachToDisplayArea(mTaskInfo.displayId, builder);
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopTasksController.kt b/libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopTasksController.kt
index e4dd9f8..578edd1 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopTasksController.kt
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopTasksController.kt
@@ -50,6 +50,7 @@
 import android.view.WindowManager.TRANSIT_CLOSE
 import android.view.WindowManager.TRANSIT_NONE
 import android.view.WindowManager.TRANSIT_OPEN
+import android.view.WindowManager.TRANSIT_PIP
 import android.view.WindowManager.TRANSIT_TO_FRONT
 import android.widget.Toast
 import android.window.DesktopModeFlags
@@ -220,6 +221,7 @@
     // Launch cookie used to identify a drag and drop transition to fullscreen after it has begun.
     // Used to prevent handleRequest from moving the new fullscreen task to freeform.
     private var dragAndDropFullscreenCookie: Binder? = null
+    private var pendingPipTransitionAndTask: Pair<IBinder, Int>? = null
 
     init {
         desktopMode = DesktopModeImpl()
@@ -564,6 +566,26 @@
     }
 
     fun minimizeTask(taskInfo: RunningTaskInfo) {
+        val wct = WindowContainerTransaction()
+
+        val isMinimizingToPip = taskInfo.pictureInPictureParams?.isAutoEnterEnabled() ?: false
+        // If task is going to PiP, start a PiP transition instead of a minimize transition
+        if (isMinimizingToPip) {
+            val requestInfo = TransitionRequestInfo(
+                TRANSIT_PIP, /* triggerTask= */ null, taskInfo, /* remoteTransition= */ null,
+                /* displayChange= */ null, /* flags= */ 0
+            )
+            val requestRes = transitions.dispatchRequest(Binder(), requestInfo, /* skip= */ null)
+            wct.merge(requestRes.second, true)
+            pendingPipTransitionAndTask =
+                freeformTaskTransitionStarter.startPipTransition(wct) to taskInfo.taskId
+            return
+        }
+
+        minimizeTaskInner(taskInfo)
+    }
+
+    private fun minimizeTaskInner(taskInfo: RunningTaskInfo) {
         val taskId = taskInfo.taskId
         val displayId = taskInfo.displayId
         val wct = WindowContainerTransaction()
@@ -1209,9 +1231,12 @@
         moveHomeTask(wct, toTop = true)
 
         // Currently, we only handle the desktop on the default display really.
-        if (displayId == DEFAULT_DISPLAY && ENABLE_DESKTOP_WINDOWING_WALLPAPER_ACTIVITY.isTrue()) {
+        if (
+            (displayId == DEFAULT_DISPLAY || Flags.enableBugFixesForSecondaryDisplay()) &&
+                ENABLE_DESKTOP_WINDOWING_WALLPAPER_ACTIVITY.isTrue()
+        ) {
             // Add translucent wallpaper activity to show the wallpaper underneath
-            addWallpaperActivity(wct)
+            addWallpaperActivity(displayId, wct)
         }
 
         val expandedTasksOrderedFrontToBack = taskRepository.getExpandedTasksOrdered(displayId)
@@ -1260,7 +1285,7 @@
             ?.let { homeTask -> wct.reorder(homeTask.getToken(), /* onTop= */ toTop) }
     }
 
-    private fun addWallpaperActivity(wct: WindowContainerTransaction) {
+    private fun addWallpaperActivity(displayId: Int, wct: WindowContainerTransaction) {
         logV("addWallpaperActivity")
         val userHandle = UserHandle.of(userId)
         val userContext = context.createContextAsUser(userHandle, /* flags= */ 0)
@@ -1271,6 +1296,9 @@
                 launchWindowingMode = WINDOWING_MODE_FULLSCREEN
                 pendingIntentBackgroundActivityStartMode =
                     ActivityOptions.MODE_BACKGROUND_ACTIVITY_START_ALLOW_ALWAYS
+                if (Flags.enableBugFixesForSecondaryDisplay()) {
+                    launchDisplayId = displayId
+                }
             }
         val pendingIntent =
             PendingIntent.getActivityAsUser(
@@ -1336,6 +1364,21 @@
         return false
     }
 
+    override fun onTransitionConsumed(
+        transition: IBinder,
+        aborted: Boolean,
+        finishT: Transaction?
+    ) {
+        pendingPipTransitionAndTask?.let { (pipTransition, taskId) ->
+            if (transition == pipTransition) {
+                if (aborted) {
+                    shellTaskOrganizer.getRunningTaskInfo(taskId)?.let { minimizeTaskInner(it) }
+                }
+                pendingPipTransitionAndTask = null
+            }
+        }
+    }
+
     override fun handleRequest(
         transition: IBinder,
         request: TransitionRequestInfo,
@@ -2055,7 +2098,11 @@
                     syncQueue,
                     taskInfo,
                     displayController,
-                    context,
+                    if (Flags.enableBugFixesForSecondaryDisplay()) {
+                        displayController.getDisplayContext(taskInfo.displayId)
+                    } else {
+                        context
+                    },
                     taskSurface,
                     rootTaskDisplayAreaOrganizer,
                     dragStartState,
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/docs/threading.md b/libs/WindowManager/Shell/src/com/android/wm/shell/docs/threading.md
index 9d01535..837a6dd3 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/docs/threading.md
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/docs/threading.md
@@ -36,7 +36,8 @@
   thread)
   - This is always another thread even if config_enableShellMainThread is not set true
   - **Note**:
-    - This thread runs with `THREAD_PRIORITY_BACKGROUND` priority
+    - This thread runs with `THREAD_PRIORITY_BACKGROUND` priority but can be requested to be boosted
+      to `THREAD_PRIORITY_FOREGROUND`
 - `ShellAnimationThread` (currently only used for Transitions and Splitscreen, but potentially all
   animations could be offloaded here)
 - `ShellSplashScreenThread` (only for use with splashscreens)
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/freeform/FreeformTaskTransitionHandler.java b/libs/WindowManager/Shell/src/com/android/wm/shell/freeform/FreeformTaskTransitionHandler.java
index 2ae9828..52b6c62 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/freeform/FreeformTaskTransitionHandler.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/freeform/FreeformTaskTransitionHandler.java
@@ -18,6 +18,7 @@
 
 import static android.app.WindowConfiguration.WINDOWING_MODE_FREEFORM;
 import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN;
+import static android.view.WindowManager.TRANSIT_PIP;
 
 import android.animation.Animator;
 import android.animation.AnimatorListenerAdapter;
@@ -99,6 +100,12 @@
         return token;
     }
 
+    @Override
+    public IBinder startPipTransition(WindowContainerTransaction wct) {
+        final IBinder token = mTransitions.startTransition(TRANSIT_PIP, wct, null);
+        mPendingTransitionTokens.add(token);
+        return token;
+    }
 
     @Override
     public IBinder startRemoveTransition(WindowContainerTransaction wct) {
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/freeform/FreeformTaskTransitionStarter.java b/libs/WindowManager/Shell/src/com/android/wm/shell/freeform/FreeformTaskTransitionStarter.java
index 5984d48..a874a5b 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/freeform/FreeformTaskTransitionStarter.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/freeform/FreeformTaskTransitionStarter.java
@@ -51,4 +51,13 @@
      * @return the started transition
      */
     IBinder startRemoveTransition(WindowContainerTransaction wct);
+
+    /**
+     * Starts PiP transition
+     *
+     * @param wct the {@link WindowContainerTransaction} that launches the PiP
+     *
+     * @return the started transition
+     */
+    IBinder startPipTransition(WindowContainerTransaction wct);
 }
\ No newline at end of file
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/pip2/phone/PipTouchHandler.java b/libs/WindowManager/Shell/src/com/android/wm/shell/pip2/phone/PipTouchHandler.java
index 44cc563..fc3fbe2 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/pip2/phone/PipTouchHandler.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/pip2/phone/PipTouchHandler.java
@@ -222,7 +222,10 @@
                 pipBoundsState, mTouchState, mPipScheduler, mPipTransitionState, pipUiEventLogger,
                 menuController, mainExecutor,
                 mPipPerfHintController);
-        mPipBoundsState.addOnAspectRatioChangedCallback(this::updateMinMaxSize);
+        mPipBoundsState.addOnAspectRatioChangedCallback(aspectRatio -> {
+            updateMinMaxSize(aspectRatio);
+            onAspectRatioChanged();
+        });
 
         mMoveOnShelVisibilityChanged = () -> {
             if (mIsImeShowing && mImeHeight > mShelfHeight) {
@@ -768,18 +771,19 @@
     private void animateToNormalSize(Runnable callback) {
         // Save the current bounds as the user-resize bounds.
         mPipResizeGestureHandler.setUserResizeBounds(mPipBoundsState.getBounds());
-
-        final Size minMenuSize = mMenuController.getEstimatedMinMenuSize();
-        final Size defaultSize = mSizeSpecSource.getDefaultSize(mPipBoundsState.getAspectRatio());
-        final Rect normalBounds = new Rect(0, 0, defaultSize.getWidth(), defaultSize.getHeight());
-        final Rect adjustedNormalBounds = mPipBoundsAlgorithm.adjustNormalBoundsToFitMenu(
-                normalBounds, minMenuSize);
-
+        final Rect adjustedNormalBounds = getAdjustedNormalBounds();
         mSavedSnapFraction = mMotionHelper.animateToExpandedState(adjustedNormalBounds,
                 getMovementBounds(mPipBoundsState.getBounds()),
                 getMovementBounds(adjustedNormalBounds), callback /* callback */);
     }
 
+    private Rect getAdjustedNormalBounds() {
+        final Size minMenuSize = mMenuController.getEstimatedMinMenuSize();
+        final Size defaultSize = mSizeSpecSource.getDefaultSize(mPipBoundsState.getAspectRatio());
+        final Rect normalBounds = new Rect(0, 0, defaultSize.getWidth(), defaultSize.getHeight());
+        return mPipBoundsAlgorithm.adjustNormalBoundsToFitMenu(normalBounds, minMenuSize);
+    }
+
     private void animateToUnexpandedState(Rect restoreBounds) {
         mMotionHelper.animateToUnexpandedState(restoreBounds, mSavedSnapFraction,
                 getMovementBounds(restoreBounds),
@@ -1065,6 +1069,10 @@
         mPipBoundsAlgorithm.getMovementBounds(mPipBoundsState.getBounds(),
                 insetBounds, mPipBoundsState.getMovementBounds(), mIsImeShowing ? mImeHeight : 0);
         mMotionHelper.onMovementBoundsChanged();
+
+        if (mPipResizeGestureHandler.getUserResizeBounds().isEmpty()) {
+            mPipResizeGestureHandler.setUserResizeBounds(getAdjustedNormalBounds());
+        }
     }
 
     private Rect getMovementBounds(Rect curBounds) {
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/pip2/phone/PipTransition.java b/libs/WindowManager/Shell/src/com/android/wm/shell/pip2/phone/PipTransition.java
index 1efe2ff..dae3c21 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/pip2/phone/PipTransition.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/pip2/phone/PipTransition.java
@@ -55,6 +55,7 @@
 import androidx.annotation.Nullable;
 
 import com.android.internal.util.Preconditions;
+import com.android.window.flags.Flags;
 import com.android.wm.shell.ShellTaskOrganizer;
 import com.android.wm.shell.common.pip.PipBoundsAlgorithm;
 import com.android.wm.shell.common.pip.PipBoundsState;
@@ -729,6 +730,10 @@
                     && getFixedRotationDelta(info, pipTaskChange) == ROTATION_90) {
                 adjustedSourceRectHint.offset(cutoutInsets.left, cutoutInsets.top);
             }
+            if (Flags.enableDesktopWindowingPip()) {
+                adjustedSourceRectHint.offset(-pipActivityChange.getStartAbsBounds().left,
+                        -pipActivityChange.getStartAbsBounds().top);
+            }
         } else {
             // For non-valid app provided src-rect-hint, calculate one to crop into during
             // app icon overlay animation.
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/recents/RecentTasksController.java b/libs/WindowManager/Shell/src/com/android/wm/shell/recents/RecentTasksController.java
index b922cd0..0869caa 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/recents/RecentTasksController.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/recents/RecentTasksController.java
@@ -550,7 +550,9 @@
                 groupedTasks.add(GroupedTaskInfo.forSplitTasks(taskInfo, pairedTaskInfo,
                         mTaskSplitBoundsMap.get(pairedTaskId)));
             } else {
-                if (Flags.enableRefactorTaskThumbnail() && isWallpaperTask(taskInfo)) {
+                if (
+                        Flags.enableUseTopVisibleActivityForExcludeFromRecentTask()
+                                && isWallpaperTask(taskInfo)) {
                     // Don't add the wallpaper task as an entry in grouped tasks
                     continue;
                 }
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/recents/RecentsTransitionHandler.java b/libs/WindowManager/Shell/src/com/android/wm/shell/recents/RecentsTransitionHandler.java
index 37d5878..032dac9 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/recents/RecentsTransitionHandler.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/recents/RecentsTransitionHandler.java
@@ -1317,6 +1317,9 @@
                 // otherwise a new transition will notify the relevant observers
                 if (returningToApp && allAppsAreTranslucent(mPausingTasks)) {
                     mHomeTransitionObserver.notifyHomeVisibilityChanged(true);
+                } else if (!toHome && mState == STATE_NEW_TASK
+                        && allAppsAreTranslucent(mOpeningTasks)) {
+                    // We are opening a translucent app. Launcher is still visible so we do nothing.
                 } else if (!toHome) {
                     // For some transitions, we may have notified home activity that it became
                     // visible. We need to notify the observer that we are no longer going home.
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecorViewModel.java b/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecorViewModel.java
index 85e3068..0f5813c 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecorViewModel.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecorViewModel.java
@@ -1634,7 +1634,9 @@
         }
         final DesktopModeWindowDecoration windowDecoration =
                 mDesktopModeWindowDecorFactory.create(
-                        mContext,
+                        Flags.enableBugFixesForSecondaryDisplay()
+                                ? mDisplayController.getDisplayContext(taskInfo.displayId)
+                                : mContext,
                         mContext.createContextAsUser(UserHandle.of(taskInfo.userId), 0 /* flags */),
                         mDisplayController,
                         mSplitScreenController,
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/common/viewhost/PooledWindowDecorViewHostSupplier.kt b/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/common/viewhost/PooledWindowDecorViewHostSupplier.kt
new file mode 100644
index 0000000..adb0ba6
--- /dev/null
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/common/viewhost/PooledWindowDecorViewHostSupplier.kt
@@ -0,0 +1,70 @@
+/*
+ * 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.wm.shell.windowdecor.common.viewhost
+
+import android.content.Context
+import android.os.Trace
+import android.util.Pools
+import android.view.Display
+import android.view.SurfaceControl
+import com.android.wm.shell.shared.annotations.ShellMainThread
+import kotlinx.coroutines.CoroutineScope
+
+/**
+ * A [WindowDecorViewHostSupplier] backed by a pool to allow recycling view hosts which may be
+ * expensive to recreate for each new or updated window decoration.
+ *
+ * Callers can obtain a [WindowDecorViewHost] using [acquire], which will return a pooled
+ * object if available, or create a new instance and return it if needed. When finished using a
+ * [WindowDecorViewHost], it must be released using [release] to allow it to be sent back
+ * into the pool and reused later on.
+ */
+class PooledWindowDecorViewHostSupplier(
+    @ShellMainThread private val mainScope: CoroutineScope,
+    maxPoolSize: Int,
+) : WindowDecorViewHostSupplier<WindowDecorViewHost> {
+
+    private val pool: Pools.Pool<WindowDecorViewHost> = Pools.SynchronizedPool(maxPoolSize)
+    private var nextDecorViewHostId = 0
+
+    override fun acquire(context: Context, display: Display): WindowDecorViewHost {
+        val pooledViewHost = pool.acquire()
+        if (pooledViewHost != null) {
+            return pooledViewHost
+        }
+        Trace.beginSection("PooledWindowDecorViewHostSupplier#acquire-newInstance")
+        val newDecorViewHost = newInstance(context, display)
+        Trace.endSection()
+        return newDecorViewHost
+    }
+
+    override fun release(viewHost: WindowDecorViewHost, t: SurfaceControl.Transaction) {
+        val pooled = pool.release(viewHost)
+        if (!pooled) {
+            viewHost.release(t)
+        }
+    }
+
+    private fun newInstance(context: Context, display: Display): ReusableWindowDecorViewHost {
+        // Use a reusable window decor view host, as it allows swapping the entire view hierarchy.
+        return ReusableWindowDecorViewHost(
+            context = context,
+            mainScope = mainScope,
+            display = display,
+            id = nextDecorViewHostId++
+        )
+    }
+}
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/common/viewhost/ReusableWindowDecorViewHost.kt b/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/common/viewhost/ReusableWindowDecorViewHost.kt
new file mode 100644
index 0000000..bf0b118
--- /dev/null
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/common/viewhost/ReusableWindowDecorViewHost.kt
@@ -0,0 +1,118 @@
+/*
+ * 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.wm.shell.windowdecor.common.viewhost
+
+import android.content.Context
+import android.content.res.Configuration
+import android.graphics.Region
+import android.view.Display
+import android.view.SurfaceControl
+import android.view.View
+import android.view.WindowManager
+import android.widget.FrameLayout
+import androidx.tracing.Trace
+import com.android.internal.annotations.VisibleForTesting
+import com.android.wm.shell.shared.annotations.ShellMainThread
+import kotlinx.coroutines.CoroutineScope
+import kotlinx.coroutines.Job
+import kotlinx.coroutines.launch
+
+/**
+ * An implementation of [WindowDecorViewHost] that supports:
+ * 1) Replacing the root [View], meaning [WindowDecorViewHost.updateView] maybe be called with
+ *    different [View] instances. This is useful when reusing [WindowDecorViewHost]s instances for
+ *    vastly different view hierarchies, such as Desktop Windowing's App Handles and App Headers.
+ */
+class ReusableWindowDecorViewHost(
+    private val context: Context,
+    @ShellMainThread private val mainScope: CoroutineScope,
+    display: Display,
+    val id: Int,
+    @VisibleForTesting
+    val viewHostAdapter: SurfaceControlViewHostAdapter =
+        SurfaceControlViewHostAdapter(context, display),
+) : WindowDecorViewHost {
+    @VisibleForTesting val rootView = FrameLayout(context)
+
+    private var currentUpdateJob: Job? = null
+
+    override val surfaceControl: SurfaceControl
+        get() = viewHostAdapter.rootSurface
+
+    override fun updateView(
+        view: View,
+        attrs: WindowManager.LayoutParams,
+        configuration: Configuration,
+        touchableRegion: Region?,
+        onDrawTransaction: SurfaceControl.Transaction?,
+    ) {
+        Trace.beginSection("ReusableWindowDecorViewHost#updateView")
+        clearCurrentUpdateJob()
+        updateViewHost(view, attrs, configuration, touchableRegion, onDrawTransaction)
+        Trace.endSection()
+    }
+
+    override fun updateViewAsync(
+        view: View,
+        attrs: WindowManager.LayoutParams,
+        configuration: Configuration,
+        touchableRegion: Region?,
+    ) {
+        Trace.beginSection("ReusableWindowDecorViewHost#updateViewAsync")
+        clearCurrentUpdateJob()
+        currentUpdateJob =
+            mainScope.launch {
+                updateViewHost(
+                    view,
+                    attrs,
+                    configuration,
+                    touchableRegion,
+                    onDrawTransaction = null,
+                )
+            }
+        Trace.endSection()
+    }
+
+    override fun release(t: SurfaceControl.Transaction) {
+        clearCurrentUpdateJob()
+        viewHostAdapter.release(t)
+    }
+
+    private fun updateViewHost(
+        view: View,
+        attrs: WindowManager.LayoutParams,
+        configuration: Configuration,
+        touchableRegion: Region?,
+        onDrawTransaction: SurfaceControl.Transaction?,
+    ) {
+        Trace.beginSection("ReusableWindowDecorViewHost#updateViewHost")
+        viewHostAdapter.prepareViewHost(configuration, touchableRegion)
+        onDrawTransaction?.let { viewHostAdapter.applyTransactionOnDraw(it) }
+        rootView.removeAllViews()
+        rootView.addView(view)
+        viewHostAdapter.updateView(rootView, attrs)
+        Trace.endSection()
+    }
+
+    private fun clearCurrentUpdateJob() {
+        currentUpdateJob?.cancel()
+        currentUpdateJob = null
+    }
+
+    companion object {
+        private const val TAG = "ReusableWindowDecorViewHost"
+    }
+}
diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/back/BackAnimationControllerTest.java b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/back/BackAnimationControllerTest.java
index f22e2a5..a2afd2c 100644
--- a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/back/BackAnimationControllerTest.java
+++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/back/BackAnimationControllerTest.java
@@ -33,6 +33,8 @@
 import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.ArgumentMatchers.anyInt;
 import static org.mockito.ArgumentMatchers.eq;
+import static org.mockito.ArgumentMatchers.isNull;
+import static org.mockito.ArgumentMatchers.notNull;
 import static org.mockito.Mockito.atLeastOnce;
 import static org.mockito.Mockito.doNothing;
 import static org.mockito.Mockito.doReturn;
@@ -634,7 +636,7 @@
         releaseBackGesture();
         mShellExecutor.flushAll();
 
-        verify(mAppCallback).setHandoffHandler(any());
+        verify(mAppCallback).setHandoffHandler(notNull());
     }
 
     @Test
@@ -654,7 +656,7 @@
         releaseBackGesture();
         mShellExecutor.flushAll();
 
-        verify(mAppCallback, never()).setHandoffHandler(any());
+        verify(mAppCallback).setHandoffHandler(isNull());
     }
 
     @Test
diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/common/HandlerExecutorTest.kt b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/common/HandlerExecutorTest.kt
new file mode 100644
index 0000000..799b48c
--- /dev/null
+++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/common/HandlerExecutorTest.kt
@@ -0,0 +1,173 @@
+/*
+ * 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.wm.shell.common
+
+import android.os.Handler
+import android.os.HandlerThread
+import android.os.Looper
+import android.testing.AndroidTestingRunner
+import androidx.test.filters.SmallTest
+import com.android.dx.mockito.inline.extended.ExtendedMockito
+import com.android.wm.shell.ShellTestCase
+import com.google.common.truth.Truth.assertThat
+import java.util.function.BiConsumer
+import org.junit.Test
+import org.junit.runner.RunWith
+import org.mockito.Mockito.mock
+import org.mockito.MockitoSession
+import org.mockito.kotlin.whenever
+
+/**
+ * Tests for HandlerExecutor.
+ *
+ * Build/Install/Run:
+ *  atest WMShellUnitTests:HandlerExecutorTest
+ */
+@SmallTest
+@RunWith(AndroidTestingRunner::class)
+class HandlerExecutorTest : ShellTestCase() {
+
+    class TestSetThreadPriorityFn : BiConsumer<Int, Int> {
+        var lastSetPriority = UNSET_THREAD_PRIORITY
+            private set
+        var callCount = 0
+            private set
+
+        override fun accept(tid: Int, priority: Int) {
+            lastSetPriority = priority
+            callCount++
+        }
+
+        fun reset() {
+            lastSetPriority = UNSET_THREAD_PRIORITY
+            callCount = 0
+        }
+    }
+
+    val testSetPriorityFn = TestSetThreadPriorityFn()
+
+    @Test
+    fun defaultExecutorDisallowBoost() {
+        val executor = createTestHandlerExecutor()
+
+        executor.setBoost()
+
+        assertThat(executor.isBoosted()).isFalse()
+    }
+
+    @Test
+    fun boostExecutor_resetWhenNotSet_expectNoOp() {
+        val executor = createTestHandlerExecutor(DEFAULT_THREAD_PRIORITY, BOOSTED_THREAD_PRIORITY)
+        val mockSession: MockitoSession = ExtendedMockito.mockitoSession()
+            .mockStatic(android.os.Process::class.java)
+            .startMocking()
+
+        try {
+            // Try to reset and ensure we never try to set the thread priority
+            executor.resetBoost()
+
+            assertThat(testSetPriorityFn.callCount).isEqualTo(0)
+            assertThat(executor.isBoosted()).isFalse()
+        } finally {
+            mockSession.finishMocking()
+        }
+    }
+
+    @Test
+    fun boostExecutor_setResetBoost_expectThreadPriorityUpdated() {
+        val executor = createTestHandlerExecutor(DEFAULT_THREAD_PRIORITY, BOOSTED_THREAD_PRIORITY)
+        val mockSession: MockitoSession = ExtendedMockito.mockitoSession()
+            .mockStatic(android.os.Process::class.java)
+            .startMocking()
+
+        try {
+            // Boost and ensure the boosted thread priority is requested
+            executor.setBoost()
+
+            assertThat(testSetPriorityFn.lastSetPriority).isEqualTo(BOOSTED_THREAD_PRIORITY)
+            assertThat(testSetPriorityFn.callCount).isEqualTo(1)
+            assertThat(executor.isBoosted()).isTrue()
+
+            // Reset and ensure the default thread priority is requested
+            executor.resetBoost()
+
+            assertThat(testSetPriorityFn.lastSetPriority).isEqualTo(DEFAULT_THREAD_PRIORITY)
+            assertThat(testSetPriorityFn.callCount).isEqualTo(2)
+            assertThat(executor.isBoosted()).isFalse()
+        } finally {
+            mockSession.finishMocking()
+        }
+    }
+
+    @Test
+    fun boostExecutor_overlappingBoost_expectResetOnlyWhenNotOverlapping() {
+        val executor = createTestHandlerExecutor(DEFAULT_THREAD_PRIORITY, BOOSTED_THREAD_PRIORITY)
+        val mockSession: MockitoSession = ExtendedMockito.mockitoSession()
+            .mockStatic(android.os.Process::class.java)
+            .startMocking()
+
+        try {
+            // Set and ensure we only update the thread priority once
+            executor.setBoost()
+            executor.setBoost()
+
+            assertThat(testSetPriorityFn.lastSetPriority).isEqualTo(BOOSTED_THREAD_PRIORITY)
+            assertThat(testSetPriorityFn.callCount).isEqualTo(1)
+            assertThat(executor.isBoosted()).isTrue()
+
+            // Reset and ensure we are still boosted and the thread priority doesn't change
+            executor.resetBoost()
+
+            assertThat(testSetPriorityFn.lastSetPriority).isEqualTo(BOOSTED_THREAD_PRIORITY)
+            assertThat(testSetPriorityFn.callCount).isEqualTo(1)
+            assertThat(executor.isBoosted()).isTrue()
+
+            // Reset again and ensure we update the thread priority accordingly
+            executor.resetBoost()
+
+            assertThat(testSetPriorityFn.lastSetPriority).isEqualTo(DEFAULT_THREAD_PRIORITY)
+            assertThat(testSetPriorityFn.callCount).isEqualTo(2)
+            assertThat(executor.isBoosted()).isFalse()
+        } finally {
+            mockSession.finishMocking()
+        }
+    }
+
+    /**
+     * Creates a test handler executor backed by a mocked handler thread.
+     */
+    private fun createTestHandlerExecutor(
+        defaultThreadPriority: Int = DEFAULT_THREAD_PRIORITY,
+        boostedThreadPriority: Int = DEFAULT_THREAD_PRIORITY
+    ) : HandlerExecutor {
+        val handler = mock(Handler::class.java)
+        val looper = mock(Looper::class.java)
+        val thread = mock(HandlerThread::class.java)
+        whenever(handler.looper).thenReturn(looper)
+        whenever(looper.thread).thenReturn(thread)
+        whenever(thread.threadId).thenReturn(1234)
+        val executor = HandlerExecutor(handler, defaultThreadPriority, boostedThreadPriority)
+        executor.replaceSetThreadPriorityFn(testSetPriorityFn)
+        return executor
+    }
+
+    companion object {
+        private const val UNSET_THREAD_PRIORITY = 0
+        private const val DEFAULT_THREAD_PRIORITY = 1
+        private const val BOOSTED_THREAD_PRIORITY = 1000
+    }
+}
\ No newline at end of file
diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/compatui/LetterboxEduWindowManagerTest.java b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/compatui/LetterboxEduWindowManagerTest.java
index 94dbd11..4c97c76 100644
--- a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/compatui/LetterboxEduWindowManagerTest.java
+++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/compatui/LetterboxEduWindowManagerTest.java
@@ -19,6 +19,7 @@
 import static android.content.res.Configuration.UI_MODE_NIGHT_YES;
 
 import static com.android.dx.mockito.inline.extended.ExtendedMockito.spyOn;
+import static com.android.window.flags.Flags.FLAG_APP_COMPAT_ASYNC_RELAYOUT;
 import static com.android.window.flags.Flags.FLAG_APP_COMPAT_UI_FRAMEWORK;
 import static com.android.wm.shell.compatui.CompatUIStatusManager.COMPAT_UI_EDUCATION_HIDDEN;
 import static com.android.wm.shell.compatui.CompatUIStatusManager.COMPAT_UI_EDUCATION_VISIBLE;
@@ -42,10 +43,12 @@
 import android.app.TaskInfo;
 import android.graphics.Insets;
 import android.graphics.Rect;
+import android.platform.test.annotations.DisableFlags;
 import android.platform.test.annotations.EnableFlags;
 import android.platform.test.annotations.RequiresFlagsDisabled;
 import android.platform.test.flag.junit.CheckFlagsRule;
 import android.platform.test.flag.junit.DeviceFlagsValueProvider;
+import android.platform.test.flag.junit.SetFlagsRule;
 import android.testing.AndroidTestingRunner;
 import android.util.Pair;
 import android.view.DisplayCutout;
@@ -125,6 +128,9 @@
     @Mock private Consumer<Pair<TaskInfo, ShellTaskOrganizer.TaskListener>> mOnDismissCallback;
     @Mock private DockStateReader mDockStateReader;
 
+    @Rule
+    public final SetFlagsRule mSetFlagsRule = new SetFlagsRule();
+
     private CompatUIConfiguration mCompatUIConfiguration;
     private TestShellExecutor mExecutor;
     private FakeCompatUIStatusManagerTest mCompatUIStatus;
@@ -317,6 +323,7 @@
 
     @Test
     @RequiresFlagsDisabled(FLAG_APP_COMPAT_UI_FRAMEWORK)
+    @DisableFlags(FLAG_APP_COMPAT_ASYNC_RELAYOUT)
     public void testUpdateCompatInfo_updatesLayoutCorrectly() {
         LetterboxEduWindowManager windowManager = createWindowManager(/* eligible= */ true);
 
@@ -346,6 +353,36 @@
 
     @Test
     @RequiresFlagsDisabled(FLAG_APP_COMPAT_UI_FRAMEWORK)
+    @EnableFlags(FLAG_APP_COMPAT_ASYNC_RELAYOUT)
+    public void testUpdateCompatInfo_updatesLayoutCorrectlyAsync() {
+        LetterboxEduWindowManager windowManager = createWindowManager(/* eligible= */ true);
+
+        assertTrue(windowManager.createLayout(/* canShow= */ true));
+        LetterboxEduDialogLayout layout = windowManager.mLayout;
+        assertNotNull(layout);
+
+        assertTrue(windowManager.updateCompatInfo(
+                createTaskInfo(/* eligible= */ true, USER_ID_1, new Rect(50, 25, 150, 75)),
+                mTaskListener, /* canShow= */ true));
+
+        verifyLayout(layout, layout.getLayoutParams(), /* expectedWidth= */ 100,
+                /* expectedHeight= */ 50, /* expectedExtraTopMargin= */ 0,
+                /* expectedExtraBottomMargin= */ 0);
+        verify(mViewHost).relayout(mWindowAttrsCaptor.capture(), any());
+        assertThat(mWindowAttrsCaptor.getValue()).isEqualTo(layout.getLayoutParams());
+
+        // Window manager should be released (without animation) when eligible becomes false.
+        assertFalse(windowManager.updateCompatInfo(createTaskInfo(/* eligible= */ false),
+                mTaskListener, /* canShow= */ true));
+
+        verify(windowManager).release();
+        verify(mOnDismissCallback, never()).accept(any());
+        verify(mAnimationController, never()).startExitAnimation(any(), any());
+        assertNull(windowManager.mLayout);
+    }
+
+    @Test
+    @RequiresFlagsDisabled(FLAG_APP_COMPAT_UI_FRAMEWORK)
     public void testUpdateCompatInfo_notEligibleUntilUpdate_createsLayoutAfterUpdate() {
         LetterboxEduWindowManager windowManager = createWindowManager(/* eligible= */ false);
 
@@ -375,6 +412,7 @@
 
     @Test
     @RequiresFlagsDisabled(FLAG_APP_COMPAT_UI_FRAMEWORK)
+    @DisableFlags(FLAG_APP_COMPAT_ASYNC_RELAYOUT)
     public void testUpdateDisplayLayout_updatesLayoutCorrectly() {
         LetterboxEduWindowManager windowManager = createWindowManager(/* eligible= */ true);
 
@@ -397,6 +435,29 @@
 
     @Test
     @RequiresFlagsDisabled(FLAG_APP_COMPAT_UI_FRAMEWORK)
+    @EnableFlags(FLAG_APP_COMPAT_ASYNC_RELAYOUT)
+    public void testUpdateDisplayLayout_updatesLayoutCorrectlyAsync() {
+        LetterboxEduWindowManager windowManager = createWindowManager(/* eligible= */ true);
+
+        assertTrue(windowManager.createLayout(/* canShow= */ true));
+        LetterboxEduDialogLayout layout = windowManager.mLayout;
+        assertNotNull(layout);
+
+        int newDisplayCutoutTop = DISPLAY_CUTOUT_TOP + 7;
+        int newDisplayCutoutBottom = DISPLAY_CUTOUT_BOTTOM + 9;
+        windowManager.updateDisplayLayout(createDisplayLayout(
+                Insets.of(DISPLAY_CUTOUT_HORIZONTAL, newDisplayCutoutTop,
+                        DISPLAY_CUTOUT_HORIZONTAL, newDisplayCutoutBottom)));
+
+        verifyLayout(layout, layout.getLayoutParams(), /* expectedWidth= */ TASK_WIDTH,
+                /* expectedHeight= */ TASK_HEIGHT, /* expectedExtraTopMargin= */
+                newDisplayCutoutTop, /* expectedExtraBottomMargin= */ newDisplayCutoutBottom);
+        verify(mViewHost).relayout(mWindowAttrsCaptor.capture(), any());
+        assertThat(mWindowAttrsCaptor.getValue()).isEqualTo(layout.getLayoutParams());
+    }
+
+    @Test
+    @RequiresFlagsDisabled(FLAG_APP_COMPAT_UI_FRAMEWORK)
     public void testRelease_animationIsCancelled() {
         LetterboxEduWindowManager windowManager = createWindowManager(/* eligible= */ true);
 
diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/desktopmode/DesktopTasksControllerTest.kt b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/desktopmode/DesktopTasksControllerTest.kt
index 3bee588..6a4ad2e 100644
--- a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/desktopmode/DesktopTasksControllerTest.kt
+++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/desktopmode/DesktopTasksControllerTest.kt
@@ -21,6 +21,7 @@
 import android.app.ActivityOptions
 import android.app.KeyguardManager
 import android.app.PendingIntent
+import android.app.PictureInPictureParams
 import android.app.WindowConfiguration.ACTIVITY_TYPE_HOME
 import android.app.WindowConfiguration.ACTIVITY_TYPE_STANDARD
 import android.app.WindowConfiguration.WINDOWING_MODE_FREEFORM
@@ -1724,6 +1725,34 @@
   }
 
   @Test
+  fun onDesktopWindowMinimize_pipTask_autoEnterEnabled_startPipTransition() {
+    val task = setUpPipTask(autoEnterEnabled = true)
+    val handler = mock(TransitionHandler::class.java)
+    whenever(freeformTaskTransitionStarter.startPipTransition(any()))
+      .thenReturn(Binder())
+    whenever(transitions.dispatchRequest(any(), any(), anyOrNull()))
+      .thenReturn(android.util.Pair(handler, WindowContainerTransaction())
+    )
+
+    controller.minimizeTask(task)
+
+    verify(freeformTaskTransitionStarter).startPipTransition(any())
+    verify(freeformTaskTransitionStarter, never()).startMinimizedModeTransition(any())
+  }
+
+  @Test
+  fun onDesktopWindowMinimize_pipTask_autoEnterDisabled_startMinimizeTransition() {
+    val task = setUpPipTask(autoEnterEnabled = false)
+    whenever(freeformTaskTransitionStarter.startMinimizedModeTransition(any()))
+      .thenReturn(Binder())
+
+    controller.minimizeTask(task)
+
+    verify(freeformTaskTransitionStarter).startMinimizedModeTransition(any())
+    verify(freeformTaskTransitionStarter, never()).startPipTransition(any())
+  }
+
+  @Test
   fun onDesktopWindowMinimize_singleActiveTask_noWallpaperActivityToken_doesntRemoveWallpaper() {
     val task = setUpFreeformTask(active = true)
     val transition = Binder()
@@ -4228,6 +4257,14 @@
     return task
   }
 
+  private fun setUpPipTask(autoEnterEnabled: Boolean): RunningTaskInfo {
+    return setUpFreeformTask().apply {
+      pictureInPictureParams = PictureInPictureParams.Builder()
+        .setAutoEnterEnabled(autoEnterEnabled)
+        .build()
+    }
+  }
+
   private fun setUpHomeTask(displayId: Int = DEFAULT_DISPLAY): RunningTaskInfo {
     val task = createHomeTask(displayId)
     whenever(shellTaskOrganizer.getRunningTaskInfo(task.taskId)).thenReturn(task)
diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/recents/RecentTasksControllerTest.java b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/recents/RecentTasksControllerTest.java
index c6835b7..22b45e8 100644
--- a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/recents/RecentTasksControllerTest.java
+++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/recents/RecentTasksControllerTest.java
@@ -22,7 +22,7 @@
 import static android.app.WindowConfiguration.WINDOWING_MODE_MULTI_WINDOW;
 
 import static com.android.dx.mockito.inline.extended.ExtendedMockito.mockitoSession;
-import static com.android.launcher3.Flags.FLAG_ENABLE_REFACTOR_TASK_THUMBNAIL;
+import static com.android.launcher3.Flags.FLAG_ENABLE_USE_TOP_VISIBLE_ACTIVITY_FOR_EXCLUDE_FROM_RECENT_TASK;
 import static com.android.window.flags.Flags.FLAG_ENABLE_DESKTOP_WINDOWING_PERSISTENCE;
 import static com.android.wm.shell.shared.split.SplitScreenConstants.SNAP_TO_2_50_50;
 
@@ -250,7 +250,7 @@
                 t3.taskId, -1);
     }
 
-    @EnableFlags(FLAG_ENABLE_REFACTOR_TASK_THUMBNAIL)
+    @EnableFlags(FLAG_ENABLE_USE_TOP_VISIBLE_ACTIVITY_FOR_EXCLUDE_FROM_RECENT_TASK)
     @Test
     public void testGetRecentTasks_removesDesktopWallpaperActivity() {
         RecentTaskInfo t1 = makeTaskInfo(1);
diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/windowdecor/common/viewhost/PooledWindowDecorViewHostSupplierTest.kt b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/windowdecor/common/viewhost/PooledWindowDecorViewHostSupplierTest.kt
new file mode 100644
index 0000000..40583f8
--- /dev/null
+++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/windowdecor/common/viewhost/PooledWindowDecorViewHostSupplierTest.kt
@@ -0,0 +1,129 @@
+/*
+ * 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.wm.shell.windowdecor.common.viewhost
+
+import android.content.res.Configuration
+import android.graphics.Region
+import android.testing.AndroidTestingRunner
+import android.view.SurfaceControl
+import android.view.View
+import android.view.WindowManager
+import androidx.test.filters.SmallTest
+import com.android.wm.shell.ShellTestCase
+import com.android.wm.shell.util.StubTransaction
+import com.google.common.truth.Truth.assertThat
+import kotlinx.coroutines.CoroutineScope
+import kotlinx.coroutines.test.runTest
+import org.junit.Test
+import org.junit.runner.RunWith
+import org.mockito.MockitoAnnotations
+import org.mockito.kotlin.mock
+
+/**
+ * Tests for [PooledWindowDecorViewHostSupplier].
+ *
+ * Build/Install/Run: atest WMShellUnitTests:PooledWindowDecorViewHostSupplierTest
+ */
+@SmallTest
+@RunWith(AndroidTestingRunner::class)
+class PooledWindowDecorViewHostSupplierTest : ShellTestCase() {
+
+    private lateinit var supplier: PooledWindowDecorViewHostSupplier
+
+    @Test
+    fun setUp() {
+        MockitoAnnotations.initMocks(this)
+    }
+
+    @Test
+    fun acquire_poolBelowLimit_caches() = runTest {
+        supplier = createSupplier(maxPoolSize = 5)
+
+        val viewHost = FakeWindowDecorViewHost()
+        supplier.release(viewHost, StubTransaction())
+
+        assertThat(supplier.acquire(context, context.display)).isEqualTo(viewHost)
+    }
+
+    @Test
+    fun release_poolBelowLimit_doesNotReleaseViewHost() = runTest {
+        supplier = createSupplier(maxPoolSize = 5)
+
+        val viewHost = FakeWindowDecorViewHost()
+        val mockT = mock<SurfaceControl.Transaction>()
+        supplier.release(viewHost, mockT)
+
+        assertThat(viewHost.released).isFalse()
+    }
+
+    @Test
+    fun release_poolAtLimit_doesNotCache() = runTest {
+        supplier = createSupplier(maxPoolSize = 1)
+        val viewHost = FakeWindowDecorViewHost()
+        supplier.release(viewHost, StubTransaction()) // Maxes pool.
+
+        val viewHost2 = FakeWindowDecorViewHost()
+        supplier.release(viewHost2, StubTransaction()) // Beyond limit.
+
+        assertThat(supplier.acquire(context, context.display)).isEqualTo(viewHost)
+        // Second one wasn't cached, so the acquired one should've been a new instance.
+        assertThat(supplier.acquire(context, context.display)).isNotEqualTo(viewHost2)
+    }
+
+    @Test
+    fun release_poolAtLimit_releasesViewHost() = runTest {
+        supplier = createSupplier(maxPoolSize = 1)
+        val viewHost = FakeWindowDecorViewHost()
+        supplier.release(viewHost, StubTransaction()) // Maxes pool.
+
+        val viewHost2 = FakeWindowDecorViewHost()
+        val mockT = mock<SurfaceControl.Transaction>()
+        supplier.release(viewHost2, mockT) // Beyond limit.
+
+        // Second one doesn't fit, so it needs to be released.
+        assertThat(viewHost2.released).isTrue()
+    }
+
+    private fun CoroutineScope.createSupplier(maxPoolSize: Int) =
+        PooledWindowDecorViewHostSupplier(this, maxPoolSize)
+
+    private class FakeWindowDecorViewHost : WindowDecorViewHost {
+        var released = false
+            private set
+
+        override val surfaceControl: SurfaceControl
+            get() = SurfaceControl()
+
+        override fun updateView(
+            view: View,
+            attrs: WindowManager.LayoutParams,
+            configuration: Configuration,
+            touchableRegion: Region?,
+            onDrawTransaction: SurfaceControl.Transaction?,
+        ) {}
+
+        override fun updateViewAsync(
+            view: View,
+            attrs: WindowManager.LayoutParams,
+            configuration: Configuration,
+            touchableRegion: Region?,
+        ) {}
+
+        override fun release(t: SurfaceControl.Transaction) {
+            released = true
+        }
+    }
+}
diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/windowdecor/common/viewhost/ReusableWindowDecorViewHostTest.kt b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/windowdecor/common/viewhost/ReusableWindowDecorViewHostTest.kt
new file mode 100644
index 0000000..245393a
--- /dev/null
+++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/windowdecor/common/viewhost/ReusableWindowDecorViewHostTest.kt
@@ -0,0 +1,170 @@
+/*
+ * 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.wm.shell.windowdecor.common.viewhost
+
+import android.testing.AndroidTestingRunner
+import android.testing.TestableLooper
+import android.view.SurfaceControl
+import android.view.View
+import android.view.WindowManager
+import androidx.test.filters.SmallTest
+import com.android.wm.shell.ShellTestCase
+import com.google.common.truth.Truth.assertThat
+import kotlinx.coroutines.CoroutineScope
+import kotlinx.coroutines.ExperimentalCoroutinesApi
+import kotlinx.coroutines.test.advanceUntilIdle
+import kotlinx.coroutines.test.runTest
+import org.junit.Test
+import org.junit.runner.RunWith
+import org.mockito.Mockito.mock
+import org.mockito.kotlin.spy
+import org.mockito.kotlin.verify
+
+/**
+ * Tests for [ReusableWindowDecorViewHost].
+ *
+ * Build/Install/Run: atest WMShellUnitTests:ReusableWindowDecorViewHostTest
+ */
+@SmallTest
+@TestableLooper.RunWithLooper
+@RunWith(AndroidTestingRunner::class)
+class ReusableWindowDecorViewHostTest : ShellTestCase() {
+
+    @Test
+    fun update_differentView_replacesView() = runTest {
+        val view = View(context)
+        val lp = WindowManager.LayoutParams()
+        val reusableVH = createReusableViewHost()
+        reusableVH.updateView(view, lp, context.resources.configuration, null)
+
+        assertThat(reusableVH.rootView.childCount).isEqualTo(1)
+        assertThat(reusableVH.rootView.getChildAt(0)).isEqualTo(view)
+
+        val newView = View(context)
+        val newLp = WindowManager.LayoutParams()
+        reusableVH.updateView(newView, newLp, context.resources.configuration, null)
+
+        assertThat(reusableVH.rootView.childCount).isEqualTo(1)
+        assertThat(reusableVH.rootView.getChildAt(0)).isEqualTo(newView)
+    }
+
+    @OptIn(ExperimentalCoroutinesApi::class)
+    @Test
+    fun updateView_clearsPendingAsyncJob() = runTest {
+        val reusableVH = createReusableViewHost()
+        val asyncView = View(context)
+        val syncView = View(context)
+        val asyncAttrs = WindowManager.LayoutParams(100, 100)
+        val syncAttrs = WindowManager.LayoutParams(200, 200)
+
+        reusableVH.updateViewAsync(
+            view = asyncView,
+            attrs = asyncAttrs,
+            configuration = context.resources.configuration,
+        )
+
+        // No view host yet, since the coroutine hasn't run.
+        assertThat(reusableVH.viewHostAdapter.isInitialized()).isFalse()
+
+        reusableVH.updateView(
+            view = syncView,
+            attrs = syncAttrs,
+            configuration = context.resources.configuration,
+            onDrawTransaction = null,
+        )
+
+        // Would run coroutine if it hadn't been cancelled.
+        advanceUntilIdle()
+
+        assertThat(reusableVH.viewHostAdapter.isInitialized()).isTrue()
+        // View host view/attrs should match the ones from the sync call.
+        assertThat(reusableVH.rootView.getChildAt(0)).isEqualTo(syncView)
+        assertThat(reusableVH.view()!!.layoutParams.width).isEqualTo(syncAttrs.width)
+    }
+
+    @OptIn(ExperimentalCoroutinesApi::class)
+    @Test
+    fun updateViewAsync() = runTest {
+        val reusableVH = createReusableViewHost()
+        val view = View(context)
+        val attrs = WindowManager.LayoutParams(100, 100)
+
+        reusableVH.updateViewAsync(
+            view = view,
+            attrs = attrs,
+            configuration = context.resources.configuration,
+        )
+
+        assertThat(reusableVH.viewHostAdapter.isInitialized()).isFalse()
+
+        advanceUntilIdle()
+
+        assertThat(reusableVH.viewHostAdapter.isInitialized()).isTrue()
+    }
+
+    @OptIn(ExperimentalCoroutinesApi::class)
+    @Test
+    fun updateViewAsync_clearsPendingAsyncJob() = runTest {
+        val reusableVH = createReusableViewHost()
+
+        val view = View(context)
+        reusableVH.updateViewAsync(
+            view = view,
+            attrs = WindowManager.LayoutParams(100, 100),
+            configuration = context.resources.configuration,
+        )
+        val otherView = View(context)
+        reusableVH.updateViewAsync(
+            view = otherView,
+            attrs = WindowManager.LayoutParams(100, 100),
+            configuration = context.resources.configuration,
+        )
+
+        advanceUntilIdle()
+
+        assertThat(reusableVH.viewHostAdapter.isInitialized()).isTrue()
+        assertThat(reusableVH.rootView.getChildAt(0)).isEqualTo(otherView)
+    }
+
+    @Test
+    fun release() = runTest {
+        val reusableVH = createReusableViewHost()
+
+        val view = View(context)
+        reusableVH.updateView(
+            view = view,
+            attrs = WindowManager.LayoutParams(100, 100),
+            configuration = context.resources.configuration,
+            onDrawTransaction = null,
+        )
+
+        val t = mock(SurfaceControl.Transaction::class.java)
+        reusableVH.release(t)
+
+        verify(reusableVH.viewHostAdapter).release(t)
+    }
+
+    private fun CoroutineScope.createReusableViewHost() =
+        ReusableWindowDecorViewHost(
+            context = context,
+            mainScope = this,
+            display = context.display,
+            id = 1,
+            viewHostAdapter = spy(SurfaceControlViewHostAdapter(context, context.display)),
+        )
+
+    private fun ReusableWindowDecorViewHost.view(): View? = viewHostAdapter.viewHost?.view
+}
diff --git a/media/java/android/media/AudioDeviceInfo.java b/media/java/android/media/AudioDeviceInfo.java
index b41f40f..5689df0 100644
--- a/media/java/android/media/AudioDeviceInfo.java
+++ b/media/java/android/media/AudioDeviceInfo.java
@@ -548,8 +548,45 @@
         return counts;
     }
 
+    /** @hide */
+    @IntDef(flag = true, prefix = "AudioFormat.CHANNEL_OUT_", value = {
+            AudioFormat.CHANNEL_INVALID,
+            AudioFormat.CHANNEL_OUT_DEFAULT,
+            AudioFormat.CHANNEL_OUT_FRONT_LEFT,
+            AudioFormat.CHANNEL_OUT_FRONT_RIGHT,
+            AudioFormat.CHANNEL_OUT_FRONT_CENTER,
+            AudioFormat.CHANNEL_OUT_LOW_FREQUENCY,
+            AudioFormat.CHANNEL_OUT_BACK_LEFT,
+            AudioFormat.CHANNEL_OUT_BACK_RIGHT,
+            AudioFormat.CHANNEL_OUT_FRONT_LEFT_OF_CENTER,
+            AudioFormat.CHANNEL_OUT_FRONT_RIGHT_OF_CENTER,
+            AudioFormat.CHANNEL_OUT_BACK_CENTER,
+            AudioFormat.CHANNEL_OUT_SIDE_LEFT,
+            AudioFormat.CHANNEL_OUT_SIDE_RIGHT,
+            AudioFormat.CHANNEL_OUT_TOP_CENTER,
+            AudioFormat.CHANNEL_OUT_TOP_FRONT_LEFT,
+            AudioFormat.CHANNEL_OUT_TOP_FRONT_CENTER,
+            AudioFormat.CHANNEL_OUT_TOP_FRONT_RIGHT,
+            AudioFormat.CHANNEL_OUT_TOP_BACK_LEFT,
+            AudioFormat.CHANNEL_OUT_TOP_BACK_CENTER,
+            AudioFormat.CHANNEL_OUT_TOP_BACK_RIGHT,
+            AudioFormat.CHANNEL_OUT_TOP_SIDE_LEFT,
+            AudioFormat.CHANNEL_OUT_TOP_SIDE_RIGHT,
+            AudioFormat.CHANNEL_OUT_BOTTOM_FRONT_LEFT,
+            AudioFormat.CHANNEL_OUT_BOTTOM_FRONT_CENTER,
+            AudioFormat.CHANNEL_OUT_BOTTOM_FRONT_RIGHT,
+            AudioFormat.CHANNEL_OUT_LOW_FREQUENCY_2,
+            AudioFormat.CHANNEL_OUT_FRONT_WIDE_LEFT,
+            AudioFormat.CHANNEL_OUT_FRONT_WIDE_RIGHT}
+    )
+    @Retention(RetentionPolicy.SOURCE)
+    @FlaggedApi(FLAG_SPEAKER_LAYOUT_API)
+    public @interface SpeakerLayoutChannelMask {}
+
     /**
-     * @return A ChannelMask representing the physical output speaker layout of the device.
+     * @return A ChannelMask representing the speaker layout of a TYPE_BUILTIN_SPEAKER device.
+     *
+     * Valid only for speakers built-in to the device.
      *
      * The layout channel mask only indicates which speaker channels are present, the
      * physical layout of the speakers should be informed by a standard for multi-channel
@@ -557,6 +594,7 @@
      * @see AudioFormat
      */
     @FlaggedApi(FLAG_SPEAKER_LAYOUT_API)
+    @SpeakerLayoutChannelMask
     public int getSpeakerLayoutChannelMask() {
         return mPort.speakerLayoutChannelMask();
     }
diff --git a/core/java/android/app/ondeviceintelligence/Feature.aidl b/media/java/android/media/quality/ActiveProcessingPicture.aidl
similarity index 80%
rename from core/java/android/app/ondeviceintelligence/Feature.aidl
rename to media/java/android/media/quality/ActiveProcessingPicture.aidl
index 18494d7..2851306 100644
--- a/core/java/android/app/ondeviceintelligence/Feature.aidl
+++ b/media/java/android/media/quality/ActiveProcessingPicture.aidl
@@ -5,7 +5,7 @@
  * 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
+ *      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,
@@ -14,9 +14,6 @@
  * limitations under the License.
  */
 
-package android.app.ondeviceintelligence;
+package android.media.quality;
 
-/**
-  * @hide
-  */
-parcelable Feature;
+parcelable ActiveProcessingPicture;
\ No newline at end of file
diff --git a/media/java/android/media/quality/ActiveProcessingPicture.java b/media/java/android/media/quality/ActiveProcessingPicture.java
new file mode 100644
index 0000000..e16ad62
--- /dev/null
+++ b/media/java/android/media/quality/ActiveProcessingPicture.java
@@ -0,0 +1,86 @@
+/*
+ * 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 android.media.quality;
+
+import android.annotation.FlaggedApi;
+import android.media.tv.flags.Flags;
+import android.os.Parcel;
+import android.os.Parcelable;
+
+import androidx.annotation.NonNull;
+
+/**
+ * Active picture represents an image or video undergoing picture processing which uses a picture
+ * profile. The picture profile is used to configure the picture processing parameters.
+ */
+@FlaggedApi(Flags.FLAG_MEDIA_QUALITY_FW)
+public final class ActiveProcessingPicture implements Parcelable {
+    private final int mId;
+    private final String mProfileId;
+
+    public ActiveProcessingPicture(int id, @NonNull String profileId) {
+        mId = id;
+        mProfileId = profileId;
+    }
+
+    /** @hide */
+    ActiveProcessingPicture(Parcel in) {
+        mId = in.readInt();
+        mProfileId = in.readString();
+    }
+
+    @NonNull
+    public static final Creator<ActiveProcessingPicture> CREATOR = new Creator<>() {
+        @Override
+        public ActiveProcessingPicture createFromParcel(Parcel in) {
+            return new ActiveProcessingPicture(in);
+        }
+
+        @Override
+        public ActiveProcessingPicture[] newArray(int size) {
+            return new ActiveProcessingPicture[size];
+        }
+    };
+
+    /**
+     * An ID that uniquely identifies the active content.
+     *
+     * <p>The ID is assigned by the system to distinguish different active contents.
+     */
+    public int getId() {
+        return mId;
+    }
+
+    /**
+     * The ID of the picture profile used to configure the content.
+     */
+    @NonNull
+    public String getProfileId() {
+        return mProfileId;
+    }
+
+    @Override
+    public int describeContents() {
+        return 0;
+    }
+
+    @Override
+    public void writeToParcel(@NonNull Parcel dest, int flags) {
+        dest.writeInt(mId);
+        dest.writeString(mProfileId);
+    }
+}
diff --git a/media/java/android/media/quality/IMediaQualityManager.aidl b/media/java/android/media/quality/IMediaQualityManager.aidl
index 9daebca..253c2d8 100644
--- a/media/java/android/media/quality/IMediaQualityManager.aidl
+++ b/media/java/android/media/quality/IMediaQualityManager.aidl
@@ -25,51 +25,56 @@
 import android.media.quality.PictureProfile;
 import android.media.quality.SoundProfileHandle;
 import android.media.quality.SoundProfile;
+import android.os.UserHandle;
 
 /**
  * Interface for Media Quality Manager
  * @hide
  */
 interface IMediaQualityManager {
-    PictureProfile createPictureProfile(in PictureProfile pp, int userId);
-    void updatePictureProfile(in String id, in PictureProfile pp, int userId);
-    void removePictureProfile(in String id, int userId);
-    PictureProfile getPictureProfile(in int type, in String name, int userId);
-    List<PictureProfile> getPictureProfilesByPackage(in String packageName, int userId);
-    List<PictureProfile> getAvailablePictureProfiles(int userId);
-    boolean setDefaultPictureProfile(in String id, int userId);
-    List<String> getPictureProfilePackageNames(int userId);
-    List<String> getPictureProfileAllowList(int userId);
-    void setPictureProfileAllowList(in List<String> packages, int userId);
-    List<PictureProfileHandle> getPictureProfileHandle(in String[] id, int userId);
+    PictureProfile createPictureProfile(in PictureProfile pp, in UserHandle user);
+    void updatePictureProfile(in String id, in PictureProfile pp, in UserHandle user);
+    void removePictureProfile(in String id, in UserHandle user);
+    boolean setDefaultPictureProfile(in String id, in UserHandle user);
+    PictureProfile getPictureProfile(
+            in int type, in String name, in boolean includeParams, in UserHandle user);
+    List<PictureProfile> getPictureProfilesByPackage(
+            in String packageName, in boolean includeParams, in UserHandle user);
+    List<PictureProfile> getAvailablePictureProfiles(in boolean includeParams, in UserHandle user);
+    List<String> getPictureProfilePackageNames(in UserHandle user);
+    List<String> getPictureProfileAllowList(in UserHandle user);
+    void setPictureProfileAllowList(in List<String> packages, in UserHandle user);
+    List<PictureProfileHandle> getPictureProfileHandle(in String[] id, in UserHandle user);
 
-    SoundProfile createSoundProfile(in SoundProfile pp, int userId);
-    void updateSoundProfile(in String id, in SoundProfile pp, int userId);
-    void removeSoundProfile(in String id, int userId);
-    SoundProfile getSoundProfile(in int type, in String name, int userId);
-    List<SoundProfile> getSoundProfilesByPackage(in String packageName, int userId);
-    List<SoundProfile> getAvailableSoundProfiles(int userId);
-    boolean setDefaultSoundProfile(in String id, int userId);
-    List<String> getSoundProfilePackageNames(int userId);
-    List<String> getSoundProfileAllowList(int userId);
-    void setSoundProfileAllowList(in List<String> packages, int userId);
-    List<SoundProfileHandle> getSoundProfileHandle(in String[] id, int userId);
+    SoundProfile createSoundProfile(in SoundProfile pp, in UserHandle user);
+    void updateSoundProfile(in String id, in SoundProfile pp, in UserHandle user);
+    void removeSoundProfile(in String id, in UserHandle user);
+    boolean setDefaultSoundProfile(in String id, in UserHandle user);
+    SoundProfile getSoundProfile(
+            in int type, in String name, in boolean includeParams, in UserHandle user);
+    List<SoundProfile> getSoundProfilesByPackage(
+            in String packageName, in boolean includeParams, in UserHandle user);
+    List<SoundProfile> getAvailableSoundProfiles(in boolean includeParams, in UserHandle user);
+    List<String> getSoundProfilePackageNames(in UserHandle user);
+    List<String> getSoundProfileAllowList(in UserHandle user);
+    void setSoundProfileAllowList(in List<String> packages, in UserHandle user);
+    List<SoundProfileHandle> getSoundProfileHandle(in String[] id, in UserHandle user);
 
     void registerPictureProfileCallback(in IPictureProfileCallback cb);
     void registerSoundProfileCallback(in ISoundProfileCallback cb);
     void registerAmbientBacklightCallback(in IAmbientBacklightCallback cb);
 
-    List<ParamCapability> getParamCapabilities(in List<String> names, int userId);
+    List<ParamCapability> getParamCapabilities(in List<String> names, in UserHandle user);
 
-    boolean isSupported(int userId);
-    void setAutoPictureQualityEnabled(in boolean enabled, int userId);
-    boolean isAutoPictureQualityEnabled(int userId);
-    void setSuperResolutionEnabled(in boolean enabled, int userId);
-    boolean isSuperResolutionEnabled(int userId);
-    void setAutoSoundQualityEnabled(in boolean enabled, int userId);
-    boolean isAutoSoundQualityEnabled(int userId);
+    boolean isSupported(in UserHandle user);
+    void setAutoPictureQualityEnabled(in boolean enabled, in UserHandle user);
+    boolean isAutoPictureQualityEnabled(in UserHandle user);
+    void setSuperResolutionEnabled(in boolean enabled, in UserHandle user);
+    boolean isSuperResolutionEnabled(in UserHandle user);
+    void setAutoSoundQualityEnabled(in boolean enabled, in UserHandle user);
+    boolean isAutoSoundQualityEnabled(in UserHandle user);
 
-    void setAmbientBacklightSettings(in AmbientBacklightSettings settings, int userId);
-    void setAmbientBacklightEnabled(in boolean enabled, int userId);
-    boolean isAmbientBacklightEnabled(int userId);
+    void setAmbientBacklightSettings(in AmbientBacklightSettings settings, in UserHandle user);
+    void setAmbientBacklightEnabled(in boolean enabled, in UserHandle user);
+    boolean isAmbientBacklightEnabled(in UserHandle user);
 }
diff --git a/media/java/android/media/quality/IPictureProfileCallback.aidl b/media/java/android/media/quality/IPictureProfileCallback.aidl
index 34aa2b0..7071a16 100644
--- a/media/java/android/media/quality/IPictureProfileCallback.aidl
+++ b/media/java/android/media/quality/IPictureProfileCallback.aidl
@@ -29,5 +29,5 @@
     void onPictureProfileUpdated(in String id, in PictureProfile p);
     void onPictureProfileRemoved(in String id, in PictureProfile p);
     void onParamCapabilitiesChanged(in String id, in List<ParamCapability> caps);
-    void onError(in int err);
+    void onError(in String id, in int err);
 }
diff --git a/media/java/android/media/quality/ISoundProfileCallback.aidl b/media/java/android/media/quality/ISoundProfileCallback.aidl
index 9043757..30bb106 100644
--- a/media/java/android/media/quality/ISoundProfileCallback.aidl
+++ b/media/java/android/media/quality/ISoundProfileCallback.aidl
@@ -29,5 +29,5 @@
     void onSoundProfileUpdated(in String id, in SoundProfile p);
     void onSoundProfileRemoved(in String id, in SoundProfile p);
     void onParamCapabilitiesChanged(in String id, in List<ParamCapability> caps);
-    void onError(in int err);
+    void onError(in String id, in int err);
 }
diff --git a/media/java/android/media/quality/MediaQualityManager.java b/media/java/android/media/quality/MediaQualityManager.java
index efbe47b..7e87462 100644
--- a/media/java/android/media/quality/MediaQualityManager.java
+++ b/media/java/android/media/quality/MediaQualityManager.java
@@ -20,11 +20,13 @@
 import android.annotation.FlaggedApi;
 import android.annotation.NonNull;
 import android.annotation.Nullable;
+import android.annotation.SuppressLint;
 import android.annotation.SystemApi;
 import android.annotation.SystemService;
 import android.content.Context;
 import android.media.tv.flags.Flags;
 import android.os.RemoteException;
+import android.os.UserHandle;
 
 import androidx.annotation.RequiresPermission;
 
@@ -47,7 +49,7 @@
 
     private final IMediaQualityManager mService;
     private final Context mContext;
-    private final int mUserId;
+    private final UserHandle mUserHandle;
     private final Object mLock = new Object();
     // @GuardedBy("mLock")
     private final List<PictureProfileCallbackRecord> mPpCallbackRecords = new ArrayList<>();
@@ -55,6 +57,9 @@
     private final List<SoundProfileCallbackRecord> mSpCallbackRecords = new ArrayList<>();
     // @GuardedBy("mLock")
     private final List<AmbientBacklightCallbackRecord> mAbCallbackRecords = new ArrayList<>();
+    // @GuardedBy("mLock")
+    private final List<ActiveProcessingPictureListenerRecord> mApListenerRecords =
+            new ArrayList<>();
 
 
     /**
@@ -62,7 +67,7 @@
      */
     public MediaQualityManager(Context context, IMediaQualityManager service) {
         mContext = context;
-        mUserId = context.getUserId();
+        mUserHandle = context.getUser();
         mService = service;
         IPictureProfileCallback ppCallback = new IPictureProfileCallback.Stub() {
             @Override
@@ -102,11 +107,11 @@
                 }
             }
             @Override
-            public void onError(int err) {
+            public void onError(String profileId, int err) {
                 synchronized (mLock) {
                     for (PictureProfileCallbackRecord record : mPpCallbackRecords) {
                         // TODO: filter callback record
-                        record.postError(err);
+                        record.postError(profileId, err);
                     }
                 }
             }
@@ -149,11 +154,11 @@
                 }
             }
             @Override
-            public void onError(int err) {
+            public void onError(String profileId, int err) {
                 synchronized (mLock) {
                     for (SoundProfileCallbackRecord record : mSpCallbackRecords) {
                         // TODO: filter callback record
-                        record.postError(err);
+                        record.postError(profileId, err);
                     }
                 }
             }
@@ -210,18 +215,21 @@
         }
     }
 
-
     /**
      * Gets picture profile by given profile type and name.
      *
+     * @param type the type of the profile.
+     * @param name the name of the profile.
+     * @param includeParams {@code true} to include parameters in the profile; {@code false}
+     *                      otherwise.
      * @return the corresponding picture profile if available; {@code null} if the name doesn't
-     *         exist.
+     * exist.
      */
     @Nullable
     public PictureProfile getPictureProfile(
-            @PictureProfile.ProfileType int type, @NonNull String name) {
+            @PictureProfile.ProfileType int type, @NonNull String name, boolean includeParams) {
         try {
-            return mService.getPictureProfile(type, name, mUserId);
+            return mService.getPictureProfile(type, name, includeParams, mUserHandle);
         } catch (RemoteException e) {
             throw e.rethrowFromSystemServer();
         }
@@ -231,14 +239,18 @@
     /**
      * Gets profiles that available to the given package.
      *
+     * @param packageName the package name of the profiles.
+     * @param includeParams {@code true} to include parameters in the profile; {@code false}
+     *                      otherwise.
      * @hide
      */
     @SystemApi
     @NonNull
     @RequiresPermission(android.Manifest.permission.MANAGE_GLOBAL_PICTURE_QUALITY_SERVICE)
-    public List<PictureProfile> getPictureProfilesByPackage(@NonNull String packageName) {
+    public List<PictureProfile> getPictureProfilesByPackage(
+            @NonNull String packageName, boolean includeParams) {
         try {
-            return mService.getPictureProfilesByPackage(packageName, mUserId);
+            return mService.getPictureProfilesByPackage(packageName, includeParams, mUserHandle);
         } catch (RemoteException e) {
             throw e.rethrowFromSystemServer();
         }
@@ -246,11 +258,16 @@
 
     /**
      * Gets profiles that available to the caller.
+     *
+     * @param includeParams {@code true} to include parameters in the profile; {@code false}
+     *                      otherwise.
+     * @return the corresponding picture profile if available; {@code null} if the name doesn't
+     * exist.
      */
     @NonNull
-    public List<PictureProfile> getAvailablePictureProfiles() {
+    public List<PictureProfile> getAvailablePictureProfiles(boolean includeParams) {
         try {
-            return mService.getAvailablePictureProfiles(mUserId);
+            return mService.getAvailablePictureProfiles(includeParams, mUserHandle);
         } catch (RemoteException e) {
             throw e.rethrowFromSystemServer();
         }
@@ -268,7 +285,7 @@
     @RequiresPermission(android.Manifest.permission.MANAGE_GLOBAL_PICTURE_QUALITY_SERVICE)
     public boolean setDefaultPictureProfile(@Nullable String id) {
         try {
-            return mService.setDefaultPictureProfile(id, mUserId);
+            return mService.setDefaultPictureProfile(id, mUserHandle);
         } catch (RemoteException e) {
             throw e.rethrowFromSystemServer();
         }
@@ -277,7 +294,7 @@
     /**
      * Gets all package names whose picture profiles are available.
      *
-     * @see #getPictureProfilesByPackage(String)
+     * @see #getPictureProfilesByPackage(String, boolean)
      * @hide
      */
     @SystemApi
@@ -285,7 +302,7 @@
     @RequiresPermission(android.Manifest.permission.MANAGE_GLOBAL_PICTURE_QUALITY_SERVICE)
     public List<String> getPictureProfilePackageNames() {
         try {
-            return mService.getPictureProfilePackageNames(mUserId);
+            return mService.getPictureProfilePackageNames(mUserHandle);
         } catch (RemoteException e) {
             throw e.rethrowFromSystemServer();
         }
@@ -297,7 +314,7 @@
      */
     public List<PictureProfileHandle> getPictureProfileHandle(String[] id) {
         try {
-            return mService.getPictureProfileHandle(id, mUserId);
+            return mService.getPictureProfileHandle(id, mUserHandle);
         } catch (RemoteException e) {
             throw e.rethrowFromSystemServer();
         }
@@ -309,7 +326,7 @@
      */
     public List<SoundProfileHandle> getSoundProfileHandle(String[] id) {
         try {
-            return mService.getSoundProfileHandle(id, mUserId);
+            return mService.getSoundProfileHandle(id, mUserHandle);
         } catch (RemoteException e) {
             throw e.rethrowFromSystemServer();
         }
@@ -320,10 +337,12 @@
      *
      * <p>If the profile is created successfully,
      * {@link PictureProfileCallback#onPictureProfileAdded(String, PictureProfile)} is invoked.
+     *
+     * @param pp the {@link PictureProfile} object to be created.
      */
     public void createPictureProfile(@NonNull PictureProfile pp) {
         try {
-            mService.createPictureProfile(pp, mUserId);
+            mService.createPictureProfile(pp, mUserHandle);
         } catch (RemoteException e) {
             throw e.rethrowFromSystemServer();
         }
@@ -332,10 +351,13 @@
 
     /**
      * Updates an existing picture profile and store it in the system.
+     *
+     * @param profileId the id of the object to be updated.
+     * @param pp the {@link PictureProfile} object to be updated.
      */
     public void updatePictureProfile(@NonNull String profileId, @NonNull PictureProfile pp) {
         try {
-            mService.updatePictureProfile(profileId, pp, mUserId);
+            mService.updatePictureProfile(profileId, pp, mUserHandle);
         } catch (RemoteException e) {
             throw e.rethrowFromSystemServer();
         }
@@ -344,10 +366,12 @@
 
     /**
      * Removes a picture profile from the system.
+     *
+     * @param profileId the id of the object to be removed.
      */
     public void removePictureProfile(@NonNull String profileId) {
         try {
-            mService.removePictureProfile(profileId, mUserId);
+            mService.removePictureProfile(profileId, mUserHandle);
         } catch (RemoteException e) {
             throw e.rethrowFromSystemServer();
         }
@@ -383,18 +407,20 @@
         }
     }
 
-
     /**
      * Gets sound profile by given profile type and name.
      *
-     * @return the corresponding sound profile if available; {@code null} if the name doesn't
-     *         exist.
+     * @param type the type of the profile.
+     * @param name the name of the profile.
+     * @param includeParams {@code true} to include parameters in the profile; {@code false}
+     *                      otherwise.
+     * @return the corresponding sound profile if available; {@code null} if the name doesn't exist.
      */
     @Nullable
     public SoundProfile getSoundProfile(
-            @SoundProfile.ProfileType int type, @NonNull String name) {
+            @SoundProfile.ProfileType int type, @NonNull String name, boolean includeParams) {
         try {
-            return mService.getSoundProfile(type, name, mUserId);
+            return mService.getSoundProfile(type, name, includeParams, mUserHandle);
         } catch (RemoteException e) {
             throw e.rethrowFromSystemServer();
         }
@@ -404,14 +430,18 @@
     /**
      * Gets profiles that available to the given package.
      *
+     * @param packageName the package name of the profiles.
+     * @param includeParams {@code true} to include parameters in the profile; {@code false}
+     *                      otherwise.
      * @hide
      */
     @SystemApi
     @NonNull
     @RequiresPermission(android.Manifest.permission.MANAGE_GLOBAL_SOUND_QUALITY_SERVICE)
-    public List<SoundProfile> getSoundProfilesByPackage(@NonNull String packageName) {
+    public List<SoundProfile> getSoundProfilesByPackage(
+            @NonNull String packageName, boolean includeParams) {
         try {
-            return mService.getSoundProfilesByPackage(packageName, mUserId);
+            return mService.getSoundProfilesByPackage(packageName, includeParams, mUserHandle);
         } catch (RemoteException e) {
             throw e.rethrowFromSystemServer();
         }
@@ -419,11 +449,16 @@
 
     /**
      * Gets profiles that available to the caller package.
+     *
+     * @param includeParams {@code true} to include parameters in the profile; {@code false}
+     *                      otherwise.
+     *
+     * @return the corresponding sound profile if available; {@code null} if the none available.
      */
     @NonNull
-    public List<SoundProfile> getAvailableSoundProfiles() {
+    public List<SoundProfile> getAvailableSoundProfiles(boolean includeParams) {
         try {
-            return mService.getAvailableSoundProfiles(mUserId);
+            return mService.getAvailableSoundProfiles(includeParams, mUserHandle);
         } catch (RemoteException e) {
             throw e.rethrowFromSystemServer();
         }
@@ -441,7 +476,7 @@
     @RequiresPermission(android.Manifest.permission.MANAGE_GLOBAL_SOUND_QUALITY_SERVICE)
     public boolean setDefaultSoundProfile(@Nullable String id) {
         try {
-            return mService.setDefaultSoundProfile(id, mUserId);
+            return mService.setDefaultSoundProfile(id, mUserHandle);
         } catch (RemoteException e) {
             throw e.rethrowFromSystemServer();
         }
@@ -450,7 +485,7 @@
     /**
      * Gets all package names whose sound profiles are available.
      *
-     * @see #getSoundProfilesByPackage(String)
+     * @see #getSoundProfilesByPackage(String, boolean)
      *
      * @hide
      */
@@ -459,7 +494,7 @@
     @RequiresPermission(android.Manifest.permission.MANAGE_GLOBAL_SOUND_QUALITY_SERVICE)
     public List<String> getSoundProfilePackageNames() {
         try {
-            return mService.getSoundProfilePackageNames(mUserId);
+            return mService.getSoundProfilePackageNames(mUserHandle);
         } catch (RemoteException e) {
             throw e.rethrowFromSystemServer();
         }
@@ -471,10 +506,12 @@
      *
      * <p>If the profile is created successfully,
      * {@link SoundProfileCallback#onSoundProfileAdded(String, SoundProfile)} is invoked.
+     *
+     * @param sp the {@link SoundProfile} object to be created.
      */
     public void createSoundProfile(@NonNull SoundProfile sp) {
         try {
-            mService.createSoundProfile(sp, mUserId);
+            mService.createSoundProfile(sp, mUserHandle);
         } catch (RemoteException e) {
             throw e.rethrowFromSystemServer();
         }
@@ -483,10 +520,13 @@
 
     /**
      * Updates an existing sound profile and store it in the system.
+     *
+     * @param profileId the id of the object to be updated.
+     * @param sp the {@link SoundProfile} object to be updated.
      */
     public void updateSoundProfile(@NonNull String profileId, @NonNull SoundProfile sp) {
         try {
-            mService.updateSoundProfile(profileId, sp, mUserId);
+            mService.updateSoundProfile(profileId, sp, mUserHandle);
         } catch (RemoteException e) {
             throw e.rethrowFromSystemServer();
         }
@@ -495,10 +535,12 @@
 
     /**
      * Removes a sound profile from the system.
+     *
+     * @param profileId the id of the object to be removed.
      */
     public void removeSoundProfile(@NonNull String profileId) {
         try {
-            mService.removeSoundProfile(profileId, mUserId);
+            mService.removeSoundProfile(profileId, mUserHandle);
         } catch (RemoteException e) {
             throw e.rethrowFromSystemServer();
         }
@@ -510,7 +552,7 @@
     @NonNull
     public List<ParamCapability> getParamCapabilities(@NonNull List<String> names) {
         try {
-            return mService.getParamCapabilities(names, mUserId);
+            return mService.getParamCapabilities(names, mUserHandle);
         } catch (RemoteException e) {
             throw e.rethrowFromSystemServer();
         }
@@ -528,7 +570,7 @@
     @NonNull
     public List<String> getPictureProfileAllowList() {
         try {
-            return mService.getPictureProfileAllowList(mUserId);
+            return mService.getPictureProfileAllowList(mUserHandle);
         } catch (RemoteException e) {
             throw e.rethrowFromSystemServer();
         }
@@ -542,7 +584,7 @@
     @RequiresPermission(android.Manifest.permission.MANAGE_GLOBAL_PICTURE_QUALITY_SERVICE)
     public void setPictureProfileAllowList(@NonNull List<String> packageNames) {
         try {
-            mService.setPictureProfileAllowList(packageNames, mUserId);
+            mService.setPictureProfileAllowList(packageNames, mUserHandle);
         } catch (RemoteException e) {
             throw e.rethrowFromSystemServer();
         }
@@ -560,7 +602,7 @@
     @NonNull
     public List<String> getSoundProfileAllowList() {
         try {
-            return mService.getSoundProfileAllowList(mUserId);
+            return mService.getSoundProfileAllowList(mUserHandle);
         } catch (RemoteException e) {
             throw e.rethrowFromSystemServer();
         }
@@ -574,7 +616,7 @@
     @RequiresPermission(android.Manifest.permission.MANAGE_GLOBAL_SOUND_QUALITY_SERVICE)
     public void setSoundProfileAllowList(@NonNull List<String> packageNames) {
         try {
-            mService.setSoundProfileAllowList(packageNames, mUserId);
+            mService.setSoundProfileAllowList(packageNames, mUserHandle);
         } catch (RemoteException e) {
             throw e.rethrowFromSystemServer();
         }
@@ -586,7 +628,7 @@
      */
     public boolean isSupported() {
         try {
-            return mService.isSupported(mUserId);
+            return mService.isSupported(mUserHandle);
         } catch (RemoteException e) {
             throw e.rethrowFromSystemServer();
         }
@@ -604,7 +646,7 @@
     @RequiresPermission(android.Manifest.permission.MANAGE_GLOBAL_PICTURE_QUALITY_SERVICE)
     public void setAutoPictureQualityEnabled(boolean enabled) {
         try {
-            mService.setAutoPictureQualityEnabled(enabled, mUserId);
+            mService.setAutoPictureQualityEnabled(enabled, mUserHandle);
         } catch (RemoteException e) {
             throw e.rethrowFromSystemServer();
         }
@@ -615,7 +657,7 @@
      */
     public boolean isAutoPictureQualityEnabled() {
         try {
-            return mService.isAutoPictureQualityEnabled(mUserId);
+            return mService.isAutoPictureQualityEnabled(mUserHandle);
         } catch (RemoteException e) {
             throw e.rethrowFromSystemServer();
         }
@@ -632,7 +674,7 @@
     @RequiresPermission(android.Manifest.permission.MANAGE_GLOBAL_PICTURE_QUALITY_SERVICE)
     public void setSuperResolutionEnabled(boolean enabled) {
         try {
-            mService.setSuperResolutionEnabled(enabled, mUserId);
+            mService.setSuperResolutionEnabled(enabled, mUserHandle);
         } catch (RemoteException e) {
             throw e.rethrowFromSystemServer();
         }
@@ -643,7 +685,7 @@
      */
     public boolean isSuperResolutionEnabled() {
         try {
-            return mService.isSuperResolutionEnabled(mUserId);
+            return mService.isSuperResolutionEnabled(mUserHandle);
         } catch (RemoteException e) {
             throw e.rethrowFromSystemServer();
         }
@@ -661,7 +703,7 @@
     @RequiresPermission(android.Manifest.permission.MANAGE_GLOBAL_SOUND_QUALITY_SERVICE)
     public void setAutoSoundQualityEnabled(boolean enabled) {
         try {
-            mService.setAutoSoundQualityEnabled(enabled, mUserId);
+            mService.setAutoSoundQualityEnabled(enabled, mUserHandle);
         } catch (RemoteException e) {
             throw e.rethrowFromSystemServer();
         }
@@ -672,7 +714,7 @@
      */
     public boolean isAutoSoundQualityEnabled() {
         try {
-            return mService.isAutoSoundQualityEnabled(mUserId);
+            return mService.isAutoSoundQualityEnabled(mUserHandle);
         } catch (RemoteException e) {
             throw e.rethrowFromSystemServer();
         }
@@ -721,7 +763,7 @@
             @NonNull AmbientBacklightSettings settings) {
         Preconditions.checkNotNull(settings);
         try {
-            mService.setAmbientBacklightSettings(settings, mUserId);
+            mService.setAmbientBacklightSettings(settings, mUserHandle);
         } catch (RemoteException e) {
             throw e.rethrowFromSystemServer();
         }
@@ -732,7 +774,7 @@
      */
     public boolean isAmbientBacklightEnabled() {
         try {
-            return mService.isAmbientBacklightEnabled(mUserId);
+            return mService.isAmbientBacklightEnabled(mUserHandle);
         } catch (RemoteException e) {
             throw e.rethrowFromSystemServer();
         }
@@ -746,7 +788,7 @@
     @RequiresPermission(android.Manifest.permission.READ_COLOR_ZONES)
     public void setAmbientBacklightEnabled(boolean enabled) {
         try {
-            mService.setAmbientBacklightEnabled(enabled, mUserId);
+            mService.setAmbientBacklightEnabled(enabled, mUserHandle);
         } catch (RemoteException e) {
             throw e.rethrowFromSystemServer();
         }
@@ -803,11 +845,11 @@
             });
         }
 
-        public void postError(int error) {
+        public void postError(String profileId, int error) {
             mExecutor.execute(new Runnable() {
                 @Override
                 public void run() {
-                    mCallback.onError(error);
+                    mCallback.onError(profileId, error);
                 }
             });
         }
@@ -863,11 +905,11 @@
             });
         }
 
-        public void postError(int error) {
+        public void postError(String profileId, int error) {
             mExecutor.execute(new Runnable() {
                 @Override
                 public void run() {
-                    mCallback.onError(error);
+                    mCallback.onError(profileId, error);
                 }
             });
         }
@@ -933,9 +975,11 @@
         /**
          * This is invoked when an issue has occurred.
          *
+         * @param profileId the profile ID related to the error. {@code null} if there is no
+         *                  associated profile.
          * @param errorCode the error code
          */
-        public void onError(@PictureProfile.ErrorCode int errorCode) {
+        public void onError(@Nullable String profileId, @PictureProfile.ErrorCode int errorCode) {
         }
 
         /**
@@ -988,9 +1032,11 @@
         /**
          * This is invoked when an issue has occurred.
          *
+         * @param profileId the profile ID related to the error. {@code null} if there is no
+         *                  associated profile.
          * @param errorCode the error code
          */
-        public void onError(@SoundProfile.ErrorCode int errorCode) {
+        public void onError(@Nullable String profileId, @SoundProfile.ErrorCode int errorCode) {
         }
 
         /**
@@ -1016,4 +1062,86 @@
         public void onAmbientBacklightEvent(@NonNull AmbientBacklightEvent event) {
         }
     }
+
+    /**
+     * Listener used to monitor status of active pictures.
+     */
+    public interface ActiveProcessingPictureListener {
+        /**
+         * Called when active pictures are changed.
+         *
+         * @param activeProcessingPictures contents currently undergoing picture processing.
+         */
+        void onActiveProcessingPicturesChanged(
+                @NonNull List<ActiveProcessingPicture> activeProcessingPictures);
+    }
+
+    /**
+     * Adds an active picture listener for the contents owner by the caller.
+     */
+    public void addActiveProcessingPictureListener(
+            @CallbackExecutor @NonNull Executor executor,
+            @NonNull ActiveProcessingPictureListener listener) {
+        Preconditions.checkNotNull(listener);
+        Preconditions.checkNotNull(executor);
+        synchronized (mLock) {
+            mApListenerRecords.add(
+                    new ActiveProcessingPictureListenerRecord(listener, executor, false));
+        }
+    }
+
+    /**
+     * Adds an active picture listener for all contents.
+     *
+     * @hide
+     */
+    @SuppressLint("PairedRegistration")
+    @SystemApi
+    @RequiresPermission(android.Manifest.permission.MANAGE_GLOBAL_PICTURE_QUALITY_SERVICE)
+    public void addGlobalActiveProcessingPictureListener(
+            @NonNull Executor executor,
+            @NonNull ActiveProcessingPictureListener listener) {
+        Preconditions.checkNotNull(listener);
+        Preconditions.checkNotNull(executor);
+        synchronized (mLock) {
+            mApListenerRecords.add(
+                    new ActiveProcessingPictureListenerRecord(listener, executor, true));
+        }
+    }
+
+
+    /**
+     * Removes an active picture listener for the contents.
+     */
+    public void removeActiveProcessingPictureListener(
+            @NonNull ActiveProcessingPictureListener listener) {
+        Preconditions.checkNotNull(listener);
+        synchronized (mLock) {
+            for (Iterator<ActiveProcessingPictureListenerRecord> it = mApListenerRecords.iterator();
+                    it.hasNext(); ) {
+                ActiveProcessingPictureListenerRecord record = it.next();
+                if (record.getListener() == listener) {
+                    it.remove();
+                    break;
+                }
+            }
+        }
+    }
+
+    private static final class ActiveProcessingPictureListenerRecord {
+        private final ActiveProcessingPictureListener mListener;
+        private final Executor mExecutor;
+        private final boolean mIsGlobal;
+
+        ActiveProcessingPictureListenerRecord(
+                ActiveProcessingPictureListener listener, Executor executor, boolean isGlobal) {
+            mListener = listener;
+            mExecutor = executor;
+            mIsGlobal = isGlobal;
+        }
+
+        public ActiveProcessingPictureListener getListener() {
+            return mListener;
+        }
+    }
 }
diff --git a/media/java/android/media/quality/PictureProfileHandle.java b/media/java/android/media/quality/PictureProfileHandle.java
index 714fd36..d9d2193 100644
--- a/media/java/android/media/quality/PictureProfileHandle.java
+++ b/media/java/android/media/quality/PictureProfileHandle.java
@@ -28,11 +28,14 @@
   * A picture profile represents a collection of parameters used to configure picture processing
   * to enhance the quality of graphic buffers.
   *
+  * @see PictureProfile.getHandle
+  *
   * @hide
   */
 @SystemApi
 @FlaggedApi(android.media.tv.flags.Flags.FLAG_APPLY_PICTURE_PROFILES)
 public final class PictureProfileHandle implements Parcelable {
+    /** A handle that represents no picture processing configuration. */
     public static final @NonNull PictureProfileHandle NONE = new PictureProfileHandle(0);
 
     private final long mId;
@@ -42,7 +45,16 @@
         mId = id;
     }
 
-    /** @hide */
+    /**
+     * An ID that uniquely identifies the picture profile across the system.
+     *
+     * This ID can be used to construct an NDK PictureProfileHandle to be fed directly into
+     * IGraphicBufferProducer to couple a picture profile to a graphic buffer.
+     *
+     * Note: These IDs are generated randomly and are not stable across reboots.
+     *
+     * @hide
+     */
     @SystemApi
     @FlaggedApi(android.media.tv.flags.Flags.FLAG_APPLY_PICTURE_PROFILES)
     public long getId() {
diff --git a/native/android/dynamic_instrumentation_manager.cpp b/native/android/dynamic_instrumentation_manager.cpp
index 5322136..0749731 100644
--- a/native/android/dynamic_instrumentation_manager.cpp
+++ b/native/android/dynamic_instrumentation_manager.cpp
@@ -15,7 +15,9 @@
  */
 
 #define LOG_TAG "ADynamicInstrumentationManager"
+#include <android-base/properties.h>
 #include <android/dynamic_instrumentation_manager.h>
+#include <android/os/instrumentation/BnOffsetCallback.h>
 #include <android/os/instrumentation/ExecutableMethodFileOffsets.h>
 #include <android/os/instrumentation/IDynamicInstrumentationManager.h>
 #include <android/os/instrumentation/MethodDescriptor.h>
@@ -23,7 +25,9 @@
 #include <binder/Binder.h>
 #include <binder/IServiceManager.h>
 #include <utils/Log.h>
+#include <utils/StrongPointer.h>
 
+#include <future>
 #include <mutex>
 #include <optional>
 #include <string>
@@ -31,6 +35,9 @@
 
 namespace android::dynamicinstrumentationmanager {
 
+using android::os::instrumentation::BnOffsetCallback;
+using android::os::instrumentation::ExecutableMethodFileOffsets;
+
 // Global instance of IDynamicInstrumentationManager, service is obtained only on first use.
 static std::mutex mLock;
 static sp<os::instrumentation::IDynamicInstrumentationManager> mService;
@@ -131,6 +138,30 @@
     delete instance;
 }
 
+class ResultCallback : public BnOffsetCallback {
+public:
+    ::android::binder::Status onResult(
+            const ::std::optional<ExecutableMethodFileOffsets>& offsets) override {
+        promise_.set_value(offsets);
+        return android::binder::Status::ok();
+    }
+
+    std::optional<ExecutableMethodFileOffsets> waitForResult() {
+        std::future<std::optional<ExecutableMethodFileOffsets>> futureResult =
+                promise_.get_future();
+        auto futureStatus = futureResult.wait_for(
+                std::chrono::seconds(1 * android::base::HwTimeoutMultiplier()));
+        if (futureStatus == std::future_status::ready) {
+            return futureResult.get();
+        } else {
+            return std::nullopt;
+        }
+    }
+
+private:
+    std::promise<std::optional<ExecutableMethodFileOffsets>> promise_;
+};
+
 int32_t ADynamicInstrumentationManager_getExecutableMethodFileOffsets(
         const ADynamicInstrumentationManager_TargetProcess* targetProcess,
         const ADynamicInstrumentationManager_MethodDescriptor* methodDescriptor,
@@ -150,15 +181,15 @@
         return INVALID_OPERATION;
     }
 
-    std::optional<android::os::instrumentation::ExecutableMethodFileOffsets> offsets;
+    android::sp<ResultCallback> resultCallback = android::sp<ResultCallback>::make();
     binder_status_t result =
             service->getExecutableMethodFileOffsets(targetProcessParcel, methodDescriptorParcel,
-                                                    &offsets)
+                                                    resultCallback)
                     .exceptionCode();
     if (result != OK) {
         return result;
     }
-
+    std::optional<ExecutableMethodFileOffsets> offsets = resultCallback->waitForResult();
     if (offsets != std::nullopt) {
         auto* value = new ADynamicInstrumentationManager_ExecutableMethodFileOffsets();
         value->containerPath = offsets->containerPath;
@@ -170,4 +201,4 @@
     }
 
     return result;
-}
\ No newline at end of file
+}
diff --git a/native/android/libandroid.map.txt b/native/android/libandroid.map.txt
index 8dd8830..1ccadf9 100644
--- a/native/android/libandroid.map.txt
+++ b/native/android/libandroid.map.txt
@@ -393,6 +393,7 @@
     APerformanceHint_createSessionUsingConfig; # introduced=36
     APerformanceHint_notifyWorkloadIncrease; # introduced=36
     APerformanceHint_notifyWorkloadReset; # introduced=36
+    APerformanceHint_notifyWorkloadSpike; # introduced=36
     APerformanceHint_borrowSessionFromJava; # introduced=36
     APerformanceHint_setNativeSurfaces; # introduced=36
     AWorkDuration_create; # introduced=VanillaIceCream
diff --git a/native/android/performance_hint.cpp b/native/android/performance_hint.cpp
index 5dbb8a9..1945d90 100644
--- a/native/android/performance_hint.cpp
+++ b/native/android/performance_hint.cpp
@@ -214,6 +214,7 @@
     int sendHints(std::vector<hal::SessionHint>& hints, int64_t now, const char* debugName);
     int notifyWorkloadIncrease(bool cpu, bool gpu, const char* debugName);
     int notifyWorkloadReset(bool cpu, bool gpu, const char* debugName);
+    int notifyWorkloadSpike(bool cpu, bool gpu, const char* debugName);
     int setThreads(const int32_t* threadIds, size_t size);
     int getThreadIds(int32_t* const threadIds, size_t* size);
     int setPreferPowerEfficiency(bool enabled);
@@ -600,6 +601,19 @@
     return sendHints(hints, now, debugName);
 }
 
+int APerformanceHintSession::notifyWorkloadSpike(bool cpu, bool gpu, const char* debugName) {
+    std::vector<hal::SessionHint> hints(2);
+    hints.clear();
+    if (cpu) {
+        hints.push_back(hal::SessionHint::CPU_LOAD_SPIKE);
+    }
+    if (gpu) {
+        hints.push_back(hal::SessionHint::GPU_LOAD_SPIKE);
+    }
+    int64_t now = ::android::uptimeNanos();
+    return sendHints(hints, now, debugName);
+}
+
 int APerformanceHintSession::setThreads(const int32_t* threadIds, size_t size) {
     if (size == 0) {
         ALOGE("%s: the list of thread ids must not be empty.", __FUNCTION__);
@@ -1149,6 +1163,16 @@
     return session->notifyWorkloadReset(cpu, gpu, debugName);
 }
 
+int APerformanceHint_notifyWorkloadSpike(APerformanceHintSession* session, bool cpu, bool gpu,
+                                         const char* debugName) {
+    VALIDATE_PTR(session)
+    VALIDATE_PTR(debugName)
+    if (!useNewLoadHintBehavior()) {
+        return ENOTSUP;
+    }
+    return session->notifyWorkloadReset(cpu, gpu, debugName);
+}
+
 int APerformanceHint_setNativeSurfaces(APerformanceHintSession* session,
                                        ANativeWindow** nativeWindows, int nativeWindowsSize,
                                        ASurfaceControl** surfaceControls, int surfaceControlsSize) {
diff --git a/native/android/tests/performance_hint/PerformanceHintNativeTest.cpp b/native/android/tests/performance_hint/PerformanceHintNativeTest.cpp
index b8f574f..c166e73 100644
--- a/native/android/tests/performance_hint/PerformanceHintNativeTest.cpp
+++ b/native/android/tests/performance_hint/PerformanceHintNativeTest.cpp
@@ -299,6 +299,10 @@
     EXPECT_CALL(*mMockSession, sendHint(Eq(SessionHint::GPU_LOAD_RESET))).Times(Exactly(1));
     result = APerformanceHint_notifyWorkloadReset(session, true, true, "Test hint");
     EXPECT_EQ(0, result);
+    EXPECT_CALL(*mMockSession, sendHint(Eq(SessionHint::CPU_LOAD_SPIKE))).Times(Exactly(1));
+    EXPECT_CALL(*mMockSession, sendHint(Eq(SessionHint::GPU_LOAD_SPIKE))).Times(Exactly(1));
+    result = APerformanceHint_notifyWorkloadSpike(session, true, true, "Test hint");
+    EXPECT_EQ(0, result);
 
     result = APerformanceHint_sendHint(session, static_cast<SessionHint>(-1));
     EXPECT_EQ(EINVAL, result);
diff --git a/packages/NeuralNetworks/framework/Android.bp b/packages/NeuralNetworks/framework/Android.bp
new file mode 100644
index 0000000..6f45daa
--- /dev/null
+++ b/packages/NeuralNetworks/framework/Android.bp
@@ -0,0 +1,30 @@
+// 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 {
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
+filegroup {
+    name: "framework-ondeviceintelligence-sources",
+    srcs: [
+        "java/**/*.aidl",
+        "java/**/*.java",
+    ],
+    path: "java",
+    visibility: [
+        "//frameworks/base:__subpackages__",
+        "//packages/modules/NeuralNetworks:__subpackages__",
+    ],
+}
diff --git a/core/java/android/app/ondeviceintelligence/DownloadCallback.java b/packages/NeuralNetworks/framework/java/android/app/ondeviceintelligence/DownloadCallback.java
similarity index 96%
rename from core/java/android/app/ondeviceintelligence/DownloadCallback.java
rename to packages/NeuralNetworks/framework/java/android/app/ondeviceintelligence/DownloadCallback.java
index 30c6e19..95fb288 100644
--- a/core/java/android/app/ondeviceintelligence/DownloadCallback.java
+++ b/packages/NeuralNetworks/framework/java/android/app/ondeviceintelligence/DownloadCallback.java
@@ -23,8 +23,7 @@
 import android.annotation.Nullable;
 import android.annotation.SystemApi;
 import android.os.PersistableBundle;
-
-import androidx.annotation.IntDef;
+import android.annotation.IntDef;
 
 import java.lang.annotation.Retention;
 import java.lang.annotation.RetentionPolicy;
@@ -53,14 +52,14 @@
 
     /**
      * Sent when feature download has been initiated already, hence no need to request download
-     * again. Caller can query {@link OnDeviceIntelligenceManager#getFeatureStatus} to check if
+     * again. Caller can query {@link OnDeviceIntelligenceManager#getFeatureDetails} to check if
      * download has been completed.
      */
     int DOWNLOAD_FAILURE_STATUS_DOWNLOADING = 3;
 
     /**
      * Sent when feature download did not start due to errors (e.g. remote exception of features not
-     * available). Caller can query {@link OnDeviceIntelligenceManager#getFeatureStatus} to check
+     * available). Caller can query {@link OnDeviceIntelligenceManager#getFeatureDetails} to check
      * if feature-status is {@link FeatureDetails#FEATURE_STATUS_DOWNLOADABLE}.
      */
     int DOWNLOAD_FAILURE_STATUS_UNAVAILABLE = 4;
@@ -72,7 +71,7 @@
             DOWNLOAD_FAILURE_STATUS_NETWORK_FAILURE,
             DOWNLOAD_FAILURE_STATUS_DOWNLOADING,
             DOWNLOAD_FAILURE_STATUS_UNAVAILABLE
-    }, open = true)
+    })
     @Retention(RetentionPolicy.SOURCE)
     @interface DownloadFailureStatus {
     }
diff --git a/core/java/android/app/ondeviceintelligence/FeatureDetails.aidl b/packages/NeuralNetworks/framework/java/android/app/ondeviceintelligence/Feature.aidl
similarity index 93%
rename from core/java/android/app/ondeviceintelligence/FeatureDetails.aidl
rename to packages/NeuralNetworks/framework/java/android/app/ondeviceintelligence/Feature.aidl
index 0589bf8..47cfb4a 100644
--- a/core/java/android/app/ondeviceintelligence/FeatureDetails.aidl
+++ b/packages/NeuralNetworks/framework/java/android/app/ondeviceintelligence/Feature.aidl
@@ -19,4 +19,4 @@
 /**
   * @hide
   */
-parcelable FeatureDetails;
+@JavaOnlyStableParcelable parcelable Feature;
diff --git a/core/java/android/app/ondeviceintelligence/Feature.java b/packages/NeuralNetworks/framework/java/android/app/ondeviceintelligence/Feature.java
similarity index 96%
rename from core/java/android/app/ondeviceintelligence/Feature.java
rename to packages/NeuralNetworks/framework/java/android/app/ondeviceintelligence/Feature.java
index bcc56073..88f4de29 100644
--- a/core/java/android/app/ondeviceintelligence/Feature.java
+++ b/packages/NeuralNetworks/framework/java/android/app/ondeviceintelligence/Feature.java
@@ -26,6 +26,8 @@
 import android.os.Parcelable;
 import android.os.PersistableBundle;
 
+import java.util.Objects;
+
 /**
  * Represents a typical feature associated with on-device intelligence.
  *
@@ -56,9 +58,8 @@
         this.mModelName = modelName;
         this.mType = type;
         this.mVariant = variant;
-        this.mFeatureParams = featureParams;
-        com.android.internal.util.AnnotationValidations.validate(
-                NonNull.class, null, mFeatureParams);
+        this.mFeatureParams = Objects.requireNonNull(featureParams,
+                "featureParams should be non-null.");
     }
 
     /** Returns the unique and immutable identifier of this feature. */
@@ -167,8 +168,6 @@
         this.mType = type;
         this.mVariant = variant;
         this.mFeatureParams = featureParams;
-        com.android.internal.util.AnnotationValidations.validate(
-                NonNull.class, null, mFeatureParams);
     }
 
     public static final @NonNull Parcelable.Creator<Feature> CREATOR
@@ -200,6 +199,7 @@
 
         /**
          * Provides a builder instance to create a feature for given id.
+         *
          * @param id the unique identifier for the feature.
          */
         public Builder(int id) {
diff --git a/core/java/android/app/ondeviceintelligence/FeatureDetails.aidl b/packages/NeuralNetworks/framework/java/android/app/ondeviceintelligence/FeatureDetails.aidl
similarity index 92%
copy from core/java/android/app/ondeviceintelligence/FeatureDetails.aidl
copy to packages/NeuralNetworks/framework/java/android/app/ondeviceintelligence/FeatureDetails.aidl
index 0589bf8..c5b3532 100644
--- a/core/java/android/app/ondeviceintelligence/FeatureDetails.aidl
+++ b/packages/NeuralNetworks/framework/java/android/app/ondeviceintelligence/FeatureDetails.aidl
@@ -19,4 +19,4 @@
 /**
   * @hide
   */
-parcelable FeatureDetails;
+@JavaOnlyStableParcelable parcelable FeatureDetails;
diff --git a/core/java/android/app/ondeviceintelligence/FeatureDetails.java b/packages/NeuralNetworks/framework/java/android/app/ondeviceintelligence/FeatureDetails.java
similarity index 87%
rename from core/java/android/app/ondeviceintelligence/FeatureDetails.java
rename to packages/NeuralNetworks/framework/java/android/app/ondeviceintelligence/FeatureDetails.java
index 44930f2..063cfb8 100644
--- a/core/java/android/app/ondeviceintelligence/FeatureDetails.java
+++ b/packages/NeuralNetworks/framework/java/android/app/ondeviceintelligence/FeatureDetails.java
@@ -19,18 +19,18 @@
 import static android.app.ondeviceintelligence.flags.Flags.FLAG_ENABLE_ON_DEVICE_INTELLIGENCE;
 
 import android.annotation.FlaggedApi;
+import android.annotation.IntDef;
 import android.annotation.NonNull;
 import android.annotation.SystemApi;
 import android.os.Parcelable;
 import android.os.PersistableBundle;
 
-import androidx.annotation.IntDef;
-
 import java.lang.annotation.ElementType;
 import java.lang.annotation.Retention;
 import java.lang.annotation.RetentionPolicy;
 import java.lang.annotation.Target;
 import java.text.MessageFormat;
+import java.util.Objects;
 
 /**
  * Represents a status of a requested {@link Feature}.
@@ -69,7 +69,7 @@
             FEATURE_STATUS_DOWNLOADING,
             FEATURE_STATUS_AVAILABLE,
             FEATURE_STATUS_SERVICE_UNAVAILABLE
-    }, open = true)
+    })
     @Target({ElementType.TYPE_USE, ElementType.METHOD, ElementType.PARAMETER, ElementType.FIELD})
     @Retention(RetentionPolicy.SOURCE)
     public @interface Status {
@@ -79,18 +79,12 @@
             @Status int featureStatus,
             @NonNull PersistableBundle featureDetailParams) {
         this.mFeatureStatus = featureStatus;
-        com.android.internal.util.AnnotationValidations.validate(
-                Status.class, null, mFeatureStatus);
-        this.mFeatureDetailParams = featureDetailParams;
-        com.android.internal.util.AnnotationValidations.validate(
-                NonNull.class, null, mFeatureDetailParams);
+        this.mFeatureDetailParams = Objects.requireNonNull(featureDetailParams);
     }
 
     public FeatureDetails(
             @Status int featureStatus) {
         this.mFeatureStatus = featureStatus;
-        com.android.internal.util.AnnotationValidations.validate(
-                Status.class, null, mFeatureStatus);
         this.mFeatureDetailParams = new PersistableBundle();
     }
 
@@ -155,11 +149,7 @@
                 PersistableBundle.CREATOR);
 
         this.mFeatureStatus = status;
-        com.android.internal.util.AnnotationValidations.validate(
-                Status.class, null, mFeatureStatus);
         this.mFeatureDetailParams = persistableBundle;
-        com.android.internal.util.AnnotationValidations.validate(
-                NonNull.class, null, mFeatureDetailParams);
     }
 
 
diff --git a/core/java/android/app/ondeviceintelligence/FeatureDetails.aidl b/packages/NeuralNetworks/framework/java/android/app/ondeviceintelligence/ICancellationSignal.aidl
similarity index 82%
copy from core/java/android/app/ondeviceintelligence/FeatureDetails.aidl
copy to packages/NeuralNetworks/framework/java/android/app/ondeviceintelligence/ICancellationSignal.aidl
index 0589bf8..1fe201f 100644
--- a/core/java/android/app/ondeviceintelligence/FeatureDetails.aidl
+++ b/packages/NeuralNetworks/framework/java/android/app/ondeviceintelligence/ICancellationSignal.aidl
@@ -5,7 +5,7 @@
  * 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
+ *      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,
@@ -17,6 +17,8 @@
 package android.app.ondeviceintelligence;
 
 /**
-  * @hide
-  */
-parcelable FeatureDetails;
+ * @hide
+ */
+oneway interface ICancellationSignal {
+    void cancel();
+}
diff --git a/core/java/android/app/ondeviceintelligence/IDownloadCallback.aidl b/packages/NeuralNetworks/framework/java/android/app/ondeviceintelligence/IDownloadCallback.aidl
similarity index 100%
rename from core/java/android/app/ondeviceintelligence/IDownloadCallback.aidl
rename to packages/NeuralNetworks/framework/java/android/app/ondeviceintelligence/IDownloadCallback.aidl
diff --git a/core/java/android/app/ondeviceintelligence/IFeatureCallback.aidl b/packages/NeuralNetworks/framework/java/android/app/ondeviceintelligence/IFeatureCallback.aidl
similarity index 100%
rename from core/java/android/app/ondeviceintelligence/IFeatureCallback.aidl
rename to packages/NeuralNetworks/framework/java/android/app/ondeviceintelligence/IFeatureCallback.aidl
diff --git a/core/java/android/app/ondeviceintelligence/IFeatureDetailsCallback.aidl b/packages/NeuralNetworks/framework/java/android/app/ondeviceintelligence/IFeatureDetailsCallback.aidl
similarity index 100%
rename from core/java/android/app/ondeviceintelligence/IFeatureDetailsCallback.aidl
rename to packages/NeuralNetworks/framework/java/android/app/ondeviceintelligence/IFeatureDetailsCallback.aidl
diff --git a/core/java/android/app/ondeviceintelligence/IListFeaturesCallback.aidl b/packages/NeuralNetworks/framework/java/android/app/ondeviceintelligence/IListFeaturesCallback.aidl
similarity index 100%
rename from core/java/android/app/ondeviceintelligence/IListFeaturesCallback.aidl
rename to packages/NeuralNetworks/framework/java/android/app/ondeviceintelligence/IListFeaturesCallback.aidl
diff --git a/core/java/android/app/ondeviceintelligence/IOnDeviceIntelligenceManager.aidl b/packages/NeuralNetworks/framework/java/android/app/ondeviceintelligence/IOnDeviceIntelligenceManager.aidl
similarity index 97%
rename from core/java/android/app/ondeviceintelligence/IOnDeviceIntelligenceManager.aidl
rename to packages/NeuralNetworks/framework/java/android/app/ondeviceintelligence/IOnDeviceIntelligenceManager.aidl
index 1977a39..fac5ec6 100644
--- a/core/java/android/app/ondeviceintelligence/IOnDeviceIntelligenceManager.aidl
+++ b/packages/NeuralNetworks/framework/java/android/app/ondeviceintelligence/IOnDeviceIntelligenceManager.aidl
@@ -16,8 +16,8 @@
 
  package android.app.ondeviceintelligence;
 
- import com.android.internal.infra.AndroidFuture;
- import android.os.ICancellationSignal;
+ import com.android.modules.utils.AndroidFuture;
+ import android.app.ondeviceintelligence.ICancellationSignal;
  import android.os.ParcelFileDescriptor;
  import android.os.PersistableBundle;
  import android.os.RemoteCallback;
diff --git a/core/java/android/app/ondeviceintelligence/IProcessingSignal.aidl b/packages/NeuralNetworks/framework/java/android/app/ondeviceintelligence/IProcessingSignal.aidl
similarity index 100%
rename from core/java/android/app/ondeviceintelligence/IProcessingSignal.aidl
rename to packages/NeuralNetworks/framework/java/android/app/ondeviceintelligence/IProcessingSignal.aidl
diff --git a/packages/NeuralNetworks/framework/java/android/app/ondeviceintelligence/IRemoteCallback.aidl b/packages/NeuralNetworks/framework/java/android/app/ondeviceintelligence/IRemoteCallback.aidl
new file mode 100644
index 0000000..6f07693
--- /dev/null
+++ b/packages/NeuralNetworks/framework/java/android/app/ondeviceintelligence/IRemoteCallback.aidl
@@ -0,0 +1,24 @@
+/*
+* Copyright 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 android.app.ondeviceintelligence;
+
+import android.os.Bundle;
+
+/* @hide */
+oneway interface IRemoteCallback {
+    void sendResult(in Bundle data);
+}
diff --git a/core/java/android/app/ondeviceintelligence/IResponseCallback.aidl b/packages/NeuralNetworks/framework/java/android/app/ondeviceintelligence/IResponseCallback.aidl
similarity index 100%
rename from core/java/android/app/ondeviceintelligence/IResponseCallback.aidl
rename to packages/NeuralNetworks/framework/java/android/app/ondeviceintelligence/IResponseCallback.aidl
diff --git a/core/java/android/app/ondeviceintelligence/IStreamingResponseCallback.aidl b/packages/NeuralNetworks/framework/java/android/app/ondeviceintelligence/IStreamingResponseCallback.aidl
similarity index 100%
rename from core/java/android/app/ondeviceintelligence/IStreamingResponseCallback.aidl
rename to packages/NeuralNetworks/framework/java/android/app/ondeviceintelligence/IStreamingResponseCallback.aidl
diff --git a/core/java/android/app/ondeviceintelligence/ITokenInfoCallback.aidl b/packages/NeuralNetworks/framework/java/android/app/ondeviceintelligence/ITokenInfoCallback.aidl
similarity index 100%
rename from core/java/android/app/ondeviceintelligence/ITokenInfoCallback.aidl
rename to packages/NeuralNetworks/framework/java/android/app/ondeviceintelligence/ITokenInfoCallback.aidl
diff --git a/core/java/android/app/ondeviceintelligence/FeatureDetails.aidl b/packages/NeuralNetworks/framework/java/android/app/ondeviceintelligence/InferenceInfo.aidl
similarity index 92%
copy from core/java/android/app/ondeviceintelligence/FeatureDetails.aidl
copy to packages/NeuralNetworks/framework/java/android/app/ondeviceintelligence/InferenceInfo.aidl
index 0589bf8..6f63254 100644
--- a/core/java/android/app/ondeviceintelligence/FeatureDetails.aidl
+++ b/packages/NeuralNetworks/framework/java/android/app/ondeviceintelligence/InferenceInfo.aidl
@@ -19,4 +19,4 @@
 /**
   * @hide
   */
-parcelable FeatureDetails;
+@JavaOnlyStableParcelable parcelable InferenceInfo;
diff --git a/core/java/android/app/ondeviceintelligence/InferenceInfo.java b/packages/NeuralNetworks/framework/java/android/app/ondeviceintelligence/InferenceInfo.java
similarity index 100%
rename from core/java/android/app/ondeviceintelligence/InferenceInfo.java
rename to packages/NeuralNetworks/framework/java/android/app/ondeviceintelligence/InferenceInfo.java
diff --git a/core/java/android/app/ondeviceintelligence/OnDeviceIntelligenceException.java b/packages/NeuralNetworks/framework/java/android/app/ondeviceintelligence/OnDeviceIntelligenceException.java
similarity index 97%
rename from core/java/android/app/ondeviceintelligence/OnDeviceIntelligenceException.java
rename to packages/NeuralNetworks/framework/java/android/app/ondeviceintelligence/OnDeviceIntelligenceException.java
index 03ff563a..2881c9d 100644
--- a/core/java/android/app/ondeviceintelligence/OnDeviceIntelligenceException.java
+++ b/packages/NeuralNetworks/framework/java/android/app/ondeviceintelligence/OnDeviceIntelligenceException.java
@@ -20,13 +20,14 @@
 import static android.app.ondeviceintelligence.flags.Flags.FLAG_ENABLE_ON_DEVICE_INTELLIGENCE;
 
 import android.annotation.FlaggedApi;
+import android.annotation.IntDef;
 import android.annotation.NonNull;
 import android.annotation.SystemApi;
 import android.os.PersistableBundle;
 
-import androidx.annotation.IntDef;
-
 import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
 import java.lang.annotation.Target;
 
 /**
@@ -124,8 +125,9 @@
                     PROCESSING_ERROR_SERVICE_UNAVAILABLE,
                     ON_DEVICE_INTELLIGENCE_SERVICE_UNAVAILABLE,
                     PROCESSING_UPDATE_STATUS_CONNECTION_FAILED
-            }, open = true)
+            })
     @Target({ElementType.TYPE_PARAMETER, ElementType.TYPE_USE})
+    @Retention(RetentionPolicy.SOURCE)
     @interface OnDeviceIntelligenceError {
     }
 
diff --git a/packages/NeuralNetworks/framework/java/android/app/ondeviceintelligence/OnDeviceIntelligenceFrameworkInitializer.java b/packages/NeuralNetworks/framework/java/android/app/ondeviceintelligence/OnDeviceIntelligenceFrameworkInitializer.java
new file mode 100644
index 0000000..7d35dd7
--- /dev/null
+++ b/packages/NeuralNetworks/framework/java/android/app/ondeviceintelligence/OnDeviceIntelligenceFrameworkInitializer.java
@@ -0,0 +1,54 @@
+/*
+ * 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 android.app.ondeviceintelligence;
+
+import static android.app.ondeviceintelligence.flags.Flags.FLAG_ENABLE_ON_DEVICE_INTELLIGENCE;
+
+import android.annotation.FlaggedApi;
+import android.annotation.SystemApi;
+import android.app.SystemServiceRegistry;
+import android.content.Context;
+
+/**
+ * Class for performing registration for OnDeviceIntelligence service.
+ *
+ * @hide
+ */
+@SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
+@FlaggedApi(FLAG_ENABLE_ON_DEVICE_INTELLIGENCE)
+public class OnDeviceIntelligenceFrameworkInitializer {
+    private OnDeviceIntelligenceFrameworkInitializer() {
+    }
+
+    /**
+     * Called by {@link SystemServiceRegistry}'s static initializer and registers
+     * OnDeviceIntelligence service to {@link Context}, so that {@link Context#getSystemService} can
+     * return them.
+     *
+     * @throws IllegalStateException if this is called from anywhere besides {@link
+     *                               SystemServiceRegistry}
+     */
+    public static void registerServiceWrappers() {
+        SystemServiceRegistry.registerContextAwareService(Context.ON_DEVICE_INTELLIGENCE_SERVICE,
+                OnDeviceIntelligenceManager.class,
+                (context, serviceBinder) -> {
+                    IOnDeviceIntelligenceManager manager =
+                            IOnDeviceIntelligenceManager.Stub.asInterface(serviceBinder);
+                    return new OnDeviceIntelligenceManager(context, manager);
+                });
+    }
+}
\ No newline at end of file
diff --git a/core/java/android/app/ondeviceintelligence/OnDeviceIntelligenceManager.java b/packages/NeuralNetworks/framework/java/android/app/ondeviceintelligence/OnDeviceIntelligenceManager.java
similarity index 88%
rename from core/java/android/app/ondeviceintelligence/OnDeviceIntelligenceManager.java
rename to packages/NeuralNetworks/framework/java/android/app/ondeviceintelligence/OnDeviceIntelligenceManager.java
index 91651e3..dc0665a 100644
--- a/core/java/android/app/ondeviceintelligence/OnDeviceIntelligenceManager.java
+++ b/packages/NeuralNetworks/framework/java/android/app/ondeviceintelligence/OnDeviceIntelligenceManager.java
@@ -23,18 +23,18 @@
 import android.annotation.CallbackExecutor;
 import android.annotation.CurrentTimeMillisLong;
 import android.annotation.FlaggedApi;
+import android.annotation.IntDef;
 import android.annotation.NonNull;
 import android.annotation.Nullable;
 import android.annotation.RequiresPermission;
 import android.annotation.SystemApi;
 import android.annotation.SystemService;
+import android.app.ondeviceintelligence.utils.BinderUtils;
 import android.content.Context;
 import android.graphics.Bitmap;
-import android.os.Binder;
 import android.os.Bundle;
 import android.os.CancellationSignal;
 import android.os.IBinder;
-import android.os.ICancellationSignal;
 import android.os.OutcomeReceiver;
 import android.os.PersistableBundle;
 import android.os.RemoteCallback;
@@ -42,9 +42,7 @@
 import android.system.OsConstants;
 import android.util.Log;
 
-import androidx.annotation.IntDef;
-
-import com.android.internal.infra.AndroidFuture;
+import com.android.modules.utils.AndroidFuture;
 
 import java.lang.annotation.ElementType;
 import java.lang.annotation.Retention;
@@ -80,10 +78,39 @@
     public static final String AUGMENT_REQUEST_CONTENT_BUNDLE_KEY =
             "AugmentRequestContentBundleKey";
 
+    /**
+     * Timeout to be used for unbinding to the configured remote {@link
+     * android.service.ondeviceintelligence.OnDeviceIntelligenceService} if there are no requests in
+     * the queue. A value of -1 represents to never unbind.
+     *
+     * @hide
+     */
+    public static final String ON_DEVICE_INTELLIGENCE_UNBIND_TIMEOUT_MS =
+        "on_device_intelligence_unbind_timeout_ms";
+
+    /**
+     * Timeout that represents maximum idle time before which a callback should be populated.
+     *
+     * @hide
+     */
+    public static final String ON_DEVICE_INTELLIGENCE_IDLE_TIMEOUT_MS =
+        "on_device_intelligence_idle_timeout_ms";
+
+    /**
+     * Timeout to be used for unbinding to the configured remote {@link
+     * android.service.ondeviceintelligence.OnDeviceSandboxedInferenceService} if there are no
+     * requests in the queue. A value of -1 represents to never unbind.
+     *
+     * @hide
+     */
+    public static final String ON_DEVICE_INFERENCE_UNBIND_TIMEOUT_MS =
+        "on_device_inference_unbind_timeout_ms";
+
     private static final String TAG = "OnDeviceIntelligence";
     private final Context mContext;
     private final IOnDeviceIntelligenceManager mService;
 
+
     /**
      * @hide
      */
@@ -105,11 +132,11 @@
         try {
             RemoteCallback callback = new RemoteCallback(result -> {
                 if (result == null) {
-                    Binder.withCleanCallingIdentity(
+                    BinderUtils.withCleanCallingIdentity(
                             () -> callbackExecutor.execute(() -> versionConsumer.accept(0)));
                 }
                 long version = result.getLong(API_VERSION_BUNDLE_KEY);
-                Binder.withCleanCallingIdentity(
+                BinderUtils.withCleanCallingIdentity(
                         () -> callbackExecutor.execute(() -> versionConsumer.accept(version)));
             });
             mService.getVersion(callback);
@@ -151,14 +178,14 @@
                     new IFeatureCallback.Stub() {
                         @Override
                         public void onSuccess(Feature result) {
-                            Binder.withCleanCallingIdentity(() -> callbackExecutor.execute(
+                            BinderUtils.withCleanCallingIdentity(() -> callbackExecutor.execute(
                                     () -> featureReceiver.onResult(result)));
                         }
 
                         @Override
                         public void onFailure(int errorCode, String errorMessage,
                                 PersistableBundle errorParams) {
-                            Binder.withCleanCallingIdentity(() -> callbackExecutor.execute(
+                            BinderUtils.withCleanCallingIdentity(() -> callbackExecutor.execute(
                                     () -> featureReceiver.onError(
                                             new OnDeviceIntelligenceException(
                                                     errorCode, errorMessage, errorParams))));
@@ -185,14 +212,14 @@
                     new IListFeaturesCallback.Stub() {
                         @Override
                         public void onSuccess(List<Feature> result) {
-                            Binder.withCleanCallingIdentity(() -> callbackExecutor.execute(
+                            BinderUtils.withCleanCallingIdentity(() -> callbackExecutor.execute(
                                     () -> featureListReceiver.onResult(result)));
                         }
 
                         @Override
                         public void onFailure(int errorCode, String errorMessage,
                                 PersistableBundle errorParams) {
-                            Binder.withCleanCallingIdentity(() -> callbackExecutor.execute(
+                            BinderUtils.withCleanCallingIdentity(() -> callbackExecutor.execute(
                                     () -> featureListReceiver.onError(
                                             new OnDeviceIntelligenceException(
                                                     errorCode, errorMessage, errorParams))));
@@ -223,14 +250,14 @@
 
                 @Override
                 public void onSuccess(FeatureDetails result) {
-                    Binder.withCleanCallingIdentity(() -> callbackExecutor.execute(
+                    BinderUtils.withCleanCallingIdentity(() -> callbackExecutor.execute(
                             () -> featureDetailsReceiver.onResult(result)));
                 }
 
                 @Override
                 public void onFailure(int errorCode, String errorMessage,
                         PersistableBundle errorParams) {
-                    Binder.withCleanCallingIdentity(() -> callbackExecutor.execute(
+                    BinderUtils.withCleanCallingIdentity(() -> callbackExecutor.execute(
                             () -> featureDetailsReceiver.onError(
                                     new OnDeviceIntelligenceException(errorCode,
                                             errorMessage, errorParams))));
@@ -268,27 +295,27 @@
 
                 @Override
                 public void onDownloadStarted(long bytesToDownload) {
-                    Binder.withCleanCallingIdentity(() -> callbackExecutor.execute(
+                    BinderUtils.withCleanCallingIdentity(() -> callbackExecutor.execute(
                             () -> callback.onDownloadStarted(bytesToDownload)));
                 }
 
                 @Override
                 public void onDownloadProgress(long bytesDownloaded) {
-                    Binder.withCleanCallingIdentity(() -> callbackExecutor.execute(
+                    BinderUtils.withCleanCallingIdentity(() -> callbackExecutor.execute(
                             () -> callback.onDownloadProgress(bytesDownloaded)));
                 }
 
                 @Override
                 public void onDownloadFailed(int failureStatus, String errorMessage,
                         PersistableBundle errorParams) {
-                    Binder.withCleanCallingIdentity(() -> callbackExecutor.execute(
+                    BinderUtils.withCleanCallingIdentity(() -> callbackExecutor.execute(
                             () -> callback.onDownloadFailed(failureStatus, errorMessage,
                                     errorParams)));
                 }
 
                 @Override
                 public void onDownloadCompleted(PersistableBundle downloadParams) {
-                    Binder.withCleanCallingIdentity(() -> callbackExecutor.execute(
+                    BinderUtils.withCleanCallingIdentity(() -> callbackExecutor.execute(
                             () -> callback.onDownloadCompleted(downloadParams)));
                 }
             };
@@ -325,14 +352,14 @@
             ITokenInfoCallback callback = new ITokenInfoCallback.Stub() {
                 @Override
                 public void onSuccess(TokenInfo tokenInfo) {
-                    Binder.withCleanCallingIdentity(() -> callbackExecutor.execute(
+                    BinderUtils.withCleanCallingIdentity(() -> callbackExecutor.execute(
                             () -> outcomeReceiver.onResult(tokenInfo)));
                 }
 
                 @Override
                 public void onFailure(int errorCode, String errorMessage,
                         PersistableBundle errorParams) {
-                    Binder.withCleanCallingIdentity(() -> callbackExecutor.execute(
+                    BinderUtils.withCleanCallingIdentity(() -> callbackExecutor.execute(
                             () -> outcomeReceiver.onError(
                                     new OnDeviceIntelligenceException(
                                             errorCode, errorMessage, errorParams))));
@@ -377,7 +404,7 @@
             IResponseCallback callback = new IResponseCallback.Stub() {
                 @Override
                 public void onSuccess(@InferenceParams Bundle result) {
-                    Binder.withCleanCallingIdentity(() -> {
+                    BinderUtils.withCleanCallingIdentity(() -> {
                         callbackExecutor.execute(() -> processingCallback.onResult(result));
                     });
                 }
@@ -385,7 +412,7 @@
                 @Override
                 public void onFailure(int errorCode, String errorMessage,
                         PersistableBundle errorParams) {
-                    Binder.withCleanCallingIdentity(() -> callbackExecutor.execute(
+                    BinderUtils.withCleanCallingIdentity(() -> callbackExecutor.execute(
                             () -> processingCallback.onError(
                                     new OnDeviceIntelligenceException(
                                             errorCode, errorMessage, errorParams))));
@@ -394,7 +421,7 @@
                 @Override
                 public void onDataAugmentRequest(@NonNull @InferenceParams Bundle request,
                         @NonNull RemoteCallback contentCallback) {
-                    Binder.withCleanCallingIdentity(() -> callbackExecutor.execute(
+                    BinderUtils.withCleanCallingIdentity(() -> callbackExecutor.execute(
                             () -> processingCallback.onDataAugmentRequest(request, result -> {
                                 Bundle bundle = new Bundle();
                                 bundle.putParcelable(AUGMENT_REQUEST_CONTENT_BUNDLE_KEY, result);
@@ -447,7 +474,7 @@
             IStreamingResponseCallback callback = new IStreamingResponseCallback.Stub() {
                 @Override
                 public void onNewContent(@InferenceParams Bundle result) {
-                    Binder.withCleanCallingIdentity(() -> {
+                    BinderUtils.withCleanCallingIdentity(() -> {
                         callbackExecutor.execute(
                                 () -> streamingProcessingCallback.onPartialResult(result));
                     });
@@ -455,7 +482,7 @@
 
                 @Override
                 public void onSuccess(@InferenceParams Bundle result) {
-                    Binder.withCleanCallingIdentity(() -> {
+                    BinderUtils.withCleanCallingIdentity(() -> {
                         callbackExecutor.execute(
                                 () -> streamingProcessingCallback.onResult(result));
                     });
@@ -464,7 +491,7 @@
                 @Override
                 public void onFailure(int errorCode, String errorMessage,
                         PersistableBundle errorParams) {
-                    Binder.withCleanCallingIdentity(() -> {
+                    BinderUtils.withCleanCallingIdentity(() -> {
                         callbackExecutor.execute(
                                 () -> streamingProcessingCallback.onError(
                                         new OnDeviceIntelligenceException(
@@ -476,7 +503,7 @@
                 @Override
                 public void onDataAugmentRequest(@NonNull @InferenceParams Bundle content,
                         @NonNull RemoteCallback contentCallback) {
-                    Binder.withCleanCallingIdentity(() -> callbackExecutor.execute(
+                    BinderUtils.withCleanCallingIdentity(() -> callbackExecutor.execute(
                             () -> streamingProcessingCallback.onDataAugmentRequest(content,
                                     contentResponse -> {
                                         Bundle bundle = new Bundle();
@@ -537,7 +564,7 @@
             REQUEST_TYPE_INFERENCE,
             REQUEST_TYPE_PREPARE,
             REQUEST_TYPE_EMBEDDINGS
-    }, open = true)
+    })
     @Target({ElementType.TYPE_USE, ElementType.METHOD, ElementType.PARAMETER,
             ElementType.FIELD})
     @Retention(RetentionPolicy.SOURCE)
@@ -614,8 +641,17 @@
                     if (error != null || cancellationTransport == null) {
                         Log.e(TAG, "Unable to receive the remote cancellation signal.", error);
                     } else {
-                        cancellationSignal.setRemote(
-                                ICancellationSignal.Stub.asInterface(cancellationTransport));
+                        ICancellationSignal remoteCancellationSignal =
+                                ICancellationSignal.Stub.asInterface(cancellationTransport);
+                        cancellationSignal.setOnCancelListener(
+                                () -> {
+                                    try {
+                                        remoteCancellationSignal.cancel();
+                                    } catch (RemoteException e) {
+                                        Log.w(TAG, "Unable to propagate cancellation signal.",
+                                                e);
+                                    }
+                                });
                     }
                 }, callbackExecutor);
         return cancellationFuture;
@@ -638,6 +674,4 @@
                 }, executor);
         return processingSignalFuture;
     }
-
-
-}
+}
\ No newline at end of file
diff --git a/core/java/android/app/ondeviceintelligence/ProcessingCallback.java b/packages/NeuralNetworks/framework/java/android/app/ondeviceintelligence/ProcessingCallback.java
similarity index 100%
rename from core/java/android/app/ondeviceintelligence/ProcessingCallback.java
rename to packages/NeuralNetworks/framework/java/android/app/ondeviceintelligence/ProcessingCallback.java
diff --git a/core/java/android/app/ondeviceintelligence/ProcessingSignal.java b/packages/NeuralNetworks/framework/java/android/app/ondeviceintelligence/ProcessingSignal.java
similarity index 100%
rename from core/java/android/app/ondeviceintelligence/ProcessingSignal.java
rename to packages/NeuralNetworks/framework/java/android/app/ondeviceintelligence/ProcessingSignal.java
diff --git a/core/java/android/app/ondeviceintelligence/StreamingProcessingCallback.java b/packages/NeuralNetworks/framework/java/android/app/ondeviceintelligence/StreamingProcessingCallback.java
similarity index 100%
rename from core/java/android/app/ondeviceintelligence/StreamingProcessingCallback.java
rename to packages/NeuralNetworks/framework/java/android/app/ondeviceintelligence/StreamingProcessingCallback.java
diff --git a/core/java/android/app/ondeviceintelligence/TokenInfo.aidl b/packages/NeuralNetworks/framework/java/android/app/ondeviceintelligence/TokenInfo.aidl
similarity index 93%
rename from core/java/android/app/ondeviceintelligence/TokenInfo.aidl
rename to packages/NeuralNetworks/framework/java/android/app/ondeviceintelligence/TokenInfo.aidl
index 2c19c1e..599b337 100644
--- a/core/java/android/app/ondeviceintelligence/TokenInfo.aidl
+++ b/packages/NeuralNetworks/framework/java/android/app/ondeviceintelligence/TokenInfo.aidl
@@ -19,4 +19,4 @@
 /**
   * @hide
   */
-parcelable TokenInfo;
+@JavaOnlyStableParcelable parcelable TokenInfo;
diff --git a/core/java/android/app/ondeviceintelligence/TokenInfo.java b/packages/NeuralNetworks/framework/java/android/app/ondeviceintelligence/TokenInfo.java
similarity index 100%
rename from core/java/android/app/ondeviceintelligence/TokenInfo.java
rename to packages/NeuralNetworks/framework/java/android/app/ondeviceintelligence/TokenInfo.java
diff --git a/packages/NeuralNetworks/framework/java/android/app/ondeviceintelligence/utils/BinderUtils.java b/packages/NeuralNetworks/framework/java/android/app/ondeviceintelligence/utils/BinderUtils.java
new file mode 100644
index 0000000..2916f03
--- /dev/null
+++ b/packages/NeuralNetworks/framework/java/android/app/ondeviceintelligence/utils/BinderUtils.java
@@ -0,0 +1,96 @@
+/*
+ * 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 android.app.ondeviceintelligence.utils;
+
+import android.annotation.NonNull;
+import android.os.Binder;
+
+import java.util.function.Supplier;
+
+/**
+ * Collection of utilities for {@link Binder} and related classes.
+ * @hide
+ */
+public class BinderUtils {
+    /**
+     * Convenience method for running the provided action enclosed in
+     * {@link Binder#clearCallingIdentity}/{@link Binder#restoreCallingIdentity}
+     *
+     * Any exception thrown by the given action will be caught and rethrown after the call to
+     * {@link Binder#restoreCallingIdentity}
+     *
+     * Note that this is copied from Binder#withCleanCallingIdentity with minor changes
+     * since it is not public.
+     *
+     * @hide
+     */
+    public static final <T extends Exception> void withCleanCallingIdentity(
+            @NonNull ThrowingRunnable<T> action) throws T {
+        final long callingIdentity = Binder.clearCallingIdentity();
+        try {
+            action.run();
+        } finally {
+            Binder.restoreCallingIdentity(callingIdentity);
+        }
+    }
+
+    /**
+     * Like a Runnable, but declared to throw an exception.
+     *
+     * @param <T> The exception class which is declared to be thrown.
+     */
+    @FunctionalInterface
+    public interface ThrowingRunnable<T extends Exception> {
+        /** @see java.lang.Runnable */
+        void run() throws T;
+    }
+
+    /**
+     * Convenience method for running the provided action enclosed in
+     * {@link Binder#clearCallingIdentity}/{@link Binder#restoreCallingIdentity} returning the
+     * result.
+     *
+     * <p>Any exception thrown by the given action will be caught and rethrown after
+     * the call to {@link Binder#restoreCallingIdentity}.
+     *
+     * Note that this is copied from Binder#withCleanCallingIdentity with minor changes
+     * since it is not public.
+     *
+     * @hide
+     */
+    public static final <T, E extends Exception> T withCleanCallingIdentity(
+            @NonNull ThrowingSupplier<T, E> action) throws E {
+        final long callingIdentity = Binder.clearCallingIdentity();
+        try {
+            return action.get();
+        } finally {
+            Binder.restoreCallingIdentity(callingIdentity);
+        }
+    }
+
+    /**
+     * An equivalent of {@link Supplier}
+     *
+     * @param <T> The class which is declared to be returned.
+     * @param <E> The exception class which is declared to be thrown.
+     */
+    @FunctionalInterface
+    public interface ThrowingSupplier<T, E extends Exception> {
+        /** @see java.util.function.Supplier */
+        T get() throws E;
+    }
+}
\ No newline at end of file
diff --git a/core/java/android/service/ondeviceintelligence/IOnDeviceIntelligenceService.aidl b/packages/NeuralNetworks/framework/java/android/service/ondeviceintelligence/IOnDeviceIntelligenceService.aidl
similarity index 95%
rename from core/java/android/service/ondeviceintelligence/IOnDeviceIntelligenceService.aidl
rename to packages/NeuralNetworks/framework/java/android/service/ondeviceintelligence/IOnDeviceIntelligenceService.aidl
index 45c4350..cba18c1 100644
--- a/core/java/android/service/ondeviceintelligence/IOnDeviceIntelligenceService.aidl
+++ b/packages/NeuralNetworks/framework/java/android/service/ondeviceintelligence/IOnDeviceIntelligenceService.aidl
@@ -18,14 +18,14 @@
 
 import android.os.PersistableBundle;
 import android.os.ParcelFileDescriptor;
-import android.os.ICancellationSignal;
+import android.app.ondeviceintelligence.ICancellationSignal;
 import android.os.RemoteCallback;
 import android.app.ondeviceintelligence.IDownloadCallback;
 import android.app.ondeviceintelligence.Feature;
 import android.app.ondeviceintelligence.IFeatureCallback;
 import android.app.ondeviceintelligence.IListFeaturesCallback;
 import android.app.ondeviceintelligence.IFeatureDetailsCallback;
-import com.android.internal.infra.AndroidFuture;
+import com.android.modules.utils.AndroidFuture;
 import android.service.ondeviceintelligence.IRemoteProcessingService;
 
 
diff --git a/core/java/android/service/ondeviceintelligence/IOnDeviceSandboxedInferenceService.aidl b/packages/NeuralNetworks/framework/java/android/service/ondeviceintelligence/IOnDeviceSandboxedInferenceService.aidl
similarity index 93%
rename from core/java/android/service/ondeviceintelligence/IOnDeviceSandboxedInferenceService.aidl
rename to packages/NeuralNetworks/framework/java/android/service/ondeviceintelligence/IOnDeviceSandboxedInferenceService.aidl
index 1af3b0f..504fdd9 100644
--- a/core/java/android/service/ondeviceintelligence/IOnDeviceSandboxedInferenceService.aidl
+++ b/packages/NeuralNetworks/framework/java/android/service/ondeviceintelligence/IOnDeviceSandboxedInferenceService.aidl
@@ -21,11 +21,11 @@
 import android.app.ondeviceintelligence.ITokenInfoCallback;
 import android.app.ondeviceintelligence.IProcessingSignal;
 import android.app.ondeviceintelligence.Feature;
-import android.os.IRemoteCallback;
-import android.os.ICancellationSignal;
+import android.app.ondeviceintelligence.IRemoteCallback;
+import android.app.ondeviceintelligence.ICancellationSignal;
 import android.os.PersistableBundle;
 import android.os.Bundle;
-import com.android.internal.infra.AndroidFuture;
+import com.android.modules.utils.AndroidFuture;
 import android.service.ondeviceintelligence.IRemoteStorageService;
 import android.service.ondeviceintelligence.IProcessingUpdateStatusCallback;
 
diff --git a/core/java/android/service/ondeviceintelligence/IProcessingUpdateStatusCallback.aidl b/packages/NeuralNetworks/framework/java/android/service/ondeviceintelligence/IProcessingUpdateStatusCallback.aidl
similarity index 100%
rename from core/java/android/service/ondeviceintelligence/IProcessingUpdateStatusCallback.aidl
rename to packages/NeuralNetworks/framework/java/android/service/ondeviceintelligence/IProcessingUpdateStatusCallback.aidl
diff --git a/core/java/android/service/ondeviceintelligence/IRemoteProcessingService.aidl b/packages/NeuralNetworks/framework/java/android/service/ondeviceintelligence/IRemoteProcessingService.aidl
similarity index 100%
rename from core/java/android/service/ondeviceintelligence/IRemoteProcessingService.aidl
rename to packages/NeuralNetworks/framework/java/android/service/ondeviceintelligence/IRemoteProcessingService.aidl
diff --git a/core/java/android/service/ondeviceintelligence/IRemoteStorageService.aidl b/packages/NeuralNetworks/framework/java/android/service/ondeviceintelligence/IRemoteStorageService.aidl
similarity index 95%
rename from core/java/android/service/ondeviceintelligence/IRemoteStorageService.aidl
rename to packages/NeuralNetworks/framework/java/android/service/ondeviceintelligence/IRemoteStorageService.aidl
index a6f49e1..253df89 100644
--- a/core/java/android/service/ondeviceintelligence/IRemoteStorageService.aidl
+++ b/packages/NeuralNetworks/framework/java/android/service/ondeviceintelligence/IRemoteStorageService.aidl
@@ -20,7 +20,7 @@
 import android.os.ParcelFileDescriptor;
 import android.os.RemoteCallback;
 
-import com.android.internal.infra.AndroidFuture;
+import com.android.modules.utils.AndroidFuture;
 
 /**
  * Interface for a concrete implementation to provide access to storage read access
diff --git a/core/java/android/service/ondeviceintelligence/OnDeviceIntelligenceService.java b/packages/NeuralNetworks/framework/java/android/service/ondeviceintelligence/OnDeviceIntelligenceService.java
similarity index 67%
rename from core/java/android/service/ondeviceintelligence/OnDeviceIntelligenceService.java
rename to packages/NeuralNetworks/framework/java/android/service/ondeviceintelligence/OnDeviceIntelligenceService.java
index d82fe1c..6907e2b 100644
--- a/core/java/android/service/ondeviceintelligence/OnDeviceIntelligenceService.java
+++ b/packages/NeuralNetworks/framework/java/android/service/ondeviceintelligence/OnDeviceIntelligenceService.java
@@ -18,8 +18,6 @@
 
 import static android.app.ondeviceintelligence.flags.Flags.FLAG_ENABLE_ON_DEVICE_INTELLIGENCE;
 
-import static com.android.internal.util.function.pooled.PooledLambda.obtainMessage;
-
 import android.annotation.CallSuper;
 import android.annotation.CallbackExecutor;
 import android.annotation.FlaggedApi;
@@ -27,11 +25,11 @@
 import android.annotation.Nullable;
 import android.annotation.SdkConstant;
 import android.annotation.SystemApi;
-import android.annotation.TestApi;
 import android.app.Service;
 import android.app.ondeviceintelligence.DownloadCallback;
 import android.app.ondeviceintelligence.Feature;
 import android.app.ondeviceintelligence.FeatureDetails;
+import android.app.ondeviceintelligence.ICancellationSignal;
 import android.app.ondeviceintelligence.IDownloadCallback;
 import android.app.ondeviceintelligence.IFeatureCallback;
 import android.app.ondeviceintelligence.IFeatureDetailsCallback;
@@ -39,14 +37,14 @@
 import android.app.ondeviceintelligence.OnDeviceIntelligenceException;
 import android.app.ondeviceintelligence.OnDeviceIntelligenceManager;
 import android.app.ondeviceintelligence.OnDeviceIntelligenceManager.StateParams;
+import android.app.ondeviceintelligence.utils.BinderUtils;
 import android.content.Intent;
-import android.os.Binder;
 import android.os.Bundle;
 import android.os.CancellationSignal;
 import android.os.Handler;
 import android.os.IBinder;
-import android.os.ICancellationSignal;
 import android.os.Looper;
+import android.os.Message;
 import android.os.OutcomeReceiver;
 import android.os.ParcelFileDescriptor;
 import android.os.PersistableBundle;
@@ -55,10 +53,11 @@
 import android.util.Log;
 import android.util.Slog;
 
-import com.android.internal.infra.AndroidFuture;
+import com.android.modules.utils.AndroidFuture;
 
 import java.io.File;
 import java.io.FileNotFoundException;
+import java.io.IOException;
 import java.util.Collection;
 import java.util.List;
 import java.util.Map;
@@ -92,6 +91,18 @@
 @SystemApi
 @FlaggedApi(FLAG_ENABLE_ON_DEVICE_INTELLIGENCE)
 public abstract class OnDeviceIntelligenceService extends Service {
+    private static final int MSG_ON_READY = 1;
+    private static final int MSG_GET_VERSION = 2;
+    private static final int MSG_LIST_FEATURES = 3;
+    private static final int MSG_GET_FEATURE = 4;
+    private static final int MSG_GET_FEATURE_DETAILS = 5;
+    private static final int MSG_DOWNLOAD_FEATURE = 6;
+    private static final int MSG_GET_READ_ONLY_FILE_DESCRIPTOR = 7;
+    private static final int MSG_GET_READ_ONLY_FEATURE_FILE_DESCRIPTOR_MAP = 8;
+    private static final int MSG_REGISTER_REMOTE_SERVICES = 9;
+    private static final int MSG_INFERENCE_SERVICE_CONNECTED = 10;
+    private static final int MSG_INFERENCE_SERVICE_DISCONNECTED = 11;
+
     private static final String TAG = OnDeviceIntelligenceService.class.getSimpleName();
 
     private volatile IRemoteProcessingService mRemoteProcessingService;
@@ -101,19 +112,71 @@
     @Override
     public void onCreate() {
         super.onCreate();
-        mHandler = new Handler(Looper.getMainLooper(), null /* callback */, true /* async */);
+        mHandler = new Handler(Looper.getMainLooper()) {
+            @Override
+            public void handleMessage(@NonNull Message msg) {
+                switch (msg.what) {
+                    case MSG_ON_READY:
+                        OnDeviceIntelligenceService.this.onReady();
+                        break;
+                    case MSG_GET_VERSION:
+                        OnDeviceIntelligenceService.this.onGetVersion(
+                                (LongConsumer) msg.obj);
+                        break;
+                    case MSG_LIST_FEATURES:
+                        OnDeviceIntelligenceService.this.onListFeatures(
+                                msg.arg1,
+                                (OutcomeReceiver<List<Feature>, OnDeviceIntelligenceException>) msg.obj);
+                        break;
+                    case MSG_GET_FEATURE:
+                        GetFeatureParams params = (GetFeatureParams) msg.obj;
+                        OnDeviceIntelligenceService.this.onGetFeature(
+                                msg.arg1,
+                                msg.arg2,
+                                params.callback);
+                        break;
+                    case MSG_GET_FEATURE_DETAILS:
+                        FeatureDetailsParams detailsParams = (FeatureDetailsParams) msg.obj;
+                        OnDeviceIntelligenceService.this.onGetFeatureDetails(
+                                msg.arg1,
+                                detailsParams.feature,
+                                detailsParams.callback);
+                        break;
+                    case MSG_DOWNLOAD_FEATURE:
+                        DownloadParams downloadParams = (DownloadParams) msg.obj;
+                        OnDeviceIntelligenceService.this.onDownloadFeature(
+                                msg.arg1,
+                                downloadParams.feature,
+                                downloadParams.cancellationSignal,
+                                downloadParams.callback);
+                        break;
+                    case MSG_GET_READ_ONLY_FILE_DESCRIPTOR:
+                        FileDescriptorParams fdParams = (FileDescriptorParams) msg.obj;
+                        OnDeviceIntelligenceService.this.onGetReadOnlyFileDescriptor(
+                                fdParams.fileName,
+                                fdParams.future);
+                        break;
+                    case MSG_GET_READ_ONLY_FEATURE_FILE_DESCRIPTOR_MAP:
+                        FeatureFileDescriptorParams ffdParams =
+                                (FeatureFileDescriptorParams) msg.obj;
+                        OnDeviceIntelligenceService.this.onGetReadOnlyFeatureFileDescriptorMap(
+                                ffdParams.feature,
+                                ffdParams.consumer);
+                        break;
+                    case MSG_REGISTER_REMOTE_SERVICES:
+                        mRemoteProcessingService = (IRemoteProcessingService) msg.obj;
+                        break;
+                    case MSG_INFERENCE_SERVICE_CONNECTED:
+                        OnDeviceIntelligenceService.this.onInferenceServiceConnected();
+                        break;
+                    case MSG_INFERENCE_SERVICE_DISCONNECTED:
+                        OnDeviceIntelligenceService.this.onInferenceServiceDisconnected();
+                        break;
+                }
+            }
+        };
     }
 
-    /**
-     * The {@link Intent} that must be declared as handled by the service. To be supported, the
-     * service must also require the
-     * {@link android.Manifest.permission#BIND_ON_DEVICE_INTELLIGENCE_SERVICE}
-     * permission so that other applications can not abuse it.
-     */
-    @SdkConstant(SdkConstant.SdkConstantType.SERVICE_ACTION)
-    public static final String SERVICE_INTERFACE =
-            "android.service.ondeviceintelligence.OnDeviceIntelligenceService";
-
 
     /**
      * @hide
@@ -126,45 +189,37 @@
                 /** {@inheritDoc} */
                 @Override
                 public void ready() {
-                    mHandler.executeOrSendMessage(
-                            obtainMessage(OnDeviceIntelligenceService::onReady,
-                                    OnDeviceIntelligenceService.this));
+                    mHandler.sendEmptyMessage(MSG_ON_READY);
                 }
 
                 @Override
                 public void getVersion(RemoteCallback remoteCallback) {
                     Objects.requireNonNull(remoteCallback);
-                    mHandler.executeOrSendMessage(
-                            obtainMessage(
-                                    OnDeviceIntelligenceService::onGetVersion,
-                                    OnDeviceIntelligenceService.this, l -> {
-                                        Bundle b = new Bundle();
-                                        b.putLong(
-                                                OnDeviceIntelligenceManager.API_VERSION_BUNDLE_KEY,
-                                                l);
-                                        remoteCallback.sendResult(b);
-                                    }));
+                    Message msg = Message.obtain(mHandler, MSG_GET_VERSION,
+                            (LongConsumer) (l -> {
+                                Bundle b = new Bundle();
+                                b.putLong(OnDeviceIntelligenceManager.API_VERSION_BUNDLE_KEY, l);
+                                remoteCallback.sendResult(b);
+                            }));
+                    mHandler.sendMessage(msg);
                 }
 
                 @Override
                 public void listFeatures(int callerUid,
                         IListFeaturesCallback listFeaturesCallback) {
                     Objects.requireNonNull(listFeaturesCallback);
-                    mHandler.executeOrSendMessage(
-                            obtainMessage(
-                                    OnDeviceIntelligenceService::onListFeatures,
-                                    OnDeviceIntelligenceService.this, callerUid,
-                                    wrapListFeaturesCallback(listFeaturesCallback)));
+                    Message msg = Message.obtain(mHandler, MSG_LIST_FEATURES,
+                            callerUid, 0, wrapListFeaturesCallback(listFeaturesCallback));
+                    mHandler.sendMessage(msg);
                 }
 
                 @Override
                 public void getFeature(int callerUid, int id, IFeatureCallback featureCallback) {
                     Objects.requireNonNull(featureCallback);
-                    mHandler.executeOrSendMessage(
-                            obtainMessage(
-                                    OnDeviceIntelligenceService::onGetFeature,
-                                    OnDeviceIntelligenceService.this, callerUid,
-                                    id, wrapFeatureCallback(featureCallback)));
+                    Message msg = Message.obtain(mHandler, MSG_GET_FEATURE,
+                            callerUid, id,
+                            new GetFeatureParams(wrapFeatureCallback(featureCallback)));
+                    mHandler.sendMessage(msg);
                 }
 
 
@@ -173,11 +228,11 @@
                         IFeatureDetailsCallback featureDetailsCallback) {
                     Objects.requireNonNull(feature);
                     Objects.requireNonNull(featureDetailsCallback);
-                    mHandler.executeOrSendMessage(
-                            obtainMessage(
-                                    OnDeviceIntelligenceService::onGetFeatureDetails,
-                                    OnDeviceIntelligenceService.this, callerUid,
-                                    feature, wrapFeatureDetailsCallback(featureDetailsCallback)));
+                    Message msg = Message.obtain(mHandler, MSG_GET_FEATURE_DETAILS,
+                            new FeatureDetailsParams(feature,
+                                    wrapFeatureDetailsCallback(featureDetailsCallback)));
+                    msg.arg1 = callerUid;
+                    mHandler.sendMessage(msg);
                 }
 
                 @Override
@@ -186,18 +241,24 @@
                         IDownloadCallback downloadCallback) {
                     Objects.requireNonNull(feature);
                     Objects.requireNonNull(downloadCallback);
-                    ICancellationSignal transport = null;
+
+                    CancellationSignal cancellationSignal = new CancellationSignal();
                     if (cancellationSignalFuture != null) {
-                        transport = CancellationSignal.createTransport();
+                        ICancellationSignal transport = new ICancellationSignal.Stub() {
+                            @Override
+                            public void cancel() {
+                                cancellationSignal.cancel();
+                            }
+                        };
                         cancellationSignalFuture.complete(transport);
                     }
-                    mHandler.executeOrSendMessage(
-                            obtainMessage(
-                                    OnDeviceIntelligenceService::onDownloadFeature,
-                                    OnDeviceIntelligenceService.this, callerUid,
-                                    feature,
-                                    CancellationSignal.fromTransport(transport),
+
+                    Message msg = Message.obtain(mHandler, MSG_DOWNLOAD_FEATURE,
+                            new DownloadParams(feature,
+                                    cancellationSignalFuture != null ? cancellationSignal : null,
                                     wrapDownloadCallback(downloadCallback)));
+                    msg.arg1 = callerUid;
+                    mHandler.sendMessage(msg);
                 }
 
                 @Override
@@ -205,11 +266,9 @@
                         AndroidFuture<ParcelFileDescriptor> future) {
                     Objects.requireNonNull(fileName);
                     Objects.requireNonNull(future);
-                    mHandler.executeOrSendMessage(
-                            obtainMessage(
-                                    OnDeviceIntelligenceService::onGetReadOnlyFileDescriptor,
-                                    OnDeviceIntelligenceService.this, fileName,
-                                    future));
+                    Message msg = Message.obtain(mHandler, MSG_GET_READ_ONLY_FILE_DESCRIPTOR,
+                            new FileDescriptorParams(fileName, future));
+                    mHandler.sendMessage(msg);
                 }
 
                 @Override
@@ -217,16 +276,15 @@
                         Feature feature, RemoteCallback remoteCallback) {
                     Objects.requireNonNull(feature);
                     Objects.requireNonNull(remoteCallback);
-                    mHandler.executeOrSendMessage(
-                            obtainMessage(
-                                    OnDeviceIntelligenceService::onGetReadOnlyFeatureFileDescriptorMap,
-                                    OnDeviceIntelligenceService.this, feature,
-                                    parcelFileDescriptorMap -> {
-                                        Bundle bundle = new Bundle();
-                                        parcelFileDescriptorMap.forEach(bundle::putParcelable);
-                                        remoteCallback.sendResult(bundle);
-                                        tryClosePfds(parcelFileDescriptorMap.values());
-                                    }));
+                    Message msg = Message.obtain(mHandler,
+                            MSG_GET_READ_ONLY_FEATURE_FILE_DESCRIPTOR_MAP,
+                            new FeatureFileDescriptorParams(feature, parcelFileDescriptorMap -> {
+                                Bundle bundle = new Bundle();
+                                parcelFileDescriptorMap.forEach(bundle::putParcelable);
+                                remoteCallback.sendResult(bundle);
+                                tryClosePfds(parcelFileDescriptorMap.values());
+                            }));
+                    mHandler.sendMessage(msg);
                 }
 
                 @Override
@@ -237,18 +295,12 @@
 
                 @Override
                 public void notifyInferenceServiceConnected() {
-                    mHandler.executeOrSendMessage(
-                            obtainMessage(
-                                    OnDeviceIntelligenceService::onInferenceServiceConnected,
-                                    OnDeviceIntelligenceService.this));
+                    mHandler.sendEmptyMessage(MSG_INFERENCE_SERVICE_CONNECTED);
                 }
 
                 @Override
                 public void notifyInferenceServiceDisconnected() {
-                    mHandler.executeOrSendMessage(
-                            obtainMessage(
-                                    OnDeviceIntelligenceService::onInferenceServiceDisconnected,
-                                    OnDeviceIntelligenceService.this));
+                    mHandler.sendEmptyMessage(MSG_INFERENCE_SERVICE_DISCONNECTED);
                 }
             };
         }
@@ -257,13 +309,77 @@
     }
 
     /**
+     * The {@link Intent} that must be declared as handled by the service. To be supported, the
+     * service must also require the
+     * {@link android.Manifest.permission#BIND_ON_DEVICE_INTELLIGENCE_SERVICE}
+     * permission so that other applications can not abuse it.
+     */
+    @SdkConstant(SdkConstant.SdkConstantType.SERVICE_ACTION)
+    public static final String SERVICE_INTERFACE =
+            "android.service.ondeviceintelligence.OnDeviceIntelligenceService";
+
+    // Parameter holder classes
+    private static class GetFeatureParams {
+        final OutcomeReceiver<Feature, OnDeviceIntelligenceException> callback;
+
+        GetFeatureParams(OutcomeReceiver<Feature, OnDeviceIntelligenceException> callback) {
+            this.callback = callback;
+        }
+    }
+
+    private static class FeatureDetailsParams {
+        final Feature feature;
+        final OutcomeReceiver<FeatureDetails, OnDeviceIntelligenceException> callback;
+
+        FeatureDetailsParams(Feature feature,
+                OutcomeReceiver<FeatureDetails, OnDeviceIntelligenceException> callback) {
+            this.feature = feature;
+            this.callback = callback;
+        }
+    }
+
+    private static class DownloadParams {
+        final Feature feature;
+        final CancellationSignal cancellationSignal;
+        final DownloadCallback callback;
+
+        DownloadParams(Feature feature, CancellationSignal cancellationSignal,
+                DownloadCallback callback) {
+            this.feature = feature;
+            this.cancellationSignal = cancellationSignal;
+            this.callback = callback;
+        }
+    }
+
+    private static class FileDescriptorParams {
+        final String fileName;
+        final AndroidFuture<ParcelFileDescriptor> future;
+
+        FileDescriptorParams(String fileName, AndroidFuture<ParcelFileDescriptor> future) {
+            this.fileName = fileName;
+            this.future = future;
+        }
+    }
+
+    private static class FeatureFileDescriptorParams {
+        final Feature feature;
+        final Consumer<Map<String, ParcelFileDescriptor>> consumer;
+
+        FeatureFileDescriptorParams(Feature feature,
+                Consumer<Map<String, ParcelFileDescriptor>> consumer) {
+            this.feature = feature;
+            this.consumer = consumer;
+        }
+    }
+
+    /**
      * Using this signal to assertively a signal each time service binds successfully, used only in
      * tests to get a signal that service instance is ready. This is needed because we cannot rely
      * on {@link #onCreate} or {@link #onBind} to be invoke on each binding.
      *
      * @hide
      */
-    @TestApi
+    @SystemApi
     public void onReady() {
     }
 
@@ -306,7 +422,7 @@
                     new IProcessingUpdateStatusCallback.Stub() {
                         @Override
                         public void onSuccess(PersistableBundle result) {
-                            Binder.withCleanCallingIdentity(() -> {
+                            BinderUtils.withCleanCallingIdentity(() -> {
                                 callbackExecutor.execute(
                                         () -> statusReceiver.onResult(result));
                             });
@@ -314,7 +430,7 @@
 
                         @Override
                         public void onFailure(int errorCode, String errorMessage) {
-                            Binder.withCleanCallingIdentity(() -> callbackExecutor.execute(
+                            BinderUtils.withCleanCallingIdentity(() -> callbackExecutor.execute(
                                     () -> statusReceiver.onError(
                                             new OnDeviceIntelligenceException(
                                                     errorCode, errorMessage))));
@@ -459,7 +575,7 @@
     private void onGetReadOnlyFileDescriptor(@NonNull String fileName,
             @NonNull AndroidFuture<ParcelFileDescriptor> future) {
         Slog.v(TAG, "onGetReadOnlyFileDescriptor " + fileName);
-        Binder.withCleanCallingIdentity(() -> {
+        BinderUtils.withCleanCallingIdentity(() -> {
             Slog.v(TAG,
                     "onGetReadOnlyFileDescriptor: " + fileName + " under internal app storage.");
             File f = new File(getBaseContext().getFilesDir(), fileName);
@@ -476,7 +592,11 @@
             } finally {
                 future.complete(pfd);
                 if (pfd != null) {
-                    pfd.close();
+                    try {
+                        pfd.close();
+                    } catch (IOException e) {
+                        Log.w(TAG, "Error closing FD", e);
+                    }
                 }
             }
         });
diff --git a/core/java/android/service/ondeviceintelligence/OnDeviceSandboxedInferenceService.java b/packages/NeuralNetworks/framework/java/android/service/ondeviceintelligence/OnDeviceSandboxedInferenceService.java
similarity index 74%
rename from core/java/android/service/ondeviceintelligence/OnDeviceSandboxedInferenceService.java
rename to packages/NeuralNetworks/framework/java/android/service/ondeviceintelligence/OnDeviceSandboxedInferenceService.java
index 3181556..315dbaf 100644
--- a/core/java/android/service/ondeviceintelligence/OnDeviceSandboxedInferenceService.java
+++ b/packages/NeuralNetworks/framework/java/android/service/ondeviceintelligence/OnDeviceSandboxedInferenceService.java
@@ -19,10 +19,8 @@
 import static android.app.ondeviceintelligence.OnDeviceIntelligenceManager.AUGMENT_REQUEST_CONTENT_BUNDLE_KEY;
 import static android.app.ondeviceintelligence.flags.Flags.FLAG_ENABLE_ON_DEVICE_INTELLIGENCE;
 
-import static com.android.internal.util.function.pooled.PooledLambda.obtainMessage;
-
-import android.annotation.CallbackExecutor;
 import android.annotation.CallSuper;
+import android.annotation.CallbackExecutor;
 import android.annotation.FlaggedApi;
 import android.annotation.NonNull;
 import android.annotation.Nullable;
@@ -31,7 +29,9 @@
 import android.annotation.SystemApi;
 import android.app.Service;
 import android.app.ondeviceintelligence.Feature;
+import android.app.ondeviceintelligence.ICancellationSignal;
 import android.app.ondeviceintelligence.IProcessingSignal;
+import android.app.ondeviceintelligence.IRemoteCallback;
 import android.app.ondeviceintelligence.IResponseCallback;
 import android.app.ondeviceintelligence.IStreamingResponseCallback;
 import android.app.ondeviceintelligence.ITokenInfoCallback;
@@ -48,11 +48,9 @@
 import android.os.Bundle;
 import android.os.CancellationSignal;
 import android.os.Handler;
-import android.os.HandlerExecutor;
 import android.os.IBinder;
-import android.os.ICancellationSignal;
-import android.os.IRemoteCallback;
 import android.os.Looper;
+import android.os.Message;
 import android.os.OutcomeReceiver;
 import android.os.ParcelFileDescriptor;
 import android.os.PersistableBundle;
@@ -61,7 +59,8 @@
 import android.util.Log;
 import android.util.Slog;
 
-import com.android.internal.infra.AndroidFuture;
+import com.android.modules.utils.AndroidFuture;
+import com.android.modules.utils.HandlerExecutor;
 
 import java.io.FileInputStream;
 import java.io.FileNotFoundException;
@@ -100,6 +99,12 @@
 public abstract class OnDeviceSandboxedInferenceService extends Service {
     private static final String TAG = OnDeviceSandboxedInferenceService.class.getSimpleName();
 
+    private static final int MSG_TOKEN_INFO_REQUEST = 1;
+    private static final int MSG_PROCESS_REQUEST_STREAMING = 2;
+    private static final int MSG_PROCESS_REQUEST = 3;
+    private static final int MSG_UPDATE_PROCESSING_STATE = 4;
+
+
     /**
      * @hide
      */
@@ -133,12 +138,12 @@
      * @hide
      */
     public static final String MODEL_LOADED_BROADCAST_INTENT =
-        "android.service.ondeviceintelligence.MODEL_LOADED";
+            "android.service.ondeviceintelligence.MODEL_LOADED";
     /**
      * @hide
      */
     public static final String MODEL_UNLOADED_BROADCAST_INTENT =
-        "android.service.ondeviceintelligence.MODEL_UNLOADED";
+            "android.service.ondeviceintelligence.MODEL_UNLOADED";
 
     /**
      * @hide
@@ -152,12 +157,115 @@
     @Override
     public void onCreate() {
         super.onCreate();
-        mHandler = new Handler(Looper.getMainLooper(), null /* callback */, true /* async */);
+        mHandler = new Handler(Looper.getMainLooper()) {
+            @Override
+            public void handleMessage(Message msg) {
+                switch (msg.what) {
+                    case MSG_TOKEN_INFO_REQUEST:
+                        TokenInfoParams params = (TokenInfoParams) msg.obj;
+                        OnDeviceSandboxedInferenceService.this.onTokenInfoRequest(
+                                msg.arg1,
+                                params.feature,
+                                params.request,
+                                params.cancellationSignal,
+                                params.callback);
+                        break;
+                    case MSG_PROCESS_REQUEST_STREAMING:
+                        StreamingRequestParams streamParams = (StreamingRequestParams) msg.obj;
+                        OnDeviceSandboxedInferenceService.this.onProcessRequestStreaming(
+                                msg.arg1,
+                                streamParams.feature,
+                                streamParams.request,
+                                msg.arg2,
+                                streamParams.cancellationSignal,
+                                streamParams.processingSignal,
+                                streamParams.callback);
+                        break;
+                    case MSG_PROCESS_REQUEST:
+                        RequestParams requestParams = (RequestParams) msg.obj;
+                        OnDeviceSandboxedInferenceService.this.onProcessRequest(
+                                msg.arg1,
+                                requestParams.feature,
+                                requestParams.request,
+                                msg.arg2,
+                                requestParams.cancellationSignal,
+                                requestParams.processingSignal,
+                                requestParams.callback);
+                        break;
+                    case MSG_UPDATE_PROCESSING_STATE:
+                        UpdateStateParams stateParams = (UpdateStateParams) msg.obj;
+                        OnDeviceSandboxedInferenceService.this.onUpdateProcessingState(
+                                stateParams.processingState,
+                                stateParams.callback);
+                        break;
+                }
+            }
+        };
     }
 
-    /**
-     * @hide
-     */
+    // Parameter holder classes
+    private static class TokenInfoParams {
+        final Feature feature;
+        final Bundle request;
+        final CancellationSignal cancellationSignal;
+        final OutcomeReceiver<TokenInfo, OnDeviceIntelligenceException> callback;
+
+        TokenInfoParams(Feature feature, Bundle request, CancellationSignal cancellationSignal,
+                OutcomeReceiver<TokenInfo, OnDeviceIntelligenceException> callback) {
+            this.feature = feature;
+            this.request = request;
+            this.cancellationSignal = cancellationSignal;
+            this.callback = callback;
+        }
+    }
+
+    private static class StreamingRequestParams {
+        final Feature feature;
+        final Bundle request;
+        final CancellationSignal cancellationSignal;
+        final ProcessingSignal processingSignal;
+        final StreamingProcessingCallback callback;
+
+        StreamingRequestParams(Feature feature, Bundle request,
+                CancellationSignal cancellationSignal, ProcessingSignal processingSignal,
+                StreamingProcessingCallback callback) {
+            this.feature = feature;
+            this.request = request;
+            this.cancellationSignal = cancellationSignal;
+            this.processingSignal = processingSignal;
+            this.callback = callback;
+        }
+    }
+
+    private static class RequestParams {
+        final Feature feature;
+        final Bundle request;
+        final CancellationSignal cancellationSignal;
+        final ProcessingSignal processingSignal;
+        final ProcessingCallback callback;
+
+        RequestParams(Feature feature, Bundle request,
+                CancellationSignal cancellationSignal, ProcessingSignal processingSignal,
+                ProcessingCallback callback) {
+            this.feature = feature;
+            this.request = request;
+            this.cancellationSignal = cancellationSignal;
+            this.processingSignal = processingSignal;
+            this.callback = callback;
+        }
+    }
+
+    private static class UpdateStateParams {
+        final Bundle processingState;
+        final OutcomeReceiver<PersistableBundle, OnDeviceIntelligenceException> callback;
+
+        UpdateStateParams(Bundle processingState,
+                OutcomeReceiver<PersistableBundle, OnDeviceIntelligenceException> callback) {
+            this.processingState = processingState;
+            this.callback = callback;
+        }
+    }
+
     @Nullable
     @Override
     public final IBinder onBind(@NonNull Intent intent) {
@@ -168,8 +276,7 @@
                         IRemoteCallback remoteCallback) throws RemoteException {
                     Objects.requireNonNull(storageService);
                     mRemoteStorageService = storageService;
-                    remoteCallback.sendResult(
-                            Bundle.EMPTY); //to notify caller uid to system-server.
+                    remoteCallback.sendResult(Bundle.EMPTY);
                 }
 
                 @Override
@@ -178,34 +285,42 @@
                         ITokenInfoCallback tokenInfoCallback) {
                     Objects.requireNonNull(feature);
                     Objects.requireNonNull(tokenInfoCallback);
-                    ICancellationSignal transport = null;
+                    CancellationSignal cancellationSignal = new CancellationSignal();
                     if (cancellationSignalFuture != null) {
-                        transport = CancellationSignal.createTransport();
+                        ICancellationSignal transport = new ICancellationSignal.Stub() {
+                            @Override
+                            public void cancel() {
+                                cancellationSignal.cancel();
+                            }
+                        };
                         cancellationSignalFuture.complete(transport);
                     }
 
-                    mHandler.executeOrSendMessage(
-                            obtainMessage(
-                                    OnDeviceSandboxedInferenceService::onTokenInfoRequest,
-                                    OnDeviceSandboxedInferenceService.this,
-                                    callerUid, feature,
-                                    request,
-                                    CancellationSignal.fromTransport(transport),
+                    Message msg = Message.obtain(mHandler, MSG_TOKEN_INFO_REQUEST,
+                            callerUid, 0,
+                            new TokenInfoParams(feature, request,
+                                    cancellationSignalFuture != null ? cancellationSignal : null,
                                     wrapTokenInfoCallback(tokenInfoCallback)));
+                    mHandler.sendMessage(msg);
                 }
 
                 @Override
-                public void processRequestStreaming(int callerUid, Feature feature, Bundle request,
-                        int requestType,
+                public void processRequestStreaming(int callerUid, Feature feature,
+                        Bundle request, int requestType,
                         AndroidFuture cancellationSignalFuture,
                         AndroidFuture processingSignalFuture,
                         IStreamingResponseCallback callback) {
                     Objects.requireNonNull(feature);
                     Objects.requireNonNull(callback);
 
-                    ICancellationSignal transport = null;
+                    CancellationSignal cancellationSignal = new CancellationSignal();
                     if (cancellationSignalFuture != null) {
-                        transport = CancellationSignal.createTransport();
+                        ICancellationSignal transport = new ICancellationSignal.Stub() {
+                            @Override
+                            public void cancel() {
+                                cancellationSignal.cancel();
+                            }
+                        };
                         cancellationSignalFuture.complete(transport);
                     }
                     IProcessingSignal processingSignalTransport = null;
@@ -214,30 +329,32 @@
                         processingSignalFuture.complete(processingSignalTransport);
                     }
 
-
-                    mHandler.executeOrSendMessage(
-                            obtainMessage(
-                                    OnDeviceSandboxedInferenceService::onProcessRequestStreaming,
-                                    OnDeviceSandboxedInferenceService.this, callerUid,
-                                    feature,
-                                    request,
-                                    requestType,
-                                    CancellationSignal.fromTransport(transport),
+                    Message msg = Message.obtain(mHandler, MSG_PROCESS_REQUEST_STREAMING,
+                            callerUid, requestType,
+                            new StreamingRequestParams(feature, request,
+                                    cancellationSignalFuture != null ? cancellationSignal : null,
                                     ProcessingSignal.fromTransport(processingSignalTransport),
                                     wrapStreamingResponseCallback(callback)));
+                    mHandler.sendMessage(msg);
                 }
 
                 @Override
-                public void processRequest(int callerUid, Feature feature, Bundle request,
-                        int requestType,
+                public void processRequest(int callerUid, Feature feature,
+                        Bundle request, int requestType,
                         AndroidFuture cancellationSignalFuture,
                         AndroidFuture processingSignalFuture,
                         IResponseCallback callback) {
                     Objects.requireNonNull(feature);
                     Objects.requireNonNull(callback);
-                    ICancellationSignal transport = null;
+
+                    CancellationSignal cancellationSignal = new CancellationSignal();
                     if (cancellationSignalFuture != null) {
-                        transport = CancellationSignal.createTransport();
+                        ICancellationSignal transport = new ICancellationSignal.Stub() {
+                            @Override
+                            public void cancel() {
+                                cancellationSignal.cancel();
+                            }
+                        };
                         cancellationSignalFuture.complete(transport);
                     }
                     IProcessingSignal processingSignalTransport = null;
@@ -245,14 +362,14 @@
                         processingSignalTransport = ProcessingSignal.createTransport();
                         processingSignalFuture.complete(processingSignalTransport);
                     }
-                    mHandler.executeOrSendMessage(
-                            obtainMessage(
-                                    OnDeviceSandboxedInferenceService::onProcessRequest,
-                                    OnDeviceSandboxedInferenceService.this, callerUid, feature,
-                                    request, requestType,
-                                    CancellationSignal.fromTransport(transport),
+
+                    Message msg = Message.obtain(mHandler, MSG_PROCESS_REQUEST,
+                            callerUid, requestType,
+                            new RequestParams(feature, request,
+                                    cancellationSignalFuture != null ? cancellationSignal : null,
                                     ProcessingSignal.fromTransport(processingSignalTransport),
                                     wrapResponseCallback(callback)));
+                    mHandler.sendMessage(msg);
                 }
 
                 @Override
@@ -260,11 +377,11 @@
                         IProcessingUpdateStatusCallback callback) {
                     Objects.requireNonNull(processingState);
                     Objects.requireNonNull(callback);
-                    mHandler.executeOrSendMessage(
-                            obtainMessage(
-                                    OnDeviceSandboxedInferenceService::onUpdateProcessingState,
-                                    OnDeviceSandboxedInferenceService.this, processingState,
+
+                    Message msg = Message.obtain(mHandler, MSG_UPDATE_PROCESSING_STATE,
+                            new UpdateStateParams(processingState,
                                     wrapOutcomeReceiver(callback)));
+                    mHandler.sendMessage(msg);
                 }
             };
         }
@@ -471,7 +588,7 @@
             IResponseCallback callback) {
         return new ProcessingCallback() {
             @Override
-            public void onResult(@androidx.annotation.NonNull Bundle result) {
+            public void onResult(@NonNull Bundle result) {
                 try {
                     callback.onSuccess(result);
                 } catch (RemoteException e) {
@@ -507,7 +624,7 @@
             IStreamingResponseCallback callback) {
         return new StreamingProcessingCallback() {
             @Override
-            public void onPartialResult(@androidx.annotation.NonNull Bundle partialResult) {
+            public void onPartialResult(@NonNull Bundle partialResult) {
                 try {
                     callback.onNewContent(partialResult);
                 } catch (RemoteException e) {
@@ -516,7 +633,7 @@
             }
 
             @Override
-            public void onResult(@androidx.annotation.NonNull Bundle result) {
+            public void onResult(@NonNull Bundle result) {
                 try {
                     callback.onSuccess(result);
                 } catch (RemoteException e) {
@@ -549,7 +666,7 @@
     }
 
     private RemoteCallback wrapRemoteCallback(
-            @androidx.annotation.NonNull Consumer<Bundle> contentCallback) {
+            @NonNull Consumer<Bundle> contentCallback) {
         return new RemoteCallback(
                 result -> {
                     if (result != null) {
@@ -604,7 +721,7 @@
 
             @Override
             public void onError(
-                    @androidx.annotation.NonNull OnDeviceIntelligenceException error) {
+                    @NonNull OnDeviceIntelligenceException error) {
                 try {
                     callback.onFailure(error.getErrorCode(), error.getMessage());
                 } catch (RemoteException e) {
diff --git a/packages/NeuralNetworks/service/Android.bp b/packages/NeuralNetworks/service/Android.bp
new file mode 100644
index 0000000..05c603f
--- /dev/null
+++ b/packages/NeuralNetworks/service/Android.bp
@@ -0,0 +1,29 @@
+// 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 {
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
+filegroup {
+    name: "service-ondeviceintelligence-sources",
+    srcs: [
+        "java/**/*.java",
+    ],
+    path: "java",
+    visibility: [
+        "//frameworks/base:__subpackages__",
+        "//packages/modules/NeuralNetworks:__subpackages__",
+    ],
+}
diff --git a/services/core/java/com/android/server/ondeviceintelligence/BundleUtil.java b/packages/NeuralNetworks/service/java/com/android/server/ondeviceintelligence/BundleUtil.java
similarity index 94%
rename from services/core/java/com/android/server/ondeviceintelligence/BundleUtil.java
rename to packages/NeuralNetworks/service/java/com/android/server/ondeviceintelligence/BundleUtil.java
index 7dd8f2f..2626cc8 100644
--- a/services/core/java/com/android/server/ondeviceintelligence/BundleUtil.java
+++ b/packages/NeuralNetworks/service/java/com/android/server/ondeviceintelligence/BundleUtil.java
@@ -21,6 +21,7 @@
 import static android.system.OsConstants.O_RDONLY;
 import static android.system.OsConstants.PROT_READ;
 
+import android.annotation.SuppressLint;
 import android.app.ondeviceintelligence.IResponseCallback;
 import android.app.ondeviceintelligence.IStreamingResponseCallback;
 import android.app.ondeviceintelligence.ITokenInfoCallback;
@@ -42,7 +43,7 @@
 import android.system.Os;
 import android.util.Log;
 
-import com.android.internal.infra.AndroidFuture;
+import com.android.modules.utils.AndroidFuture;
 
 import java.util.concurrent.Executor;
 import java.util.concurrent.TimeoutException;
@@ -50,6 +51,8 @@
 /**
  * Util methods for ensuring the Bundle passed in various methods are read-only and restricted to
  * some known types.
+ *
+ * @hide
  */
 public class BundleUtil {
     private static final String TAG = "BundleUtil";
@@ -76,7 +79,7 @@
                  * {@link ClassNotFoundException} exception is swallowed and `null` is returned
                  * instead. We want to ensure cleanup of null entries in such case.
                  */
-                bundle.putObject(key, null);
+                bundle.putParcelable(key, null);
                 continue;
             }
             if (canMarshall(obj) || obj instanceof CursorWindow) {
@@ -122,7 +125,7 @@
                  * {@link ClassNotFoundException} exception is swallowed and `null` is returned
                  * instead. We want to ensure cleanup of null entries in such case.
                  */
-                bundle.putObject(key, null);
+                bundle.putParcelable(key, null);
                 continue;
             }
             if (canMarshall(obj)) {
@@ -167,7 +170,7 @@
                  * {@link ClassNotFoundException} exception is swallowed and `null` is returned
                  * instead. We want to ensure cleanup of null entries in such case.
                  */
-                bundle.putObject(key, null);
+                bundle.putParcelable(key, null);
                 continue;
             }
             if (canMarshall(obj)) {
@@ -317,11 +320,16 @@
         };
     }
 
-    private static boolean canMarshall(Object obj) {
-        return obj instanceof byte[] || obj instanceof PersistableBundle
-                || PersistableBundle.isValidType(obj);
+    private static boolean canMarshall(Object value) {
+        return (value instanceof byte[]) || (value instanceof Integer) || (value instanceof Long) ||
+                (value instanceof Double) || (value instanceof String) ||
+                (value instanceof int[]) || (value instanceof long[]) ||
+                (value instanceof double[]) || (value instanceof String[]) ||
+                (value instanceof PersistableBundle) || (value == null) ||
+                (value instanceof Boolean) || (value instanceof boolean[]);
     }
 
+    @SuppressLint("NewApi")
     private static void ensureValidBundle(Bundle bundle) {
         if (bundle == null) {
             throw new IllegalArgumentException("Request passed is expected to be non-null");
@@ -364,7 +372,7 @@
             }
         } catch (ErrnoException e) {
             throw new BadParcelableException(
-                    "Invalid File descriptor passed in the Bundle.", e);
+                    "Invalid File descriptor passed in the Bundle.");
         }
     }
 
diff --git a/services/core/java/com/android/server/ondeviceintelligence/InferenceInfoStore.java b/packages/NeuralNetworks/service/java/com/android/server/ondeviceintelligence/InferenceInfoStore.java
similarity index 99%
rename from services/core/java/com/android/server/ondeviceintelligence/InferenceInfoStore.java
rename to packages/NeuralNetworks/service/java/com/android/server/ondeviceintelligence/InferenceInfoStore.java
index bef3f80..e8a1b322 100644
--- a/services/core/java/com/android/server/ondeviceintelligence/InferenceInfoStore.java
+++ b/packages/NeuralNetworks/service/java/com/android/server/ondeviceintelligence/InferenceInfoStore.java
@@ -28,6 +28,9 @@
 import java.util.List;
 import java.util.TreeSet;
 
+/**
+ * @hide
+ */
 public class InferenceInfoStore {
     private static final String TAG = "InferenceInfoStore";
     private final TreeSet<InferenceInfo> inferenceInfos;
@@ -98,4 +101,4 @@
                 info.startTimeMs).setEndTimeMillis(info.endTimeMs).setSuspendedTimeMillis(
                 info.suspendedTimeMs).build();
     }
-}
\ No newline at end of file
+}
diff --git a/services/core/java/com/android/server/ondeviceintelligence/OnDeviceIntelligenceManagerInternal.java b/packages/NeuralNetworks/service/java/com/android/server/ondeviceintelligence/OnDeviceIntelligenceManagerLocal.java
similarity index 60%
rename from services/core/java/com/android/server/ondeviceintelligence/OnDeviceIntelligenceManagerInternal.java
rename to packages/NeuralNetworks/service/java/com/android/server/ondeviceintelligence/OnDeviceIntelligenceManagerLocal.java
index 1450dc0..6badc53 100644
--- a/services/core/java/com/android/server/ondeviceintelligence/OnDeviceIntelligenceManagerInternal.java
+++ b/packages/NeuralNetworks/service/java/com/android/server/ondeviceintelligence/OnDeviceIntelligenceManagerLocal.java
@@ -16,7 +16,21 @@
 
 package com.android.server.ondeviceintelligence;
 
-public interface OnDeviceIntelligenceManagerInternal {
+import static android.app.ondeviceintelligence.flags.Flags.FLAG_ENABLE_ON_DEVICE_INTELLIGENCE_MODULE;
+
+import android.annotation.FlaggedApi;
+import android.annotation.SystemApi;
+import android.annotation.SystemApi.Client;
+
+/**
+ * Exposes APIs to {@code system_server} components outside of the module boundaries.
+ * <p> This API should be access using {@link com.android.server.LocalManagerRegistry}. </p>
+ *
+ * @hide
+ */
+@SystemApi(client = Client.SYSTEM_SERVER)
+@FlaggedApi(FLAG_ENABLE_ON_DEVICE_INTELLIGENCE_MODULE)
+public interface OnDeviceIntelligenceManagerLocal {
     /**
      * Gets the uid for the process that is currently hosting the
      * {@link android.service.ondeviceintelligence.OnDeviceSandboxedInferenceService} registered on
diff --git a/services/core/java/com/android/server/ondeviceintelligence/OnDeviceIntelligenceManagerService.java b/packages/NeuralNetworks/service/java/com/android/server/ondeviceintelligence/OnDeviceIntelligenceManagerService.java
similarity index 84%
rename from services/core/java/com/android/server/ondeviceintelligence/OnDeviceIntelligenceManagerService.java
rename to packages/NeuralNetworks/service/java/com/android/server/ondeviceintelligence/OnDeviceIntelligenceManagerService.java
index b0d69e6..607ec1c 100644
--- a/services/core/java/com/android/server/ondeviceintelligence/OnDeviceIntelligenceManagerService.java
+++ b/packages/NeuralNetworks/service/java/com/android/server/ondeviceintelligence/OnDeviceIntelligenceManagerService.java
@@ -16,38 +16,42 @@
 
 package com.android.server.ondeviceintelligence;
 
+import static android.app.ondeviceintelligence.flags.Flags.enableOnDeviceIntelligenceModule;
+
+import static android.app.ondeviceintelligence.OnDeviceIntelligenceManager.ON_DEVICE_INTELLIGENCE_IDLE_TIMEOUT_MS;
 import static android.service.ondeviceintelligence.OnDeviceSandboxedInferenceService.DEVICE_CONFIG_UPDATE_BUNDLE_KEY;
-import static android.service.ondeviceintelligence.OnDeviceSandboxedInferenceService.MODEL_LOADED_BUNDLE_KEY;
-import static android.service.ondeviceintelligence.OnDeviceSandboxedInferenceService.MODEL_UNLOADED_BUNDLE_KEY;
 import static android.service.ondeviceintelligence.OnDeviceSandboxedInferenceService.MODEL_LOADED_BROADCAST_INTENT;
+import static android.service.ondeviceintelligence.OnDeviceSandboxedInferenceService.MODEL_LOADED_BUNDLE_KEY;
 import static android.service.ondeviceintelligence.OnDeviceSandboxedInferenceService.MODEL_UNLOADED_BROADCAST_INTENT;
+import static android.service.ondeviceintelligence.OnDeviceSandboxedInferenceService.MODEL_UNLOADED_BUNDLE_KEY;
 import static android.service.ondeviceintelligence.OnDeviceSandboxedInferenceService.REGISTER_MODEL_UPDATE_CALLBACK_BUNDLE_KEY;
 
 import static com.android.server.ondeviceintelligence.BundleUtil.sanitizeInferenceParams;
-import static com.android.server.ondeviceintelligence.BundleUtil.validatePfdReadOnly;
 import static com.android.server.ondeviceintelligence.BundleUtil.sanitizeStateParams;
+import static com.android.server.ondeviceintelligence.BundleUtil.validatePfdReadOnly;
 import static com.android.server.ondeviceintelligence.BundleUtil.wrapWithValidation;
 
-
 import android.Manifest;
 import android.annotation.NonNull;
 import android.annotation.Nullable;
 import android.annotation.RequiresPermission;
-import android.app.AppGlobals;
 import android.app.ondeviceintelligence.DownloadCallback;
 import android.app.ondeviceintelligence.Feature;
 import android.app.ondeviceintelligence.FeatureDetails;
+import android.app.ondeviceintelligence.ICancellationSignal;
 import android.app.ondeviceintelligence.IDownloadCallback;
 import android.app.ondeviceintelligence.IFeatureCallback;
 import android.app.ondeviceintelligence.IFeatureDetailsCallback;
 import android.app.ondeviceintelligence.IListFeaturesCallback;
 import android.app.ondeviceintelligence.IOnDeviceIntelligenceManager;
 import android.app.ondeviceintelligence.IProcessingSignal;
+import android.app.ondeviceintelligence.IRemoteCallback;
 import android.app.ondeviceintelligence.IResponseCallback;
 import android.app.ondeviceintelligence.IStreamingResponseCallback;
 import android.app.ondeviceintelligence.ITokenInfoCallback;
 import android.app.ondeviceintelligence.InferenceInfo;
 import android.app.ondeviceintelligence.OnDeviceIntelligenceException;
+import android.app.ondeviceintelligence.utils.BinderUtils;
 import android.content.ComponentName;
 import android.content.Context;
 import android.content.Intent;
@@ -58,16 +62,12 @@
 import android.os.Bundle;
 import android.os.Handler;
 import android.os.IBinder;
-import android.os.ICancellationSignal;
-import android.os.IRemoteCallback;
 import android.os.Looper;
 import android.os.Message;
 import android.os.ParcelFileDescriptor;
 import android.os.PersistableBundle;
 import android.os.RemoteCallback;
 import android.os.RemoteException;
-import android.os.ResultReceiver;
-import android.os.ShellCallback;
 import android.os.UserHandle;
 import android.provider.DeviceConfig;
 import android.provider.Settings;
@@ -82,17 +82,14 @@
 import android.util.Log;
 import android.util.Slog;
 
-import com.android.internal.R;
 import com.android.internal.annotations.GuardedBy;
-import com.android.internal.infra.AndroidFuture;
-import com.android.internal.infra.ServiceConnector;
-import com.android.internal.os.BackgroundThread;
-import com.android.server.LocalServices;
+import com.android.modules.utils.AndroidFuture;
+import com.android.modules.utils.BackgroundThread;
+import com.android.modules.utils.ServiceConnector;
+import com.android.server.LocalManagerRegistry;
 import com.android.server.SystemService;
-import com.android.server.SystemService.TargetUser;
 import com.android.server.ondeviceintelligence.callbacks.ListenableDownloadCallback;
 
-import java.io.FileDescriptor;
 import java.io.IOException;
 import java.util.List;
 import java.util.Objects;
@@ -182,9 +179,11 @@
     public void onStart() {
         publishBinderService(
                 Context.ON_DEVICE_INTELLIGENCE_SERVICE, getOnDeviceIntelligenceManagerService(),
-                /* allowIsolated = */true);
-        LocalServices.addService(OnDeviceIntelligenceManagerInternal.class,
-                this::getRemoteInferenceServiceUid);
+                /* allowIsolated = */ true);
+        if (enableOnDeviceIntelligenceModule()) {
+            LocalManagerRegistry.addManager(OnDeviceIntelligenceManagerLocal.class,
+                    this::getRemoteInferenceServiceUid);
+        }
     }
 
     @Override
@@ -203,10 +202,10 @@
     public void onUserUnlocked(@NonNull TargetUser user) {
         Slog.d(TAG, "onUserUnlocked: " + user.getUserHandle());
         //connect to remote services(if available) during boot.
-        if(user.getUserHandle().equals(UserHandle.SYSTEM)) {
+        if (user.getUserHandle().equals(UserHandle.SYSTEM)) {
             try {
-                ensureRemoteInferenceServiceInitialized();
-                ensureRemoteIntelligenceServiceInitialized();
+                ensureRemoteInferenceServiceInitialized(/* throwServiceIfInvalid */ false);
+                ensureRemoteIntelligenceServiceInitialized(/* throwServiceIfInvalid */ false);
             } catch (Exception e) {
                 Slog.w(TAG, "Couldn't pre-start remote ondeviceintelligence services.", e);
             }
@@ -251,7 +250,7 @@
                     remoteCallback.sendResult(null);
                     return;
                 }
-                ensureRemoteIntelligenceServiceInitialized();
+                ensureRemoteIntelligenceServiceInitialized(/* throwServiceIfInvalid */ true);
                 mRemoteOnDeviceIntelligenceService.postAsync(
                         service -> {
                             AndroidFuture future = new AndroidFuture();
@@ -279,7 +278,7 @@
                             PersistableBundle.EMPTY);
                     return;
                 }
-                ensureRemoteIntelligenceServiceInitialized();
+                ensureRemoteIntelligenceServiceInitialized(/* throwServiceIfInvalid */ true);
                 int callerUid = Binder.getCallingUid();
                 mRemoteOnDeviceIntelligenceService.postAsync(
                         service -> {
@@ -317,7 +316,7 @@
                             PersistableBundle.EMPTY);
                     return;
                 }
-                ensureRemoteIntelligenceServiceInitialized();
+                ensureRemoteIntelligenceServiceInitialized(/* throwServiceIfInvalid */ true);
                 int callerUid = Binder.getCallingUid();
                 mRemoteOnDeviceIntelligenceService.postAsync(
                         service -> {
@@ -361,7 +360,7 @@
                             PersistableBundle.EMPTY);
                     return;
                 }
-                ensureRemoteIntelligenceServiceInitialized();
+                ensureRemoteIntelligenceServiceInitialized(/* throwServiceIfInvalid */ true);
                 int callerUid = Binder.getCallingUid();
                 mRemoteOnDeviceIntelligenceService.postAsync(
                         service -> {
@@ -404,7 +403,7 @@
                             "OnDeviceIntelligenceManagerService is unavailable",
                             PersistableBundle.EMPTY);
                 }
-                ensureRemoteIntelligenceServiceInitialized();
+                ensureRemoteIntelligenceServiceInitialized(/* throwServiceIfInvalid */ true);
                 int callerUid = Binder.getCallingUid();
                 mRemoteOnDeviceIntelligenceService.postAsync(
                         service -> {
@@ -444,7 +443,7 @@
                                 "OnDeviceIntelligenceManagerService is unavailable",
                                 PersistableBundle.EMPTY);
                     }
-                    ensureRemoteInferenceServiceInitialized();
+                    ensureRemoteInferenceServiceInitialized(/* throwServiceIfInvalid */ true);
                     int callerUid = Binder.getCallingUid();
                     result = mRemoteInferenceService.postAsync(
                             service -> {
@@ -488,7 +487,7 @@
                                 "OnDeviceIntelligenceManagerService is unavailable",
                                 PersistableBundle.EMPTY);
                     }
-                    ensureRemoteInferenceServiceInitialized();
+                    ensureRemoteInferenceServiceInitialized(/* throwServiceIfInvalid */ true);
                     int callerUid = Binder.getCallingUid();
                     result = mRemoteInferenceService.postAsync(
                             service -> {
@@ -534,7 +533,7 @@
                                 "OnDeviceIntelligenceManagerService is unavailable",
                                 PersistableBundle.EMPTY);
                     }
-                    ensureRemoteInferenceServiceInitialized();
+                    ensureRemoteInferenceServiceInitialized(/* throwServiceIfInvalid */ true);
                     int callerUid = Binder.getCallingUid();
                     result = mRemoteInferenceService.postAsync(
                             service -> {
@@ -559,20 +558,31 @@
             }
 
             @Override
-            public void onShellCommand(FileDescriptor in, FileDescriptor out, FileDescriptor err,
-                    String[] args, ShellCallback callback, ResultReceiver resultReceiver) {
-                new OnDeviceIntelligenceShellCommand(OnDeviceIntelligenceManagerService.this).exec(
-                        this, in, out, err, args, callback, resultReceiver);
+            public int handleShellCommand(@NonNull ParcelFileDescriptor in,
+                    @NonNull ParcelFileDescriptor out, @NonNull ParcelFileDescriptor err,
+                    @NonNull String[] args) {
+                return new com.android.server.ondeviceintelligence.OnDeviceIntelligenceShellCommand(
+                        OnDeviceIntelligenceManagerService.this).exec(
+                        this,
+                        in.getFileDescriptor(),
+                        out.getFileDescriptor(),
+                        err.getFileDescriptor(),
+                        args);
             }
         };
     }
 
-    private void ensureRemoteIntelligenceServiceInitialized() {
+    private boolean ensureRemoteIntelligenceServiceInitialized(boolean throwIfServiceInvalid) {
         synchronized (mLock) {
             if (mRemoteOnDeviceIntelligenceService == null) {
                 String serviceName = getServiceNames()[0];
-                Binder.withCleanCallingIdentity(() -> validateServiceElevated(serviceName, false));
-                mRemoteOnDeviceIntelligenceService = new RemoteOnDeviceIntelligenceService(mContext,
+                if (!BinderUtils.withCleanCallingIdentity(
+                        () -> validateServiceElevated(serviceName, false,
+                                throwIfServiceInvalid))) {
+                    return false;
+                }
+                mRemoteOnDeviceIntelligenceService = new RemoteOnDeviceIntelligenceService(
+                        mContext,
                         ComponentName.unflattenFromString(serviceName),
                         UserHandle.SYSTEM.getIdentifier());
                 mRemoteOnDeviceIntelligenceService.setServiceLifecycleCallbacks(
@@ -591,6 +601,7 @@
                         });
             }
         }
+        return true;
     }
 
     @NonNull
@@ -604,13 +615,21 @@
                     AndroidFuture<Void> result = null;
                     try {
                         sanitizeStateParams(processingState);
-                        ensureRemoteInferenceServiceInitialized();
-                        result = mRemoteInferenceService.post(
-                                service -> service.updateProcessingState(
-                                        processingState, callback));
-                        result.whenCompleteAsync(
-                                (c, e) -> BundleUtil.tryCloseResource(processingState),
-                                resourceClosingExecutor);
+                        if (ensureRemoteInferenceServiceInitialized(/* throwServiceIfInvalid */
+                                false)) {
+                            result = mRemoteInferenceService.post(
+                                    service -> service.updateProcessingState(
+                                            processingState, callback));
+                            result.whenCompleteAsync(
+                                    (c, e) -> BundleUtil.tryCloseResource(processingState),
+                                    resourceClosingExecutor);
+                        } else {
+                            callback.onFailure(
+                                    OnDeviceIntelligenceException.PROCESSING_ERROR_SERVICE_UNAVAILABLE,
+                                    "Remote service cannot be initialized.");
+                        }
+                    } catch (RemoteException e) {
+                        Slog.w("Failed to invoke updateProcessingState", e);
                     } finally {
                         if (result == null) {
                             resourceClosingExecutor.execute(
@@ -622,11 +641,14 @@
         };
     }
 
-    private void ensureRemoteInferenceServiceInitialized() {
+    private boolean ensureRemoteInferenceServiceInitialized(boolean throwIfServiceInvalid) {
         synchronized (mLock) {
             if (mRemoteInferenceService == null) {
                 String serviceName = getServiceNames()[1];
-                Binder.withCleanCallingIdentity(() -> validateServiceElevated(serviceName, true));
+                if (!BinderUtils.withCleanCallingIdentity(
+                        () -> validateServiceElevated(serviceName, true, throwIfServiceInvalid))) {
+                    return false;
+                }
                 mRemoteInferenceService = new RemoteOnDeviceSandboxedInferenceService(mContext,
                         ComponentName.unflattenFromString(serviceName),
                         UserHandle.SYSTEM.getIdentifier());
@@ -636,7 +658,11 @@
                             public void onConnected(
                                     @NonNull IOnDeviceSandboxedInferenceService service) {
                                 try {
-                                    ensureRemoteIntelligenceServiceInitialized();
+                                    if (!ensureRemoteIntelligenceServiceInitialized(
+                                            /* throwServiceIfInvalid */
+                                            false)) {
+                                        return;
+                                    }
                                     service.registerRemoteStorageService(
                                             getIRemoteStorageService(), new IRemoteCallback.Stub() {
                                                 @Override
@@ -659,20 +685,29 @@
                             @Override
                             public void onDisconnected(
                                     @NonNull IOnDeviceSandboxedInferenceService service) {
-                                ensureRemoteIntelligenceServiceInitialized();
+                                if (!ensureRemoteIntelligenceServiceInitialized(
+                                        /* throwServiceIfInvalid */
+                                        false)) {
+                                    return;
+                                }
                                 mRemoteOnDeviceIntelligenceService.run(
                                         IOnDeviceIntelligenceService::notifyInferenceServiceDisconnected);
                             }
 
                             @Override
                             public void onBinderDied() {
-                                ensureRemoteIntelligenceServiceInitialized();
+                                if (!ensureRemoteIntelligenceServiceInitialized(
+                                        /* throwServiceIfInvalid */
+                                        false)) {
+                                    return;
+                                }
                                 mRemoteOnDeviceIntelligenceService.run(
                                         IOnDeviceIntelligenceService::notifyInferenceServiceDisconnected);
                             }
                         });
             }
         }
+        return true;
     }
 
     private void registerModelLoadingBroadcasts(IOnDeviceSandboxedInferenceService service) {
@@ -743,9 +778,13 @@
             if (mTemporaryConfigNamespace != null) {
                 return mTemporaryConfigNamespace;
             }
-
-            return mContext.getResources().getString(
-                    R.string.config_defaultOnDeviceIntelligenceDeviceConfigNamespace);
+            return mContext.getResources()
+                    .getString(
+                            mContext.getResources()
+                                    .getIdentifier(
+                                            "config_defaultOnDeviceIntelligenceDeviceConfigNamespace",
+                                            "string",
+                                            "android"));
         }
     }
 
@@ -759,7 +798,11 @@
         }
         Bundle bundle = new Bundle();
         bundle.putParcelable(DEVICE_CONFIG_UPDATE_BUNDLE_KEY, persistableBundle);
-        ensureRemoteInferenceServiceInitialized();
+        if (!ensureRemoteIntelligenceServiceInitialized(
+                /* throwServiceIfInvalid */
+                false)) {
+            return;
+        }
         mRemoteInferenceService.run(service -> service.updateProcessingState(bundle,
                 new IProcessingUpdateStatusCallback.Stub() {
                     @Override
@@ -782,7 +825,13 @@
             public void getReadOnlyFileDescriptor(
                     String filePath,
                     AndroidFuture<ParcelFileDescriptor> future) {
-                ensureRemoteIntelligenceServiceInitialized();
+                if (!ensureRemoteIntelligenceServiceInitialized(
+                        /* throwServiceIfInvalid */
+                        false)) {
+                    future.completeExceptionally(new OnDeviceIntelligenceException(
+                            OnDeviceIntelligenceException.PROCESSING_ERROR_NOT_AVAILABLE));
+                    return;
+                }
                 AndroidFuture<ParcelFileDescriptor> pfdFuture = new AndroidFuture<>();
                 mRemoteOnDeviceIntelligenceService.run(
                         service -> service.getReadOnlyFileDescriptor(
@@ -805,7 +854,7 @@
             public void getReadOnlyFeatureFileDescriptorMap(
                     Feature feature,
                     RemoteCallback remoteCallback) {
-                ensureRemoteIntelligenceServiceInitialized();
+                ensureRemoteIntelligenceServiceInitialized(/* throwServiceIfInvalid */ true);
                 mRemoteOnDeviceIntelligenceService.run(
                         service -> service.getReadOnlyFeatureFileDescriptorMap(
                                 feature,
@@ -829,40 +878,48 @@
         };
     }
 
-    private void validateServiceElevated(String serviceName, boolean checkIsolated) {
+    private boolean validateServiceElevated(String serviceName, boolean checkIsolated,
+            boolean throwIfServiceInvalid) {
         try {
             if (TextUtils.isEmpty(serviceName)) {
-                throw new IllegalStateException(
-                        "Remote service is not configured to complete the request");
+                if (throwIfServiceInvalid) {
+                    throw new IllegalStateException(
+                            "Remote service is not configured to complete the request");
+                }
+                return false;
             }
             ComponentName serviceComponent = ComponentName.unflattenFromString(
                     serviceName);
-            ServiceInfo serviceInfo = AppGlobals.getPackageManager().getServiceInfo(
+            ServiceInfo serviceInfo = mContext.getPackageManager().getServiceInfo(
                     serviceComponent,
                     PackageManager.MATCH_DIRECT_BOOT_AWARE
-                            | PackageManager.MATCH_DIRECT_BOOT_UNAWARE,
-                    UserHandle.SYSTEM.getIdentifier());
-            if (serviceInfo != null) {
-                if (!checkIsolated) {
-                    checkServiceRequiresPermission(serviceInfo,
-                            Manifest.permission.BIND_ON_DEVICE_INTELLIGENCE_SERVICE);
-                    return;
-                }
-
+                            | PackageManager.MATCH_DIRECT_BOOT_UNAWARE);
+            if (!checkIsolated) {
                 checkServiceRequiresPermission(serviceInfo,
-                        Manifest.permission.BIND_ON_DEVICE_SANDBOXED_INFERENCE_SERVICE);
-                if (!isIsolatedService(serviceInfo)) {
-                    throw new SecurityException(
-                            "Call required an isolated service, but the configured service: "
-                                    + serviceName + ", is not isolated");
-                }
-            } else {
+                        Manifest.permission.BIND_ON_DEVICE_INTELLIGENCE_SERVICE);
+                return true;
+            }
+
+            checkServiceRequiresPermission(serviceInfo,
+                    Manifest.permission.BIND_ON_DEVICE_SANDBOXED_INFERENCE_SERVICE);
+            if (!isIsolatedService(serviceInfo)) {
+                throw new SecurityException(
+                        "Call required an isolated service, but the configured service: "
+                                + serviceName + ", is not isolated");
+            }
+        } catch (PackageManager.NameNotFoundException e) {
+            if (throwIfServiceInvalid) {
                 throw new IllegalStateException(
                         "Remote service is not configured to complete the request.");
             }
-        } catch (RemoteException e) {
-            throw new IllegalStateException("Could not fetch service info for remote services", e);
+            return false;
+        } catch (SecurityException e) {
+            if (throwIfServiceInvalid) {
+                throw e;
+            }
+            return false;
         }
+        return true;
     }
 
     private static void checkServiceRequiresPermission(ServiceInfo serviceInfo,
@@ -870,8 +927,8 @@
         final String permission = serviceInfo.permission;
         if (!requiredPermission.equals(permission)) {
             throw new SecurityException(String.format(
-                    "Service %s requires %s permission. Found %s permission",
-                    serviceInfo.getComponentName(),
+                    "%s requires %s permission. Found %s permission",
+                    serviceInfo,
                     requiredPermission,
                     serviceInfo.permission));
         }
@@ -909,10 +966,22 @@
                 return mTemporaryServiceNames;
             }
         }
-        return new String[]{mContext.getResources().getString(
-                R.string.config_defaultOnDeviceIntelligenceService),
-                mContext.getResources().getString(
-                        R.string.config_defaultOnDeviceSandboxedInferenceService)};
+        return new String[]{
+                mContext.getResources()
+                        .getString(
+                        mContext.getResources()
+                                .getIdentifier(
+                                        "config_defaultOnDeviceIntelligenceService",
+                                        "string",
+                                        "android")),
+                mContext.getResources()
+                        .getString(
+                        mContext.getResources()
+                                .getIdentifier(
+                                        "config_defaultOnDeviceSandboxedInferenceService",
+                                        "string",
+                                        "android"))
+        };
     }
 
     protected String[] getBroadcastKeys() throws Resources.NotFoundException {
@@ -923,7 +992,7 @@
             }
         }
 
-        return new String[]{ MODEL_LOADED_BROADCAST_INTENT, MODEL_UNLOADED_BROADCAST_INTENT };
+        return new String[]{MODEL_LOADED_BROADCAST_INTENT, MODEL_UNLOADED_BROADCAST_INTENT};
     }
 
     @RequiresPermission(Manifest.permission.USE_ON_DEVICE_INTELLIGENCE)
@@ -1068,7 +1137,7 @@
 
     private synchronized Handler getTemporaryHandler() {
         if (mTemporaryHandler == null) {
-            mTemporaryHandler = new Handler(Looper.getMainLooper(), null, true) {
+            mTemporaryHandler = new Handler(Looper.getMainLooper()) {
                 @Override
                 public void handleMessage(Message msg) {
                     synchronized (mLock) {
@@ -1090,10 +1159,13 @@
         return mTemporaryHandler;
     }
 
+    // Using #getLong here as the timeout settings are only applicable to the services running in
+    // SYSTEM user only.
+    @SuppressWarnings("NonUserGetterCalled")
     private long getIdleTimeoutMs() {
-        return Settings.Secure.getLongForUser(mContext.getContentResolver(),
-                Settings.Secure.ON_DEVICE_INTELLIGENCE_IDLE_TIMEOUT_MS, TimeUnit.HOURS.toMillis(1),
-                mContext.getUserId());
+        return Settings.Secure.getLong(mContext.getContentResolver(),
+                ON_DEVICE_INTELLIGENCE_IDLE_TIMEOUT_MS,
+                TimeUnit.HOURS.toMillis(1));
     }
 
     private int getRemoteInferenceServiceUid() {
diff --git a/services/core/java/com/android/server/ondeviceintelligence/OnDeviceIntelligenceShellCommand.java b/packages/NeuralNetworks/service/java/com/android/server/ondeviceintelligence/OnDeviceIntelligenceShellCommand.java
similarity index 97%
rename from services/core/java/com/android/server/ondeviceintelligence/OnDeviceIntelligenceShellCommand.java
rename to packages/NeuralNetworks/service/java/com/android/server/ondeviceintelligence/OnDeviceIntelligenceShellCommand.java
index d2c84fa..c641de8 100644
--- a/services/core/java/com/android/server/ondeviceintelligence/OnDeviceIntelligenceShellCommand.java
+++ b/packages/NeuralNetworks/service/java/com/android/server/ondeviceintelligence/OnDeviceIntelligenceShellCommand.java
@@ -18,12 +18,16 @@
 
 import android.annotation.NonNull;
 import android.os.Binder;
-import android.os.ShellCommand;
+
+import com.android.modules.utils.BasicShellCommandHandler;
 
 import java.io.PrintWriter;
 import java.util.Objects;
 
-final class OnDeviceIntelligenceShellCommand extends ShellCommand {
+/**
+ * @hide
+ */
+final class OnDeviceIntelligenceShellCommand extends BasicShellCommandHandler {
     private static final String TAG = OnDeviceIntelligenceShellCommand.class.getSimpleName();
 
     @NonNull
diff --git a/services/core/java/com/android/server/ondeviceintelligence/RemoteOnDeviceIntelligenceService.java b/packages/NeuralNetworks/service/java/com/android/server/ondeviceintelligence/RemoteOnDeviceIntelligenceService.java
similarity index 80%
rename from services/core/java/com/android/server/ondeviceintelligence/RemoteOnDeviceIntelligenceService.java
rename to packages/NeuralNetworks/service/java/com/android/server/ondeviceintelligence/RemoteOnDeviceIntelligenceService.java
index ac9747a..0c43a30 100644
--- a/services/core/java/com/android/server/ondeviceintelligence/RemoteOnDeviceIntelligenceService.java
+++ b/packages/NeuralNetworks/service/java/com/android/server/ondeviceintelligence/RemoteOnDeviceIntelligenceService.java
@@ -16,6 +16,7 @@
 
 package com.android.server.ondeviceintelligence;
 
+import static android.app.ondeviceintelligence.OnDeviceIntelligenceManager.ON_DEVICE_INTELLIGENCE_UNBIND_TIMEOUT_MS;
 import static android.content.Context.BIND_FOREGROUND_SERVICE;
 import static android.content.Context.BIND_INCLUDE_CAPABILITIES;
 
@@ -26,13 +27,15 @@
 import android.service.ondeviceintelligence.IOnDeviceIntelligenceService;
 import android.service.ondeviceintelligence.OnDeviceIntelligenceService;
 
-import com.android.internal.infra.ServiceConnector;
+import com.android.modules.utils.ServiceConnector;
 
 import java.util.concurrent.TimeUnit;
 
 /**
  * Manages the connection to the remote on-device intelligence service. Also, handles unbinding
  * logic set by the service implementation via a Secure Settings flag.
+ *
+ * @hide
  */
 public class RemoteOnDeviceIntelligenceService extends
         ServiceConnector.Impl<IOnDeviceIntelligenceService> {
@@ -56,11 +59,13 @@
         return LONG_TIMEOUT;
     }
 
+    // Using #getLong here as the timeout settings are only applicable to the services running in
+    // SYSTEM user only.
     @Override
+    @SuppressWarnings("NonUserGetterCalled")
     protected long getAutoDisconnectTimeoutMs() {
-        return Settings.Secure.getLongForUser(mContext.getContentResolver(),
-                Settings.Secure.ON_DEVICE_INTELLIGENCE_UNBIND_TIMEOUT_MS,
-                TimeUnit.SECONDS.toMillis(30),
-                mContext.getUserId());
+        return Settings.Secure.getLong(mContext.getContentResolver(),
+                ON_DEVICE_INTELLIGENCE_UNBIND_TIMEOUT_MS,
+                TimeUnit.SECONDS.toMillis(30));
     }
 }
diff --git a/services/core/java/com/android/server/ondeviceintelligence/RemoteOnDeviceSandboxedInferenceService.java b/packages/NeuralNetworks/service/java/com/android/server/ondeviceintelligence/RemoteOnDeviceSandboxedInferenceService.java
similarity index 82%
rename from services/core/java/com/android/server/ondeviceintelligence/RemoteOnDeviceSandboxedInferenceService.java
rename to packages/NeuralNetworks/service/java/com/android/server/ondeviceintelligence/RemoteOnDeviceSandboxedInferenceService.java
index 18b1383..8c5d5a7 100644
--- a/services/core/java/com/android/server/ondeviceintelligence/RemoteOnDeviceSandboxedInferenceService.java
+++ b/packages/NeuralNetworks/service/java/com/android/server/ondeviceintelligence/RemoteOnDeviceSandboxedInferenceService.java
@@ -16,6 +16,7 @@
 
 package com.android.server.ondeviceintelligence;
 
+import static android.app.ondeviceintelligence.OnDeviceIntelligenceManager.ON_DEVICE_INFERENCE_UNBIND_TIMEOUT_MS;
 import static android.content.Context.BIND_FOREGROUND_SERVICE;
 import static android.content.Context.BIND_INCLUDE_CAPABILITIES;
 
@@ -26,7 +27,7 @@
 import android.service.ondeviceintelligence.IOnDeviceSandboxedInferenceService;
 import android.service.ondeviceintelligence.OnDeviceSandboxedInferenceService;
 
-import com.android.internal.infra.ServiceConnector;
+import com.android.modules.utils.ServiceConnector;
 
 import java.util.concurrent.TimeUnit;
 
@@ -35,6 +36,8 @@
  * Manages the connection to the remote on-device sand boxed inference service. Also, handles
  * unbinding
  * logic set by the service implementation via a SecureSettings flag.
+ *
+ * @hide
  */
 public class RemoteOnDeviceSandboxedInferenceService extends
         ServiceConnector.Impl<IOnDeviceSandboxedInferenceService> {
@@ -65,12 +68,13 @@
         return LONG_TIMEOUT;
     }
 
-
+    // Using #getLong here as the timeout settings are only applicable to the services running in
+    // SYSTEM user only.
     @Override
+    @SuppressWarnings("NonUserGetterCalled")
     protected long getAutoDisconnectTimeoutMs() {
-        return Settings.Secure.getLongForUser(mContext.getContentResolver(),
-                Settings.Secure.ON_DEVICE_INFERENCE_UNBIND_TIMEOUT_MS,
-                TimeUnit.SECONDS.toMillis(30),
-                mContext.getUserId());
+        return Settings.Secure.getLong(mContext.getContentResolver(),
+                ON_DEVICE_INFERENCE_UNBIND_TIMEOUT_MS,
+                TimeUnit.SECONDS.toMillis(30));
     }
 }
diff --git a/services/core/java/com/android/server/ondeviceintelligence/callbacks/ListenableDownloadCallback.java b/packages/NeuralNetworks/service/java/com/android/server/ondeviceintelligence/callbacks/ListenableDownloadCallback.java
similarity index 98%
rename from services/core/java/com/android/server/ondeviceintelligence/callbacks/ListenableDownloadCallback.java
rename to packages/NeuralNetworks/service/java/com/android/server/ondeviceintelligence/callbacks/ListenableDownloadCallback.java
index 32f0698..249bcd3 100644
--- a/services/core/java/com/android/server/ondeviceintelligence/callbacks/ListenableDownloadCallback.java
+++ b/packages/NeuralNetworks/service/java/com/android/server/ondeviceintelligence/callbacks/ListenableDownloadCallback.java
@@ -21,7 +21,7 @@
 import android.os.PersistableBundle;
 import android.os.RemoteException;
 
-import com.android.internal.infra.AndroidFuture;
+import com.android.modules.utils.AndroidFuture;
 
 import java.util.concurrent.TimeoutException;
 
@@ -32,6 +32,8 @@
  * some cases. Instead, in such cases we rely on the remote service sending progress updates and if
  * there are *no* progress callbacks in the duration of {@link #idleTimeoutMs}, we can assume the
  * download will not complete and enabling faster cleanup.
+ *
+ * @hide
  */
 public class ListenableDownloadCallback extends IDownloadCallback.Stub implements Runnable {
     private final IDownloadCallback callback;
diff --git a/packages/PackageInstaller/TEST_MAPPING b/packages/PackageInstaller/TEST_MAPPING
index 50db501..5033101 100644
--- a/packages/PackageInstaller/TEST_MAPPING
+++ b/packages/PackageInstaller/TEST_MAPPING
@@ -45,6 +45,17 @@
       ]
     },
     {
+      "name": "CtsPackageInstallerCUJUpdateOwnerShipTestCases",
+      "options":[
+        {
+          "exclude-annotation":"androidx.test.filters.FlakyTest"
+        },
+        {
+          "exclude-annotation":"org.junit.Ignore"
+        }
+      ]
+    },
+    {
       "name": "CtsPackageInstallerCUJUpdateSelfTestCases",
       "options":[
         {
diff --git a/packages/SettingsLib/aconfig/settingslib.aconfig b/packages/SettingsLib/aconfig/settingslib.aconfig
index c1f254a..1a043d5 100644
--- a/packages/SettingsLib/aconfig/settingslib.aconfig
+++ b/packages/SettingsLib/aconfig/settingslib.aconfig
@@ -187,3 +187,13 @@
     description: "Enable the connection status report for a set of hearing device."
     bug: "357882387"
 }
+
+flag {
+    name: "ignore_a2dp_disconnection_for_android_auto"
+    namespace: "cross_device_experiences"
+    description: "Do not show problem connecting message when Android Auto disconnect A2DP"
+    bug: "381981752"
+    metadata {
+        purpose: PURPOSE_BUGFIX
+    }
+}
diff --git a/packages/SettingsLib/src/com/android/settingslib/bluetooth/BluetoothUtils.java b/packages/SettingsLib/src/com/android/settingslib/bluetooth/BluetoothUtils.java
index 216574a..429e4c9 100644
--- a/packages/SettingsLib/src/com/android/settingslib/bluetooth/BluetoothUtils.java
+++ b/packages/SettingsLib/src/com/android/settingslib/bluetooth/BluetoothUtils.java
@@ -631,15 +631,15 @@
                 assistantProfile.getAllConnectedDevices().stream()
                         .map(deviceManager::findDevice)
                         .filter(Objects::nonNull)
-                        .map(CachedBluetoothDevice::getGroupId)
+                        .map(BluetoothUtils::getGroupId)
                         .collect(Collectors.toSet());
         Set<Integer> activeGroupIds =
                 leAudioProfile.getActiveDevices().stream()
                         .map(deviceManager::findDevice)
                         .filter(Objects::nonNull)
-                        .map(CachedBluetoothDevice::getGroupId)
+                        .map(BluetoothUtils::getGroupId)
                         .collect(Collectors.toSet());
-        int groupId = cachedDevice.getGroupId();
+        int groupId = getGroupId(cachedDevice);
         return activeGroupIds.size() == 1
                 && !activeGroupIds.contains(groupId)
                 && connectedGroupIds.size() == 2
diff --git a/packages/SettingsProvider/src/android/provider/settings/backup/SecureSettings.java b/packages/SettingsProvider/src/android/provider/settings/backup/SecureSettings.java
index 1f291cd..731cb72 100644
--- a/packages/SettingsProvider/src/android/provider/settings/backup/SecureSettings.java
+++ b/packages/SettingsProvider/src/android/provider/settings/backup/SecureSettings.java
@@ -99,6 +99,7 @@
         Settings.Secure.RTT_CALLING_MODE,
         Settings.Secure.INCALL_POWER_BUTTON_BEHAVIOR,
         Settings.Secure.MINIMAL_POST_PROCESSING_ALLOWED,
+        Settings.Secure.MIRROR_BUILT_IN_DISPLAY,
         Settings.Secure.MATCH_CONTENT_FRAME_RATE,
         Settings.Secure.NIGHT_DISPLAY_CUSTOM_START_TIME,
         Settings.Secure.NIGHT_DISPLAY_CUSTOM_END_TIME,
diff --git a/packages/SettingsProvider/src/android/provider/settings/validators/SecureSettingsValidators.java b/packages/SettingsProvider/src/android/provider/settings/validators/SecureSettingsValidators.java
index abd5b9a..039832c 100644
--- a/packages/SettingsProvider/src/android/provider/settings/validators/SecureSettingsValidators.java
+++ b/packages/SettingsProvider/src/android/provider/settings/validators/SecureSettingsValidators.java
@@ -150,6 +150,7 @@
                 Secure.INCALL_POWER_BUTTON_BEHAVIOR,
                 new DiscreteValueValidator(new String[] {"1", "2"}));
         VALIDATORS.put(Secure.MINIMAL_POST_PROCESSING_ALLOWED, BOOLEAN_VALIDATOR);
+        VALIDATORS.put(Secure.MIRROR_BUILT_IN_DISPLAY, BOOLEAN_VALIDATOR);
         VALIDATORS.put(
                 Secure.MATCH_CONTENT_FRAME_RATE,
                 new DiscreteValueValidator(new String[] {"0", "1", "2"}));
diff --git a/packages/SettingsProvider/src/com/android/providers/settings/EventLogTags.logtags b/packages/SettingsProvider/src/com/android/providers/settings/EventLogTags.logtags
index 7eff16b..0367fe0 100644
--- a/packages/SettingsProvider/src/com/android/providers/settings/EventLogTags.logtags
+++ b/packages/SettingsProvider/src/com/android/providers/settings/EventLogTags.logtags
@@ -1,4 +1,4 @@
-# See system/core/logcat/event.logtags for a description of the format of this file.
+# See system/logging/logcat/event.logtags for a description of the format of this file.
 
 option java_package com.android.providers.settings;
 
diff --git a/packages/SettingsProvider/src/com/android/providers/settings/SettingsBackupAgent.java b/packages/SettingsProvider/src/com/android/providers/settings/SettingsBackupAgent.java
index 9ab853f..326bff4 100644
--- a/packages/SettingsProvider/src/com/android/providers/settings/SettingsBackupAgent.java
+++ b/packages/SettingsProvider/src/com/android/providers/settings/SettingsBackupAgent.java
@@ -22,6 +22,7 @@
 import android.app.backup.BackupAgentHelper;
 import android.app.backup.BackupDataInput;
 import android.app.backup.BackupDataOutput;
+import android.app.backup.BackupRestoreEventLogger;
 import android.app.backup.FullBackupDataOutput;
 import android.content.ContentResolver;
 import android.content.ContentValues;
@@ -82,6 +83,7 @@
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicInteger;
 import java.util.function.Consumer;
+import java.util.HashMap;
 import java.util.zip.CRC32;
 
 /**
@@ -194,6 +196,22 @@
     private static final String KEY_LOCK_SETTINGS_PIN_ENHANCED_PRIVACY =
             "pin_enhanced_privacy";
 
+    // Error messages for logging metrics.
+    private static final String ERROR_COULD_NOT_READ_FROM_CURSOR =
+        "could_not_read_from_cursor";
+    private static final String ERROR_FAILED_TO_WRITE_ENTITY =
+        "failed_to_write_entity";
+    private static final String ERROR_COULD_NOT_READ_ENTITY =
+        "could_not_read_entity";
+    private static final String ERROR_SKIPPED_BY_SYSTEM = "skipped_by_system";
+    private static final String ERROR_SKIPPED_BY_BLOCKLIST =
+        "skipped_by_dynamic_blocklist";
+    private static final String ERROR_SKIPPED_PRESERVED = "skipped_preserved";
+    private static final String ERROR_SKIPPED_DUE_TO_LARGE_SCREEN =
+        "skipped_due_to_large_screen";
+    private static final String ERROR_DID_NOT_PASS_VALIDATION = "did_not_pass_validation";
+
+
     // Name of the temporary file we use during full backup/restore.  This is
     // stored in the full-backup tarfile as well, so should not be changed.
     private static final String STAGE_FILE = "flattened-data";
@@ -224,6 +242,10 @@
     // The font_scale default value for this device.
     private float mDefaultFontScale;
 
+    @Nullable private BackupRestoreEventLogger mBackupRestoreEventLogger;
+    @VisibleForTesting boolean areAgentMetricsEnabled = false;
+    @VisibleForTesting protected Map<String, Integer> numberOfSettingsPerKey;
+
     @Override
     public void onCreate() {
         if (DEBUG_BACKUP) Log.d(TAG, "onCreate() invoked");
@@ -232,6 +254,11 @@
                 .getStringArray(R.array.entryvalues_font_size);
         mSettingsHelper = new SettingsHelper(this);
         mWifiManager = (WifiManager) getSystemService(Context.WIFI_SERVICE);
+        if (com.android.server.backup.Flags.enableMetricsSettingsBackupAgents()) {
+            mBackupRestoreEventLogger = this.getBackupRestoreEventLogger();
+            numberOfSettingsPerKey = new HashMap<>();
+            areAgentMetricsEnabled = true;
+        }
         super.onCreate();
     }
 
@@ -356,7 +383,7 @@
                     restoreSettings(data, Settings.System.CONTENT_URI, movedToGlobal,
                             movedToSecure, /* movedToSystem= */ null,
                             R.array.restore_blocked_system_settings, dynamicBlockList,
-                            preservedSystemSettings);
+                            preservedSystemSettings, KEY_SYSTEM);
                     mSettingsHelper.applyAudioSettings();
                     break;
 
@@ -364,13 +391,13 @@
                     restoreSettings(data, Settings.Secure.CONTENT_URI, movedToGlobal,
                             /* movedToSecure= */ null, movedToSystem,
                             R.array.restore_blocked_secure_settings, dynamicBlockList,
-                            preservedSecureSettings);
+                            preservedSecureSettings, KEY_SECURE);
                     break;
 
                 case KEY_GLOBAL :
                     restoreSettings(data, Settings.Global.CONTENT_URI, /* movedToGlobal= */ null,
                             movedToSecure, movedToSystem, R.array.restore_blocked_global_settings,
-                            dynamicBlockList, preservedGlobalSettings);
+                            dynamicBlockList, preservedGlobalSettings, KEY_GLOBAL);
                     break;
 
                 case KEY_WIFI_SUPPLICANT :
@@ -489,7 +516,7 @@
             restoreSettings(buffer, nBytes, Settings.System.CONTENT_URI, movedToGlobal,
                     movedToSecure, /* movedToSystem= */ null,
                     R.array.restore_blocked_system_settings, Collections.emptySet(),
-                    Collections.emptySet());
+                    Collections.emptySet(), KEY_SYSTEM);
 
             // secure settings
             nBytes = in.readInt();
@@ -499,7 +526,7 @@
             restoreSettings(buffer, nBytes, Settings.Secure.CONTENT_URI, movedToGlobal,
                     /* movedToSecure= */ null, movedToSystem,
                     R.array.restore_blocked_secure_settings, Collections.emptySet(),
-                    Collections.emptySet());
+                    Collections.emptySet(), KEY_SECURE);
 
             // Global only if sufficiently new
             if (version >= FULL_BACKUP_ADDED_GLOBAL) {
@@ -510,7 +537,7 @@
                 restoreSettings(buffer, nBytes, Settings.Global.CONTENT_URI,
                         /* movedToGlobal= */ null, movedToSecure, movedToSystem,
                         R.array.restore_blocked_global_settings, Collections.emptySet(),
-                        Collections.emptySet());
+                        Collections.emptySet(), KEY_GLOBAL);
             }
 
             // locale
@@ -654,23 +681,41 @@
         if (oldChecksum == newChecksum) {
             return oldChecksum;
         }
+        writeDataForKey(key, data, output);
+        return newChecksum;
+    }
+
+    @VisibleForTesting
+    void writeDataForKey(String key, byte[] data, BackupDataOutput output) {
+        boolean shouldLogMetrics =
+            areAgentMetricsEnabled && numberOfSettingsPerKey.containsKey(key);
         try {
             if (DEBUG_BACKUP) {
                 Log.v(TAG, "Writing entity " + key + " of size " + data.length);
             }
             output.writeEntityHeader(key, data.length);
             output.writeEntityData(data, data.length);
+            if (shouldLogMetrics) {
+                mBackupRestoreEventLogger
+                    .logItemsBackedUp(key, numberOfSettingsPerKey.get(key));
+            }
         } catch (IOException ioe) {
             // Bail
+            if (shouldLogMetrics) {
+                mBackupRestoreEventLogger
+                    .logItemsBackupFailed(
+                        key,
+                        numberOfSettingsPerKey.get(key),
+                        ERROR_FAILED_TO_WRITE_ENTITY);
+            }
         }
-        return newChecksum;
     }
 
     private byte[] getSystemSettings() {
         Cursor cursor = getContentResolver().query(Settings.System.CONTENT_URI, PROJECTION, null,
                 null, null);
         try {
-            return extractRelevantValues(cursor, SystemSettings.SETTINGS_TO_BACKUP);
+            return extractRelevantValues(cursor, SystemSettings.SETTINGS_TO_BACKUP, KEY_SYSTEM);
         } finally {
             cursor.close();
         }
@@ -680,7 +725,7 @@
         Cursor cursor = getContentResolver().query(Settings.Secure.CONTENT_URI, PROJECTION, null,
                 null, null);
         try {
-            return extractRelevantValues(cursor, SecureSettings.SETTINGS_TO_BACKUP);
+            return extractRelevantValues(cursor, SecureSettings.SETTINGS_TO_BACKUP, KEY_SECURE);
         } finally {
             cursor.close();
         }
@@ -690,7 +735,7 @@
         Cursor cursor = getContentResolver().query(Settings.Global.CONTENT_URI, PROJECTION, null,
                 null, null);
         try {
-            return extractRelevantValues(cursor, getGlobalSettingsToBackup());
+            return extractRelevantValues(cursor, getGlobalSettingsToBackup(), KEY_GLOBAL);
         } finally {
             cursor.close();
         }
@@ -773,7 +818,8 @@
         return baos.toByteArray();
     }
 
-    private void restoreSettings(
+    @VisibleForTesting
+    void restoreSettings(
             BackupDataInput data,
             Uri contentUri,
             Set<String> movedToGlobal,
@@ -781,12 +827,17 @@
             Set<String> movedToSystem,
             int blockedSettingsArrayId,
             Set<String> dynamicBlockList,
-            Set<String> settingsToPreserve) {
+            Set<String> settingsToPreserve,
+            String settingsKey) {
         byte[] settings = new byte[data.getDataSize()];
         try {
             data.readEntityData(settings, 0, settings.length);
         } catch (IOException ioe) {
             Log.e(TAG, "Couldn't read entity data");
+            if (areAgentMetricsEnabled) {
+                mBackupRestoreEventLogger.logItemsRestoreFailed(
+                    settingsKey, /* count= */ 1, ERROR_COULD_NOT_READ_ENTITY);
+            }
             return;
         }
         restoreSettings(
@@ -798,7 +849,8 @@
                 movedToSystem,
                 blockedSettingsArrayId,
                 dynamicBlockList,
-                settingsToPreserve);
+                settingsToPreserve,
+                settingsKey);
     }
 
     private void restoreSettings(
@@ -810,7 +862,8 @@
             Set<String> movedToSystem,
             int blockedSettingsArrayId,
             Set<String> dynamicBlockList,
-            Set<String> settingsToPreserve) {
+            Set<String> settingsToPreserve,
+            String settingsKey) {
         restoreSettings(
                 settings,
                 0,
@@ -821,7 +874,8 @@
                 movedToSystem,
                 blockedSettingsArrayId,
                 dynamicBlockList,
-                settingsToPreserve);
+                settingsToPreserve,
+                settingsKey);
     }
 
     @VisibleForTesting
@@ -835,12 +889,13 @@
             Set<String> movedToSystem,
             int blockedSettingsArrayId,
             Set<String> dynamicBlockList,
-            Set<String> settingsToPreserve) {
+            Set<String> settingsToPreserve,
+            String settingsKey) {
         if (DEBUG) {
             Log.i(TAG, "restoreSettings: " + contentUri);
         }
 
-        SettingsBackupWhitelist whitelist = getBackupWhitelist(contentUri);
+        SettingsBackupAllowlist allowlist = getBackupAllowlist(contentUri);
 
         // Restore only the white list data.
         final ArrayMap<String, String> cachedEntries = new ArrayMap<>();
@@ -850,7 +905,8 @@
 
         Set<String> blockedSettings = getBlockedSettings(blockedSettingsArrayId);
 
-        for (String key : whitelist.mSettingsWhitelist) {
+        int restoredSettingsCount = 0;
+        for (String key : allowlist.mSettingsAllowlist) {
             boolean isBlockedBySystem = blockedSettings != null && blockedSettings.contains(key);
             if (isBlockedBySystem || isBlockedByDynamicList(dynamicBlockList, contentUri,  key)) {
                 Log.i(
@@ -860,6 +916,12 @@
                                 + " removed from restore by "
                                 + (isBlockedBySystem ? "system" : "dynamic")
                                 + " block list");
+                if (areAgentMetricsEnabled) {
+                    mBackupRestoreEventLogger.logItemsRestoreFailed(
+                        settingsKey,
+                        /* count= */ 1,
+                        isBlockedBySystem ? ERROR_SKIPPED_BY_SYSTEM : ERROR_SKIPPED_BY_BLOCKLIST);
+                }
                 continue;
             }
 
@@ -870,12 +932,20 @@
             if (isSettingPreserved && !Settings.Secure.NAVIGATION_MODE.equals(key)) {
                 Log.i(TAG, "Skipping restore for setting " + key + " as it is marked as "
                         + "preserved");
+                if (areAgentMetricsEnabled) {
+                    mBackupRestoreEventLogger.logItemsRestoreFailed(
+                            settingsKey, /* count= */ 1, ERROR_SKIPPED_PRESERVED);
+                }
                 continue;
             }
 
             if (LargeScreenSettings.doNotRestoreIfLargeScreenSetting(key, getBaseContext())) {
                 Log.i(TAG, "Skipping restore for setting " + key + " as the target device "
                         + "is a large screen (i.e tablet or foldable in unfolded state)");
+                if (areAgentMetricsEnabled) {
+                    mBackupRestoreEventLogger.logItemsRestoreFailed(
+                            settingsKey, /* count= */ 1, ERROR_SKIPPED_DUE_TO_LARGE_SCREEN);
+                }
                 continue;
             }
 
@@ -912,19 +982,34 @@
             }
 
             // only restore the settings that have valid values
-            if (!isValidSettingValue(key, value, whitelist.mSettingsValidators)) {
+            if (!isValidSettingValue(key, value, allowlist.mSettingsValidators)) {
                 Log.w(TAG, "Attempted restore of " + key + " setting, but its value didn't pass"
                         + " validation, value: " + value);
+                if (areAgentMetricsEnabled) {
+                    mBackupRestoreEventLogger.logItemsRestoreFailed(
+                            settingsKey, /* count= */ 1, ERROR_DID_NOT_PASS_VALIDATION);
+                }
                 continue;
             }
 
             final Uri destination;
+            // If the destination changes, we need to update the key used as datatype for metrics.
+            String finalSettingsKey = settingsKey;
             if (movedToGlobal != null && movedToGlobal.contains(key)) {
                 destination = Settings.Global.CONTENT_URI;
+                if (areAgentMetricsEnabled) {
+                    finalSettingsKey = KEY_GLOBAL;
+                }
             } else if (movedToSecure != null && movedToSecure.contains(key)) {
                 destination = Settings.Secure.CONTENT_URI;
+                if (areAgentMetricsEnabled) {
+                    finalSettingsKey = KEY_SECURE;
+                }
             } else if (movedToSystem != null && movedToSystem.contains(key)) {
                 destination = Settings.System.CONTENT_URI;
+                if (areAgentMetricsEnabled) {
+                    finalSettingsKey = KEY_SYSTEM;
+                }
             } else {
                 destination = contentUri;
             }
@@ -942,6 +1027,10 @@
                 if (isSettingPreserved) {
                     Log.i(TAG, "Skipping restore for setting navigation_mode "
                         + "as it is marked as preserved");
+                    if (areAgentMetricsEnabled) {
+                        mBackupRestoreEventLogger.logItemsRestoreFailed(
+                                finalSettingsKey, /* count= */ 1, ERROR_SKIPPED_PRESERVED);
+                    }
                     continue;
                 }
             }
@@ -961,12 +1050,16 @@
                 Log.d(TAG, "Restored font scale from: " + toRestore + " to " + value);
             }
 
-
+            // TODO(b/379861078): Log metrics inside this method.
             settingsHelper.restoreValue(this, cr, contentValues, destination, key, value,
                     mRestoredFromSdkInt);
 
             Log.d(TAG, "Restored setting: " + destination + " : " + key + "=" + value);
+            if (areAgentMetricsEnabled) {
+                mBackupRestoreEventLogger.logItemsRestored(finalSettingsKey, /* count= */ 1);
+            }
         }
+
     }
 
 
@@ -996,29 +1089,29 @@
     }
 
     @VisibleForTesting
-    SettingsBackupWhitelist getBackupWhitelist(Uri contentUri) {
+    SettingsBackupAllowlist getBackupAllowlist(Uri contentUri) {
         // Figure out the white list and redirects to the global table.  We restore anything
         // in either the backup allowlist or the legacy-restore allowlist for this table.
-        String[] whitelist;
+        String[] allowlist;
         Map<String, Validator> validators = null;
         if (contentUri.equals(Settings.Secure.CONTENT_URI)) {
-            whitelist = ArrayUtils.concat(String.class, SecureSettings.SETTINGS_TO_BACKUP,
+            allowlist = ArrayUtils.concat(String.class, SecureSettings.SETTINGS_TO_BACKUP,
                     Settings.Secure.LEGACY_RESTORE_SETTINGS,
                     DeviceSpecificSettings.DEVICE_SPECIFIC_SETTINGS_TO_BACKUP);
             validators = SecureSettingsValidators.VALIDATORS;
         } else if (contentUri.equals(Settings.System.CONTENT_URI)) {
-            whitelist = ArrayUtils.concat(String.class, SystemSettings.SETTINGS_TO_BACKUP,
+            allowlist = ArrayUtils.concat(String.class, SystemSettings.SETTINGS_TO_BACKUP,
                     Settings.System.LEGACY_RESTORE_SETTINGS);
             validators = SystemSettingsValidators.VALIDATORS;
         } else if (contentUri.equals(Settings.Global.CONTENT_URI)) {
-            whitelist = ArrayUtils.concat(String.class, getGlobalSettingsToBackup(),
+            allowlist = ArrayUtils.concat(String.class, getGlobalSettingsToBackup(),
                     Settings.Global.LEGACY_RESTORE_SETTINGS);
             validators = GlobalSettingsValidators.VALIDATORS;
         } else {
             throw new IllegalArgumentException("Unknown URI: " + contentUri);
         }
 
-        return new SettingsBackupWhitelist(whitelist, validators);
+        return new SettingsBackupAllowlist(allowlist, validators);
     }
 
     private String[] getGlobalSettingsToBackup() {
@@ -1118,11 +1211,20 @@
      *
      * @param cursor A cursor with settings data.
      * @param settings The settings to extract.
+     * @param settingsKey The key of the settings to extract (eg system).
      * @return The byte array of extracted values.
      */
-    private byte[] extractRelevantValues(Cursor cursor, String[] settings) {
+    private byte[] extractRelevantValues(
+        Cursor cursor, String[] settings, String settingsKey) {
         if (!cursor.moveToFirst()) {
             Log.e(TAG, "Couldn't read from the cursor");
+            if (areAgentMetricsEnabled) {
+                mBackupRestoreEventLogger
+                    .logItemsBackupFailed(
+                        settingsKey,
+                        settings.length,
+                        ERROR_COULD_NOT_READ_FROM_CURSOR);
+            }
             return new byte[0];
         }
 
@@ -1181,6 +1283,10 @@
             }
         }
 
+        if (areAgentMetricsEnabled) {
+            numberOfSettingsPerKey.put(settingsKey, backedUpSettingIndex);
+        }
+
         // Aggregate the result.
         byte[] result = new byte[totalSize];
         int pos = 0;
@@ -1364,7 +1470,9 @@
                      getContentResolver()
                              .query(Settings.Secure.CONTENT_URI, PROJECTION, null, null, null)) {
             return extractRelevantValues(
-                    cursor, DeviceSpecificSettings.DEVICE_SPECIFIC_SETTINGS_TO_BACKUP);
+                    cursor,
+                    DeviceSpecificSettings.DEVICE_SPECIFIC_SETTINGS_TO_BACKUP,
+                    KEY_DEVICE_SPECIFIC_CONFIG);
         }
     }
 
@@ -1399,7 +1507,8 @@
                 null,
                 blockedSettingsArrayId,
                 dynamicBlocklist,
-                preservedSettings);
+                preservedSettings,
+                KEY_DEVICE_SPECIFIC_CONFIG);
 
         updateWindowManagerIfNeeded(originalDensity);
 
@@ -1597,14 +1706,14 @@
      * Store the allowlist of settings to be backed up and validators for them.
      */
     @VisibleForTesting
-    static class SettingsBackupWhitelist {
-        final String[] mSettingsWhitelist;
+    static class SettingsBackupAllowlist {
+        final String[] mSettingsAllowlist;
         final Map<String, Validator> mSettingsValidators;
 
 
-        SettingsBackupWhitelist(String[] settingsWhitelist,
+        SettingsBackupAllowlist(String[] settingsAllowlist,
                 Map<String, Validator> settingsValidators) {
-            mSettingsWhitelist = settingsWhitelist;
+            mSettingsAllowlist = settingsAllowlist;
             mSettingsValidators = settingsValidators;
         }
     }
diff --git a/packages/SettingsProvider/test/src/com/android/providers/settings/SettingsBackupAgentTest.java b/packages/SettingsProvider/test/src/com/android/providers/settings/SettingsBackupAgentTest.java
index 3a391505..350c149 100644
--- a/packages/SettingsProvider/test/src/com/android/providers/settings/SettingsBackupAgentTest.java
+++ b/packages/SettingsProvider/test/src/com/android/providers/settings/SettingsBackupAgentTest.java
@@ -17,11 +17,23 @@
 package com.android.providers.settings;
 
 import static junit.framework.Assert.assertEquals;
+import static junit.framework.Assert.assertNotNull;
+import static junit.framework.Assert.assertNull;
 import static junit.framework.Assert.assertFalse;
 import static junit.framework.Assert.assertTrue;
 
 import static org.junit.Assert.assertArrayEquals;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.anyInt;
+import static org.mockito.ArgumentMatchers.anyString;
+import static org.mockito.Mockito.when;
 
+import android.app.backup.BackupAnnotations.BackupDestination;
+import android.app.backup.BackupAnnotations.OperationType;
+import android.app.backup.BackupDataInput;
+import android.app.backup.BackupDataOutput;
+import android.app.backup.BackupRestoreEventLogger;
+import android.app.backup.BackupRestoreEventLogger.DataTypeResult;
 import android.content.ContentResolver;
 import android.content.ContentValues;
 import android.content.Context;
@@ -32,7 +44,10 @@
 import android.net.Uri;
 import android.os.Build;
 import android.os.Bundle;
+import android.os.UserHandle;
+import android.platform.test.annotations.DisableFlags;
 import android.platform.test.annotations.EnableFlags;
+import android.platform.test.flag.junit.SetFlagsRule;
 import android.provider.Settings;
 import android.provider.settings.validators.SettingsValidators;
 import android.provider.settings.validators.Validator;
@@ -43,9 +58,14 @@
 
 import com.android.window.flags.Flags;
 
+import java.util.List;
 import org.junit.Before;
+import org.junit.Rule;
 import org.junit.Test;
 import org.junit.runner.RunWith;
+import org.mockito.Mock;
+import org.mockito.junit.MockitoJUnit;
+import org.mockito.junit.MockitoRule;
 
 import java.io.ByteArrayOutputStream;
 import java.io.IOException;
@@ -54,12 +74,14 @@
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.HashSet;
+import java.util.List;
 import java.util.Map;
 import java.util.Objects;
 import java.util.Set;
 import java.util.concurrent.atomic.AtomicInteger;
 import java.util.function.Function;
 
+
 /**
  * Tests for the SettingsHelperTest
  * Usage: atest SettingsProviderTest:SettingsBackupAgentTest
@@ -73,6 +95,17 @@
     private static final Map<String, String> DEVICE_SPECIFIC_TEST_VALUES = new HashMap<>();
     private static final Map<String, String> TEST_VALUES = new HashMap<>();
     private static final Map<String, Validator> TEST_VALUES_VALIDATORS = new HashMap<>();
+    private static final String TEST_KEY = "test_key";
+    private static final String TEST_VALUE = "test_value";
+    private static final String ERROR_COULD_NOT_READ_ENTITY = "could_not_read_entity";
+    private static final String ERROR_SKIPPED_BY_SYSTEM = "skipped_by_system";
+    private static final String ERROR_SKIPPED_BY_BLOCKLIST =
+        "skipped_by_dynamic_blocklist";
+    private static final String ERROR_SKIPPED_PRESERVED = "skipped_preserved";
+    private static final String ERROR_DID_NOT_PASS_VALIDATION = "did_not_pass_validation";
+    private static final String KEY_SYSTEM = "system";
+    private static final String KEY_SECURE = "secure";
+    private static final String KEY_GLOBAL = "global";
 
     static {
         DEVICE_SPECIFIC_TEST_VALUES.put(Settings.Secure.DISPLAY_DENSITY_FORCED,
@@ -86,6 +119,14 @@
         TEST_VALUES_VALIDATORS.put(PRESERVED_TEST_SETTING, SettingsValidators.ANY_STRING_VALIDATOR);
     }
 
+    @Rule
+    public final SetFlagsRule mSetFlagsRule = new SetFlagsRule();
+    @Rule
+    public final MockitoRule mockito = MockitoJUnit.rule();
+
+    @Mock private BackupDataInput mBackupDataInput;
+    @Mock private BackupDataOutput mBackupDataOutput;
+
     private TestFriendlySettingsBackupAgent mAgentUnderTest;
     private Context mContext;
 
@@ -203,19 +244,32 @@
 
     @Test
     public void testOnRestore_preservedSettingsAreNotRestored() {
-        SettingsBackupAgent.SettingsBackupWhitelist whitelist =
-                new SettingsBackupAgent.SettingsBackupWhitelist(
+        SettingsBackupAgent.SettingsBackupAllowlist allowlist =
+                new SettingsBackupAgent.SettingsBackupAllowlist(
                         new String[] { OVERRIDDEN_TEST_SETTING, PRESERVED_TEST_SETTING },
                         TEST_VALUES_VALIDATORS);
-        mAgentUnderTest.setSettingsWhitelist(whitelist);
+        mAgentUnderTest.setSettingsAllowlist(allowlist);
         mAgentUnderTest.setBlockedSettings();
         TestSettingsHelper settingsHelper = new TestSettingsHelper(mContext);
         mAgentUnderTest.mSettingsHelper = settingsHelper;
 
         byte[] backupData = generateBackupData(TEST_VALUES);
-        mAgentUnderTest.restoreSettings(backupData, /* pos */ 0, backupData.length, TEST_URI,
-                null, null, null, /* blockedSettingsArrayId */ 0, Collections.emptySet(),
-                new HashSet<>(Collections.singletonList(SettingsBackupAgent.getQualifiedKeyForSetting(PRESERVED_TEST_SETTING, TEST_URI))));
+        mAgentUnderTest.restoreSettings(
+            backupData,
+            /* pos */ 0,
+            backupData.length,
+            TEST_URI,
+            null,
+            null,
+            null,
+            /* blockedSettingsArrayId */ 0,
+            Collections.emptySet(),
+            new HashSet<>(Collections
+                              .singletonList(
+                                  SettingsBackupAgent
+                                      .getQualifiedKeyForSetting(
+                                          PRESERVED_TEST_SETTING, TEST_URI))),
+            TEST_KEY);
 
         assertTrue(settingsHelper.mWrittenValues.containsKey(OVERRIDDEN_TEST_SETTING));
         assertFalse(settingsHelper.mWrittenValues.containsKey(PRESERVED_TEST_SETTING));
@@ -262,6 +316,486 @@
         assertEquals("1.5", testedMethod.apply("1.8"));
     }
 
+    @Test
+    @DisableFlags(com.android.server.backup.Flags.FLAG_ENABLE_METRICS_SETTINGS_BACKUP_AGENTS)
+    public void onCreate_metricsFlagIsDisabled_areAgentMetricsEnabledIsFalse() {
+        mAgentUnderTest.onCreate();
+
+        assertFalse(mAgentUnderTest.areAgentMetricsEnabled);
+    }
+
+    @Test
+    @EnableFlags(com.android.server.backup.Flags.FLAG_ENABLE_METRICS_SETTINGS_BACKUP_AGENTS)
+    public void onCreate_flagIsEnabled_areAgentMetricsEnabledIsTrue() {
+        mAgentUnderTest.onCreate();
+
+        assertTrue(mAgentUnderTest.areAgentMetricsEnabled);
+    }
+
+    @Test
+    @EnableFlags(com.android.server.backup.Flags.FLAG_ENABLE_METRICS_SETTINGS_BACKUP_AGENTS)
+    public void writeDataForKey_metricsFlagIsEnabled_numberOfSettingsPerKeyContainsKey_dataWriteSucceeds_logsSuccessMetrics()
+        throws IOException {
+        when(mBackupDataOutput.writeEntityHeader(anyString(), anyInt())).thenReturn(0);
+        when(mBackupDataOutput.writeEntityData(any(byte[].class), anyInt())).thenReturn(0);
+        mAgentUnderTest.onCreate(
+            UserHandle.SYSTEM, BackupDestination.CLOUD, OperationType.BACKUP);
+        mAgentUnderTest.setNumberOfSettingsPerKey(TEST_KEY, 1);
+
+        mAgentUnderTest.writeDataForKey(
+            TEST_KEY, TEST_VALUE.getBytes(), mBackupDataOutput);
+
+        DataTypeResult loggingResult =
+            getLoggingResultForDatatype(TEST_KEY, mAgentUnderTest);
+        assertNotNull(loggingResult);
+        assertEquals(loggingResult.getSuccessCount(), 1);
+    }
+
+    @Test
+    @EnableFlags(com.android.server.backup.Flags.FLAG_ENABLE_METRICS_SETTINGS_BACKUP_AGENTS)
+    public void writeDataForKey_metricsFlagIsEnabled_numberOfSettingsPerKeyContainsKey_writeEntityHeaderFails_logsFailureMetrics()
+        throws IOException {
+        when(mBackupDataOutput.writeEntityHeader(anyString(), anyInt())).thenThrow(new IOException());
+        when(mBackupDataOutput.writeEntityData(any(byte[].class), anyInt())).thenReturn(0);
+        mAgentUnderTest.onCreate(
+            UserHandle.SYSTEM, BackupDestination.CLOUD, OperationType.BACKUP);
+        mAgentUnderTest.setNumberOfSettingsPerKey(TEST_KEY, 1);
+
+        mAgentUnderTest.writeDataForKey(
+            TEST_KEY, TEST_VALUE.getBytes(), mBackupDataOutput);
+
+        DataTypeResult loggingResult =
+            getLoggingResultForDatatype(TEST_KEY, mAgentUnderTest);
+        assertNotNull(loggingResult);
+        assertEquals(loggingResult.getFailCount(), 1);
+    }
+
+    @Test
+    @EnableFlags(com.android.server.backup.Flags.FLAG_ENABLE_METRICS_SETTINGS_BACKUP_AGENTS)
+    public void writeDataForKey_metricsFlagIsEnabled_numberOfSettingsPerKeyContainsKey_writeEntityDataFails_logsFailureMetrics()
+        throws IOException {
+        when(mBackupDataOutput.writeEntityHeader(anyString(), anyInt())).thenReturn(0);
+        when(mBackupDataOutput.writeEntityData(any(byte[].class), anyInt())).thenThrow(new IOException());
+        mAgentUnderTest.onCreate(
+            UserHandle.SYSTEM, BackupDestination.CLOUD, OperationType.BACKUP);
+        mAgentUnderTest.setNumberOfSettingsPerKey(TEST_KEY, 1);
+
+        mAgentUnderTest.writeDataForKey(
+            TEST_KEY, TEST_VALUE.getBytes(), mBackupDataOutput);
+
+        DataTypeResult loggingResult =
+            getLoggingResultForDatatype(TEST_KEY, mAgentUnderTest);
+        assertNotNull(loggingResult);
+        assertEquals(loggingResult.getFailCount(), 1);
+    }
+
+    @Test
+    @DisableFlags(com.android.server.backup.Flags.FLAG_ENABLE_METRICS_SETTINGS_BACKUP_AGENTS)
+    public void writeDataForKey_metricsFlagIsDisabled_doesNotLogMetrics()
+        throws IOException {
+        when(mBackupDataOutput.writeEntityHeader(anyString(), anyInt())).thenReturn(0);
+        when(mBackupDataOutput.writeEntityData(any(byte[].class), anyInt())).thenReturn(0);
+        mAgentUnderTest.onCreate(
+            UserHandle.SYSTEM, BackupDestination.CLOUD, OperationType.BACKUP);
+        mAgentUnderTest.setNumberOfSettingsPerKey(TEST_KEY, 1);
+
+        mAgentUnderTest.writeDataForKey(
+            TEST_KEY, TEST_VALUE.getBytes(), mBackupDataOutput);
+
+        assertNull(getLoggingResultForDatatype(TEST_KEY, mAgentUnderTest));
+    }
+
+    @Test
+    @EnableFlags(com.android.server.backup.Flags.FLAG_ENABLE_METRICS_SETTINGS_BACKUP_AGENTS)
+    public void writeDataForKey_metricsFlagIsEnabled_numberOfSettingsPerKeyDoesNotContainKey_doesNotLogMetrics()
+        throws IOException {
+        when(mBackupDataOutput.writeEntityHeader(anyString(), anyInt())).thenReturn(0);
+        when(mBackupDataOutput.writeEntityData(any(byte[].class), anyInt())).thenReturn(0);
+        mAgentUnderTest.onCreate(
+            UserHandle.SYSTEM, BackupDestination.CLOUD, OperationType.BACKUP);
+
+        mAgentUnderTest.writeDataForKey(
+            TEST_KEY, TEST_VALUE.getBytes(), mBackupDataOutput);
+
+        assertNull(getLoggingResultForDatatype(TEST_KEY, mAgentUnderTest));
+    }
+
+    @Test
+    @EnableFlags(com.android.server.backup.Flags.FLAG_ENABLE_METRICS_SETTINGS_BACKUP_AGENTS)
+    public void restoreSettings_agentMetricsAreEnabled_agentMetricsAreLogged() {
+        mAgentUnderTest.onCreate(
+            UserHandle.SYSTEM, BackupDestination.CLOUD, OperationType.RESTORE);
+        SettingsBackupAgent.SettingsBackupAllowlist allowlist =
+                new SettingsBackupAgent.SettingsBackupAllowlist(
+                        new String[] {OVERRIDDEN_TEST_SETTING},
+                        TEST_VALUES_VALIDATORS);
+        mAgentUnderTest.setSettingsAllowlist(allowlist);
+        mAgentUnderTest.setBlockedSettings();
+        TestSettingsHelper settingsHelper = new TestSettingsHelper(mContext);
+        mAgentUnderTest.mSettingsHelper = settingsHelper;
+
+        byte[] backupData = generateBackupData(TEST_VALUES);
+        mAgentUnderTest
+            .restoreSettings(
+                backupData,
+                /* pos= */ 0,
+                backupData.length,
+                TEST_URI,
+                /* movedToGlobal= */ null,
+                /* movedToSecure= */ null,
+                /* movedToSystem= */ null,
+                /* blockedSettingsArrayId= */ 0,
+                /* dynamicBlockList= */ Collections.emptySet(),
+                /* settingsToPreserve= */ Collections.emptySet(),
+                TEST_KEY);
+
+        DataTypeResult loggingResult =
+            getLoggingResultForDatatype(TEST_KEY, mAgentUnderTest);
+        assertNotNull(loggingResult);
+        assertEquals(loggingResult.getSuccessCount(), 1);
+    }
+
+    @Test
+    @DisableFlags(com.android.server.backup.Flags.FLAG_ENABLE_METRICS_SETTINGS_BACKUP_AGENTS)
+    public void restoreSettings_agentMetricsAreDisabled_agentMetricsAreNotLogged() {
+        mAgentUnderTest.onCreate(
+            UserHandle.SYSTEM, BackupDestination.CLOUD, OperationType.RESTORE);
+        SettingsBackupAgent.SettingsBackupAllowlist allowlist =
+                new SettingsBackupAgent.SettingsBackupAllowlist(
+                        new String[] {OVERRIDDEN_TEST_SETTING},
+                        TEST_VALUES_VALIDATORS);
+        mAgentUnderTest.setSettingsAllowlist(allowlist);
+        mAgentUnderTest.setBlockedSettings();
+        TestSettingsHelper settingsHelper = new TestSettingsHelper(mContext);
+        mAgentUnderTest.mSettingsHelper = settingsHelper;
+
+        byte[] backupData = generateBackupData(TEST_VALUES);
+        mAgentUnderTest
+            .restoreSettings(
+                backupData,
+                /* pos= */ 0,
+                backupData.length,
+                TEST_URI,
+                /* movedToGlobal= */ null,
+                /* movedToSecure= */ null,
+                /* movedToSystem= */ null,
+                /* blockedSettingsArrayId= */ 0,
+                /* dynamicBlockList= */ Collections.emptySet(),
+                /* settingsToPreserve= */ Collections.emptySet(),
+                TEST_KEY);
+
+        DataTypeResult loggingResult =
+            getLoggingResultForDatatype(TEST_KEY, mAgentUnderTest);
+        assertNull(loggingResult);
+    }
+
+    @Test
+    @EnableFlags(com.android.server.backup.Flags.FLAG_ENABLE_METRICS_SETTINGS_BACKUP_AGENTS)
+    public void restoreSettings_agentMetricsAreEnabled_readEntityDataFails_failureIsLogged()
+        throws IOException {
+        when(mBackupDataInput.readEntityData(any(byte[].class), anyInt(), anyInt()))
+            .thenThrow(new IOException());
+        mAgentUnderTest.onCreate(
+            UserHandle.SYSTEM, BackupDestination.CLOUD, OperationType.RESTORE);
+
+        mAgentUnderTest.restoreSettings(
+            mBackupDataInput,
+            TEST_URI,
+            /* movedToGlobal= */ null,
+            /* movedToSecure= */ null,
+            /* movedToSystem= */ null,
+            /* blockedSettingsArrayId= */ 0,
+            /* dynamicBlockList= */ Collections.emptySet(),
+            /* settingsToPreserve= */ Collections.emptySet(),
+            TEST_KEY);
+
+        DataTypeResult loggingResult =
+            getLoggingResultForDatatype(TEST_KEY, mAgentUnderTest);
+        assertNotNull(loggingResult);
+        assertEquals(loggingResult.getFailCount(), 1);
+        assertTrue(loggingResult.getErrors().containsKey(ERROR_COULD_NOT_READ_ENTITY));
+    }
+
+    @Test
+    @DisableFlags(com.android.server.backup.Flags.FLAG_ENABLE_METRICS_SETTINGS_BACKUP_AGENTS)
+    public void restoreSettings_agentMetricsAreDisabled_readEntityDataFails_failureIsNotLogged()
+        throws IOException {
+        when(mBackupDataInput.readEntityData(any(byte[].class), anyInt(), anyInt()))
+            .thenThrow(new IOException());
+        mAgentUnderTest.onCreate(
+            UserHandle.SYSTEM, BackupDestination.CLOUD, OperationType.RESTORE);
+
+        mAgentUnderTest.restoreSettings(
+            mBackupDataInput,
+            TEST_URI,
+            /* movedToGlobal= */ null,
+            /* movedToSecure= */ null,
+            /* movedToSystem= */ null,
+            /* blockedSettingsArrayId= */ 0,
+            /* dynamicBlockList= */ Collections.emptySet(),
+            /* settingsToPreserve= */ Collections.emptySet(),
+            TEST_KEY);
+
+        assertNull(getLoggingResultForDatatype(TEST_KEY, mAgentUnderTest));
+    }
+
+    @Test
+    @EnableFlags(com.android.server.backup.Flags.FLAG_ENABLE_METRICS_SETTINGS_BACKUP_AGENTS)
+    public void restoreSettings_agentMetricsAreEnabled_settingIsSkippedBySystem_failureIsLogged() {
+        mAgentUnderTest.onCreate(
+            UserHandle.SYSTEM, BackupDestination.CLOUD, OperationType.RESTORE);
+        String[] settingBlockedBySystem = new String[] {OVERRIDDEN_TEST_SETTING};
+        SettingsBackupAgent.SettingsBackupAllowlist allowlist =
+                new SettingsBackupAgent.SettingsBackupAllowlist(
+                        settingBlockedBySystem,
+                        TEST_VALUES_VALIDATORS);
+        mAgentUnderTest.setSettingsAllowlist(allowlist);
+        mAgentUnderTest.setBlockedSettings(settingBlockedBySystem);
+        TestSettingsHelper settingsHelper = new TestSettingsHelper(mContext);
+        mAgentUnderTest.mSettingsHelper = settingsHelper;
+
+        byte[] backupData = generateBackupData(TEST_VALUES);
+        mAgentUnderTest
+            .restoreSettings(
+                backupData,
+                /* pos= */ 0,
+                backupData.length,
+                TEST_URI,
+                /* movedToGlobal= */ null,
+                /* movedToSecure= */ null,
+                /* movedToSystem= */ null,
+                /* blockedSettingsArrayId= */ 0,
+                /* dynamicBlockList= */ Collections.emptySet(),
+                /* settingsToPreserve= */ Collections.emptySet(),
+                TEST_KEY);
+
+        DataTypeResult loggingResult =
+            getLoggingResultForDatatype(TEST_KEY, mAgentUnderTest);
+        assertNotNull(loggingResult);
+        assertEquals(loggingResult.getFailCount(), 1);
+        assertTrue(loggingResult.getErrors().containsKey(ERROR_SKIPPED_BY_SYSTEM));
+    }
+
+    @Test
+    @EnableFlags(com.android.server.backup.Flags.FLAG_ENABLE_METRICS_SETTINGS_BACKUP_AGENTS)
+    public void restoreSettings_agentMetricsAreEnabled_settingIsSkippedByBlockList_failureIsLogged() {
+        mAgentUnderTest.onCreate(
+            UserHandle.SYSTEM, BackupDestination.CLOUD, OperationType.RESTORE);
+        SettingsBackupAgent.SettingsBackupAllowlist allowlist =
+                new SettingsBackupAgent.SettingsBackupAllowlist(
+                        new String[] {OVERRIDDEN_TEST_SETTING},
+                        TEST_VALUES_VALIDATORS);
+        mAgentUnderTest.setSettingsAllowlist(allowlist);
+        mAgentUnderTest.setBlockedSettings();
+        TestSettingsHelper settingsHelper = new TestSettingsHelper(mContext);
+        mAgentUnderTest.mSettingsHelper = settingsHelper;
+        Set<String> dynamicBlockList =
+            Set.of(Uri.withAppendedPath(TEST_URI, OVERRIDDEN_TEST_SETTING).toString());
+
+        byte[] backupData = generateBackupData(TEST_VALUES);
+        mAgentUnderTest
+            .restoreSettings(
+                backupData,
+                /* pos= */ 0,
+                backupData.length,
+                TEST_URI,
+                /* movedToGlobal= */ null,
+                /* movedToSecure= */ null,
+                /* movedToSystem= */ null,
+                /* blockedSettingsArrayId= */ 0,
+                dynamicBlockList,
+                /* settingsToPreserve= */ Collections.emptySet(),
+                TEST_KEY);
+
+        DataTypeResult loggingResult =
+            getLoggingResultForDatatype(TEST_KEY, mAgentUnderTest);
+        assertNotNull(loggingResult);
+        assertEquals(loggingResult.getFailCount(), 1);
+        assertTrue(loggingResult.getErrors().containsKey(ERROR_SKIPPED_BY_BLOCKLIST));
+    }
+
+    @Test
+    @EnableFlags(com.android.server.backup.Flags.FLAG_ENABLE_METRICS_SETTINGS_BACKUP_AGENTS)
+    public void restoreSettings_agentMetricsAreEnabled_settingIsPreserved_failureIsLogged() {
+        mAgentUnderTest.onCreate(
+            UserHandle.SYSTEM, BackupDestination.CLOUD, OperationType.RESTORE);
+        SettingsBackupAgent.SettingsBackupAllowlist allowlist =
+                new SettingsBackupAgent.SettingsBackupAllowlist(
+                        new String[] {OVERRIDDEN_TEST_SETTING},
+                        TEST_VALUES_VALIDATORS);
+        mAgentUnderTest.setSettingsAllowlist(allowlist);
+        mAgentUnderTest.setBlockedSettings();
+        TestSettingsHelper settingsHelper = new TestSettingsHelper(mContext);
+        mAgentUnderTest.mSettingsHelper = settingsHelper;
+        Set<String> preservedSettings =
+            Set.of(Uri.withAppendedPath(TEST_URI, OVERRIDDEN_TEST_SETTING).toString());
+
+        byte[] backupData = generateBackupData(TEST_VALUES);
+        mAgentUnderTest
+            .restoreSettings(
+                backupData,
+                /* pos= */ 0,
+                backupData.length,
+                TEST_URI,
+                /* movedToGlobal= */ null,
+                /* movedToSecure= */ null,
+                /* movedToSystem= */ null,
+                /* blockedSettingsArrayId= */ 0,
+                /* dynamicBlockList = */ Collections.emptySet(),
+                preservedSettings,
+                TEST_KEY);
+
+        DataTypeResult loggingResult =
+            getLoggingResultForDatatype(TEST_KEY, mAgentUnderTest);
+        assertNotNull(loggingResult);
+        assertEquals(loggingResult.getFailCount(), 1);
+        assertTrue(loggingResult.getErrors().containsKey(ERROR_SKIPPED_PRESERVED));
+    }
+
+    @Test
+    @EnableFlags(com.android.server.backup.Flags.FLAG_ENABLE_METRICS_SETTINGS_BACKUP_AGENTS)
+    public void restoreSettings_agentMetricsAreEnabled_settingIsNotValid_failureIsLogged() {
+        mAgentUnderTest.onCreate(
+            UserHandle.SYSTEM, BackupDestination.CLOUD, OperationType.RESTORE);
+        SettingsBackupAgent.SettingsBackupAllowlist allowlist =
+                new SettingsBackupAgent.SettingsBackupAllowlist(
+                        new String[] {OVERRIDDEN_TEST_SETTING},
+                        /* settingsValidators= */ null);
+        mAgentUnderTest.setSettingsAllowlist(allowlist);
+        mAgentUnderTest.setBlockedSettings();
+        TestSettingsHelper settingsHelper = new TestSettingsHelper(mContext);
+        mAgentUnderTest.mSettingsHelper = settingsHelper;
+
+        byte[] backupData = generateBackupData(TEST_VALUES);
+        mAgentUnderTest
+            .restoreSettings(
+                backupData,
+                /* pos= */ 0,
+                backupData.length,
+                TEST_URI,
+                /* movedToGlobal= */ null,
+                /* movedToSecure= */ null,
+                /* movedToSystem= */ null,
+                /* blockedSettingsArrayId= */ 0,
+                /* dynamicBlockList = */ Collections.emptySet(),
+                /* settingsToPreserve= */ Collections.emptySet(),
+                TEST_KEY);
+
+        DataTypeResult loggingResult =
+            getLoggingResultForDatatype(TEST_KEY, mAgentUnderTest);
+        assertNotNull(loggingResult);
+        assertEquals(loggingResult.getFailCount(), 1);
+        assertTrue(loggingResult.getErrors().containsKey(ERROR_DID_NOT_PASS_VALIDATION));
+    }
+
+    @Test
+    @EnableFlags(com.android.server.backup.Flags.FLAG_ENABLE_METRICS_SETTINGS_BACKUP_AGENTS)
+    public void restoreSettings_agentMetricsAreEnabled_settingIsMarkedAsMovedToGlobal_agentMetricsAreLoggedWithGlobalKey() {
+        mAgentUnderTest.onCreate(
+            UserHandle.SYSTEM, BackupDestination.CLOUD, OperationType.RESTORE);
+        SettingsBackupAgent.SettingsBackupAllowlist allowlist =
+                new SettingsBackupAgent.SettingsBackupAllowlist(
+                        new String[] {OVERRIDDEN_TEST_SETTING},
+                        TEST_VALUES_VALIDATORS);
+        mAgentUnderTest.setSettingsAllowlist(allowlist);
+        mAgentUnderTest.setBlockedSettings();
+        TestSettingsHelper settingsHelper = new TestSettingsHelper(mContext);
+        mAgentUnderTest.mSettingsHelper = settingsHelper;
+
+        byte[] backupData = generateBackupData(TEST_VALUES);
+        mAgentUnderTest
+            .restoreSettings(
+                backupData,
+                /* pos= */ 0,
+                backupData.length,
+                TEST_URI,
+                /* movedToGlobal= */ Set.of(OVERRIDDEN_TEST_SETTING),
+                /* movedToSecure= */ null,
+                /* movedToSystem= */ null,
+                /* blockedSettingsArrayId= */ 0,
+                /* dynamicBlockList= */ Collections.emptySet(),
+                /* settingsToPreserve= */ Collections.emptySet(),
+                TEST_KEY);
+
+        DataTypeResult loggingResult =
+            getLoggingResultForDatatype(KEY_GLOBAL, mAgentUnderTest);
+        assertNotNull(loggingResult);
+        assertEquals(loggingResult.getSuccessCount(), 1);
+        assertNull(getLoggingResultForDatatype(TEST_KEY, mAgentUnderTest));
+    }
+
+    @Test
+    @EnableFlags(com.android.server.backup.Flags.FLAG_ENABLE_METRICS_SETTINGS_BACKUP_AGENTS)
+    public void restoreSettings_agentMetricsAreEnabled_settingIsMarkedAsMovedToSecure_agentMetricsAreLoggedWithSecureKey() {
+        mAgentUnderTest.onCreate(
+            UserHandle.SYSTEM, BackupDestination.CLOUD, OperationType.RESTORE);
+        SettingsBackupAgent.SettingsBackupAllowlist allowlist =
+                new SettingsBackupAgent.SettingsBackupAllowlist(
+                        new String[] {OVERRIDDEN_TEST_SETTING},
+                        TEST_VALUES_VALIDATORS);
+        mAgentUnderTest.setSettingsAllowlist(allowlist);
+        mAgentUnderTest.setBlockedSettings();
+        TestSettingsHelper settingsHelper = new TestSettingsHelper(mContext);
+        mAgentUnderTest.mSettingsHelper = settingsHelper;
+
+        byte[] backupData = generateBackupData(TEST_VALUES);
+        mAgentUnderTest
+            .restoreSettings(
+                backupData,
+                /* pos= */ 0,
+                backupData.length,
+                TEST_URI,
+                /* movedToGlobal= */ null,
+                /* movedToSecure= */ Set.of(OVERRIDDEN_TEST_SETTING),
+                /* movedToSystem= */ null,
+                /* blockedSettingsArrayId= */ 0,
+                /* dynamicBlockList= */ Collections.emptySet(),
+                /* settingsToPreserve= */ Collections.emptySet(),
+                TEST_KEY);
+
+        DataTypeResult loggingResult =
+            getLoggingResultForDatatype(KEY_SECURE, mAgentUnderTest);
+        assertNotNull(loggingResult);
+        assertEquals(loggingResult.getSuccessCount(), 1);
+        assertNull(getLoggingResultForDatatype(TEST_KEY, mAgentUnderTest));
+    }
+
+    @Test
+    @EnableFlags(com.android.server.backup.Flags.FLAG_ENABLE_METRICS_SETTINGS_BACKUP_AGENTS)
+    public void restoreSettings_agentMetricsAreEnabled_settingIsMarkedAsMovedToSystem_agentMetricsAreLoggedWithSystemKey() {
+        mAgentUnderTest.onCreate(
+            UserHandle.SYSTEM, BackupDestination.CLOUD, OperationType.RESTORE);
+        SettingsBackupAgent.SettingsBackupAllowlist allowlist =
+                new SettingsBackupAgent.SettingsBackupAllowlist(
+                        new String[] {OVERRIDDEN_TEST_SETTING},
+                        TEST_VALUES_VALIDATORS);
+        mAgentUnderTest.setSettingsAllowlist(allowlist);
+        mAgentUnderTest.setBlockedSettings();
+        TestSettingsHelper settingsHelper = new TestSettingsHelper(mContext);
+        mAgentUnderTest.mSettingsHelper = settingsHelper;
+
+        byte[] backupData = generateBackupData(TEST_VALUES);
+        mAgentUnderTest
+            .restoreSettings(
+                backupData,
+                /* pos= */ 0,
+                backupData.length,
+                TEST_URI,
+                /* movedToGlobal= */ null,
+                /* movedToSecure= */ null,
+                /* movedToSystem= */ Set.of(OVERRIDDEN_TEST_SETTING),
+                /* blockedSettingsArrayId= */ 0,
+                /* dynamicBlockList= */ Collections.emptySet(),
+                /* settingsToPreserve= */ Collections.emptySet(),
+                TEST_KEY);
+
+        DataTypeResult loggingResult =
+            getLoggingResultForDatatype(KEY_SYSTEM, mAgentUnderTest);
+        assertNotNull(loggingResult);
+        assertEquals(loggingResult.getSuccessCount(), 1);
+        assertNull(getLoggingResultForDatatype(TEST_KEY, mAgentUnderTest));
+    }
+
     private byte[] generateBackupData(Map<String, String> keyValueData) {
         int totalBytes = 0;
         for (String key : keyValueData.keySet()) {
@@ -293,7 +827,8 @@
                 null,
                 R.array.restore_blocked_global_settings,
                 /* dynamicBlockList= */ Collections.emptySet(),
-                /* settingsToPreserve= */ Collections.emptySet());
+                /* settingsToPreserve= */ Collections.emptySet(),
+                TEST_KEY);
     }
 
     private byte[] generateUncorruptedHeader() throws IOException {
@@ -329,6 +864,21 @@
         }
     }
 
+    private DataTypeResult getLoggingResultForDatatype(
+        String dataType, SettingsBackupAgent agent) {
+        if (agent.getBackupRestoreEventLogger() == null) {
+            return null;
+        }
+        List<DataTypeResult> loggingResults =
+            agent.getBackupRestoreEventLogger().getLoggingResults();
+        for (DataTypeResult result : loggingResults) {
+            if (result.getDataType().equals(dataType)) {
+                return result;
+            }
+        }
+        return null;
+    }
+
     private byte[] generateSingleKeyTestBackupData(String key, String value) throws IOException {
         try (ByteArrayOutputStream os = new ByteArrayOutputStream()) {
             os.write(SettingsBackupAgent.toByteArray(key));
@@ -340,7 +890,7 @@
     private static class TestFriendlySettingsBackupAgent extends SettingsBackupAgent {
         private Boolean mForcedDeviceInfoRestoreAcceptability = null;
         private String[] mBlockedSettings = null;
-        private SettingsBackupWhitelist mSettingsWhitelist = null;
+        private SettingsBackupAllowlist mSettingsAllowlist = null;
 
         void setForcedDeviceInfoRestoreAcceptability(boolean value) {
             mForcedDeviceInfoRestoreAcceptability = value;
@@ -350,8 +900,8 @@
             mBlockedSettings = blockedSettings;
         }
 
-        void setSettingsWhitelist(SettingsBackupWhitelist settingsWhitelist) {
-            mSettingsWhitelist = settingsWhitelist;
+        void setSettingsAllowlist(SettingsBackupAllowlist settingsAllowlist) {
+            mSettingsAllowlist = settingsAllowlist;
         }
 
         @Override
@@ -369,12 +919,18 @@
         }
 
         @Override
-        SettingsBackupWhitelist getBackupWhitelist(Uri contentUri) {
-            if (mSettingsWhitelist == null) {
-                return super.getBackupWhitelist(contentUri);
+        SettingsBackupAllowlist getBackupAllowlist(Uri contentUri) {
+            if (mSettingsAllowlist == null) {
+                return super.getBackupAllowlist(contentUri);
             }
 
-            return mSettingsWhitelist;
+            return mSettingsAllowlist;
+        }
+
+        void setNumberOfSettingsPerKey(String key, int numberOfSettings) {
+            if (numberOfSettingsPerKey != null) {
+                this.numberOfSettingsPerKey.put(key, numberOfSettings);
+            }
         }
     }
 
diff --git a/packages/Shell/res/values/defaults.xml b/packages/Shell/res/values/defaults.xml
new file mode 100644
index 0000000..b693cc8
--- /dev/null
+++ b/packages/Shell/res/values/defaults.xml
@@ -0,0 +1,5 @@
+<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+    <!-- Default for Wear bugreport warning activity-->
+    <!-- DO NOT TRANSLATE -->
+    <string name="system_ui_wear_bugreport_warning_activity" />
+</resources>
\ No newline at end of file
diff --git a/packages/Shell/src/com/android/shell/BugreportProgressService.java b/packages/Shell/src/com/android/shell/BugreportProgressService.java
index 9736831..0694b61 100644
--- a/packages/Shell/src/com/android/shell/BugreportProgressService.java
+++ b/packages/Shell/src/com/android/shell/BugreportProgressService.java
@@ -1365,7 +1365,11 @@
      */
     private Intent buildWearWarningIntent() {
         Intent intent = new Intent();
-        intent.setClassName(mContext, getPackageName() + ".WearBugreportWarningActivity");
+        String systemUIPackage = mContext.getResources().getString(
+                com.android.internal.R.string.config_systemUi);
+        String wearBugreportWarningActivity = getResources()
+                .getString(R.string.system_ui_wear_bugreport_warning_activity);
+        intent.setClassName(systemUIPackage, wearBugreportWarningActivity);
         if (mContext.getPackageManager().resolveActivity(intent, /* flags */ 0) == null) {
             Log.e(TAG, "Cannot find wear bugreport warning activity");
             return buildWarningIntent(mContext, /* sendIntent */ null);
diff --git a/packages/SystemUI/AndroidManifest.xml b/packages/SystemUI/AndroidManifest.xml
index 5519b51..11cb070 100644
--- a/packages/SystemUI/AndroidManifest.xml
+++ b/packages/SystemUI/AndroidManifest.xml
@@ -385,6 +385,9 @@
          is ready -->
     <uses-permission android:name="android.permission.OVERRIDE_SYSTEM_KEY_BEHAVIOR_IN_FOCUSED_WINDOW" />
 
+    <!-- To be able to decipher default applications for certain roles in shortcut helper -->
+    <uses-permission android:name="android.permission.MANAGE_DEFAULT_APPLICATIONS" />
+
     <protected-broadcast android:name="com.android.settingslib.action.REGISTER_SLICE_RECEIVER" />
     <protected-broadcast android:name="com.android.settingslib.action.UNREGISTER_SLICE_RECEIVER" />
     <protected-broadcast android:name="com.android.settings.flashlight.action.FLASHLIGHT_CHANGED" />
diff --git a/packages/SystemUI/aconfig/systemui.aconfig b/packages/SystemUI/aconfig/systemui.aconfig
index c1f7868..ee22915 100644
--- a/packages/SystemUI/aconfig/systemui.aconfig
+++ b/packages/SystemUI/aconfig/systemui.aconfig
@@ -1230,13 +1230,6 @@
 }
 
 flag {
-  name: "communal_hub_on_mobile"
-  namespace: "systemui"
-  description: "Brings the glanceable hub experience to mobile phones"
-  bug: "375689917"
-}
-
-flag {
   name: "glanceable_hub_v2"
   namespace: "systemui"
   description: "Gates the refreshed glanceable hub experience that also brings the glanceable hub to mobile phones"
diff --git a/packages/SystemUI/animation/src/com/android/systemui/animation/ActivityTransitionAnimator.kt b/packages/SystemUI/animation/src/com/android/systemui/animation/ActivityTransitionAnimator.kt
index 3eeaf41..41a00f5 100644
--- a/packages/SystemUI/animation/src/com/android/systemui/animation/ActivityTransitionAnimator.kt
+++ b/packages/SystemUI/animation/src/com/android/systemui/animation/ActivityTransitionAnimator.kt
@@ -873,6 +873,9 @@
                     ) {
                         // Raise closing task to "above" layer so it isn't covered.
                         t.setLayer(target.leash, aboveLayers - i)
+                    } else if (TransitionUtil.isOpeningType(change.mode)) {
+                        // Put into the "below" layer space.
+                        t.setLayer(target.leash, belowLayers - i)
                     }
                 } else if (TransitionInfo.isIndependent(change, info)) {
                     // Root tasks
@@ -1153,7 +1156,7 @@
                 // If a [controller.windowAnimatorState] exists, treat this like a takeover.
                 takeOverAnimationInternal(
                     window,
-                    startWindowStates = null,
+                    startWindowState = null,
                     startTransaction = null,
                     callback,
                 )
@@ -1168,22 +1171,23 @@
             callback: IRemoteAnimationFinishedCallback?,
         ) {
             val window = setUpAnimation(apps, callback) ?: return
-            takeOverAnimationInternal(window, startWindowStates, startTransaction, callback)
+            val startWindowState = startWindowStates[apps!!.indexOf(window)]
+            takeOverAnimationInternal(window, startWindowState, startTransaction, callback)
         }
 
         private fun takeOverAnimationInternal(
             window: RemoteAnimationTarget,
-            startWindowStates: Array<WindowAnimationState>?,
+            startWindowState: WindowAnimationState?,
             startTransaction: SurfaceControl.Transaction?,
             callback: IRemoteAnimationFinishedCallback?,
         ) {
             val useSpring =
-                !controller.isLaunching && startWindowStates != null && startTransaction != null
+                !controller.isLaunching && startWindowState != null && startTransaction != null
             startAnimation(
                 window,
                 navigationBar = null,
                 useSpring,
-                startWindowStates,
+                startWindowState,
                 startTransaction,
                 callback,
             )
@@ -1293,7 +1297,7 @@
             window: RemoteAnimationTarget,
             navigationBar: RemoteAnimationTarget? = null,
             useSpring: Boolean = false,
-            startingWindowStates: Array<WindowAnimationState>? = null,
+            startingWindowState: WindowAnimationState? = null,
             startTransaction: SurfaceControl.Transaction? = null,
             iCallback: IRemoteAnimationFinishedCallback? = null,
         ) {
@@ -1339,6 +1343,7 @@
 
             val isExpandingFullyAbove =
                 transitionAnimator.isExpandingFullyAbove(controller.transitionContainer, endState)
+            val windowState = startingWindowState ?: controller.windowAnimatorState
 
             // We animate the opening window and delegate the view expansion to [this.controller].
             val delegate = this.controller
@@ -1361,18 +1366,6 @@
                                 }
                         }
 
-                        // The states are sorted matching the changes inside the transition info.
-                        // Using this info, the RemoteAnimationTargets are created, with their
-                        // prefixOrderIndex fields in reverse order to that of changes. To extract
-                        // the right state, we need to invert again.
-                        val windowState =
-                            if (startingWindowStates != null) {
-                                startingWindowStates[
-                                    startingWindowStates.size - window.prefixOrderIndex]
-                            } else {
-                                controller.windowAnimatorState
-                            }
-
                         // TODO(b/323863002): use the timestamp and velocity to update the initial
                         //   position.
                         val bounds = windowState?.bounds
@@ -1461,12 +1454,6 @@
                         delegate.onTransitionAnimationProgress(state, progress, linearProgress)
                     }
                 }
-            val windowState =
-                if (startingWindowStates != null) {
-                    startingWindowStates[startingWindowStates.size - window.prefixOrderIndex]
-                } else {
-                    controller.windowAnimatorState
-                }
             val velocityPxPerS =
                 if (longLivedReturnAnimationsEnabled() && windowState?.velocityPxPerMs != null) {
                     val xVelocityPxPerS = windowState.velocityPxPerMs.x * 1000
@@ -1485,6 +1472,7 @@
                     fadeWindowBackgroundLayer = !controller.isBelowAnimatingWindow,
                     drawHole = !controller.isBelowAnimatingWindow,
                     startVelocity = velocityPxPerS,
+                    startFrameTime = windowState?.timestamp ?: -1,
                 )
         }
 
diff --git a/packages/SystemUI/animation/src/com/android/systemui/animation/TransitionAnimator.kt b/packages/SystemUI/animation/src/com/android/systemui/animation/TransitionAnimator.kt
index e2bc409..4e889e9 100644
--- a/packages/SystemUI/animation/src/com/android/systemui/animation/TransitionAnimator.kt
+++ b/packages/SystemUI/animation/src/com/android/systemui/animation/TransitionAnimator.kt
@@ -27,6 +27,8 @@
 import android.util.FloatProperty
 import android.util.Log
 import android.util.MathUtils
+import android.util.TimeUtils
+import android.view.Choreographer
 import android.view.View
 import android.view.ViewGroup
 import android.view.ViewGroupOverlay
@@ -366,6 +368,7 @@
         @get:VisibleForTesting val springY: SpringAnimation,
         @get:VisibleForTesting val springScale: SpringAnimation,
         private val springState: SpringState,
+        private val startFrameTime: Long,
         private val onAnimationStart: Runnable,
     ) : Animation {
         @get:VisibleForTesting
@@ -374,6 +377,42 @@
 
         override fun start() {
             onAnimationStart.run()
+
+            // If no start frame time is provided, we start the springs normally.
+            if (startFrameTime < 0) {
+                startSprings()
+                return
+            }
+
+            // This function is not guaranteed to be called inside a frame. We try to access the
+            // frame time immediately, but if we're not inside a frame this will throw an exception.
+            // We must then post a callback to be run at the beginning of the next frame.
+            try {
+                initAndStartSprings(Choreographer.getInstance().frameTime)
+            } catch (_: IllegalStateException) {
+                Choreographer.getInstance().postFrameCallback { frameTimeNanos ->
+                    initAndStartSprings(frameTimeNanos / TimeUtils.NANOS_PER_MS)
+                }
+            }
+        }
+
+        private fun initAndStartSprings(frameTime: Long) {
+            // Initialize the spring as if it had started at the time that its start state
+            // was created.
+            springX.doAnimationFrame(startFrameTime)
+            springY.doAnimationFrame(startFrameTime)
+            springScale.doAnimationFrame(startFrameTime)
+            // Move the spring time forward to the current frame, so it updates its internal state
+            // following the initial momentum over the elapsed time.
+            springX.doAnimationFrame(frameTime)
+            springY.doAnimationFrame(frameTime)
+            springScale.doAnimationFrame(frameTime)
+            // Actually start the spring. We do this after the previous calls because the framework
+            // doesn't like it when you call doAnimationFrame() after start() with an earlier time.
+            startSprings()
+        }
+
+        private fun startSprings() {
             springX.start()
             springY.start()
             springScale.start()
@@ -471,7 +510,9 @@
      * is true.
      *
      * If [startVelocity] (expressed in pixels per second) is not null, a multi-spring animation
-     * using it for the initial momentum will be used instead of the default interpolators.
+     * using it for the initial momentum will be used instead of the default interpolators. In this
+     * case, [startFrameTime] (if non-negative) represents the frame time at which the springs
+     * should be started.
      */
     fun startAnimation(
         controller: Controller,
@@ -480,6 +521,7 @@
         fadeWindowBackgroundLayer: Boolean = true,
         drawHole: Boolean = false,
         startVelocity: PointF? = null,
+        startFrameTime: Long = -1,
     ): Animation {
         if (!controller.isLaunching) assertReturnAnimations()
         if (startVelocity != null) assertLongLivedReturnAnimations()
@@ -502,6 +544,7 @@
                 fadeWindowBackgroundLayer,
                 drawHole,
                 startVelocity,
+                startFrameTime,
             )
             .apply { start() }
     }
@@ -515,6 +558,7 @@
         fadeWindowBackgroundLayer: Boolean = true,
         drawHole: Boolean = false,
         startVelocity: PointF? = null,
+        startFrameTime: Long = -1,
     ): Animation {
         val transitionContainer = controller.transitionContainer
         val transitionContainerOverlay = transitionContainer.overlay
@@ -537,6 +581,7 @@
                 startState,
                 endState,
                 startVelocity,
+                startFrameTime,
                 windowBackgroundLayer,
                 transitionContainer,
                 transitionContainerOverlay,
@@ -722,6 +767,7 @@
         startState: State,
         endState: State,
         startVelocity: PointF,
+        startFrameTime: Long,
         windowBackgroundLayer: GradientDrawable,
         transitionContainer: View,
         transitionContainerOverlay: ViewGroupOverlay,
@@ -912,7 +958,7 @@
                     }
                 }
 
-        return MultiSpringAnimation(springX, springY, springScale, springState) {
+        return MultiSpringAnimation(springX, springY, springScale, springState, startFrameTime) {
             onAnimationStart(
                 controller,
                 isExpandingFullyAbove,
diff --git a/packages/SystemUI/checks/src/com/android/internal/systemui/lint/ShadeDisplayAwareDetector.kt b/packages/SystemUI/checks/src/com/android/internal/systemui/lint/ShadeDisplayAwareDetector.kt
index 2f83d82..92b6fd4 100644
--- a/packages/SystemUI/checks/src/com/android/internal/systemui/lint/ShadeDisplayAwareDetector.kt
+++ b/packages/SystemUI/checks/src/com/android/internal/systemui/lint/ShadeDisplayAwareDetector.kt
@@ -25,6 +25,7 @@
 import com.android.tools.lint.detector.api.Scope
 import com.android.tools.lint.detector.api.Severity
 import com.android.tools.lint.detector.api.SourceCodeScanner
+import com.intellij.psi.PsiParameter
 import org.jetbrains.uast.UClass
 import org.jetbrains.uast.getContainingUFile
 
@@ -40,14 +41,8 @@
                     if (!isInRelevantShadePackage(node)) continue
                     if (IGNORED_PACKAGES.contains(node.qualifiedName)) continue
 
-                    // Check the any context-dependent parameter to see if it has @ShadeDisplayAware
-                    // annotation
                     for (parameter in constructor.parameterList.parameters) {
-                        val shouldReport =
-                            CONTEXT_DEPENDENT_SHADE_CLASSES.contains(
-                                parameter.type.canonicalText
-                            ) && !parameter.hasAnnotation(SHADE_DISPLAY_AWARE_ANNOTATION)
-                        if (shouldReport) {
+                        if (parameter.shouldReport()) {
                             context.report(
                                 issue = ISSUE,
                                 scope = parameter.declarationScope,
@@ -62,20 +57,35 @@
 
     companion object {
         private const val INJECT_ANNOTATION = "javax.inject.Inject"
+        private const val APPLICATION_ANNOTATION =
+            "com.android.systemui.dagger.qualifiers.Application"
+        private const val GLOBAL_CONFIG_ANNOTATION = "com.android.systemui.common.ui.GlobalConfig"
         private const val SHADE_DISPLAY_AWARE_ANNOTATION =
             "com.android.systemui.shade.ShadeDisplayAware"
 
+        private const val CONTEXT = "android.content.Context"
+        private const val WINDOW_MANAGER = "android.view.WindowManager"
+        private const val LAYOUT_INFLATER = "android.view.LayoutInflater"
+        private const val RESOURCES = "android.content.res.Resources"
+        private const val CONFIG_STATE = "com.android.systemui.common.ui.ConfigurationState"
+        private const val CONFIG_CONTROLLER =
+            "com.android.systemui.statusbar.policy.ConfigurationController"
+        private const val CONFIG_INTERACTOR =
+            "com.android.systemui.common.ui.domain.interactor.ConfigurationInteractor"
+
         private val CONTEXT_DEPENDENT_SHADE_CLASSES =
             setOf(
-                "android.content.Context",
-                "android.view.WindowManager",
-                "android.view.LayoutInflater",
-                "android.content.res.Resources",
-                "com.android.systemui.common.ui.ConfigurationState",
-                "com.android.systemui.statusbar.policy.ConfigurationController",
-                "com.android.systemui.common.ui.domain.interactor.ConfigurationInteractor",
+                CONTEXT,
+                WINDOW_MANAGER,
+                LAYOUT_INFLATER,
+                RESOURCES,
+                CONFIG_STATE,
+                CONFIG_CONTROLLER,
+                CONFIG_INTERACTOR,
             )
 
+        private val CONFIG_CLASSES = setOf(CONFIG_STATE, CONFIG_CONTROLLER, CONFIG_INTERACTOR)
+
         private val SHADE_WINDOW_PACKAGES =
             listOf(
                 "com.android.systemui.biometrics",
@@ -93,6 +103,22 @@
                 "com.android.systemui.qs.customize.TileAdapter",
             )
 
+        private fun PsiParameter.shouldReport(): Boolean {
+            val className = type.canonicalText
+
+            // check if the parameter is a context-dependent class relevant to shade
+            if (className !in CONTEXT_DEPENDENT_SHADE_CLASSES) return false
+            // check if it has @ShadeDisplayAware
+            if (hasAnnotation(SHADE_DISPLAY_AWARE_ANNOTATION)) return false
+            // check if its a @Application-annotated Context
+            if (className == CONTEXT && hasAnnotation(APPLICATION_ANNOTATION)) return false
+            // check if its a @GlobalConfig-annotated ConfigurationState, ConfigurationController
+            // or ConfigurationInteractor
+            if (className in CONFIG_CLASSES && hasAnnotation(GLOBAL_CONFIG_ANNOTATION)) return false
+
+            return true
+        }
+
         private fun isInRelevantShadePackage(node: UClass): Boolean {
             val packageName = node.getContainingUFile()?.packageName
             if (packageName.isNullOrBlank()) return false
@@ -102,15 +128,15 @@
         }
 
         private fun reportMsg(className: String) =
-            """UI elements of the shade window
-              |should use ShadeDisplayAware-annotated $className, as the shade might move between windows, and only
-              |@ShadeDisplayAware resources are updated with the new configuration correctly. Failures to do so
-              |might result in wrong dimensions for shade window classes (e.g. using the wrong density or theme).
-              |If the usage of $className is not related to display specific configuration or UI, then there is
-              |technically no need to use the annotation, and you can annotate the class with
-              |@SuppressLint("ShadeDisplayAwareContextChecker")/@Suppress("ShadeDisplayAwareContextChecker")
-              |"""
-                .trimMargin()
+            "UI elements of the shade window should use " +
+                "ShadeDisplayAware-annotated $className, as the shade might move between windows, " +
+                "and only @ShadeDisplayAware resources are updated with the new configuration " +
+                "correctly. Failures to do so might result in wrong dimensions for shade window " +
+                "classes (e.g. using the wrong density or theme). If the usage of $className is " +
+                "not related to display specific configuration or UI, then there is technically " +
+                "no need to use the annotation, and you can annotate the class with " +
+                "@SuppressLint(\"ShadeDisplayAwareContextChecker\")/" +
+                "@Suppress(\"ShadeDisplayAwareContextChecker\")".trimMargin()
 
         @JvmField
         val ISSUE: Issue =
diff --git a/packages/SystemUI/checks/tests/com/android/internal/systemui/lint/ShadeDisplayAwareDetectorTest.kt b/packages/SystemUI/checks/tests/com/android/internal/systemui/lint/ShadeDisplayAwareDetectorTest.kt
index 58ad363..79f1907 100644
--- a/packages/SystemUI/checks/tests/com/android/internal/systemui/lint/ShadeDisplayAwareDetectorTest.kt
+++ b/packages/SystemUI/checks/tests/com/android/internal/systemui/lint/ShadeDisplayAwareDetectorTest.kt
@@ -63,6 +63,26 @@
             )
             .indented()
 
+    private val applicationStub: TestFile =
+        kotlin(
+                """
+                package com.android.systemui.dagger.qualifiers
+
+                @Retention(AnnotationRetention.RUNTIME) annotation class Application
+                """
+            )
+            .indented()
+
+    private val globalConfigStub: TestFile =
+        kotlin(
+                """
+                package com.android.systemui.common.ui
+
+                @Retention(AnnotationRetention.RUNTIME) annotation class GlobalConfig
+                """
+            )
+            .indented()
+
     private val configStateStub: TestFile =
         kotlin(
                 """
@@ -98,6 +118,8 @@
             injectStub,
             qsContext,
             shadeDisplayAwareStub,
+            applicationStub,
+            globalConfigStub,
             configStateStub,
             configControllerStub,
             configInteractorStub,
@@ -259,6 +281,60 @@
     }
 
     @Test
+    fun injectedConstructor_inRelevantPackage_withApplicationAnnotatedContext() {
+        lint()
+            .files(
+                TestFiles.kotlin(
+                    """
+                        package com.android.systemui.shade.example
+
+                        import javax.inject.Inject
+                        import android.content.Context
+                        import com.android.systemui.dagger.qualifiers.Application
+
+                        class ExampleClass
+                            @Inject
+                            constructor(@Application private val context: Context)
+                    """
+                        .trimIndent()
+                ),
+                *androidStubs,
+                *otherStubs,
+            )
+            .issues(ShadeDisplayAwareDetector.ISSUE)
+            .testModes(TestMode.DEFAULT)
+            .run()
+            .expectClean()
+    }
+
+    @Test
+    fun injectedConstructor_inRelevantPackage_withGlobalConfigAnnotatedConfigurationClass() {
+        lint()
+            .files(
+                TestFiles.kotlin(
+                    """
+                        package com.android.systemui.shade.example
+
+                        import javax.inject.Inject
+                        import com.android.systemui.common.ui.ConfigurationState
+                        import com.android.systemui.common.ui.GlobalConfig
+
+                        class ExampleClass
+                            @Inject
+                            constructor(@GlobalConfig private val configState: ConfigurationState)
+                    """
+                        .trimIndent()
+                ),
+                *androidStubs,
+                *otherStubs,
+            )
+            .issues(ShadeDisplayAwareDetector.ISSUE)
+            .testModes(TestMode.DEFAULT)
+            .run()
+            .expectClean()
+    }
+
+    @Test
     fun injectedConstructor_notInRelevantPackage_withRelevantParameter_withoutAnnotation() {
         lint()
             .files(
@@ -363,13 +439,13 @@
     }
 
     private fun errorMsgString(lineNumber: Int, className: String) =
-        """
-        src/com/android/systemui/shade/example/ExampleClass.kt:$lineNumber: Error: UI elements of the shade window
-        should use ShadeDisplayAware-annotated $className, as the shade might move between windows, and only
-        @ShadeDisplayAware resources are updated with the new configuration correctly. Failures to do so
-        might result in wrong dimensions for shade window classes (e.g. using the wrong density or theme).
-        If the usage of $className is not related to display specific configuration or UI, then there is
-        technically no need to use the annotation, and you can annotate the class with
-        @SuppressLint("ShadeDisplayAwareContextChecker")/@Suppress("ShadeDisplayAwareContextChecker")
-    """
+        "src/com/android/systemui/shade/example/ExampleClass.kt:$lineNumber: Error: UI elements of " +
+            "the shade window should use ShadeDisplayAware-annotated $className, as the shade " +
+            "might move between windows, and only @ShadeDisplayAware resources are updated with " +
+            "the new configuration correctly. Failures to do so might result in wrong dimensions " +
+            "for shade window classes (e.g. using the wrong density or theme). If the usage of " +
+            "$className is not related to display specific configuration or UI, then there is " +
+            "technically no need to use the annotation, and you can annotate the class with " +
+            "@SuppressLint(\"ShadeDisplayAwareContextChecker\")" +
+            "/@Suppress(\"ShadeDisplayAwareContextChecker\")"
 }
diff --git a/packages/SystemUI/compose/core/src/com/android/compose/gesture/NestedDraggable.kt b/packages/SystemUI/compose/core/src/com/android/compose/gesture/NestedDraggable.kt
new file mode 100644
index 0000000..9fe85b7
--- /dev/null
+++ b/packages/SystemUI/compose/core/src/com/android/compose/gesture/NestedDraggable.kt
@@ -0,0 +1,497 @@
+/*
+ * 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.compose.gesture
+
+import androidx.compose.foundation.OverscrollEffect
+import androidx.compose.foundation.gestures.Orientation
+import androidx.compose.foundation.gestures.awaitEachGesture
+import androidx.compose.foundation.gestures.awaitFirstDown
+import androidx.compose.foundation.gestures.awaitHorizontalTouchSlopOrCancellation
+import androidx.compose.foundation.gestures.awaitVerticalTouchSlopOrCancellation
+import androidx.compose.foundation.gestures.horizontalDrag
+import androidx.compose.foundation.gestures.verticalDrag
+import androidx.compose.foundation.overscroll
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.geometry.Offset
+import androidx.compose.ui.input.nestedscroll.NestedScrollConnection
+import androidx.compose.ui.input.nestedscroll.NestedScrollDispatcher
+import androidx.compose.ui.input.nestedscroll.NestedScrollSource
+import androidx.compose.ui.input.nestedscroll.nestedScrollModifierNode
+import androidx.compose.ui.input.pointer.AwaitPointerEventScope
+import androidx.compose.ui.input.pointer.PointerEvent
+import androidx.compose.ui.input.pointer.PointerEventPass
+import androidx.compose.ui.input.pointer.PointerId
+import androidx.compose.ui.input.pointer.PointerInputChange
+import androidx.compose.ui.input.pointer.PointerInputScope
+import androidx.compose.ui.input.pointer.SuspendingPointerInputModifierNode
+import androidx.compose.ui.input.pointer.positionChange
+import androidx.compose.ui.input.pointer.util.VelocityTracker
+import androidx.compose.ui.input.pointer.util.addPointerInputChange
+import androidx.compose.ui.node.CompositionLocalConsumerModifierNode
+import androidx.compose.ui.node.DelegatingNode
+import androidx.compose.ui.node.ModifierNodeElement
+import androidx.compose.ui.node.PointerInputModifierNode
+import androidx.compose.ui.node.currentValueOf
+import androidx.compose.ui.platform.LocalViewConfiguration
+import androidx.compose.ui.unit.IntSize
+import androidx.compose.ui.unit.Velocity
+import androidx.compose.ui.util.fastAny
+import com.android.compose.modifiers.thenIf
+import kotlin.math.sign
+import kotlinx.coroutines.CoroutineScope
+import kotlinx.coroutines.CoroutineStart
+import kotlinx.coroutines.launch
+
+/**
+ * A draggable that plays nicely with the nested scroll mechanism.
+ *
+ * This can be used whenever you need a draggable inside a scrollable or a draggable that contains a
+ * scrollable.
+ */
+interface NestedDraggable {
+    /**
+     * Called when a drag is started in the given [position] (*before* dragging the touch slop) and
+     * in the direction given by [sign].
+     */
+    fun onDragStarted(position: Offset, sign: Float): Controller
+
+    /**
+     * Whether this draggable should consume any scroll amount with the given [sign] coming from a
+     * nested scrollable.
+     *
+     * This is called whenever a nested scrollable does not consume some scroll amount. If this
+     * returns `true`, then [onDragStarted] will be called and this draggable will have priority and
+     * consume all future events during preScroll until the nested scroll is finished.
+     */
+    fun shouldConsumeNestedScroll(sign: Float): Boolean
+
+    interface Controller {
+        /**
+         * Drag by [delta] pixels.
+         *
+         * @return the consumed [delta]. Any non-consumed delta will be dispatched to the next
+         *   nested scroll connection to be consumed by any composable above in the hierarchy. If
+         *   the drag was performed on this draggable directly (instead of on a nested scrollable),
+         *   any remaining delta will be used to overscroll this draggable.
+         */
+        fun onDrag(delta: Float): Float
+
+        /**
+         * Stop the current drag with the given [velocity].
+         *
+         * @return the consumed [velocity]. Any non-consumed velocity will be dispatched to the next
+         *   nested scroll connection to be consumed by any composable above in the hierarchy. If
+         *   the drag was performed on this draggable directly (instead of on a nested scrollable),
+         *   any remaining velocity will be used to animate the overscroll of this draggable.
+         */
+        suspend fun onDragStopped(velocity: Float): Float
+    }
+}
+
+/**
+ * A draggable that supports nested scrolling and overscroll effects.
+ *
+ * @see NestedDraggable
+ */
+fun Modifier.nestedDraggable(
+    draggable: NestedDraggable,
+    orientation: Orientation,
+    overscrollEffect: OverscrollEffect? = null,
+    enabled: Boolean = true,
+): Modifier {
+    return this.thenIf(overscrollEffect != null) { Modifier.overscroll(overscrollEffect) }
+        .then(NestedDraggableElement(draggable, orientation, overscrollEffect, enabled))
+}
+
+private data class NestedDraggableElement(
+    private val draggable: NestedDraggable,
+    private val orientation: Orientation,
+    private val overscrollEffect: OverscrollEffect?,
+    private val enabled: Boolean,
+) : ModifierNodeElement<NestedDraggableNode>() {
+    override fun create(): NestedDraggableNode {
+        return NestedDraggableNode(draggable, orientation, overscrollEffect, enabled)
+    }
+
+    override fun update(node: NestedDraggableNode) {
+        node.update(draggable, orientation, overscrollEffect, enabled)
+    }
+}
+
+private class NestedDraggableNode(
+    private var draggable: NestedDraggable,
+    override var orientation: Orientation,
+    private var overscrollEffect: OverscrollEffect?,
+    private var enabled: Boolean,
+) :
+    DelegatingNode(),
+    PointerInputModifierNode,
+    NestedScrollConnection,
+    CompositionLocalConsumerModifierNode,
+    OrientationAware {
+    private val nestedScrollDispatcher = NestedScrollDispatcher()
+    private var trackDownPositionDelegate: SuspendingPointerInputModifierNode? = null
+        set(value) {
+            field?.let { undelegate(it) }
+            field = value?.also { delegate(it) }
+        }
+
+    private var detectDragsDelegate: SuspendingPointerInputModifierNode? = null
+        set(value) {
+            field?.let { undelegate(it) }
+            field = value?.also { delegate(it) }
+        }
+
+    /** The controller created by the nested scroll logic (and *not* the drag logic). */
+    private var nestedScrollController: WrappedController? = null
+        set(value) {
+            field?.ensureOnDragStoppedIsCalled()
+            field = value
+        }
+
+    /**
+     * The last pointer which was the first down since the last time all pointers were up.
+     *
+     * This is use to track the started position of a drag started on a nested scrollable.
+     */
+    private var lastFirstDown: Offset? = null
+
+    init {
+        delegate(nestedScrollModifierNode(this, nestedScrollDispatcher))
+    }
+
+    override fun onDetach() {
+        nestedScrollController?.ensureOnDragStoppedIsCalled()
+    }
+
+    fun update(
+        draggable: NestedDraggable,
+        orientation: Orientation,
+        overscrollEffect: OverscrollEffect?,
+        enabled: Boolean,
+    ) {
+        this.draggable = draggable
+        this.orientation = orientation
+        this.overscrollEffect = overscrollEffect
+        this.enabled = enabled
+
+        trackDownPositionDelegate?.resetPointerInputHandler()
+        detectDragsDelegate?.resetPointerInputHandler()
+        nestedScrollController?.ensureOnDragStoppedIsCalled()
+
+        if (!enabled && trackDownPositionDelegate != null) {
+            check(detectDragsDelegate != null)
+            trackDownPositionDelegate = null
+            detectDragsDelegate = null
+        }
+    }
+
+    override fun onPointerEvent(
+        pointerEvent: PointerEvent,
+        pass: PointerEventPass,
+        bounds: IntSize,
+    ) {
+        if (!enabled) return
+
+        if (trackDownPositionDelegate == null) {
+            check(detectDragsDelegate == null)
+            trackDownPositionDelegate = SuspendingPointerInputModifierNode { trackDownPosition() }
+            detectDragsDelegate = SuspendingPointerInputModifierNode { detectDrags() }
+        }
+
+        checkNotNull(trackDownPositionDelegate).onPointerEvent(pointerEvent, pass, bounds)
+        checkNotNull(detectDragsDelegate).onPointerEvent(pointerEvent, pass, bounds)
+    }
+
+    override fun onCancelPointerInput() {
+        trackDownPositionDelegate?.onCancelPointerInput()
+        detectDragsDelegate?.onCancelPointerInput()
+    }
+
+    /*
+     * ======================================
+     * ===== Pointer input (drag) logic =====
+     * ======================================
+     */
+
+    private suspend fun PointerInputScope.detectDrags() {
+        // Lazily create the velocity tracker when the pointer input restarts.
+        val velocityTracker = VelocityTracker()
+
+        awaitEachGesture {
+            val down = awaitFirstDown(requireUnconsumed = false)
+            var overSlop = 0f
+            val onTouchSlopReached = { change: PointerInputChange, over: Float ->
+                change.consume()
+                overSlop = over
+            }
+
+            suspend fun AwaitPointerEventScope.awaitTouchSlopOrCancellation(
+                pointerId: PointerId
+            ): PointerInputChange? {
+                return when (orientation) {
+                    Orientation.Horizontal ->
+                        awaitHorizontalTouchSlopOrCancellation(pointerId, onTouchSlopReached)
+                    Orientation.Vertical ->
+                        awaitVerticalTouchSlopOrCancellation(pointerId, onTouchSlopReached)
+                }
+            }
+
+            var drag = awaitTouchSlopOrCancellation(down.id)
+
+            // We try to pick-up the drag gesture in case the touch slop swipe was consumed by a
+            // nested scrollable child that disappeared.
+            // This was copied from http://shortn/_10L8U02IoL.
+            // TODO(b/380838584): Reuse detect(Horizontal|Vertical)DragGestures() instead.
+            while (drag == null && currentEvent.changes.fastAny { it.pressed }) {
+                var event: PointerEvent
+                do {
+                    event = awaitPointerEvent()
+                } while (
+                    event.changes.fastAny { it.isConsumed } && event.changes.fastAny { it.pressed }
+                )
+
+                // An event was not consumed and there's still a pointer in the screen.
+                if (event.changes.fastAny { it.pressed }) {
+                    // Await touch slop again, using the initial down as starting point.
+                    // For most cases this should return immediately since we probably moved
+                    // far enough from the initial down event.
+                    drag = awaitTouchSlopOrCancellation(down.id)
+                }
+            }
+
+            if (drag != null) {
+                velocityTracker.resetTracking()
+
+                val sign = (drag.position - down.position).toFloat().sign
+                val wrappedController =
+                    WrappedController(coroutineScope, draggable.onDragStarted(down.position, sign))
+                if (overSlop != 0f) {
+                    onDrag(wrappedController, drag, overSlop, velocityTracker)
+                }
+
+                // If a drag was started, we cancel any other drag started by a nested scrollable.
+                //
+                // Note: we cancel the nested drag here *after* starting the new drag so that in the
+                // STL case, the cancelled drag will not change the current scene of the STL.
+                nestedScrollController?.ensureOnDragStoppedIsCalled()
+
+                val isSuccessful =
+                    try {
+                        val onDrag = { change: PointerInputChange ->
+                            onDrag(
+                                wrappedController,
+                                change,
+                                change.positionChange().toFloat(),
+                                velocityTracker,
+                            )
+                            change.consume()
+                        }
+
+                        when (orientation) {
+                            Orientation.Horizontal -> horizontalDrag(drag.id, onDrag)
+                            Orientation.Vertical -> verticalDrag(drag.id, onDrag)
+                        }
+                    } catch (t: Throwable) {
+                        wrappedController.ensureOnDragStoppedIsCalled()
+                        throw t
+                    }
+
+                if (isSuccessful) {
+                    val maxVelocity = currentValueOf(LocalViewConfiguration).maximumFlingVelocity
+                    val velocity =
+                        velocityTracker
+                            .calculateVelocity(Velocity(maxVelocity, maxVelocity))
+                            .toFloat()
+                    onDragStopped(wrappedController, velocity)
+                } else {
+                    onDragStopped(wrappedController, velocity = 0f)
+                }
+            }
+        }
+    }
+
+    private fun onDrag(
+        controller: NestedDraggable.Controller,
+        change: PointerInputChange,
+        delta: Float,
+        velocityTracker: VelocityTracker,
+    ) {
+        velocityTracker.addPointerInputChange(change)
+
+        scrollWithOverscroll(delta) { deltaFromOverscroll ->
+            scrollWithNestedScroll(deltaFromOverscroll) { deltaFromNestedScroll ->
+                controller.onDrag(deltaFromNestedScroll)
+            }
+        }
+    }
+
+    private fun onDragStopped(controller: WrappedController, velocity: Float) {
+        coroutineScope.launch(start = CoroutineStart.UNDISPATCHED) {
+            try {
+                flingWithOverscroll(velocity) { velocityFromOverscroll ->
+                    flingWithNestedScroll(velocityFromOverscroll) { velocityFromNestedScroll ->
+                        controller.onDragStopped(velocityFromNestedScroll)
+                    }
+                }
+            } finally {
+                controller.ensureOnDragStoppedIsCalled()
+            }
+        }
+    }
+
+    private fun scrollWithOverscroll(delta: Float, performScroll: (Float) -> Float): Float {
+        val effect = overscrollEffect
+        return if (effect != null) {
+            effect
+                .applyToScroll(delta.toOffset(), source = NestedScrollSource.UserInput) {
+                    performScroll(it.toFloat()).toOffset()
+                }
+                .toFloat()
+        } else {
+            performScroll(delta)
+        }
+    }
+
+    private fun scrollWithNestedScroll(delta: Float, performScroll: (Float) -> Float): Float {
+        val preConsumed =
+            nestedScrollDispatcher
+                .dispatchPreScroll(
+                    available = delta.toOffset(),
+                    source = NestedScrollSource.UserInput,
+                )
+                .toFloat()
+        val available = delta - preConsumed
+        val consumed = performScroll(available)
+        val left = available - consumed
+        val postConsumed =
+            nestedScrollDispatcher
+                .dispatchPostScroll(
+                    consumed = (preConsumed + consumed).toOffset(),
+                    available = left.toOffset(),
+                    source = NestedScrollSource.UserInput,
+                )
+                .toFloat()
+        return consumed + preConsumed + postConsumed
+    }
+
+    private suspend fun flingWithOverscroll(
+        velocity: Float,
+        performFling: suspend (Float) -> Float,
+    ) {
+        val effect = overscrollEffect
+        if (effect != null) {
+            effect.applyToFling(velocity.toVelocity()) { performFling(it.toFloat()).toVelocity() }
+        } else {
+            performFling(velocity)
+        }
+    }
+
+    private suspend fun flingWithNestedScroll(
+        velocity: Float,
+        performFling: suspend (Float) -> Float,
+    ): Float {
+        val preConsumed = nestedScrollDispatcher.dispatchPreFling(available = velocity.toVelocity())
+        val available = velocity - preConsumed.toFloat()
+        val consumed = performFling(available)
+        val left = available - consumed
+        return nestedScrollDispatcher
+            .dispatchPostFling(
+                consumed = consumed.toVelocity() + preConsumed,
+                available = left.toVelocity(),
+            )
+            .toFloat()
+    }
+
+    /*
+     * ===============================
+     * ===== Nested scroll logic =====
+     * ===============================
+     */
+
+    private suspend fun PointerInputScope.trackDownPosition() {
+        awaitEachGesture { lastFirstDown = awaitFirstDown(requireUnconsumed = false).position }
+    }
+
+    override fun onPreScroll(available: Offset, source: NestedScrollSource): Offset {
+        val controller = nestedScrollController ?: return Offset.Zero
+        val consumed = controller.onDrag(available.toFloat())
+        return consumed.toOffset()
+    }
+
+    override fun onPostScroll(
+        consumed: Offset,
+        available: Offset,
+        source: NestedScrollSource,
+    ): Offset {
+        if (source == NestedScrollSource.SideEffect) {
+            check(nestedScrollController == null)
+            return Offset.Zero
+        }
+
+        val offset = available.toFloat()
+        if (offset == 0f) {
+            return Offset.Zero
+        }
+
+        val sign = offset.sign
+        if (nestedScrollController == null && draggable.shouldConsumeNestedScroll(sign)) {
+            val startedPosition = checkNotNull(lastFirstDown) { "lastFirstDown is not set" }
+            nestedScrollController =
+                WrappedController(coroutineScope, draggable.onDragStarted(startedPosition, sign))
+        }
+
+        val controller = nestedScrollController ?: return Offset.Zero
+        return controller.onDrag(offset).toOffset()
+    }
+
+    override suspend fun onPreFling(available: Velocity): Velocity {
+        val controller = nestedScrollController ?: return Velocity.Zero
+        nestedScrollController = null
+
+        val consumed = controller.onDragStopped(available.toFloat())
+        return consumed.toVelocity()
+    }
+}
+
+/**
+ * A controller that wraps [delegate] and can be used to ensure that [onDragStopped] is called, but
+ * not more than once.
+ */
+private class WrappedController(
+    private val coroutineScope: CoroutineScope,
+    private val delegate: NestedDraggable.Controller,
+) : NestedDraggable.Controller by delegate {
+    private var onDragStoppedCalled = false
+
+    override fun onDrag(delta: Float): Float {
+        if (onDragStoppedCalled) return 0f
+        return delegate.onDrag(delta)
+    }
+
+    override suspend fun onDragStopped(velocity: Float): Float {
+        if (onDragStoppedCalled) return 0f
+        onDragStoppedCalled = true
+        return delegate.onDragStopped(velocity)
+    }
+
+    fun ensureOnDragStoppedIsCalled() {
+        // Start with UNDISPATCHED so that onDragStopped() is always run until its first suspension
+        // point, even if coroutineScope is cancelled.
+        coroutineScope.launch(start = CoroutineStart.UNDISPATCHED) { onDragStopped(velocity = 0f) }
+    }
+}
diff --git a/packages/SystemUI/compose/core/src/com/android/compose/gesture/OrientationAware.kt b/packages/SystemUI/compose/core/src/com/android/compose/gesture/OrientationAware.kt
new file mode 100644
index 0000000..6e91727
--- /dev/null
+++ b/packages/SystemUI/compose/core/src/com/android/compose/gesture/OrientationAware.kt
@@ -0,0 +1,57 @@
+/*
+ * 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.compose.gesture
+
+import androidx.compose.foundation.gestures.Orientation
+import androidx.compose.ui.geometry.Offset
+import androidx.compose.ui.unit.Velocity
+
+/**
+ * An interface to conveniently convert a [Float] to and from an [Offset] or a [Velocity] given an
+ * [orientation].
+ */
+interface OrientationAware {
+    val orientation: Orientation
+
+    fun Float.toOffset(): Offset {
+        return when (orientation) {
+            Orientation.Horizontal -> Offset(x = this, y = 0f)
+            Orientation.Vertical -> Offset(x = 0f, y = this)
+        }
+    }
+
+    fun Float.toVelocity(): Velocity {
+        return when (orientation) {
+            Orientation.Horizontal -> Velocity(x = this, y = 0f)
+            Orientation.Vertical -> Velocity(x = 0f, y = this)
+        }
+    }
+
+    fun Offset.toFloat(): Float {
+        return when (orientation) {
+            Orientation.Horizontal -> this.x
+            Orientation.Vertical -> this.y
+        }
+    }
+
+    fun Velocity.toFloat(): Float {
+        return when (orientation) {
+            Orientation.Horizontal -> this.x
+            Orientation.Vertical -> this.y
+        }
+    }
+}
diff --git a/packages/SystemUI/compose/core/tests/src/com/android/compose/gesture/NestedDraggableTest.kt b/packages/SystemUI/compose/core/tests/src/com/android/compose/gesture/NestedDraggableTest.kt
new file mode 100644
index 0000000..fd3902f
--- /dev/null
+++ b/packages/SystemUI/compose/core/tests/src/com/android/compose/gesture/NestedDraggableTest.kt
@@ -0,0 +1,443 @@
+/*
+ * 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.compose.gesture
+
+import androidx.compose.foundation.ScrollState
+import androidx.compose.foundation.gestures.Orientation
+import androidx.compose.foundation.horizontalScroll
+import androidx.compose.foundation.layout.Box
+import androidx.compose.foundation.layout.fillMaxSize
+import androidx.compose.foundation.rememberScrollState
+import androidx.compose.foundation.verticalScroll
+import androidx.compose.runtime.Composable
+import androidx.compose.runtime.getValue
+import androidx.compose.runtime.mutableStateOf
+import androidx.compose.runtime.remember
+import androidx.compose.runtime.setValue
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.geometry.Offset
+import androidx.compose.ui.input.nestedscroll.NestedScrollConnection
+import androidx.compose.ui.input.nestedscroll.nestedScroll
+import androidx.compose.ui.platform.LocalViewConfiguration
+import androidx.compose.ui.test.junit4.ComposeContentTestRule
+import androidx.compose.ui.test.junit4.createComposeRule
+import androidx.compose.ui.test.onRoot
+import androidx.compose.ui.test.performTouchInput
+import androidx.compose.ui.test.swipeDown
+import androidx.compose.ui.test.swipeLeft
+import androidx.compose.ui.unit.Velocity
+import com.google.common.truth.Truth.assertThat
+import kotlinx.coroutines.awaitCancellation
+import org.junit.Ignore
+import org.junit.Rule
+import org.junit.Test
+import org.junit.runner.RunWith
+import org.junit.runners.Parameterized
+
+@RunWith(Parameterized::class)
+class NestedDraggableTest(override val orientation: Orientation) : OrientationAware {
+    companion object {
+        @Parameterized.Parameters(name = "{0}")
+        @JvmStatic
+        fun orientations() = listOf(Orientation.Horizontal, Orientation.Vertical)
+    }
+
+    @get:Rule val rule = createComposeRule()
+
+    @Test
+    fun simpleDrag() {
+        val draggable = TestDraggable()
+        val touchSlop =
+            rule.setContentWithTouchSlop {
+                Box(Modifier.fillMaxSize().nestedDraggable(draggable, orientation))
+            }
+
+        assertThat(draggable.onDragStartedCalled).isFalse()
+        assertThat(draggable.onDragCalled).isFalse()
+        assertThat(draggable.onDragStoppedCalled).isFalse()
+
+        var rootCenter = Offset.Zero
+        rule.onRoot().performTouchInput {
+            rootCenter = center
+            down(center)
+            moveBy((touchSlop + 10f).toOffset())
+        }
+
+        assertThat(draggable.onDragStartedCalled).isTrue()
+        assertThat(draggable.onDragCalled).isTrue()
+        assertThat(draggable.onDragDelta).isEqualTo(10f)
+        assertThat(draggable.onDragStartedPosition).isEqualTo(rootCenter)
+        assertThat(draggable.onDragStartedSign).isEqualTo(1f)
+        assertThat(draggable.onDragStoppedCalled).isFalse()
+
+        rule.onRoot().performTouchInput { moveBy(20f.toOffset()) }
+
+        assertThat(draggable.onDragDelta).isEqualTo(30f)
+        assertThat(draggable.onDragStoppedCalled).isFalse()
+
+        rule.onRoot().performTouchInput {
+            moveBy((-15f).toOffset())
+            up()
+        }
+
+        assertThat(draggable.onDragDelta).isEqualTo(15f)
+        assertThat(draggable.onDragStoppedCalled).isTrue()
+    }
+
+    @Test
+    fun nestedScrollable() {
+        val draggable = TestDraggable()
+        val touchSlop =
+            rule.setContentWithTouchSlop {
+                Box(
+                    Modifier.fillMaxSize()
+                        .nestedDraggable(draggable, orientation)
+                        .nestedScrollable(rememberScrollState())
+                )
+            }
+
+        assertThat(draggable.onDragStartedCalled).isFalse()
+        assertThat(draggable.onDragCalled).isFalse()
+        assertThat(draggable.onDragStoppedCalled).isFalse()
+
+        var rootCenter = Offset.Zero
+        rule.onRoot().performTouchInput {
+            rootCenter = center
+            down(center)
+            moveBy((-touchSlop - 10f).toOffset())
+        }
+
+        assertThat(draggable.onDragStartedCalled).isTrue()
+        assertThat(draggable.onDragCalled).isTrue()
+        assertThat(draggable.onDragDelta).isEqualTo(-10f)
+        assertThat(draggable.onDragStartedPosition).isEqualTo(rootCenter)
+        assertThat(draggable.onDragStartedSign).isEqualTo(-1f)
+        assertThat(draggable.onDragStoppedCalled).isFalse()
+
+        rule.onRoot().performTouchInput { moveBy((-20f).toOffset()) }
+
+        assertThat(draggable.onDragStartedCalled).isTrue()
+        assertThat(draggable.onDragCalled).isTrue()
+        assertThat(draggable.onDragDelta).isEqualTo(-30f)
+        assertThat(draggable.onDragStoppedCalled).isFalse()
+
+        rule.onRoot().performTouchInput {
+            moveBy(15f.toOffset())
+            up()
+        }
+
+        assertThat(draggable.onDragStartedCalled).isTrue()
+        assertThat(draggable.onDragCalled).isTrue()
+        assertThat(draggable.onDragDelta).isEqualTo(-15f)
+        assertThat(draggable.onDragStoppedCalled).isTrue()
+    }
+
+    @Test
+    fun onDragStoppedIsCalledWhenDraggableIsUpdatedAndReset() {
+        val draggable = TestDraggable()
+        var orientation by mutableStateOf(orientation)
+        val touchSlop =
+            rule.setContentWithTouchSlop {
+                Box(Modifier.fillMaxSize().nestedDraggable(draggable, orientation))
+            }
+
+        assertThat(draggable.onDragStartedCalled).isFalse()
+
+        rule.onRoot().performTouchInput {
+            down(center)
+            moveBy(touchSlop.toOffset())
+        }
+
+        assertThat(draggable.onDragStartedCalled).isTrue()
+        assertThat(draggable.onDragStoppedCalled).isFalse()
+
+        orientation =
+            when (orientation) {
+                Orientation.Horizontal -> Orientation.Vertical
+                Orientation.Vertical -> Orientation.Horizontal
+            }
+        rule.waitForIdle()
+        assertThat(draggable.onDragStoppedCalled).isTrue()
+    }
+
+    @Test
+    fun onDragStoppedIsCalledWhenDraggableIsUpdatedAndReset_nestedScroll() {
+        val draggable = TestDraggable()
+        var orientation by mutableStateOf(orientation)
+        val touchSlop =
+            rule.setContentWithTouchSlop {
+                Box(
+                    Modifier.fillMaxSize()
+                        .nestedDraggable(draggable, orientation)
+                        .nestedScrollable(rememberScrollState())
+                )
+            }
+
+        assertThat(draggable.onDragStartedCalled).isFalse()
+
+        rule.onRoot().performTouchInput {
+            down(center)
+            moveBy((touchSlop + 1f).toOffset())
+        }
+
+        assertThat(draggable.onDragStartedCalled).isTrue()
+        assertThat(draggable.onDragStoppedCalled).isFalse()
+
+        orientation =
+            when (orientation) {
+                Orientation.Horizontal -> Orientation.Vertical
+                Orientation.Vertical -> Orientation.Horizontal
+            }
+        rule.waitForIdle()
+        assertThat(draggable.onDragStoppedCalled).isTrue()
+    }
+
+    @Test
+    fun onDragStoppedIsCalledWhenDraggableIsRemovedDuringDrag() {
+        val draggable = TestDraggable()
+        var composeContent by mutableStateOf(true)
+        val touchSlop =
+            rule.setContentWithTouchSlop {
+                if (composeContent) {
+                    Box(Modifier.fillMaxSize().nestedDraggable(draggable, orientation))
+                }
+            }
+
+        assertThat(draggable.onDragStartedCalled).isFalse()
+
+        rule.onRoot().performTouchInput {
+            down(center)
+            moveBy(touchSlop.toOffset())
+        }
+
+        assertThat(draggable.onDragStartedCalled).isTrue()
+        assertThat(draggable.onDragStoppedCalled).isFalse()
+
+        composeContent = false
+        rule.waitForIdle()
+        assertThat(draggable.onDragStoppedCalled).isTrue()
+    }
+
+    @Test
+    fun onDragStoppedIsCalledWhenDraggableIsRemovedDuringDrag_nestedScroll() {
+        val draggable = TestDraggable()
+        var composeContent by mutableStateOf(true)
+        val touchSlop =
+            rule.setContentWithTouchSlop {
+                if (composeContent) {
+                    Box(
+                        Modifier.fillMaxSize()
+                            .nestedDraggable(draggable, orientation)
+                            .nestedScrollable(rememberScrollState())
+                    )
+                }
+            }
+
+        assertThat(draggable.onDragStartedCalled).isFalse()
+
+        rule.onRoot().performTouchInput {
+            down(center)
+            moveBy((touchSlop + 1f).toOffset())
+        }
+
+        assertThat(draggable.onDragStartedCalled).isTrue()
+        assertThat(draggable.onDragStoppedCalled).isFalse()
+
+        composeContent = false
+        rule.waitForIdle()
+        assertThat(draggable.onDragStoppedCalled).isTrue()
+    }
+
+    @Test
+    fun onDragStoppedIsCalledWhenDraggableIsRemovedDuringFling() {
+        val draggable = TestDraggable()
+        var composeContent by mutableStateOf(true)
+        var preFlingCalled = false
+        rule.setContent {
+            if (composeContent) {
+                Box(
+                    Modifier.fillMaxSize()
+                        // This nested scroll connection indefinitely suspends on pre fling, so that
+                        // we can emulate what happens when the draggable is removed from
+                        // composition while the pre-fling happens and onDragStopped() was not
+                        // called yet.
+                        .nestedScroll(
+                            remember {
+                                object : NestedScrollConnection {
+                                    override suspend fun onPreFling(available: Velocity): Velocity {
+                                        preFlingCalled = true
+                                        awaitCancellation()
+                                    }
+                                }
+                            }
+                        )
+                        .nestedDraggable(draggable, orientation)
+                )
+            }
+        }
+
+        assertThat(draggable.onDragStartedCalled).isFalse()
+
+        // Swipe down.
+        rule.onRoot().performTouchInput {
+            when (orientation) {
+                Orientation.Horizontal -> swipeLeft()
+                Orientation.Vertical -> swipeDown()
+            }
+        }
+
+        assertThat(draggable.onDragStartedCalled).isTrue()
+        assertThat(draggable.onDragStoppedCalled).isFalse()
+        assertThat(preFlingCalled).isTrue()
+
+        composeContent = false
+        rule.waitForIdle()
+        assertThat(draggable.onDragStoppedCalled).isTrue()
+    }
+
+    @Test
+    @Ignore("b/303224944#comment22")
+    fun onDragStoppedIsCalledWhenNestedScrollableIsRemoved() {
+        val draggable = TestDraggable()
+        var composeNestedScrollable by mutableStateOf(true)
+        val touchSlop =
+            rule.setContentWithTouchSlop {
+                Box(
+                    Modifier.fillMaxSize()
+                        .nestedDraggable(draggable, orientation)
+                        .then(
+                            if (composeNestedScrollable) {
+                                Modifier.nestedScrollable(rememberScrollState())
+                            } else {
+                                Modifier
+                            }
+                        )
+                )
+            }
+
+        assertThat(draggable.onDragStartedCalled).isFalse()
+
+        rule.onRoot().performTouchInput {
+            down(center)
+            moveBy((touchSlop + 1f).toOffset())
+        }
+
+        assertThat(draggable.onDragStartedCalled).isTrue()
+        assertThat(draggable.onDragStoppedCalled).isFalse()
+
+        composeNestedScrollable = false
+        rule.waitForIdle()
+        assertThat(draggable.onDragStoppedCalled).isTrue()
+    }
+
+    @Test
+    fun enabled() {
+        val draggable = TestDraggable()
+        var enabled by mutableStateOf(false)
+        val touchSlop =
+            rule.setContentWithTouchSlop {
+                Box(
+                    Modifier.fillMaxSize()
+                        .nestedDraggable(draggable, orientation, enabled = enabled)
+                )
+            }
+
+        assertThat(draggable.onDragStartedCalled).isFalse()
+
+        rule.onRoot().performTouchInput {
+            down(center)
+            moveBy(touchSlop.toOffset())
+        }
+
+        assertThat(draggable.onDragStartedCalled).isFalse()
+        assertThat(draggable.onDragStoppedCalled).isFalse()
+
+        enabled = true
+        rule.onRoot().performTouchInput {
+            // Release previously up finger.
+            up()
+
+            down(center)
+            moveBy(touchSlop.toOffset())
+        }
+
+        assertThat(draggable.onDragStartedCalled).isTrue()
+        assertThat(draggable.onDragStoppedCalled).isFalse()
+
+        enabled = false
+        rule.waitForIdle()
+        assertThat(draggable.onDragStoppedCalled).isTrue()
+    }
+
+    private fun ComposeContentTestRule.setContentWithTouchSlop(
+        content: @Composable () -> Unit
+    ): Float {
+        var touchSlop = 0f
+        setContent {
+            touchSlop = LocalViewConfiguration.current.touchSlop
+            content()
+        }
+        return touchSlop
+    }
+
+    private fun Modifier.nestedScrollable(scrollState: ScrollState): Modifier {
+        return when (orientation) {
+            Orientation.Vertical -> verticalScroll(scrollState)
+            Orientation.Horizontal -> horizontalScroll(scrollState)
+        }
+    }
+
+    private class TestDraggable(
+        private val onDragStarted: (Offset, Float) -> Unit = { _, _ -> },
+        private val onDrag: (Float) -> Float = { it },
+        private val onDragStopped: suspend (Float) -> Float = { it },
+        private val shouldConsumeNestedScroll: (Float) -> Boolean = { true },
+    ) : NestedDraggable {
+        var onDragStartedCalled = false
+        var onDragCalled = false
+        var onDragStoppedCalled = false
+
+        var onDragStartedPosition = Offset.Zero
+        var onDragStartedSign = 0f
+        var onDragDelta = 0f
+
+        override fun onDragStarted(position: Offset, sign: Float): NestedDraggable.Controller {
+            onDragStartedCalled = true
+            onDragStartedPosition = position
+            onDragStartedSign = sign
+            onDragDelta = 0f
+
+            onDragStarted.invoke(position, sign)
+            return object : NestedDraggable.Controller {
+                override fun onDrag(delta: Float): Float {
+                    onDragCalled = true
+                    onDragDelta += delta
+                    return onDrag.invoke(delta)
+                }
+
+                override suspend fun onDragStopped(velocity: Float): Float {
+                    onDragStoppedCalled = true
+                    return onDragStopped.invoke(velocity)
+                }
+            }
+        }
+
+        override fun shouldConsumeNestedScroll(sign: Float): Boolean {
+            return shouldConsumeNestedScroll.invoke(sign)
+        }
+    }
+}
diff --git a/packages/SystemUI/compose/features/src/com/android/systemui/communal/ui/compose/CommunalContainer.kt b/packages/SystemUI/compose/features/src/com/android/systemui/communal/ui/compose/CommunalContainer.kt
index 4705d8d..beaf963 100644
--- a/packages/SystemUI/compose/features/src/com/android/systemui/communal/ui/compose/CommunalContainer.kt
+++ b/packages/SystemUI/compose/features/src/com/android/systemui/communal/ui/compose/CommunalContainer.kt
@@ -44,7 +44,6 @@
 import com.android.compose.animation.scene.Swipe
 import com.android.compose.animation.scene.observableTransitionState
 import com.android.compose.animation.scene.transitions
-import com.android.systemui.Flags.communalHubOnMobile
 import com.android.systemui.communal.shared.model.CommunalBackgroundType
 import com.android.systemui.communal.shared.model.CommunalScenes
 import com.android.systemui.communal.shared.model.CommunalTransitionKeys
@@ -188,7 +187,7 @@
         scene(
             CommunalScenes.Blank,
             userActions =
-                if (communalHubOnMobile()) emptyMap()
+                if (viewModel.v2FlagEnabled()) emptyMap()
                 else mapOf(Swipe.Start(fromSource = Edge.End) to CommunalScenes.Communal),
         ) {
             // This scene shows nothing only allowing for transitions to the communal scene.
@@ -198,7 +197,8 @@
         scene(
             CommunalScenes.Communal,
             userActions =
-                if (communalHubOnMobile()) emptyMap() else mapOf(Swipe.End to CommunalScenes.Blank),
+                if (viewModel.v2FlagEnabled()) emptyMap()
+                else mapOf(Swipe.End to CommunalScenes.Blank),
         ) {
             CommunalScene(
                 backgroundType = backgroundType,
diff --git a/packages/SystemUI/compose/features/src/com/android/systemui/communal/ui/compose/CommunalContent.kt b/packages/SystemUI/compose/features/src/com/android/systemui/communal/ui/compose/CommunalContent.kt
index 778d7e7..3926b32 100644
--- a/packages/SystemUI/compose/features/src/com/android/systemui/communal/ui/compose/CommunalContent.kt
+++ b/packages/SystemUI/compose/features/src/com/android/systemui/communal/ui/compose/CommunalContent.kt
@@ -24,6 +24,7 @@
 import androidx.compose.ui.Modifier
 import androidx.compose.ui.layout.Layout
 import androidx.compose.ui.unit.IntRect
+import androidx.compose.ui.zIndex
 import com.android.compose.animation.scene.SceneScope
 import com.android.systemui.communal.smartspace.SmartspaceInteractionHandler
 import com.android.systemui.communal.ui.compose.section.AmbientStatusBarSection
@@ -59,7 +60,7 @@
                     Box(modifier = Modifier.fillMaxSize()) {
                         with(communalPopupSection) { Popup() }
                         with(ambientStatusBarSection) {
-                            AmbientStatusBar(modifier = Modifier.fillMaxWidth())
+                            AmbientStatusBar(modifier = Modifier.fillMaxWidth().zIndex(1f))
                         }
                         CommunalHub(
                             viewModel = viewModel,
diff --git a/packages/SystemUI/compose/features/src/com/android/systemui/people/ui/compose/PeopleScreen.kt b/packages/SystemUI/compose/features/src/com/android/systemui/people/ui/compose/PeopleScreen.kt
index 4f1acdc..6591a75 100644
--- a/packages/SystemUI/compose/features/src/com/android/systemui/people/ui/compose/PeopleScreen.kt
+++ b/packages/SystemUI/compose/features/src/com/android/systemui/people/ui/compose/PeopleScreen.kt
@@ -27,6 +27,7 @@
 import androidx.compose.foundation.layout.height
 import androidx.compose.foundation.layout.padding
 import androidx.compose.foundation.layout.size
+import androidx.compose.foundation.layout.safeContentPadding
 import androidx.compose.foundation.rememberScrollState
 import androidx.compose.foundation.shape.RoundedCornerShape
 import androidx.compose.foundation.verticalScroll
@@ -95,7 +96,9 @@
     recentTiles: List<PeopleTileViewModel>,
     onTileClicked: (PeopleTileViewModel) -> Unit,
 ) {
-    Column(Modifier.sysuiResTag("top_level_with_conversations")) {
+    Column(
+        Modifier.fillMaxSize().safeContentPadding().sysuiResTag("top_level_with_conversations")
+    ) {
         Column(
             Modifier.fillMaxWidth().padding(PeopleSpacePadding),
             horizontalAlignment = Alignment.CenterHorizontally,
diff --git a/packages/SystemUI/compose/features/src/com/android/systemui/people/ui/compose/PeopleScreenEmpty.kt b/packages/SystemUI/compose/features/src/com/android/systemui/people/ui/compose/PeopleScreenEmpty.kt
index d483f88..9f582bc 100644
--- a/packages/SystemUI/compose/features/src/com/android/systemui/people/ui/compose/PeopleScreenEmpty.kt
+++ b/packages/SystemUI/compose/features/src/com/android/systemui/people/ui/compose/PeopleScreenEmpty.kt
@@ -27,6 +27,7 @@
 import androidx.compose.foundation.layout.padding
 import androidx.compose.foundation.layout.size
 import androidx.compose.foundation.layout.width
+import androidx.compose.foundation.layout.safeContentPadding
 import androidx.compose.foundation.shape.RoundedCornerShape
 import androidx.compose.material3.Button
 import androidx.compose.material3.ButtonDefaults
@@ -47,7 +48,7 @@
 @Composable
 internal fun PeopleScreenEmpty(onGotItClicked: () -> Unit) {
     Column(
-        Modifier.fillMaxSize().padding(PeopleSpacePadding),
+        Modifier.fillMaxSize().safeContentPadding().padding(PeopleSpacePadding),
         horizontalAlignment = Alignment.CenterHorizontally,
     ) {
         Text(
diff --git a/packages/SystemUI/compose/features/src/com/android/systemui/qs/footer/ui/compose/FooterActions.kt b/packages/SystemUI/compose/features/src/com/android/systemui/qs/footer/ui/compose/FooterActions.kt
index 2d32fd7..f7ce215 100644
--- a/packages/SystemUI/compose/features/src/com/android/systemui/qs/footer/ui/compose/FooterActions.kt
+++ b/packages/SystemUI/compose/features/src/com/android/systemui/qs/footer/ui/compose/FooterActions.kt
@@ -261,7 +261,7 @@
 
 /** A button with an icon. */
 @Composable
-private fun IconButton(model: FooterActionsButtonViewModel, modifier: Modifier = Modifier) {
+fun IconButton(model: FooterActionsButtonViewModel, modifier: Modifier = Modifier) {
     Expandable(
         color = colorAttr(model.backgroundColor),
         shape = CircleShape,
diff --git a/packages/SystemUI/compose/features/src/com/android/systemui/qs/ui/composable/QuickSettingsShadeOverlay.kt b/packages/SystemUI/compose/features/src/com/android/systemui/qs/ui/composable/QuickSettingsShadeOverlay.kt
index 3fce890..b1a1945 100644
--- a/packages/SystemUI/compose/features/src/com/android/systemui/qs/ui/composable/QuickSettingsShadeOverlay.kt
+++ b/packages/SystemUI/compose/features/src/com/android/systemui/qs/ui/composable/QuickSettingsShadeOverlay.kt
@@ -26,8 +26,10 @@
 import androidx.compose.foundation.layout.Column
 import androidx.compose.foundation.layout.fillMaxWidth
 import androidx.compose.foundation.layout.height
-import androidx.compose.foundation.layout.heightIn
 import androidx.compose.foundation.layout.padding
+import androidx.compose.foundation.layout.requiredHeightIn
+import androidx.compose.foundation.rememberScrollState
+import androidx.compose.foundation.verticalScroll
 import androidx.compose.runtime.Composable
 import androidx.compose.runtime.getValue
 import androidx.compose.ui.Alignment
@@ -50,6 +52,8 @@
 import com.android.systemui.qs.panels.ui.compose.EditMode
 import com.android.systemui.qs.panels.ui.compose.TileDetails
 import com.android.systemui.qs.panels.ui.compose.TileGrid
+import com.android.systemui.qs.panels.ui.compose.toolbar.Toolbar
+import com.android.systemui.qs.ui.composable.QuickSettingsShade.Dimensions.GridMaxHeight
 import com.android.systemui.qs.ui.viewmodel.QuickSettingsContainerViewModel
 import com.android.systemui.qs.ui.viewmodel.QuickSettingsShadeOverlayActionsViewModel
 import com.android.systemui.qs.ui.viewmodel.QuickSettingsShadeOverlayContentViewModel
@@ -122,7 +126,9 @@
 // A sealed interface to represent the possible states of the `ShadeBody`
 sealed interface ShadeBodyState {
     data object Editing : ShadeBodyState
+
     data object TileDetails : ShadeBodyState
+
     data object Default : ShadeBodyState
 }
 
@@ -149,9 +155,8 @@
             ShadeBodyState.Editing -> {
                 EditMode(
                     viewModel = viewModel.editModeViewModel,
-                    modifier = Modifier
-                        .fillMaxWidth()
-                        .padding(QuickSettingsShade.Dimensions.Padding),
+                    modifier =
+                        Modifier.fillMaxWidth().padding(QuickSettingsShade.Dimensions.Padding),
                 )
             }
             ShadeBodyState.TileDetails -> {
@@ -182,22 +187,23 @@
                 .padding(
                     start = QuickSettingsShade.Dimensions.Padding,
                     end = QuickSettingsShade.Dimensions.Padding,
-                    top = QuickSettingsShade.Dimensions.Padding,
+                    bottom = QuickSettingsShade.Dimensions.Padding / 2,
                 ),
     ) {
+        Toolbar(viewModel.toolbarViewModelFactory)
         BrightnessSliderContainer(
             viewModel = viewModel.brightnessSliderViewModel,
             modifier =
                 Modifier.fillMaxWidth().height(QuickSettingsShade.Dimensions.BrightnessSliderHeight),
         )
-        Box {
+        Box(
+            modifier =
+                Modifier.requiredHeightIn(max = GridMaxHeight)
+                    .verticalNestedScrollToScene()
+                    .verticalScroll(rememberScrollState())
+        ) {
             GridAnchor()
-            TileGrid(
-                viewModel = viewModel.tileGridViewModel,
-                modifier =
-                    Modifier.fillMaxWidth()
-                        .heightIn(max = QuickSettingsShade.Dimensions.GridMaxHeight),
-            )
+            TileGrid(viewModel = viewModel.tileGridViewModel, modifier = Modifier.fillMaxWidth())
         }
     }
 }
@@ -207,6 +213,6 @@
     object Dimensions {
         val Padding = 16.dp
         val BrightnessSliderHeight = 64.dp
-        val GridMaxHeight = 800.dp
+        val GridMaxHeight = 420.dp
     }
 }
diff --git a/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/DraggableHandler.kt b/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/DraggableHandler.kt
index caf5e41..2d589f3 100644
--- a/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/DraggableHandler.kt
+++ b/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/DraggableHandler.kt
@@ -27,8 +27,11 @@
 import com.android.compose.nestedscroll.OnStopScope
 import com.android.compose.nestedscroll.PriorityNestedScrollConnection
 import com.android.compose.nestedscroll.ScrollController
+import com.android.compose.ui.util.SpaceVectorConverter
 import kotlin.math.absoluteValue
+import kotlinx.coroutines.NonCancellable
 import kotlinx.coroutines.launch
+import kotlinx.coroutines.withContext
 
 internal interface DraggableHandler {
     /**
@@ -191,9 +194,15 @@
     private val draggableHandler: DraggableHandlerImpl,
     val swipes: Swipes,
     var swipeAnimation: SwipeAnimation<*>,
-) : DragController {
+) : DragController, SpaceVectorConverter by SpaceVectorConverter(draggableHandler.orientation) {
     val layoutState = draggableHandler.layoutImpl.state
 
+    val overscrollableContent: OverscrollableContent =
+        when (draggableHandler.orientation) {
+            Orientation.Vertical -> draggableHandler.layoutImpl.verticalOverscrollableContent
+            Orientation.Horizontal -> draggableHandler.layoutImpl.horizontalOverscrollableContent
+        }
+
     /**
      * Whether this handle is active. If this returns false, calling [onDrag] and [onStop] will do
      * nothing.
@@ -224,36 +233,75 @@
      * @return the consumed delta
      */
     override fun onDrag(delta: Float): Float {
-        return onDrag(delta, swipeAnimation)
-    }
-
-    private fun <T : ContentKey> onDrag(delta: Float, swipeAnimation: SwipeAnimation<T>): Float {
-        if (delta == 0f || !isDrivingTransition || swipeAnimation.isAnimatingOffset()) {
+        val initialAnimation = swipeAnimation
+        if (delta == 0f || !isDrivingTransition || initialAnimation.isAnimatingOffset()) {
             return 0f
         }
+        // swipeAnimation can change during the gesture, we want to always use the initial reference
+        // during the whole drag gesture.
+        return dragWithOverscroll(delta, animation = initialAnimation)
+    }
 
-        val distance = swipeAnimation.distance()
-        val previousOffset = swipeAnimation.dragOffset
+    private fun <T : ContentKey> dragWithOverscroll(
+        delta: Float,
+        animation: SwipeAnimation<T>,
+    ): Float {
+        require(delta != 0f) { "delta should not be 0" }
+        var overscrollEffect = overscrollableContent.currentOverscrollEffect
+
+        // If we're already overscrolling, continue with the current effect for a smooth finish.
+        if (overscrollEffect == null || !overscrollEffect.isInProgress) {
+            // Otherwise, determine the target content (toContent or fromContent) for the new
+            // overscroll effect based on the gesture's direction.
+            val content = animation.contentByDirection(delta)
+            overscrollEffect = overscrollableContent.applyOverscrollEffectOn(content)
+        }
+
+        // TODO(b/378470603) Remove this check once NestedDraggable is used to handle drags.
+        if (!overscrollEffect.node.node.isAttached) {
+            return drag(delta, animation)
+        }
+
+        return overscrollEffect
+            .applyToScroll(
+                delta = delta.toOffset(),
+                source = NestedScrollSource.UserInput,
+                performScroll = {
+                    val preScrollAvailable = it.toFloat()
+                    drag(preScrollAvailable, animation).toOffset()
+                },
+            )
+            .toFloat()
+    }
+
+    private fun <T : ContentKey> drag(delta: Float, animation: SwipeAnimation<T>): Float {
+        if (delta == 0f) return 0f
+
+        val distance = animation.distance()
+        val previousOffset = animation.dragOffset
         val desiredOffset = previousOffset + delta
-        val desiredProgress = swipeAnimation.computeProgress(desiredOffset)
+        val desiredProgress = animation.computeProgress(desiredOffset)
 
-        // Note: the distance could be negative if fromContent is above or to the left of
-        // toContent.
+        // Note: the distance could be negative if fromContent is above or to the left of toContent.
         val newOffset =
             when {
                 distance == DistanceUnspecified ||
-                    swipeAnimation.contentTransition.isWithinProgressRange(desiredProgress) ->
+                    animation.contentTransition.isWithinProgressRange(desiredProgress) ->
                     desiredOffset
                 distance > 0f -> desiredOffset.fastCoerceIn(0f, distance)
                 else -> desiredOffset.fastCoerceIn(distance, 0f)
             }
 
-        swipeAnimation.dragOffset = newOffset
+        animation.dragOffset = newOffset
         return newOffset - previousOffset
     }
 
     override suspend fun onStop(velocity: Float, canChangeContent: Boolean): Float {
-        return onStop(velocity, canChangeContent, swipeAnimation)
+        // To ensure that any ongoing animation completes gracefully and avoids an undefined state,
+        // we execute the actual `onStop` logic in a non-cancellable context. This prevents the
+        // coroutine from being cancelled prematurely, which could interrupt the animation.
+        // TODO(b/378470603) Remove this check once NestedDraggable is used to handle drags.
+        return withContext(NonCancellable) { onStop(velocity, canChangeContent, swipeAnimation) }
     }
 
     private suspend fun <T : ContentKey> onStop(
@@ -304,7 +352,22 @@
                 fromContent
             }
 
-        return swipeAnimation.animateOffset(velocity, targetContent)
+        val overscrollEffect = overscrollableContent.applyOverscrollEffectOn(targetContent)
+
+        // TODO(b/378470603) Remove this check once NestedDraggable is used to handle drags.
+        if (!overscrollEffect.node.node.isAttached) {
+            return swipeAnimation.animateOffset(velocity, targetContent)
+        }
+
+        overscrollEffect.applyToFling(
+            velocity = velocity.toVelocity(),
+            performFling = {
+                val velocityLeft = it.toFloat()
+                swipeAnimation.animateOffset(velocityLeft, targetContent).toVelocity()
+            },
+        )
+
+        return velocity
     }
 
     /**
diff --git a/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/SceneTransitionLayout.kt b/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/SceneTransitionLayout.kt
index a14b2b3..bf7e8e8 100644
--- a/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/SceneTransitionLayout.kt
+++ b/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/SceneTransitionLayout.kt
@@ -36,6 +36,7 @@
 import androidx.compose.ui.unit.IntOffset
 import androidx.compose.ui.unit.IntSize
 import androidx.compose.ui.unit.LayoutDirection
+import com.android.compose.animation.scene.effect.ContentOverscrollEffect
 
 /**
  * [SceneTransitionLayout] is a container that automatically animates its content whenever its state
@@ -283,6 +284,53 @@
 @ElementDsl
 interface ContentScope : BaseContentScope {
     /**
+     * The overscroll effect applied to the content in the vertical direction. This can be used to
+     * customize how the content behaves when the scene is over scrolled.
+     *
+     * For example, you can use it with the `Modifier.overscroll()` modifier:
+     * ```kotlin
+     * @Composable
+     * fun ContentScope.MyScene() {
+     *     Box(
+     *         modifier = Modifier
+     *             // Apply the effect
+     *             .overscroll(verticalOverscrollEffect)
+     *     ) {
+     *         // ... your content ...
+     *     }
+     * }
+     * ```
+     *
+     * Or you can read the `overscrollDistance` value directly, if you need some custom overscroll
+     * behavior:
+     * ```kotlin
+     * @Composable
+     * fun ContentScope.MyScene() {
+     *     Box(
+     *         modifier = Modifier
+     *             .graphicsLayer {
+     *                 // Translate half of the overscroll
+     *                 translationY = verticalOverscrollEffect.overscrollDistance * 0.5f
+     *             }
+     *     ) {
+     *         // ... your content ...
+     *     }
+     * }
+     * ```
+     *
+     * @see horizontalOverscrollEffect
+     */
+    val verticalOverscrollEffect: ContentOverscrollEffect
+
+    /**
+     * The overscroll effect applied to the content in the horizontal direction. This can be used to
+     * customize how the content behaves when the scene is over scrolled.
+     *
+     * @see verticalOverscrollEffect
+     */
+    val horizontalOverscrollEffect: ContentOverscrollEffect
+
+    /**
      * Animate some value at the content level.
      *
      * @param value the value of this shared value in the current content.
diff --git a/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/SceneTransitionLayoutImpl.kt b/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/SceneTransitionLayoutImpl.kt
index bdc1461..d7bac14 100644
--- a/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/SceneTransitionLayoutImpl.kt
+++ b/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/SceneTransitionLayoutImpl.kt
@@ -49,8 +49,10 @@
 import com.android.compose.animation.scene.content.Overlay
 import com.android.compose.animation.scene.content.Scene
 import com.android.compose.animation.scene.content.state.TransitionState
+import com.android.compose.animation.scene.effect.GestureEffect
 import com.android.compose.ui.util.lerp
 import kotlinx.coroutines.CoroutineScope
+import kotlinx.coroutines.launch
 
 /** The type for the content of movable elements. */
 internal typealias MovableElementContent = @Composable (@Composable () -> Unit) -> Unit
@@ -134,6 +136,18 @@
                     _movableContents = it
                 }
 
+    internal var horizontalOverscrollableContent =
+        OverscrollableContent(
+            animationScope = animationScope,
+            overscrollEffect = { content(it).scope.horizontalOverscrollGestureEffect },
+        )
+
+    internal var verticalOverscrollableContent =
+        OverscrollableContent(
+            animationScope = animationScope,
+            overscrollEffect = { content(it).scope.verticalOverscrollGestureEffect },
+        )
+
     /**
      * The different values of a shared value keyed by a a [ValueKey] and the different elements and
      * contents it is associated to.
@@ -561,3 +575,23 @@
         return layout(width, height) { placeable.place(0, 0) }
     }
 }
+
+internal class OverscrollableContent(
+    private val animationScope: CoroutineScope,
+    private val overscrollEffect: (ContentKey) -> GestureEffect,
+) {
+    private var currentContent: ContentKey? = null
+    var currentOverscrollEffect: GestureEffect? = null
+
+    fun applyOverscrollEffectOn(contentKey: ContentKey): GestureEffect {
+        if (currentContent == contentKey) return currentOverscrollEffect!!
+
+        currentOverscrollEffect?.apply { animationScope.launch { ensureApplyToFlingIsCalled() } }
+
+        // We are wrapping the overscroll effect.
+        val overscrollEffect = overscrollEffect(contentKey)
+        currentContent = contentKey
+        currentOverscrollEffect = overscrollEffect
+        return overscrollEffect
+    }
+}
diff --git a/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/SwipeAnimation.kt b/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/SwipeAnimation.kt
index ae235e5..35cdf81 100644
--- a/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/SwipeAnimation.kt
+++ b/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/SwipeAnimation.kt
@@ -313,6 +313,17 @@
 
     fun isAnimatingOffset(): Boolean = offsetAnimation != null
 
+    /** Get the [ContentKey] ([fromContent] or [toContent]) associated to the current [direction] */
+    fun contentByDirection(direction: Float): T {
+        require(direction != 0f) { "Cannot find a content in this direction: $direction" }
+        val isDirectionToContent = (isUpOrLeft && direction < 0) || (!isUpOrLeft && direction > 0)
+        return if (isDirectionToContent) {
+            toContent
+        } else {
+            fromContent
+        }
+    }
+
     /**
      * Animate the offset to a [targetContent], using the [initialVelocity] and an optional [spec]
      *
diff --git a/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/content/Content.kt b/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/content/Content.kt
index 8c4cd8c..152f05e 100644
--- a/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/content/Content.kt
+++ b/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/content/Content.kt
@@ -17,6 +17,7 @@
 package com.android.compose.animation.scene.content
 
 import android.annotation.SuppressLint
+import androidx.compose.foundation.gestures.Orientation
 import androidx.compose.foundation.layout.Box
 import androidx.compose.runtime.Composable
 import androidx.compose.runtime.Stable
@@ -51,6 +52,9 @@
 import com.android.compose.animation.scene.UserActionResult
 import com.android.compose.animation.scene.ValueKey
 import com.android.compose.animation.scene.animateSharedValueAsState
+import com.android.compose.animation.scene.effect.GestureEffect
+import com.android.compose.animation.scene.effect.OffsetOverscrollEffect
+import com.android.compose.animation.scene.effect.VisualEffect
 import com.android.compose.animation.scene.element
 import com.android.compose.animation.scene.modifiers.noResizeDuringTransitions
 import com.android.compose.animation.scene.nestedScrollToScene
@@ -109,6 +113,26 @@
 
     override val layoutState: SceneTransitionLayoutState = layoutImpl.state
 
+    private val _verticalOverscrollEffect =
+        OffsetOverscrollEffect(
+            orientation = Orientation.Vertical,
+            animationScope = layoutImpl.animationScope,
+        )
+
+    private val _horizontalOverscrollEffect =
+        OffsetOverscrollEffect(
+            orientation = Orientation.Horizontal,
+            animationScope = layoutImpl.animationScope,
+        )
+
+    val verticalOverscrollGestureEffect = GestureEffect(_verticalOverscrollEffect)
+
+    val horizontalOverscrollGestureEffect = GestureEffect(_horizontalOverscrollEffect)
+
+    override val verticalOverscrollEffect = VisualEffect(_verticalOverscrollEffect)
+
+    override val horizontalOverscrollEffect = VisualEffect(_horizontalOverscrollEffect)
+
     override fun Modifier.element(key: ElementKey): Modifier {
         return element(layoutImpl, content, key)
     }
diff --git a/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/effect/ContentOverscrollEffect.kt b/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/effect/ContentOverscrollEffect.kt
new file mode 100644
index 0000000..2233deb
--- /dev/null
+++ b/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/effect/ContentOverscrollEffect.kt
@@ -0,0 +1,173 @@
+/*
+ * 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.compose.animation.scene.effect
+
+import androidx.compose.animation.core.Animatable
+import androidx.compose.animation.core.AnimationSpec
+import androidx.compose.foundation.OverscrollEffect
+import androidx.compose.foundation.gestures.Orientation
+import androidx.compose.ui.geometry.Offset
+import androidx.compose.ui.input.nestedscroll.NestedScrollSource
+import androidx.compose.ui.unit.Velocity
+import com.android.compose.ui.util.SpaceVectorConverter
+import kotlin.math.abs
+import kotlin.math.sign
+import kotlinx.coroutines.CoroutineScope
+import kotlinx.coroutines.coroutineScope
+import kotlinx.coroutines.launch
+
+/**
+ * An [OverscrollEffect] that uses an [Animatable] to track and animate overscroll values along a
+ * specific [Orientation].
+ */
+interface ContentOverscrollEffect : OverscrollEffect {
+    /** The current overscroll value. */
+    val overscrollDistance: Float
+}
+
+open class BaseContentOverscrollEffect(
+    orientation: Orientation,
+    private val animationScope: CoroutineScope,
+    private val animationSpec: AnimationSpec<Float>,
+) : ContentOverscrollEffect, SpaceVectorConverter by SpaceVectorConverter(orientation) {
+
+    /** The [Animatable] that holds the current overscroll value. */
+    private val animatable = Animatable(initialValue = 0f, visibilityThreshold = 0.5f)
+
+    override val overscrollDistance: Float
+        get() = animatable.value
+
+    override val isInProgress: Boolean
+        get() = overscrollDistance != 0f
+
+    override fun applyToScroll(
+        delta: Offset,
+        source: NestedScrollSource,
+        performScroll: (Offset) -> Offset,
+    ): Offset {
+        val deltaForAxis = delta.toFloat()
+
+        // If we're currently overscrolled, and the user scrolls in the opposite direction, we need
+        // to "relax" the overscroll by consuming some of the scroll delta to bring it back towards
+        // zero.
+        val currentOffset = animatable.value
+        val sameDirection = deltaForAxis.sign == currentOffset.sign
+        val consumedByPreScroll =
+            if (abs(currentOffset) > 0.5 && !sameDirection) {
+                    // The user has scrolled in the opposite direction.
+                    val prevOverscrollValue = currentOffset
+                    val newOverscrollValue = currentOffset + deltaForAxis
+                    if (sign(prevOverscrollValue) != sign(newOverscrollValue)) {
+                        // Enough to completely cancel the overscroll. We snap the overscroll value
+                        // back to zero and consume the corresponding amount of the scroll delta.
+                        animationScope.launch { animatable.snapTo(0f) }
+                        -prevOverscrollValue
+                    } else {
+                        // Not enough to cancel the overscroll. We update the overscroll value
+                        // accordingly and consume the entire scroll delta.
+                        animationScope.launch { animatable.snapTo(newOverscrollValue) }
+                        deltaForAxis
+                    }
+                } else {
+                    0f
+                }
+                .toOffset()
+
+        // After handling any overscroll relaxation, we pass the remaining scroll delta to the
+        // standard scrolling logic.
+        val leftForScroll = delta - consumedByPreScroll
+        val consumedByScroll = performScroll(leftForScroll)
+        val overscrollDelta = leftForScroll - consumedByScroll
+
+        // If the user is dragging (not flinging), and there's any remaining scroll delta after the
+        // standard scrolling logic has been applied, we add it to the overscroll.
+        if (abs(overscrollDelta.toFloat()) > 0.5 && source == NestedScrollSource.UserInput) {
+            animationScope.launch { animatable.snapTo(currentOffset + overscrollDelta.toFloat()) }
+        }
+
+        return delta
+    }
+
+    override suspend fun applyToFling(
+        velocity: Velocity,
+        performFling: suspend (Velocity) -> Velocity,
+    ) {
+        // We launch a coroutine to ensure the fling animation starts after any pending [snapTo]
+        // animations have finished.
+        // This guarantees a smooth, sequential execution of animations on the overscroll value.
+        coroutineScope {
+            launch {
+                val consumed = performFling(velocity)
+                val remaining = velocity - consumed
+                animatable.animateTo(0f, animationSpec, remaining.toFloat())
+            }
+        }
+    }
+}
+
+/** An overscroll effect that ensures only a single fling animation is triggered. */
+internal class GestureEffect(private val delegate: ContentOverscrollEffect) :
+    ContentOverscrollEffect by delegate {
+    private var shouldFling = false
+
+    override fun applyToScroll(
+        delta: Offset,
+        source: NestedScrollSource,
+        performScroll: (Offset) -> Offset,
+    ): Offset {
+        shouldFling = true
+        return delegate.applyToScroll(delta, source, performScroll)
+    }
+
+    override suspend fun applyToFling(
+        velocity: Velocity,
+        performFling: suspend (Velocity) -> Velocity,
+    ) {
+        if (!shouldFling) {
+            performFling(velocity)
+            return
+        }
+        shouldFling = false
+        delegate.applyToFling(velocity, performFling)
+    }
+
+    suspend fun ensureApplyToFlingIsCalled() {
+        applyToFling(Velocity.Zero) { Velocity.Zero }
+    }
+}
+
+/**
+ * An overscroll effect that only applies visual effects and does not interfere with the actual
+ * scrolling or flinging behavior.
+ */
+internal class VisualEffect(private val delegate: ContentOverscrollEffect) :
+    ContentOverscrollEffect by delegate {
+    override fun applyToScroll(
+        delta: Offset,
+        source: NestedScrollSource,
+        performScroll: (Offset) -> Offset,
+    ): Offset {
+        return performScroll(delta)
+    }
+
+    override suspend fun applyToFling(
+        velocity: Velocity,
+        performFling: suspend (Velocity) -> Velocity,
+    ) {
+        performFling(velocity)
+    }
+}
diff --git a/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/effect/OffsetOverscrollEffect.kt b/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/effect/OffsetOverscrollEffect.kt
new file mode 100644
index 0000000..f459c46
--- /dev/null
+++ b/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/effect/OffsetOverscrollEffect.kt
@@ -0,0 +1,100 @@
+/*
+ * 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.compose.animation.scene.effect
+
+import androidx.annotation.VisibleForTesting
+import androidx.compose.animation.core.AnimationSpec
+import androidx.compose.animation.core.Spring
+import androidx.compose.animation.core.spring
+import androidx.compose.foundation.OverscrollEffect
+import androidx.compose.foundation.gestures.Orientation
+import androidx.compose.runtime.Composable
+import androidx.compose.runtime.remember
+import androidx.compose.runtime.rememberCoroutineScope
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.layout.Measurable
+import androidx.compose.ui.layout.MeasureResult
+import androidx.compose.ui.layout.MeasureScope
+import androidx.compose.ui.node.DelegatableNode
+import androidx.compose.ui.node.LayoutModifierNode
+import androidx.compose.ui.unit.Constraints
+import androidx.compose.ui.unit.Density
+import androidx.compose.ui.unit.dp
+import com.android.compose.animation.scene.ProgressConverter
+import kotlin.math.roundToInt
+import kotlinx.coroutines.CoroutineScope
+
+/** An [OverscrollEffect] that offsets the content by the overscroll value. */
+class OffsetOverscrollEffect(
+    orientation: Orientation,
+    animationScope: CoroutineScope,
+    animationSpec: AnimationSpec<Float> = DefaultAnimationSpec,
+) : BaseContentOverscrollEffect(orientation, animationScope, animationSpec) {
+    private var _node: DelegatableNode = newNode()
+    override val node: DelegatableNode
+        get() = _node
+
+    fun newNode(): DelegatableNode {
+        return object : Modifier.Node(), LayoutModifierNode {
+            override fun onDetach() {
+                super.onDetach()
+                // TODO(b/379086317) Remove this workaround: avoid to reuse the same node.
+                _node = newNode()
+            }
+
+            override fun MeasureScope.measure(
+                measurable: Measurable,
+                constraints: Constraints,
+            ): MeasureResult {
+                val placeable = measurable.measure(constraints)
+                return layout(placeable.width, placeable.height) {
+                    val offsetPx = computeOffset(density = this@measure, overscrollDistance)
+                    placeable.placeRelativeWithLayer(position = offsetPx.toIntOffset())
+                }
+            }
+        }
+    }
+
+    companion object {
+        private val MaxDistance = 400.dp
+
+        internal val DefaultAnimationSpec =
+            spring(
+                stiffness = Spring.StiffnessLow,
+                dampingRatio = Spring.DampingRatioLowBouncy,
+                visibilityThreshold = 0.5f,
+            )
+
+        @VisibleForTesting
+        internal fun computeOffset(density: Density, overscrollDistance: Float): Int {
+            val maxDistancePx = with(density) { MaxDistance.toPx() }
+            val progress = ProgressConverter.Default.convert(overscrollDistance / maxDistancePx)
+            return (progress * maxDistancePx).roundToInt()
+        }
+    }
+}
+
+@Composable
+fun rememberOffsetOverscrollEffect(
+    orientation: Orientation,
+    animationSpec: AnimationSpec<Float> = OffsetOverscrollEffect.DefaultAnimationSpec,
+): OffsetOverscrollEffect {
+    val animationScope = rememberCoroutineScope()
+    return remember(orientation, animationScope, animationSpec) {
+        OffsetOverscrollEffect(orientation, animationScope, animationSpec)
+    }
+}
diff --git a/packages/SystemUI/compose/scene/src/com/android/compose/nestedscroll/LargeTopAppBarNestedScrollConnection.kt b/packages/SystemUI/compose/scene/src/com/android/compose/nestedscroll/LargeTopAppBarNestedScrollConnection.kt
index a5be4dc..98a0017 100644
--- a/packages/SystemUI/compose/scene/src/com/android/compose/nestedscroll/LargeTopAppBarNestedScrollConnection.kt
+++ b/packages/SystemUI/compose/scene/src/com/android/compose/nestedscroll/LargeTopAppBarNestedScrollConnection.kt
@@ -48,8 +48,8 @@
         orientation = Orientation.Vertical,
         // When swiping up, the LargeTopAppBar will shrink (to [minHeight]) and the content will
         // expand. Then, you can then scroll down the content.
-        canStartPreScroll = { offsetAvailable, offsetBeforeStart, _ ->
-            offsetAvailable < 0 && offsetBeforeStart == 0f && height() > minHeight()
+        canStartPreScroll = { offsetAvailable, _, _ ->
+            offsetAvailable < 0 && height() > minHeight()
         },
         // When swiping down, the content will scroll up until it reaches the top. Then, the
         // LargeTopAppBar will expand until it reaches its [maxHeight].
diff --git a/packages/SystemUI/compose/scene/tests/src/com/android/compose/animation/scene/ElementTest.kt b/packages/SystemUI/compose/scene/tests/src/com/android/compose/animation/scene/ElementTest.kt
index a301856..f1da01f 100644
--- a/packages/SystemUI/compose/scene/tests/src/com/android/compose/animation/scene/ElementTest.kt
+++ b/packages/SystemUI/compose/scene/tests/src/com/android/compose/animation/scene/ElementTest.kt
@@ -30,6 +30,7 @@
 import androidx.compose.foundation.layout.fillMaxSize
 import androidx.compose.foundation.layout.offset
 import androidx.compose.foundation.layout.size
+import androidx.compose.foundation.overscroll
 import androidx.compose.foundation.pager.HorizontalPager
 import androidx.compose.foundation.pager.PagerState
 import androidx.compose.material3.Text
@@ -47,6 +48,7 @@
 import androidx.compose.ui.geometry.Offset
 import androidx.compose.ui.layout.approachLayout
 import androidx.compose.ui.layout.layout
+import androidx.compose.ui.platform.LocalDensity
 import androidx.compose.ui.platform.LocalViewConfiguration
 import androidx.compose.ui.platform.testTag
 import androidx.compose.ui.test.assertIsDisplayed
@@ -60,6 +62,7 @@
 import androidx.compose.ui.test.onNodeWithTag
 import androidx.compose.ui.test.onRoot
 import androidx.compose.ui.test.performTouchInput
+import androidx.compose.ui.unit.Density
 import androidx.compose.ui.unit.Dp
 import androidx.compose.ui.unit.DpOffset
 import androidx.compose.ui.unit.DpSize
@@ -72,6 +75,7 @@
 import com.android.compose.animation.scene.TestScenes.SceneB
 import com.android.compose.animation.scene.TestScenes.SceneC
 import com.android.compose.animation.scene.content.state.TransitionState
+import com.android.compose.animation.scene.effect.OffsetOverscrollEffect
 import com.android.compose.animation.scene.subjects.assertThat
 import com.android.compose.test.assertSizeIsEqualTo
 import com.android.compose.test.setContentAndCreateMainScope
@@ -712,7 +716,7 @@
     }
 
     @Test
-    fun elementTransitionDuringOverscroll() {
+    fun elementTransitionDuringOverscrollWithOverscrollDSL() {
         val layoutWidth = 200.dp
         val layoutHeight = 400.dp
         val overscrollTranslateY = 10.dp
@@ -765,6 +769,241 @@
         assertThat(animatedFloat).isEqualTo(100f)
     }
 
+    private fun expectedOffset(currentOffset: Dp, density: Density): Dp {
+        return with(density) {
+            OffsetOverscrollEffect.computeOffset(this, currentOffset.toPx()).toDp()
+        }
+    }
+
+    @Test
+    fun elementTransitionDuringOverscroll() {
+        val layoutWidth = 200.dp
+        val layoutHeight = 400.dp
+        lateinit var density: Density
+
+        // The draggable touch slop, i.e. the min px distance a touch pointer must move before it is
+        // detected as a drag event.
+        var touchSlop = 0f
+        val state =
+            rule.runOnUiThread {
+                MutableSceneTransitionLayoutState(
+                    initialScene = SceneA,
+                    transitions = transitions { overscrollDisabled(SceneB, Orientation.Vertical) },
+                )
+            }
+        rule.setContent {
+            density = LocalDensity.current
+            touchSlop = LocalViewConfiguration.current.touchSlop
+            SceneTransitionLayout(state, Modifier.size(layoutWidth, layoutHeight)) {
+                scene(key = SceneA, userActions = mapOf(Swipe.Down to SceneB)) {
+                    Spacer(Modifier.fillMaxSize())
+                }
+                scene(SceneB) {
+                    Spacer(
+                        Modifier.overscroll(verticalOverscrollEffect)
+                            .fillMaxSize()
+                            .element(TestElements.Foo)
+                    )
+                }
+            }
+        }
+        assertThat(state.transitionState).isIdle()
+
+        // Swipe by half of verticalSwipeDistance.
+        rule.onRoot().performTouchInput {
+            val middleTop = Offset((layoutWidth / 2).toPx(), 0f)
+            down(middleTop)
+            // Scroll 50%.
+            val firstScrollHeight = layoutHeight.toPx() * 0.5f
+            moveBy(Offset(0f, touchSlop + firstScrollHeight), delayMillis = 1_000)
+        }
+
+        rule.onNodeWithTag(TestElements.Foo.testTag).assertTopPositionInRootIsEqualTo(0.dp)
+        val transition = assertThat(state.transitionState).isSceneTransition()
+        assertThat(transition).isNotNull()
+        assertThat(transition).hasProgress(0.5f)
+
+        rule.onRoot().performTouchInput {
+            // Scroll another 100%.
+            moveBy(Offset(0f, layoutHeight.toPx()), delayMillis = 1_000)
+        }
+
+        // Scroll 150% (Scene B overscroll by 50%).
+        assertThat(transition).hasProgress(1f)
+
+        rule
+            .onNodeWithTag(TestElements.Foo.testTag)
+            .assertTopPositionInRootIsEqualTo(expectedOffset(layoutHeight * 0.5f, density))
+    }
+
+    @Test
+    fun elementTransitionOverscrollMultipleScenes() {
+        val layoutWidth = 200.dp
+        val layoutHeight = 400.dp
+        lateinit var density: Density
+
+        // The draggable touch slop, i.e. the min px distance a touch pointer must move before it is
+        // detected as a drag event.
+        var touchSlop = 0f
+        val state =
+            rule.runOnUiThread {
+                MutableSceneTransitionLayoutState(
+                    initialScene = SceneA,
+                    transitions =
+                        transitions {
+                            overscrollDisabled(SceneA, Orientation.Vertical)
+                            overscrollDisabled(SceneB, Orientation.Vertical)
+                        },
+                )
+            }
+        rule.setContent {
+            density = LocalDensity.current
+            touchSlop = LocalViewConfiguration.current.touchSlop
+            SceneTransitionLayout(state, Modifier.size(layoutWidth, layoutHeight)) {
+                scene(key = SceneA, userActions = mapOf(Swipe.Down to SceneB)) {
+                    Spacer(
+                        Modifier.overscroll(verticalOverscrollEffect)
+                            .fillMaxSize()
+                            .element(TestElements.Foo)
+                    )
+                }
+                scene(SceneB) {
+                    Spacer(
+                        Modifier.overscroll(verticalOverscrollEffect)
+                            .fillMaxSize()
+                            .element(TestElements.Bar)
+                    )
+                }
+            }
+        }
+        assertThat(state.transitionState).isIdle()
+
+        // Swipe by half of verticalSwipeDistance.
+        rule.onRoot().performTouchInput {
+            val middleTop = Offset((layoutWidth / 2).toPx(), 0f)
+            down(middleTop)
+            val firstScrollHeight = layoutHeight.toPx() * 0.5f // Scroll 50%
+            moveBy(Offset(0f, touchSlop + firstScrollHeight), delayMillis = 1_000)
+        }
+
+        rule.onNodeWithTag(TestElements.Foo.testTag).assertTopPositionInRootIsEqualTo(0.dp)
+        rule.onNodeWithTag(TestElements.Bar.testTag).assertTopPositionInRootIsEqualTo(0.dp)
+        val transition = assertThat(state.transitionState).isSceneTransition()
+        assertThat(transition).isNotNull()
+        assertThat(transition).hasProgress(0.5f)
+
+        rule.onRoot().performTouchInput {
+            // Scroll another 100%.
+            moveBy(Offset(0f, layoutHeight.toPx()), delayMillis = 1_000)
+        }
+
+        // Scroll 150% (Scene B overscroll by 50%).
+        assertThat(transition).hasProgress(1f)
+
+        rule.onNodeWithTag(TestElements.Foo.testTag).assertTopPositionInRootIsEqualTo(0.dp)
+        rule
+            .onNodeWithTag(TestElements.Bar.testTag)
+            .assertTopPositionInRootIsEqualTo(expectedOffset(layoutHeight * 0.5f, density))
+
+        rule.onRoot().performTouchInput {
+            // Scroll another -30%.
+            moveBy(Offset(0f, layoutHeight.toPx() * -0.3f), delayMillis = 1_000)
+        }
+
+        // Scroll 120% (Scene B overscroll by 20%).
+        assertThat(transition).hasProgress(1f)
+
+        rule.onNodeWithTag(TestElements.Foo.testTag).assertTopPositionInRootIsEqualTo(0.dp)
+        rule
+            .onNodeWithTag(TestElements.Bar.testTag)
+            .assertTopPositionInRootIsEqualTo(expectedOffset(layoutHeight * 0.2f, density))
+        rule.onRoot().performTouchInput {
+            // Scroll another -70%
+            moveBy(Offset(0f, layoutHeight.toPx() * -0.7f), delayMillis = 1_000)
+        }
+
+        // Scroll 50% (No overscroll).
+        assertThat(transition).hasProgress(0.5f)
+
+        rule.onNodeWithTag(TestElements.Foo.testTag).assertTopPositionInRootIsEqualTo(0.dp)
+        rule.onNodeWithTag(TestElements.Bar.testTag).assertTopPositionInRootIsEqualTo(0.dp)
+
+        rule.onRoot().performTouchInput {
+            // Scroll another -100%.
+            moveBy(Offset(0f, layoutHeight.toPx() * -1f), delayMillis = 1_000)
+        }
+
+        // Scroll -50% (Scene A overscroll by -50%).
+        assertThat(transition).hasProgress(0f)
+        rule
+            .onNodeWithTag(TestElements.Foo.testTag)
+            .assertTopPositionInRootIsEqualTo(expectedOffset(layoutHeight * -0.5f, density))
+        rule.onNodeWithTag(TestElements.Bar.testTag).assertTopPositionInRootIsEqualTo(0.dp)
+    }
+
+    @Test
+    fun elementTransitionOverscroll() {
+        val layoutWidth = 200.dp
+        val layoutHeight = 400.dp
+        lateinit var density: Density
+
+        // The draggable touch slop, i.e. the min px distance a touch pointer must move before it is
+        // detected as a drag event.
+        var touchSlop = 0f
+        val state =
+            rule.runOnUiThread {
+                MutableSceneTransitionLayoutState(
+                    initialScene = SceneA,
+                    transitions =
+                        transitions {
+                            defaultOverscrollProgressConverter = ProgressConverter.linear()
+                            overscrollDisabled(SceneB, Orientation.Vertical)
+                        },
+                )
+            }
+        rule.setContent {
+            density = LocalDensity.current
+            touchSlop = LocalViewConfiguration.current.touchSlop
+            SceneTransitionLayout(state, Modifier.size(layoutWidth, layoutHeight)) {
+                scene(key = SceneA, userActions = mapOf(Swipe.Down to SceneB)) {
+                    Spacer(Modifier.fillMaxSize())
+                }
+                scene(SceneB) {
+                    Spacer(
+                        Modifier.overscroll(verticalOverscrollEffect)
+                            .element(TestElements.Foo)
+                            .fillMaxSize()
+                    )
+                }
+            }
+        }
+        assertThat(state.transitionState).isIdle()
+
+        // Swipe by half of verticalSwipeDistance.
+        rule.onRoot().performTouchInput {
+            val middleTop = Offset((layoutWidth / 2).toPx(), 0f)
+            down(middleTop)
+            val firstScrollHeight = layoutHeight.toPx() * 0.5f // Scroll 50%
+            moveBy(Offset(0f, touchSlop + firstScrollHeight), delayMillis = 1_000)
+        }
+
+        val fooElement = rule.onNodeWithTag(TestElements.Foo.testTag)
+        fooElement.assertTopPositionInRootIsEqualTo(0.dp)
+        val transition = assertThat(state.transitionState).isSceneTransition()
+        assertThat(transition).isNotNull()
+        assertThat(transition).hasProgress(0.5f)
+
+        rule.onRoot().performTouchInput {
+            // Scroll another 100%.
+            moveBy(Offset(0f, layoutHeight.toPx()), delayMillis = 1_000)
+        }
+
+        // Scroll 150% (Scene B overscroll by 50%).
+        assertThat(transition).hasProgress(1f)
+
+        fooElement.assertTopPositionInRootIsEqualTo(expectedOffset(layoutHeight * 0.5f, density))
+    }
+
     @Test
     fun elementTransitionDuringNestedScrollOverscroll() {
         // The draggable touch slop, i.e. the min px distance a touch pointer must move before it is
diff --git a/packages/SystemUI/compose/scene/tests/src/com/android/compose/animation/scene/effect/OffsetOverscrollEffectTest.kt b/packages/SystemUI/compose/scene/tests/src/com/android/compose/animation/scene/effect/OffsetOverscrollEffectTest.kt
new file mode 100644
index 0000000..d267cc5
--- /dev/null
+++ b/packages/SystemUI/compose/scene/tests/src/com/android/compose/animation/scene/effect/OffsetOverscrollEffectTest.kt
@@ -0,0 +1,208 @@
+/*
+ * 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.compose.animation.scene.effect
+
+import androidx.compose.foundation.gestures.Orientation
+import androidx.compose.foundation.gestures.rememberScrollableState
+import androidx.compose.foundation.gestures.scrollable
+import androidx.compose.foundation.layout.Box
+import androidx.compose.foundation.layout.size
+import androidx.compose.foundation.overscroll
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.geometry.Offset
+import androidx.compose.ui.platform.LocalDensity
+import androidx.compose.ui.platform.LocalViewConfiguration
+import androidx.compose.ui.platform.testTag
+import androidx.compose.ui.test.assertTopPositionInRootIsEqualTo
+import androidx.compose.ui.test.junit4.createComposeRule
+import androidx.compose.ui.test.onNodeWithTag
+import androidx.compose.ui.test.onRoot
+import androidx.compose.ui.test.performTouchInput
+import androidx.compose.ui.unit.Density
+import androidx.compose.ui.unit.Dp
+import androidx.compose.ui.unit.dp
+import androidx.test.ext.junit.runners.AndroidJUnit4
+import org.junit.Rule
+import org.junit.Test
+import org.junit.runner.RunWith
+
+@RunWith(AndroidJUnit4::class)
+class OffsetOverscrollEffectTest {
+    @get:Rule val rule = createComposeRule()
+
+    private fun expectedOffset(currentOffset: Dp, density: Density): Dp {
+        return with(density) {
+            OffsetOverscrollEffect.computeOffset(this, currentOffset.toPx()).toDp()
+        }
+    }
+
+    @Test
+    fun applyVerticalOffset_duringVerticalOverscroll() {
+        // The draggable touch slop, i.e. the min px distance a touch pointer must move before it is
+        // detected as a drag event.
+        var touchSlop = 0f
+        lateinit var density: Density
+        val layoutSize = 200.dp
+
+        rule.setContent {
+            density = LocalDensity.current
+            touchSlop = LocalViewConfiguration.current.touchSlop
+            val overscrollEffect = rememberOffsetOverscrollEffect(Orientation.Vertical)
+
+            Box(
+                Modifier.overscroll(overscrollEffect)
+                    // A scrollable that does not consume the scroll gesture.
+                    .scrollable(
+                        state = rememberScrollableState { 0f },
+                        orientation = Orientation.Vertical,
+                        overscrollEffect = overscrollEffect,
+                    )
+                    .size(layoutSize)
+                    .testTag("box")
+            )
+        }
+
+        val onBox = rule.onNodeWithTag("box")
+
+        onBox.assertTopPositionInRootIsEqualTo(0.dp)
+
+        rule.onRoot().performTouchInput {
+            down(center)
+            moveBy(Offset(0f, touchSlop + layoutSize.toPx()), delayMillis = 1_000)
+        }
+
+        onBox.assertTopPositionInRootIsEqualTo(expectedOffset(layoutSize, density))
+    }
+
+    @Test
+    fun applyNoOffset_duringHorizontalOverscroll() {
+        // The draggable touch slop, i.e. the min px distance a touch pointer must move before it is
+        // detected as a drag event.
+        var touchSlop = 0f
+        val layoutSize = 200.dp
+
+        rule.setContent {
+            touchSlop = LocalViewConfiguration.current.touchSlop
+            val overscrollEffect = rememberOffsetOverscrollEffect(Orientation.Vertical)
+
+            Box(
+                Modifier.overscroll(overscrollEffect)
+                    // A scrollable that does not consume the scroll gesture.
+                    .scrollable(
+                        state = rememberScrollableState { 0f },
+                        orientation = Orientation.Horizontal,
+                        overscrollEffect = overscrollEffect,
+                    )
+                    .size(layoutSize)
+                    .testTag("box")
+            )
+        }
+
+        val onBox = rule.onNodeWithTag("box")
+
+        onBox.assertTopPositionInRootIsEqualTo(0.dp)
+
+        rule.onRoot().performTouchInput {
+            down(center)
+            moveBy(Offset(touchSlop + layoutSize.toPx(), 0f), delayMillis = 1_000)
+        }
+
+        onBox.assertTopPositionInRootIsEqualTo(0.dp)
+    }
+
+    @Test
+    fun backToZero_afterOverscroll() {
+        // The draggable touch slop, i.e. the min px distance a touch pointer must move before it is
+        // detected as a drag event.
+        var touchSlop = 0f
+        lateinit var density: Density
+        val layoutSize = 200.dp
+
+        rule.setContent {
+            density = LocalDensity.current
+            touchSlop = LocalViewConfiguration.current.touchSlop
+            val overscrollEffect = rememberOffsetOverscrollEffect(Orientation.Vertical)
+
+            Box(
+                Modifier.overscroll(overscrollEffect)
+                    // A scrollable that does not consume the scroll gesture.
+                    .scrollable(
+                        state = rememberScrollableState { 0f },
+                        orientation = Orientation.Vertical,
+                        overscrollEffect = overscrollEffect,
+                    )
+                    .size(layoutSize)
+                    .testTag("box")
+            )
+        }
+
+        val onBox = rule.onNodeWithTag("box")
+
+        rule.onRoot().performTouchInput {
+            down(center)
+            moveBy(Offset(0f, touchSlop + layoutSize.toPx()), delayMillis = 1_000)
+        }
+
+        onBox.assertTopPositionInRootIsEqualTo(expectedOffset(layoutSize, density))
+
+        rule.onRoot().performTouchInput { up() }
+
+        onBox.assertTopPositionInRootIsEqualTo(0.dp)
+    }
+
+    @Test
+    fun offsetOverscroll_followTheTouchPointer() {
+        // The draggable touch slop, i.e. the min px distance a touch pointer must move before it is
+        // detected as a drag event.
+        var touchSlop = 0f
+        lateinit var density: Density
+        val layoutSize = 200.dp
+
+        rule.setContent {
+            density = LocalDensity.current
+            touchSlop = LocalViewConfiguration.current.touchSlop
+            val overscrollEffect = rememberOffsetOverscrollEffect(Orientation.Vertical)
+
+            Box(
+                Modifier.overscroll(overscrollEffect)
+                    // A scrollable that does not consume the scroll gesture.
+                    .scrollable(
+                        state = rememberScrollableState { 0f },
+                        orientation = Orientation.Vertical,
+                        overscrollEffect = overscrollEffect,
+                    )
+                    .size(layoutSize)
+                    .testTag("box")
+            )
+        }
+
+        val onBox = rule.onNodeWithTag("box")
+
+        rule.onRoot().performTouchInput {
+            down(center)
+            // A full screen scroll.
+            moveBy(Offset(0f, touchSlop + layoutSize.toPx()), delayMillis = 1_000)
+        }
+        onBox.assertTopPositionInRootIsEqualTo(expectedOffset(layoutSize, density))
+
+        rule.onRoot().performTouchInput {
+            // Reduced by half.
+            moveBy(Offset(0f, -layoutSize.toPx() / 2), delayMillis = 1_000)
+        }
+        onBox.assertTopPositionInRootIsEqualTo(expectedOffset(layoutSize / 2, density))
+    }
+}
diff --git a/packages/SystemUI/compose/scene/tests/src/com/android/compose/nestedscroll/LargeTopAppBarNestedScrollConnectionTest.kt b/packages/SystemUI/compose/scene/tests/src/com/android/compose/nestedscroll/LargeTopAppBarNestedScrollConnectionTest.kt
index e27f9b5..c8fb2cb 100644
--- a/packages/SystemUI/compose/scene/tests/src/com/android/compose/nestedscroll/LargeTopAppBarNestedScrollConnectionTest.kt
+++ b/packages/SystemUI/compose/scene/tests/src/com/android/compose/nestedscroll/LargeTopAppBarNestedScrollConnectionTest.kt
@@ -71,41 +71,6 @@
     }
 
     @Test
-    fun onScrollUpAfterContentScrolled_ignoreUpEvent() {
-        val scrollConnection = buildScrollConnection(heightRange = 0f..2f)
-        height = 1f
-
-        // scroll down consumed by a child
-        scrollConnection.scroll(available = Offset(0f, 1f), consumedByScroll = Offset(0f, 1f))
-
-        val offsetConsumed =
-            scrollConnection.onPreScroll(available = Offset(x = 0f, y = -1f), source = scrollSource)
-
-        // It should ignore all onPreScroll events
-        assertThat(offsetConsumed).isEqualTo(Offset.Zero)
-        assertThat(height).isEqualTo(1f)
-    }
-
-    @Test
-    fun onScrollUpAfterContentReturnedToZero_consumeHeight() {
-        val scrollConnection = buildScrollConnection(heightRange = 0f..2f)
-        height = 1f
-
-        // scroll down consumed by a child
-        scrollConnection.scroll(available = Offset(0f, 1f), consumedByScroll = Offset(0f, 1f))
-
-        // scroll up consumed by a child, the child is in its original position
-        scrollConnection.scroll(available = Offset(0f, -1f), consumedByScroll = Offset(0f, -1f))
-
-        val offsetConsumed =
-            scrollConnection.onPreScroll(available = Offset(x = 0f, y = -1f), source = scrollSource)
-
-        // It should ignore all onPreScroll events
-        assertThat(offsetConsumed).isEqualTo(Offset(0f, -1f))
-        assertThat(height).isEqualTo(0f)
-    }
-
-    @Test
     fun onScrollUp_consumeDownToMin() {
         val scrollConnection = buildScrollConnection(heightRange = 0f..2f)
         height = 0f
diff --git a/packages/SystemUI/lint-baseline.xml b/packages/SystemUI/lint-baseline.xml
index 00b0c44..43131b1 100644
--- a/packages/SystemUI/lint-baseline.xml
+++ b/packages/SystemUI/lint-baseline.xml
@@ -33644,7 +33644,7 @@
 
     <issue
         id="ShadeDisplayAwareContextChecker"
-        message="UI elements of the shade window&#xA;should use ShadeDisplayAware-annotated Resources, as the shade might move between windows, and only&#xA;@ShadeDisplayAware resources are updated with the new configuration correctly. Failures to do so&#xA;might result in wrong dimensions for shade window classes (e.g. using the wrong density or theme).&#xA;If the usage of Resources is not related to display specific configuration or UI, then there is&#xA;technically no need to use the annotation, and you can annotate the class with&#xA;@SuppressLint(&quot;ShadeDisplayAwareContextChecker&quot;)/@Suppress(&quot;ShadeDisplayAwareContextChecker&quot;)"
+        message="UI elements of the shade window should use ShadeDisplayAware-annotated Resources, as the shade might move between windows, and only @ShadeDisplayAware resources are updated with the new configuration correctly. Failures to do so might result in wrong dimensions for shade window classes (e.g. using the wrong density or theme). If the usage of Resources is not related to display specific configuration or UI, then there is technically no need to use the annotation, and you can annotate the class with @SuppressLint(&quot;ShadeDisplayAwareContextChecker&quot;)/@Suppress(&quot;ShadeDisplayAwareContextChecker&quot;)"
         errorLine1="    @Main resources: Resources,"
         errorLine2="    ~~~~~~~~~~~~~~~~~~~~~~~~~~">
         <location
@@ -33655,7 +33655,7 @@
 
     <issue
         id="ShadeDisplayAwareContextChecker"
-        message="UI elements of the shade window&#xA;should use ShadeDisplayAware-annotated Context, as the shade might move between windows, and only&#xA;@ShadeDisplayAware resources are updated with the new configuration correctly. Failures to do so&#xA;might result in wrong dimensions for shade window classes (e.g. using the wrong density or theme).&#xA;If the usage of Context is not related to display specific configuration or UI, then there is&#xA;technically no need to use the annotation, and you can annotate the class with&#xA;@SuppressLint(&quot;ShadeDisplayAwareContextChecker&quot;)/@Suppress(&quot;ShadeDisplayAwareContextChecker&quot;)"
+        message="UI elements of the shade window should use ShadeDisplayAware-annotated Context, as the shade might move between windows, and only @ShadeDisplayAware resources are updated with the new configuration correctly. Failures to do so might result in wrong dimensions for shade window classes (e.g. using the wrong density or theme). If the usage of Context is not related to display specific configuration or UI, then there is technically no need to use the annotation, and you can annotate the class with @SuppressLint(&quot;ShadeDisplayAwareContextChecker&quot;)/@Suppress(&quot;ShadeDisplayAwareContextChecker&quot;)"
         errorLine1="constructor(context: Context, val shadeViewController: ShadeViewController) {"
         errorLine2="            ~~~~~~~~~~~~~~~~">
         <location
@@ -33699,7 +33699,7 @@
 
     <issue
         id="ShadeDisplayAwareContextChecker"
-        message="UI elements of the shade window&#xA;should use ShadeDisplayAware-annotated Resources, as the shade might move between windows, and only&#xA;@ShadeDisplayAware resources are updated with the new configuration correctly. Failures to do so&#xA;might result in wrong dimensions for shade window classes (e.g. using the wrong density or theme).&#xA;If the usage of Resources is not related to display specific configuration or UI, then there is&#xA;technically no need to use the annotation, and you can annotate the class with&#xA;@SuppressLint(&quot;ShadeDisplayAwareContextChecker&quot;)/@Suppress(&quot;ShadeDisplayAwareContextChecker&quot;)"
+        message="UI elements of the shade window should use ShadeDisplayAware-annotated Resources, as the shade might move between windows, and only @ShadeDisplayAware resources are updated with the new configuration correctly. Failures to do so might result in wrong dimensions for shade window classes (e.g. using the wrong density or theme). If the usage of Resources is not related to display specific configuration or UI, then there is technically no need to use the annotation, and you can annotate the class with @SuppressLint(&quot;ShadeDisplayAwareContextChecker&quot;)/@Suppress(&quot;ShadeDisplayAwareContextChecker&quot;)"
         errorLine1="    @Main private val resources: Resources,"
         errorLine2="    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
         <location
@@ -33763,5 +33763,201 @@
             column="5"/>
     </issue>
 
+    <issue
+        id="ShadeDisplayAwareContextChecker"
+        message="UI elements of the shade window should use ShadeDisplayAware-annotated Context, as the shade might move between windows, and only @ShadeDisplayAware resources are updated with the new configuration correctly. Failures to do so might result in wrong dimensions for shade window classes (e.g. using the wrong density or theme). If the usage of Context is not related to display specific configuration or UI, then there is technically no need to use the annotation, and you can annotate the class with @SuppressLint(&quot;ShadeDisplayAwareContextChecker&quot;)/@Suppress(&quot;ShadeDisplayAwareContextChecker&quot;)"
+        errorLine1="    public AuthController(Context context,"
+        errorLine2="                                  ~~~~~~~">
+        <location
+            file="frameworks/base/packages/SystemUI/src/com/android/systemui/biometrics/AuthController.java"
+            line="716"
+            column="35"/>
+    </issue>
+
+    <issue
+        id="ShadeDisplayAwareContextChecker"
+        message="UI elements of the shade window should use ShadeDisplayAware-annotated WindowManager, as the shade might move between windows, and only @ShadeDisplayAware resources are updated with the new configuration correctly. Failures to do so might result in wrong dimensions for shade window classes (e.g. using the wrong density or theme). If the usage of WindowManager is not related to display specific configuration or UI, then there is technically no need to use the annotation, and you can annotate the class with @SuppressLint(&quot;ShadeDisplayAwareContextChecker&quot;)/@Suppress(&quot;ShadeDisplayAwareContextChecker&quot;)"
+        errorLine1="            @NonNull WindowManager windowManager,"
+        errorLine2="                                   ~~~~~~~~~~~~~">
+        <location
+            file="frameworks/base/packages/SystemUI/src/com/android/systemui/biometrics/AuthController.java"
+            line="721"
+            column="36"/>
+    </issue>
+
+    <issue
+        id="ShadeDisplayAwareContextChecker"
+        message="UI elements of the shade window should use ShadeDisplayAware-annotated Context, as the shade might move between windows, and only @ShadeDisplayAware resources are updated with the new configuration correctly. Failures to do so might result in wrong dimensions for shade window classes (e.g. using the wrong density or theme). If the usage of Context is not related to display specific configuration or UI, then there is technically no need to use the annotation, and you can annotate the class with @SuppressLint(&quot;ShadeDisplayAwareContextChecker&quot;)/@Suppress(&quot;ShadeDisplayAwareContextChecker&quot;)"
+        errorLine1="    private val sysuiContext: Context,"
+        errorLine2="    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+        <location
+            file="frameworks/base/packages/SystemUI/src/com/android/systemui/biometrics/AuthRippleController.kt"
+            line="72"
+            column="5"/>
+    </issue>
+
+    <issue
+        id="ShadeDisplayAwareContextChecker"
+        message="UI elements of the shade window should use ShadeDisplayAware-annotated ConfigurationController, as the shade might move between windows, and only @ShadeDisplayAware resources are updated with the new configuration correctly. Failures to do so might result in wrong dimensions for shade window classes (e.g. using the wrong density or theme). If the usage of ConfigurationController is not related to display specific configuration or UI, then there is technically no need to use the annotation, and you can annotate the class with @SuppressLint(&quot;ShadeDisplayAwareContextChecker&quot;)/@Suppress(&quot;ShadeDisplayAwareContextChecker&quot;)"
+        errorLine1="    private val configurationController: ConfigurationController,"
+        errorLine2="    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+        <location
+            file="frameworks/base/packages/SystemUI/src/com/android/systemui/biometrics/AuthRippleController.kt"
+            line="74"
+            column="5"/>
+    </issue>
+
+    <issue
+        id="ShadeDisplayAwareContextChecker"
+        message="UI elements of the shade window should use ShadeDisplayAware-annotated Context, as the shade might move between windows, and only @ShadeDisplayAware resources are updated with the new configuration correctly. Failures to do so might result in wrong dimensions for shade window classes (e.g. using the wrong density or theme). If the usage of Context is not related to display specific configuration or UI, then there is technically no need to use the annotation, and you can annotate the class with @SuppressLint(&quot;ShadeDisplayAwareContextChecker&quot;)/@Suppress(&quot;ShadeDisplayAwareContextChecker&quot;)"
+        errorLine1="            Context context,"
+        errorLine2="                    ~~~~~~~">
+        <location
+            file="frameworks/base/packages/SystemUI/src/com/android/systemui/biometrics/BiometricNotificationBroadcastReceiver.java"
+            line="46"
+            column="21"/>
+    </issue>
+
+    <issue
+        id="ShadeDisplayAwareContextChecker"
+        message="UI elements of the shade window should use ShadeDisplayAware-annotated Resources, as the shade might move between windows, and only @ShadeDisplayAware resources are updated with the new configuration correctly. Failures to do so might result in wrong dimensions for shade window classes (e.g. using the wrong density or theme). If the usage of Resources is not related to display specific configuration or UI, then there is technically no need to use the annotation, and you can annotate the class with @SuppressLint(&quot;ShadeDisplayAwareContextChecker&quot;)/@Suppress(&quot;ShadeDisplayAwareContextChecker&quot;)"
+        errorLine1="            @Main Resources resources,"
+        errorLine2="                            ~~~~~~~~~">
+        <location
+            file="frameworks/base/packages/SystemUI/src/com/android/systemui/biometrics/BiometricNotificationDialogFactory.java"
+            line="52"
+            column="29"/>
+    </issue>
+
+    <issue
+        id="ShadeDisplayAwareContextChecker"
+        message="UI elements of the shade window should use ShadeDisplayAware-annotated Context, as the shade might move between windows, and only @ShadeDisplayAware resources are updated with the new configuration correctly. Failures to do so might result in wrong dimensions for shade window classes (e.g. using the wrong density or theme). If the usage of Context is not related to display specific configuration or UI, then there is technically no need to use the annotation, and you can annotate the class with @SuppressLint(&quot;ShadeDisplayAwareContextChecker&quot;)/@Suppress(&quot;ShadeDisplayAwareContextChecker&quot;)"
+        errorLine1="    public BiometricNotificationService(@NonNull Context context,"
+        errorLine2="                                                         ~~~~~~~">
+        <location
+            file="frameworks/base/packages/SystemUI/src/com/android/systemui/biometrics/BiometricNotificationService.java"
+            line="148"
+            column="58"/>
+    </issue>
+
+    <issue
+        id="ShadeDisplayAwareContextChecker"
+        message="UI elements of the shade window should use ShadeDisplayAware-annotated Context, as the shade might move between windows, and only @ShadeDisplayAware resources are updated with the new configuration correctly. Failures to do so might result in wrong dimensions for shade window classes (e.g. using the wrong density or theme). If the usage of Context is not related to display specific configuration or UI, then there is technically no need to use the annotation, and you can annotate the class with @SuppressLint(&quot;ShadeDisplayAwareContextChecker&quot;)/@Suppress(&quot;ShadeDisplayAwareContextChecker&quot;)"
+        errorLine1="    c: Context,"
+        errorLine2="    ~~~~~~~~~~">
+        <location
+            file="frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ChannelEditorDialogController.kt"
+            line="61"
+            column="5"/>
+    </issue>
+
+    <issue
+        id="ShadeDisplayAwareContextChecker"
+        message="UI elements of the shade window should use ShadeDisplayAware-annotated Resources, as the shade might move between windows, and only @ShadeDisplayAware resources are updated with the new configuration correctly. Failures to do so might result in wrong dimensions for shade window classes (e.g. using the wrong density or theme). If the usage of Resources is not related to display specific configuration or UI, then there is technically no need to use the annotation, and you can annotate the class with @SuppressLint(&quot;ShadeDisplayAwareContextChecker&quot;)/@Suppress(&quot;ShadeDisplayAwareContextChecker&quot;)"
+        errorLine1="    @Main private val resources: Resources,"
+        errorLine2="    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+        <location
+            file="frameworks/base/packages/SystemUI/src/com/android/systemui/bouncer/data/repository/EmergencyServicesRepository.kt"
+            line="39"
+            column="5"/>
+    </issue>
+
+    <issue
+        id="ShadeDisplayAwareContextChecker"
+        message="UI elements of the shade window should use ShadeDisplayAware-annotated Resources, as the shade might move between windows, and only @ShadeDisplayAware resources are updated with the new configuration correctly. Failures to do so might result in wrong dimensions for shade window classes (e.g. using the wrong density or theme). If the usage of Resources is not related to display specific configuration or UI, then there is technically no need to use the annotation, and you can annotate the class with @SuppressLint(&quot;ShadeDisplayAwareContextChecker&quot;)/@Suppress(&quot;ShadeDisplayAwareContextChecker&quot;)"
+        errorLine1="    @Main private val resources: Resources,"
+        errorLine2="    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+        <location
+            file="frameworks/base/packages/SystemUI/src/com/android/systemui/biometrics/FaceAuthAccessibilityDelegate.kt"
+            line="37"
+            column="5"/>
+    </issue>
+
+    <issue
+        id="ShadeDisplayAwareContextChecker"
+        message="UI elements of the shade window should use ShadeDisplayAware-annotated Resources, as the shade might move between windows, and only @ShadeDisplayAware resources are updated with the new configuration correctly. Failures to do so might result in wrong dimensions for shade window classes (e.g. using the wrong density or theme). If the usage of Resources is not related to display specific configuration or UI, then there is technically no need to use the annotation, and you can annotate the class with @SuppressLint(&quot;ShadeDisplayAwareContextChecker&quot;)/@Suppress(&quot;ShadeDisplayAwareContextChecker&quot;)"
+        errorLine1="    @Main private val resources: Resources,"
+        errorLine2="    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+        <location
+            file="frameworks/base/packages/SystemUI/src/com/android/systemui/biometrics/FaceHelpMessageDeferral.kt"
+            line="42"
+            column="5"/>
+    </issue>
+
+    <issue
+        id="ShadeDisplayAwareContextChecker"
+        message="UI elements of the shade window should use ShadeDisplayAware-annotated Context, as the shade might move between windows, and only @ShadeDisplayAware resources are updated with the new configuration correctly. Failures to do so might result in wrong dimensions for shade window classes (e.g. using the wrong density or theme). If the usage of Context is not related to display specific configuration or UI, then there is technically no need to use the annotation, and you can annotate the class with @SuppressLint(&quot;ShadeDisplayAwareContextChecker&quot;)/@Suppress(&quot;ShadeDisplayAwareContextChecker&quot;)"
+        errorLine1="            @NonNull final Context context,"
+        errorLine2="                                   ~~~~~~~">
+        <location
+            file="frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/notification/headsup/HeadsUpManagerImpl.java"
+            line="186"
+            column="36"/>
+    </issue>
+
+    <issue
+        id="ShadeDisplayAwareContextChecker"
+        message="UI elements of the shade window should use ShadeDisplayAware-annotated Context, as the shade might move between windows, and only @ShadeDisplayAware resources are updated with the new configuration correctly. Failures to do so might result in wrong dimensions for shade window classes (e.g. using the wrong density or theme). If the usage of Context is not related to display specific configuration or UI, then there is technically no need to use the annotation, and you can annotate the class with @SuppressLint(&quot;ShadeDisplayAwareContextChecker&quot;)/@Suppress(&quot;ShadeDisplayAwareContextChecker&quot;)"
+        errorLine1="class IconBuilder @Inject constructor(private val context: Context) {"
+        errorLine2="                                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+        <location
+            file="frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/notification/icon/IconBuilder.kt"
+            line="27"
+            column="39"/>
+    </issue>
+
+    <issue
+        id="ShadeDisplayAwareContextChecker"
+        message="UI elements of the shade window should use ShadeDisplayAware-annotated WindowManager, as the shade might move between windows, and only @ShadeDisplayAware resources are updated with the new configuration correctly. Failures to do so might result in wrong dimensions for shade window classes (e.g. using the wrong density or theme). If the usage of WindowManager is not related to display specific configuration or UI, then there is technically no need to use the annotation, and you can annotate the class with @SuppressLint(&quot;ShadeDisplayAwareContextChecker&quot;)/@Suppress(&quot;ShadeDisplayAwareContextChecker&quot;)"
+        errorLine1="    private val windowManager: WindowManager,"
+        errorLine2="    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+        <location
+            file="frameworks/base/packages/SystemUI/src/com/android/systemui/keyboard/docking/ui/viewmodel/KeyboardDockingIndicationViewModel.kt"
+            line="40"
+            column="5"/>
+    </issue>
+
+    <issue
+        id="ShadeDisplayAwareContextChecker"
+        message="UI elements of the shade window should use ShadeDisplayAware-annotated Resources, as the shade might move between windows, and only @ShadeDisplayAware resources are updated with the new configuration correctly. Failures to do so might result in wrong dimensions for shade window classes (e.g. using the wrong density or theme). If the usage of Resources is not related to display specific configuration or UI, then there is technically no need to use the annotation, and you can annotate the class with @SuppressLint(&quot;ShadeDisplayAwareContextChecker&quot;)/@Suppress(&quot;ShadeDisplayAwareContextChecker&quot;)"
+        errorLine1="    @Main resources: Resources,"
+        errorLine2="    ~~~~~~~~~~~~~~~~~~~~~~~~~~">
+        <location
+            file="frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/notification/icon/ui/viewmodel/NotificationIconContainerStatusBarViewModel.kt"
+            line="53"
+            column="5"/>
+    </issue>
+
+    <issue
+        id="ShadeDisplayAwareContextChecker"
+        message="UI elements of the shade window should use ShadeDisplayAware-annotated Resources, as the shade might move between windows, and only @ShadeDisplayAware resources are updated with the new configuration correctly. Failures to do so might result in wrong dimensions for shade window classes (e.g. using the wrong density or theme). If the usage of Resources is not related to display specific configuration or UI, then there is technically no need to use the annotation, and you can annotate the class with @SuppressLint(&quot;ShadeDisplayAwareContextChecker&quot;)/@Suppress(&quot;ShadeDisplayAwareContextChecker&quot;)"
+        errorLine1="    @Main private val resources: Resources,"
+        errorLine2="    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+        <location
+            file="frameworks/base/packages/SystemUI/src/com/android/systemui/qs/pipeline/domain/autoaddable/SafetyCenterAutoAddable.kt"
+            line="51"
+            column="5"/>
+    </issue>
+
+    <issue
+        id="ShadeDisplayAwareContextChecker"
+        message="UI elements of the shade window should use ShadeDisplayAware-annotated Context, as the shade might move between windows, and only @ShadeDisplayAware resources are updated with the new configuration correctly. Failures to do so might result in wrong dimensions for shade window classes (e.g. using the wrong density or theme). If the usage of Context is not related to display specific configuration or UI, then there is technically no need to use the annotation, and you can annotate the class with @SuppressLint(&quot;ShadeDisplayAwareContextChecker&quot;)/@Suppress(&quot;ShadeDisplayAwareContextChecker&quot;)"
+        errorLine1="    private val context: Context,"
+        errorLine2="    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+        <location
+            file="frameworks/base/packages/SystemUI/src/com/android/systemui/biometrics/domain/interactor/SideFpsSensorInteractor.kt"
+            line="51"
+            column="5"/>
+    </issue>
+
+    <issue
+        id="ShadeDisplayAwareContextChecker"
+        message="UI elements of the shade window should use ShadeDisplayAware-annotated WindowManager, as the shade might move between windows, and only @ShadeDisplayAware resources are updated with the new configuration correctly. Failures to do so might result in wrong dimensions for shade window classes (e.g. using the wrong density or theme). If the usage of WindowManager is not related to display specific configuration or UI, then there is technically no need to use the annotation, and you can annotate the class with @SuppressLint(&quot;ShadeDisplayAwareContextChecker&quot;)/@Suppress(&quot;ShadeDisplayAwareContextChecker&quot;)"
+        errorLine1="    windowManager: WindowManager,"
+        errorLine2="    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+        <location
+            file="frameworks/base/packages/SystemUI/src/com/android/systemui/biometrics/domain/interactor/SideFpsSensorInteractor.kt"
+            line="53"
+            column="5"/>
 
 </issues>
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/dreams/DreamOverlayRegistrantTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/dreams/DreamOverlayRegistrantTest.kt
index 790df03..1e937b4 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/dreams/DreamOverlayRegistrantTest.kt
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/dreams/DreamOverlayRegistrantTest.kt
@@ -29,8 +29,11 @@
 import androidx.test.filters.SmallTest
 import com.android.systemui.Flags
 import com.android.systemui.SysuiTestCase
+import com.android.systemui.communal.domain.interactor.communalSettingsInteractor
+import com.android.systemui.communal.domain.interactor.setCommunalV2ConfigEnabled
 import com.android.systemui.log.core.FakeLogBuffer
 import com.android.systemui.shared.condition.Monitor
+import com.android.systemui.testKosmos
 import com.android.systemui.util.mockito.withArgCaptor
 import kotlin.test.Test
 import org.junit.Before
@@ -48,6 +51,8 @@
 @TestableLooper.RunWithLooper
 @RunWith(AndroidJUnit4::class)
 class DreamOverlayRegistrantTest : SysuiTestCase() {
+    private val kosmos = testKosmos()
+
     private val context = mock<Context>()
 
     private val packageManager = mock<PackageManager>()
@@ -73,6 +78,7 @@
                 monitor,
                 packageManager,
                 dreamManager,
+                kosmos.communalSettingsInteractor,
                 logBuffer,
             )
 
@@ -117,7 +123,7 @@
 
     /** Verify overlay registered when enabled in manifest. */
     @Test
-    @DisableFlags(Flags.FLAG_COMMUNAL_HUB_ON_MOBILE)
+    @DisableFlags(Flags.FLAG_GLANCEABLE_HUB_V2)
     fun testRegisteredWhenEnabledWithManifest() {
         serviceInfo.enabled = true
         start()
@@ -127,8 +133,10 @@
 
     /** Verify overlay registered for mobile hub with flag. */
     @Test
-    @EnableFlags(Flags.FLAG_COMMUNAL_HUB_ON_MOBILE)
+    @EnableFlags(Flags.FLAG_GLANCEABLE_HUB_V2)
     fun testRegisteredForMobileHub() {
+        kosmos.setCommunalV2ConfigEnabled(true)
+
         start()
 
         verify(dreamManager).registerDreamOverlayService(componentName)
@@ -139,7 +147,7 @@
      * enabled.
      */
     @Test
-    @DisableFlags(Flags.FLAG_COMMUNAL_HUB_ON_MOBILE)
+    @DisableFlags(Flags.FLAG_GLANCEABLE_HUB_V2)
     fun testDisabledForMobileWithoutMobileHub() {
         start()
 
@@ -154,8 +162,9 @@
 
     /** Ensure service unregistered when component is disabled at runtime. */
     @Test
-    @EnableFlags(Flags.FLAG_COMMUNAL_HUB_ON_MOBILE)
+    @EnableFlags(Flags.FLAG_GLANCEABLE_HUB_V2)
     fun testUnregisteredWhenComponentDisabled() {
+        kosmos.setCommunalV2ConfigEnabled(true)
         start()
         verify(dreamManager).registerDreamOverlayService(componentName)
         clearInvocations(dreamManager)
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/dreams/DreamOverlayServiceTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/dreams/DreamOverlayServiceTest.kt
index f924ccb..b07097d 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/dreams/DreamOverlayServiceTest.kt
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/dreams/DreamOverlayServiceTest.kt
@@ -43,7 +43,7 @@
 import com.android.keyguard.KeyguardUpdateMonitor
 import com.android.keyguard.KeyguardUpdateMonitorCallback
 import com.android.systemui.Flags.FLAG_COMMUNAL_HUB
-import com.android.systemui.Flags.FLAG_COMMUNAL_HUB_ON_MOBILE
+import com.android.systemui.Flags.FLAG_GLANCEABLE_HUB_V2
 import com.android.systemui.Flags.FLAG_SCENE_CONTAINER
 import com.android.systemui.SysuiTestCase
 import com.android.systemui.ambient.touch.TouchHandler
@@ -55,7 +55,9 @@
 import com.android.systemui.communal.data.repository.fakeCommunalSceneRepository
 import com.android.systemui.communal.domain.interactor.CommunalInteractor
 import com.android.systemui.communal.domain.interactor.communalInteractor
+import com.android.systemui.communal.domain.interactor.communalSettingsInteractor
 import com.android.systemui.communal.domain.interactor.setCommunalAvailable
+import com.android.systemui.communal.domain.interactor.setCommunalV2ConfigEnabled
 import com.android.systemui.communal.shared.log.CommunalUiEvent
 import com.android.systemui.communal.shared.model.CommunalScenes
 import com.android.systemui.complication.ComplicationHostViewController
@@ -262,6 +264,7 @@
                 mKeyguardUpdateMonitor,
                 mScrimManager,
                 mCommunalInteractor,
+                kosmos.communalSettingsInteractor,
                 kosmos.sceneInteractor,
                 mSystemDialogsCloser,
                 mUiEventLogger,
@@ -1283,7 +1286,7 @@
         environmentComponents.verifyNoMoreInteractions()
     }
 
-    @DisableFlags(FLAG_COMMUNAL_HUB_ON_MOBILE)
+    @DisableFlags(FLAG_GLANCEABLE_HUB_V2)
     @Test
     fun testAmbientTouchHandlersRegistration_registerHideComplicationAndCommunal() {
         val client = client
@@ -1303,9 +1306,11 @@
             .containsExactly(mHideComplicationTouchHandler, mCommunalTouchHandler)
     }
 
-    @EnableFlags(FLAG_COMMUNAL_HUB_ON_MOBILE)
+    @EnableFlags(FLAG_GLANCEABLE_HUB_V2)
     @Test
     fun testAmbientTouchHandlersRegistration_v2_registerOnlyHideComplication() {
+        kosmos.setCommunalV2ConfigEnabled(true)
+
         val client = client
 
         // Inform the overlay service of dream starting.
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/inputdevice/tutorial/ui/viewmodel/KeyboardTouchpadTutorialViewModelTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/inputdevice/tutorial/ui/viewmodel/KeyboardTouchpadTutorialViewModelTest.kt
index 76434ee..1de38ee 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/inputdevice/tutorial/ui/viewmodel/KeyboardTouchpadTutorialViewModelTest.kt
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/inputdevice/tutorial/ui/viewmodel/KeyboardTouchpadTutorialViewModelTest.kt
@@ -16,10 +16,8 @@
 
 package com.android.systemui.inputdevice.tutorial.ui.viewmodel
 
-import androidx.lifecycle.Lifecycle.Event
-import androidx.lifecycle.LifecycleOwner
-import androidx.lifecycle.LifecycleRegistry
 import androidx.lifecycle.SavedStateHandle
+import androidx.lifecycle.testing.TestLifecycleOwner
 import androidx.test.ext.junit.runners.AndroidJUnit4
 import androidx.test.filters.SmallTest
 import com.android.systemui.SysuiTestCase
@@ -55,7 +53,6 @@
 import org.junit.Rule
 import org.junit.Test
 import org.junit.runner.RunWith
-import org.mockito.Mockito.mock
 import org.mockito.kotlin.mock
 
 @OptIn(ExperimentalCoroutinesApi::class)
@@ -71,9 +68,6 @@
     private var tutorialScope = INTENT_TUTORIAL_SCOPE_TOUCHPAD
     private val viewModel by lazy { createViewModel(tutorialScope) }
 
-    // createUnsafe so its methods don't have to be called on Main thread
-    private val lifecycle = LifecycleRegistry.createUnsafe(mock(LifecycleOwner::class.java))
-
     @get:Rule val mainDispatcherRule = MainDispatcherRule(kosmos.testDispatcher)
 
     private fun createViewModel(
@@ -88,7 +82,6 @@
                 mock<InputDeviceTutorialLogger>(),
                 SavedStateHandle(mapOf(INTENT_TUTORIAL_SCOPE_KEY to scope)),
             )
-        lifecycle.addObserver(viewModel)
         return viewModel
     }
 
@@ -279,7 +272,7 @@
             collectValues(viewModel.screen) // just to initialize viewModel
             peripheralsState(touchpadConnected = true)
 
-            lifecycle.handleLifecycleEvent(Event.ON_START)
+            viewModel.onStart(TestLifecycleOwner())
 
             assertGesturesDisabled()
         }
@@ -291,8 +284,8 @@
             collectValues(viewModel.screen)
             peripheralsState(touchpadConnected = true)
 
-            lifecycle.handleLifecycleEvent(Event.ON_START)
-            lifecycle.handleLifecycleEvent(Event.ON_STOP)
+            viewModel.onStart(TestLifecycleOwner())
+            viewModel.onStop(TestLifecycleOwner())
 
             assertGesturesNotDisabled()
         }
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/keyboard/shortcut/data/repository/InputGestureDataAdapterTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/keyboard/shortcut/data/repository/InputGestureDataAdapterTest.kt
new file mode 100644
index 0000000..f78c692
--- /dev/null
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/keyboard/shortcut/data/repository/InputGestureDataAdapterTest.kt
@@ -0,0 +1,195 @@
+/*
+ * 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.keyboard.shortcut.data.repository
+
+import android.app.role.RoleManager
+import android.app.role.roleManager
+import android.content.Context
+import android.content.Intent
+import android.content.mockedContext
+import android.content.packageManager
+import android.content.pm.ActivityInfo
+import android.content.pm.PackageManager
+import android.hardware.input.AppLaunchData
+import android.hardware.input.AppLaunchData.RoleData
+import android.hardware.input.InputGestureData
+import android.hardware.input.InputGestureData.createKeyTrigger
+import android.view.KeyEvent.KEYCODE_A
+import android.view.KeyEvent.META_ALT_ON
+import android.view.KeyEvent.META_CTRL_ON
+import androidx.test.ext.junit.runners.AndroidJUnit4
+import androidx.test.filters.SmallTest
+import com.android.internal.app.ResolverActivity
+import com.android.systemui.SysuiTestCase
+import com.android.systemui.keyboard.shortcut.data.model.InternalGroupsSource
+import com.android.systemui.keyboard.shortcut.data.model.InternalKeyboardShortcutGroup
+import com.android.systemui.keyboard.shortcut.data.model.InternalKeyboardShortcutInfo
+import com.android.systemui.keyboard.shortcut.inputGestureDataAdapter
+import com.android.systemui.keyboard.shortcut.shared.model.ShortcutCategoryType
+import com.android.systemui.kosmos.runTest
+import com.android.systemui.res.R
+import com.android.systemui.settings.FakeUserTracker
+import com.android.systemui.settings.userTracker
+import com.android.systemui.testKosmos
+import com.google.common.truth.Truth.assertThat
+import org.junit.Before
+import org.junit.Test
+import org.junit.runner.RunWith
+import org.mockito.ArgumentMatchers.any
+import org.mockito.ArgumentMatchers.anyInt
+import org.mockito.kotlin.eq
+import org.mockito.kotlin.mock
+import org.mockito.kotlin.whenever
+
+
+@SmallTest
+@RunWith(AndroidJUnit4::class)
+class InputGestureDataAdapterTest : SysuiTestCase() {
+
+    private val kosmos = testKosmos().also { kosmos ->
+        kosmos.userTracker = FakeUserTracker(onCreateCurrentUserContext = { kosmos.mockedContext })
+    }
+    private val adapter = kosmos.inputGestureDataAdapter
+    private val roleManager = kosmos.roleManager
+    private val packageManager: PackageManager = kosmos.packageManager
+    private val mockUserContext: Context = kosmos.mockedContext
+    private val intent: Intent = mock()
+    private val fakeResolverActivityInfo =
+        ActivityInfo().apply { name = ResolverActivity::class.qualifiedName }
+    private val fakeActivityInfo: ActivityInfo =
+        ActivityInfo().apply {
+            name = FAKE_ACTIVITY_NAME
+            icon = 0x1
+            nonLocalizedLabel = TEST_SHORTCUT_LABEL
+        }
+    private val mockSelectorIntent: Intent = mock()
+
+    @Before
+    fun setup() {
+        whenever(mockUserContext.packageManager).thenReturn(packageManager)
+        whenever(mockUserContext.getSystemService(RoleManager::class.java)).thenReturn(roleManager)
+        whenever(roleManager.isRoleAvailable(TEST_ROLE)).thenReturn(true)
+        whenever(roleManager.getDefaultApplication(TEST_ROLE)).thenReturn(TEST_ROLE_PACKAGE)
+        whenever(packageManager.getActivityInfo(any(), anyInt())).thenReturn(mock())
+        whenever(packageManager.getLaunchIntentForPackage(TEST_ROLE_PACKAGE)).thenReturn(intent)
+        whenever(intent.selector).thenReturn(mockSelectorIntent)
+        whenever(mockSelectorIntent.categories).thenReturn(setOf(TEST_ACTIVITY_CATEGORY))
+    }
+
+    @Test
+    fun shortcutLabel_whenDefaultAppForCategoryIsNotSet_loadsLabelFromFirstAppMatchingIntent() =
+        kosmos.runTest {
+            setApiToRetrieveResolverActivity()
+
+            val inputGestureData = buildInputGestureDataForAppLaunchShortcut()
+            val internalGroups = adapter.toInternalGroupSources(listOf(inputGestureData))
+            val label =
+                internalGroups.firstOrNull()?.groups?.firstOrNull()?.items?.firstOrNull()?.label
+
+            assertThat(label).isEqualTo(expectedShortcutLabelForFirstAppMatchingIntent)
+        }
+
+    @Test
+    fun shortcutLabel_whenDefaultAppForCategoryIsSet_loadsLabelOfDefaultApp() {
+        kosmos.runTest {
+            setApiToRetrieveSpecificActivity()
+
+            val inputGestureData = buildInputGestureDataForAppLaunchShortcut()
+            val internalGroups = adapter.toInternalGroupSources(listOf(inputGestureData))
+            val label =
+                internalGroups.firstOrNull()?.groups?.firstOrNull()?.items?.firstOrNull()?.label
+
+            assertThat(label).isEqualTo(TEST_SHORTCUT_LABEL)
+        }
+    }
+
+    @Test
+    fun shortcutIcon_whenDefaultAppForCategoryIsSet_loadsIconOfDefaultApp() {
+        kosmos.runTest {
+            setApiToRetrieveSpecificActivity()
+
+            val inputGestureData = buildInputGestureDataForAppLaunchShortcut()
+            val internalGroups = adapter.toInternalGroupSources(listOf(inputGestureData))
+            val icon =
+                internalGroups.firstOrNull()?.groups?.firstOrNull()?.items?.firstOrNull()?.icon
+
+            assertThat(icon).isNotNull()
+        }
+    }
+
+    @Test
+    fun internalGroupSource_isCorrectlyConvertedWithSimpleInputGestureData() =
+        kosmos.runTest {
+            setApiToRetrieveResolverActivity()
+
+            val inputGestureData = buildInputGestureDataForAppLaunchShortcut()
+            val internalGroups = adapter.toInternalGroupSources(listOf(inputGestureData))
+
+            assertThat(internalGroups).containsExactly(
+                InternalGroupsSource(
+                    type = ShortcutCategoryType.AppCategories,
+                    groups = listOf(
+                        InternalKeyboardShortcutGroup(
+                            label = APPLICATION_SHORTCUT_GROUP_LABEL,
+                            items = listOf(
+                                InternalKeyboardShortcutInfo(
+                                    label = expectedShortcutLabelForFirstAppMatchingIntent,
+                                    keycode = KEYCODE_A,
+                                    modifiers = META_CTRL_ON or META_ALT_ON,
+                                    isCustomShortcut = true
+                                )
+                            )
+                        )
+                    )
+                )
+            )
+        }
+
+    private fun setApiToRetrieveResolverActivity() {
+        whenever(intent.resolveActivityInfo(eq(packageManager), anyInt()))
+            .thenReturn(fakeResolverActivityInfo)
+    }
+
+    private fun setApiToRetrieveSpecificActivity() {
+        whenever(intent.resolveActivityInfo(eq(packageManager), anyInt()))
+            .thenReturn(fakeActivityInfo)
+    }
+
+
+    private fun buildInputGestureDataForAppLaunchShortcut(
+        keyCode: Int = KEYCODE_A,
+        modifiers: Int = META_CTRL_ON or META_ALT_ON,
+        appLaunchData: AppLaunchData = RoleData(TEST_ROLE)
+    ): InputGestureData {
+        return InputGestureData.Builder()
+            .setTrigger(createKeyTrigger(keyCode, modifiers))
+            .setAppLaunchData(appLaunchData)
+            .build()
+    }
+
+    private val expectedShortcutLabelForFirstAppMatchingIntent =
+        context.getString(R.string.keyboard_shortcut_group_applications_browser)
+
+    private companion object {
+        private const val TEST_ROLE = "Test Browser Role"
+        private const val TEST_ROLE_PACKAGE = "test.browser.package"
+        private const val APPLICATION_SHORTCUT_GROUP_LABEL = "Applications"
+        private const val FAKE_ACTIVITY_NAME = "Fake activity"
+        private const val TEST_SHORTCUT_LABEL = "Test shortcut label"
+        private const val TEST_ACTIVITY_CATEGORY = Intent.CATEGORY_APP_BROWSER
+    }
+}
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/keyboard/shortcut/data/source/TestShortcuts.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/keyboard/shortcut/data/source/TestShortcuts.kt
index 75190e9..92c76ff 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/keyboard/shortcut/data/source/TestShortcuts.kt
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/keyboard/shortcut/data/source/TestShortcuts.kt
@@ -567,13 +567,6 @@
             ),
             simpleShortcutCategory(System, "System controls", "Show shortcuts"),
             simpleShortcutCategory(System, "System controls", "View recent apps"),
-            simpleShortcutCategory(AppCategories, "Applications", "Calculator"),
-            simpleShortcutCategory(AppCategories, "Applications", "Calendar"),
-            simpleShortcutCategory(AppCategories, "Applications", "Browser"),
-            simpleShortcutCategory(AppCategories, "Applications", "Contacts"),
-            simpleShortcutCategory(AppCategories, "Applications", "Email"),
-            simpleShortcutCategory(AppCategories, "Applications", "Maps"),
-            simpleShortcutCategory(AppCategories, "Applications", "SMS"),
         )
     val customInputGestureTypeHome = simpleInputGestureData(keyGestureType = KEY_GESTURE_TYPE_HOME)
 
@@ -615,27 +608,6 @@
             ),
             simpleInputGestureData(keyGestureType = KeyGestureEvent.KEY_GESTURE_TYPE_RECENT_APPS),
             simpleInputGestureData(
-                keyGestureType = KeyGestureEvent.KEY_GESTURE_TYPE_LAUNCH_DEFAULT_CALCULATOR
-            ),
-            simpleInputGestureData(
-                keyGestureType = KeyGestureEvent.KEY_GESTURE_TYPE_LAUNCH_DEFAULT_CALENDAR
-            ),
-            simpleInputGestureData(
-                keyGestureType = KeyGestureEvent.KEY_GESTURE_TYPE_LAUNCH_DEFAULT_BROWSER
-            ),
-            simpleInputGestureData(
-                keyGestureType = KeyGestureEvent.KEY_GESTURE_TYPE_LAUNCH_DEFAULT_CONTACTS
-            ),
-            simpleInputGestureData(
-                keyGestureType = KeyGestureEvent.KEY_GESTURE_TYPE_LAUNCH_DEFAULT_EMAIL
-            ),
-            simpleInputGestureData(
-                keyGestureType = KeyGestureEvent.KEY_GESTURE_TYPE_LAUNCH_DEFAULT_MAPS
-            ),
-            simpleInputGestureData(
-                keyGestureType = KeyGestureEvent.KEY_GESTURE_TYPE_LAUNCH_DEFAULT_MESSAGING
-            ),
-            simpleInputGestureData(
                 keyGestureType = KeyGestureEvent.KEY_GESTURE_TYPE_RECENT_APPS_SWITCHER
             ),
         )
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/keyguard/data/quickaffordance/GlanceableHubQuickAffordanceConfigTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/keyguard/data/quickaffordance/GlanceableHubQuickAffordanceConfigTest.kt
index 77c615c..789b10b 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/keyguard/data/quickaffordance/GlanceableHubQuickAffordanceConfigTest.kt
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/keyguard/data/quickaffordance/GlanceableHubQuickAffordanceConfigTest.kt
@@ -25,7 +25,8 @@
 import com.android.systemui.SysuiTestCase
 import com.android.systemui.communal.data.repository.communalSceneRepository
 import com.android.systemui.communal.domain.interactor.communalInteractor
-import com.android.systemui.communal.domain.interactor.setCommunalEnabled
+import com.android.systemui.communal.domain.interactor.communalSettingsInteractor
+import com.android.systemui.communal.domain.interactor.setCommunalV2Enabled
 import com.android.systemui.communal.shared.model.CommunalScenes
 import com.android.systemui.coroutines.collectLastValue
 import com.android.systemui.flags.andSceneContainer
@@ -38,7 +39,6 @@
 import kotlinx.coroutines.ExperimentalCoroutinesApi
 import kotlinx.coroutines.test.runCurrent
 import kotlinx.coroutines.test.runTest
-import org.junit.Assert.assertTrue
 import org.junit.Before
 import org.junit.Test
 import org.junit.runner.RunWith
@@ -48,7 +48,7 @@
 
 @SmallTest
 @OptIn(ExperimentalCoroutinesApi::class)
-@EnableFlags(Flags.FLAG_GLANCEABLE_HUB_SHORTCUT_BUTTON)
+@EnableFlags(Flags.FLAG_GLANCEABLE_HUB_SHORTCUT_BUTTON, Flags.FLAG_GLANCEABLE_HUB_V2)
 @RunWith(ParameterizedAndroidJunit4::class)
 class GlanceableHubQuickAffordanceConfigTest(flags: FlagsParameterization?) : SysuiTestCase() {
     private val kosmos = testKosmos()
@@ -69,6 +69,7 @@
                 context = context,
                 communalInteractor = kosmos.communalInteractor,
                 communalSceneRepository = kosmos.communalSceneRepository,
+                communalSettingsInteractor = kosmos.communalSettingsInteractor,
                 sceneInteractor = kosmos.sceneInteractor,
             )
     }
@@ -76,28 +77,30 @@
     @Test
     fun lockscreenState_whenGlanceableHubEnabled_returnsVisible() =
         testScope.runTest {
-            kosmos.setCommunalEnabled(true)
+            kosmos.setCommunalV2Enabled(true)
             runCurrent()
 
             val lockScreenState by collectLastValue(underTest.lockScreenState)
 
-            assertTrue(lockScreenState is KeyguardQuickAffordanceConfig.LockScreenState.Visible)
+            assertThat(lockScreenState)
+                .isInstanceOf(KeyguardQuickAffordanceConfig.LockScreenState.Visible::class.java)
         }
 
     @Test
     fun lockscreenState_whenGlanceableHubDisabled_returnsHidden() =
         testScope.runTest {
-            kosmos.setCommunalEnabled(false)
+            kosmos.setCommunalV2Enabled(false)
             val lockScreenState by collectLastValue(underTest.lockScreenState)
             runCurrent()
 
-            assertTrue(lockScreenState is KeyguardQuickAffordanceConfig.LockScreenState.Hidden)
+            assertThat(lockScreenState)
+                .isEqualTo(KeyguardQuickAffordanceConfig.LockScreenState.Hidden)
         }
 
     @Test
     fun pickerScreenState_whenGlanceableHubEnabled_returnsDefault() =
         testScope.runTest {
-            kosmos.setCommunalEnabled(true)
+            kosmos.setCommunalV2Enabled(true)
             runCurrent()
 
             assertThat(underTest.getPickerScreenState())
@@ -107,7 +110,7 @@
     @Test
     fun pickerScreenState_whenGlanceableHubDisabled_returnsDisabled() =
         testScope.runTest {
-            kosmos.setCommunalEnabled(false)
+            kosmos.setCommunalV2Enabled(false)
             runCurrent()
 
             assertThat(
@@ -143,7 +146,8 @@
         @Parameters(name = "{0}")
         fun getParams(): List<FlagsParameterization> {
             return FlagsParameterization.allCombinationsOf(
-                    Flags.FLAG_GLANCEABLE_HUB_SHORTCUT_BUTTON
+                    Flags.FLAG_GLANCEABLE_HUB_SHORTCUT_BUTTON,
+                    Flags.FLAG_GLANCEABLE_HUB_V2,
                 )
                 .andSceneContainer()
         }
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/composefragment/viewmodel/QSFragmentComposeViewModelTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/composefragment/viewmodel/QSFragmentComposeViewModelTest.kt
index 111b3b6..4457d9b 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/composefragment/viewmodel/QSFragmentComposeViewModelTest.kt
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/composefragment/viewmodel/QSFragmentComposeViewModelTest.kt
@@ -38,6 +38,7 @@
 import com.android.systemui.qs.panels.domain.interactor.tileSquishinessInteractor
 import com.android.systemui.qs.panels.ui.viewmodel.setConfigurationForMediaInRow
 import com.android.systemui.res.R
+import com.android.systemui.shade.data.repository.fakeShadeRepository
 import com.android.systemui.shade.largeScreenHeaderHelper
 import com.android.systemui.statusbar.StatusBarState
 import com.android.systemui.statusbar.disableflags.data.repository.fakeDisableFlagsRepository
@@ -436,6 +437,28 @@
             }
         }
 
+    @Test
+    fun qsVisibleAndAnyShadeVisible() =
+        with(kosmos) {
+            testScope.testWithinLifecycle {
+                underTest.isQsVisible = false
+                fakeShadeRepository.setLegacyExpandedOrAwaitingInputTransfer(false)
+                assertThat(underTest.isQsVisibleAndAnyShadeExpanded).isFalse()
+
+                underTest.isQsVisible = true
+                fakeShadeRepository.setLegacyExpandedOrAwaitingInputTransfer(false)
+                assertThat(underTest.isQsVisibleAndAnyShadeExpanded).isFalse()
+
+                underTest.isQsVisible = false
+                fakeShadeRepository.setLegacyExpandedOrAwaitingInputTransfer(true)
+                assertThat(underTest.isQsVisibleAndAnyShadeExpanded).isFalse()
+
+                underTest.isQsVisible = true
+                fakeShadeRepository.setLegacyExpandedOrAwaitingInputTransfer(true)
+                assertThat(underTest.isQsVisibleAndAnyShadeExpanded).isTrue()
+            }
+        }
+
     private fun TestScope.setMediaState(state: MediaState) {
         with(kosmos) {
             val activeMedia = state == ACTIVE_MEDIA
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/panels/data/repository/GridLayoutTypeRepositoryTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/panels/data/repository/GridLayoutTypeRepositoryTest.kt
new file mode 100644
index 0000000..eef195b
--- /dev/null
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/panels/data/repository/GridLayoutTypeRepositoryTest.kt
@@ -0,0 +1,53 @@
+/*
+ * 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.data.repository
+
+import androidx.test.ext.junit.runners.AndroidJUnit4
+import androidx.test.filters.SmallTest
+import com.android.systemui.SysuiTestCase
+import com.android.systemui.kosmos.collectLastValue
+import com.android.systemui.kosmos.runTest
+import com.android.systemui.qs.panels.shared.model.InfiniteGridLayoutType
+import com.android.systemui.qs.panels.shared.model.PaginatedGridLayoutType
+import com.android.systemui.testKosmos
+import com.google.common.truth.Truth.assertThat
+import kotlin.test.Test
+import org.junit.runner.RunWith
+
+@SmallTest
+@RunWith(AndroidJUnit4::class)
+class GridLayoutTypeRepositoryTest : SysuiTestCase() {
+    val kosmos = testKosmos()
+
+    val underTest = kosmos.gridLayoutTypeRepository
+
+    @Test
+    fun defaultType_paginated() =
+        kosmos.runTest {
+            val type by collectLastValue(underTest.defaultLayoutType)
+
+            assertThat(type).isEqualTo(PaginatedGridLayoutType)
+        }
+
+    @Test
+    fun dualShadeType_infinite() =
+        kosmos.runTest {
+            val type by collectLastValue(underTest.dualShadeLayoutType)
+
+            assertThat(type).isEqualTo(InfiniteGridLayoutType)
+        }
+}
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/panels/domain/interactor/GridLayoutTypeInteractorTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/panels/domain/interactor/GridLayoutTypeInteractorTest.kt
new file mode 100644
index 0000000..b591538
--- /dev/null
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/panels/domain/interactor/GridLayoutTypeInteractorTest.kt
@@ -0,0 +1,68 @@
+/*
+ * 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.domain.interactor
+
+import android.platform.test.annotations.DisableFlags
+import android.platform.test.annotations.EnableFlags
+import androidx.test.ext.junit.runners.AndroidJUnit4
+import androidx.test.filters.SmallTest
+import com.android.systemui.SysuiTestCase
+import com.android.systemui.kosmos.Kosmos
+import com.android.systemui.kosmos.collectLastValue
+import com.android.systemui.kosmos.runTest
+import com.android.systemui.qs.panels.shared.model.InfiniteGridLayoutType
+import com.android.systemui.qs.panels.shared.model.PaginatedGridLayoutType
+import com.android.systemui.shade.data.repository.fakeShadeRepository
+import com.android.systemui.shade.shared.flag.DualShade
+import com.android.systemui.testKosmos
+import com.google.common.truth.Truth.assertThat
+import kotlin.test.Test
+import org.junit.runner.RunWith
+
+@SmallTest
+@RunWith(AndroidJUnit4::class)
+class GridLayoutTypeInteractorTest : SysuiTestCase() {
+    val kosmos = testKosmos()
+
+    val Kosmos.underTest by Kosmos.Fixture { kosmos.gridLayoutTypeInteractor }
+
+    @DisableFlags(DualShade.FLAG_NAME)
+    @Test
+    fun noDualShade_gridAlwaysPaginated() =
+        kosmos.runTest {
+            val type by collectLastValue(underTest.layout)
+
+            fakeShadeRepository.setShadeLayoutWide(false)
+            assertThat(type).isEqualTo(PaginatedGridLayoutType)
+
+            fakeShadeRepository.setShadeLayoutWide(true)
+            assertThat(type).isEqualTo(PaginatedGridLayoutType)
+        }
+
+    @EnableFlags(DualShade.FLAG_NAME)
+    @Test
+    fun dualShade_gridAlwaysInfinite() =
+        kosmos.runTest {
+            val type by collectLastValue(underTest.layout)
+
+            fakeShadeRepository.setShadeLayoutWide(false)
+            assertThat(type).isEqualTo(InfiniteGridLayoutType)
+
+            fakeShadeRepository.setShadeLayoutWide(true)
+            assertThat(type).isEqualTo(InfiniteGridLayoutType)
+        }
+}
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/panels/ui/compose/InfiniteGridLayoutTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/panels/ui/compose/InfiniteGridLayoutTest.kt
index a9a527f..4891c9f 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/panels/ui/compose/InfiniteGridLayoutTest.kt
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/panels/ui/compose/InfiniteGridLayoutTest.kt
@@ -22,7 +22,7 @@
 import com.android.systemui.kosmos.testScope
 import com.android.systemui.qs.panels.data.repository.DefaultLargeTilesRepository
 import com.android.systemui.qs.panels.data.repository.defaultLargeTilesRepository
-import com.android.systemui.qs.panels.domain.interactor.infiniteGridLayout
+import com.android.systemui.qs.panels.ui.compose.infinitegrid.infiniteGridLayout
 import com.android.systemui.qs.panels.ui.viewmodel.MockTileViewModel
 import com.android.systemui.qs.pipeline.shared.TileSpec
 import com.android.systemui.testKosmos
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/panels/ui/viewmodel/EditModeButtonViewModelTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/panels/ui/viewmodel/toolbar/EditModeButtonViewModelTest.kt
similarity index 95%
rename from packages/SystemUI/multivalentTests/src/com/android/systemui/qs/panels/ui/viewmodel/EditModeButtonViewModelTest.kt
rename to packages/SystemUI/multivalentTests/src/com/android/systemui/qs/panels/ui/viewmodel/toolbar/EditModeButtonViewModelTest.kt
index f2bfd72..a8e390c 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/panels/ui/viewmodel/EditModeButtonViewModelTest.kt
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/panels/ui/viewmodel/toolbar/EditModeButtonViewModelTest.kt
@@ -23,6 +23,7 @@
 import com.android.systemui.kosmos.collectLastValue
 import com.android.systemui.kosmos.runCurrent
 import com.android.systemui.kosmos.runTest
+import com.android.systemui.qs.panels.ui.viewmodel.toolbar.editModeButtonViewModelFactory
 import com.android.systemui.testKosmos
 import com.google.common.truth.Truth.assertThat
 import org.junit.Test
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/internet/domain/interactor/InternetTileUserActionInteractorTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/internet/domain/interactor/InternetTileUserActionInteractorTest.kt
index 52c476e..e4a9888 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/internet/domain/interactor/InternetTileUserActionInteractorTest.kt
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/internet/domain/interactor/InternetTileUserActionInteractorTest.kt
@@ -33,6 +33,7 @@
 import com.android.systemui.util.mockito.mock
 import com.android.systemui.util.mockito.nullable
 import com.google.common.truth.Truth
+import com.google.common.truth.Truth.assertThat
 import kotlinx.coroutines.test.runTest
 import org.junit.Before
 import org.junit.Test
@@ -136,4 +137,13 @@
 
             verify(wifiStateWorker, times(1)).isWifiEnabled = eq(true)
         }
+
+    @Test
+    fun detailsViewModel() =
+        kosmos.testScope.runTest {
+            assertThat(underTest.detailsViewModel.getTitle())
+                .isEqualTo("Internet")
+            assertThat(underTest.detailsViewModel.getSubTitle())
+                .isEqualTo("Tab a network to connect")
+        }
 }
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/viewmodel/QSTileViewModelTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/viewmodel/QSTileViewModelTest.kt
index 954215ee..2edb9c6 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/viewmodel/QSTileViewModelTest.kt
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/viewmodel/QSTileViewModelTest.kt
@@ -173,6 +173,21 @@
                 .isEqualTo(FakeQSTileDataInteractor.AvailabilityRequest(USER))
         }
 
+    @Test
+    fun tileDetails() =
+        testScope.runTest {
+            assertThat(tileUserActionInteractor.detailsViewModel).isNotNull()
+            assertThat(tileUserActionInteractor.detailsViewModel?.getTitle())
+                .isEqualTo("FakeQSTileUserActionInteractor")
+            assertThat(underTest.detailsViewModel).isNotNull()
+            assertThat(underTest.detailsViewModel?.getTitle())
+                .isEqualTo("FakeQSTileUserActionInteractor")
+
+            tileUserActionInteractor.detailsViewModel = null
+            assertThat(tileUserActionInteractor.detailsViewModel).isNull()
+            assertThat(underTest.detailsViewModel).isNull()
+        }
+
     private fun createViewModel(
         scope: TestScope,
         config: QSTileConfig = tileConfig,
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/chips/call/ui/viewmodel/CallChipViewModelTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/chips/call/ui/viewmodel/CallChipViewModelTest.kt
index 3ebf9f7..a62d9d5 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/chips/call/ui/viewmodel/CallChipViewModelTest.kt
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/chips/call/ui/viewmodel/CallChipViewModelTest.kt
@@ -34,6 +34,7 @@
 import com.android.systemui.statusbar.chips.ui.model.ColorsModel
 import com.android.systemui.statusbar.chips.ui.model.OngoingActivityChipModel
 import com.android.systemui.statusbar.chips.ui.view.ChipBackgroundContainer
+import com.android.systemui.statusbar.core.StatusBarConnectedDisplays
 import com.android.systemui.statusbar.phone.ongoingcall.data.repository.ongoingCallRepository
 import com.android.systemui.statusbar.phone.ongoingcall.shared.model.OngoingCallModel
 import com.android.systemui.statusbar.phone.ongoingcall.shared.model.inCallModel
@@ -163,6 +164,28 @@
         }
 
     @Test
+    @EnableFlags(FLAG_STATUS_BAR_CALL_CHIP_NOTIFICATION_ICON, StatusBarConnectedDisplays.FLAG_NAME)
+    fun chip_positiveStartTime_notifIconAndConnectedDisplaysFlagOn_iconIsNotifIcon() =
+        testScope.runTest {
+            val latest by collectLastValue(underTest.chip)
+
+            val notifKey = "testNotifKey"
+            repo.setOngoingCallState(
+                inCallModel(startTimeMs = 1000, notificationIcon = null, notificationKey = notifKey)
+            )
+
+            assertThat((latest as OngoingActivityChipModel.Shown).icon)
+                .isInstanceOf(
+                    OngoingActivityChipModel.ChipIcon.StatusBarNotificationIcon::class.java
+                )
+            val actualNotifKey =
+                (((latest as OngoingActivityChipModel.Shown).icon)
+                        as OngoingActivityChipModel.ChipIcon.StatusBarNotificationIcon)
+                    .notificationKey
+            assertThat(actualNotifKey).isEqualTo(notifKey)
+        }
+
+    @Test
     @DisableFlags(FLAG_STATUS_BAR_CALL_CHIP_NOTIFICATION_ICON)
     fun chip_zeroStartTime_notifIconFlagOff_iconIsPhone() =
         testScope.runTest {
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/chips/notification/domain/interactor/SingleNotificationChipInteractorTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/chips/notification/domain/interactor/SingleNotificationChipInteractorTest.kt
index e96dd16..f06bab7 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/chips/notification/domain/interactor/SingleNotificationChipInteractorTest.kt
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/chips/notification/domain/interactor/SingleNotificationChipInteractorTest.kt
@@ -16,6 +16,7 @@
 
 package com.android.systemui.statusbar.chips.notification.domain.interactor
 
+import android.platform.test.annotations.EnableFlags
 import androidx.test.ext.junit.runners.AndroidJUnit4
 import androidx.test.filters.SmallTest
 import com.android.systemui.SysuiTestCase
@@ -25,6 +26,8 @@
 import com.android.systemui.kosmos.runTest
 import com.android.systemui.kosmos.useUnconfinedTestDispatcher
 import com.android.systemui.statusbar.StatusBarIconView
+import com.android.systemui.statusbar.chips.notification.domain.model.NotificationChipModel
+import com.android.systemui.statusbar.core.StatusBarConnectedDisplays
 import com.android.systemui.statusbar.notification.data.model.activeNotificationModel
 import com.android.systemui.testKosmos
 import com.google.common.truth.Truth.assertThat
@@ -111,6 +114,27 @@
         }
 
     @Test
+    @EnableFlags(StatusBarConnectedDisplays.FLAG_NAME)
+    fun notificationChip_cdEnabled_missingStatusBarIconChipView_inConstructor_emitsNotNull() =
+        kosmos.runTest {
+            val underTest =
+                factory.create(
+                    activeNotificationModel(
+                        key = "notif1",
+                        statusBarChipIcon = null,
+                        whenTime = 123L,
+                    )
+                )
+
+            val latest by collectLastValue(underTest.notificationChip)
+
+            assertThat(latest)
+                .isEqualTo(
+                    NotificationChipModel("notif1", statusBarChipIconView = null, whenTime = 123L)
+                )
+        }
+
+    @Test
     fun notificationChip_missingStatusBarIconChipView_inSet_emitsNull() =
         kosmos.runTest {
             val startingNotif = activeNotificationModel(key = "notif1", statusBarChipIcon = mock())
@@ -126,6 +150,29 @@
         }
 
     @Test
+    @EnableFlags(StatusBarConnectedDisplays.FLAG_NAME)
+    fun notificationChip_missingStatusBarIconChipView_inSet_cdEnabled_emitsNotNull() =
+        kosmos.runTest {
+            val startingNotif = activeNotificationModel(key = "notif1", statusBarChipIcon = mock())
+            val underTest = factory.create(startingNotif)
+            val latest by collectLastValue(underTest.notificationChip)
+            assertThat(latest).isNotNull()
+
+            underTest.setNotification(
+                activeNotificationModel(key = "notif1", statusBarChipIcon = null, whenTime = 123L)
+            )
+
+            assertThat(latest)
+                .isEqualTo(
+                    NotificationChipModel(
+                        key = "notif1",
+                        statusBarChipIconView = null,
+                        whenTime = 123L,
+                    )
+                )
+        }
+
+    @Test
     fun notificationChip_appIsVisibleOnCreation_emitsNull() =
         kosmos.runTest {
             activityManagerRepository.fake.startingIsAppVisibleValue = true
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/chips/notification/ui/viewmodel/NotifChipsViewModelTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/chips/notification/ui/viewmodel/NotifChipsViewModelTest.kt
index 11831ca..8a4ddce 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/chips/notification/ui/viewmodel/NotifChipsViewModelTest.kt
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/chips/notification/ui/viewmodel/NotifChipsViewModelTest.kt
@@ -29,6 +29,7 @@
 import com.android.systemui.statusbar.chips.notification.domain.interactor.statusBarNotificationChipsInteractor
 import com.android.systemui.statusbar.chips.notification.shared.StatusBarNotifChips
 import com.android.systemui.statusbar.chips.ui.model.OngoingActivityChipModel
+import com.android.systemui.statusbar.core.StatusBarConnectedDisplays
 import com.android.systemui.statusbar.notification.data.model.activeNotificationModel
 import com.android.systemui.statusbar.notification.data.repository.ActiveNotificationsStore
 import com.android.systemui.statusbar.notification.data.repository.activeNotificationListRepository
@@ -107,6 +108,30 @@
         }
 
     @Test
+    @EnableFlags(StatusBarConnectedDisplays.FLAG_NAME)
+    fun chips_onePromotedNotif_connectedDisplaysFlagEnabled_statusBarIconMatches() =
+        kosmos.runTest {
+            val latest by collectLastValue(underTest.chips)
+
+            val notifKey = "notif"
+            setNotifs(
+                listOf(
+                    activeNotificationModel(
+                        key = notifKey,
+                        statusBarChipIcon = null,
+                        promotedContent = PromotedNotificationContentModel.Builder(notifKey).build(),
+                    )
+                )
+            )
+
+            assertThat(latest).hasSize(1)
+            val chip = latest!![0]
+            assertThat(chip).isInstanceOf(OngoingActivityChipModel.Shown.ShortTimeDelta::class.java)
+            assertThat(chip.icon)
+                .isEqualTo(OngoingActivityChipModel.ChipIcon.StatusBarNotificationIcon(notifKey))
+        }
+
+    @Test
     fun chips_onlyForPromotedNotifs() =
         kosmos.runTest {
             val latest by collectLastValue(underTest.chips)
@@ -139,6 +164,41 @@
         }
 
     @Test
+    @EnableFlags(StatusBarConnectedDisplays.FLAG_NAME)
+    fun chips_connectedDisplaysFlagEnabled_onlyForPromotedNotifs() =
+        kosmos.runTest {
+            val latest by collectLastValue(underTest.chips)
+
+            val firstKey = "notif1"
+            val secondKey = "notif2"
+            val thirdKey = "notif3"
+            setNotifs(
+                listOf(
+                    activeNotificationModel(
+                        key = firstKey,
+                        statusBarChipIcon = null,
+                        promotedContent = PromotedNotificationContentModel.Builder(firstKey).build(),
+                    ),
+                    activeNotificationModel(
+                        key = secondKey,
+                        statusBarChipIcon = null,
+                        promotedContent =
+                            PromotedNotificationContentModel.Builder(secondKey).build(),
+                    ),
+                    activeNotificationModel(
+                        key = thirdKey,
+                        statusBarChipIcon = null,
+                        promotedContent = null,
+                    ),
+                )
+            )
+
+            assertThat(latest).hasSize(2)
+            assertIsNotifKey(latest!![0], firstKey)
+            assertIsNotifKey(latest!![1], secondKey)
+        }
+
+    @Test
     fun chips_clickingChipNotifiesInteractor() =
         kosmos.runTest {
             val latest by collectLastValue(underTest.chips)
@@ -178,5 +238,12 @@
             assertThat((latest as OngoingActivityChipModel.Shown).icon)
                 .isEqualTo(OngoingActivityChipModel.ChipIcon.StatusBarView(expectedIcon))
         }
+
+        fun assertIsNotifKey(latest: OngoingActivityChipModel?, expectedKey: String) {
+            assertThat(latest)
+                .isInstanceOf(OngoingActivityChipModel.Shown.ShortTimeDelta::class.java)
+            assertThat((latest as OngoingActivityChipModel.Shown).icon)
+                .isEqualTo(OngoingActivityChipModel.ChipIcon.StatusBarNotificationIcon(expectedKey))
+        }
     }
 }
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/collection/coordinator/SensitiveContentCoordinatorTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/collection/coordinator/SensitiveContentCoordinatorTest.kt
index 689fc7c..68798a8 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/collection/coordinator/SensitiveContentCoordinatorTest.kt
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/collection/coordinator/SensitiveContentCoordinatorTest.kt
@@ -14,6 +14,8 @@
  * limitations under the License.
  */
 
+@file:OptIn(ExperimentalCoroutinesApi::class)
+
 package com.android.systemui.statusbar.notification.collection.coordinator
 
 import android.app.Notification
@@ -22,83 +24,92 @@
 import android.os.UserHandle
 import android.platform.test.annotations.DisableFlags
 import android.platform.test.annotations.EnableFlags
+import android.platform.test.flag.junit.FlagsParameterization
 import android.service.notification.StatusBarNotification
-import androidx.test.ext.junit.runners.AndroidJUnit4
 import androidx.test.filters.SmallTest
 import com.android.keyguard.KeyguardUpdateMonitor
+import com.android.keyguard.keyguardUpdateMonitor
 import com.android.server.notification.Flags.FLAG_SCREENSHARE_NOTIFICATION_HIDING
 import com.android.systemui.SysuiTestCase
-import com.android.systemui.dagger.qualifiers.Application
-import com.android.systemui.deviceentry.domain.interactor.DeviceEntryInteractor
-import com.android.systemui.kosmos.applicationCoroutineScope
-import com.android.systemui.plugins.statusbar.StatusBarStateController
+import com.android.systemui.flags.andSceneContainer
+import com.android.systemui.plugins.statusbar.fakeStatusBarStateController
+import com.android.systemui.plugins.statusbar.statusBarStateController
 import com.android.systemui.scene.domain.interactor.SceneInteractor
+import com.android.systemui.scene.domain.interactor.sceneInteractor
 import com.android.systemui.statusbar.NotificationLockscreenUserManager
 import com.android.systemui.statusbar.RankingBuilder
 import com.android.systemui.statusbar.StatusBarState
+import com.android.systemui.statusbar.SysuiStatusBarStateController
 import com.android.systemui.statusbar.notification.DynamicPrivacyController
 import com.android.systemui.statusbar.notification.collection.ListEntry
 import com.android.systemui.statusbar.notification.collection.NotifPipeline
 import com.android.systemui.statusbar.notification.collection.NotificationEntry
 import com.android.systemui.statusbar.notification.collection.NotificationEntryBuilder
-import com.android.systemui.statusbar.notification.collection.coordinator.dagger.CoordinatorScope
 import com.android.systemui.statusbar.notification.collection.listbuilder.OnBeforeRenderListListener
 import com.android.systemui.statusbar.notification.collection.listbuilder.pluggable.Invalidator
 import com.android.systemui.statusbar.notification.collection.listbuilder.pluggable.NotifFilter
 import com.android.systemui.statusbar.notification.collection.listbuilder.pluggable.Pluggable
+import com.android.systemui.statusbar.notification.collection.notifPipeline
+import com.android.systemui.statusbar.notification.dynamicPrivacyController
+import com.android.systemui.statusbar.notification.mockDynamicPrivacyController
 import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow
-import com.android.systemui.statusbar.policy.KeyguardStateController
+import com.android.systemui.statusbar.notificationLockscreenUserManager
 import com.android.systemui.statusbar.policy.SensitiveNotificationProtectionController
+import com.android.systemui.statusbar.policy.mockSensitiveNotificationProtectionController
+import com.android.systemui.statusbar.policy.sensitiveNotificationProtectionController
 import com.android.systemui.testKosmos
-import com.android.systemui.user.domain.interactor.SelectedUserInteractor
-import com.android.systemui.util.mockito.any
-import com.android.systemui.util.mockito.eq
-import com.android.systemui.util.mockito.mock
 import com.android.systemui.util.mockito.withArgCaptor
-import dagger.BindsInstance
-import dagger.Component
-import kotlinx.coroutines.CoroutineScope
+import kotlinx.coroutines.ExperimentalCoroutinesApi
 import org.junit.Assert.assertFalse
 import org.junit.Assert.assertTrue
 import org.junit.Test
 import org.junit.runner.RunWith
-import org.mockito.Mockito.never
-import org.mockito.Mockito.verify
-import org.mockito.Mockito.`when` as whenever
+import org.mockito.kotlin.any
+import org.mockito.kotlin.eq
+import org.mockito.kotlin.mock
+import org.mockito.kotlin.never
+import org.mockito.kotlin.verify
+import org.mockito.kotlin.whenever
+import platform.test.runner.parameterized.ParameterizedAndroidJunit4
+import platform.test.runner.parameterized.Parameters
 
 @SmallTest
-@RunWith(AndroidJUnit4::class)
-class SensitiveContentCoordinatorTest : SysuiTestCase() {
+@RunWith(ParameterizedAndroidJunit4::class)
+class SensitiveContentCoordinatorTest(flags: FlagsParameterization) : SysuiTestCase() {
 
-    val kosmos = testKosmos()
+    val kosmos =
+        testKosmos().apply {
+            // Override some Kosmos objects with mocks or fakes for easier testability
+            dynamicPrivacyController = mockDynamicPrivacyController
+            sensitiveNotificationProtectionController =
+                mockSensitiveNotificationProtectionController
+            statusBarStateController = fakeStatusBarStateController
+        }
 
-    val dynamicPrivacyController: DynamicPrivacyController = mock()
-    val lockscreenUserManager: NotificationLockscreenUserManager = mock()
-    val pipeline: NotifPipeline = mock()
-    val keyguardUpdateMonitor: KeyguardUpdateMonitor = mock()
-    val statusBarStateController: StatusBarStateController = mock()
-    val keyguardStateController: KeyguardStateController = mock()
-    val mSelectedUserInteractor: SelectedUserInteractor = mock()
+    val dynamicPrivacyController: DynamicPrivacyController = kosmos.mockDynamicPrivacyController
+    val lockscreenUserManager: NotificationLockscreenUserManager =
+        kosmos.notificationLockscreenUserManager
+    val pipeline: NotifPipeline = kosmos.notifPipeline
+    val keyguardUpdateMonitor: KeyguardUpdateMonitor = kosmos.keyguardUpdateMonitor
+    val statusBarStateController: SysuiStatusBarStateController =
+        kosmos.fakeStatusBarStateController
     val sensitiveNotificationProtectionController: SensitiveNotificationProtectionController =
-        mock()
-    val deviceEntryInteractor: DeviceEntryInteractor = mock()
-    val sceneInteractor: SceneInteractor = mock()
+        kosmos.mockSensitiveNotificationProtectionController
+    val sceneInteractor: SceneInteractor = kosmos.sceneInteractor
 
-    val coordinator: SensitiveContentCoordinator =
-        DaggerTestSensitiveContentCoordinatorComponent.factory()
-            .create(
-                dynamicPrivacyController,
-                lockscreenUserManager,
-                keyguardUpdateMonitor,
-                statusBarStateController,
-                keyguardStateController,
-                mSelectedUserInteractor,
-                sensitiveNotificationProtectionController,
-                deviceEntryInteractor,
-                sceneInteractor,
-                kosmos.applicationCoroutineScope,
-            )
-            .coordinator
+    val coordinator: SensitiveContentCoordinator by lazy { kosmos.sensitiveContentCoordinator }
+
+    companion object {
+        @JvmStatic
+        @Parameters(name = "{0}")
+        fun getParams(): List<FlagsParameterization> {
+            return FlagsParameterization.allCombinationsOf().andSceneContainer()
+        }
+    }
+
+    init {
+        mSetFlagsRule.setFlagsParameterization(flags)
+    }
 
     @Test
     fun onDynamicPrivacyChanged_invokeInvalidationListener() {
@@ -143,7 +154,7 @@
     fun screenshareSecretFilter_flagDisabled_filterNoAdded() {
         coordinator.attach(pipeline)
 
-        verify(pipeline, never()).addFinalizeFilter(any(NotifFilter::class.java))
+        verify(pipeline, never()).addFinalizeFilter(any())
     }
 
     @Test
@@ -675,13 +686,13 @@
         whenever(lockscreenUserManager.isLockscreenPublicMode(1)).thenReturn(true)
         whenever(lockscreenUserManager.userAllowsPrivateNotificationsInPublic(1)).thenReturn(false)
         whenever(dynamicPrivacyController.isDynamicallyUnlocked).thenReturn(true)
-        whenever(statusBarStateController.getState()).thenReturn(StatusBarState.KEYGUARD)
         whenever(keyguardUpdateMonitor.getUserUnlockedWithBiometricAndIsBypassing(any()))
             .thenReturn(true)
         val entry = fakeNotification(2, true)
         whenever(sensitiveNotificationProtectionController.isSensitiveStateActive).thenReturn(true)
         whenever(sensitiveNotificationProtectionController.shouldProtectNotification(any()))
             .thenReturn(true)
+        statusBarStateController.state = StatusBarState.KEYGUARD
 
         onBeforeRenderListListener.onBeforeRenderList(listOf(entry))
 
@@ -733,26 +744,3 @@
         return notificationEntry
     }
 }
-
-@CoordinatorScope
-@Component(modules = [SensitiveContentCoordinatorModule::class])
-interface TestSensitiveContentCoordinatorComponent {
-    val coordinator: SensitiveContentCoordinator
-
-    @Component.Factory
-    interface Factory {
-        fun create(
-            @BindsInstance dynamicPrivacyController: DynamicPrivacyController,
-            @BindsInstance lockscreenUserManager: NotificationLockscreenUserManager,
-            @BindsInstance keyguardUpdateMonitor: KeyguardUpdateMonitor,
-            @BindsInstance statusBarStateController: StatusBarStateController,
-            @BindsInstance keyguardStateController: KeyguardStateController,
-            @BindsInstance selectedUserInteractor: SelectedUserInteractor,
-            @BindsInstance
-            sensitiveNotificationProtectionController: SensitiveNotificationProtectionController,
-            @BindsInstance deviceEntryInteractor: DeviceEntryInteractor,
-            @BindsInstance sceneInteractor: SceneInteractor,
-            @BindsInstance @Application scope: CoroutineScope,
-        ): TestSensitiveContentCoordinatorComponent
-    }
-}
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/headsup/HeadsUpManagerImplOldTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/headsup/HeadsUpManagerImplOldTest.kt
deleted file mode 100644
index 8b4f53a..0000000
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/headsup/HeadsUpManagerImplOldTest.kt
+++ /dev/null
@@ -1,698 +0,0 @@
-/*
- * Copyright (C) 2019 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.statusbar.notification.headsup
-
-import android.app.Notification
-import android.app.PendingIntent
-import android.app.Person
-import android.os.Handler
-import android.platform.test.annotations.DisableFlags
-import android.platform.test.annotations.EnableFlags
-import android.platform.test.flag.junit.FlagsParameterization
-import android.testing.TestableLooper.RunWithLooper
-import androidx.test.filters.SmallTest
-import com.android.internal.logging.testing.UiEventLoggerFake
-import com.android.systemui.SysuiTestCase
-import com.android.systemui.dump.DumpManager
-import com.android.systemui.kosmos.KosmosJavaAdapter
-import com.android.systemui.log.logcatLogBuffer
-import com.android.systemui.res.R
-import com.android.systemui.shade.domain.interactor.ShadeInteractor
-import com.android.systemui.statusbar.notification.collection.NotificationEntry
-import com.android.systemui.statusbar.notification.collection.NotificationEntryBuilder
-import com.android.systemui.statusbar.notification.collection.render.GroupMembershipManagerImpl
-import com.android.systemui.statusbar.notification.headsup.HeadsUpManagerImpl.HeadsUpEntry
-import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow
-import com.android.systemui.statusbar.notification.shared.NotificationThrottleHun
-import com.android.systemui.statusbar.policy.AccessibilityManagerWrapper
-import com.android.systemui.util.concurrency.FakeExecutor
-import com.android.systemui.util.concurrency.mockExecutorHandler
-import com.android.systemui.util.kotlin.JavaAdapter
-import com.android.systemui.util.settings.FakeGlobalSettings
-import com.android.systemui.util.time.FakeSystemClock
-import com.google.common.truth.Truth
-import com.google.common.truth.Truth.assertThat
-import kotlinx.coroutines.flow.MutableStateFlow
-import org.junit.Rule
-import org.junit.Test
-import org.junit.runner.RunWith
-import org.mockito.ArgumentMatchers
-import org.mockito.Mock
-import org.mockito.Mockito
-import org.mockito.invocation.InvocationOnMock
-import org.mockito.junit.MockitoJUnit
-import org.mockito.junit.MockitoRule
-import org.mockito.kotlin.eq
-import platform.test.runner.parameterized.ParameterizedAndroidJunit4
-import platform.test.runner.parameterized.Parameters
-
-@SmallTest
-@RunWithLooper
-@RunWith(ParameterizedAndroidJunit4::class)
-// TODO(b/378142453): Merge this with HeadsUpManagerImplTest.
-open class HeadsUpManagerImplOldTest(flags: FlagsParameterization?) : SysuiTestCase() {
-    protected var mKosmos: KosmosJavaAdapter = KosmosJavaAdapter(this)
-
-    @JvmField @Rule var rule: MockitoRule = MockitoJUnit.rule()
-
-    private val mUiEventLoggerFake = UiEventLoggerFake()
-
-    private val mLogger: HeadsUpManagerLogger = Mockito.spy(HeadsUpManagerLogger(logcatLogBuffer()))
-
-    @Mock private val mBgHandler: Handler? = null
-
-    @Mock private val dumpManager: DumpManager? = null
-
-    @Mock private val mShadeInteractor: ShadeInteractor? = null
-    private var mAvalancheController: AvalancheController? = null
-
-    @Mock private val mAccessibilityMgr: AccessibilityManagerWrapper? = null
-
-    protected val globalSettings: FakeGlobalSettings = FakeGlobalSettings()
-    protected val systemClock: FakeSystemClock = FakeSystemClock()
-    protected val executor: FakeExecutor = FakeExecutor(systemClock)
-
-    @Mock protected var mRow: ExpandableNotificationRow? = null
-
-    private fun createHeadsUpManager(): HeadsUpManagerImpl {
-        return HeadsUpManagerImpl(
-            mContext,
-            mLogger,
-            mKosmos.statusBarStateController,
-            mKosmos.keyguardBypassController,
-            GroupMembershipManagerImpl(),
-            mKosmos.visualStabilityProvider,
-            mKosmos.configurationController,
-            mockExecutorHandler(executor),
-            globalSettings,
-            systemClock,
-            executor,
-            mAccessibilityMgr,
-            mUiEventLoggerFake,
-            JavaAdapter(mKosmos.testScope),
-            mShadeInteractor,
-            mAvalancheController,
-        )
-    }
-
-    private fun createStickyEntry(id: Int): NotificationEntry {
-        val notif =
-            Notification.Builder(mContext, "")
-                .setSmallIcon(R.drawable.ic_person)
-                .setFullScreenIntent(
-                    Mockito.mock(PendingIntent::class.java), /* highPriority */
-                    true,
-                )
-                .build()
-        return HeadsUpManagerTestUtil.createEntry(id, notif)
-    }
-
-    private fun createStickyForSomeTimeEntry(id: Int): NotificationEntry {
-        val notif =
-            Notification.Builder(mContext, "")
-                .setSmallIcon(R.drawable.ic_person)
-                .setFlag(Notification.FLAG_FSI_REQUESTED_BUT_DENIED, true)
-                .build()
-        return HeadsUpManagerTestUtil.createEntry(id, notif)
-    }
-
-    private fun useAccessibilityTimeout(use: Boolean) {
-        if (use) {
-            Mockito.doReturn(TEST_A11Y_AUTO_DISMISS_TIME)
-                .`when`(mAccessibilityMgr!!)
-                .getRecommendedTimeoutMillis(ArgumentMatchers.anyInt(), ArgumentMatchers.anyInt())
-        } else {
-            Mockito.`when`(
-                    mAccessibilityMgr!!.getRecommendedTimeoutMillis(
-                        ArgumentMatchers.anyInt(),
-                        ArgumentMatchers.anyInt(),
-                    )
-                )
-                .then { i: InvocationOnMock -> i.getArgument(0) }
-        }
-    }
-
-    init {
-        mSetFlagsRule.setFlagsParameterization(flags!!)
-    }
-
-    @Throws(Exception::class)
-    override fun SysuiSetup() {
-        super.SysuiSetup()
-        mContext.getOrCreateTestableResources().apply {
-            this.addOverride(R.integer.ambient_notification_extension_time, TEST_EXTENSION_TIME)
-            this.addOverride(R.integer.touch_acceptance_delay, TEST_TOUCH_ACCEPTANCE_TIME)
-            this.addOverride(
-                R.integer.heads_up_notification_minimum_time,
-                TEST_MINIMUM_DISPLAY_TIME,
-            )
-            this.addOverride(
-                R.integer.heads_up_notification_minimum_time_with_throttling,
-                TEST_MINIMUM_DISPLAY_TIME,
-            )
-            this.addOverride(R.integer.heads_up_notification_decay, TEST_AUTO_DISMISS_TIME)
-            this.addOverride(
-                R.integer.sticky_heads_up_notification_time,
-                TEST_STICKY_AUTO_DISMISS_TIME,
-            )
-        }
-
-        mAvalancheController =
-            AvalancheController(dumpManager!!, mUiEventLoggerFake, mLogger, mBgHandler!!)
-        Mockito.`when`(mShadeInteractor!!.isAnyExpanded).thenReturn(MutableStateFlow(true))
-        Mockito.`when`(mKosmos.keyguardBypassController.bypassEnabled).thenReturn(false)
-    }
-
-    @Test
-    fun testHasNotifications_headsUpManagerMapNotEmpty_true() {
-        val bhum = createHeadsUpManager()
-        val entry = HeadsUpManagerTestUtil.createEntry(/* id= */ 0, mContext)
-        bhum.showNotification(entry)
-
-        Truth.assertThat(bhum.mHeadsUpEntryMap).isNotEmpty()
-        Truth.assertThat(bhum.hasNotifications()).isTrue()
-    }
-
-    @Test
-    @EnableFlags(NotificationThrottleHun.FLAG_NAME)
-    fun testHasNotifications_avalancheMapNotEmpty_true() {
-        val bhum = createHeadsUpManager()
-        val notifEntry = HeadsUpManagerTestUtil.createEntry(/* id= */ 0, mContext)
-        val headsUpEntry = bhum.createHeadsUpEntry(notifEntry)
-        mAvalancheController!!.addToNext(headsUpEntry) {}
-
-        Truth.assertThat(mAvalancheController!!.getWaitingEntryList()).isNotEmpty()
-        Truth.assertThat(bhum.hasNotifications()).isTrue()
-    }
-
-    @Test
-    @EnableFlags(NotificationThrottleHun.FLAG_NAME)
-    fun testHasNotifications_false() {
-        val bhum = createHeadsUpManager()
-        Truth.assertThat(bhum.mHeadsUpEntryMap).isEmpty()
-        Truth.assertThat(mAvalancheController!!.getWaitingEntryList()).isEmpty()
-        Truth.assertThat(bhum.hasNotifications()).isFalse()
-    }
-
-    @Test
-    @EnableFlags(NotificationThrottleHun.FLAG_NAME)
-    fun testGetHeadsUpEntryList_includesAvalancheEntryList() {
-        val bhum = createHeadsUpManager()
-        val notifEntry = HeadsUpManagerTestUtil.createEntry(/* id= */ 0, mContext)
-        val headsUpEntry = bhum.createHeadsUpEntry(notifEntry)
-        mAvalancheController!!.addToNext(headsUpEntry) {}
-
-        Truth.assertThat(bhum.headsUpEntryList).contains(headsUpEntry)
-    }
-
-    @Test
-    @EnableFlags(NotificationThrottleHun.FLAG_NAME)
-    fun testGetHeadsUpEntry_returnsAvalancheEntry() {
-        val bhum = createHeadsUpManager()
-        val notifEntry = HeadsUpManagerTestUtil.createEntry(/* id= */ 0, mContext)
-        val headsUpEntry = bhum.createHeadsUpEntry(notifEntry)
-        mAvalancheController!!.addToNext(headsUpEntry) {}
-
-        Truth.assertThat(bhum.getHeadsUpEntry(notifEntry.key)).isEqualTo(headsUpEntry)
-    }
-
-    @Test
-    fun testShowNotification_addsEntry() {
-        val alm = createHeadsUpManager()
-        val entry = HeadsUpManagerTestUtil.createEntry(/* id= */ 0, mContext)
-
-        alm.showNotification(entry)
-
-        assertThat(alm.isHeadsUpEntry(entry.key)).isTrue()
-        assertThat(alm.hasNotifications()).isTrue()
-        assertThat(alm.getEntry(entry.key)).isEqualTo(entry)
-    }
-
-    @Test
-    fun testShowNotification_autoDismisses() {
-        val alm = createHeadsUpManager()
-        val entry = HeadsUpManagerTestUtil.createEntry(/* id= */ 0, mContext)
-
-        alm.showNotification(entry)
-        systemClock.advanceTime((TEST_AUTO_DISMISS_TIME * 3 / 2).toLong())
-
-        assertThat(alm.isHeadsUpEntry(entry.key)).isFalse()
-    }
-
-    @Test
-    fun testRemoveNotification_removeDeferred() {
-        val alm = createHeadsUpManager()
-        val entry = HeadsUpManagerTestUtil.createEntry(/* id= */ 0, mContext)
-
-        alm.showNotification(entry)
-
-        val removedImmediately =
-            alm.removeNotification(entry.key, /* releaseImmediately= */ false, "removeDeferred")
-        assertThat(removedImmediately).isFalse()
-        assertThat(alm.isHeadsUpEntry(entry.key)).isTrue()
-    }
-
-    @Test
-    fun testRemoveNotification_forceRemove() {
-        val alm = createHeadsUpManager()
-        val entry = HeadsUpManagerTestUtil.createEntry(/* id= */ 0, mContext)
-
-        alm.showNotification(entry)
-
-        val removedImmediately =
-            alm.removeNotification(entry.key, /* releaseImmediately= */ true, "forceRemove")
-        assertThat(removedImmediately).isTrue()
-        assertThat(alm.isHeadsUpEntry(entry.key)).isFalse()
-    }
-
-    @Test
-    fun testReleaseAllImmediately() {
-        val alm = createHeadsUpManager()
-        for (i in 0 until TEST_NUM_NOTIFICATIONS) {
-            val entry = HeadsUpManagerTestUtil.createEntry(i, mContext)
-            entry.row = mRow
-            alm.showNotification(entry)
-        }
-
-        alm.releaseAllImmediately()
-
-        assertThat(alm.allEntries.count()).isEqualTo(0)
-    }
-
-    @Test
-    fun testCanRemoveImmediately_notShownLongEnough() {
-        val alm = createHeadsUpManager()
-        val entry = HeadsUpManagerTestUtil.createEntry(/* id= */ 0, mContext)
-
-        alm.showNotification(entry)
-
-        // The entry has just been added so we should not remove immediately.
-        assertThat(alm.canRemoveImmediately(entry.key)).isFalse()
-    }
-
-    @Test
-    fun testHunRemovedLogging() {
-        val hum = createHeadsUpManager()
-        val notifEntry = HeadsUpManagerTestUtil.createEntry(/* id= */ 0, mContext)
-        val headsUpEntry = Mockito.mock(HeadsUpEntry::class.java)
-        Mockito.`when`(headsUpEntry.pinnedStatus)
-            .thenReturn(MutableStateFlow(PinnedStatus.NotPinned))
-        headsUpEntry.mEntry = notifEntry
-
-        hum.onEntryRemoved(headsUpEntry, "test")
-
-        Mockito.verify(mLogger, Mockito.times(1)).logNotificationActuallyRemoved(eq(notifEntry))
-    }
-
-    @Test
-    fun testShowNotification_autoDismissesIncludingTouchAcceptanceDelay() {
-        val hum = createHeadsUpManager()
-        val entry = HeadsUpManagerTestUtil.createEntry(/* id= */ 0, mContext)
-        useAccessibilityTimeout(false)
-
-        hum.showNotification(entry)
-        systemClock.advanceTime((TEST_TOUCH_ACCEPTANCE_TIME / 2 + TEST_AUTO_DISMISS_TIME).toLong())
-
-        assertThat(hum.isHeadsUpEntry(entry.key)).isTrue()
-    }
-
-    @Test
-    fun testShowNotification_autoDismissesWithDefaultTimeout() {
-        val hum = createHeadsUpManager()
-        val entry = HeadsUpManagerTestUtil.createEntry(/* id= */ 0, mContext)
-        useAccessibilityTimeout(false)
-
-        hum.showNotification(entry)
-        systemClock.advanceTime(
-            (TEST_TOUCH_ACCEPTANCE_TIME +
-                    (TEST_AUTO_DISMISS_TIME + TEST_A11Y_AUTO_DISMISS_TIME) / 2)
-                .toLong()
-        )
-
-        assertThat(hum.isHeadsUpEntry(entry.key)).isFalse()
-    }
-
-    @Test
-    fun testShowNotification_stickyForSomeTime_autoDismissesWithStickyTimeout() {
-        val hum = createHeadsUpManager()
-        val entry = createStickyForSomeTimeEntry(/* id= */ 0)
-        useAccessibilityTimeout(false)
-
-        hum.showNotification(entry)
-        systemClock.advanceTime(
-            (TEST_TOUCH_ACCEPTANCE_TIME +
-                    (TEST_AUTO_DISMISS_TIME + TEST_STICKY_AUTO_DISMISS_TIME) / 2)
-                .toLong()
-        )
-
-        assertThat(hum.isHeadsUpEntry(entry.key)).isTrue()
-    }
-
-    @Test
-    fun testShowNotification_sticky_neverAutoDismisses() {
-        val hum = createHeadsUpManager()
-        val entry = createStickyEntry(/* id= */ 0)
-        useAccessibilityTimeout(false)
-
-        hum.showNotification(entry)
-        systemClock.advanceTime(
-            (TEST_TOUCH_ACCEPTANCE_TIME + 2 * TEST_A11Y_AUTO_DISMISS_TIME).toLong()
-        )
-
-        assertThat(hum.isHeadsUpEntry(entry.key)).isTrue()
-    }
-
-    @Test
-    fun testShowNotification_autoDismissesWithAccessibilityTimeout() {
-        val hum = createHeadsUpManager()
-        val entry = HeadsUpManagerTestUtil.createEntry(/* id= */ 0, mContext)
-        useAccessibilityTimeout(true)
-
-        hum.showNotification(entry)
-        systemClock.advanceTime(
-            (TEST_TOUCH_ACCEPTANCE_TIME +
-                    (TEST_AUTO_DISMISS_TIME + TEST_A11Y_AUTO_DISMISS_TIME) / 2)
-                .toLong()
-        )
-
-        assertThat(hum.isHeadsUpEntry(entry.key)).isTrue()
-    }
-
-    @Test
-    fun testShowNotification_stickyForSomeTime_autoDismissesWithAccessibilityTimeout() {
-        val hum = createHeadsUpManager()
-        val entry = createStickyForSomeTimeEntry(/* id= */ 0)
-        useAccessibilityTimeout(true)
-
-        hum.showNotification(entry)
-        systemClock.advanceTime(
-            (TEST_TOUCH_ACCEPTANCE_TIME +
-                    (TEST_STICKY_AUTO_DISMISS_TIME + TEST_A11Y_AUTO_DISMISS_TIME) / 2)
-                .toLong()
-        )
-
-        assertThat(hum.isHeadsUpEntry(entry.key)).isTrue()
-    }
-
-    @Test
-    fun testRemoveNotification_beforeMinimumDisplayTime() {
-        val hum = createHeadsUpManager()
-        val entry = HeadsUpManagerTestUtil.createEntry(/* id= */ 0, mContext)
-        useAccessibilityTimeout(false)
-
-        hum.showNotification(entry)
-
-        val removedImmediately =
-            hum.removeNotification(
-                entry.key,
-                /* releaseImmediately = */ false,
-                "beforeMinimumDisplayTime",
-            )
-        assertThat(removedImmediately).isFalse()
-        assertThat(hum.isHeadsUpEntry(entry.key)).isTrue()
-
-        systemClock.advanceTime(((TEST_MINIMUM_DISPLAY_TIME + TEST_AUTO_DISMISS_TIME) / 2).toLong())
-
-        assertThat(hum.isHeadsUpEntry(entry.key)).isFalse()
-    }
-
-    @Test
-    fun testRemoveNotification_afterMinimumDisplayTime() {
-        val hum = createHeadsUpManager()
-        val entry = HeadsUpManagerTestUtil.createEntry(/* id= */ 0, mContext)
-        useAccessibilityTimeout(false)
-
-        hum.showNotification(entry)
-        systemClock.advanceTime(((TEST_MINIMUM_DISPLAY_TIME + TEST_AUTO_DISMISS_TIME) / 2).toLong())
-
-        assertThat(hum.isHeadsUpEntry(entry.key)).isTrue()
-
-        val removedImmediately =
-            hum.removeNotification(
-                entry.key,
-                /* releaseImmediately = */ false,
-                "afterMinimumDisplayTime",
-            )
-        assertThat(removedImmediately).isTrue()
-        assertThat(hum.isHeadsUpEntry(entry.key)).isFalse()
-    }
-
-    @Test
-    fun testRemoveNotification_releaseImmediately() {
-        val hum = createHeadsUpManager()
-        val entry = HeadsUpManagerTestUtil.createEntry(/* id= */ 0, mContext)
-
-        hum.showNotification(entry)
-
-        val removedImmediately =
-            hum.removeNotification(
-                entry.key,
-                /* releaseImmediately = */ true,
-                "afterMinimumDisplayTime",
-            )
-        assertThat(removedImmediately).isTrue()
-        assertThat(hum.isHeadsUpEntry(entry.key)).isFalse()
-    }
-
-    @Test
-    fun testIsSticky_rowPinnedAndExpanded_true() {
-        val hum = createHeadsUpManager()
-        val notifEntry = HeadsUpManagerTestUtil.createEntry(/* id= */ 0, mContext)
-        Mockito.`when`(mRow!!.isPinned).thenReturn(true)
-        notifEntry.row = mRow
-
-        hum.showNotification(notifEntry)
-
-        val headsUpEntry = hum.getHeadsUpEntry(notifEntry.key)
-        headsUpEntry!!.setExpanded(true)
-
-        assertThat(hum.isSticky(notifEntry.key)).isTrue()
-    }
-
-    @Test
-    fun testIsSticky_remoteInputActive_true() {
-        val hum = createHeadsUpManager()
-        val notifEntry = HeadsUpManagerTestUtil.createEntry(/* id= */ 0, mContext)
-
-        hum.showNotification(notifEntry)
-
-        val headsUpEntry = hum.getHeadsUpEntry(notifEntry.key)
-        headsUpEntry!!.mRemoteInputActive = true
-
-        assertThat(hum.isSticky(notifEntry.key)).isTrue()
-    }
-
-    @Test
-    fun testIsSticky_hasFullScreenIntent_true() {
-        val hum = createHeadsUpManager()
-        val notifEntry = HeadsUpManagerTestUtil.createFullScreenIntentEntry(/* id= */ 0, mContext)
-
-        hum.showNotification(notifEntry)
-
-        assertThat(hum.isSticky(notifEntry.key)).isTrue()
-    }
-
-    @Test
-    fun testIsSticky_stickyForSomeTime_false() {
-        val hum = createHeadsUpManager()
-        val entry = createStickyForSomeTimeEntry(/* id= */ 0)
-
-        hum.showNotification(entry)
-
-        assertThat(hum.isSticky(entry.key)).isFalse()
-    }
-
-    @Test
-    fun testIsSticky_false() {
-        val hum = createHeadsUpManager()
-        val notifEntry = HeadsUpManagerTestUtil.createEntry(/* id= */ 0, mContext)
-
-        hum.showNotification(notifEntry)
-
-        val headsUpEntry = hum.getHeadsUpEntry(notifEntry.key)
-        headsUpEntry!!.setExpanded(false)
-        headsUpEntry.mRemoteInputActive = false
-
-        assertThat(hum.isSticky(notifEntry.key)).isFalse()
-    }
-
-    @Test
-    fun testCompareTo_withNullEntries() {
-        val hum = createHeadsUpManager()
-        val alertEntry = NotificationEntryBuilder().setTag("alert").build()
-
-        hum.showNotification(alertEntry)
-
-        assertThat(hum.compare(alertEntry, null)).isLessThan(0)
-        assertThat(hum.compare(null, alertEntry)).isGreaterThan(0)
-        assertThat(hum.compare(null, null)).isEqualTo(0)
-    }
-
-    @Test
-    fun testCompareTo_withNonAlertEntries() {
-        val hum = createHeadsUpManager()
-
-        val nonAlertEntry1 = NotificationEntryBuilder().setTag("nae1").build()
-        val nonAlertEntry2 = NotificationEntryBuilder().setTag("nae2").build()
-        val alertEntry = NotificationEntryBuilder().setTag("alert").build()
-        hum.showNotification(alertEntry)
-
-        assertThat(hum.compare(alertEntry, nonAlertEntry1)).isLessThan(0)
-        assertThat(hum.compare(nonAlertEntry1, alertEntry)).isGreaterThan(0)
-        assertThat(hum.compare(nonAlertEntry1, nonAlertEntry2)).isEqualTo(0)
-    }
-
-    @Test
-    fun testAlertEntryCompareTo_ongoingCallLessThanActiveRemoteInput() {
-        val hum = createHeadsUpManager()
-
-        val ongoingCall =
-            hum.HeadsUpEntry(
-                NotificationEntryBuilder()
-                    .setSbn(
-                        HeadsUpManagerTestUtil.createSbn(
-                            /* id = */ 0,
-                            Notification.Builder(mContext, "")
-                                .setCategory(Notification.CATEGORY_CALL)
-                                .setOngoing(true),
-                        )
-                    )
-                    .build()
-            )
-
-        val activeRemoteInput =
-            hum.HeadsUpEntry(HeadsUpManagerTestUtil.createEntry(/* id= */ 1, mContext))
-        activeRemoteInput.mRemoteInputActive = true
-
-        assertThat(ongoingCall.compareTo(activeRemoteInput)).isLessThan(0)
-        assertThat(activeRemoteInput.compareTo(ongoingCall)).isGreaterThan(0)
-    }
-
-    @Test
-    fun testAlertEntryCompareTo_incomingCallLessThanActiveRemoteInput() {
-        val hum = createHeadsUpManager()
-
-        val person = Person.Builder().setName("person").build()
-        val intent = Mockito.mock(PendingIntent::class.java)
-        val incomingCall =
-            hum.HeadsUpEntry(
-                NotificationEntryBuilder()
-                    .setSbn(
-                        HeadsUpManagerTestUtil.createSbn(
-                            /* id = */ 0,
-                            Notification.Builder(mContext, "")
-                                .setStyle(
-                                    Notification.CallStyle.forIncomingCall(person, intent, intent)
-                                ),
-                        )
-                    )
-                    .build()
-            )
-
-        val activeRemoteInput =
-            hum.HeadsUpEntry(HeadsUpManagerTestUtil.createEntry(/* id= */ 1, mContext))
-        activeRemoteInput.mRemoteInputActive = true
-
-        assertThat(incomingCall.compareTo(activeRemoteInput)).isLessThan(0)
-        assertThat(activeRemoteInput.compareTo(incomingCall)).isGreaterThan(0)
-    }
-
-    @Test
-    @EnableFlags(NotificationThrottleHun.FLAG_NAME)
-    fun testPinEntry_logsPeek_throttleEnabled() {
-        val hum = createHeadsUpManager()
-
-        // Needs full screen intent in order to be pinned
-        val entryToPin =
-            hum.HeadsUpEntry(
-                HeadsUpManagerTestUtil.createFullScreenIntentEntry(/* id= */ 0, mContext)
-            )
-
-        // Note: the standard way to show a notification would be calling showNotification rather
-        // than onAlertEntryAdded. However, in practice showNotification in effect adds
-        // the notification and then updates it; in order to not log twice, the entry needs
-        // to have a functional ExpandableNotificationRow that can keep track of whether it's
-        // pinned or not (via isRowPinned()). That feels like a lot to pull in to test this one bit.
-        hum.onEntryAdded(entryToPin)
-
-        assertThat(mUiEventLoggerFake.numLogs()).isEqualTo(2)
-        assertThat(AvalancheController.ThrottleEvent.AVALANCHE_THROTTLING_HUN_SHOWN.getId())
-            .isEqualTo(mUiEventLoggerFake.eventId(0))
-        assertThat(HeadsUpManagerImpl.NotificationPeekEvent.NOTIFICATION_PEEK.id)
-            .isEqualTo(mUiEventLoggerFake.eventId(1))
-    }
-
-    @Test
-    @DisableFlags(NotificationThrottleHun.FLAG_NAME)
-    fun testPinEntry_logsPeek_throttleDisabled() {
-        val hum = createHeadsUpManager()
-
-        // Needs full screen intent in order to be pinned
-        val entryToPin =
-            hum.HeadsUpEntry(
-                HeadsUpManagerTestUtil.createFullScreenIntentEntry(/* id= */ 0, mContext)
-            )
-
-        // Note: the standard way to show a notification would be calling showNotification rather
-        // than onAlertEntryAdded. However, in practice showNotification in effect adds
-        // the notification and then updates it; in order to not log twice, the entry needs
-        // to have a functional ExpandableNotificationRow that can keep track of whether it's
-        // pinned or not (via isRowPinned()). That feels like a lot to pull in to test this one bit.
-        hum.onEntryAdded(entryToPin)
-
-        assertThat(mUiEventLoggerFake.numLogs()).isEqualTo(1)
-        assertThat(HeadsUpManagerImpl.NotificationPeekEvent.NOTIFICATION_PEEK.id)
-            .isEqualTo(mUiEventLoggerFake.eventId(0))
-    }
-
-    @Test
-    fun testSetUserActionMayIndirectlyRemove() {
-        val hum = createHeadsUpManager()
-        val notifEntry = HeadsUpManagerTestUtil.createEntry(/* id= */ 0, mContext)
-
-        hum.showNotification(notifEntry)
-
-        assertThat(hum.canRemoveImmediately(notifEntry.key)).isFalse()
-
-        hum.setUserActionMayIndirectlyRemove(notifEntry)
-
-        assertThat(hum.canRemoveImmediately(notifEntry.key)).isTrue()
-    }
-
-    companion object {
-        const val TEST_TOUCH_ACCEPTANCE_TIME: Int = 200
-        const val TEST_A11Y_AUTO_DISMISS_TIME: Int = 1000
-        const val TEST_EXTENSION_TIME = 500
-
-        const val TEST_MINIMUM_DISPLAY_TIME: Int = 400
-        const val TEST_AUTO_DISMISS_TIME: Int = 600
-        const val TEST_STICKY_AUTO_DISMISS_TIME: Int = 800
-
-        // Number of notifications to use in tests requiring multiple notifications
-        private const val TEST_NUM_NOTIFICATIONS = 4
-
-        init {
-            Truth.assertThat(TEST_MINIMUM_DISPLAY_TIME).isLessThan(TEST_AUTO_DISMISS_TIME)
-            Truth.assertThat(TEST_AUTO_DISMISS_TIME).isLessThan(TEST_STICKY_AUTO_DISMISS_TIME)
-            Truth.assertThat(TEST_STICKY_AUTO_DISMISS_TIME).isLessThan(TEST_A11Y_AUTO_DISMISS_TIME)
-        }
-
-        @get:Parameters(name = "{0}")
-        @JvmStatic
-        val flags: List<FlagsParameterization>
-            get() = FlagsParameterization.allCombinationsOf(NotificationThrottleHun.FLAG_NAME)
-    }
-}
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/headsup/HeadsUpManagerImplTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/headsup/HeadsUpManagerImplTest.kt
index a5fecb8..8420c49 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/headsup/HeadsUpManagerImplTest.kt
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/headsup/HeadsUpManagerImplTest.kt
@@ -15,25 +15,38 @@
  */
 package com.android.systemui.statusbar.notification.headsup
 
+import android.app.Notification
+import android.app.PendingIntent
+import android.app.Person
 import android.os.Handler
+import android.platform.test.annotations.DisableFlags
 import android.platform.test.annotations.EnableFlags
 import android.platform.test.flag.junit.FlagsParameterization
+import android.testing.TestableLooper
 import android.testing.TestableLooper.RunWithLooper
+import android.view.accessibility.accessibilityManager
 import android.view.accessibility.accessibilityManagerWrapper
 import androidx.test.filters.SmallTest
 import com.android.internal.logging.uiEventLoggerFake
+import com.android.systemui.SysuiTestCase
+import com.android.systemui.concurrency.fakeExecutor
 import com.android.systemui.dump.dumpManager
+import com.android.systemui.flags.BrokenWithSceneContainer
 import com.android.systemui.flags.andSceneContainer
 import com.android.systemui.kosmos.runTest
 import com.android.systemui.kosmos.testScope
 import com.android.systemui.kosmos.useUnconfinedTestDispatcher
-import com.android.systemui.log.logcatLogBuffer
 import com.android.systemui.res.R
 import com.android.systemui.shade.domain.interactor.shadeInteractor
 import com.android.systemui.shade.shadeTestUtil
 import com.android.systemui.statusbar.StatusBarState
+import com.android.systemui.statusbar.notification.collection.NotificationEntry
+import com.android.systemui.statusbar.notification.collection.NotificationEntryBuilder
 import com.android.systemui.statusbar.notification.collection.provider.visualStabilityProvider
 import com.android.systemui.statusbar.notification.collection.render.GroupMembershipManager
+import com.android.systemui.statusbar.notification.headsup.HeadsUpManagerImpl.HeadsUpEntry
+import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow
+import com.android.systemui.statusbar.notification.row.NotificationTestHelper
 import com.android.systemui.statusbar.notification.shared.NotificationThrottleHun
 import com.android.systemui.statusbar.phone.keyguardBypassController
 import com.android.systemui.statusbar.policy.configurationController
@@ -41,12 +54,19 @@
 import com.android.systemui.testKosmos
 import com.android.systemui.util.concurrency.mockExecutorHandler
 import com.android.systemui.util.kotlin.JavaAdapter
+import com.android.systemui.util.settings.fakeGlobalSettings
+import com.android.systemui.util.time.fakeSystemClock
 import com.google.common.truth.Truth.assertThat
 import org.junit.Before
 import org.junit.Ignore
 import org.junit.Test
 import org.junit.runner.RunWith
+import org.mockito.kotlin.any
+import org.mockito.kotlin.doAnswer
+import org.mockito.kotlin.eq
 import org.mockito.kotlin.mock
+import org.mockito.kotlin.times
+import org.mockito.kotlin.verify
 import org.mockito.kotlin.whenever
 import platform.test.runner.parameterized.ParameterizedAndroidJunit4
 import platform.test.runner.parameterized.Parameters
@@ -54,19 +74,26 @@
 @SmallTest
 @RunWith(ParameterizedAndroidJunit4::class)
 @RunWithLooper
-class HeadsUpManagerImplTest(flags: FlagsParameterization) : HeadsUpManagerImplOldTest(flags) {
-
-    private val headsUpManagerLogger = HeadsUpManagerLogger(logcatLogBuffer())
+class HeadsUpManagerImplTest(flags: FlagsParameterization) : SysuiTestCase() {
+    init {
+        mSetFlagsRule.setFlagsParameterization(flags)
+    }
 
     private val kosmos = testKosmos().useUnconfinedTestDispatcher()
     private val testScope = kosmos.testScope
 
     private val groupManager = mock<GroupMembershipManager>()
     private val bgHandler = mock<Handler>()
+    private val headsUpManagerLogger = mock<HeadsUpManagerLogger>()
 
     val statusBarStateController = kosmos.sysuiStatusBarStateController
+    private val globalSettings = kosmos.fakeGlobalSettings
+    private val systemClock = kosmos.fakeSystemClock
+    private val executor = kosmos.fakeExecutor
+    private val uiEventLoggerFake = kosmos.uiEventLoggerFake
     private val javaAdapter: JavaAdapter = JavaAdapter(testScope.backgroundScope)
 
+    private lateinit var testHelper: NotificationTestHelper
     private lateinit var avalancheController: AvalancheController
     private lateinit var underTest: HeadsUpManagerImpl
 
@@ -90,12 +117,15 @@
             )
         }
 
+        allowTestableLooperAsMainThread()
+        testHelper = NotificationTestHelper(mContext, mDependency, TestableLooper.get(this))
+
         whenever(kosmos.keyguardBypassController.bypassEnabled).thenReturn(false)
         kosmos.visualStabilityProvider.isReorderingAllowed = true
         avalancheController =
             AvalancheController(
                 kosmos.dumpManager,
-                kosmos.uiEventLoggerFake,
+                uiEventLoggerFake,
                 headsUpManagerLogger,
                 bgHandler,
             )
@@ -113,7 +143,7 @@
                 systemClock,
                 executor,
                 kosmos.accessibilityManagerWrapper,
-                kosmos.uiEventLoggerFake,
+                uiEventLoggerFake,
                 javaAdapter,
                 kosmos.shadeInteractor,
                 avalancheController,
@@ -121,6 +151,220 @@
     }
 
     @Test
+    fun testHasNotifications_headsUpManagerMapNotEmpty_true() {
+        val entry = HeadsUpManagerTestUtil.createEntry(/* id= */ 0, mContext)
+        underTest.showNotification(entry)
+
+        assertThat(underTest.mHeadsUpEntryMap).isNotEmpty()
+        assertThat(underTest.hasNotifications()).isTrue()
+    }
+
+    @Test
+    @EnableFlags(NotificationThrottleHun.FLAG_NAME)
+    fun testHasNotifications_avalancheMapNotEmpty_true() {
+        val notifEntry = HeadsUpManagerTestUtil.createEntry(/* id= */ 0, mContext)
+        val headsUpEntry = underTest.createHeadsUpEntry(notifEntry)
+        avalancheController.addToNext(headsUpEntry) {}
+
+        assertThat(avalancheController.getWaitingEntryList()).isNotEmpty()
+        assertThat(underTest.hasNotifications()).isTrue()
+    }
+
+    @Test
+    @EnableFlags(NotificationThrottleHun.FLAG_NAME)
+    fun testHasNotifications_false() {
+        assertThat(underTest.mHeadsUpEntryMap).isEmpty()
+        assertThat(avalancheController.getWaitingEntryList()).isEmpty()
+        assertThat(underTest.hasNotifications()).isFalse()
+    }
+
+    @Test
+    @EnableFlags(NotificationThrottleHun.FLAG_NAME)
+    fun testGetHeadsUpEntryList_includesAvalancheEntryList() {
+        val notifEntry = HeadsUpManagerTestUtil.createEntry(/* id= */ 0, mContext)
+        val headsUpEntry = underTest.createHeadsUpEntry(notifEntry)
+        avalancheController.addToNext(headsUpEntry) {}
+
+        assertThat(underTest.headsUpEntryList).contains(headsUpEntry)
+    }
+
+    @Test
+    @EnableFlags(NotificationThrottleHun.FLAG_NAME)
+    fun testGetHeadsUpEntry_returnsAvalancheEntry() {
+        val notifEntry = HeadsUpManagerTestUtil.createEntry(/* id= */ 0, mContext)
+        val headsUpEntry = underTest.createHeadsUpEntry(notifEntry)
+        avalancheController.addToNext(headsUpEntry) {}
+
+        assertThat(underTest.getHeadsUpEntry(notifEntry.key)).isEqualTo(headsUpEntry)
+    }
+
+    @Test
+    fun testShowNotification_addsEntry() {
+        val entry = HeadsUpManagerTestUtil.createEntry(/* id= */ 0, mContext)
+
+        underTest.showNotification(entry)
+
+        assertThat(underTest.isHeadsUpEntry(entry.key)).isTrue()
+        assertThat(underTest.hasNotifications()).isTrue()
+        assertThat(underTest.getEntry(entry.key)).isEqualTo(entry)
+    }
+
+    @Test
+    fun testShowNotification_autoDismisses() {
+        val entry = HeadsUpManagerTestUtil.createEntry(/* id= */ 0, mContext)
+
+        underTest.showNotification(entry)
+        systemClock.advanceTime((TEST_AUTO_DISMISS_TIME * 3 / 2).toLong())
+
+        assertThat(underTest.isHeadsUpEntry(entry.key)).isFalse()
+    }
+
+    @Test
+    fun testRemoveNotification_removeDeferred() {
+        val entry = HeadsUpManagerTestUtil.createEntry(/* id= */ 0, mContext)
+
+        underTest.showNotification(entry)
+
+        val removedImmediately =
+            underTest.removeNotification(
+                entry.key,
+                /* releaseImmediately= */ false,
+                "removeDeferred",
+            )
+        assertThat(removedImmediately).isFalse()
+        assertThat(underTest.isHeadsUpEntry(entry.key)).isTrue()
+    }
+
+    @Test
+    fun testRemoveNotification_forceRemove() {
+        val entry = HeadsUpManagerTestUtil.createEntry(/* id= */ 0, mContext)
+
+        underTest.showNotification(entry)
+
+        val removedImmediately =
+            underTest.removeNotification(entry.key, /* releaseImmediately= */ true, "forceRemove")
+        assertThat(removedImmediately).isTrue()
+        assertThat(underTest.isHeadsUpEntry(entry.key)).isFalse()
+    }
+
+    @Test
+    fun testReleaseAllImmediately() {
+        for (i in 0 until 4) {
+            val entry = HeadsUpManagerTestUtil.createEntry(i, mContext)
+            entry.row = mock<ExpandableNotificationRow>()
+            underTest.showNotification(entry)
+        }
+
+        underTest.releaseAllImmediately()
+
+        assertThat(underTest.allEntries.count()).isEqualTo(0)
+    }
+
+    @Test
+    fun testCanRemoveImmediately_notShownLongEnough() {
+        val entry = HeadsUpManagerTestUtil.createEntry(/* id= */ 0, mContext)
+
+        underTest.showNotification(entry)
+
+        // The entry has just been added so we should not remove immediately.
+        assertThat(underTest.canRemoveImmediately(entry.key)).isFalse()
+    }
+
+    @Test
+    fun testHunRemovedLogging() {
+        val notifEntry = HeadsUpManagerTestUtil.createEntry(/* id= */ 0, mContext)
+        val headsUpEntry = underTest.HeadsUpEntry(notifEntry)
+        headsUpEntry.setRowPinnedStatus(PinnedStatus.NotPinned)
+
+        underTest.onEntryRemoved(headsUpEntry, "test")
+
+        verify(headsUpManagerLogger, times(1)).logNotificationActuallyRemoved(eq(notifEntry))
+    }
+
+    @Test
+    fun testShowNotification_autoDismissesIncludingTouchAcceptanceDelay() {
+        val entry = HeadsUpManagerTestUtil.createEntry(/* id= */ 0, mContext)
+        useAccessibilityTimeout(false)
+
+        underTest.showNotification(entry)
+        systemClock.advanceTime((TEST_TOUCH_ACCEPTANCE_TIME / 2 + TEST_AUTO_DISMISS_TIME).toLong())
+
+        assertThat(underTest.isHeadsUpEntry(entry.key)).isTrue()
+    }
+
+    @Test
+    fun testShowNotification_autoDismissesWithDefaultTimeout() {
+        val entry = HeadsUpManagerTestUtil.createEntry(/* id= */ 0, mContext)
+        useAccessibilityTimeout(false)
+
+        underTest.showNotification(entry)
+        systemClock.advanceTime(
+            (TEST_TOUCH_ACCEPTANCE_TIME +
+                    (TEST_AUTO_DISMISS_TIME + TEST_A11Y_AUTO_DISMISS_TIME) / 2)
+                .toLong()
+        )
+
+        assertThat(underTest.isHeadsUpEntry(entry.key)).isFalse()
+    }
+
+    @Test
+    fun testRemoveNotification_beforeMinimumDisplayTime() {
+        val entry = HeadsUpManagerTestUtil.createEntry(/* id= */ 0, mContext)
+        useAccessibilityTimeout(false)
+
+        underTest.showNotification(entry)
+
+        val removedImmediately =
+            underTest.removeNotification(
+                entry.key,
+                /* releaseImmediately = */ false,
+                "beforeMinimumDisplayTime",
+            )
+        assertThat(removedImmediately).isFalse()
+        assertThat(underTest.isHeadsUpEntry(entry.key)).isTrue()
+
+        systemClock.advanceTime(((TEST_MINIMUM_DISPLAY_TIME + TEST_AUTO_DISMISS_TIME) / 2).toLong())
+
+        assertThat(underTest.isHeadsUpEntry(entry.key)).isFalse()
+    }
+
+    @Test
+    fun testRemoveNotification_afterMinimumDisplayTime() {
+        val entry = HeadsUpManagerTestUtil.createEntry(/* id= */ 0, mContext)
+        useAccessibilityTimeout(false)
+
+        underTest.showNotification(entry)
+        systemClock.advanceTime(((TEST_MINIMUM_DISPLAY_TIME + TEST_AUTO_DISMISS_TIME) / 2).toLong())
+
+        assertThat(underTest.isHeadsUpEntry(entry.key)).isTrue()
+
+        val removedImmediately =
+            underTest.removeNotification(
+                entry.key,
+                /* releaseImmediately = */ false,
+                "afterMinimumDisplayTime",
+            )
+        assertThat(removedImmediately).isTrue()
+        assertThat(underTest.isHeadsUpEntry(entry.key)).isFalse()
+    }
+
+    @Test
+    fun testRemoveNotification_releaseImmediately() {
+        val entry = HeadsUpManagerTestUtil.createEntry(/* id= */ 0, mContext)
+
+        underTest.showNotification(entry)
+
+        val removedImmediately =
+            underTest.removeNotification(
+                entry.key,
+                /* releaseImmediately = */ true,
+                "afterMinimumDisplayTime",
+            )
+        assertThat(removedImmediately).isTrue()
+        assertThat(underTest.isHeadsUpEntry(entry.key)).isFalse()
+    }
+
+    @Test
     fun testSnooze() {
         val entry = HeadsUpManagerTestUtil.createEntry(/* id= */ 0, mContext)
         underTest.showNotification(entry)
@@ -160,7 +404,7 @@
     fun testCanRemoveImmediately_notTopEntry() {
         val earlierEntry = HeadsUpManagerTestUtil.createEntry(/* id= */ 0, mContext)
         val laterEntry = HeadsUpManagerTestUtil.createEntry(/* id= */ 1, mContext)
-        laterEntry.row = mRow
+        laterEntry.row = mock<ExpandableNotificationRow>()
         underTest.showNotification(earlierEntry)
         underTest.showNotification(laterEntry)
 
@@ -226,6 +470,122 @@
     }
 
     @Test
+    fun testShowNotification_sticky_neverAutoDismisses() {
+        val entry = createStickyEntry(id = 0)
+        useAccessibilityTimeout(false)
+
+        underTest.showNotification(entry)
+        systemClock.advanceTime(
+            (TEST_TOUCH_ACCEPTANCE_TIME + 2 * TEST_A11Y_AUTO_DISMISS_TIME).toLong()
+        )
+
+        assertThat(underTest.isHeadsUpEntry(entry.key)).isTrue()
+    }
+
+    @Test
+    fun testShowNotification_autoDismissesWithAccessibilityTimeout() {
+        val entry = HeadsUpManagerTestUtil.createEntry(/* id= */ 0, mContext)
+        useAccessibilityTimeout(true)
+
+        underTest.showNotification(entry)
+        systemClock.advanceTime(
+            (TEST_TOUCH_ACCEPTANCE_TIME +
+                    (TEST_AUTO_DISMISS_TIME + TEST_A11Y_AUTO_DISMISS_TIME) / 2)
+                .toLong()
+        )
+
+        assertThat(underTest.isHeadsUpEntry(entry.key)).isTrue()
+    }
+
+    @Test
+    fun testShowNotification_stickyForSomeTime_autoDismissesWithStickyTimeout() {
+        val entry = createStickyForSomeTimeEntry(id = 0)
+        useAccessibilityTimeout(false)
+
+        underTest.showNotification(entry)
+        systemClock.advanceTime(
+            (TEST_TOUCH_ACCEPTANCE_TIME +
+                    (TEST_AUTO_DISMISS_TIME + TEST_STICKY_AUTO_DISMISS_TIME) / 2)
+                .toLong()
+        )
+
+        assertThat(underTest.isHeadsUpEntry(entry.key)).isTrue()
+    }
+
+    @Test
+    fun testShowNotification_stickyForSomeTime_autoDismissesWithAccessibilityTimeout() {
+        val entry = createStickyForSomeTimeEntry(id = 0)
+        useAccessibilityTimeout(true)
+
+        underTest.showNotification(entry)
+        systemClock.advanceTime(
+            (TEST_TOUCH_ACCEPTANCE_TIME +
+                    (TEST_STICKY_AUTO_DISMISS_TIME + TEST_A11Y_AUTO_DISMISS_TIME) / 2)
+                .toLong()
+        )
+
+        assertThat(underTest.isHeadsUpEntry(entry.key)).isTrue()
+    }
+
+    @Test
+    fun testIsSticky_rowPinnedAndExpanded_true() {
+        val notifEntry = HeadsUpManagerTestUtil.createEntry(/* id= */ 0, mContext)
+        val row = testHelper.createRow()
+        row.setPinnedStatus(PinnedStatus.PinnedBySystem)
+        notifEntry.row = row
+
+        underTest.showNotification(notifEntry)
+
+        val headsUpEntry = underTest.getHeadsUpEntry(notifEntry.key)
+        headsUpEntry!!.setExpanded(true)
+
+        assertThat(underTest.isSticky(notifEntry.key)).isTrue()
+    }
+
+    @Test
+    fun testIsSticky_remoteInputActive_true() {
+        val notifEntry = HeadsUpManagerTestUtil.createEntry(/* id= */ 0, mContext)
+
+        underTest.showNotification(notifEntry)
+
+        val headsUpEntry = underTest.getHeadsUpEntry(notifEntry.key)
+        headsUpEntry!!.mRemoteInputActive = true
+
+        assertThat(underTest.isSticky(notifEntry.key)).isTrue()
+    }
+
+    @Test
+    fun testIsSticky_hasFullScreenIntent_true() {
+        val notifEntry = HeadsUpManagerTestUtil.createFullScreenIntentEntry(/* id= */ 0, mContext)
+
+        underTest.showNotification(notifEntry)
+
+        assertThat(underTest.isSticky(notifEntry.key)).isTrue()
+    }
+
+    @Test
+    fun testIsSticky_stickyForSomeTime_false() {
+        val entry = createStickyForSomeTimeEntry(id = 0)
+
+        underTest.showNotification(entry)
+
+        assertThat(underTest.isSticky(entry.key)).isFalse()
+    }
+
+    @Test
+    fun testIsSticky_false() {
+        val notifEntry = HeadsUpManagerTestUtil.createEntry(/* id= */ 0, mContext)
+
+        underTest.showNotification(notifEntry)
+
+        val headsUpEntry = underTest.getHeadsUpEntry(notifEntry.key)
+        headsUpEntry!!.setExpanded(false)
+        headsUpEntry.mRemoteInputActive = false
+
+        assertThat(underTest.isSticky(notifEntry.key)).isFalse()
+    }
+
+    @Test
     fun testShouldHeadsUpBecomePinned_noFSI_false() =
         kosmos.runTest {
             statusBarStateController.setState(StatusBarState.KEYGUARD)
@@ -270,11 +630,13 @@
         }
 
     @Test
+    @BrokenWithSceneContainer(381869885) // because `ShadeTestUtil.setShadeExpansion(0f)`
+    // still causes `ShadeInteractor.isAnyExpanded` to emit `true`, when it should emit `false`.
     fun shouldHeadsUpBecomePinned_shadeNotExpanded_true() =
         kosmos.runTest {
             // GIVEN
-            shadeTestUtil.setShadeExpansion(0f)
-            // TODO(b/381869885): Determine why we need both of these ShadeTestUtil calls.
+            // TODO(b/381869885): We should be able to use `ShadeTestUtil.setShadeExpansion(0f)`
+            // instead.
             shadeTestUtil.setLegacyExpandedOrAwaitingInputTransfer(false)
 
             val entry = HeadsUpManagerTestUtil.createEntry(/* id= */ 0, mContext)
@@ -347,8 +709,183 @@
             assertThat(underTest.shouldHeadsUpBecomePinned(entry)).isFalse()
         }
 
+    @Test
+    fun testCompareTo_withNullEntries() {
+        val alertEntry = NotificationEntryBuilder().setTag("alert").build()
+
+        underTest.showNotification(alertEntry)
+
+        assertThat(underTest.compare(alertEntry, null)).isLessThan(0)
+        assertThat(underTest.compare(null, alertEntry)).isGreaterThan(0)
+        assertThat(underTest.compare(null, null)).isEqualTo(0)
+    }
+
+    @Test
+    fun testCompareTo_withNonAlertEntries() {
+        val nonAlertEntry1 = NotificationEntryBuilder().setTag("nae1").build()
+        val nonAlertEntry2 = NotificationEntryBuilder().setTag("nae2").build()
+        val alertEntry = NotificationEntryBuilder().setTag("alert").build()
+        underTest.showNotification(alertEntry)
+
+        assertThat(underTest.compare(alertEntry, nonAlertEntry1)).isLessThan(0)
+        assertThat(underTest.compare(nonAlertEntry1, alertEntry)).isGreaterThan(0)
+        assertThat(underTest.compare(nonAlertEntry1, nonAlertEntry2)).isEqualTo(0)
+    }
+
+    @Test
+    fun testAlertEntryCompareTo_ongoingCallLessThanActiveRemoteInput() {
+        val ongoingCall =
+            underTest.HeadsUpEntry(
+                NotificationEntryBuilder()
+                    .setSbn(
+                        HeadsUpManagerTestUtil.createSbn(
+                            /* id = */ 0,
+                            Notification.Builder(mContext, "")
+                                .setCategory(Notification.CATEGORY_CALL)
+                                .setOngoing(true),
+                        )
+                    )
+                    .build()
+            )
+
+        val activeRemoteInput =
+            underTest.HeadsUpEntry(HeadsUpManagerTestUtil.createEntry(/* id= */ 1, mContext))
+        activeRemoteInput.mRemoteInputActive = true
+
+        assertThat(ongoingCall.compareTo(activeRemoteInput)).isLessThan(0)
+        assertThat(activeRemoteInput.compareTo(ongoingCall)).isGreaterThan(0)
+    }
+
+    @Test
+    fun testAlertEntryCompareTo_incomingCallLessThanActiveRemoteInput() {
+        val person = Person.Builder().setName("person").build()
+        val intent = mock<PendingIntent>()
+        val incomingCall =
+            underTest.HeadsUpEntry(
+                NotificationEntryBuilder()
+                    .setSbn(
+                        HeadsUpManagerTestUtil.createSbn(
+                            /* id = */ 0,
+                            Notification.Builder(mContext, "")
+                                .setStyle(
+                                    Notification.CallStyle.forIncomingCall(person, intent, intent)
+                                ),
+                        )
+                    )
+                    .build()
+            )
+
+        val activeRemoteInput =
+            underTest.HeadsUpEntry(HeadsUpManagerTestUtil.createEntry(/* id= */ 1, mContext))
+        activeRemoteInput.mRemoteInputActive = true
+
+        assertThat(incomingCall.compareTo(activeRemoteInput)).isLessThan(0)
+        assertThat(activeRemoteInput.compareTo(incomingCall)).isGreaterThan(0)
+    }
+
+    @Test
+    @EnableFlags(NotificationThrottleHun.FLAG_NAME)
+    fun testPinEntry_logsPeek_throttleEnabled() {
+        // Needs full screen intent in order to be pinned
+        val entryToPin =
+            underTest.HeadsUpEntry(
+                HeadsUpManagerTestUtil.createFullScreenIntentEntry(/* id= */ 0, mContext)
+            )
+
+        // Note: the standard way to show a notification would be calling showNotification rather
+        // than onAlertEntryAdded. However, in practice showNotification in effect adds
+        // the notification and then updates it; in order to not log twice, the entry needs
+        // to have a functional ExpandableNotificationRow that can keep track of whether it's
+        // pinned or not (via isRowPinned()). That feels like a lot to pull in to test this one bit.
+        underTest.onEntryAdded(entryToPin)
+
+        assertThat(uiEventLoggerFake.numLogs()).isEqualTo(2)
+        assertThat(AvalancheController.ThrottleEvent.AVALANCHE_THROTTLING_HUN_SHOWN.getId())
+            .isEqualTo(uiEventLoggerFake.eventId(0))
+        assertThat(HeadsUpManagerImpl.NotificationPeekEvent.NOTIFICATION_PEEK.id)
+            .isEqualTo(uiEventLoggerFake.eventId(1))
+    }
+
+    @Test
+    @DisableFlags(NotificationThrottleHun.FLAG_NAME)
+    fun testPinEntry_logsPeek_throttleDisabled() {
+        // Needs full screen intent in order to be pinned
+        val entryToPin =
+            underTest.HeadsUpEntry(
+                HeadsUpManagerTestUtil.createFullScreenIntentEntry(/* id= */ 0, mContext)
+            )
+
+        // Note: the standard way to show a notification would be calling showNotification rather
+        // than onAlertEntryAdded. However, in practice showNotification in effect adds
+        // the notification and then updates it; in order to not log twice, the entry needs
+        // to have a functional ExpandableNotificationRow that can keep track of whether it's
+        // pinned or not (via isRowPinned()). That feels like a lot to pull in to test this one bit.
+        underTest.onEntryAdded(entryToPin)
+
+        assertThat(uiEventLoggerFake.numLogs()).isEqualTo(1)
+        assertThat(HeadsUpManagerImpl.NotificationPeekEvent.NOTIFICATION_PEEK.id)
+            .isEqualTo(uiEventLoggerFake.eventId(0))
+    }
+
+    @Test
+    fun testSetUserActionMayIndirectlyRemove() {
+        val notifEntry = HeadsUpManagerTestUtil.createEntry(/* id= */ 0, mContext)
+
+        underTest.showNotification(notifEntry)
+
+        assertThat(underTest.canRemoveImmediately(notifEntry.key)).isFalse()
+
+        underTest.setUserActionMayIndirectlyRemove(notifEntry)
+
+        assertThat(underTest.canRemoveImmediately(notifEntry.key)).isTrue()
+    }
+
+    private fun createStickyEntry(id: Int): NotificationEntry {
+        val notif =
+            Notification.Builder(mContext, "")
+                .setSmallIcon(R.drawable.ic_person)
+                .setFullScreenIntent(mock<PendingIntent>(), /* highPriority= */ true)
+                .build()
+        return HeadsUpManagerTestUtil.createEntry(id, notif)
+    }
+
+    private fun createStickyForSomeTimeEntry(id: Int): NotificationEntry {
+        val notif =
+            Notification.Builder(mContext, "")
+                .setSmallIcon(R.drawable.ic_person)
+                .setFlag(Notification.FLAG_FSI_REQUESTED_BUT_DENIED, true)
+                .build()
+        return HeadsUpManagerTestUtil.createEntry(id, notif)
+    }
+
+    private fun useAccessibilityTimeout(use: Boolean) {
+        if (use) {
+            whenever(kosmos.accessibilityManager.getRecommendedTimeoutMillis(any(), any()))
+                .thenReturn(TEST_A11Y_AUTO_DISMISS_TIME)
+        } else {
+            doAnswer { it.getArgument(0) as Int }
+                .whenever(kosmos.accessibilityManager)
+                .getRecommendedTimeoutMillis(any(), any())
+        }
+    }
+
     companion object {
+        const val TEST_TOUCH_ACCEPTANCE_TIME = 200
+        const val TEST_A11Y_AUTO_DISMISS_TIME = 1000
+        const val TEST_EXTENSION_TIME = 500
+
+        const val TEST_MINIMUM_DISPLAY_TIME = 400
+        const val TEST_AUTO_DISMISS_TIME = 600
+        const val TEST_STICKY_AUTO_DISMISS_TIME = 800
+
+        init {
+            assertThat(TEST_MINIMUM_DISPLAY_TIME).isLessThan(TEST_AUTO_DISMISS_TIME)
+            assertThat(TEST_AUTO_DISMISS_TIME).isLessThan(TEST_STICKY_AUTO_DISMISS_TIME)
+            assertThat(TEST_STICKY_AUTO_DISMISS_TIME).isLessThan(TEST_A11Y_AUTO_DISMISS_TIME)
+        }
+
         @get:Parameters(name = "{0}")
+        @JvmStatic
         val flags: List<FlagsParameterization>
             get() = buildList {
                 addAll(
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/phone/CentralSurfacesCommandQueueCallbacksTest.java b/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/phone/CentralSurfacesCommandQueueCallbacksTest.java
index f76f1ce..7f139bd 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/phone/CentralSurfacesCommandQueueCallbacksTest.java
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/phone/CentralSurfacesCommandQueueCallbacksTest.java
@@ -30,6 +30,8 @@
 import android.os.PowerManager;
 import android.os.UserHandle;
 import android.os.Vibrator;
+import android.platform.test.annotations.DisableFlags;
+import android.platform.test.annotations.EnableFlags;
 import android.view.HapticFeedbackConstants;
 
 import androidx.test.ext.junit.runners.AndroidJUnit4;
@@ -45,6 +47,8 @@
 import com.android.systemui.keyguard.domain.interactor.KeyguardInteractor;
 import com.android.systemui.plugins.ActivityStarter;
 import com.android.systemui.qs.QSHost;
+import com.android.systemui.qs.QSPanelController;
+import com.android.systemui.qs.flags.QSComposeFragment;
 import com.android.systemui.recents.ScreenPinningRequest;
 import com.android.systemui.settings.UserTracker;
 import com.android.systemui.shade.CameraLauncher;
@@ -54,15 +58,14 @@
 import com.android.systemui.shade.ShadeViewController;
 import com.android.systemui.shade.domain.interactor.PanelExpansionInteractor;
 import com.android.systemui.shade.domain.interactor.ShadeInteractor;
+import com.android.systemui.shade.shared.flag.DualShade;
 import com.android.systemui.statusbar.CommandQueue;
+import com.android.systemui.statusbar.notification.headsup.HeadsUpManager;
 import com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayoutController;
 import com.android.systemui.statusbar.policy.DeviceProvisionedController;
-import com.android.systemui.statusbar.notification.headsup.HeadsUpManager;
 import com.android.systemui.statusbar.policy.KeyguardStateController;
 import com.android.systemui.statusbar.policy.RemoteInputQuickSettingsDisabler;
 
-import dagger.Lazy;
-
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
@@ -72,6 +75,8 @@
 
 import java.util.Optional;
 
+import dagger.Lazy;
+
 @SmallTest
 @RunWith(AndroidJUnit4.class)
 public class CentralSurfacesCommandQueueCallbacksTest extends SysuiTestCase {
@@ -105,6 +110,7 @@
     @Mock private ActivityStarter mActivityStarter;
     @Mock private EmergencyGestureIntentFactory mEmergencyGestureIntentFactory;
     @Mock private KeyguardInteractor mKeyguardInteractor;
+    @Mock private QSPanelController mQSPanelController;
 
     CentralSurfacesCommandQueueCallbacks mSbcqCallbacks;
 
@@ -150,6 +156,7 @@
         when(mDeviceProvisionedController.isCurrentUserSetup()).thenReturn(true);
         when(mRemoteInputQuickSettingsDisabler.adjustDisableFlags(anyInt()))
                 .thenAnswer((Answer<Integer>) invocation -> invocation.getArgument(0));
+        when(mCentralSurfaces.getQSPanelController()).thenReturn(mQSPanelController);
     }
 
     @Test
@@ -230,4 +237,45 @@
 
         verify(mQSHost).addTile(c, false);
     }
+
+    @Test
+    @DisableFlags(value = {QSComposeFragment.FLAG_NAME, DualShade.FLAG_NAME})
+    public void clickQsTile_flagsDisabled_callsQSPanelController() {
+        ComponentName c = new ComponentName("testpkg", "testcls");
+
+        mSbcqCallbacks.clickTile(c);
+        verify(mQSPanelController).clickTile(c);
+    }
+
+    @Test
+    @DisableFlags(DualShade.FLAG_NAME)
+    @EnableFlags(QSComposeFragment.FLAG_NAME)
+    public void clickQsTile_onlyQSComposeFlag_callsQSHost() {
+        ComponentName c = new ComponentName("testpkg", "testcls");
+
+        mSbcqCallbacks.clickTile(c);
+        verify(mQSPanelController, never()).clickTile(c);
+        verify(mQSHost).clickTile(c);
+    }
+
+    @Test
+    @EnableFlags(DualShade.FLAG_NAME)
+    @DisableFlags(QSComposeFragment.FLAG_NAME)
+    public void clickQsTile_onlyDualShadeFlag_callsQSHost() {
+        ComponentName c = new ComponentName("testpkg", "testcls");
+
+        mSbcqCallbacks.clickTile(c);
+        verify(mQSPanelController, never()).clickTile(c);
+        verify(mQSHost).clickTile(c);
+    }
+
+    @Test
+    @EnableFlags(value = {QSComposeFragment.FLAG_NAME, DualShade.FLAG_NAME})
+    public void clickQsTile_qsComposeAndDualShadeFlags_callsQSHost() {
+        ComponentName c = new ComponentName("testpkg", "testcls");
+
+        mSbcqCallbacks.clickTile(c);
+        verify(mQSPanelController, never()).clickTile(c);
+        verify(mQSHost).clickTile(c);
+    }
 }
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/pipeline/shared/ui/viewmodel/FakeHomeStatusBarViewBinder.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/pipeline/shared/ui/viewmodel/FakeHomeStatusBarViewBinder.kt
index 9888574..a2ca12c 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/pipeline/shared/ui/viewmodel/FakeHomeStatusBarViewBinder.kt
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/pipeline/shared/ui/viewmodel/FakeHomeStatusBarViewBinder.kt
@@ -30,6 +30,7 @@
     var listener: StatusBarVisibilityChangeListener? = null
 
     override fun bind(
+        displayId: Int,
         view: View,
         viewModel: HomeStatusBarViewModel,
         systemEventChipAnimateIn: ((View) -> Unit)?,
diff --git a/packages/SystemUI/res/layout/volume_dialog_slider.xml b/packages/SystemUI/res/layout/volume_dialog_slider.xml
index c1852b1..9ac456c 100644
--- a/packages/SystemUI/res/layout/volume_dialog_slider.xml
+++ b/packages/SystemUI/res/layout/volume_dialog_slider.xml
@@ -14,15 +14,21 @@
      limitations under the License.
 -->
 <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="@dimen/volume_dialog_slider_width"
-    android:layout_height="@dimen/volume_dialog_slider_height">
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    android:layout_width="wrap_content"
+    android:layout_height="wrap_content">
 
     <com.google.android.material.slider.Slider
-        style="@style/SystemUI.Material3.Slider.Volume"
         android:id="@+id/volume_dialog_slider"
-        android:layout_width="@dimen/volume_dialog_slider_height"
-        android:layout_height="match_parent"
+        style="@style/SystemUI.Material3.Slider.Volume"
+        android:layout_width="@dimen/volume_dialog_slider_width"
+        android:layout_height="@dimen/volume_dialog_slider_height"
         android:layout_gravity="center"
-        android:rotation="270"
-        android:theme="@style/Theme.Material3.Light" />
-</FrameLayout>
+        android:theme="@style/Theme.Material3.Light"
+        android:orientation="vertical"
+        app:thumbHeight="52dp"
+        app:trackCornerSize="12dp"
+        app:trackHeight="40dp"
+        app:trackStopIndicatorSize="6dp"
+        app:trackInsideCornerSize="2dp" />
+</FrameLayout>
\ No newline at end of file
diff --git a/packages/SystemUI/res/values/dimens.xml b/packages/SystemUI/res/values/dimens.xml
index 478050b..df7adc0 100644
--- a/packages/SystemUI/res/values/dimens.xml
+++ b/packages/SystemUI/res/values/dimens.xml
@@ -237,6 +237,9 @@
     <dimen name="status_bar_connected_device_bt_indicator_size">17dp</dimen>
 
     <!-- Height of a small notification in the status bar (2025 redesign version) -->
+    <dimen name="notification_2025_header_height">@*android:dimen/notification_2025_header_height</dimen>
+
+    <!-- Height of a small notification in the status bar (2025 redesign version) -->
     <dimen name="notification_2025_min_height">@*android:dimen/notification_2025_min_height</dimen>
 
     <!-- Height of a small notification in the status bar-->
diff --git a/packages/SystemUI/res/values/strings.xml b/packages/SystemUI/res/values/strings.xml
index fac2c4a..658f2c2 100644
--- a/packages/SystemUI/res/values/strings.xml
+++ b/packages/SystemUI/res/values/strings.xml
@@ -1509,6 +1509,9 @@
     <!-- Content description for accessibility: Tapping this button will dismiss all gentle notifications [CHAR LIMIT=NONE] -->
     <string name="accessibility_notification_section_header_gentle_clear_all">Clear all silent notifications</string>
 
+    <!-- Content description for accessibility: Tapping this button will open notifications settings [CHAR LIMIT=NONE] -->
+    <string name="accessibility_notification_section_header_open_settings">Open notifications settings</string>
+
     <!-- The text to show in the notifications shade when dnd is suppressing notifications. [CHAR LIMIT=100] -->
     <string name="dnd_suppressing_shade_text">Notifications paused by Do Not Disturb</string>
 
diff --git a/packages/SystemUI/src/com/android/systemui/EventLogTags.logtags b/packages/SystemUI/src/com/android/systemui/EventLogTags.logtags
index 08236b7..ca5424b 100644
--- a/packages/SystemUI/src/com/android/systemui/EventLogTags.logtags
+++ b/packages/SystemUI/src/com/android/systemui/EventLogTags.logtags
@@ -1,4 +1,4 @@
-# See system/core/logcat/event.logtags for a description of the format of this file.
+# See system/logging/logcat/event.logtags for a description of the format of this file.
 
 option java_package com.android.systemui;
 
diff --git a/packages/SystemUI/src/com/android/systemui/ambient/statusbar/ui/AmbientStatusBarView.java b/packages/SystemUI/src/com/android/systemui/ambient/statusbar/ui/AmbientStatusBarView.java
index d4e74d3..9e1b09c 100644
--- a/packages/SystemUI/src/com/android/systemui/ambient/statusbar/ui/AmbientStatusBarView.java
+++ b/packages/SystemUI/src/com/android/systemui/ambient/statusbar/ui/AmbientStatusBarView.java
@@ -162,11 +162,12 @@
 
     void showIcon(@StatusIconType int iconType, boolean show, @Nullable String contentDescription) {
         View icon = mStatusIcons.get(iconType);
-        if (icon == null) {
-            return;
-        }
+        if (icon == null) return;
+
         if (show && contentDescription != null) {
             icon.setContentDescription(contentDescription);
+            icon.setFocusable(true);
+            icon.setImportantForAccessibility(IMPORTANT_FOR_ACCESSIBILITY_YES);
         }
         icon.setVisibility(show ? View.VISIBLE : View.GONE);
         mSystemStatusViewGroup.setVisibility(areAnyStatusIconsVisible() ? View.VISIBLE : View.GONE);
@@ -174,9 +175,12 @@
 
     void setExtraStatusBarItemViews(List<View> views) {
         removeAllExtraStatusBarItemViews();
-        views.forEach(view -> mExtraSystemStatusViewGroup.addView(view));
+        views.forEach(view -> {
+            view.setFocusable(true);
+            view.setImportantForAccessibility(IMPORTANT_FOR_ACCESSIBILITY_YES);
+            mExtraSystemStatusViewGroup.addView(view);
+        });
     }
-
     private View fetchStatusIconForResId(int resId) {
         final View statusIcon = findViewById(resId);
         return Objects.requireNonNull(statusIcon);
diff --git a/packages/SystemUI/src/com/android/systemui/camera/CameraGestureHelper.kt b/packages/SystemUI/src/com/android/systemui/camera/CameraGestureHelper.kt
index b2d02ed..a31e61f 100644
--- a/packages/SystemUI/src/com/android/systemui/camera/CameraGestureHelper.kt
+++ b/packages/SystemUI/src/com/android/systemui/camera/CameraGestureHelper.kt
@@ -107,6 +107,7 @@
                 activityOptions.setDisallowEnterPictureInPictureWhileLaunching(true)
                 activityOptions.rotationAnimationHint =
                     WindowManager.LayoutParams.ROTATION_ANIMATION_SEAMLESS
+                intent.collectExtraIntentKeys()
                 try {
                     activityTaskManager.startActivityAsUser(
                         null,
diff --git a/packages/SystemUI/src/com/android/systemui/classifier/domain/interactor/FalsingInteractor.kt b/packages/SystemUI/src/com/android/systemui/classifier/domain/interactor/FalsingInteractor.kt
index 074b64e..69f4f6d 100644
--- a/packages/SystemUI/src/com/android/systemui/classifier/domain/interactor/FalsingInteractor.kt
+++ b/packages/SystemUI/src/com/android/systemui/classifier/domain/interactor/FalsingInteractor.kt
@@ -74,3 +74,12 @@
     /** Returns `true` if the tap gesture should be rejected */
     fun isFalseTap(@Penalty penalty: Int): Boolean = manager.isFalseTap(penalty)
 }
+
+inline fun FalsingInteractor.runIfNotFalseTap(
+    penalty: Int = FalsingManager.LOW_PENALTY,
+    action: () -> Unit,
+) {
+    if (!isFalseTap(penalty)) {
+        action()
+    }
+}
diff --git a/packages/SystemUI/src/com/android/systemui/communal/CommunalSceneStartable.kt b/packages/SystemUI/src/com/android/systemui/communal/CommunalSceneStartable.kt
index d648b9c..5644e6b 100644
--- a/packages/SystemUI/src/com/android/systemui/communal/CommunalSceneStartable.kt
+++ b/packages/SystemUI/src/com/android/systemui/communal/CommunalSceneStartable.kt
@@ -23,7 +23,6 @@
 import com.android.compose.animation.scene.TransitionKey
 import com.android.internal.logging.UiEventLogger
 import com.android.systemui.CoreStartable
-import com.android.systemui.Flags.communalHubOnMobile
 import com.android.systemui.Flags.communalSceneKtfRefactor
 import com.android.systemui.communal.domain.interactor.CommunalInteractor
 import com.android.systemui.communal.domain.interactor.CommunalSceneInteractor
@@ -218,7 +217,8 @@
                             newScene = CommunalScenes.Blank,
                             loggingReason = "hub timeout",
                             transitionKey =
-                                if (communalHubOnMobile()) CommunalTransitionKeys.SimpleFade
+                                if (communalSettingsInteractor.isV2FlagEnabled())
+                                    CommunalTransitionKeys.SimpleFade
                                 else null,
                         )
                         uiEventLogger.log(CommunalUiEvent.COMMUNAL_HUB_TIMEOUT)
diff --git a/packages/SystemUI/src/com/android/systemui/communal/domain/interactor/CommunalSettingsInteractor.kt b/packages/SystemUI/src/com/android/systemui/communal/domain/interactor/CommunalSettingsInteractor.kt
index 0cdbad4..862b05b 100644
--- a/packages/SystemUI/src/com/android/systemui/communal/domain/interactor/CommunalSettingsInteractor.kt
+++ b/packages/SystemUI/src/com/android/systemui/communal/domain/interactor/CommunalSettingsInteractor.kt
@@ -63,24 +63,41 @@
             .logDiffsForTable(
                 tableLogBuffer = tableLogBuffer,
                 columnPrefix = "disabledReason",
-                initialValue = CommunalEnabledState()
+                initialValue = CommunalEnabledState(),
             )
             .map { model -> model.enabled }
             // Start this eagerly since the value is accessed synchronously in many places.
             .stateIn(scope = bgScope, started = SharingStarted.Eagerly, initialValue = false)
 
     /**
-     * Returns true if both the communal trunk-stable flag and resource flag are enabled.
+     * Returns true if any glanceable hub functionality should be enabled via configs and flags.
      *
-     * The trunk-stable flag is controlled by server rollout and is on all devices. The resource
-     * flag is enabled via resource overlay only on products we want the hub to be present on.
+     * This should be used for preventing basic glanceable hub functionality from running on devices
+     * that don't need it.
      *
      * If this is false, then the hub is definitely not available on the device. If this is true,
      * refer to [isCommunalEnabled] which takes into account other factors that can change at
      * runtime.
+     *
+     * If the glanceable_hub_v2 flag is enabled, checks the config_glanceableHubEnabled Android
+     * config boolean. Otherwise, checks the old config_communalServiceEnabled config and
+     * communal_hub flag.
      */
     fun isCommunalFlagEnabled(): Boolean = repository.getFlagEnabled()
 
+    /**
+     * Returns true if the Android config config_glanceableHubEnabled and the glanceable_hub_v2 flag
+     * are enabled.
+     *
+     * This should be used to flag off new glanceable hub or dream behavior that should launch
+     * together with the new hub experience that brings the hub to mobile.
+     *
+     * The trunk-stable flag is controlled by server rollout and is on all devices. The Android
+     * config flag is enabled via resource overlay only on products we want the hub to be present
+     * on.
+     */
+    fun isV2FlagEnabled(): Boolean = repository.getV2FlagEnabled()
+
     /** The type of background to use for the hub. Used to experiment with different backgrounds */
     val communalBackground: Flow<CommunalBackgroundType> =
         userInteractor.selectedUserInfo
@@ -120,6 +137,6 @@
             .stateIn(
                 scope = bgScope,
                 started = SharingStarted.WhileSubscribed(),
-                initialValue = null
+                initialValue = null,
             )
 }
diff --git a/packages/SystemUI/src/com/android/systemui/communal/ui/viewmodel/CommunalViewModel.kt b/packages/SystemUI/src/com/android/systemui/communal/ui/viewmodel/CommunalViewModel.kt
index 9cd6465..eb7420f 100644
--- a/packages/SystemUI/src/com/android/systemui/communal/ui/viewmodel/CommunalViewModel.kt
+++ b/packages/SystemUI/src/com/android/systemui/communal/ui/viewmodel/CommunalViewModel.kt
@@ -90,7 +90,7 @@
     private val keyguardIndicationController: KeyguardIndicationController,
     communalSceneInteractor: CommunalSceneInteractor,
     private val communalInteractor: CommunalInteractor,
-    communalSettingsInteractor: CommunalSettingsInteractor,
+    private val communalSettingsInteractor: CommunalSettingsInteractor,
     tutorialInteractor: CommunalTutorialInteractor,
     private val shadeInteractor: ShadeInteractor,
     @Named(MediaModule.COMMUNAL_HUB) mediaHost: MediaHost,
@@ -372,6 +372,9 @@
     val communalBackground: Flow<CommunalBackgroundType> =
         communalSettingsInteractor.communalBackground
 
+    /** See [CommunalSettingsInteractor.isV2FlagEnabled] */
+    fun v2FlagEnabled(): Boolean = communalSettingsInteractor.isV2FlagEnabled()
+
     companion object {
         const val POPUP_AUTO_HIDE_TIMEOUT_MS = 12000L
     }
diff --git a/packages/SystemUI/src/com/android/systemui/dreams/DreamOverlayRegistrant.kt b/packages/SystemUI/src/com/android/systemui/dreams/DreamOverlayRegistrant.kt
index e76fd47..c425bee 100644
--- a/packages/SystemUI/src/com/android/systemui/dreams/DreamOverlayRegistrant.kt
+++ b/packages/SystemUI/src/com/android/systemui/dreams/DreamOverlayRegistrant.kt
@@ -25,7 +25,7 @@
 import android.os.RemoteException
 import android.service.dreams.IDreamManager
 import android.util.Log
-import com.android.systemui.Flags
+import com.android.systemui.communal.domain.interactor.CommunalSettingsInteractor
 import com.android.systemui.dagger.qualifiers.SystemUser
 import com.android.systemui.dreams.dagger.DreamModule
 import com.android.systemui.log.LogBuffer
@@ -48,6 +48,7 @@
     @SystemUser monitor: Monitor,
     private val packageManager: PackageManager,
     private val dreamManager: IDreamManager,
+    private val communalSettingsInteractor: CommunalSettingsInteractor,
     @DreamLog private val logBuffer: LogBuffer,
 ) : ConditionalCoreStartable(monitor) {
     private var currentRegisteredState = false
@@ -90,7 +91,7 @@
             }
 
             if (
-                Flags.communalHubOnMobile() &&
+                communalSettingsInteractor.isV2FlagEnabled() &&
                     packageManager.getComponentEnabledSetting(overlayServiceComponent) ==
                         PackageManager.COMPONENT_ENABLED_STATE_ENABLED
             ) {
@@ -111,7 +112,7 @@
         }
 
         // Enable for hub on mobile
-        if (Flags.communalHubOnMobile()) {
+        if (communalSettingsInteractor.isV2FlagEnabled()) {
             // Not available on TV or auto
             if (
                 packageManager.hasSystemFeature(PackageManager.FEATURE_AUTOMOTIVE) ||
diff --git a/packages/SystemUI/src/com/android/systemui/dreams/DreamOverlayService.java b/packages/SystemUI/src/com/android/systemui/dreams/DreamOverlayService.java
index aee3a45..571b37f 100644
--- a/packages/SystemUI/src/com/android/systemui/dreams/DreamOverlayService.java
+++ b/packages/SystemUI/src/com/android/systemui/dreams/DreamOverlayService.java
@@ -18,7 +18,6 @@
 
 import static android.service.dreams.Flags.dreamWakeRedirect;
 
-import static com.android.systemui.Flags.communalHubOnMobile;
 import static com.android.systemui.Flags.glanceableHubAllowKeyguardWhenDreaming;
 import static com.android.systemui.dreams.dagger.DreamModule.DREAM_OVERLAY_WINDOW_TITLE;
 import static com.android.systemui.dreams.dagger.DreamModule.DREAM_TOUCH_INSET_MANAGER;
@@ -60,6 +59,7 @@
 import com.android.systemui.ambient.touch.dagger.AmbientTouchComponent;
 import com.android.systemui.ambient.touch.scrim.ScrimManager;
 import com.android.systemui.communal.domain.interactor.CommunalInteractor;
+import com.android.systemui.communal.domain.interactor.CommunalSettingsInteractor;
 import com.android.systemui.communal.shared.log.CommunalUiEvent;
 import com.android.systemui.communal.shared.model.CommunalScenes;
 import com.android.systemui.communal.shared.model.CommunalTransitionKeys;
@@ -171,6 +171,7 @@
 
     private final SceneInteractor mSceneInteractor;
     private final CommunalInteractor mCommunalInteractor;
+    private final CommunalSettingsInteractor mCommunalSettingsInteractor;
 
     private boolean mCommunalAvailable;
 
@@ -383,6 +384,7 @@
             KeyguardUpdateMonitor keyguardUpdateMonitor,
             ScrimManager scrimManager,
             CommunalInteractor communalInteractor,
+            CommunalSettingsInteractor communalSettingsInteractor,
             SceneInteractor sceneInteractor,
             SystemDialogsCloser systemDialogsCloser,
             UiEventLogger uiEventLogger,
@@ -411,6 +413,7 @@
         mDreamOverlayCallbackController = dreamOverlayCallbackController;
         mWindowTitle = windowTitle;
         mCommunalInteractor = communalInteractor;
+        mCommunalSettingsInteractor = communalSettingsInteractor;
         mSceneInteractor = sceneInteractor;
         mSystemDialogsCloser = systemDialogsCloser;
         mGestureInteractor = gestureInteractor;
@@ -488,7 +491,7 @@
 
         final ArrayList<TouchHandler> touchHandlers = new ArrayList<>(
                 List.of(dreamComplicationComponent.getHideComplicationTouchHandler()));
-        if (!communalHubOnMobile()) {
+        if (!mCommunalSettingsInteractor.isV2FlagEnabled()) {
             // Do not add the communal touch handler for glanceable hub v2 since there is no dream
             // to hub swipe gesture.
             touchHandlers.add(dreamOverlayComponent.getCommunalTouchHandler());
@@ -575,7 +578,8 @@
         } else {
             mCommunalInteractor.changeScene(CommunalScenes.Communal,
                     "dream wake requested",
-                    communalHubOnMobile() ? CommunalTransitionKeys.INSTANCE.getSimpleFade() : null);
+                    mCommunalSettingsInteractor.isV2FlagEnabled()
+                            ? CommunalTransitionKeys.INSTANCE.getSimpleFade() : null);
         }
     }
 
diff --git a/packages/SystemUI/src/com/android/systemui/education/domain/interactor/KeyboardTouchpadEduInteractor.kt b/packages/SystemUI/src/com/android/systemui/education/domain/interactor/KeyboardTouchpadEduInteractor.kt
index 7242770..e264635 100644
--- a/packages/SystemUI/src/com/android/systemui/education/domain/interactor/KeyboardTouchpadEduInteractor.kt
+++ b/packages/SystemUI/src/com/android/systemui/education/domain/interactor/KeyboardTouchpadEduInteractor.kt
@@ -21,6 +21,9 @@
 import com.android.systemui.common.coroutine.ChannelExt.trySendWithFailureLogging
 import com.android.systemui.contextualeducation.GestureType
 import com.android.systemui.contextualeducation.GestureType.ALL_APPS
+import com.android.systemui.contextualeducation.GestureType.BACK
+import com.android.systemui.contextualeducation.GestureType.HOME
+import com.android.systemui.contextualeducation.GestureType.OVERVIEW
 import com.android.systemui.dagger.SysUISingleton
 import com.android.systemui.dagger.qualifiers.Background
 import com.android.systemui.education.ContextualEducationMetricsLogger
@@ -37,6 +40,7 @@
 import com.android.systemui.recents.OverviewProxyService.OverviewProxyListener
 import com.android.systemui.utils.coroutines.flow.conflatedCallbackFlow
 import java.time.Clock
+import java.time.Instant
 import javax.inject.Inject
 import kotlin.time.Duration
 import kotlin.time.Duration.Companion.days
@@ -48,6 +52,7 @@
 import kotlinx.coroutines.flow.Flow
 import kotlinx.coroutines.flow.MutableStateFlow
 import kotlinx.coroutines.flow.asStateFlow
+import kotlinx.coroutines.flow.combine
 import kotlinx.coroutines.flow.first
 import kotlinx.coroutines.flow.flatMapLatest
 import kotlinx.coroutines.flow.merge
@@ -71,6 +76,8 @@
         const val TAG = "KeyboardTouchpadEduInteractor"
         const val MAX_SIGNAL_COUNT: Int = 2
         const val MAX_EDUCATION_SHOW_COUNT: Int = 2
+        const val MAX_TOAST_PER_USAGE_SESSION: Int = 2
+
         val usageSessionDuration =
             getDurationForConfig("persist.contextual_edu.usage_session_sec", 3.days)
         val minIntervalBetweenEdu =
@@ -110,6 +117,16 @@
         awaitClose { overviewProxyService.removeCallback(listener) }
     }
 
+    private val gestureModelMap: Flow<Map<GestureType, GestureEduModel>> =
+        combine(
+            contextualEducationInteractor.backGestureModelFlow,
+            contextualEducationInteractor.homeGestureModelFlow,
+            contextualEducationInteractor.overviewGestureModelFlow,
+            contextualEducationInteractor.allAppsGestureModelFlow,
+        ) { back, home, overview, allApps ->
+            mapOf(BACK to back, HOME to home, OVERVIEW to overview, ALL_APPS to allApps)
+        }
+
     @OptIn(ExperimentalCoroutinesApi::class)
     override fun start() {
         backgroundScope.launch {
@@ -211,7 +228,11 @@
 
     private suspend fun incrementSignalCount(gestureType: GestureType) {
         val targetDevice = getTargetDevice(gestureType)
-        if (isTargetDeviceConnected(targetDevice) && hasInitialDelayElapsed(targetDevice)) {
+        if (
+            isTargetDeviceConnected(targetDevice) &&
+                hasInitialDelayElapsed(targetDevice) &&
+                isMinIntervalForToastEduElapsed(gestureType)
+        ) {
             contextualEducationInteractor.incrementSignalCount(gestureType)
         }
     }
@@ -223,6 +244,28 @@
         }
     }
 
+    private suspend fun isMinIntervalForToastEduElapsed(gestureType: GestureType): Boolean {
+        val gestureModelMap = gestureModelMap.first()
+        // Only perform checking if the next edu is toast (i.e. no education is shown yet)
+        if (gestureModelMap[gestureType]?.educationShownCount != 0) {
+            return true
+        }
+
+        val wasLastEduToast = { gesture: GestureEduModel -> gesture.educationShownCount == 1 }
+        val toastEduTimesInCurrentSession: List<Instant> =
+            gestureModelMap.values
+                .filter { wasLastEduToast(it) }
+                .mapNotNull { it.lastEducationTime }
+                .filter { it >= clock.instant().minusSeconds(usageSessionDuration.inWholeSeconds) }
+
+        return if (toastEduTimesInCurrentSession.size >= MAX_TOAST_PER_USAGE_SESSION) {
+            val lastToastTime: Instant? = toastEduTimesInCurrentSession.maxOrNull()
+            clock.instant().isAfter(lastToastTime?.plusSeconds(usageSessionDuration.inWholeSeconds))
+        } else {
+            true
+        }
+    }
+
     /**
      * Keyboard shortcut education would be provided for All Apps. Touchpad gesture education would
      * be provided for the rest of the gesture types (i.e. Home, Overview, Back). This method maps
diff --git a/packages/SystemUI/src/com/android/systemui/keyboard/shortcut/data/model/InternalShortcutModels.kt b/packages/SystemUI/src/com/android/systemui/keyboard/shortcut/data/model/InternalShortcutModels.kt
index 8c393e2..3020e5d 100644
--- a/packages/SystemUI/src/com/android/systemui/keyboard/shortcut/data/model/InternalShortcutModels.kt
+++ b/packages/SystemUI/src/com/android/systemui/keyboard/shortcut/data/model/InternalShortcutModels.kt
@@ -21,6 +21,7 @@
 import android.view.KeyboardShortcutGroup
 import com.android.systemui.keyboard.shortcut.data.repository.ShortcutCategoriesUtils
 import com.android.systemui.keyboard.shortcut.shared.model.ShortcutCategory
+import com.android.systemui.keyboard.shortcut.shared.model.ShortcutCategoryType
 
 /**
  * Internal Keyboard Shortcut models to use with [ShortcutCategoriesUtils.fetchShortcutCategory]
@@ -55,3 +56,8 @@
     val icon: Icon? = null,
     val isCustomShortcut: Boolean = false,
 )
+
+data class InternalGroupsSource(
+    val groups: List<InternalKeyboardShortcutGroup>,
+    val type: ShortcutCategoryType,
+)
\ No newline at end of file
diff --git a/packages/SystemUI/src/com/android/systemui/keyboard/shortcut/data/repository/CustomShortcutCategoriesRepository.kt b/packages/SystemUI/src/com/android/systemui/keyboard/shortcut/data/repository/CustomShortcutCategoriesRepository.kt
index 4af3786..8afec04 100644
--- a/packages/SystemUI/src/com/android/systemui/keyboard/shortcut/data/repository/CustomShortcutCategoriesRepository.kt
+++ b/packages/SystemUI/src/com/android/systemui/keyboard/shortcut/data/repository/CustomShortcutCategoriesRepository.kt
@@ -16,10 +16,8 @@
 
 package com.android.systemui.keyboard.shortcut.data.repository
 
-import android.content.Context
 import android.hardware.input.InputGestureData
 import android.hardware.input.InputGestureData.Builder
-import android.hardware.input.InputGestureData.KeyTrigger
 import android.hardware.input.InputGestureData.createKeyTrigger
 import android.hardware.input.InputManager
 import android.hardware.input.KeyGestureEvent.KeyGestureType
@@ -30,11 +28,8 @@
 import com.android.systemui.dagger.SysUISingleton
 import com.android.systemui.dagger.qualifiers.Background
 import com.android.systemui.keyboard.shared.model.ShortcutCustomizationRequestResult
-import com.android.systemui.keyboard.shortcut.data.model.InternalKeyboardShortcutGroup
-import com.android.systemui.keyboard.shortcut.data.model.InternalKeyboardShortcutInfo
 import com.android.systemui.keyboard.shortcut.shared.model.KeyCombination
 import com.android.systemui.keyboard.shortcut.shared.model.ShortcutCategory
-import com.android.systemui.keyboard.shortcut.shared.model.ShortcutCategoryType
 import com.android.systemui.keyboard.shortcut.shared.model.ShortcutCustomizationRequestInfo
 import com.android.systemui.keyboard.shortcut.shared.model.ShortcutHelperState.Active
 import com.android.systemui.keyboard.shortcut.shared.model.ShortcutKey
@@ -57,8 +52,7 @@
     @Background private val backgroundScope: CoroutineScope,
     @Background private val bgCoroutineContext: CoroutineContext,
     private val shortcutCategoriesUtils: ShortcutCategoriesUtils,
-    private val context: Context,
-    private val inputGestureMaps: InputGestureMaps,
+    private val inputGestureDataAdapter: InputGestureDataAdapter,
     private val customInputGesturesRepository: CustomInputGesturesRepository,
     private val inputManager: InputManager
 ) : ShortcutCategoriesRepository {
@@ -116,7 +110,7 @@
                 if (inputDevice == null) {
                     emptyList()
                 } else {
-                    val sources = toInternalGroupSources(inputGestures)
+                    val sources = inputGestureDataAdapter.toInternalGroupSources(inputGestures)
                     val supportedKeyCodes =
                         shortcutCategoriesUtils.fetchSupportedKeyCodes(
                             inputDevice.id,
@@ -216,7 +210,8 @@
             return null
         }
 
-        return inputGestureMaps.shortcutLabelToKeyGestureTypeMap[shortcutBeingCustomized.label]
+        return inputGestureDataAdapter
+            .getKeyGestureTypeFromShortcutLabel(shortcutBeingCustomized.label)
     }
 
     @KeyGestureType
@@ -232,7 +227,8 @@
             return null
         }
 
-        return inputGestureMaps.shortcutLabelToKeyGestureTypeMap[shortcutBeingCustomized.label]
+        return inputGestureDataAdapter
+            .getKeyGestureTypeFromShortcutLabel(shortcutBeingCustomized.label)
     }
 
     private fun Builder.addTriggerFromSelectedKeyCombination(): Builder {
@@ -261,70 +257,6 @@
         return _shortcutBeingCustomized.value
     }
 
-    private fun toInternalGroupSources(
-        inputGestures: List<InputGestureData>
-    ): List<InternalGroupsSource> {
-        val ungroupedInternalGroupSources =
-            inputGestures.mapNotNull { gestureData ->
-                val keyTrigger = gestureData.trigger as KeyTrigger
-                val keyGestureType = gestureData.action.keyGestureType()
-                fetchGroupLabelByGestureType(keyGestureType)?.let { groupLabel ->
-                    toInternalKeyboardShortcutInfo(keyGestureType, keyTrigger)?.let {
-                        internalKeyboardShortcutInfo ->
-                        val group =
-                            InternalKeyboardShortcutGroup(
-                                label = groupLabel,
-                                items = listOf(internalKeyboardShortcutInfo),
-                            )
-
-                        fetchShortcutCategoryTypeByGestureType(keyGestureType)?.let {
-                            InternalGroupsSource(groups = listOf(group), type = it)
-                        }
-                    }
-                }
-            }
-
-        return ungroupedInternalGroupSources
-    }
-
-    private fun toInternalKeyboardShortcutInfo(
-        keyGestureType: Int,
-        keyTrigger: KeyTrigger,
-    ): InternalKeyboardShortcutInfo? {
-        fetchShortcutInfoLabelByGestureType(keyGestureType)?.let {
-            return InternalKeyboardShortcutInfo(
-                label = it,
-                keycode = keyTrigger.keycode,
-                modifiers = keyTrigger.modifierState,
-                isCustomShortcut = true,
-            )
-        }
-        return null
-    }
-
-    private fun fetchGroupLabelByGestureType(@KeyGestureType keyGestureType: Int): String? {
-        inputGestureMaps.gestureToInternalKeyboardShortcutGroupLabelResIdMap[keyGestureType]?.let {
-            return context.getString(it)
-        } ?: return null
-    }
-
-    private fun fetchShortcutInfoLabelByGestureType(@KeyGestureType keyGestureType: Int): String? {
-        inputGestureMaps.gestureToInternalKeyboardShortcutInfoLabelResIdMap[keyGestureType]?.let {
-            return context.getString(it)
-        } ?: return null
-    }
-
-    private fun fetchShortcutCategoryTypeByGestureType(
-        @KeyGestureType keyGestureType: Int
-    ): ShortcutCategoryType? {
-        return inputGestureMaps.gestureToShortcutCategoryTypeMap[keyGestureType]
-    }
-
-    private data class InternalGroupsSource(
-        val groups: List<InternalKeyboardShortcutGroup>,
-        val type: ShortcutCategoryType,
-    )
-
     private companion object {
         private const val TAG = "CustomShortcutCategoriesRepository"
     }
diff --git a/packages/SystemUI/src/com/android/systemui/keyboard/shortcut/data/repository/InputGestureDataAdapter.kt b/packages/SystemUI/src/com/android/systemui/keyboard/shortcut/data/repository/InputGestureDataAdapter.kt
new file mode 100644
index 0000000..df7101e
--- /dev/null
+++ b/packages/SystemUI/src/com/android/systemui/keyboard/shortcut/data/repository/InputGestureDataAdapter.kt
@@ -0,0 +1,267 @@
+/*
+ * 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.keyboard.shortcut.data.repository
+
+import android.annotation.SuppressLint
+import android.app.role.RoleManager
+import android.content.ComponentName
+import android.content.Context
+import android.content.Intent
+import android.content.Intent.ACTION_MAIN
+import android.content.Intent.CATEGORY_LAUNCHER
+import android.content.pm.ActivityInfo
+import android.content.pm.PackageManager.MATCH_DEFAULT_ONLY
+import android.content.pm.PackageManager.MATCH_DIRECT_BOOT_AWARE
+import android.content.pm.PackageManager.MATCH_DIRECT_BOOT_UNAWARE
+import android.content.pm.PackageManager.MATCH_UNINSTALLED_PACKAGES
+import android.content.pm.PackageManager.NameNotFoundException
+import android.graphics.drawable.Icon
+import android.hardware.input.AppLaunchData
+import android.hardware.input.AppLaunchData.CategoryData
+import android.hardware.input.AppLaunchData.ComponentData
+import android.hardware.input.AppLaunchData.RoleData
+import android.hardware.input.InputGestureData
+import android.hardware.input.InputGestureData.KeyTrigger
+import android.hardware.input.KeyGestureEvent.KEY_GESTURE_TYPE_LAUNCH_APPLICATION
+import android.hardware.input.KeyGestureEvent.KeyGestureType
+import android.util.Log
+import com.android.internal.app.ResolverActivity
+import com.android.systemui.keyboard.shortcut.data.model.InternalGroupsSource
+import com.android.systemui.keyboard.shortcut.data.model.InternalKeyboardShortcutGroup
+import com.android.systemui.keyboard.shortcut.data.model.InternalKeyboardShortcutInfo
+import com.android.systemui.keyboard.shortcut.shared.model.ShortcutCategoryType
+import com.android.systemui.res.R
+import com.android.systemui.settings.UserTracker
+import javax.inject.Inject
+
+
+class InputGestureDataAdapter
+@Inject
+constructor(
+    private val userTracker: UserTracker,
+    private val inputGestureMaps: InputGestureMaps,
+    private val context: Context
+) {
+    private val userContext: Context
+        get() = userTracker.createCurrentUserContext(userTracker.userContext)
+
+    fun toInternalGroupSources(
+        inputGestures: List<InputGestureData>
+    ): List<InternalGroupsSource> {
+        val ungroupedInternalGroupSources =
+            inputGestures.mapNotNull { gestureData ->
+                val keyTrigger = gestureData.trigger as KeyTrigger
+                val keyGestureType = gestureData.action.keyGestureType()
+                val appLaunchData: AppLaunchData? = gestureData.action.appLaunchData()
+                fetchGroupLabelByGestureType(keyGestureType)?.let { groupLabel ->
+                    toInternalKeyboardShortcutInfo(
+                        keyGestureType,
+                        keyTrigger,
+                        appLaunchData
+                    )?.let { internalKeyboardShortcutInfo ->
+                        val group =
+                            InternalKeyboardShortcutGroup(
+                                label = groupLabel,
+                                items = listOf(internalKeyboardShortcutInfo),
+                            )
+
+                        fetchShortcutCategoryTypeByGestureType(keyGestureType)?.let {
+                            InternalGroupsSource(groups = listOf(group), type = it)
+                        }
+                    }
+                }
+            }
+
+        return ungroupedInternalGroupSources
+    }
+
+    fun getKeyGestureTypeFromShortcutLabel(label: String): Int? {
+        return inputGestureMaps.shortcutLabelToKeyGestureTypeMap[label]
+    }
+
+    private fun toInternalKeyboardShortcutInfo(
+        keyGestureType: Int,
+        keyTrigger: KeyTrigger,
+        appLaunchData: AppLaunchData?,
+    ): InternalKeyboardShortcutInfo? {
+        fetchShortcutLabelByGestureType(keyGestureType, appLaunchData)?.let {
+            return InternalKeyboardShortcutInfo(
+                label = it,
+                keycode = keyTrigger.keycode,
+                modifiers = keyTrigger.modifierState,
+                isCustomShortcut = true,
+                icon = appLaunchData?.let { fetchShortcutIconByAppLaunchData(appLaunchData) }
+            )
+        }
+        return null
+    }
+
+    @SuppressLint("QueryPermissionsNeeded")
+    private fun fetchShortcutIconByAppLaunchData(
+        appLaunchData: AppLaunchData
+    ): Icon? {
+        val intent = fetchIntentFromAppLaunchData(appLaunchData) ?: return null
+        val resolvedActivity = resolveSingleMatchingActivityFrom(intent)
+
+        return if (resolvedActivity == null) {
+            null
+        } else {
+            Icon.createWithResource(context, resolvedActivity.iconResource)
+        }
+    }
+
+    private fun fetchGroupLabelByGestureType(@KeyGestureType keyGestureType: Int): String? {
+        inputGestureMaps.gestureToInternalKeyboardShortcutGroupLabelResIdMap[keyGestureType]?.let {
+            return context.getString(it)
+        } ?: return null
+    }
+
+    private fun fetchShortcutLabelByGestureType(
+        @KeyGestureType keyGestureType: Int,
+        appLaunchData: AppLaunchData?
+    ): String? {
+        inputGestureMaps.gestureToInternalKeyboardShortcutInfoLabelResIdMap[keyGestureType]?.let {
+            return context.getString(it)
+        }
+
+        if (keyGestureType == KEY_GESTURE_TYPE_LAUNCH_APPLICATION) {
+            return fetchShortcutLabelByAppLaunchData(appLaunchData!!)
+        }
+
+        return null
+    }
+
+    private fun fetchShortcutLabelByAppLaunchData(appLaunchData: AppLaunchData): String? {
+        val intent = fetchIntentFromAppLaunchData(appLaunchData) ?: return null
+        val resolvedActivity = resolveSingleMatchingActivityFrom(intent)
+
+        return if (resolvedActivity == null) {
+            getIntentCategoryLabel(intent.selector?.categories?.iterator()?.next())
+        } else resolvedActivity.loadLabel(userContext.packageManager).toString()
+
+    }
+
+    @SuppressLint("QueryPermissionsNeeded")
+    private fun resolveSingleMatchingActivityFrom(intent: Intent): ActivityInfo? {
+        val packageManager = userContext.packageManager
+        val resolvedActivity = intent.resolveActivityInfo(
+            packageManager,
+            /* flags= */ MATCH_DEFAULT_ONLY
+        ) ?: return null
+
+        val matchesMultipleActivities =
+            ResolverActivity::class.qualifiedName.equals(resolvedActivity.name)
+
+        return if (matchesMultipleActivities) {
+            return null
+        } else resolvedActivity
+    }
+
+    private fun getIntentCategoryLabel(category: String?): String? {
+        val categoryLabelRes = when (category.toString()) {
+            Intent.CATEGORY_APP_BROWSER -> R.string.keyboard_shortcut_group_applications_browser
+            Intent.CATEGORY_APP_CONTACTS -> R.string.keyboard_shortcut_group_applications_contacts
+            Intent.CATEGORY_APP_EMAIL -> R.string.keyboard_shortcut_group_applications_email
+            Intent.CATEGORY_APP_CALENDAR -> R.string.keyboard_shortcut_group_applications_calendar
+            Intent.CATEGORY_APP_MAPS -> R.string.keyboard_shortcut_group_applications_maps
+            Intent.CATEGORY_APP_MUSIC -> R.string.keyboard_shortcut_group_applications_music
+            Intent.CATEGORY_APP_MESSAGING -> R.string.keyboard_shortcut_group_applications_sms
+            Intent.CATEGORY_APP_CALCULATOR -> R.string.keyboard_shortcut_group_applications_calculator
+            else -> {
+                Log.w(TAG, ("No label for app category $category"))
+                null
+            }
+        }
+
+        return if (categoryLabelRes == null){
+            return null
+        } else {
+            context.getString(categoryLabelRes)
+        }
+    }
+
+    private fun fetchIntentFromAppLaunchData(appLaunchData: AppLaunchData): Intent? {
+        return when (appLaunchData) {
+            is CategoryData -> Intent.makeMainSelectorActivity(
+                /* selectorAction= */ ACTION_MAIN,
+                /* selectorCategory= */ appLaunchData.category
+            )
+
+            is RoleData -> getRoleLaunchIntent(appLaunchData.role)
+            is ComponentData -> resolveComponentNameIntent(
+                packageName = appLaunchData.packageName,
+                className = appLaunchData.className
+            )
+
+            else -> null
+        }
+    }
+
+    private fun resolveComponentNameIntent(packageName: String, className: String): Intent? {
+        buildIntentFromComponentName(ComponentName(packageName, className))?.let { return it }
+        buildIntentFromComponentName(ComponentName(
+            userContext.packageManager.canonicalToCurrentPackageNames(arrayOf(packageName))[0],
+            className
+        ))?.let { return it }
+        return null
+    }
+
+    private fun buildIntentFromComponentName(componentName: ComponentName): Intent? {
+        try{
+            val flags =
+                MATCH_DIRECT_BOOT_UNAWARE or MATCH_DIRECT_BOOT_AWARE or MATCH_UNINSTALLED_PACKAGES
+            // attempt to retrieve activity info to see if a NameNotFoundException is thrown.
+            userContext.packageManager.getActivityInfo(componentName, flags)
+        } catch (e: NameNotFoundException) {
+            Log.w(
+                TAG,
+                "Unable to find activity info for componentName: $componentName"
+            )
+            return null
+        }
+
+        return Intent(ACTION_MAIN).apply {
+            addCategory(CATEGORY_LAUNCHER)
+            component = componentName
+        }
+    }
+
+    @SuppressLint("NonInjectedService")
+    private fun getRoleLaunchIntent(role: String): Intent? {
+        val packageManager = userContext.packageManager
+        val roleManager = userContext.getSystemService(RoleManager::class.java)!!
+        if (roleManager.isRoleAvailable(role)) {
+            roleManager.getDefaultApplication(role)?.let { rolePackage ->
+                packageManager.getLaunchIntentForPackage(rolePackage)?.let { return it }
+                    ?: Log.w(TAG, "No launch intent for role $role")
+            } ?: Log.w(TAG, "No default application for role $role, user= ${userContext.user}")
+        } else {
+            Log.w(TAG, "Role $role is not available.")
+        }
+        return null
+    }
+
+    private fun fetchShortcutCategoryTypeByGestureType(
+        @KeyGestureType keyGestureType: Int
+    ): ShortcutCategoryType? {
+        return inputGestureMaps.gestureToShortcutCategoryTypeMap[keyGestureType]
+    }
+
+    private companion object {
+        private const val TAG = "InputGestureDataUtils"
+    }
+}
\ No newline at end of file
diff --git a/packages/SystemUI/src/com/android/systemui/keyboard/shortcut/data/repository/InputGestureMaps.kt b/packages/SystemUI/src/com/android/systemui/keyboard/shortcut/data/repository/InputGestureMaps.kt
index 1c380c2..30a2f33 100644
--- a/packages/SystemUI/src/com/android/systemui/keyboard/shortcut/data/repository/InputGestureMaps.kt
+++ b/packages/SystemUI/src/com/android/systemui/keyboard/shortcut/data/repository/InputGestureMaps.kt
@@ -22,14 +22,8 @@
 import android.hardware.input.KeyGestureEvent.KEY_GESTURE_TYPE_CHANGE_SPLITSCREEN_FOCUS_LEFT
 import android.hardware.input.KeyGestureEvent.KEY_GESTURE_TYPE_CHANGE_SPLITSCREEN_FOCUS_RIGHT
 import android.hardware.input.KeyGestureEvent.KEY_GESTURE_TYPE_HOME
+import android.hardware.input.KeyGestureEvent.KEY_GESTURE_TYPE_LAUNCH_APPLICATION
 import android.hardware.input.KeyGestureEvent.KEY_GESTURE_TYPE_LAUNCH_ASSISTANT
-import android.hardware.input.KeyGestureEvent.KEY_GESTURE_TYPE_LAUNCH_DEFAULT_BROWSER
-import android.hardware.input.KeyGestureEvent.KEY_GESTURE_TYPE_LAUNCH_DEFAULT_CALCULATOR
-import android.hardware.input.KeyGestureEvent.KEY_GESTURE_TYPE_LAUNCH_DEFAULT_CALENDAR
-import android.hardware.input.KeyGestureEvent.KEY_GESTURE_TYPE_LAUNCH_DEFAULT_CONTACTS
-import android.hardware.input.KeyGestureEvent.KEY_GESTURE_TYPE_LAUNCH_DEFAULT_EMAIL
-import android.hardware.input.KeyGestureEvent.KEY_GESTURE_TYPE_LAUNCH_DEFAULT_MAPS
-import android.hardware.input.KeyGestureEvent.KEY_GESTURE_TYPE_LAUNCH_DEFAULT_MESSAGING
 import android.hardware.input.KeyGestureEvent.KEY_GESTURE_TYPE_LAUNCH_SYSTEM_SETTINGS
 import android.hardware.input.KeyGestureEvent.KEY_GESTURE_TYPE_LAUNCH_VOICE_ASSISTANT
 import android.hardware.input.KeyGestureEvent.KEY_GESTURE_TYPE_LOCK_SCREEN
@@ -74,13 +68,7 @@
             KEY_GESTURE_TYPE_CHANGE_SPLITSCREEN_FOCUS_RIGHT to MultiTasking,
 
             // App Category
-            KEY_GESTURE_TYPE_LAUNCH_DEFAULT_CALCULATOR to AppCategories,
-            KEY_GESTURE_TYPE_LAUNCH_DEFAULT_CALENDAR to AppCategories,
-            KEY_GESTURE_TYPE_LAUNCH_DEFAULT_BROWSER to AppCategories,
-            KEY_GESTURE_TYPE_LAUNCH_DEFAULT_CONTACTS to AppCategories,
-            KEY_GESTURE_TYPE_LAUNCH_DEFAULT_EMAIL to AppCategories,
-            KEY_GESTURE_TYPE_LAUNCH_DEFAULT_MAPS to AppCategories,
-            KEY_GESTURE_TYPE_LAUNCH_DEFAULT_MESSAGING to AppCategories,
+            KEY_GESTURE_TYPE_LAUNCH_APPLICATION to AppCategories,
         )
 
     val gestureToInternalKeyboardShortcutGroupLabelResIdMap =
@@ -116,20 +104,14 @@
                 R.string.shortcutHelper_category_split_screen,
 
             // App Category
-            KEY_GESTURE_TYPE_LAUNCH_DEFAULT_CALCULATOR to
-                R.string.keyboard_shortcut_group_applications,
-            KEY_GESTURE_TYPE_LAUNCH_DEFAULT_CALENDAR to
-                R.string.keyboard_shortcut_group_applications,
-            KEY_GESTURE_TYPE_LAUNCH_DEFAULT_BROWSER to
-                R.string.keyboard_shortcut_group_applications,
-            KEY_GESTURE_TYPE_LAUNCH_DEFAULT_CONTACTS to
-                R.string.keyboard_shortcut_group_applications,
-            KEY_GESTURE_TYPE_LAUNCH_DEFAULT_EMAIL to R.string.keyboard_shortcut_group_applications,
-            KEY_GESTURE_TYPE_LAUNCH_DEFAULT_MAPS to R.string.keyboard_shortcut_group_applications,
-            KEY_GESTURE_TYPE_LAUNCH_DEFAULT_MESSAGING to
+            KEY_GESTURE_TYPE_LAUNCH_APPLICATION to
                 R.string.keyboard_shortcut_group_applications,
         )
 
+    /**
+     * App Category shortcut labels are mapped dynamically based on intent
+     * see [InputGestureDataAdapter.fetchShortcutLabelByAppLaunchData]
+     */
     val gestureToInternalKeyboardShortcutInfoLabelResIdMap =
         mapOf(
             // System Category
@@ -158,22 +140,6 @@
                 R.string.system_multitasking_splitscreen_focus_lhs,
             KEY_GESTURE_TYPE_CHANGE_SPLITSCREEN_FOCUS_RIGHT to
                 R.string.system_multitasking_splitscreen_focus_rhs,
-
-            // App Category
-            KEY_GESTURE_TYPE_LAUNCH_DEFAULT_CALCULATOR to
-                R.string.keyboard_shortcut_group_applications_calculator,
-            KEY_GESTURE_TYPE_LAUNCH_DEFAULT_CALENDAR to
-                R.string.keyboard_shortcut_group_applications_calendar,
-            KEY_GESTURE_TYPE_LAUNCH_DEFAULT_BROWSER to
-                R.string.keyboard_shortcut_group_applications_browser,
-            KEY_GESTURE_TYPE_LAUNCH_DEFAULT_CONTACTS to
-                R.string.keyboard_shortcut_group_applications_contacts,
-            KEY_GESTURE_TYPE_LAUNCH_DEFAULT_EMAIL to
-                R.string.keyboard_shortcut_group_applications_email,
-            KEY_GESTURE_TYPE_LAUNCH_DEFAULT_MAPS to
-                R.string.keyboard_shortcut_group_applications_maps,
-            KEY_GESTURE_TYPE_LAUNCH_DEFAULT_MESSAGING to
-                R.string.keyboard_shortcut_group_applications_sms,
         )
 
     val shortcutLabelToKeyGestureTypeMap: Map<String, Int>
diff --git a/packages/SystemUI/src/com/android/systemui/keyboard/shortcut/ui/composable/ShortcutHelper.kt b/packages/SystemUI/src/com/android/systemui/keyboard/shortcut/ui/composable/ShortcutHelper.kt
index 7d9e010..2724918 100644
--- a/packages/SystemUI/src/com/android/systemui/keyboard/shortcut/ui/composable/ShortcutHelper.kt
+++ b/packages/SystemUI/src/com/android/systemui/keyboard/shortcut/ui/composable/ShortcutHelper.kt
@@ -115,6 +115,7 @@
 import androidx.compose.ui.util.fastForEachIndexed
 import com.android.compose.modifiers.thenIf
 import com.android.compose.ui.graphics.painter.rememberDrawablePainter
+import com.android.systemui.keyboard.shortcut.shared.model.Shortcut as ShortcutModel
 import com.android.systemui.keyboard.shortcut.shared.model.ShortcutCategoryType
 import com.android.systemui.keyboard.shortcut.shared.model.ShortcutCommand
 import com.android.systemui.keyboard.shortcut.shared.model.ShortcutCustomizationRequestInfo
@@ -126,7 +127,6 @@
 import com.android.systemui.keyboard.shortcut.ui.model.ShortcutsUiState
 import com.android.systemui.res.R
 import kotlinx.coroutines.delay
-import com.android.systemui.keyboard.shortcut.shared.model.Shortcut as ShortcutModel
 
 @Composable
 fun ShortcutHelper(
@@ -189,7 +189,7 @@
             onKeyboardSettingsClicked,
             shortcutsUiState.isShortcutCustomizerFlagEnabled,
             onCustomizationRequested,
-            shortcutsUiState.shouldShowResetButton
+            shortcutsUiState.shouldShowResetButton,
         )
     }
 }
@@ -380,7 +380,7 @@
     onKeyboardSettingsClicked: () -> Unit,
     isShortcutCustomizerFlagEnabled: Boolean,
     onCustomizationRequested: (ShortcutCustomizationRequestInfo) -> Unit = {},
-    shouldShowResetButton: Boolean
+    shouldShowResetButton: Boolean,
 ) {
     val selectedCategory = categories.fastFirstOrNull { it.type == selectedCategoryType }
     var isCustomizing by remember { mutableStateOf(false) }
@@ -801,7 +801,10 @@
 private fun BoxScope.ShortcutTextKey(key: ShortcutKey.Text) {
     Text(
         text = key.value,
-        modifier = Modifier.align(Alignment.Center).padding(horizontal = 12.dp),
+        modifier =
+            Modifier.align(Alignment.Center).padding(horizontal = 12.dp).semantics {
+                hideFromAccessibility()
+            },
         style = MaterialTheme.typography.titleSmall,
     )
 }
@@ -825,7 +828,7 @@
     Spacer(Modifier.width(spacing))
     Text(
         text = stringResource(R.string.shortcut_helper_key_combinations_or_separator),
-        modifier = Modifier.align(Alignment.CenterVertically),
+        modifier = Modifier.align(Alignment.CenterVertically).semantics { hideFromAccessibility() },
         style = MaterialTheme.typography.titleSmall,
     )
     Spacer(Modifier.width(spacing))
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/data/quickaffordance/GlanceableHubQuickAffordanceConfig.kt b/packages/SystemUI/src/com/android/systemui/keyguard/data/quickaffordance/GlanceableHubQuickAffordanceConfig.kt
index 71f29c0..d335a18 100644
--- a/packages/SystemUI/src/com/android/systemui/keyguard/data/quickaffordance/GlanceableHubQuickAffordanceConfig.kt
+++ b/packages/SystemUI/src/com/android/systemui/keyguard/data/quickaffordance/GlanceableHubQuickAffordanceConfig.kt
@@ -20,12 +20,12 @@
 import android.content.Intent
 import android.provider.Settings
 import android.util.Log
-import com.android.systemui.Flags.glanceableHubShortcutButton
 import com.android.systemui.animation.Expandable
 import com.android.systemui.common.shared.model.ContentDescription
 import com.android.systemui.common.shared.model.Icon
 import com.android.systemui.communal.data.repository.CommunalSceneRepository
 import com.android.systemui.communal.domain.interactor.CommunalInteractor
+import com.android.systemui.communal.domain.interactor.CommunalSettingsInteractor
 import com.android.systemui.communal.shared.model.CommunalScenes
 import com.android.systemui.communal.shared.model.CommunalTransitionKeys
 import com.android.systemui.dagger.SysUISingleton
@@ -46,6 +46,7 @@
     @Application private val context: Context,
     private val communalSceneRepository: CommunalSceneRepository,
     private val communalInteractor: CommunalInteractor,
+    private val communalSettingsInteractor: CommunalSettingsInteractor,
     private val sceneInteractor: SceneInteractor,
 ) : KeyguardQuickAffordanceConfig {
 
@@ -61,8 +62,7 @@
     override val lockScreenState: Flow<KeyguardQuickAffordanceConfig.LockScreenState>
         get() = flow {
             emit(
-                // TODO(b/378113263): Gate on getV2FlagEnabled() when ready.
-                if (!glanceableHubShortcutButton()) {
+                if (!communalSettingsInteractor.isV2FlagEnabled()) {
                     Log.i(TAG, "Button hidden on lockscreen: flag not enabled.")
                     KeyguardQuickAffordanceConfig.LockScreenState.Hidden
                 } else if (!communalInteractor.isCommunalEnabled.value) {
@@ -81,8 +81,7 @@
         }
 
     override suspend fun getPickerScreenState(): KeyguardQuickAffordanceConfig.PickerScreenState {
-        // TODO(b/378113263): Gate on getV2FlagEnabled() when ready.
-        return if (!glanceableHubShortcutButton()) {
+        return if (!communalSettingsInteractor.isV2FlagEnabled()) {
             Log.i(TAG, "Button unavailable in picker: flag not enabled.")
             KeyguardQuickAffordanceConfig.PickerScreenState.UnavailableOnDevice
         } else if (!communalInteractor.isCommunalEnabled.value) {
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/FromDreamingTransitionInteractor.kt b/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/FromDreamingTransitionInteractor.kt
index 25e6f0e..a999211 100644
--- a/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/FromDreamingTransitionInteractor.kt
+++ b/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/FromDreamingTransitionInteractor.kt
@@ -21,7 +21,6 @@
 import android.app.DreamManager
 import com.android.app.animation.Interpolators
 import com.android.app.tracing.coroutines.launchTraced as launch
-import com.android.systemui.Flags.communalHubOnMobile
 import com.android.systemui.Flags.communalSceneKtfRefactor
 import com.android.systemui.communal.domain.interactor.CommunalInteractor
 import com.android.systemui.communal.domain.interactor.CommunalSceneInteractor
@@ -177,7 +176,8 @@
                             newScene = CommunalScenes.Communal,
                             loggingReason = "FromDreamingTransitionInteractor",
                             transitionKey =
-                                if (communalHubOnMobile()) CommunalTransitionKeys.SimpleFade
+                                if (communalSettingsInteractor.isV2FlagEnabled())
+                                    CommunalTransitionKeys.SimpleFade
                                 else null,
                         )
                     } else {
diff --git a/packages/SystemUI/src/com/android/systemui/qs/QSHost.java b/packages/SystemUI/src/com/android/systemui/qs/QSHost.java
index ba3357c..7c7f48e0 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/QSHost.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/QSHost.java
@@ -19,6 +19,8 @@
 import android.content.res.Resources;
 import android.provider.Settings;
 
+import androidx.annotation.NonNull;
+
 import com.android.systemui.plugins.qs.QSTile;
 import com.android.systemui.res.R;
 
@@ -80,6 +82,12 @@
     void addTile(ComponentName tile);
 
     /**
+     * Click on a tile. Used by external commands
+     * @param tile the component name of the {@link android.service.quicksettings.TileService}
+     */
+    void clickTile(@NonNull ComponentName tile);
+
+    /**
      * Adds a custom tile to the set of current tiles.
      * @param tile the component name of the {@link android.service.quicksettings.TileService}
      * @param end if true, the tile will be added at the end. If false, at the beginning.
diff --git a/packages/SystemUI/src/com/android/systemui/qs/QSHostAdapter.kt b/packages/SystemUI/src/com/android/systemui/qs/QSHostAdapter.kt
index 0d464f5..dc3b582 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/QSHostAdapter.kt
+++ b/packages/SystemUI/src/com/android/systemui/qs/QSHostAdapter.kt
@@ -19,11 +19,13 @@
 import android.content.ComponentName
 import android.content.Context
 import androidx.annotation.GuardedBy
+import com.android.app.tracing.coroutines.launchTraced as launch
 import com.android.systemui.dagger.SysUISingleton
 import com.android.systemui.dagger.qualifiers.Application
 import com.android.systemui.dump.DumpManager
 import com.android.systemui.plugins.qs.QSTile
 import com.android.systemui.qs.external.TileServiceRequestController
+import com.android.systemui.qs.flags.QsInCompose
 import com.android.systemui.qs.pipeline.data.repository.TileSpecRepository.Companion.POSITION_AT_END
 import com.android.systemui.qs.pipeline.domain.interactor.CurrentTilesInteractor
 import com.android.systemui.qs.pipeline.shared.QSPipelineFlagsRepository
@@ -32,7 +34,6 @@
 import javax.inject.Inject
 import kotlinx.coroutines.CoroutineScope
 import kotlinx.coroutines.Job
-import com.android.app.tracing.coroutines.launchTraced as launch
 
 /**
  * Adapter to determine what real class to use for classes that depend on [QSHost].
@@ -135,4 +136,12 @@
     override fun indexOf(tileSpec: String): Int {
         return specs.indexOf(tileSpec)
     }
+
+    override fun clickTile(tile: ComponentName) {
+        if (QsInCompose.isUnexpectedlyInLegacyMode()) {
+            return
+        }
+        val spec = TileSpec.create(tile)
+        interactor.currentTiles.value.firstOrNull { it.spec == spec }?.tile?.click(null)
+    }
 }
diff --git a/packages/SystemUI/src/com/android/systemui/qs/composefragment/QSFragmentCompose.kt b/packages/SystemUI/src/com/android/systemui/qs/composefragment/QSFragmentCompose.kt
index 9dc21fb..8d9f49e 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/composefragment/QSFragmentCompose.kt
+++ b/packages/SystemUI/src/com/android/systemui/qs/composefragment/QSFragmentCompose.kt
@@ -47,7 +47,6 @@
 import androidx.compose.foundation.layout.fillMaxSize
 import androidx.compose.foundation.layout.fillMaxWidth
 import androidx.compose.foundation.layout.height
-import androidx.compose.foundation.layout.heightIn
 import androidx.compose.foundation.layout.offset
 import androidx.compose.foundation.layout.padding
 import androidx.compose.foundation.verticalScroll
@@ -248,7 +247,7 @@
         PlatformTheme(isDarkTheme = true) {
             ProvideShortcutHelperIndication(interactionsConfig = interactionsConfig()) {
                 AnimatedVisibility(
-                    visible = viewModel.isQsVisible,
+                    visible = viewModel.isQsVisibleAndAnyShadeExpanded,
                     modifier =
                         Modifier.graphicsLayer { alpha = viewModel.viewAlpha }
                             // Clipping before translation to match QSContainerImpl.onDraw
@@ -709,12 +708,7 @@
                                     GridAnchor()
                                     TileGrid(
                                         viewModel = containerViewModel.tileGridViewModel,
-                                        modifier =
-                                            Modifier.fillMaxWidth()
-                                                .heightIn(
-                                                    max =
-                                                        QuickSettingsShade.Dimensions.GridMaxHeight
-                                                ),
+                                        modifier = Modifier.fillMaxWidth(),
                                     )
                                 }
                             }
diff --git a/packages/SystemUI/src/com/android/systemui/qs/composefragment/viewmodel/QSFragmentComposeViewModel.kt b/packages/SystemUI/src/com/android/systemui/qs/composefragment/viewmodel/QSFragmentComposeViewModel.kt
index 02498d6..3c72520 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/composefragment/viewmodel/QSFragmentComposeViewModel.kt
+++ b/packages/SystemUI/src/com/android/systemui/qs/composefragment/viewmodel/QSFragmentComposeViewModel.kt
@@ -62,6 +62,7 @@
 import com.android.systemui.scene.shared.model.Scenes
 import com.android.systemui.shade.LargeScreenHeaderHelper
 import com.android.systemui.shade.ShadeDisplayAware
+import com.android.systemui.shade.domain.interactor.ShadeInteractor
 import com.android.systemui.shade.transition.LargeScreenShadeInterpolator
 import com.android.systemui.statusbar.StatusBarState
 import com.android.systemui.statusbar.SysuiStatusBarStateController
@@ -101,6 +102,7 @@
     DisableFlagsInteractor: DisableFlagsInteractor,
     keyguardTransitionInteractor: KeyguardTransitionInteractor,
     private val largeScreenShadeInterpolator: LargeScreenShadeInterpolator,
+    private val shadeInteractor: ShadeInteractor,
     @ShadeDisplayAware configurationInteractor: ConfigurationInteractor,
     private val largeScreenHeaderHelper: LargeScreenHeaderHelper,
     private val squishinessInteractor: TileSquishinessInteractor,
@@ -129,6 +131,9 @@
 
     var isQsVisible by mutableStateOf(false)
 
+    val isQsVisibleAndAnyShadeExpanded: Boolean
+        get() = anyShadeExpanded && isQsVisible
+
     // This can only be negative if undefined (in which case it will be -1f), else it will be
     // in [0, 1]. In some cases, it could be set back to -1f internally to indicate that it's
     // different to every value in [0, 1].
@@ -429,6 +434,12 @@
                 ),
         )
 
+    private val anyShadeExpanded by
+        hydrator.hydratedStateOf(
+            traceName = "anyShadeExpanded",
+            source = shadeInteractor.isAnyExpanded,
+        )
+
     fun applyNewQsScrollerBounds(left: Float, top: Float, right: Float, bottom: Float) {
         if (usingMedia) {
             qsMediaHost.currentClipping.set(
@@ -503,6 +514,8 @@
             printSection("Quick Settings state") {
                 println("isQSExpanded", isQsExpanded)
                 println("isQSVisible", isQsVisible)
+                println("anyShadeExpanded", anyShadeExpanded)
+                println("isQSVisibleAndAnyShadeExpanded", isQsVisibleAndAnyShadeExpanded)
                 println("isQSEnabled", isQsEnabled)
                 println("isCustomizing", containerViewModel.editModeViewModel.isEditing.value)
                 println("inFirstPage", inFirstPage)
diff --git a/packages/SystemUI/src/com/android/systemui/qs/footer/ui/viewmodel/FooterActionsViewModel.kt b/packages/SystemUI/src/com/android/systemui/qs/footer/ui/viewmodel/FooterActionsViewModel.kt
index 8ef6375..cc87206 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/footer/ui/viewmodel/FooterActionsViewModel.kt
+++ b/packages/SystemUI/src/com/android/systemui/qs/footer/ui/viewmodel/FooterActionsViewModel.kt
@@ -23,12 +23,12 @@
 import androidx.lifecycle.Lifecycle
 import androidx.lifecycle.LifecycleCoroutineScope
 import androidx.lifecycle.LifecycleOwner
+import com.android.app.tracing.coroutines.launchTraced as launch
 import com.android.settingslib.Utils
 import com.android.systemui.animation.Expandable
 import com.android.systemui.common.shared.model.ContentDescription
 import com.android.systemui.common.shared.model.Icon
 import com.android.systemui.dagger.SysUISingleton
-import com.android.systemui.dagger.qualifiers.Application
 import com.android.systemui.globalactions.GlobalActionsDialogLite
 import com.android.systemui.plugins.ActivityStarter
 import com.android.systemui.plugins.FalsingManager
@@ -38,6 +38,7 @@
 import com.android.systemui.qs.footer.domain.model.SecurityButtonConfig
 import com.android.systemui.res.R
 import com.android.systemui.shade.ShadeDisplayAware
+import com.android.systemui.shade.shared.flag.DualShade
 import com.android.systemui.util.icuMessageFormat
 import javax.inject.Inject
 import javax.inject.Named
@@ -54,7 +55,6 @@
 import kotlinx.coroutines.flow.distinctUntilChanged
 import kotlinx.coroutines.flow.map
 import kotlinx.coroutines.isActive
-import com.android.app.tracing.coroutines.launchTraced as launch
 
 private const val TAG = "FooterActionsViewModel"
 
@@ -113,7 +113,7 @@
     class Factory
     @Inject
     constructor(
-        @ShadeDisplayAware  private val context: Context,
+        @ShadeDisplayAware private val context: Context,
         private val falsingManager: FalsingManager,
         private val footerActionsInteractor: FooterActionsInteractor,
         private val globalActionsDialogLiteProvider: Provider<GlobalActionsDialogLite>,
@@ -211,7 +211,7 @@
                 false /* if the dismiss should be deferred */
             },
             null /* cancelAction */,
-            true /* afterKeyguardGone */
+            true, /* afterKeyguardGone */
         )
     }
 
@@ -269,29 +269,7 @@
             .distinctUntilChanged()
 
     val userSwitcher =
-        footerActionsInteractor.userSwitcherStatus
-            .map { userSwitcherStatus ->
-                when (userSwitcherStatus) {
-                    UserSwitcherStatusModel.Disabled -> null
-                    is UserSwitcherStatusModel.Enabled -> {
-                        if (userSwitcherStatus.currentUserImage == null) {
-                            Log.e(
-                                TAG,
-                                "Skipped the addition of user switcher button because " +
-                                    "currentUserImage is missing",
-                            )
-                            return@map null
-                        }
-
-                        userSwitcherButtonViewModel(
-                            qsThemedContext,
-                            userSwitcherStatus,
-                            ::onUserSwitcherClicked
-                        )
-                    }
-                }
-            }
-            .distinctUntilChanged()
+        userSwitcherViewModel(qsThemedContext, footerActionsInteractor, ::onUserSwitcherClicked)
 
     val settings = settingsButtonViewModel(qsThemedContext, ::onSettingsButtonClicked)
     val power =
@@ -311,6 +289,36 @@
     )
 }
 
+fun userSwitcherViewModel(
+    themedContext: Context,
+    footerActionsInteractor: FooterActionsInteractor,
+    onUserSwitcherClicked: (Expandable) -> Unit,
+): Flow<FooterActionsButtonViewModel?> {
+    return footerActionsInteractor.userSwitcherStatus
+        .map { userSwitcherStatus ->
+            when (userSwitcherStatus) {
+                UserSwitcherStatusModel.Disabled -> null
+                is UserSwitcherStatusModel.Enabled -> {
+                    if (userSwitcherStatus.currentUserImage == null) {
+                        Log.e(
+                            TAG,
+                            "Skipped the addition of user switcher button because " +
+                                "currentUserImage is missing",
+                        )
+                        return@map null
+                    }
+
+                    userSwitcherButtonViewModel(
+                        themedContext,
+                        userSwitcherStatus,
+                        onUserSwitcherClicked,
+                    )
+                }
+            }
+        }
+        .distinctUntilChanged()
+}
+
 fun securityButtonViewModel(
     config: SecurityButtonConfig,
     onSecurityButtonClicked: (Context, Expandable) -> Unit,
@@ -369,7 +377,7 @@
 
 private fun userSwitcherContentDescription(
     qsThemedContext: Context,
-    currentUser: String?
+    currentUser: String?,
 ): String? {
     return currentUser?.let { user ->
         qsThemedContext.getString(R.string.accessibility_quick_settings_user, user)
@@ -384,13 +392,9 @@
         id = R.id.settings_button_container,
         Icon.Resource(
             R.drawable.ic_settings,
-            ContentDescription.Resource(R.string.accessibility_quick_settings_settings)
+            ContentDescription.Resource(R.string.accessibility_quick_settings_settings),
         ),
-        iconTint =
-            Utils.getColorAttrDefaultColor(
-                qsThemedContext,
-                R.attr.onShadeInactiveVariant,
-            ),
+        iconTint = Utils.getColorAttrDefaultColor(qsThemedContext, R.attr.onShadeInactiveVariant),
         backgroundColor = R.attr.shadeInactive,
         onSettingsButtonClicked,
     )
@@ -404,14 +408,14 @@
         id = R.id.pm_lite,
         Icon.Resource(
             android.R.drawable.ic_lock_power_off,
-            ContentDescription.Resource(R.string.accessibility_quick_settings_power_menu)
+            ContentDescription.Resource(R.string.accessibility_quick_settings_power_menu),
         ),
         iconTint =
             Utils.getColorAttrDefaultColor(
                 qsThemedContext,
-                R.attr.onShadeActive,
+                if (DualShade.isEnabled) R.attr.onShadeInactiveVariant else R.attr.onShadeActive,
             ),
-        backgroundColor = R.attr.shadeActive,
+        backgroundColor = if (DualShade.isEnabled) R.attr.shadeInactive else R.attr.shadeActive,
         onPowerButtonClicked,
     )
 }
diff --git a/packages/SystemUI/src/com/android/systemui/qs/panels/dagger/PanelsModule.kt b/packages/SystemUI/src/com/android/systemui/qs/panels/dagger/PanelsModule.kt
index 1f55ac7..f4bf53ca 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/panels/dagger/PanelsModule.kt
+++ b/packages/SystemUI/src/com/android/systemui/qs/panels/dagger/PanelsModule.kt
@@ -21,8 +21,6 @@
 import com.android.systemui.log.LogBufferFactory
 import com.android.systemui.qs.panels.data.repository.DefaultLargeTilesRepository
 import com.android.systemui.qs.panels.data.repository.DefaultLargeTilesRepositoryImpl
-import com.android.systemui.qs.panels.data.repository.GridLayoutTypeRepository
-import com.android.systemui.qs.panels.data.repository.GridLayoutTypeRepositoryImpl
 import com.android.systemui.qs.panels.domain.interactor.EditTilesResetInteractor
 import com.android.systemui.qs.panels.domain.interactor.SizedTilesResetInteractor
 import com.android.systemui.qs.panels.shared.model.GridLayoutType
@@ -49,9 +47,6 @@
     ): DefaultLargeTilesRepository
 
     @Binds
-    fun bindGridLayoutTypeRepository(impl: GridLayoutTypeRepositoryImpl): GridLayoutTypeRepository
-
-    @Binds
     fun bindEditTilesResetInteractor(impl: SizedTilesResetInteractor): EditTilesResetInteractor
 
     @Binds fun bindIconTilesViewModel(impl: IconTilesViewModelImpl): IconTilesViewModel
diff --git a/packages/SystemUI/src/com/android/systemui/qs/panels/data/repository/GridLayoutTypeRepository.kt b/packages/SystemUI/src/com/android/systemui/qs/panels/data/repository/GridLayoutTypeRepository.kt
index 47c4ffd..f17abe8 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/panels/data/repository/GridLayoutTypeRepository.kt
+++ b/packages/SystemUI/src/com/android/systemui/qs/panels/data/repository/GridLayoutTypeRepository.kt
@@ -17,28 +17,14 @@
 package com.android.systemui.qs.panels.data.repository
 
 import com.android.systemui.dagger.SysUISingleton
-import com.android.systemui.qs.panels.shared.model.GridLayoutType
+import com.android.systemui.qs.panels.shared.model.InfiniteGridLayoutType
 import com.android.systemui.qs.panels.shared.model.PaginatedGridLayoutType
 import javax.inject.Inject
-import kotlinx.coroutines.flow.MutableStateFlow
-import kotlinx.coroutines.flow.StateFlow
-import kotlinx.coroutines.flow.asStateFlow
-
-interface GridLayoutTypeRepository {
-    val layout: StateFlow<GridLayoutType>
-
-    fun setLayout(type: GridLayoutType)
-}
+import kotlinx.coroutines.flow.flowOf
 
 @SysUISingleton
-class GridLayoutTypeRepositoryImpl @Inject constructor() : GridLayoutTypeRepository {
-    private val _layout: MutableStateFlow<GridLayoutType> =
-        MutableStateFlow(PaginatedGridLayoutType)
-    override val layout = _layout.asStateFlow()
+class GridLayoutTypeRepository @Inject constructor() {
+    val defaultLayoutType = flowOf(PaginatedGridLayoutType)
 
-    override fun setLayout(type: GridLayoutType) {
-        if (_layout.value != type) {
-            _layout.value = type
-        }
-    }
+    val dualShadeLayoutType = flowOf(InfiniteGridLayoutType)
 }
diff --git a/packages/SystemUI/src/com/android/systemui/qs/panels/domain/interactor/GridLayoutTypeInteractor.kt b/packages/SystemUI/src/com/android/systemui/qs/panels/domain/interactor/GridLayoutTypeInteractor.kt
index 4af1b22..e493cbe 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/panels/domain/interactor/GridLayoutTypeInteractor.kt
+++ b/packages/SystemUI/src/com/android/systemui/qs/panels/domain/interactor/GridLayoutTypeInteractor.kt
@@ -19,14 +19,23 @@
 import com.android.systemui.dagger.SysUISingleton
 import com.android.systemui.qs.panels.data.repository.GridLayoutTypeRepository
 import com.android.systemui.qs.panels.shared.model.GridLayoutType
+import com.android.systemui.shade.domain.interactor.ShadeModeInteractor
+import com.android.systemui.shade.shared.model.ShadeMode
 import javax.inject.Inject
-import kotlinx.coroutines.flow.StateFlow
+import kotlinx.coroutines.ExperimentalCoroutinesApi
+import kotlinx.coroutines.flow.Flow
+import kotlinx.coroutines.flow.flatMapLatest
 
 @SysUISingleton
-class GridLayoutTypeInteractor @Inject constructor(private val repo: GridLayoutTypeRepository) {
-    val layout: StateFlow<GridLayoutType> = repo.layout
-
-    fun setLayoutType(type: GridLayoutType) {
-        repo.setLayout(type)
-    }
+@OptIn(ExperimentalCoroutinesApi::class)
+class GridLayoutTypeInteractor
+@Inject
+constructor(private val repo: GridLayoutTypeRepository, shadeModeInteractor: ShadeModeInteractor) {
+    val layout: Flow<GridLayoutType> =
+        shadeModeInteractor.shadeMode.flatMapLatest { shadeMode ->
+            when (shadeMode) {
+                is ShadeMode.Dual -> repo.dualShadeLayoutType
+                else -> repo.defaultLayoutType
+            }
+        }
 }
diff --git a/packages/SystemUI/src/com/android/systemui/qs/panels/ui/compose/PaginatedGridLayout.kt b/packages/SystemUI/src/com/android/systemui/qs/panels/ui/compose/PaginatedGridLayout.kt
index b6dbf4d..39408d3 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/panels/ui/compose/PaginatedGridLayout.kt
+++ b/packages/SystemUI/src/com/android/systemui/qs/panels/ui/compose/PaginatedGridLayout.kt
@@ -49,9 +49,10 @@
 import com.android.systemui.qs.panels.dagger.PaginatedBaseLayoutType
 import com.android.systemui.qs.panels.ui.compose.Dimensions.FooterHeight
 import com.android.systemui.qs.panels.ui.compose.Dimensions.InterPageSpacing
-import com.android.systemui.qs.panels.ui.viewmodel.EditModeButtonViewModel
+import com.android.systemui.qs.panels.ui.compose.toolbar.EditModeButton
 import com.android.systemui.qs.panels.ui.viewmodel.PaginatedGridViewModel
 import com.android.systemui.qs.panels.ui.viewmodel.TileViewModel
+import com.android.systemui.qs.panels.ui.viewmodel.toolbar.EditModeButtonViewModel
 import com.android.systemui.qs.ui.compose.borderOnFocus
 import javax.inject.Inject
 
diff --git a/packages/SystemUI/src/com/android/systemui/qs/panels/ui/compose/infinitegrid/EditTile.kt b/packages/SystemUI/src/com/android/systemui/qs/panels/ui/compose/infinitegrid/EditTile.kt
index c6141a1..a05747d 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/panels/ui/compose/infinitegrid/EditTile.kt
+++ b/packages/SystemUI/src/com/android/systemui/qs/panels/ui/compose/infinitegrid/EditTile.kt
@@ -28,6 +28,7 @@
 import androidx.compose.foundation.LocalOverscrollFactory
 import androidx.compose.foundation.background
 import androidx.compose.foundation.border
+import androidx.compose.foundation.clipScrollableContainer
 import androidx.compose.foundation.gestures.Orientation
 import androidx.compose.foundation.layout.Arrangement.spacedBy
 import androidx.compose.foundation.layout.Box
@@ -138,7 +139,6 @@
 import com.android.systemui.qs.pipeline.shared.TileSpec
 import com.android.systemui.qs.shared.model.groupAndSort
 import com.android.systemui.res.R
-import kotlin.math.max
 import kotlin.math.roundToInt
 import kotlinx.coroutines.CoroutineScope
 import kotlinx.coroutines.delay
@@ -148,8 +148,9 @@
 @OptIn(ExperimentalMaterial3Api::class)
 @Composable
 private fun EditModeTopBar(onStopEditing: () -> Unit, onReset: (() -> Unit)?) {
+
     TopAppBar(
-        colors = TopAppBarDefaults.topAppBarColors(containerColor = Color.Black),
+        colors = TopAppBarDefaults.topAppBarColors(containerColor = Color.Transparent),
         title = { Text(text = stringResource(id = R.string.qs_edit)) },
         navigationIcon = {
             IconButton(onClick = onStopEditing) {
@@ -209,7 +210,15 @@
             Column(
                 verticalArrangement =
                     spacedBy(dimensionResource(id = R.dimen.qs_label_container_margin)),
-                modifier = modifier.fillMaxSize().verticalScroll(scrollState).padding(innerPadding),
+                modifier =
+                    modifier
+                        .fillMaxSize()
+                        // Apply top padding before the scroll so the scrollable doesn't show under
+                        // the
+                        // top bar
+                        .padding(top = innerPadding.calculateTopPadding())
+                        .clipScrollableContainer(Orientation.Vertical)
+                        .verticalScroll(scrollState),
             ) {
                 AnimatedContent(
                     targetState = listState.dragInProgress,
diff --git a/packages/SystemUI/src/com/android/systemui/qs/panels/ui/compose/EditModeButton.kt b/packages/SystemUI/src/com/android/systemui/qs/panels/ui/compose/toolbar/EditModeButton.kt
similarity index 93%
rename from packages/SystemUI/src/com/android/systemui/qs/panels/ui/compose/EditModeButton.kt
rename to packages/SystemUI/src/com/android/systemui/qs/panels/ui/compose/toolbar/EditModeButton.kt
index c2764f9..85db952 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/panels/ui/compose/EditModeButton.kt
+++ b/packages/SystemUI/src/com/android/systemui/qs/panels/ui/compose/toolbar/EditModeButton.kt
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package com.android.systemui.qs.panels.ui.compose
+package com.android.systemui.qs.panels.ui.compose.toolbar
 
 import androidx.compose.foundation.shape.CornerSize
 import androidx.compose.foundation.shape.RoundedCornerShape
@@ -30,7 +30,7 @@
 import androidx.compose.ui.res.stringResource
 import androidx.compose.ui.unit.dp
 import com.android.systemui.lifecycle.rememberViewModel
-import com.android.systemui.qs.panels.ui.viewmodel.EditModeButtonViewModel
+import com.android.systemui.qs.panels.ui.viewmodel.toolbar.EditModeButtonViewModel
 import com.android.systemui.qs.ui.compose.borderOnFocus
 import com.android.systemui.res.R
 
diff --git a/packages/SystemUI/src/com/android/systemui/qs/panels/ui/compose/toolbar/Toolbar.kt b/packages/SystemUI/src/com/android/systemui/qs/panels/ui/compose/toolbar/Toolbar.kt
new file mode 100644
index 0000000..37fa9e7
--- /dev/null
+++ b/packages/SystemUI/src/com/android/systemui/qs/panels/ui/compose/toolbar/Toolbar.kt
@@ -0,0 +1,54 @@
+/*
+ * 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.compose.toolbar
+
+import androidx.compose.foundation.layout.Row
+import androidx.compose.foundation.layout.Spacer
+import androidx.compose.foundation.layout.fillMaxWidth
+import androidx.compose.foundation.layout.requiredHeight
+import androidx.compose.runtime.Composable
+import androidx.compose.ui.Alignment
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.unit.dp
+import com.android.systemui.compose.modifiers.sysuiResTag
+import com.android.systemui.lifecycle.rememberViewModel
+import com.android.systemui.qs.footer.ui.compose.IconButton
+import com.android.systemui.qs.panels.ui.viewmodel.toolbar.ToolbarViewModel
+
+@Composable
+fun Toolbar(toolbarViewModelFactory: ToolbarViewModel.Factory, modifier: Modifier = Modifier) {
+    val viewModel = rememberViewModel("Toolbar") { toolbarViewModelFactory.create() }
+
+    Row(
+        modifier = modifier.fillMaxWidth().requiredHeight(48.dp),
+        verticalAlignment = Alignment.CenterVertically,
+    ) {
+        viewModel.userSwitcherViewModel?.let {
+            IconButton(it, Modifier.sysuiResTag("multi_user_switch"))
+        }
+
+        EditModeButton(viewModel.editModeButtonViewModelFactory)
+
+        IconButton(
+            viewModel.settingsButtonViewModel,
+            Modifier.sysuiResTag("settings_button_container"),
+        )
+
+        Spacer(modifier = Modifier.weight(1f))
+        IconButton(viewModel.powerButtonViewModel, Modifier.sysuiResTag("pm_lite"))
+    }
+}
diff --git a/packages/SystemUI/src/com/android/systemui/qs/panels/ui/viewmodel/PaginatedGridViewModel.kt b/packages/SystemUI/src/com/android/systemui/qs/panels/ui/viewmodel/PaginatedGridViewModel.kt
index 4a18872..3fcb2ab 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/panels/ui/viewmodel/PaginatedGridViewModel.kt
+++ b/packages/SystemUI/src/com/android/systemui/qs/panels/ui/viewmodel/PaginatedGridViewModel.kt
@@ -24,6 +24,7 @@
 import com.android.systemui.lifecycle.Hydrator
 import com.android.systemui.media.controls.ui.controller.MediaHierarchyManager.Companion.LOCATION_QS
 import com.android.systemui.qs.panels.domain.interactor.PaginatedGridInteractor
+import com.android.systemui.qs.panels.ui.viewmodel.toolbar.EditModeButtonViewModel
 import dagger.assisted.AssistedFactory
 import dagger.assisted.AssistedInject
 import kotlinx.coroutines.awaitCancellation
diff --git a/packages/SystemUI/src/com/android/systemui/qs/panels/ui/viewmodel/EditModeButtonViewModel.kt b/packages/SystemUI/src/com/android/systemui/qs/panels/ui/viewmodel/toolbar/EditModeButtonViewModel.kt
similarity index 90%
rename from packages/SystemUI/src/com/android/systemui/qs/panels/ui/viewmodel/EditModeButtonViewModel.kt
rename to packages/SystemUI/src/com/android/systemui/qs/panels/ui/viewmodel/toolbar/EditModeButtonViewModel.kt
index b033473..f606218 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/panels/ui/viewmodel/EditModeButtonViewModel.kt
+++ b/packages/SystemUI/src/com/android/systemui/qs/panels/ui/viewmodel/toolbar/EditModeButtonViewModel.kt
@@ -14,10 +14,11 @@
  * limitations under the License.
  */
 
-package com.android.systemui.qs.panels.ui.viewmodel
+package com.android.systemui.qs.panels.ui.viewmodel.toolbar
 
 import com.android.systemui.classifier.domain.interactor.FalsingInteractor
 import com.android.systemui.plugins.FalsingManager
+import com.android.systemui.qs.panels.ui.viewmodel.EditModeViewModel
 import dagger.assisted.AssistedFactory
 import dagger.assisted.AssistedInject
 
diff --git a/packages/SystemUI/src/com/android/systemui/qs/panels/ui/viewmodel/toolbar/ToolbarViewModel.kt b/packages/SystemUI/src/com/android/systemui/qs/panels/ui/viewmodel/toolbar/ToolbarViewModel.kt
new file mode 100644
index 0000000..0fde855
--- /dev/null
+++ b/packages/SystemUI/src/com/android/systemui/qs/panels/ui/viewmodel/toolbar/ToolbarViewModel.kt
@@ -0,0 +1,111 @@
+/*
+ * 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.toolbar
+
+import android.content.Context
+import android.view.ContextThemeWrapper
+import androidx.compose.runtime.getValue
+import androidx.compose.runtime.mutableStateOf
+import androidx.compose.runtime.setValue
+import com.android.systemui.animation.Expandable
+import com.android.systemui.classifier.domain.interactor.FalsingInteractor
+import com.android.systemui.classifier.domain.interactor.runIfNotFalseTap
+import com.android.systemui.globalactions.GlobalActionsDialogLite
+import com.android.systemui.lifecycle.ExclusiveActivatable
+import com.android.systemui.lifecycle.Hydrator
+import com.android.systemui.qs.footer.domain.interactor.FooterActionsInteractor
+import com.android.systemui.qs.footer.ui.viewmodel.FooterActionsButtonViewModel
+import com.android.systemui.qs.footer.ui.viewmodel.powerButtonViewModel
+import com.android.systemui.qs.footer.ui.viewmodel.settingsButtonViewModel
+import com.android.systemui.qs.footer.ui.viewmodel.userSwitcherViewModel
+import com.android.systemui.res.R
+import com.android.systemui.shade.ShadeDisplayAware
+import dagger.assisted.AssistedFactory
+import dagger.assisted.AssistedInject
+import javax.inject.Provider
+import kotlinx.coroutines.awaitCancellation
+import kotlinx.coroutines.coroutineScope
+import kotlinx.coroutines.launch
+
+class ToolbarViewModel
+@AssistedInject
+constructor(
+    val editModeButtonViewModelFactory: EditModeButtonViewModel.Factory,
+    private val footerActionsInteractor: FooterActionsInteractor,
+    private val globalActionsDialogLiteProvider: Provider<GlobalActionsDialogLite>,
+    private val falsingInteractor: FalsingInteractor,
+    @ShadeDisplayAware appContext: Context,
+) : ExclusiveActivatable() {
+    private val qsThemedContext =
+        ContextThemeWrapper(appContext, R.style.Theme_SystemUI_QuickSettings)
+    private val hydrator = Hydrator("ToolbarViewModel.hydrator")
+
+    val powerButtonViewModel = powerButtonViewModel(qsThemedContext, ::onPowerButtonClicked)
+
+    val settingsButtonViewModel =
+        settingsButtonViewModel(qsThemedContext, ::onSettingsButtonClicked)
+
+    val userSwitcherViewModel: FooterActionsButtonViewModel? by
+        hydrator.hydratedStateOf(
+            traceName = "userSwitcherViewModel",
+            initialValue = null,
+            source =
+                userSwitcherViewModel(
+                    qsThemedContext,
+                    footerActionsInteractor,
+                    ::onUserSwitcherClicked,
+                ),
+        )
+
+    override suspend fun onActivated(): Nothing {
+        coroutineScope {
+            launch {
+                try {
+                    globalActionsDialogLite = globalActionsDialogLiteProvider.get()
+                    awaitCancellation()
+                } finally {
+                    globalActionsDialogLite?.destroy()
+                }
+            }
+            launch { hydrator.activate() }
+            awaitCancellation()
+        }
+    }
+
+    private var globalActionsDialogLite: GlobalActionsDialogLite? by mutableStateOf(null)
+
+    private fun onPowerButtonClicked(expandable: Expandable) {
+        falsingInteractor.runIfNotFalseTap {
+            globalActionsDialogLite?.let {
+                footerActionsInteractor.showPowerMenuDialog(it, expandable)
+            }
+        }
+    }
+
+    private fun onUserSwitcherClicked(expandable: Expandable) {
+        falsingInteractor.runIfNotFalseTap { footerActionsInteractor.showUserSwitcher(expandable) }
+    }
+
+    private fun onSettingsButtonClicked(expandable: Expandable) {
+        falsingInteractor.runIfNotFalseTap { footerActionsInteractor.showSettings(expandable) }
+    }
+
+    @AssistedFactory
+    interface Factory {
+        fun create(): ToolbarViewModel
+    }
+}
diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/base/interactor/QSTileUserActionInteractor.kt b/packages/SystemUI/src/com/android/systemui/qs/tiles/base/interactor/QSTileUserActionInteractor.kt
index 17b78eb..e8c4274 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/tiles/base/interactor/QSTileUserActionInteractor.kt
+++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/base/interactor/QSTileUserActionInteractor.kt
@@ -17,6 +17,7 @@
 package com.android.systemui.qs.tiles.base.interactor
 
 import android.annotation.WorkerThread
+import com.android.systemui.plugins.qs.TileDetailsViewModel
 
 interface QSTileUserActionInteractor<DATA_TYPE> {
     /**
@@ -27,4 +28,17 @@
      * It's safe to run long running computations inside this function.
      */
     @WorkerThread suspend fun handleInput(input: QSTileInput<DATA_TYPE>)
+
+    /**
+     * Provides the [TileDetailsViewModel] for constructing the corresponding details view.
+     *
+     * This property is defined here to reuse the business logic. For example, reusing the user
+     * long-click as the go-to-settings callback in the details view.
+     * Subclasses can override this property to provide a specific [TileDetailsViewModel]
+     * implementation.
+     *
+     * @return The [TileDetailsViewModel] instance, or null if not implemented.
+     */
+    val detailsViewModel: TileDetailsViewModel?
+        get() = null
 }
diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/base/viewmodel/QSTileViewModelImpl.kt b/packages/SystemUI/src/com/android/systemui/qs/tiles/base/viewmodel/QSTileViewModelImpl.kt
index aeb6cef..224fa10 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/tiles/base/viewmodel/QSTileViewModelImpl.kt
+++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/base/viewmodel/QSTileViewModelImpl.kt
@@ -20,6 +20,7 @@
 import com.android.app.tracing.coroutines.launchTraced as launch
 import com.android.systemui.Dumpable
 import com.android.systemui.plugins.FalsingManager
+import com.android.systemui.plugins.qs.TileDetailsViewModel
 import com.android.systemui.qs.tiles.base.analytics.QSTileAnalytics
 import com.android.systemui.qs.tiles.base.interactor.DataUpdateTrigger
 import com.android.systemui.qs.tiles.base.interactor.DisabledByPolicyInteractor
@@ -115,6 +116,9 @@
             .flowOn(backgroundDispatcher)
             .stateIn(tileScope, SharingStarted.WhileSubscribed(), true)
 
+    override val detailsViewModel: TileDetailsViewModel?
+        get() = userActionInteractor().detailsViewModel
+
     override fun forceUpdate() {
         tileScope.launch(context = backgroundDispatcher) { forceUpdates.emit(Unit) }
     }
diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/impl/internet/domain/interactor/InternetTileUserActionInteractor.kt b/packages/SystemUI/src/com/android/systemui/qs/tiles/impl/internet/domain/interactor/InternetTileUserActionInteractor.kt
index a963b28..fdb15b9 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/tiles/impl/internet/domain/interactor/InternetTileUserActionInteractor.kt
+++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/impl/internet/domain/interactor/InternetTileUserActionInteractor.kt
@@ -18,15 +18,23 @@
 
 import android.content.Intent
 import android.provider.Settings
+import com.android.systemui.animation.Expandable
 import com.android.systemui.dagger.qualifiers.Main
+import com.android.systemui.plugins.qs.TileDetailsViewModel
 import com.android.systemui.qs.tiles.base.actions.QSTileIntentUserInputHandler
 import com.android.systemui.qs.tiles.base.interactor.QSTileInput
 import com.android.systemui.qs.tiles.base.interactor.QSTileUserActionInteractor
+import com.android.systemui.qs.tiles.dialog.InternetDetailsViewModel
 import com.android.systemui.qs.tiles.dialog.InternetDialogManager
 import com.android.systemui.qs.tiles.dialog.WifiStateWorker
 import com.android.systemui.qs.tiles.impl.internet.domain.model.InternetTileModel
 import com.android.systemui.qs.tiles.viewmodel.QSTileUserAction
 import com.android.systemui.statusbar.connectivity.AccessPointController
+import kotlinx.coroutines.flow.SharingStarted
+import kotlinx.coroutines.flow.StateFlow
+import kotlinx.coroutines.flow.flatMapLatest
+import kotlinx.coroutines.flow.flowOn
+import kotlinx.coroutines.flow.stateIn
 import javax.inject.Inject
 import kotlin.coroutines.CoroutineContext
 import kotlinx.coroutines.withContext
@@ -61,11 +69,18 @@
                     wifiStateWorker.isWifiEnabled = !wifiStateWorker.isWifiEnabled
                 }
                 is QSTileUserAction.LongClick -> {
-                    qsTileIntentUserActionHandler.handle(
-                        action.expandable,
-                        Intent(Settings.ACTION_WIFI_SETTINGS)
-                    )
+                    handleLongClick(action.expandable)
                 }
             }
         }
+
+    override val detailsViewModel: TileDetailsViewModel =
+        InternetDetailsViewModel { handleLongClick(null) }
+
+    private fun handleLongClick(expandable:Expandable?){
+        qsTileIntentUserActionHandler.handle(
+            expandable,
+            Intent(Settings.ACTION_WIFI_SETTINGS)
+        )
+    }
 }
diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/viewmodel/QSTileViewModel.kt b/packages/SystemUI/src/com/android/systemui/qs/tiles/viewmodel/QSTileViewModel.kt
index b1b0001..e8b9926 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/tiles/viewmodel/QSTileViewModel.kt
+++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/viewmodel/QSTileViewModel.kt
@@ -17,6 +17,7 @@
 package com.android.systemui.qs.tiles.viewmodel
 
 import android.os.UserHandle
+import com.android.systemui.plugins.qs.TileDetailsViewModel
 import kotlinx.coroutines.flow.StateFlow
 
 /**
@@ -37,6 +38,10 @@
     /** Specifies whether this device currently supports this tile. */
     val isAvailable: StateFlow<Boolean>
 
+    /** Specifies the [TileDetailsViewModel] for constructing the corresponding details view. */
+    val detailsViewModel: TileDetailsViewModel?
+        get() = null
+
     /**
      * Notifies about the user change. Implementations should avoid using 3rd party userId sources
      * and use this value instead. This is to maintain consistent and concurrency-free behaviour
diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/viewmodel/QSTileViewModelAdapter.kt b/packages/SystemUI/src/com/android/systemui/qs/tiles/viewmodel/QSTileViewModelAdapter.kt
index 9d902d3..632eeef 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/tiles/viewmodel/QSTileViewModelAdapter.kt
+++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/viewmodel/QSTileViewModelAdapter.kt
@@ -27,6 +27,7 @@
 import com.android.systemui.dagger.qualifiers.Application
 import com.android.systemui.dagger.qualifiers.UiBackground
 import com.android.systemui.plugins.qs.QSTile
+import com.android.systemui.plugins.qs.TileDetailsViewModel
 import com.android.systemui.qs.QSHost
 import com.android.systemui.qs.tileimpl.QSTileImpl.DrawableIcon
 import com.android.systemui.qs.tileimpl.QSTileImpl.DrawableIconWithRes
@@ -154,6 +155,10 @@
         qsTileViewModel.onUserChanged(UserHandle.of(currentUser))
     }
 
+    override fun getDetailsViewModel(): TileDetailsViewModel? {
+        return qsTileViewModel.detailsViewModel
+    }
+
     @Deprecated(
         "Not needed as {@link com.android.internal.logging.UiEvent} will use #getMetricsSpec",
         replaceWith = ReplaceWith("getMetricsSpec"),
diff --git a/packages/SystemUI/src/com/android/systemui/qs/ui/viewmodel/QuickSettingsContainerViewModel.kt b/packages/SystemUI/src/com/android/systemui/qs/ui/viewmodel/QuickSettingsContainerViewModel.kt
index 62b1203..91d9079 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/ui/viewmodel/QuickSettingsContainerViewModel.kt
+++ b/packages/SystemUI/src/com/android/systemui/qs/ui/viewmodel/QuickSettingsContainerViewModel.kt
@@ -22,6 +22,7 @@
 import com.android.systemui.qs.panels.ui.viewmodel.EditModeViewModel
 import com.android.systemui.qs.panels.ui.viewmodel.QuickQuickSettingsViewModel
 import com.android.systemui.qs.panels.ui.viewmodel.TileGridViewModel
+import com.android.systemui.qs.panels.ui.viewmodel.toolbar.ToolbarViewModel
 import dagger.assisted.Assisted
 import dagger.assisted.AssistedFactory
 import dagger.assisted.AssistedInject
@@ -38,6 +39,7 @@
     val tileGridViewModel: TileGridViewModel,
     val editModeViewModel: EditModeViewModel,
     val detailsViewModel: DetailsViewModel,
+    val toolbarViewModelFactory: ToolbarViewModel.Factory,
 ) : ExclusiveActivatable() {
 
     val brightnessSliderViewModel =
diff --git a/packages/SystemUI/src/com/android/systemui/shade/GlanceableHubContainerController.kt b/packages/SystemUI/src/com/android/systemui/shade/GlanceableHubContainerController.kt
index 31780a5..61ac1a02 100644
--- a/packages/SystemUI/src/com/android/systemui/shade/GlanceableHubContainerController.kt
+++ b/packages/SystemUI/src/com/android/systemui/shade/GlanceableHubContainerController.kt
@@ -41,11 +41,11 @@
 import com.android.compose.theme.PlatformTheme
 import com.android.internal.annotations.VisibleForTesting
 import com.android.systemui.Flags
-import com.android.systemui.Flags.communalHubOnMobile
 import com.android.systemui.ambient.touch.TouchMonitor
 import com.android.systemui.ambient.touch.dagger.AmbientTouchComponent
 import com.android.systemui.communal.dagger.Communal
 import com.android.systemui.communal.domain.interactor.CommunalInteractor
+import com.android.systemui.communal.domain.interactor.CommunalSettingsInteractor
 import com.android.systemui.communal.ui.compose.CommunalContainer
 import com.android.systemui.communal.ui.compose.CommunalContent
 import com.android.systemui.communal.ui.viewmodel.CommunalViewModel
@@ -83,6 +83,7 @@
 @Inject
 constructor(
     private val communalInteractor: CommunalInteractor,
+    private val communalSettingsInteractor: CommunalSettingsInteractor,
     private val communalViewModel: CommunalViewModel,
     private val keyguardInteractor: KeyguardInteractor,
     private val keyguardTransitionInteractor: KeyguardTransitionInteractor,
@@ -514,7 +515,7 @@
         val touchOnUmo = keyguardMediaController.isWithinMediaViewBounds(ev.x.toInt(), ev.y.toInt())
         val touchOnSmartspace =
             lockscreenSmartspaceController.isWithinSmartspaceBounds(ev.x.toInt(), ev.y.toInt())
-        val glanceableHubV2 = communalHubOnMobile()
+        val glanceableHubV2 = communalSettingsInteractor.isV2FlagEnabled()
         if (
             !hubShowing &&
                 (touchOnNotifications || touchOnUmo || touchOnSmartspace || glanceableHubV2)
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/chips/call/ui/viewmodel/CallChipViewModel.kt b/packages/SystemUI/src/com/android/systemui/statusbar/chips/call/ui/viewmodel/CallChipViewModel.kt
index 6f491e7..85b50d3 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/chips/call/ui/viewmodel/CallChipViewModel.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/chips/call/ui/viewmodel/CallChipViewModel.kt
@@ -35,6 +35,7 @@
 import com.android.systemui.statusbar.chips.ui.model.OngoingActivityChipModel
 import com.android.systemui.statusbar.chips.ui.view.ChipBackgroundContainer
 import com.android.systemui.statusbar.chips.ui.viewmodel.OngoingActivityChipViewModel
+import com.android.systemui.statusbar.core.StatusBarConnectedDisplays
 import com.android.systemui.statusbar.phone.ongoingcall.shared.model.OngoingCallModel
 import com.android.systemui.util.time.SystemClock
 import javax.inject.Inject
@@ -67,9 +68,17 @@
                                 Flags.statusBarCallChipNotificationIcon() &&
                                     state.notificationIconView != null
                             ) {
+                                StatusBarConnectedDisplays.assertInLegacyMode()
                                 OngoingActivityChipModel.ChipIcon.StatusBarView(
                                     state.notificationIconView
                                 )
+                            } else if (
+                                StatusBarConnectedDisplays.isEnabled &&
+                                    Flags.statusBarCallChipNotificationIcon()
+                            ) {
+                                OngoingActivityChipModel.ChipIcon.StatusBarNotificationIcon(
+                                    state.notificationKey
+                                )
                             } else {
                                 OngoingActivityChipModel.ChipIcon.SingleColorIcon(phoneIcon)
                             }
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/chips/notification/domain/interactor/SingleNotificationChipInteractor.kt b/packages/SystemUI/src/com/android/systemui/statusbar/chips/notification/domain/interactor/SingleNotificationChipInteractor.kt
index c57c807..571a3e4 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/chips/notification/domain/interactor/SingleNotificationChipInteractor.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/chips/notification/domain/interactor/SingleNotificationChipInteractor.kt
@@ -22,6 +22,7 @@
 import com.android.systemui.statusbar.chips.StatusBarChipLogTags.pad
 import com.android.systemui.statusbar.chips.StatusBarChipsLog
 import com.android.systemui.statusbar.chips.notification.domain.model.NotificationChipModel
+import com.android.systemui.statusbar.core.StatusBarConnectedDisplays
 import com.android.systemui.statusbar.notification.shared.ActiveNotificationModel
 import dagger.assisted.Assisted
 import dagger.assisted.AssistedFactory
@@ -100,10 +101,15 @@
     private fun ActiveNotificationModel.toNotificationChipModel(): NotificationChipModel? {
         val statusBarChipIconView = this.statusBarChipIconView
         if (statusBarChipIconView == null) {
-            logger.w({ "$str1: Can't show chip because status bar chip icon view is null" }) {
-                str1 = extraLogTag
+            if (!StatusBarConnectedDisplays.isEnabled) {
+                logger.w({ "$str1: Can't show chip because status bar chip icon view is null" }) {
+                    str1 = extraLogTag
+                }
+                // When the flag is disabled, we keep the old behavior of returning null.
+                // When the flag is enabled, the icon will always be null, and will later be
+                // fetched in the UI layer using the notification key.
+                return null
             }
-            return null
         }
         return NotificationChipModel(key, statusBarChipIconView, whenTime)
     }
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/chips/notification/domain/model/NotificationChipModel.kt b/packages/SystemUI/src/com/android/systemui/statusbar/chips/notification/domain/model/NotificationChipModel.kt
index bc4241d..4588b19 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/chips/notification/domain/model/NotificationChipModel.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/chips/notification/domain/model/NotificationChipModel.kt
@@ -21,6 +21,6 @@
 /** Modeling all the data needed to render a status bar notification chip. */
 data class NotificationChipModel(
     val key: String,
-    val statusBarChipIconView: StatusBarIconView,
+    val statusBarChipIconView: StatusBarIconView?,
     val whenTime: Long,
 )
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/chips/notification/ui/viewmodel/NotifChipsViewModel.kt b/packages/SystemUI/src/com/android/systemui/statusbar/chips/notification/ui/viewmodel/NotifChipsViewModel.kt
index b2f7e2f..2cd5bb3 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/chips/notification/ui/viewmodel/NotifChipsViewModel.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/chips/notification/ui/viewmodel/NotifChipsViewModel.kt
@@ -24,6 +24,7 @@
 import com.android.systemui.statusbar.chips.notification.shared.StatusBarNotifChips
 import com.android.systemui.statusbar.chips.ui.model.ColorsModel
 import com.android.systemui.statusbar.chips.ui.model.OngoingActivityChipModel
+import com.android.systemui.statusbar.core.StatusBarConnectedDisplays
 import javax.inject.Inject
 import kotlinx.coroutines.CoroutineScope
 import kotlinx.coroutines.flow.Flow
@@ -50,7 +51,14 @@
     /** Converts the notification to the [OngoingActivityChipModel] object. */
     private fun NotificationChipModel.toActivityChipModel(): OngoingActivityChipModel.Shown {
         StatusBarNotifChips.assertInNewMode()
-        val icon = OngoingActivityChipModel.ChipIcon.StatusBarView(this.statusBarChipIconView)
+        val icon =
+            if (this.statusBarChipIconView != null) {
+                StatusBarConnectedDisplays.assertInLegacyMode()
+                OngoingActivityChipModel.ChipIcon.StatusBarView(this.statusBarChipIconView)
+            } else {
+                StatusBarConnectedDisplays.assertInNewMode()
+                OngoingActivityChipModel.ChipIcon.StatusBarNotificationIcon(this.key)
+            }
         // TODO(b/364653005): Use the notification color if applicable.
         val colors = ColorsModel.Themed
         val onClickListener =
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/chips/ui/binder/OngoingActivityChipBinder.kt b/packages/SystemUI/src/com/android/systemui/statusbar/chips/ui/binder/OngoingActivityChipBinder.kt
index 730784a..cf69d40 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/chips/ui/binder/OngoingActivityChipBinder.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/chips/ui/binder/OngoingActivityChipBinder.kt
@@ -32,11 +32,13 @@
 import com.android.systemui.statusbar.chips.ui.model.OngoingActivityChipModel
 import com.android.systemui.statusbar.chips.ui.view.ChipBackgroundContainer
 import com.android.systemui.statusbar.chips.ui.view.ChipChronometer
+import com.android.systemui.statusbar.core.StatusBarConnectedDisplays
+import com.android.systemui.statusbar.notification.icon.ui.viewbinder.NotificationIconContainerViewBinder.IconViewStore
 
 /** Binder for ongoing activity chip views. */
 object OngoingActivityChipBinder {
     /** Binds the given [chipModel] data to the given [chipView]. */
-    fun bind(chipModel: OngoingActivityChipModel, chipView: View) {
+    fun bind(chipModel: OngoingActivityChipModel, chipView: View, iconViewStore: IconViewStore?) {
         val chipContext = chipView.context
         val chipDefaultIconView: ImageView =
             chipView.requireViewById(R.id.ongoing_activity_chip_icon)
@@ -51,7 +53,7 @@
         when (chipModel) {
             is OngoingActivityChipModel.Shown -> {
                 // Data
-                setChipIcon(chipModel, chipBackgroundView, chipDefaultIconView)
+                setChipIcon(chipModel, chipBackgroundView, chipDefaultIconView, iconViewStore)
                 setChipMainContent(chipModel, chipTextView, chipTimeView, chipShortTimeDeltaView)
                 chipView.setOnClickListener(chipModel.onClickListener)
                 updateChipPadding(
@@ -85,6 +87,7 @@
         chipModel: OngoingActivityChipModel.Shown,
         backgroundView: ChipBackgroundContainer,
         defaultIconView: ImageView,
+        iconViewStore: IconViewStore?,
     ) {
         // Always remove any previously set custom icon. If we have a new custom icon, we'll re-add
         // it.
@@ -108,40 +111,64 @@
                 defaultIconView.untintView()
             }
             is OngoingActivityChipModel.ChipIcon.StatusBarView -> {
-                // Hide the default icon since we'll show this custom icon instead.
-                defaultIconView.visibility = View.GONE
-
-                // Add the new custom icon:
-                // 1. Set up the right visual params.
-                val iconView = icon.impl
-                with(iconView) {
-                    id = CUSTOM_ICON_VIEW_ID
-                    // TODO(b/354930838): Update the content description to not include "phone" and
-                    // maybe include the app name.
-                    contentDescription =
-                        context.resources.getString(R.string.ongoing_phone_call_content_description)
-                    tintView(iconTint)
+                StatusBarConnectedDisplays.assertInLegacyMode()
+                setStatusBarIconView(defaultIconView, icon.impl, iconTint, backgroundView)
+            }
+            is OngoingActivityChipModel.ChipIcon.StatusBarNotificationIcon -> {
+                StatusBarConnectedDisplays.assertInNewMode()
+                val iconView = fetchStatusBarIconView(iconViewStore, icon)
+                if (iconView == null) {
+                    // This means that the notification key doesn't exist anymore.
+                    return
                 }
-
-                // 2. If we just reinflated the view, we may need to detach the icon view from the
-                // old chip before we reattach it to the new one.
-                // See also: NotificationIconContainerViewBinder#bindIcons.
-                val currentParent = iconView.parent as? ViewGroup
-                if (currentParent != null && currentParent != backgroundView) {
-                    currentParent.removeView(iconView)
-                    currentParent.removeTransientView(iconView)
-                }
-
-                // 3: Add the icon as the starting view.
-                backgroundView.addView(
-                    iconView,
-                    /* index= */ 0,
-                    generateCustomIconLayoutParams(iconView),
-                )
+                setStatusBarIconView(defaultIconView, iconView, iconTint, backgroundView)
             }
         }
     }
 
+    private fun fetchStatusBarIconView(
+        iconViewStore: IconViewStore?,
+        icon: OngoingActivityChipModel.ChipIcon.StatusBarNotificationIcon,
+    ): StatusBarIconView? {
+        StatusBarConnectedDisplays.assertInNewMode()
+        if (iconViewStore == null) {
+            throw IllegalStateException("Store should always be non-null when flag is enabled.")
+        }
+        return iconViewStore.iconView(icon.notificationKey)
+    }
+
+    private fun setStatusBarIconView(
+        defaultIconView: ImageView,
+        iconView: StatusBarIconView,
+        iconTint: Int,
+        backgroundView: ChipBackgroundContainer,
+    ) {
+        // Hide the default icon since we'll show this custom icon instead.
+        defaultIconView.visibility = View.GONE
+
+        // 1. Set up the right visual params.
+        with(iconView) {
+            id = CUSTOM_ICON_VIEW_ID
+            // TODO(b/354930838): Update the content description to not include "phone" and maybe
+            // include the app name.
+            contentDescription =
+                context.resources.getString(R.string.ongoing_phone_call_content_description)
+            tintView(iconTint)
+        }
+
+        // 2. If we just reinflated the view, we may need to detach the icon view from the old chip
+        // before we reattach it to the new one.
+        // See also: NotificationIconContainerViewBinder#bindIcons.
+        val currentParent = iconView.parent as? ViewGroup
+        if (currentParent != null && currentParent != backgroundView) {
+            currentParent.removeView(iconView)
+            currentParent.removeTransientView(iconView)
+        }
+
+        // 3: Add the icon as the starting view.
+        backgroundView.addView(iconView, /* index= */ 0, generateCustomIconLayoutParams(iconView))
+    }
+
     private fun View.getCustomIconView(): StatusBarIconView? {
         return this.findViewById(CUSTOM_ICON_VIEW_ID)
     }
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/chips/ui/model/OngoingActivityChipModel.kt b/packages/SystemUI/src/com/android/systemui/statusbar/chips/ui/model/OngoingActivityChipModel.kt
index cf07af1..2dce4e3 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/chips/ui/model/OngoingActivityChipModel.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/chips/ui/model/OngoingActivityChipModel.kt
@@ -21,6 +21,7 @@
 import com.android.systemui.common.shared.model.Icon
 import com.android.systemui.statusbar.StatusBarIconView
 import com.android.systemui.statusbar.chips.notification.shared.StatusBarNotifChips
+import com.android.systemui.statusbar.core.StatusBarConnectedDisplays
 
 /** Model representing the display of an ongoing activity as a chip in the status bar. */
 sealed class OngoingActivityChipModel {
@@ -132,6 +133,17 @@
                     "OngoingActivityChipModel.ChipIcon.StatusBarView created even though " +
                         "Flags.statusBarCallChipNotificationIcon is not enabled"
                 }
+                StatusBarConnectedDisplays.assertInLegacyMode()
+            }
+        }
+
+        /**
+         * The icon is a custom icon, which is set on a notification, and can be looked up using the
+         * provided [notificationKey]. The icon was likely created by an external app.
+         */
+        data class StatusBarNotificationIcon(val notificationKey: String) : ChipIcon {
+            init {
+                StatusBarConnectedDisplays.assertInNewMode()
             }
         }
 
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/icon/IconManager.kt b/packages/SystemUI/src/com/android/systemui/statusbar/notification/icon/IconManager.kt
index 98ce163..b56a838 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/icon/IconManager.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/icon/IconManager.kt
@@ -162,7 +162,9 @@
             val sbIcon = iconBuilder.createIconView(entry)
             sbIcon.scaleType = ImageView.ScaleType.CENTER_INSIDE
             val sbChipIcon: StatusBarIconView?
-            if (Flags.statusBarCallChipNotificationIcon()) {
+            if (
+                Flags.statusBarCallChipNotificationIcon() && !StatusBarConnectedDisplays.isEnabled
+            ) {
                 sbChipIcon = iconBuilder.createIconView(entry)
                 sbChipIcon.scaleType = ImageView.ScaleType.CENTER_INSIDE
             } else {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationChildrenContainer.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationChildrenContainer.java
index c8e18a8..99edf65 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationChildrenContainer.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationChildrenContainer.java
@@ -16,6 +16,8 @@
 
 package com.android.systemui.statusbar.notification.stack;
 
+import static android.app.Flags.notificationsRedesignTemplates;
+
 import android.app.Notification;
 import android.content.Context;
 import android.content.res.Configuration;
@@ -171,7 +173,9 @@
                 R.dimen.notification_children_container_margin_top);
         mNotificationTopPadding = res.getDimensionPixelOffset(
                 R.dimen.notification_children_container_top_padding);
-        mHeaderHeight = mNotificationHeaderMargin + mNotificationTopPadding;
+        mHeaderHeight = notificationsRedesignTemplates()
+                ? res.getDimensionPixelSize(R.dimen.notification_2025_header_height)
+                : mNotificationHeaderMargin + mNotificationTopPadding;
         mCollapsedBottomPadding = res.getDimensionPixelOffset(
                 R.dimen.notification_children_collapsed_bottom_padding);
         mEnableShadowOnChildNotifications =
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/SectionHeaderView.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/SectionHeaderView.java
index 969ff1b..44075af 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/SectionHeaderView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/SectionHeaderView.java
@@ -16,6 +16,8 @@
 
 package com.android.systemui.statusbar.notification.stack;
 
+import static androidx.core.view.accessibility.AccessibilityNodeInfoCompat.AccessibilityActionCompat.ACTION_CLICK;
+
 import android.annotation.ColorInt;
 import android.annotation.Nullable;
 import android.annotation.StringRes;
@@ -28,6 +30,8 @@
 import android.widget.ImageView;
 import android.widget.TextView;
 
+import androidx.core.view.ViewCompat;
+
 import com.android.systemui.res.R;
 import com.android.systemui.statusbar.notification.row.StackScrollerDecorView;
 
@@ -69,6 +73,13 @@
             mLabelView.setText(mLabelTextId);
         }
         mLabelView.setAccessibilityHeading(true);
+        ViewCompat.replaceAccessibilityAction(
+                mLabelView,
+                ACTION_CLICK,
+                getResources().getString(
+                        R.string.accessibility_notification_section_header_open_settings),
+                null
+        );
     }
 
     @Override
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/ActivityStarterInternalImpl.kt b/packages/SystemUI/src/com/android/systemui/statusbar/phone/ActivityStarterInternalImpl.kt
index d1338ea..f2ef2f0 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/ActivityStarterInternalImpl.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/ActivityStarterInternalImpl.kt
@@ -313,6 +313,7 @@
                     // if it is volume panel.
                     options.setDisallowEnterPictureInPictureWhileLaunching(true)
                 }
+                intent.collectExtraIntentKeys()
                 try {
                     result[0] =
                         ActivityTaskManager.getService()
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesCommandQueueCallbacks.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesCommandQueueCallbacks.java
index 7f95fb0..adfcb71 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesCommandQueueCallbacks.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesCommandQueueCallbacks.java
@@ -53,6 +53,7 @@
 import com.android.systemui.plugins.ActivityStarter;
 import com.android.systemui.qs.QSHost;
 import com.android.systemui.qs.QSPanelController;
+import com.android.systemui.qs.flags.QsInCompose;
 import com.android.systemui.recents.ScreenPinningRequest;
 import com.android.systemui.res.R;
 import com.android.systemui.scene.shared.flag.SceneContainerFlag;
@@ -209,10 +210,16 @@
 
     @Override
     public void clickTile(ComponentName tile) {
-        // Can't inject this because it changes with the QS fragment
-        QSPanelController qsPanelController = mCentralSurfaces.getQSPanelController();
-        if (qsPanelController != null) {
-            qsPanelController.clickTile(tile);
+        if (QsInCompose.isEnabled()) {
+            if (tile != null) {
+                mQSHost.clickTile(tile);
+            }
+        } else {
+            // Can't inject this because it changes with the QS fragment
+            QSPanelController qsPanelController = mCentralSurfaces.getQSPanelController();
+            if (qsPanelController != null) {
+                qsPanelController.clickTile(tile);
+            }
         }
     }
 
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/LegacyActivityStarterInternalImpl.kt b/packages/SystemUI/src/com/android/systemui/statusbar/phone/LegacyActivityStarterInternalImpl.kt
index 1cca3ae..d7cc65d 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/LegacyActivityStarterInternalImpl.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/LegacyActivityStarterInternalImpl.kt
@@ -180,6 +180,7 @@
                     // if it is volume panel.
                     options.setDisallowEnterPictureInPictureWhileLaunching(true)
                 }
+                intent.collectExtraIntentKeys()
                 try {
                     result[0] =
                         ActivityTaskManager.getService()
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/fragment/CollapsedStatusBarFragment.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/fragment/CollapsedStatusBarFragment.java
index e4768e8..724ba8c 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/fragment/CollapsedStatusBarFragment.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/fragment/CollapsedStatusBarFragment.java
@@ -377,6 +377,7 @@
         mCarrierConfigTracker.addDefaultDataSubscriptionChangedListener(mDefaultDataListener);
 
         mHomeStatusBarViewBinder.bind(
+                view.getContext().getDisplayId(),
                 mStatusBar,
                 mHomeStatusBarViewModel,
                 /* systemEventChipAnimateIn */ null,
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/ongoingcall/OngoingCallController.kt b/packages/SystemUI/src/com/android/systemui/statusbar/phone/ongoingcall/OngoingCallController.kt
index 2166304..c57cede 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/ongoingcall/OngoingCallController.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/ongoingcall/OngoingCallController.kt
@@ -260,6 +260,7 @@
                 startTimeMs = currentInfo.callStartTime,
                 notificationIconView = icon,
                 intent = currentInfo.intent,
+                notificationKey = currentInfo.key,
             )
         } else {
             return OngoingCallModel.NoCall
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/ongoingcall/domain/interactor/OngoingCallInteractor.kt b/packages/SystemUI/src/com/android/systemui/statusbar/phone/ongoingcall/domain/interactor/OngoingCallInteractor.kt
index 1f7bd14..4b71c02 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/ongoingcall/domain/interactor/OngoingCallInteractor.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/ongoingcall/domain/interactor/OngoingCallInteractor.kt
@@ -90,6 +90,7 @@
                                     startTimeMs = model.whenTime,
                                     notificationIconView = model.statusBarChipIconView,
                                     intent = model.contentIntent,
+                                    notificationKey = model.key,
                                 )
                             }
                         }
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/ongoingcall/shared/model/OngoingCallModel.kt b/packages/SystemUI/src/com/android/systemui/statusbar/phone/ongoingcall/shared/model/OngoingCallModel.kt
index c2c91b2..1a5dcc1 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/ongoingcall/shared/model/OngoingCallModel.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/ongoingcall/shared/model/OngoingCallModel.kt
@@ -46,5 +46,6 @@
         val startTimeMs: Long,
         val notificationIconView: StatusBarIconView?,
         val intent: PendingIntent?,
+        val notificationKey: String,
     ) : OngoingCallModel
 }
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/shared/ui/binder/HomeStatusBarViewBinder.kt b/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/shared/ui/binder/HomeStatusBarViewBinder.kt
index 72df027..d9b2bd1d 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/shared/ui/binder/HomeStatusBarViewBinder.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/shared/ui/binder/HomeStatusBarViewBinder.kt
@@ -20,9 +20,9 @@
 import android.animation.AnimatorListenerAdapter
 import android.view.View
 import androidx.lifecycle.Lifecycle
+import androidx.lifecycle.lifecycleScope
 import androidx.lifecycle.repeatOnLifecycle
 import com.android.app.animation.Interpolators
-import com.android.app.tracing.coroutines.launchTraced as launch
 import com.android.systemui.Flags
 import com.android.systemui.dagger.SysUISingleton
 import com.android.systemui.lifecycle.repeatWhenAttached
@@ -31,16 +31,19 @@
 import com.android.systemui.statusbar.chips.notification.shared.StatusBarNotifChips
 import com.android.systemui.statusbar.chips.ui.binder.OngoingActivityChipBinder
 import com.android.systemui.statusbar.chips.ui.model.OngoingActivityChipModel
+import com.android.systemui.statusbar.core.StatusBarConnectedDisplays
 import com.android.systemui.statusbar.core.StatusBarRootModernization
 import com.android.systemui.statusbar.events.shared.model.SystemEventAnimationState
 import com.android.systemui.statusbar.events.shared.model.SystemEventAnimationState.AnimatingIn
 import com.android.systemui.statusbar.events.shared.model.SystemEventAnimationState.AnimatingOut
 import com.android.systemui.statusbar.events.shared.model.SystemEventAnimationState.RunningChipAnim
+import com.android.systemui.statusbar.notification.icon.ui.viewbinder.ConnectedDisplaysStatusBarNotificationIconViewStore
 import com.android.systemui.statusbar.notification.shared.NotificationsLiveDataStoreRefactor
 import com.android.systemui.statusbar.phone.fragment.CollapsedStatusBarFragment
 import com.android.systemui.statusbar.pipeline.shared.ui.viewmodel.HomeStatusBarViewModel
 import com.android.systemui.statusbar.pipeline.shared.ui.viewmodel.HomeStatusBarViewModel.VisibilityModel
 import javax.inject.Inject
+import kotlinx.coroutines.launch
 
 /**
  * Interface to assist with binding the [CollapsedStatusBarFragment] to [HomeStatusBarViewModel].
@@ -56,6 +59,7 @@
      * to support the chip animations.
      */
     fun bind(
+        displayId: Int,
         view: View,
         viewModel: HomeStatusBarViewModel,
         systemEventChipAnimateIn: ((View) -> Unit)?,
@@ -65,8 +69,13 @@
 }
 
 @SysUISingleton
-class HomeStatusBarViewBinderImpl @Inject constructor() : HomeStatusBarViewBinder {
+class HomeStatusBarViewBinderImpl
+@Inject
+constructor(
+    private val viewStoreFactory: ConnectedDisplaysStatusBarNotificationIconViewStore.Factory
+) : HomeStatusBarViewBinder {
     override fun bind(
+        displayId: Int,
         view: View,
         viewModel: HomeStatusBarViewModel,
         systemEventChipAnimateIn: ((View) -> Unit)?,
@@ -75,6 +84,14 @@
     ) {
         view.repeatWhenAttached {
             repeatOnLifecycle(Lifecycle.State.CREATED) {
+                val iconViewStore =
+                    if (StatusBarConnectedDisplays.isEnabled) {
+                        viewStoreFactory.create(displayId).also {
+                            lifecycleScope.launch { it.activate() }
+                        }
+                    } else {
+                        null
+                    }
                 launch {
                     viewModel.isTransitioningFromLockscreenToOccluded.collect {
                         listener.onStatusBarVisibilityMaybeChanged()
@@ -102,7 +119,11 @@
                         view.requireViewById(R.id.ongoing_activity_chip_primary)
                     launch {
                         viewModel.primaryOngoingActivityChip.collect { primaryChipModel ->
-                            OngoingActivityChipBinder.bind(primaryChipModel, primaryChipView)
+                            OngoingActivityChipBinder.bind(
+                                primaryChipModel,
+                                primaryChipView,
+                                iconViewStore,
+                            )
                             if (StatusBarRootModernization.isEnabled) {
                                 when (primaryChipModel) {
                                     is OngoingActivityChipModel.Shown ->
@@ -142,10 +163,18 @@
                         view.requireViewById(R.id.ongoing_activity_chip_secondary)
                     launch {
                         viewModel.ongoingActivityChips.collect { chips ->
-                            OngoingActivityChipBinder.bind(chips.primary, primaryChipView)
+                            OngoingActivityChipBinder.bind(
+                                chips.primary,
+                                primaryChipView,
+                                iconViewStore,
+                            )
                             // TODO(b/364653005): Don't show the secondary chip if there isn't
                             // enough space for it.
-                            OngoingActivityChipBinder.bind(chips.secondary, secondaryChipView)
+                            OngoingActivityChipBinder.bind(
+                                chips.secondary,
+                                secondaryChipView,
+                                iconViewStore,
+                            )
 
                             if (StatusBarRootModernization.isEnabled) {
                                 primaryChipView.adjustVisibility(chips.primary.toVisibilityModel())
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/shared/ui/composable/StatusBarRoot.kt b/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/shared/ui/composable/StatusBarRoot.kt
index 812e0eb..5614d82 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/shared/ui/composable/StatusBarRoot.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/shared/ui/composable/StatusBarRoot.kt
@@ -176,6 +176,7 @@
                     // This binder handles everything else
                     scope.launch {
                         statusBarViewBinder.bind(
+                            context.displayId,
                             phoneStatusBarView,
                             statusBarViewModel,
                             eventAnimationInteractor::animateStatusBarContentForChipEnter,
diff --git a/packages/SystemUI/src/com/android/systemui/volume/dialog/ringer/domain/VolumeDialogRingerInteractor.kt b/packages/SystemUI/src/com/android/systemui/volume/dialog/ringer/domain/VolumeDialogRingerInteractor.kt
index b83613b..4071918 100644
--- a/packages/SystemUI/src/com/android/systemui/volume/dialog/ringer/domain/VolumeDialogRingerInteractor.kt
+++ b/packages/SystemUI/src/com/android/systemui/volume/dialog/ringer/domain/VolumeDialogRingerInteractor.kt
@@ -20,7 +20,6 @@
 import android.media.AudioManager.RINGER_MODE_NORMAL
 import android.media.AudioManager.RINGER_MODE_SILENT
 import android.media.AudioManager.RINGER_MODE_VIBRATE
-import android.provider.Settings
 import com.android.settingslib.volume.data.repository.AudioSystemRepository
 import com.android.settingslib.volume.shared.model.RingerMode
 import com.android.systemui.plugins.VolumeDialogController
@@ -66,11 +65,6 @@
                             }
                         },
                 currentRingerMode = RingerMode(state.ringerModeInternal),
-                isEnabled =
-                    !(state.zenMode == Settings.Global.ZEN_MODE_ALARMS ||
-                        state.zenMode == Settings.Global.ZEN_MODE_NO_INTERRUPTIONS ||
-                        (state.zenMode == Settings.Global.ZEN_MODE_IMPORTANT_INTERRUPTIONS &&
-                            state.disallowRinger)),
                 isMuted = it.level == 0 || it.muted,
                 level = it.level,
                 levelMax = it.levelMax,
diff --git a/packages/SystemUI/src/com/android/systemui/volume/dialog/ringer/shared/model/VolumeDialogRingerModel.kt b/packages/SystemUI/src/com/android/systemui/volume/dialog/ringer/shared/model/VolumeDialogRingerModel.kt
index 3c24e02..84a8280 100644
--- a/packages/SystemUI/src/com/android/systemui/volume/dialog/ringer/shared/model/VolumeDialogRingerModel.kt
+++ b/packages/SystemUI/src/com/android/systemui/volume/dialog/ringer/shared/model/VolumeDialogRingerModel.kt
@@ -23,8 +23,6 @@
     val availableModes: List<RingerMode>,
     /** Current ringer mode internal */
     val currentRingerMode: RingerMode,
-    /** whether the ringer is allowed given the current ZenMode */
-    val isEnabled: Boolean,
     /** Whether the current ring stream level is zero or the controller state is muted */
     val isMuted: Boolean,
     /** Ring stream level */
diff --git a/packages/SystemUI/src/com/android/systemui/volume/dialog/ringer/ui/binder/VolumeDialogRingerViewBinder.kt b/packages/SystemUI/src/com/android/systemui/volume/dialog/ringer/ui/binder/VolumeDialogRingerViewBinder.kt
index 3bd2721..9eee91b 100644
--- a/packages/SystemUI/src/com/android/systemui/volume/dialog/ringer/ui/binder/VolumeDialogRingerViewBinder.kt
+++ b/packages/SystemUI/src/com/android/systemui/volume/dialog/ringer/ui/binder/VolumeDialogRingerViewBinder.kt
@@ -34,6 +34,7 @@
 import com.android.systemui.res.R
 import com.android.systemui.util.children
 import com.android.systemui.volume.dialog.dagger.scope.VolumeDialogScope
+import com.android.systemui.volume.dialog.ringer.ui.util.VolumeDialogRingerDrawerTransitionListener
 import com.android.systemui.volume.dialog.ringer.ui.viewmodel.RingerButtonUiModel
 import com.android.systemui.volume.dialog.ringer.ui.viewmodel.RingerButtonViewModel
 import com.android.systemui.volume.dialog.ringer.ui.viewmodel.RingerDrawerState
@@ -42,6 +43,7 @@
 import com.android.systemui.volume.dialog.ringer.ui.viewmodel.VolumeDialogRingerDrawerViewModel
 import com.android.systemui.volume.dialog.ui.utils.suspendAnimate
 import javax.inject.Inject
+import kotlin.properties.Delegates
 import kotlinx.coroutines.CoroutineScope
 import kotlinx.coroutines.coroutineScope
 import kotlinx.coroutines.flow.launchIn
@@ -71,6 +73,27 @@
         val drawerContainer = view.requireViewById<MotionLayout>(R.id.volume_ringer_drawer)
         val unselectedButtonUiModel = RingerButtonUiModel.getUnselectedButton(view.context)
         val selectedButtonUiModel = RingerButtonUiModel.getSelectedButton(view.context)
+        val volumeDialogBgSmallRadius =
+            view.context.resources.getDimensionPixelSize(
+                R.dimen.volume_dialog_background_square_corner_radius
+            )
+        val volumeDialogBgFullRadius =
+            view.context.resources.getDimensionPixelSize(
+                R.dimen.volume_dialog_background_corner_radius
+            )
+        var backgroundAnimationProgress: Float by
+            Delegates.observable(0F) { _, _, progress ->
+                volumeDialogBackgroundView.applyCorners(
+                    fullRadius = volumeDialogBgFullRadius,
+                    diff = volumeDialogBgFullRadius - volumeDialogBgSmallRadius,
+                    progress,
+                )
+            }
+        val ringerDrawerTransitionListener = VolumeDialogRingerDrawerTransitionListener {
+            backgroundAnimationProgress = it
+        }
+        drawerContainer.setTransitionListener(ringerDrawerTransitionListener)
+        volumeDialogBackgroundView.background = volumeDialogBackgroundView.background.mutate()
         viewModel.ringerViewModel
             .onEach { ringerState ->
                 when (ringerState) {
@@ -87,10 +110,8 @@
                                     selectedButtonUiModel,
                                     unselectedButtonUiModel,
                                 )
+                                ringerDrawerTransitionListener.setProgressChangeEnabled(true)
                                 drawerContainer.closeDrawer(uiModel.currentButtonIndex)
-                                volumeDialogBackgroundView.setBackgroundResource(
-                                    R.drawable.volume_dialog_background
-                                )
                             }
 
                             is RingerDrawerState.Closed -> {
@@ -103,11 +124,31 @@
                                         uiModel,
                                         selectedButtonUiModel,
                                         unselectedButtonUiModel,
+                                        onProgressChanged = { progress, isReverse ->
+                                            // Let's make button progress when switching matches
+                                            // motionLayout transition progress. When full radius,
+                                            // progress is 0.0. When small radius, progress is 1.0.
+                                            backgroundAnimationProgress =
+                                                if (isReverse) {
+                                                    1F - progress
+                                                } else {
+                                                    progress
+                                                }
+                                        },
                                     ) {
+                                        if (
+                                            uiModel.currentButtonIndex ==
+                                                uiModel.availableButtons.size - 1
+                                        ) {
+                                            ringerDrawerTransitionListener.setProgressChangeEnabled(
+                                                false
+                                            )
+                                        } else {
+                                            ringerDrawerTransitionListener.setProgressChangeEnabled(
+                                                true
+                                            )
+                                        }
                                         drawerContainer.closeDrawer(uiModel.currentButtonIndex)
-                                        volumeDialogBackgroundView.setBackgroundResource(
-                                            R.drawable.volume_dialog_background
-                                        )
                                     }
                                 }
                             }
@@ -120,16 +161,18 @@
                                     unselectedButtonUiModel,
                                 )
                                 // Open drawer
+                                if (
+                                    uiModel.currentButtonIndex == uiModel.availableButtons.size - 1
+                                ) {
+                                    ringerDrawerTransitionListener.setProgressChangeEnabled(false)
+                                } else {
+                                    ringerDrawerTransitionListener.setProgressChangeEnabled(true)
+                                }
                                 drawerContainer.transitionToState(
                                     R.id.volume_dialog_ringer_drawer_open
                                 )
-                                if (
-                                    uiModel.currentButtonIndex != uiModel.availableButtons.size - 1
-                                ) {
-                                    volumeDialogBackgroundView.setBackgroundResource(
-                                        R.drawable.volume_dialog_background_small_radius
-                                    )
-                                }
+                                volumeDialogBackgroundView.background =
+                                    volumeDialogBackgroundView.background.mutate()
                             }
                         }
                     }
@@ -150,6 +193,7 @@
         uiModel: RingerViewModel,
         selectedButtonUiModel: RingerButtonUiModel,
         unselectedButtonUiModel: RingerButtonUiModel,
+        onProgressChanged: (Float, Boolean) -> Unit = { _, _ -> },
         onAnimationEnd: Runnable? = null,
     ) {
         ensureChildCount(R.layout.volume_ringer_button, uiModel.availableButtons.size)
@@ -177,10 +221,26 @@
                         CLOSE_DRAWER_DELAY,
                     )
                 }
-
-            // We only need to execute on roundness animation end once.
-            selectedButton.animateTo(selectedButtonUiModel, roundnessAnimationEndListener)
-            unselectedButton.animateTo(unselectedButtonUiModel)
+            // We only need to execute on roundness animation end and volume dialog background
+            // progress update once because these changes should be applied once on volume dialog
+            // background and ringer drawer views.
+            selectedButton.animateTo(
+                selectedButtonUiModel,
+                if (uiModel.currentButtonIndex == count - 1) {
+                    onProgressChanged
+                } else {
+                    { _, _ -> }
+                },
+                roundnessAnimationEndListener,
+            )
+            unselectedButton.animateTo(
+                unselectedButtonUiModel,
+                if (previousIndex == count - 1) {
+                    onProgressChanged
+                } else {
+                    { _, _ -> }
+                },
+            )
         } else {
             bindButtons(viewModel, uiModel, onAnimationEnd)
         }
@@ -366,6 +426,7 @@
 
     private suspend fun ImageButton.animateTo(
         ringerButtonUiModel: RingerButtonUiModel,
+        onProgressChanged: (Float, Boolean) -> Unit = { _, _ -> },
         roundnessAnimationEndListener: DynamicAnimation.OnAnimationEndListener? = null,
     ) {
         val roundnessAnimation =
@@ -376,6 +437,7 @@
             ringerButtonUiModel.cornerRadius - (background as GradientDrawable).cornerRadius
         val roundnessAnimationUpdateListener =
             DynamicAnimation.OnAnimationUpdateListener { _, value, _ ->
+                onProgressChanged(value, cornerRadiusDiff > 0F)
                 (background as GradientDrawable).cornerRadius = radius + value * cornerRadiusDiff
                 background.invalidateSelf()
             }
@@ -406,4 +468,9 @@
             )
         }
     }
+
+    private fun View.applyCorners(fullRadius: Int, diff: Int, progress: Float) {
+        (background as GradientDrawable).cornerRadius = fullRadius - progress * diff
+        background.invalidateSelf()
+    }
 }
diff --git a/packages/SystemUI/src/com/android/systemui/volume/dialog/ringer/ui/util/VolumeDialogRingerDrawerTransitionListener.kt b/packages/SystemUI/src/com/android/systemui/volume/dialog/ringer/ui/util/VolumeDialogRingerDrawerTransitionListener.kt
new file mode 100644
index 0000000..6e3db0a
--- /dev/null
+++ b/packages/SystemUI/src/com/android/systemui/volume/dialog/ringer/ui/util/VolumeDialogRingerDrawerTransitionListener.kt
@@ -0,0 +1,51 @@
+/*
+ * 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.dialog.ringer.ui.util
+
+import androidx.constraintlayout.motion.widget.MotionLayout
+
+class VolumeDialogRingerDrawerTransitionListener(private val onProgressChanged: (Float) -> Unit) :
+    MotionLayout.TransitionListener {
+
+    private var notifyProgressChangeEnabled = true
+
+    fun setProgressChangeEnabled(enabled: Boolean) {
+        notifyProgressChangeEnabled = enabled
+    }
+
+    override fun onTransitionStarted(motionLayout: MotionLayout?, startId: Int, endId: Int) {}
+
+    override fun onTransitionChange(
+        motionLayout: MotionLayout?,
+        startId: Int,
+        endId: Int,
+        progress: Float,
+    ) {
+        if (notifyProgressChangeEnabled) {
+            onProgressChanged(progress)
+        }
+    }
+
+    override fun onTransitionCompleted(motionLayout: MotionLayout?, currentId: Int) {}
+
+    override fun onTransitionTrigger(
+        motionLayout: MotionLayout?,
+        triggerId: Int,
+        positive: Boolean,
+        progress: Float,
+    ) {}
+}
diff --git a/packages/SystemUI/src/com/android/systemui/volume/dialog/ringer/ui/viewmodel/VolumeDialogRingerDrawerViewModel.kt b/packages/SystemUI/src/com/android/systemui/volume/dialog/ringer/ui/viewmodel/VolumeDialogRingerDrawerViewModel.kt
index e646636..627d75e 100644
--- a/packages/SystemUI/src/com/android/systemui/volume/dialog/ringer/ui/viewmodel/VolumeDialogRingerDrawerViewModel.kt
+++ b/packages/SystemUI/src/com/android/systemui/volume/dialog/ringer/ui/viewmodel/VolumeDialogRingerDrawerViewModel.kt
@@ -21,10 +21,13 @@
 import android.media.AudioManager.RINGER_MODE_NORMAL
 import android.media.AudioManager.RINGER_MODE_SILENT
 import android.media.AudioManager.RINGER_MODE_VIBRATE
+import android.media.AudioManager.STREAM_RING
 import android.os.VibrationEffect
 import android.widget.Toast
 import com.android.internal.R as internalR
 import com.android.settingslib.Utils
+import com.android.settingslib.notification.domain.interactor.NotificationsSoundPolicyInteractor
+import com.android.settingslib.volume.shared.model.AudioStream
 import com.android.settingslib.volume.shared.model.RingerMode
 import com.android.systemui.dagger.qualifiers.Application
 import com.android.systemui.dagger.qualifiers.Background
@@ -57,7 +60,8 @@
     @Application private val applicationContext: Context,
     @VolumeDialog private val coroutineScope: CoroutineScope,
     @Background private val backgroundDispatcher: CoroutineDispatcher,
-    private val interactor: VolumeDialogRingerInteractor,
+    soundPolicyInteractor: NotificationsSoundPolicyInteractor,
+    private val ringerInteractor: VolumeDialogRingerInteractor,
     private val vibrator: VibratorHelper,
     private val volumeDialogLogger: VolumeDialogLogger,
     private val visibilityInteractor: VolumeDialogVisibilityInteractor,
@@ -66,10 +70,14 @@
     private val drawerState = MutableStateFlow<RingerDrawerState>(RingerDrawerState.Initial)
 
     val ringerViewModel: StateFlow<RingerViewModelState> =
-        combine(interactor.ringerModel, drawerState) { ringerModel, state ->
+        combine(
+                soundPolicyInteractor.isZenMuted(AudioStream(STREAM_RING)),
+                ringerInteractor.ringerModel,
+                drawerState,
+            ) { isZenMuted, ringerModel, state ->
                 level = ringerModel.level
                 levelMax = ringerModel.levelMax
-                ringerModel.toViewModel(state)
+                ringerModel.toViewModel(state, isZenMuted)
             }
             .flowOn(backgroundDispatcher)
             .stateIn(coroutineScope, SharingStarted.Eagerly, RingerViewModelState.Unavailable)
@@ -90,7 +98,7 @@
             Events.writeEvent(Events.EVENT_RINGER_TOGGLE, ringerMode.value)
             provideTouchFeedback(ringerMode)
             maybeShowToast(ringerMode)
-            interactor.setRingerMode(ringerMode)
+            ringerInteractor.setRingerMode(ringerMode)
         }
         visibilityInteractor.resetDismissTimeout()
         drawerState.value =
@@ -113,7 +121,7 @@
     private fun provideTouchFeedback(ringerMode: RingerMode) {
         when (ringerMode.value) {
             RINGER_MODE_NORMAL -> {
-                interactor.scheduleTouchFeedback()
+                ringerInteractor.scheduleTouchFeedback()
                 null
             }
             RINGER_MODE_SILENT -> VibrationEffect.get(VibrationEffect.EFFECT_CLICK)
@@ -123,7 +131,8 @@
     }
 
     private fun VolumeDialogRingerModel.toViewModel(
-        drawerState: RingerDrawerState
+        drawerState: RingerDrawerState,
+        isZenMuted: Boolean,
     ): RingerViewModelState {
         val currentIndex = availableModes.indexOf(currentRingerMode)
         if (currentIndex == -1) {
@@ -132,10 +141,11 @@
         return if (currentIndex == -1 || isSingleVolume) {
             RingerViewModelState.Unavailable
         } else {
-            toButtonViewModel(currentRingerMode, isSelectedButton = true)?.let {
+            toButtonViewModel(currentRingerMode, isZenMuted, isSelectedButton = true)?.let {
                 RingerViewModelState.Available(
                     RingerViewModel(
-                        availableButtons = availableModes.map { mode -> toButtonViewModel(mode) },
+                        availableButtons =
+                            availableModes.map { mode -> toButtonViewModel(mode, isZenMuted) },
                         currentButtonIndex = currentIndex,
                         selectedButton = it,
                         drawerState = drawerState,
@@ -147,6 +157,7 @@
 
     private fun VolumeDialogRingerModel.toButtonViewModel(
         ringerMode: RingerMode,
+        isZenMuted: Boolean,
         isSelectedButton: Boolean = false,
     ): RingerButtonViewModel? {
         return when (ringerMode.value) {
@@ -176,7 +187,7 @@
                 )
             RINGER_MODE_NORMAL ->
                 when {
-                    isMuted && isEnabled ->
+                    isMuted && !isZenMuted ->
                         RingerButtonViewModel(
                             imageResId =
                                 if (isSelectedButton) {
@@ -226,7 +237,7 @@
 
     private fun maybeShowToast(ringerMode: RingerMode) {
         coroutineScope.launch {
-            val seenToastCount = interactor.getToastCount()
+            val seenToastCount = ringerInteractor.getToastCount()
             if (seenToastCount > SHOW_RINGER_TOAST_COUNT) {
                 return@launch
             }
@@ -260,7 +271,7 @@
                         )
                 }
             toastText?.let { Toast.makeText(applicationContext, it, Toast.LENGTH_SHORT).show() }
-            interactor.updateToastCount(seenToastCount)
+            ringerInteractor.updateToastCount(seenToastCount)
         }
     }
 }
diff --git a/packages/SystemUI/src/com/android/systemui/volume/dialog/sliders/ui/VolumeDialogSliderViewBinder.kt b/packages/SystemUI/src/com/android/systemui/volume/dialog/sliders/ui/VolumeDialogSliderViewBinder.kt
index e52bad9..f305246 100644
--- a/packages/SystemUI/src/com/android/systemui/volume/dialog/sliders/ui/VolumeDialogSliderViewBinder.kt
+++ b/packages/SystemUI/src/com/android/systemui/volume/dialog/sliders/ui/VolumeDialogSliderViewBinder.kt
@@ -18,11 +18,12 @@
 
 import android.animation.Animator
 import android.animation.ObjectAnimator
+import android.annotation.SuppressLint
 import android.view.View
 import android.view.animation.DecelerateInterpolator
 import com.android.systemui.res.R
-import com.android.systemui.volume.dialog.shared.model.VolumeDialogStreamModel
 import com.android.systemui.volume.dialog.sliders.dagger.VolumeDialogSliderScope
+import com.android.systemui.volume.dialog.sliders.ui.viewmodel.VolumeDialogSliderStateModel
 import com.android.systemui.volume.dialog.sliders.ui.viewmodel.VolumeDialogSliderViewModel
 import com.android.systemui.volume.dialog.ui.utils.JankListenerFactory
 import com.android.systemui.volume.dialog.ui.utils.awaitAnimation
@@ -48,24 +49,27 @@
         val sliderView: Slider =
             view.requireViewById<Slider>(R.id.volume_dialog_slider).apply {
                 labelBehavior = LabelFormatter.LABEL_GONE
+                trackIconActiveColor = trackInactiveTintList
             }
         sliderView.addOnChangeListener { _, value, fromUser ->
             viewModel.setStreamVolume(value.roundToInt(), fromUser)
         }
 
-        viewModel.model.onEach { it.bindToSlider(sliderView) }.launchIn(this)
+        viewModel.state.onEach { it.bindToSlider(sliderView) }.launchIn(this)
     }
 
-    private suspend fun VolumeDialogStreamModel.bindToSlider(slider: Slider) {
+    @SuppressLint("UseCompatLoadingForDrawables")
+    private suspend fun VolumeDialogSliderStateModel.bindToSlider(slider: Slider) {
         with(slider) {
-            valueFrom = levelMin.toFloat()
-            valueTo = levelMax.toFloat()
+            valueFrom = minValue
+            valueTo = maxValue
             // coerce the current value to the new value range before animating it
             value = value.coerceIn(valueFrom, valueTo)
             setValueAnimated(
-                level.toFloat(),
+                value,
                 jankListenerFactory.update(this, PROGRESS_CHANGE_ANIMATION_DURATION_MS),
             )
+            trackIconActiveEnd = context.getDrawable(iconRes)
         }
     }
 }
diff --git a/packages/SystemUI/src/com/android/systemui/volume/dialog/sliders/ui/viewmodel/VolumeDialogSliderIconProvider.kt b/packages/SystemUI/src/com/android/systemui/volume/dialog/sliders/ui/viewmodel/VolumeDialogSliderIconProvider.kt
new file mode 100644
index 0000000..5c39b6f
--- /dev/null
+++ b/packages/SystemUI/src/com/android/systemui/volume/dialog/sliders/ui/viewmodel/VolumeDialogSliderIconProvider.kt
@@ -0,0 +1,122 @@
+/*
+ * 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.dialog.sliders.ui.viewmodel
+
+import android.media.AudioManager
+import androidx.annotation.DrawableRes
+import com.android.settingslib.notification.domain.interactor.NotificationsSoundPolicyInteractor
+import com.android.settingslib.volume.domain.interactor.AudioVolumeInteractor
+import com.android.settingslib.volume.shared.model.AudioStream
+import com.android.settingslib.volume.shared.model.RingerMode
+import com.android.systemui.res.R
+import javax.inject.Inject
+import kotlinx.coroutines.flow.Flow
+import kotlinx.coroutines.flow.combine
+import kotlinx.coroutines.flow.flowOf
+
+class VolumeDialogSliderIconProvider
+@Inject
+constructor(
+    private val notificationsSoundPolicyInteractor: NotificationsSoundPolicyInteractor,
+    private val audioVolumeInteractor: AudioVolumeInteractor,
+) {
+
+    @DrawableRes
+    fun getStreamIcon(
+        stream: Int,
+        level: Int,
+        levelMin: Int,
+        levelMax: Int,
+        isMuted: Boolean,
+        isRoutedToBluetooth: Boolean,
+    ): Flow<Int> {
+        return combine(
+            notificationsSoundPolicyInteractor.isZenMuted(AudioStream(stream)),
+            ringerModeForStream(stream),
+        ) { isZenMuted, ringerMode ->
+            val isStreamOffline = level == 0 || isMuted
+            if (isZenMuted) {
+                // TODO(b/372466264) use icon for the corresponding zenmode
+                return@combine com.android.internal.R.drawable.ic_qs_dnd
+            }
+            when (ringerMode?.value) {
+                AudioManager.RINGER_MODE_VIBRATE ->
+                    return@combine R.drawable.ic_volume_ringer_vibrate
+                AudioManager.RINGER_MODE_SILENT -> return@combine R.drawable.ic_ring_volume_off
+            }
+            if (isRoutedToBluetooth) {
+                return@combine if (stream == AudioManager.STREAM_VOICE_CALL) {
+                    R.drawable.ic_volume_bt_sco
+                } else {
+                    if (isStreamOffline) {
+                        R.drawable.ic_volume_media_bt_mute
+                    } else {
+                        R.drawable.ic_volume_media_bt
+                    }
+                }
+            }
+
+            return@combine if (isStreamOffline) {
+                getMutedIconForStream(stream) ?: getIconForStream(stream)
+            } else {
+                if (level < (levelMax + levelMin) / 2) {
+                    // This icon is different on TV
+                    R.drawable.ic_volume_media_low
+                } else {
+                    getIconForStream(stream)
+                }
+            }
+        }
+    }
+
+    @DrawableRes
+    private fun getMutedIconForStream(stream: Int): Int? {
+        return when (stream) {
+            AudioManager.STREAM_MUSIC -> R.drawable.ic_volume_media_mute
+            AudioManager.STREAM_NOTIFICATION -> R.drawable.ic_volume_ringer_mute
+            AudioManager.STREAM_ALARM -> R.drawable.ic_volume_alarm_mute
+            AudioManager.STREAM_SYSTEM -> R.drawable.ic_volume_system_mute
+            else -> null
+        }
+    }
+
+    @DrawableRes
+    private fun getIconForStream(stream: Int): Int {
+        return when (stream) {
+            AudioManager.STREAM_ACCESSIBILITY -> R.drawable.ic_volume_accessibility
+            AudioManager.STREAM_MUSIC -> R.drawable.ic_volume_media
+            AudioManager.STREAM_RING -> R.drawable.ic_ring_volume
+            AudioManager.STREAM_NOTIFICATION -> R.drawable.ic_volume_ringer
+            AudioManager.STREAM_ALARM -> R.drawable.ic_alarm
+            AudioManager.STREAM_VOICE_CALL -> com.android.internal.R.drawable.ic_phone
+            AudioManager.STREAM_SYSTEM -> R.drawable.ic_volume_system
+            else -> error("Unsupported stream: $stream")
+        }
+    }
+
+    /**
+     * Emits [RingerMode] for the [stream] if it's affecting it and null when [RingerMode] doesn't
+     * affect the [stream]
+     */
+    private fun ringerModeForStream(stream: Int): Flow<RingerMode?> {
+        return if (stream == AudioManager.STREAM_RING) {
+            audioVolumeInteractor.ringerMode
+        } else {
+            flowOf(null)
+        }
+    }
+}
diff --git a/packages/SystemUI/src/com/android/systemui/volume/dialog/sliders/ui/viewmodel/VolumeDialogSliderStateModel.kt b/packages/SystemUI/src/com/android/systemui/volume/dialog/sliders/ui/viewmodel/VolumeDialogSliderStateModel.kt
new file mode 100644
index 0000000..5750c04
--- /dev/null
+++ b/packages/SystemUI/src/com/android/systemui/volume/dialog/sliders/ui/viewmodel/VolumeDialogSliderStateModel.kt
@@ -0,0 +1,36 @@
+/*
+ * 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.dialog.sliders.ui.viewmodel
+
+import androidx.annotation.DrawableRes
+import com.android.systemui.volume.dialog.shared.model.VolumeDialogStreamModel
+
+data class VolumeDialogSliderStateModel(
+    val minValue: Float,
+    val maxValue: Float,
+    val value: Float,
+    @DrawableRes val iconRes: Int,
+)
+
+fun VolumeDialogStreamModel.toStateModel(@DrawableRes iconRes: Int): VolumeDialogSliderStateModel {
+    return VolumeDialogSliderStateModel(
+        minValue = levelMin.toFloat(),
+        value = level.toFloat(),
+        maxValue = levelMax.toFloat(),
+        iconRes = iconRes,
+    )
+}
diff --git a/packages/SystemUI/src/com/android/systemui/volume/dialog/sliders/ui/viewmodel/VolumeDialogSliderViewModel.kt b/packages/SystemUI/src/com/android/systemui/volume/dialog/sliders/ui/viewmodel/VolumeDialogSliderViewModel.kt
index 6dd5b63..2d56524 100644
--- a/packages/SystemUI/src/com/android/systemui/volume/dialog/sliders/ui/viewmodel/VolumeDialogSliderViewModel.kt
+++ b/packages/SystemUI/src/com/android/systemui/volume/dialog/sliders/ui/viewmodel/VolumeDialogSliderViewModel.kt
@@ -32,7 +32,9 @@
 import kotlinx.coroutines.flow.filter
 import kotlinx.coroutines.flow.filterNotNull
 import kotlinx.coroutines.flow.first
+import kotlinx.coroutines.flow.flatMapLatest
 import kotlinx.coroutines.flow.launchIn
+import kotlinx.coroutines.flow.map
 import kotlinx.coroutines.flow.mapLatest
 import kotlinx.coroutines.flow.stateIn
 
@@ -56,12 +58,12 @@
     private val interactor: VolumeDialogSliderInteractor,
     private val visibilityInteractor: VolumeDialogVisibilityInteractor,
     @VolumeDialog private val coroutineScope: CoroutineScope,
+    private val volumeDialogSliderIconProvider: VolumeDialogSliderIconProvider,
     private val systemClock: SystemClock,
 ) {
 
     private val userVolumeUpdates = MutableStateFlow<VolumeUpdate?>(null)
-
-    val model: Flow<VolumeDialogStreamModel> =
+    private val model: Flow<VolumeDialogStreamModel> =
         interactor.slider
             .filter {
                 val lastVolumeUpdateTime = userVolumeUpdates.value?.timestampMillis ?: 0
@@ -70,6 +72,21 @@
             .stateIn(coroutineScope, SharingStarted.Eagerly, null)
             .filterNotNull()
 
+    val state: Flow<VolumeDialogSliderStateModel> =
+        model.flatMapLatest { streamModel ->
+            with(streamModel) {
+                    volumeDialogSliderIconProvider.getStreamIcon(
+                        stream = stream,
+                        level = level,
+                        levelMin = levelMin,
+                        levelMax = levelMax,
+                        isMuted = muted,
+                        isRoutedToBluetooth = routedToBluetooth,
+                    )
+                }
+                .map { icon -> streamModel.toStateModel(icon) }
+        }
+
     init {
         userVolumeUpdates
             .filterNotNull()
diff --git a/packages/SystemUI/tests/src/com/android/keyguard/ClockEventControllerTest.kt b/packages/SystemUI/tests/src/com/android/keyguard/ClockEventControllerTest.kt
index f347d48..a41725f 100644
--- a/packages/SystemUI/tests/src/com/android/keyguard/ClockEventControllerTest.kt
+++ b/packages/SystemUI/tests/src/com/android/keyguard/ClockEventControllerTest.kt
@@ -529,6 +529,8 @@
     fun listenForDnd_onDndChange_updatesClockZenMode() =
         testScope.runTest {
             underTest.listenForDnd(testScope.backgroundScope)
+            runCurrent()
+            clearInvocations(events)
 
             zenModeRepository.activateMode(dndModeId)
             runCurrent()
@@ -537,7 +539,6 @@
                 .onZenDataChanged(
                     eq(ZenData(ZenMode.IMPORTANT_INTERRUPTIONS, R.string::dnd_is_on.name))
                 )
-            clearInvocations(events)
 
             zenModeRepository.deactivateMode(dndModeId)
             runCurrent()
diff --git a/packages/SystemUI/tests/src/com/android/systemui/education/domain/interactor/KeyboardTouchpadEduInteractorParameterizedTest.kt b/packages/SystemUI/tests/src/com/android/systemui/education/domain/interactor/KeyboardTouchpadEduInteractorParameterizedTest.kt
new file mode 100644
index 0000000..d7fcb6a
--- /dev/null
+++ b/packages/SystemUI/tests/src/com/android/systemui/education/domain/interactor/KeyboardTouchpadEduInteractorParameterizedTest.kt
@@ -0,0 +1,471 @@
+/*
+ * Copyright 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.education.domain.interactor
+
+import android.content.pm.UserInfo
+import androidx.test.filters.SmallTest
+import com.android.systemui.SysuiTestCase
+import com.android.systemui.contextualeducation.GestureType
+import com.android.systemui.contextualeducation.GestureType.ALL_APPS
+import com.android.systemui.contextualeducation.GestureType.BACK
+import com.android.systemui.contextualeducation.GestureType.HOME
+import com.android.systemui.contextualeducation.GestureType.OVERVIEW
+import com.android.systemui.coroutines.collectLastValue
+import com.android.systemui.coroutines.collectValues
+import com.android.systemui.education.data.model.GestureEduModel
+import com.android.systemui.education.data.repository.contextualEducationRepository
+import com.android.systemui.education.data.repository.fakeEduClock
+import com.android.systemui.education.shared.model.EducationUiType
+import com.android.systemui.inputdevice.tutorial.data.repository.DeviceType
+import com.android.systemui.inputdevice.tutorial.tutorialSchedulerRepository
+import com.android.systemui.keyboard.data.repository.keyboardRepository
+import com.android.systemui.kosmos.testScope
+import com.android.systemui.recents.OverviewProxyService.OverviewProxyListener
+import com.android.systemui.testKosmos
+import com.android.systemui.touchpad.data.repository.touchpadRepository
+import com.android.systemui.user.data.repository.fakeUserRepository
+import com.google.common.truth.Truth.assertThat
+import kotlin.time.Duration.Companion.hours
+import kotlin.time.Duration.Companion.seconds
+import kotlinx.coroutines.launch
+import kotlinx.coroutines.test.TestScope
+import kotlinx.coroutines.test.runCurrent
+import kotlinx.coroutines.test.runTest
+import org.junit.After
+import org.junit.Assume.assumeTrue
+import org.junit.Before
+import org.junit.Test
+import org.junit.runner.RunWith
+import org.mockito.kotlin.argumentCaptor
+import org.mockito.kotlin.verify
+import platform.test.runner.parameterized.ParameterizedAndroidJunit4
+import platform.test.runner.parameterized.Parameters
+
+@SmallTest
+@RunWith(ParameterizedAndroidJunit4::class)
+@kotlinx.coroutines.ExperimentalCoroutinesApi
+class KeyboardTouchpadEduInteractorParameterizedTest(private val gestureType: GestureType) :
+    SysuiTestCase() {
+    private val kosmos = testKosmos()
+    private val testScope = kosmos.testScope
+    private val contextualEduInteractor = kosmos.contextualEducationInteractor
+    private val repository = kosmos.contextualEducationRepository
+    private val touchpadRepository = kosmos.touchpadRepository
+    private val keyboardRepository = kosmos.keyboardRepository
+    private val tutorialSchedulerRepository = kosmos.tutorialSchedulerRepository
+    private val userRepository = kosmos.fakeUserRepository
+    private val overviewProxyService = kosmos.mockOverviewProxyService
+
+    private val underTest: KeyboardTouchpadEduInteractor = kosmos.keyboardTouchpadEduInteractor
+    private val eduClock = kosmos.fakeEduClock
+    private val minDurationForNextEdu =
+        KeyboardTouchpadEduInteractor.minIntervalBetweenEdu + 1.seconds
+    private val initialDelayElapsedDuration =
+        KeyboardTouchpadEduInteractor.initialDelayDuration + 1.seconds
+
+    @Before
+    fun setup() {
+        underTest.start()
+        contextualEduInteractor.start()
+        userRepository.setUserInfos(USER_INFOS)
+        testScope.launch {
+            contextualEduInteractor.updateKeyboardFirstConnectionTime()
+            contextualEduInteractor.updateTouchpadFirstConnectionTime()
+        }
+    }
+
+    @Test
+    fun newEducationInfoOnMaxSignalCountReached() =
+        testScope.runTest {
+            triggerMaxEducationSignals(gestureType)
+            val model by collectLastValue(underTest.educationTriggered)
+
+            assertThat(model?.gestureType).isEqualTo(gestureType)
+        }
+
+    @Test
+    fun newEducationToastOn1stEducation() =
+        testScope.runTest {
+            val model by collectLastValue(underTest.educationTriggered)
+            triggerMaxEducationSignals(gestureType)
+
+            assertThat(model?.educationUiType).isEqualTo(EducationUiType.Toast)
+        }
+
+    @Test
+    fun newEducationNotificationOn2ndEducation() =
+        testScope.runTest {
+            val model by collectLastValue(underTest.educationTriggered)
+            triggerMaxEducationSignals(gestureType)
+            // runCurrent() to trigger 1st education
+            runCurrent()
+
+            eduClock.offset(minDurationForNextEdu)
+            triggerMaxEducationSignals(gestureType)
+
+            assertThat(model?.educationUiType).isEqualTo(EducationUiType.Notification)
+        }
+
+    @Test
+    fun noEducationInfoBeforeMaxSignalCountReached() =
+        testScope.runTest {
+            contextualEduInteractor.incrementSignalCount(gestureType)
+            val model by collectLastValue(underTest.educationTriggered)
+            assertThat(model).isNull()
+        }
+
+    @Test
+    fun noEducationInfoWhenShortcutTriggeredPreviously() =
+        testScope.runTest {
+            val model by collectLastValue(underTest.educationTriggered)
+            contextualEduInteractor.updateShortcutTriggerTime(gestureType)
+            triggerMaxEducationSignals(gestureType)
+            assertThat(model).isNull()
+        }
+
+    @Test
+    fun no2ndEducationBeforeMinEduIntervalReached() =
+        testScope.runTest {
+            val models by collectValues(underTest.educationTriggered)
+            triggerMaxEducationSignals(gestureType)
+            runCurrent()
+
+            // Offset a duration that is less than the required education interval
+            eduClock.offset(1.seconds)
+            triggerMaxEducationSignals(gestureType)
+            runCurrent()
+
+            assertThat(models.filterNotNull().size).isEqualTo(1)
+        }
+
+    @Test
+    fun noNewEducationInfoAfterMaxEducationCountReached() =
+        testScope.runTest {
+            val models by collectValues(underTest.educationTriggered)
+            // Trigger 2 educations
+            triggerMaxEducationSignals(gestureType)
+            runCurrent()
+            eduClock.offset(minDurationForNextEdu)
+            triggerMaxEducationSignals(gestureType)
+            runCurrent()
+
+            // Try triggering 3rd education
+            eduClock.offset(minDurationForNextEdu)
+            triggerMaxEducationSignals(gestureType)
+
+            assertThat(models.filterNotNull().size).isEqualTo(2)
+        }
+
+    @Test
+    fun startNewUsageSessionWhen2ndSignalReceivedAfterSessionDeadline() =
+        testScope.runTest {
+            val model by
+                collectLastValue(
+                    kosmos.contextualEducationRepository.readGestureEduModelFlow(gestureType)
+                )
+            contextualEduInteractor.incrementSignalCount(gestureType)
+            eduClock.offset(KeyboardTouchpadEduInteractor.usageSessionDuration.plus(1.seconds))
+            val secondSignalReceivedTime = eduClock.instant()
+            contextualEduInteractor.incrementSignalCount(gestureType)
+
+            assertThat(model)
+                .isEqualTo(
+                    GestureEduModel(
+                        signalCount = 1,
+                        usageSessionStartTime = secondSignalReceivedTime,
+                        userId = 0,
+                        gestureType = gestureType,
+                    )
+                )
+        }
+
+    @Test
+    fun newTouchpadConnectionTimeOnFirstTouchpadConnected() =
+        testScope.runTest {
+            setIsAnyTouchpadConnected(true)
+            val model = contextualEduInteractor.getEduDeviceConnectionTime()
+            assertThat(model.touchpadFirstConnectionTime).isEqualTo(eduClock.instant())
+        }
+
+    @Test
+    fun unchangedTouchpadConnectionTimeOnSecondConnection() =
+        testScope.runTest {
+            val firstConnectionTime = eduClock.instant()
+            setIsAnyTouchpadConnected(true)
+            setIsAnyTouchpadConnected(false)
+
+            eduClock.offset(1.hours)
+            setIsAnyTouchpadConnected(true)
+
+            val model = contextualEduInteractor.getEduDeviceConnectionTime()
+            assertThat(model.touchpadFirstConnectionTime).isEqualTo(firstConnectionTime)
+        }
+
+    @Test
+    fun newTouchpadConnectionTimeOnUserChanged() =
+        testScope.runTest {
+            // Touchpad connected for user 0
+            setIsAnyTouchpadConnected(true)
+
+            // Change user
+            eduClock.offset(1.hours)
+            val newUserFirstConnectionTime = eduClock.instant()
+            userRepository.setSelectedUserInfo(USER_INFOS[0])
+            runCurrent()
+
+            val model = contextualEduInteractor.getEduDeviceConnectionTime()
+            assertThat(model.touchpadFirstConnectionTime).isEqualTo(newUserFirstConnectionTime)
+        }
+
+    @Test
+    fun newKeyboardConnectionTimeOnKeyboardConnected() =
+        testScope.runTest {
+            setIsAnyKeyboardConnected(true)
+            val model = contextualEduInteractor.getEduDeviceConnectionTime()
+            assertThat(model.keyboardFirstConnectionTime).isEqualTo(eduClock.instant())
+        }
+
+    @Test
+    fun unchangedKeyboardConnectionTimeOnSecondConnection() =
+        testScope.runTest {
+            val firstConnectionTime = eduClock.instant()
+            setIsAnyKeyboardConnected(true)
+            setIsAnyKeyboardConnected(false)
+
+            eduClock.offset(1.hours)
+            setIsAnyKeyboardConnected(true)
+
+            val model = contextualEduInteractor.getEduDeviceConnectionTime()
+            assertThat(model.keyboardFirstConnectionTime).isEqualTo(firstConnectionTime)
+        }
+
+    @Test
+    fun newKeyboardConnectionTimeOnUserChanged() =
+        testScope.runTest {
+            // Keyboard connected for user 0
+            setIsAnyKeyboardConnected(true)
+
+            // Change user
+            eduClock.offset(1.hours)
+            val newUserFirstConnectionTime = eduClock.instant()
+            userRepository.setSelectedUserInfo(USER_INFOS[0])
+            runCurrent()
+
+            val model = contextualEduInteractor.getEduDeviceConnectionTime()
+            assertThat(model.keyboardFirstConnectionTime).isEqualTo(newUserFirstConnectionTime)
+        }
+
+    @Test
+    fun updateShortcutTimeOnKeyboardShortcutTriggered() =
+        testScope.runTest {
+            // Only All Apps needs to update the keyboard shortcut
+            assumeTrue(gestureType == ALL_APPS)
+            kosmos.contextualEducationRepository.setKeyboardShortcutTriggered(ALL_APPS)
+
+            val model by
+                collectLastValue(
+                    kosmos.contextualEducationRepository.readGestureEduModelFlow(ALL_APPS)
+                )
+            assertThat(model?.lastShortcutTriggeredTime).isEqualTo(eduClock.instant())
+        }
+
+    @Test
+    fun dataUpdatedOnIncrementSignalCountWhenTouchpadConnected() =
+        testScope.runTest {
+            assumeTrue(gestureType != ALL_APPS)
+            setUpForInitialDelayElapse()
+            touchpadRepository.setIsAnyTouchpadConnected(true)
+
+            val model by collectLastValue(repository.readGestureEduModelFlow(gestureType))
+            val originalValue = model!!.signalCount
+            val listener = getOverviewProxyListener()
+            listener.updateContextualEduStats(/* isTrackpadGesture= */ false, gestureType)
+
+            assertThat(model?.signalCount).isEqualTo(originalValue + 1)
+        }
+
+    @Test
+    fun dataUnchangedOnIncrementSignalCountWhenTouchpadDisconnected() =
+        testScope.runTest {
+            setUpForInitialDelayElapse()
+            touchpadRepository.setIsAnyTouchpadConnected(false)
+
+            val model by collectLastValue(repository.readGestureEduModelFlow(gestureType))
+            val originalValue = model!!.signalCount
+            val listener = getOverviewProxyListener()
+            listener.updateContextualEduStats(/* isTrackpadGesture= */ false, gestureType)
+
+            assertThat(model?.signalCount).isEqualTo(originalValue)
+        }
+
+    @Test
+    fun dataUpdatedOnIncrementSignalCountWhenKeyboardConnected() =
+        testScope.runTest {
+            assumeTrue(gestureType == ALL_APPS)
+            setUpForInitialDelayElapse()
+            keyboardRepository.setIsAnyKeyboardConnected(true)
+
+            val model by collectLastValue(repository.readGestureEduModelFlow(gestureType))
+            val originalValue = model!!.signalCount
+            val listener = getOverviewProxyListener()
+            listener.updateContextualEduStats(/* isTrackpadGesture= */ false, gestureType)
+
+            assertThat(model?.signalCount).isEqualTo(originalValue + 1)
+        }
+
+    @Test
+    fun dataUnchangedOnIncrementSignalCountWhenKeyboardDisconnected() =
+        testScope.runTest {
+            setUpForInitialDelayElapse()
+            keyboardRepository.setIsAnyKeyboardConnected(false)
+
+            val model by collectLastValue(repository.readGestureEduModelFlow(gestureType))
+            val originalValue = model!!.signalCount
+            val listener = getOverviewProxyListener()
+            listener.updateContextualEduStats(/* isTrackpadGesture= */ false, gestureType)
+
+            assertThat(model?.signalCount).isEqualTo(originalValue)
+        }
+
+    @Test
+    fun dataAddedOnUpdateShortcutTriggerTime() =
+        testScope.runTest {
+            val model by collectLastValue(repository.readGestureEduModelFlow(gestureType))
+            assertThat(model?.lastShortcutTriggeredTime).isNull()
+
+            val listener = getOverviewProxyListener()
+            listener.updateContextualEduStats(/* isTrackpadGesture= */ true, gestureType)
+
+            assertThat(model?.lastShortcutTriggeredTime).isEqualTo(kosmos.fakeEduClock.instant())
+        }
+
+    @Test
+    fun dataUpdatedOnIncrementSignalCountAfterInitialDelay() =
+        testScope.runTest {
+            setUpForDeviceConnection()
+            tutorialSchedulerRepository.updateLaunchTime(DeviceType.TOUCHPAD, eduClock.instant())
+
+            val model by collectLastValue(repository.readGestureEduModelFlow(gestureType))
+            val originalValue = model!!.signalCount
+            eduClock.offset(initialDelayElapsedDuration)
+            val listener = getOverviewProxyListener()
+            listener.updateContextualEduStats(/* isTrackpadGesture= */ false, gestureType)
+
+            assertThat(model?.signalCount).isEqualTo(originalValue + 1)
+        }
+
+    @Test
+    fun dataUnchangedOnIncrementSignalCountBeforeInitialDelay() =
+        testScope.runTest {
+            setUpForDeviceConnection()
+            tutorialSchedulerRepository.updateLaunchTime(DeviceType.TOUCHPAD, eduClock.instant())
+
+            val model by collectLastValue(repository.readGestureEduModelFlow(gestureType))
+            val originalValue = model!!.signalCount
+            // No offset to the clock to simulate update before initial delay
+            val listener = getOverviewProxyListener()
+            listener.updateContextualEduStats(/* isTrackpadGesture= */ false, gestureType)
+
+            assertThat(model?.signalCount).isEqualTo(originalValue)
+        }
+
+    @Test
+    fun dataUnchangedOnIncrementSignalCountWithoutOobeLaunchTime() =
+        testScope.runTest {
+            // No update to OOBE launch time to simulate no OOBE is launched yet
+            setUpForDeviceConnection()
+
+            val model by collectLastValue(repository.readGestureEduModelFlow(gestureType))
+            val originalValue = model!!.signalCount
+            val listener = getOverviewProxyListener()
+            listener.updateContextualEduStats(/* isTrackpadGesture= */ false, gestureType)
+
+            assertThat(model?.signalCount).isEqualTo(originalValue)
+        }
+
+    private suspend fun setUpForInitialDelayElapse() {
+        tutorialSchedulerRepository.updateLaunchTime(DeviceType.TOUCHPAD, eduClock.instant())
+        tutorialSchedulerRepository.updateLaunchTime(DeviceType.KEYBOARD, eduClock.instant())
+        eduClock.offset(initialDelayElapsedDuration)
+    }
+
+    fun logMetricsForToastEducation() =
+        testScope.runTest {
+            triggerMaxEducationSignals(gestureType)
+            runCurrent()
+
+            verify(kosmos.mockEduMetricsLogger)
+                .logContextualEducationTriggered(gestureType, EducationUiType.Toast)
+        }
+
+    @Test
+    fun logMetricsForNotificationEducation() =
+        testScope.runTest {
+            triggerMaxEducationSignals(gestureType)
+            runCurrent()
+
+            eduClock.offset(minDurationForNextEdu)
+            triggerMaxEducationSignals(gestureType)
+            runCurrent()
+
+            verify(kosmos.mockEduMetricsLogger)
+                .logContextualEducationTriggered(gestureType, EducationUiType.Notification)
+        }
+
+    @After
+    fun clear() {
+        testScope.launch { tutorialSchedulerRepository.clear() }
+    }
+
+    private suspend fun triggerMaxEducationSignals(gestureType: GestureType) {
+        // Increment max number of signal to try triggering education
+        for (i in 1..KeyboardTouchpadEduInteractor.MAX_SIGNAL_COUNT) {
+            contextualEduInteractor.incrementSignalCount(gestureType)
+        }
+    }
+
+    private fun TestScope.setIsAnyTouchpadConnected(isConnected: Boolean) {
+        touchpadRepository.setIsAnyTouchpadConnected(isConnected)
+        runCurrent()
+    }
+
+    private fun TestScope.setIsAnyKeyboardConnected(isConnected: Boolean) {
+        keyboardRepository.setIsAnyKeyboardConnected(isConnected)
+        runCurrent()
+    }
+
+    private fun setUpForDeviceConnection() {
+        touchpadRepository.setIsAnyTouchpadConnected(true)
+        keyboardRepository.setIsAnyKeyboardConnected(true)
+    }
+
+    private fun getOverviewProxyListener(): OverviewProxyListener {
+        val listenerCaptor = argumentCaptor<OverviewProxyListener>()
+        verify(overviewProxyService).addCallback(listenerCaptor.capture())
+        return listenerCaptor.firstValue
+    }
+
+    companion object {
+        private val USER_INFOS = listOf(UserInfo(101, "Second User", 0))
+
+        @JvmStatic
+        @Parameters(name = "{0}")
+        fun getGestureTypes(): List<GestureType> {
+            return listOf(BACK, HOME, OVERVIEW, ALL_APPS)
+        }
+    }
+}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/education/domain/interactor/KeyboardTouchpadEduInteractorTest.kt b/packages/SystemUI/tests/src/com/android/systemui/education/domain/interactor/KeyboardTouchpadEduInteractorTest.kt
index 2a6d29c..580f631 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/education/domain/interactor/KeyboardTouchpadEduInteractorTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/education/domain/interactor/KeyboardTouchpadEduInteractorTest.kt
@@ -1,5 +1,5 @@
 /*
- * Copyright 2024 The Android Open Source Project
+ * 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.
@@ -16,19 +16,17 @@
 
 package com.android.systemui.education.domain.interactor
 
-import android.content.pm.UserInfo
+import androidx.test.ext.junit.runners.AndroidJUnit4
 import androidx.test.filters.SmallTest
 import com.android.systemui.SysuiTestCase
 import com.android.systemui.contextualeducation.GestureType
-import com.android.systemui.contextualeducation.GestureType.ALL_APPS
 import com.android.systemui.contextualeducation.GestureType.BACK
 import com.android.systemui.contextualeducation.GestureType.HOME
 import com.android.systemui.contextualeducation.GestureType.OVERVIEW
 import com.android.systemui.coroutines.collectLastValue
 import com.android.systemui.coroutines.collectValues
-import com.android.systemui.education.data.model.GestureEduModel
-import com.android.systemui.education.data.repository.contextualEducationRepository
 import com.android.systemui.education.data.repository.fakeEduClock
+import com.android.systemui.education.shared.model.EducationInfo
 import com.android.systemui.education.shared.model.EducationUiType
 import com.android.systemui.inputdevice.tutorial.data.repository.DeviceType
 import com.android.systemui.inputdevice.tutorial.tutorialSchedulerRepository
@@ -37,50 +35,42 @@
 import com.android.systemui.recents.OverviewProxyService.OverviewProxyListener
 import com.android.systemui.testKosmos
 import com.android.systemui.touchpad.data.repository.touchpadRepository
-import com.android.systemui.user.data.repository.fakeUserRepository
 import com.google.common.truth.Truth.assertThat
-import kotlin.time.Duration.Companion.hours
 import kotlin.time.Duration.Companion.seconds
+import kotlinx.coroutines.flow.filterNotNull
 import kotlinx.coroutines.launch
 import kotlinx.coroutines.test.TestScope
 import kotlinx.coroutines.test.runCurrent
 import kotlinx.coroutines.test.runTest
-import org.junit.After
-import org.junit.Assume.assumeTrue
 import org.junit.Before
 import org.junit.Test
 import org.junit.runner.RunWith
 import org.mockito.kotlin.argumentCaptor
 import org.mockito.kotlin.verify
-import platform.test.runner.parameterized.ParameterizedAndroidJunit4
-import platform.test.runner.parameterized.Parameters
 
 @SmallTest
-@RunWith(ParameterizedAndroidJunit4::class)
+@RunWith(AndroidJUnit4::class)
 @kotlinx.coroutines.ExperimentalCoroutinesApi
-class KeyboardTouchpadEduInteractorTest(private val gestureType: GestureType) : SysuiTestCase() {
+class KeyboardTouchpadEduInteractorTest : SysuiTestCase() {
     private val kosmos = testKosmos()
     private val testScope = kosmos.testScope
     private val contextualEduInteractor = kosmos.contextualEducationInteractor
-    private val repository = kosmos.contextualEducationRepository
     private val touchpadRepository = kosmos.touchpadRepository
     private val keyboardRepository = kosmos.keyboardRepository
     private val tutorialSchedulerRepository = kosmos.tutorialSchedulerRepository
-    private val userRepository = kosmos.fakeUserRepository
     private val overviewProxyService = kosmos.mockOverviewProxyService
 
     private val underTest: KeyboardTouchpadEduInteractor = kosmos.keyboardTouchpadEduInteractor
     private val eduClock = kosmos.fakeEduClock
-    private val minDurationForNextEdu =
-        KeyboardTouchpadEduInteractor.minIntervalBetweenEdu + 1.seconds
     private val initialDelayElapsedDuration =
         KeyboardTouchpadEduInteractor.initialDelayDuration + 1.seconds
+    private val minIntervalForEduNotification =
+        KeyboardTouchpadEduInteractor.minIntervalBetweenEdu + 1.seconds
 
     @Before
     fun setup() {
         underTest.start()
         contextualEduInteractor.start()
-        userRepository.setUserInfos(USER_INFOS)
         testScope.launch {
             contextualEduInteractor.updateKeyboardFirstConnectionTime()
             contextualEduInteractor.updateTouchpadFirstConnectionTime()
@@ -88,312 +78,76 @@
     }
 
     @Test
-    fun newEducationInfoOnMaxSignalCountReached() =
-        testScope.runTest {
-            triggerMaxEducationSignals(gestureType)
-            val model by collectLastValue(underTest.educationTriggered)
-
-            assertThat(model?.gestureType).isEqualTo(gestureType)
-        }
-
-    @Test
-    fun newEducationToastOn1stEducation() =
-        testScope.runTest {
-            val model by collectLastValue(underTest.educationTriggered)
-            triggerMaxEducationSignals(gestureType)
-
-            assertThat(model?.educationUiType).isEqualTo(EducationUiType.Toast)
-        }
-
-    @Test
-    fun newEducationNotificationOn2ndEducation() =
-        testScope.runTest {
-            val model by collectLastValue(underTest.educationTriggered)
-            triggerMaxEducationSignals(gestureType)
-            // runCurrent() to trigger 1st education
-            runCurrent()
-
-            eduClock.offset(minDurationForNextEdu)
-            triggerMaxEducationSignals(gestureType)
-
-            assertThat(model?.educationUiType).isEqualTo(EducationUiType.Notification)
-        }
-
-    @Test
-    fun noEducationInfoBeforeMaxSignalCountReached() =
-        testScope.runTest {
-            contextualEduInteractor.incrementSignalCount(gestureType)
-            val model by collectLastValue(underTest.educationTriggered)
-            assertThat(model).isNull()
-        }
-
-    @Test
-    fun noEducationInfoWhenShortcutTriggeredPreviously() =
-        testScope.runTest {
-            val model by collectLastValue(underTest.educationTriggered)
-            contextualEduInteractor.updateShortcutTriggerTime(gestureType)
-            triggerMaxEducationSignals(gestureType)
-            assertThat(model).isNull()
-        }
-
-    @Test
-    fun no2ndEducationBeforeMinEduIntervalReached() =
-        testScope.runTest {
-            val models by collectValues(underTest.educationTriggered)
-            triggerMaxEducationSignals(gestureType)
-            runCurrent()
-
-            // Offset a duration that is less than the required education interval
-            eduClock.offset(1.seconds)
-            triggerMaxEducationSignals(gestureType)
-            runCurrent()
-
-            assertThat(models.filterNotNull().size).isEqualTo(1)
-        }
-
-    @Test
-    fun noNewEducationInfoAfterMaxEducationCountReached() =
-        testScope.runTest {
-            val models by collectValues(underTest.educationTriggered)
-            // Trigger 2 educations
-            triggerMaxEducationSignals(gestureType)
-            runCurrent()
-            eduClock.offset(minDurationForNextEdu)
-            triggerMaxEducationSignals(gestureType)
-            runCurrent()
-
-            // Try triggering 3rd education
-            eduClock.offset(minDurationForNextEdu)
-            triggerMaxEducationSignals(gestureType)
-
-            assertThat(models.filterNotNull().size).isEqualTo(2)
-        }
-
-    @Test
-    fun startNewUsageSessionWhen2ndSignalReceivedAfterSessionDeadline() =
-        testScope.runTest {
-            val model by
-                collectLastValue(
-                    kosmos.contextualEducationRepository.readGestureEduModelFlow(gestureType)
-                )
-            contextualEduInteractor.incrementSignalCount(gestureType)
-            eduClock.offset(KeyboardTouchpadEduInteractor.usageSessionDuration.plus(1.seconds))
-            val secondSignalReceivedTime = eduClock.instant()
-            contextualEduInteractor.incrementSignalCount(gestureType)
-
-            assertThat(model)
-                .isEqualTo(
-                    GestureEduModel(
-                        signalCount = 1,
-                        usageSessionStartTime = secondSignalReceivedTime,
-                        userId = 0,
-                        gestureType = gestureType,
-                    )
-                )
-        }
-
-    @Test
-    fun newTouchpadConnectionTimeOnFirstTouchpadConnected() =
-        testScope.runTest {
-            setIsAnyTouchpadConnected(true)
-            val model = contextualEduInteractor.getEduDeviceConnectionTime()
-            assertThat(model.touchpadFirstConnectionTime).isEqualTo(eduClock.instant())
-        }
-
-    @Test
-    fun unchangedTouchpadConnectionTimeOnSecondConnection() =
-        testScope.runTest {
-            val firstConnectionTime = eduClock.instant()
-            setIsAnyTouchpadConnected(true)
-            setIsAnyTouchpadConnected(false)
-
-            eduClock.offset(1.hours)
-            setIsAnyTouchpadConnected(true)
-
-            val model = contextualEduInteractor.getEduDeviceConnectionTime()
-            assertThat(model.touchpadFirstConnectionTime).isEqualTo(firstConnectionTime)
-        }
-
-    @Test
-    fun newTouchpadConnectionTimeOnUserChanged() =
-        testScope.runTest {
-            // Touchpad connected for user 0
-            setIsAnyTouchpadConnected(true)
-
-            // Change user
-            eduClock.offset(1.hours)
-            val newUserFirstConnectionTime = eduClock.instant()
-            userRepository.setSelectedUserInfo(USER_INFOS[0])
-            runCurrent()
-
-            val model = contextualEduInteractor.getEduDeviceConnectionTime()
-            assertThat(model.touchpadFirstConnectionTime).isEqualTo(newUserFirstConnectionTime)
-        }
-
-    @Test
-    fun newKeyboardConnectionTimeOnKeyboardConnected() =
-        testScope.runTest {
-            setIsAnyKeyboardConnected(true)
-            val model = contextualEduInteractor.getEduDeviceConnectionTime()
-            assertThat(model.keyboardFirstConnectionTime).isEqualTo(eduClock.instant())
-        }
-
-    @Test
-    fun unchangedKeyboardConnectionTimeOnSecondConnection() =
-        testScope.runTest {
-            val firstConnectionTime = eduClock.instant()
-            setIsAnyKeyboardConnected(true)
-            setIsAnyKeyboardConnected(false)
-
-            eduClock.offset(1.hours)
-            setIsAnyKeyboardConnected(true)
-
-            val model = contextualEduInteractor.getEduDeviceConnectionTime()
-            assertThat(model.keyboardFirstConnectionTime).isEqualTo(firstConnectionTime)
-        }
-
-    @Test
-    fun newKeyboardConnectionTimeOnUserChanged() =
-        testScope.runTest {
-            // Keyboard connected for user 0
-            setIsAnyKeyboardConnected(true)
-
-            // Change user
-            eduClock.offset(1.hours)
-            val newUserFirstConnectionTime = eduClock.instant()
-            userRepository.setSelectedUserInfo(USER_INFOS[0])
-            runCurrent()
-
-            val model = contextualEduInteractor.getEduDeviceConnectionTime()
-            assertThat(model.keyboardFirstConnectionTime).isEqualTo(newUserFirstConnectionTime)
-        }
-
-    @Test
-    fun updateShortcutTimeOnKeyboardShortcutTriggered() =
-        testScope.runTest {
-            // Only All Apps needs to update the keyboard shortcut
-            assumeTrue(gestureType == ALL_APPS)
-            kosmos.contextualEducationRepository.setKeyboardShortcutTriggered(ALL_APPS)
-
-            val model by
-                collectLastValue(
-                    kosmos.contextualEducationRepository.readGestureEduModelFlow(ALL_APPS)
-                )
-            assertThat(model?.lastShortcutTriggeredTime).isEqualTo(eduClock.instant())
-        }
-
-    @Test
-    fun dataUpdatedOnIncrementSignalCountWhenTouchpadConnected() =
-        testScope.runTest {
-            assumeTrue(gestureType != ALL_APPS)
-            setUpForInitialDelayElapse()
-            touchpadRepository.setIsAnyTouchpadConnected(true)
-
-            val model by collectLastValue(repository.readGestureEduModelFlow(gestureType))
-            val originalValue = model!!.signalCount
-            val listener = getOverviewProxyListener()
-            listener.updateContextualEduStats(/* isTrackpadGesture= */ false, gestureType)
-
-            assertThat(model?.signalCount).isEqualTo(originalValue + 1)
-        }
-
-    @Test
-    fun dataUnchangedOnIncrementSignalCountWhenTouchpadDisconnected() =
-        testScope.runTest {
-            setUpForInitialDelayElapse()
-            touchpadRepository.setIsAnyTouchpadConnected(false)
-
-            val model by collectLastValue(repository.readGestureEduModelFlow(gestureType))
-            val originalValue = model!!.signalCount
-            val listener = getOverviewProxyListener()
-            listener.updateContextualEduStats(/* isTrackpadGesture= */ false, gestureType)
-
-            assertThat(model?.signalCount).isEqualTo(originalValue)
-        }
-
-    @Test
-    fun dataUpdatedOnIncrementSignalCountWhenKeyboardConnected() =
-        testScope.runTest {
-            assumeTrue(gestureType == ALL_APPS)
-            setUpForInitialDelayElapse()
-            keyboardRepository.setIsAnyKeyboardConnected(true)
-
-            val model by collectLastValue(repository.readGestureEduModelFlow(gestureType))
-            val originalValue = model!!.signalCount
-            val listener = getOverviewProxyListener()
-            listener.updateContextualEduStats(/* isTrackpadGesture= */ false, gestureType)
-
-            assertThat(model?.signalCount).isEqualTo(originalValue + 1)
-        }
-
-    @Test
-    fun dataUnchangedOnIncrementSignalCountWhenKeyboardDisconnected() =
-        testScope.runTest {
-            setUpForInitialDelayElapse()
-            keyboardRepository.setIsAnyKeyboardConnected(false)
-
-            val model by collectLastValue(repository.readGestureEduModelFlow(gestureType))
-            val originalValue = model!!.signalCount
-            val listener = getOverviewProxyListener()
-            listener.updateContextualEduStats(/* isTrackpadGesture= */ false, gestureType)
-
-            assertThat(model?.signalCount).isEqualTo(originalValue)
-        }
-
-    @Test
-    fun dataAddedOnUpdateShortcutTriggerTime() =
-        testScope.runTest {
-            val model by collectLastValue(repository.readGestureEduModelFlow(gestureType))
-            assertThat(model?.lastShortcutTriggeredTime).isNull()
-
-            val listener = getOverviewProxyListener()
-            listener.updateContextualEduStats(/* isTrackpadGesture= */ true, gestureType)
-
-            assertThat(model?.lastShortcutTriggeredTime).isEqualTo(kosmos.fakeEduClock.instant())
-        }
-
-    @Test
-    fun dataUpdatedOnIncrementSignalCountAfterInitialDelay() =
+    fun newEducationToastBeforeMaxToastsPerSessionTriggered() =
         testScope.runTest {
             setUpForDeviceConnection()
-            tutorialSchedulerRepository.updateLaunchTime(DeviceType.TOUCHPAD, eduClock.instant())
+            setUpForInitialDelayElapse()
+            val model by collectLastValue(underTest.educationTriggered)
 
-            val model by collectLastValue(repository.readGestureEduModelFlow(gestureType))
-            val originalValue = model!!.signalCount
-            eduClock.offset(initialDelayElapsedDuration)
-            val listener = getOverviewProxyListener()
-            listener.updateContextualEduStats(/* isTrackpadGesture= */ false, gestureType)
+            triggerEducation(HOME)
 
-            assertThat(model?.signalCount).isEqualTo(originalValue + 1)
+            assertThat(model).isEqualTo(EducationInfo(HOME, EducationUiType.Toast, userId = 0))
         }
 
     @Test
-    fun dataUnchangedOnIncrementSignalCountBeforeInitialDelay() =
+    fun noEducationToastAfterMaxToastsPerSessionTriggered() =
         testScope.runTest {
             setUpForDeviceConnection()
-            tutorialSchedulerRepository.updateLaunchTime(DeviceType.TOUCHPAD, eduClock.instant())
+            setUpForInitialDelayElapse()
+            val models by collectValues(underTest.educationTriggered.filterNotNull())
+            // Show two toasts of other gestures
+            triggerEducation(HOME)
+            triggerEducation(BACK)
 
-            val model by collectLastValue(repository.readGestureEduModelFlow(gestureType))
-            val originalValue = model!!.signalCount
-            // No offset to the clock to simulate update before initial delay
-            val listener = getOverviewProxyListener()
-            listener.updateContextualEduStats(/* isTrackpadGesture= */ false, gestureType)
+            triggerEducation(OVERVIEW)
 
-            assertThat(model?.signalCount).isEqualTo(originalValue)
+            // No new toast education besides the 2 triggered at first
+            val firstEdu = EducationInfo(HOME, EducationUiType.Toast, userId = 0)
+            val secondEdu = EducationInfo(BACK, EducationUiType.Toast, userId = 0)
+            assertThat(models).containsExactly(firstEdu, secondEdu).inOrder()
         }
 
     @Test
-    fun dataUnchangedOnIncrementSignalCountWithoutOobeLaunchTime() =
+    fun newEducationToastAfterMinIntervalElapsedWhenMaxToastsPerSessionTriggered() =
         testScope.runTest {
-            // No update to OOBE launch time to simulate no OOBE is launched yet
             setUpForDeviceConnection()
+            setUpForInitialDelayElapse()
+            val models by collectValues(underTest.educationTriggered.filterNotNull())
+            // Show two toasts of other gestures
+            triggerEducation(HOME)
+            triggerEducation(BACK)
 
-            val model by collectLastValue(repository.readGestureEduModelFlow(gestureType))
-            val originalValue = model!!.signalCount
-            val listener = getOverviewProxyListener()
-            listener.updateContextualEduStats(/* isTrackpadGesture= */ false, gestureType)
+            // Trigger toast after an usage session has elapsed
+            eduClock.offset(KeyboardTouchpadEduInteractor.usageSessionDuration + 1.seconds)
+            triggerEducation(OVERVIEW)
 
-            assertThat(model?.signalCount).isEqualTo(originalValue)
+            val firstEdu = EducationInfo(HOME, EducationUiType.Toast, userId = 0)
+            val secondEdu = EducationInfo(BACK, EducationUiType.Toast, userId = 0)
+            val thirdEdu = EducationInfo(OVERVIEW, EducationUiType.Toast, userId = 0)
+            assertThat(models).containsExactly(firstEdu, secondEdu, thirdEdu).inOrder()
+        }
+
+    @Test
+    fun newEducationNotificationAfterMaxToastsPerSessionTriggered() =
+        testScope.runTest {
+            setUpForDeviceConnection()
+            setUpForInitialDelayElapse()
+            val models by collectValues(underTest.educationTriggered.filterNotNull())
+            triggerEducation(BACK)
+
+            // Offset to let min interval for notification elapse so we could show edu notification
+            // for BACK. It would be a new usage session too because the interval (7 days) is
+            // longer than a usage session (3 days)
+            eduClock.offset(minIntervalForEduNotification)
+            triggerEducation(HOME)
+            triggerEducation(OVERVIEW)
+            triggerEducation(BACK)
+
+            val firstEdu = EducationInfo(BACK, EducationUiType.Toast, userId = 0)
+            val secondEdu = EducationInfo(HOME, EducationUiType.Toast, userId = 0)
+            val thirdEdu = EducationInfo(OVERVIEW, EducationUiType.Toast, userId = 0)
+            val fourthEdu = EducationInfo(BACK, EducationUiType.Notification, userId = 0)
+            assertThat(models).containsExactly(firstEdu, secondEdu, thirdEdu, fourthEdu).inOrder()
         }
 
     private suspend fun setUpForInitialDelayElapse() {
@@ -402,51 +156,6 @@
         eduClock.offset(initialDelayElapsedDuration)
     }
 
-    fun logMetricsForToastEducation() =
-        testScope.runTest {
-            triggerMaxEducationSignals(gestureType)
-            runCurrent()
-
-            verify(kosmos.mockEduMetricsLogger)
-                .logContextualEducationTriggered(gestureType, EducationUiType.Toast)
-        }
-
-    @Test
-    fun logMetricsForNotificationEducation() =
-        testScope.runTest {
-            triggerMaxEducationSignals(gestureType)
-            runCurrent()
-
-            eduClock.offset(minDurationForNextEdu)
-            triggerMaxEducationSignals(gestureType)
-            runCurrent()
-
-            verify(kosmos.mockEduMetricsLogger)
-                .logContextualEducationTriggered(gestureType, EducationUiType.Notification)
-        }
-
-    @After
-    fun clear() {
-        testScope.launch { tutorialSchedulerRepository.clear() }
-    }
-
-    private suspend fun triggerMaxEducationSignals(gestureType: GestureType) {
-        // Increment max number of signal to try triggering education
-        for (i in 1..KeyboardTouchpadEduInteractor.MAX_SIGNAL_COUNT) {
-            contextualEduInteractor.incrementSignalCount(gestureType)
-        }
-    }
-
-    private fun TestScope.setIsAnyTouchpadConnected(isConnected: Boolean) {
-        touchpadRepository.setIsAnyTouchpadConnected(isConnected)
-        runCurrent()
-    }
-
-    private fun TestScope.setIsAnyKeyboardConnected(isConnected: Boolean) {
-        keyboardRepository.setIsAnyKeyboardConnected(isConnected)
-        runCurrent()
-    }
-
     private fun setUpForDeviceConnection() {
         touchpadRepository.setIsAnyTouchpadConnected(true)
         keyboardRepository.setIsAnyKeyboardConnected(true)
@@ -458,13 +167,12 @@
         return listenerCaptor.firstValue
     }
 
-    companion object {
-        private val USER_INFOS = listOf(UserInfo(101, "Second User", 0))
-
-        @JvmStatic
-        @Parameters(name = "{0}")
-        fun getGestureTypes(): List<GestureType> {
-            return listOf(BACK, HOME, OVERVIEW, ALL_APPS)
+    private fun TestScope.triggerEducation(gestureType: GestureType) {
+        // Increment max number of signal to try triggering education
+        for (i in 1..KeyboardTouchpadEduInteractor.MAX_SIGNAL_COUNT) {
+            val listener = getOverviewProxyListener()
+            listener.updateContextualEduStats(/* isTrackpadGesture= */ false, gestureType)
         }
+        runCurrent()
     }
 }
diff --git a/packages/SystemUI/tests/src/com/android/systemui/shade/GlanceableHubContainerControllerTest.kt b/packages/SystemUI/tests/src/com/android/systemui/shade/GlanceableHubContainerControllerTest.kt
index e7fb470c..c410111 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/shade/GlanceableHubContainerControllerTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/shade/GlanceableHubContainerControllerTest.kt
@@ -33,7 +33,7 @@
 import androidx.test.filters.SmallTest
 import com.android.compose.animation.scene.SceneKey
 import com.android.systemui.Flags
-import com.android.systemui.Flags.FLAG_COMMUNAL_HUB_ON_MOBILE
+import com.android.systemui.Flags.FLAG_GLANCEABLE_HUB_V2
 import com.android.systemui.Flags.FLAG_HUBMODE_FULLSCREEN_VERTICAL_SWIPE_FIX
 import com.android.systemui.SysuiTestCase
 import com.android.systemui.ambient.touch.TouchHandler
@@ -43,7 +43,9 @@
 import com.android.systemui.communal.data.repository.FakeCommunalSceneRepository
 import com.android.systemui.communal.data.repository.fakeCommunalSceneRepository
 import com.android.systemui.communal.domain.interactor.communalInteractor
+import com.android.systemui.communal.domain.interactor.communalSettingsInteractor
 import com.android.systemui.communal.domain.interactor.setCommunalAvailable
+import com.android.systemui.communal.domain.interactor.setCommunalV2ConfigEnabled
 import com.android.systemui.communal.shared.model.CommunalScenes
 import com.android.systemui.communal.ui.compose.CommunalContent
 import com.android.systemui.communal.ui.viewmodel.CommunalViewModel
@@ -131,20 +133,26 @@
             underTest =
                 GlanceableHubContainerController(
                     communalInteractor,
+                    communalSettingsInteractor,
                     communalViewModel,
                     keyguardInteractor,
-                    kosmos.keyguardTransitionInteractor,
+                    keyguardTransitionInteractor,
                     shadeInteractor,
                     powerManager,
                     communalColors,
                     ambientTouchComponentFactory,
                     communalContent,
-                    kosmos.sceneDataSourceDelegator,
-                    kosmos.notificationStackScrollLayoutController,
-                    kosmos.keyguardMediaController,
-                    kosmos.lockscreenSmartspaceController,
+                    sceneDataSourceDelegator,
+                    notificationStackScrollLayoutController,
+                    keyguardMediaController,
+                    lockscreenSmartspaceController,
                     logcatLogBuffer("GlanceableHubContainerControllerTest"),
                 )
+
+            // Make below last notification true by default or else touches will be ignored by
+            // default when the hub is not showing.
+            whenever(notificationStackScrollLayoutController.isBelowLastNotification(any(), any()))
+                .thenReturn(true)
         }
         testableLooper = TestableLooper.get(this)
 
@@ -178,6 +186,7 @@
                 underTest =
                     GlanceableHubContainerController(
                         communalInteractor,
+                        kosmos.communalSettingsInteractor,
                         communalViewModel,
                         keyguardInteractor,
                         kosmos.keyguardTransitionInteractor,
@@ -207,6 +216,7 @@
             val underTest =
                 GlanceableHubContainerController(
                     communalInteractor,
+                    kosmos.communalSettingsInteractor,
                     communalViewModel,
                     keyguardInteractor,
                     kosmos.keyguardTransitionInteractor,
@@ -231,6 +241,7 @@
             val underTest =
                 GlanceableHubContainerController(
                     communalInteractor,
+                    kosmos.communalSettingsInteractor,
                     communalViewModel,
                     keyguardInteractor,
                     kosmos.keyguardTransitionInteractor,
@@ -631,7 +642,7 @@
             }
         }
 
-    @DisableFlags(FLAG_COMMUNAL_HUB_ON_MOBILE)
+    @DisableFlags(FLAG_GLANCEABLE_HUB_V2)
     @Test
     fun onTouchEvent_shadeInteracting_movesNotDispatched() =
         with(kosmos) {
@@ -688,7 +699,7 @@
             }
         }
 
-    @DisableFlags(FLAG_COMMUNAL_HUB_ON_MOBILE)
+    @DisableFlags(FLAG_GLANCEABLE_HUB_V2)
     @Test
     fun onTouchEvent_bouncerInteracting_movesNotDispatched() =
         with(kosmos) {
@@ -721,11 +732,13 @@
             }
         }
 
-    @EnableFlags(FLAG_COMMUNAL_HUB_ON_MOBILE)
+    @EnableFlags(FLAG_GLANCEABLE_HUB_V2)
     @Test
     fun onTouchEvent_onLockscreenAndGlanceableHubV2_touchIgnored() =
         with(kosmos) {
             testScope.runTest {
+                kosmos.setCommunalV2ConfigEnabled(true)
+
                 // On lockscreen.
                 goToScene(CommunalScenes.Blank)
 
diff --git a/packages/SystemUI/tests/utils/src/com/android/systemui/communal/domain/interactor/CommunalInteractorKosmos.kt b/packages/SystemUI/tests/utils/src/com/android/systemui/communal/domain/interactor/CommunalInteractorKosmos.kt
index 1f68195..ad92b31 100644
--- a/packages/SystemUI/tests/utils/src/com/android/systemui/communal/domain/interactor/CommunalInteractorKosmos.kt
+++ b/packages/SystemUI/tests/utils/src/com/android/systemui/communal/domain/interactor/CommunalInteractorKosmos.kt
@@ -16,6 +16,7 @@
 
 package com.android.systemui.communal.domain.interactor
 
+import android.content.testableContext
 import android.os.userManager
 import com.android.systemui.broadcast.broadcastDispatcher
 import com.android.systemui.communal.data.repository.communalMediaRepository
@@ -34,6 +35,7 @@
 import com.android.systemui.kosmos.testScope
 import com.android.systemui.log.logcatLogBuffer
 import com.android.systemui.plugins.activityStarter
+import com.android.systemui.res.R
 import com.android.systemui.scene.domain.interactor.sceneInteractor
 import com.android.systemui.settings.userTracker
 import com.android.systemui.statusbar.phone.fakeManagedProfileController
@@ -67,6 +69,13 @@
 
 val Kosmos.editWidgetsActivityStarter by Fixture<EditWidgetsActivityStarter> { mock() }
 
+fun Kosmos.setCommunalV2ConfigEnabled(enabled: Boolean) {
+    testableContext.orCreateTestableResources.addOverride(
+        com.android.internal.R.bool.config_glanceableHubEnabled,
+        enabled,
+    )
+}
+
 suspend fun Kosmos.setCommunalEnabled(enabled: Boolean) {
     fakeFeatureFlagsClassic.set(Flags.COMMUNAL_SERVICE_ENABLED, enabled)
     if (enabled) {
@@ -76,6 +85,15 @@
     }
 }
 
+suspend fun Kosmos.setCommunalV2Enabled(enabled: Boolean) {
+    setCommunalV2ConfigEnabled(true)
+    if (enabled) {
+        fakeUserRepository.asMainUser()
+    } else {
+        fakeUserRepository.asDefaultUser()
+    }
+}
+
 suspend fun Kosmos.setCommunalAvailable(available: Boolean) {
     setCommunalEnabled(available)
     with(fakeKeyguardRepository) {
@@ -83,3 +101,12 @@
         setKeyguardShowing(available)
     }
 }
+
+suspend fun Kosmos.setCommunalV2Available(available: Boolean) {
+    setCommunalV2ConfigEnabled(true)
+    setCommunalEnabled(available)
+    with(fakeKeyguardRepository) {
+        setIsEncryptedOrLockdown(!available)
+        setKeyguardShowing(available)
+    }
+}
diff --git a/packages/SystemUI/tests/utils/src/com/android/systemui/education/data/repository/ContextualEducationRepositoryKosmos.kt b/packages/SystemUI/tests/utils/src/com/android/systemui/education/data/repository/ContextualEducationRepositoryKosmos.kt
index 1df3ef4..1021169 100644
--- a/packages/SystemUI/tests/utils/src/com/android/systemui/education/data/repository/ContextualEducationRepositoryKosmos.kt
+++ b/packages/SystemUI/tests/utils/src/com/android/systemui/education/data/repository/ContextualEducationRepositoryKosmos.kt
@@ -17,9 +17,11 @@
 package com.android.systemui.education.data.repository
 
 import com.android.systemui.kosmos.Kosmos
+import java.time.Duration
 import java.time.Instant
 
 var Kosmos.contextualEducationRepository: FakeContextualEducationRepository by
     Kosmos.Fixture { FakeContextualEducationRepository() }
 
-var Kosmos.fakeEduClock: FakeEduClock by Kosmos.Fixture { FakeEduClock(Instant.MIN) }
+var Kosmos.fakeEduClock: FakeEduClock by
+    Kosmos.Fixture { FakeEduClock(Instant.ofEpochSecond(Duration.ofDays(30).seconds)) }
diff --git a/core/java/android/app/ondeviceintelligence/FeatureDetails.aidl b/packages/SystemUI/tests/utils/src/com/android/systemui/globalactions/GlobalActionsDialogLiteKosmos.kt
similarity index 66%
copy from core/java/android/app/ondeviceintelligence/FeatureDetails.aidl
copy to packages/SystemUI/tests/utils/src/com/android/systemui/globalactions/GlobalActionsDialogLiteKosmos.kt
index 0589bf8..63bfa52 100644
--- a/core/java/android/app/ondeviceintelligence/FeatureDetails.aidl
+++ b/packages/SystemUI/tests/utils/src/com/android/systemui/globalactions/GlobalActionsDialogLiteKosmos.kt
@@ -5,7 +5,7 @@
  * 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
+ *      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,
@@ -14,9 +14,10 @@
  * limitations under the License.
  */
 
-package android.app.ondeviceintelligence;
+package com.android.systemui.globalactions
 
-/**
-  * @hide
-  */
-parcelable FeatureDetails;
+import com.android.systemui.kosmos.Kosmos
+import org.mockito.kotlin.mock
+
+/** Provides a mock */
+val Kosmos.globalActionsDialogLite: GlobalActionsDialogLite by Kosmos.Fixture { mock() }
diff --git a/packages/SystemUI/tests/utils/src/com/android/systemui/keyboard/shortcut/KeyboardShortcutHelperKosmos.kt b/packages/SystemUI/tests/utils/src/com/android/systemui/keyboard/shortcut/KeyboardShortcutHelperKosmos.kt
index 552cd94..4cb8a41 100644
--- a/packages/SystemUI/tests/utils/src/com/android/systemui/keyboard/shortcut/KeyboardShortcutHelperKosmos.kt
+++ b/packages/SystemUI/tests/utils/src/com/android/systemui/keyboard/shortcut/KeyboardShortcutHelperKosmos.kt
@@ -25,6 +25,7 @@
 import com.android.systemui.keyboard.shortcut.data.repository.CustomInputGesturesRepository
 import com.android.systemui.keyboard.shortcut.data.repository.CustomShortcutCategoriesRepository
 import com.android.systemui.keyboard.shortcut.data.repository.DefaultShortcutCategoriesRepository
+import com.android.systemui.keyboard.shortcut.data.repository.InputGestureDataAdapter
 import com.android.systemui.keyboard.shortcut.data.repository.InputGestureMaps
 import com.android.systemui.keyboard.shortcut.data.repository.ShortcutCategoriesUtils
 import com.android.systemui.keyboard.shortcut.data.repository.ShortcutHelperStateRepository
@@ -112,6 +113,8 @@
 
 val Kosmos.inputGestureMaps by Kosmos.Fixture { InputGestureMaps(applicationContext) }
 
+val Kosmos.inputGestureDataAdapter by Kosmos.Fixture { InputGestureDataAdapter(userTracker, inputGestureMaps, applicationContext)}
+
 val Kosmos.customInputGesturesRepository by
     Kosmos.Fixture { CustomInputGesturesRepository(userTracker, testDispatcher) }
 
@@ -122,8 +125,7 @@
             applicationCoroutineScope,
             testDispatcher,
             shortcutCategoriesUtils,
-            applicationContext,
-            inputGestureMaps,
+            inputGestureDataAdapter,
             customInputGesturesRepository,
             fakeInputManager.inputManager,
         )
diff --git a/packages/SystemUI/tests/utils/src/com/android/systemui/plugins/statusbar/StatusBarStateControllerKosmos.kt b/packages/SystemUI/tests/utils/src/com/android/systemui/plugins/statusbar/StatusBarStateControllerKosmos.kt
index 10b073e..2e6d8ed 100644
--- a/packages/SystemUI/tests/utils/src/com/android/systemui/plugins/statusbar/StatusBarStateControllerKosmos.kt
+++ b/packages/SystemUI/tests/utils/src/com/android/systemui/plugins/statusbar/StatusBarStateControllerKosmos.kt
@@ -28,6 +28,7 @@
 import com.android.systemui.scene.domain.interactor.sceneContainerOcclusionInteractor
 import com.android.systemui.scene.domain.interactor.sceneInteractor
 import com.android.systemui.shade.domain.interactor.shadeInteractor
+import com.android.systemui.statusbar.FakeStatusBarStateController
 import com.android.systemui.statusbar.StatusBarStateControllerImpl
 import com.android.systemui.statusbar.SysuiStatusBarStateController
 import com.android.systemui.util.mockito.mock
@@ -49,3 +50,6 @@
             { alternateBouncerInteractor },
         )
     }
+
+var Kosmos.fakeStatusBarStateController: SysuiStatusBarStateController by
+    Kosmos.Fixture { FakeStatusBarStateController() }
diff --git a/packages/SystemUI/tests/utils/src/com/android/systemui/qs/composefragment/viewmodel/QSFragmentComposeViewModelKosmos.kt b/packages/SystemUI/tests/utils/src/com/android/systemui/qs/composefragment/viewmodel/QSFragmentComposeViewModelKosmos.kt
index c574463..d71bc31 100644
--- a/packages/SystemUI/tests/utils/src/com/android/systemui/qs/composefragment/viewmodel/QSFragmentComposeViewModelKosmos.kt
+++ b/packages/SystemUI/tests/utils/src/com/android/systemui/qs/composefragment/viewmodel/QSFragmentComposeViewModelKosmos.kt
@@ -33,6 +33,7 @@
 import com.android.systemui.qs.panels.ui.viewmodel.inFirstPageViewModel
 import com.android.systemui.qs.panels.ui.viewmodel.mediaInRowInLandscapeViewModelFactory
 import com.android.systemui.qs.ui.viewmodel.quickSettingsContainerViewModelFactory
+import com.android.systemui.shade.domain.interactor.shadeInteractor
 import com.android.systemui.shade.largeScreenHeaderHelper
 import com.android.systemui.shade.transition.largeScreenShadeInterpolator
 import com.android.systemui.statusbar.disableflags.domain.interactor.disableFlagsInteractor
@@ -56,6 +57,7 @@
                     disableFlagsInteractor,
                     keyguardTransitionInteractor,
                     largeScreenShadeInterpolator,
+                    shadeInteractor,
                     configurationInteractor,
                     largeScreenHeaderHelper,
                     tileSquishinessInteractor,
diff --git a/packages/SystemUI/tests/utils/src/com/android/systemui/qs/panels/data/repository/GridLayoutTypeRepositoryKosmos.kt b/packages/SystemUI/tests/utils/src/com/android/systemui/qs/panels/data/repository/GridLayoutTypeRepositoryKosmos.kt
index 4acedaa..322b412 100644
--- a/packages/SystemUI/tests/utils/src/com/android/systemui/qs/panels/data/repository/GridLayoutTypeRepositoryKosmos.kt
+++ b/packages/SystemUI/tests/utils/src/com/android/systemui/qs/panels/data/repository/GridLayoutTypeRepositoryKosmos.kt
@@ -18,5 +18,4 @@
 
 import com.android.systemui.kosmos.Kosmos
 
-var Kosmos.gridLayoutTypeRepository: GridLayoutTypeRepository by
-    Kosmos.Fixture { GridLayoutTypeRepositoryImpl() }
+var Kosmos.gridLayoutTypeRepository by Kosmos.Fixture { GridLayoutTypeRepository() }
diff --git a/packages/SystemUI/tests/utils/src/com/android/systemui/qs/panels/domain/interactor/GridLayoutTypeInteractorKosmos.kt b/packages/SystemUI/tests/utils/src/com/android/systemui/qs/panels/domain/interactor/GridLayoutTypeInteractorKosmos.kt
index c951642..40c3c96 100644
--- a/packages/SystemUI/tests/utils/src/com/android/systemui/qs/panels/domain/interactor/GridLayoutTypeInteractorKosmos.kt
+++ b/packages/SystemUI/tests/utils/src/com/android/systemui/qs/panels/domain/interactor/GridLayoutTypeInteractorKosmos.kt
@@ -20,10 +20,19 @@
 import com.android.systemui.qs.panels.data.repository.gridLayoutTypeRepository
 import com.android.systemui.qs.panels.shared.model.GridLayoutType
 import com.android.systemui.qs.panels.shared.model.InfiniteGridLayoutType
+import com.android.systemui.qs.panels.shared.model.PaginatedGridLayoutType
 import com.android.systemui.qs.panels.ui.compose.GridLayout
+import com.android.systemui.qs.panels.ui.compose.infinitegrid.infiniteGridLayout
+import com.android.systemui.qs.panels.ui.compose.paginatedGridLayout
+import com.android.systemui.shade.domain.interactor.shadeModeInteractor
 
 val Kosmos.gridLayoutTypeInteractor by
-    Kosmos.Fixture { GridLayoutTypeInteractor(gridLayoutTypeRepository) }
+    Kosmos.Fixture { GridLayoutTypeInteractor(gridLayoutTypeRepository, shadeModeInteractor) }
 
 val Kosmos.gridLayoutMap: Map<GridLayoutType, GridLayout> by
-    Kosmos.Fixture { mapOf(Pair(InfiniteGridLayoutType, infiniteGridLayout)) }
+    Kosmos.Fixture {
+        mapOf(
+            Pair(InfiniteGridLayoutType, infiniteGridLayout),
+            Pair(PaginatedGridLayoutType, paginatedGridLayout),
+        )
+    }
diff --git a/packages/SystemUI/tests/utils/src/com/android/systemui/qs/panels/ui/viewmodel/EditModeButtonViewModelKosmos.kt b/packages/SystemUI/tests/utils/src/com/android/systemui/qs/panels/ui/compose/PaginatedGridLayoutKosmos.kt
similarity index 61%
copy from packages/SystemUI/tests/utils/src/com/android/systemui/qs/panels/ui/viewmodel/EditModeButtonViewModelKosmos.kt
copy to packages/SystemUI/tests/utils/src/com/android/systemui/qs/panels/ui/compose/PaginatedGridLayoutKosmos.kt
index b8d3ff4..f412d98 100644
--- a/packages/SystemUI/tests/utils/src/com/android/systemui/qs/panels/ui/viewmodel/EditModeButtonViewModelKosmos.kt
+++ b/packages/SystemUI/tests/utils/src/com/android/systemui/qs/panels/ui/compose/PaginatedGridLayoutKosmos.kt
@@ -14,16 +14,11 @@
  * limitations under the License.
  */
 
-package com.android.systemui.qs.panels.ui.viewmodel
+package com.android.systemui.qs.panels.ui.compose
 
-import com.android.systemui.classifier.domain.interactor.falsingInteractor
 import com.android.systemui.kosmos.Kosmos
+import com.android.systemui.qs.panels.ui.compose.infinitegrid.infiniteGridLayout
+import com.android.systemui.qs.panels.ui.viewmodel.paginatedGridViewModelFactory
 
-val Kosmos.editModeButtonViewModelFactory by
-    Kosmos.Fixture {
-        object : EditModeButtonViewModel.Factory {
-            override fun create(): EditModeButtonViewModel {
-                return EditModeButtonViewModel(editModeViewModel, falsingInteractor)
-            }
-        }
-    }
+val Kosmos.paginatedGridLayout by
+    Kosmos.Fixture { PaginatedGridLayout(paginatedGridViewModelFactory, infiniteGridLayout) }
diff --git a/packages/SystemUI/tests/utils/src/com/android/systemui/qs/panels/domain/interactor/InfiniteGridLayoutKosmos.kt b/packages/SystemUI/tests/utils/src/com/android/systemui/qs/panels/ui/compose/infinitegrid/InfiniteGridLayoutKosmos.kt
similarity index 89%
rename from packages/SystemUI/tests/utils/src/com/android/systemui/qs/panels/domain/interactor/InfiniteGridLayoutKosmos.kt
rename to packages/SystemUI/tests/utils/src/com/android/systemui/qs/panels/ui/compose/infinitegrid/InfiniteGridLayoutKosmos.kt
index 6fe860c..f57806c 100644
--- a/packages/SystemUI/tests/utils/src/com/android/systemui/qs/panels/domain/interactor/InfiniteGridLayoutKosmos.kt
+++ b/packages/SystemUI/tests/utils/src/com/android/systemui/qs/panels/ui/compose/infinitegrid/InfiniteGridLayoutKosmos.kt
@@ -14,11 +14,10 @@
  * limitations under the License.
  */
 
-package com.android.systemui.qs.panels.domain.interactor
+package com.android.systemui.qs.panels.ui.compose.infinitegrid
 
 import com.android.systemui.haptics.msdl.tileHapticsViewModelFactoryProvider
 import com.android.systemui.kosmos.Kosmos
-import com.android.systemui.qs.panels.ui.compose.infinitegrid.InfiniteGridLayout
 import com.android.systemui.qs.panels.ui.viewmodel.detailsViewModel
 import com.android.systemui.qs.panels.ui.viewmodel.iconTilesViewModel
 import com.android.systemui.qs.panels.ui.viewmodel.infiniteGridViewModelFactory
diff --git a/packages/SystemUI/tests/utils/src/com/android/systemui/qs/panels/ui/viewmodel/EditModeViewModelKosmos.kt b/packages/SystemUI/tests/utils/src/com/android/systemui/qs/panels/ui/viewmodel/EditModeViewModelKosmos.kt
index 33227a4..86c3add 100644
--- a/packages/SystemUI/tests/utils/src/com/android/systemui/qs/panels/ui/viewmodel/EditModeViewModelKosmos.kt
+++ b/packages/SystemUI/tests/utils/src/com/android/systemui/qs/panels/ui/viewmodel/EditModeViewModelKosmos.kt
@@ -23,8 +23,8 @@
 import com.android.systemui.qs.panels.domain.interactor.editTilesListInteractor
 import com.android.systemui.qs.panels.domain.interactor.gridLayoutMap
 import com.android.systemui.qs.panels.domain.interactor.gridLayoutTypeInteractor
-import com.android.systemui.qs.panels.domain.interactor.infiniteGridLayout
 import com.android.systemui.qs.panels.domain.interactor.tilesAvailabilityInteractor
+import com.android.systemui.qs.panels.ui.compose.infinitegrid.infiniteGridLayout
 import com.android.systemui.qs.pipeline.domain.interactor.currentTilesInteractor
 import com.android.systemui.qs.pipeline.domain.interactor.minimumTilesInteractor
 
diff --git a/packages/SystemUI/tests/utils/src/com/android/systemui/qs/panels/ui/viewmodel/PaginatedGridViewModelKosmos.kt b/packages/SystemUI/tests/utils/src/com/android/systemui/qs/panels/ui/viewmodel/PaginatedGridViewModelKosmos.kt
index 5c71ba2..128cfca 100644
--- a/packages/SystemUI/tests/utils/src/com/android/systemui/qs/panels/ui/viewmodel/PaginatedGridViewModelKosmos.kt
+++ b/packages/SystemUI/tests/utils/src/com/android/systemui/qs/panels/ui/viewmodel/PaginatedGridViewModelKosmos.kt
@@ -20,6 +20,7 @@
 import com.android.systemui.development.ui.viewmodel.buildNumberViewModelFactory
 import com.android.systemui.kosmos.Kosmos
 import com.android.systemui.qs.panels.domain.interactor.paginatedGridInteractor
+import com.android.systemui.qs.panels.ui.viewmodel.toolbar.editModeButtonViewModelFactory
 
 val Kosmos.paginatedGridViewModel by
     Kosmos.Fixture {
@@ -33,3 +34,10 @@
             falsingInteractor,
         )
     }
+
+val Kosmos.paginatedGridViewModelFactory by
+    Kosmos.Fixture {
+        object : PaginatedGridViewModel.Factory {
+            override fun create() = paginatedGridViewModel
+        }
+    }
diff --git a/packages/SystemUI/tests/utils/src/com/android/systemui/qs/panels/ui/viewmodel/TileGridViewModelKosmos.kt b/packages/SystemUI/tests/utils/src/com/android/systemui/qs/panels/ui/viewmodel/TileGridViewModelKosmos.kt
index 9481fca..e79d213 100644
--- a/packages/SystemUI/tests/utils/src/com/android/systemui/qs/panels/ui/viewmodel/TileGridViewModelKosmos.kt
+++ b/packages/SystemUI/tests/utils/src/com/android/systemui/qs/panels/ui/viewmodel/TileGridViewModelKosmos.kt
@@ -20,7 +20,7 @@
 import com.android.systemui.kosmos.applicationCoroutineScope
 import com.android.systemui.qs.panels.domain.interactor.gridLayoutMap
 import com.android.systemui.qs.panels.domain.interactor.gridLayoutTypeInteractor
-import com.android.systemui.qs.panels.domain.interactor.infiniteGridLayout
+import com.android.systemui.qs.panels.ui.compose.infinitegrid.infiniteGridLayout
 import com.android.systemui.qs.pipeline.domain.interactor.currentTilesInteractor
 
 val Kosmos.tileGridViewModel by
diff --git a/packages/SystemUI/tests/utils/src/com/android/systemui/qs/panels/ui/viewmodel/EditModeButtonViewModelKosmos.kt b/packages/SystemUI/tests/utils/src/com/android/systemui/qs/panels/ui/viewmodel/toolbar/EditModeButtonViewModelKosmos.kt
similarity index 88%
rename from packages/SystemUI/tests/utils/src/com/android/systemui/qs/panels/ui/viewmodel/EditModeButtonViewModelKosmos.kt
rename to packages/SystemUI/tests/utils/src/com/android/systemui/qs/panels/ui/viewmodel/toolbar/EditModeButtonViewModelKosmos.kt
index b8d3ff4..8ae1332 100644
--- a/packages/SystemUI/tests/utils/src/com/android/systemui/qs/panels/ui/viewmodel/EditModeButtonViewModelKosmos.kt
+++ b/packages/SystemUI/tests/utils/src/com/android/systemui/qs/panels/ui/viewmodel/toolbar/EditModeButtonViewModelKosmos.kt
@@ -14,10 +14,11 @@
  * limitations under the License.
  */
 
-package com.android.systemui.qs.panels.ui.viewmodel
+package com.android.systemui.qs.panels.ui.viewmodel.toolbar
 
 import com.android.systemui.classifier.domain.interactor.falsingInteractor
 import com.android.systemui.kosmos.Kosmos
+import com.android.systemui.qs.panels.ui.viewmodel.editModeViewModel
 
 val Kosmos.editModeButtonViewModelFactory by
     Kosmos.Fixture {
diff --git a/packages/SystemUI/tests/utils/src/com/android/systemui/qs/panels/ui/viewmodel/toolbar/ToolbarViewModelKosmos.kt b/packages/SystemUI/tests/utils/src/com/android/systemui/qs/panels/ui/viewmodel/toolbar/ToolbarViewModelKosmos.kt
new file mode 100644
index 0000000..52d8a3a
--- /dev/null
+++ b/packages/SystemUI/tests/utils/src/com/android/systemui/qs/panels/ui/viewmodel/toolbar/ToolbarViewModelKosmos.kt
@@ -0,0 +1,38 @@
+/*
+ * 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.toolbar
+
+import android.content.applicationContext
+import com.android.systemui.classifier.domain.interactor.falsingInteractor
+import com.android.systemui.globalactions.globalActionsDialogLite
+import com.android.systemui.kosmos.Kosmos
+import com.android.systemui.qs.footerActionsInteractor
+
+val Kosmos.toolbarViewModelFactory by
+    Kosmos.Fixture {
+        object : ToolbarViewModel.Factory {
+            override fun create(): ToolbarViewModel {
+                return ToolbarViewModel(
+                    editModeButtonViewModelFactory,
+                    footerActionsInteractor,
+                    { globalActionsDialogLite },
+                    falsingInteractor,
+                    applicationContext,
+                )
+            }
+        }
+    }
diff --git a/packages/SystemUI/tests/utils/src/com/android/systemui/qs/tiles/base/interactor/FakeQSTileUserActionInteractor.kt b/packages/SystemUI/tests/utils/src/com/android/systemui/qs/tiles/base/interactor/FakeQSTileUserActionInteractor.kt
index 597d52d..bc1c60c 100644
--- a/packages/SystemUI/tests/utils/src/com/android/systemui/qs/tiles/base/interactor/FakeQSTileUserActionInteractor.kt
+++ b/packages/SystemUI/tests/utils/src/com/android/systemui/qs/tiles/base/interactor/FakeQSTileUserActionInteractor.kt
@@ -16,6 +16,8 @@
 
 package com.android.systemui.qs.tiles.base.interactor
 
+import com.android.systemui.plugins.qs.TileDetailsViewModel
+import com.android.systemui.qs.FakeTileDetailsViewModel
 import kotlinx.coroutines.sync.Mutex
 import kotlinx.coroutines.sync.withLock
 
@@ -31,4 +33,7 @@
     override suspend fun handleInput(input: QSTileInput<T>) {
         mutex.withLock { mutableInputs.add(input) }
     }
+
+    override var detailsViewModel: TileDetailsViewModel? =
+        FakeTileDetailsViewModel("FakeQSTileUserActionInteractor")
 }
diff --git a/packages/SystemUI/tests/utils/src/com/android/systemui/qs/ui/viewmodel/QuickSettingsContainerViewModelKosmos.kt b/packages/SystemUI/tests/utils/src/com/android/systemui/qs/ui/viewmodel/QuickSettingsContainerViewModelKosmos.kt
index 6afc0d80..aa6ce9a 100644
--- a/packages/SystemUI/tests/utils/src/com/android/systemui/qs/ui/viewmodel/QuickSettingsContainerViewModelKosmos.kt
+++ b/packages/SystemUI/tests/utils/src/com/android/systemui/qs/ui/viewmodel/QuickSettingsContainerViewModelKosmos.kt
@@ -22,6 +22,7 @@
 import com.android.systemui.qs.panels.ui.viewmodel.editModeViewModel
 import com.android.systemui.qs.panels.ui.viewmodel.quickQuickSettingsViewModelFactory
 import com.android.systemui.qs.panels.ui.viewmodel.tileGridViewModel
+import com.android.systemui.qs.panels.ui.viewmodel.toolbar.toolbarViewModelFactory
 
 val Kosmos.quickSettingsContainerViewModelFactory by
     Kosmos.Fixture {
@@ -36,6 +37,7 @@
                     tileGridViewModel,
                     editModeViewModel,
                     detailsViewModel,
+                    toolbarViewModelFactory,
                 )
             }
         }
diff --git a/packages/SystemUI/tests/utils/src/com/android/systemui/statusbar/notification/DynamicPrivacyControllerKosmos.kt b/packages/SystemUI/tests/utils/src/com/android/systemui/statusbar/notification/DynamicPrivacyControllerKosmos.kt
new file mode 100644
index 0000000..fa5bd7a
--- /dev/null
+++ b/packages/SystemUI/tests/utils/src/com/android/systemui/statusbar/notification/DynamicPrivacyControllerKosmos.kt
@@ -0,0 +1,34 @@
+/*
+ * 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.statusbar.notification
+
+import com.android.systemui.kosmos.Kosmos
+import com.android.systemui.plugins.statusbar.statusBarStateController
+import com.android.systemui.statusbar.notificationLockscreenUserManager
+import com.android.systemui.statusbar.policy.keyguardStateController
+import org.mockito.kotlin.mock
+
+var Kosmos.dynamicPrivacyController: DynamicPrivacyController by
+    Kosmos.Fixture {
+        DynamicPrivacyController(
+            notificationLockscreenUserManager,
+            keyguardStateController,
+            statusBarStateController,
+        )
+    }
+
+var Kosmos.mockDynamicPrivacyController: DynamicPrivacyController by Kosmos.Fixture { mock() }
diff --git a/packages/SystemUI/tests/utils/src/com/android/systemui/statusbar/notification/collection/coordinator/SensitiveContentCoordinatorKosmos.kt b/packages/SystemUI/tests/utils/src/com/android/systemui/statusbar/notification/collection/coordinator/SensitiveContentCoordinatorKosmos.kt
new file mode 100644
index 0000000..4a249a8
--- /dev/null
+++ b/packages/SystemUI/tests/utils/src/com/android/systemui/statusbar/notification/collection/coordinator/SensitiveContentCoordinatorKosmos.kt
@@ -0,0 +1,47 @@
+/*
+ * 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.statusbar.notification.collection.coordinator
+
+import com.android.keyguard.keyguardUpdateMonitor
+import com.android.systemui.deviceentry.domain.interactor.deviceEntryInteractor
+import com.android.systemui.kosmos.Kosmos
+import com.android.systemui.kosmos.testScope
+import com.android.systemui.plugins.statusbar.statusBarStateController
+import com.android.systemui.scene.domain.interactor.sceneInteractor
+import com.android.systemui.statusbar.notification.dynamicPrivacyController
+import com.android.systemui.statusbar.notificationLockscreenUserManager
+import com.android.systemui.statusbar.policy.keyguardStateController
+import com.android.systemui.statusbar.policy.sensitiveNotificationProtectionController
+import com.android.systemui.user.domain.interactor.selectedUserInteractor
+import kotlinx.coroutines.ExperimentalCoroutinesApi
+
+@OptIn(ExperimentalCoroutinesApi::class)
+var Kosmos.sensitiveContentCoordinator: SensitiveContentCoordinator by
+    Kosmos.Fixture {
+        SensitiveContentCoordinatorImpl(
+            dynamicPrivacyController,
+            notificationLockscreenUserManager,
+            keyguardUpdateMonitor,
+            statusBarStateController,
+            keyguardStateController,
+            selectedUserInteractor,
+            sensitiveNotificationProtectionController,
+            deviceEntryInteractor,
+            sceneInteractor,
+            testScope,
+        )
+    }
diff --git a/packages/SystemUI/tests/utils/src/com/android/systemui/statusbar/phone/ongoingcall/shared/model/OngoingCallModelBuilder.kt b/packages/SystemUI/tests/utils/src/com/android/systemui/statusbar/phone/ongoingcall/shared/model/OngoingCallModelBuilder.kt
index 3963d7c..766b280 100644
--- a/packages/SystemUI/tests/utils/src/com/android/systemui/statusbar/phone/ongoingcall/shared/model/OngoingCallModelBuilder.kt
+++ b/packages/SystemUI/tests/utils/src/com/android/systemui/statusbar/phone/ongoingcall/shared/model/OngoingCallModelBuilder.kt
@@ -23,5 +23,6 @@
 fun inCallModel(
     startTimeMs: Long,
     notificationIcon: StatusBarIconView? = null,
-    intent: PendingIntent? = null
-) = OngoingCallModel.InCall(startTimeMs, notificationIcon, intent)
+    intent: PendingIntent? = null,
+    notificationKey: String = "test",
+) = OngoingCallModel.InCall(startTimeMs, notificationIcon, intent, notificationKey)
diff --git a/packages/SystemUI/tests/utils/src/com/android/systemui/qs/panels/ui/viewmodel/EditModeButtonViewModelKosmos.kt b/packages/SystemUI/tests/utils/src/com/android/systemui/statusbar/policy/SensitiveNotificationProtectionControllerKosmos.kt
similarity index 60%
copy from packages/SystemUI/tests/utils/src/com/android/systemui/qs/panels/ui/viewmodel/EditModeButtonViewModelKosmos.kt
copy to packages/SystemUI/tests/utils/src/com/android/systemui/statusbar/policy/SensitiveNotificationProtectionControllerKosmos.kt
index b8d3ff4..8f9184d 100644
--- a/packages/SystemUI/tests/utils/src/com/android/systemui/qs/panels/ui/viewmodel/EditModeButtonViewModelKosmos.kt
+++ b/packages/SystemUI/tests/utils/src/com/android/systemui/statusbar/policy/SensitiveNotificationProtectionControllerKosmos.kt
@@ -14,16 +14,13 @@
  * limitations under the License.
  */
 
-package com.android.systemui.qs.panels.ui.viewmodel
+package com.android.systemui.statusbar.policy
 
-import com.android.systemui.classifier.domain.interactor.falsingInteractor
 import com.android.systemui.kosmos.Kosmos
+import org.mockito.kotlin.mock
 
-val Kosmos.editModeButtonViewModelFactory by
-    Kosmos.Fixture {
-        object : EditModeButtonViewModel.Factory {
-            override fun create(): EditModeButtonViewModel {
-                return EditModeButtonViewModel(editModeViewModel, falsingInteractor)
-            }
-        }
-    }
+var Kosmos.sensitiveNotificationProtectionController: SensitiveNotificationProtectionController by
+    Kosmos.Fixture { mockSensitiveNotificationProtectionController }
+val Kosmos.mockSensitiveNotificationProtectionController:
+    SensitiveNotificationProtectionController by
+    Kosmos.Fixture { mock<SensitiveNotificationProtectionController>() }
diff --git a/packages/SystemUI/tests/utils/src/com/android/systemui/volume/dialog/ringer/ui/viewmodel/VolumeDialogRingerDrawerViewModelKosmos.kt b/packages/SystemUI/tests/utils/src/com/android/systemui/volume/dialog/ringer/ui/viewmodel/VolumeDialogRingerDrawerViewModelKosmos.kt
index c8ba551..34661ce 100644
--- a/packages/SystemUI/tests/utils/src/com/android/systemui/volume/dialog/ringer/ui/viewmodel/VolumeDialogRingerDrawerViewModelKosmos.kt
+++ b/packages/SystemUI/tests/utils/src/com/android/systemui/volume/dialog/ringer/ui/viewmodel/VolumeDialogRingerDrawerViewModelKosmos.kt
@@ -21,6 +21,7 @@
 import com.android.systemui.kosmos.Kosmos
 import com.android.systemui.kosmos.applicationCoroutineScope
 import com.android.systemui.kosmos.testDispatcher
+import com.android.systemui.statusbar.notification.domain.interactor.notificationsSoundPolicyInteractor
 import com.android.systemui.volume.dialog.domain.interactor.volumeDialogVisibilityInteractor
 import com.android.systemui.volume.dialog.ringer.domain.volumeDialogRingerInteractor
 import com.android.systemui.volume.dialog.shared.volumeDialogLogger
@@ -31,7 +32,8 @@
             applicationContext = applicationContext,
             backgroundDispatcher = testDispatcher,
             coroutineScope = applicationCoroutineScope,
-            interactor = volumeDialogRingerInteractor,
+            soundPolicyInteractor = notificationsSoundPolicyInteractor,
+            ringerInteractor = volumeDialogRingerInteractor,
             vibrator = vibratorHelper,
             volumeDialogLogger = volumeDialogLogger,
             visibilityInteractor = volumeDialogVisibilityInteractor,
diff --git a/proto/Android.bp b/proto/Android.bp
index a5e1335..feaa6d2 100644
--- a/proto/Android.bp
+++ b/proto/Android.bp
@@ -25,6 +25,10 @@
             static_libs: ["libprotobuf-java-nano"],
         },
     },
+    apex_available: [
+        "com.android.neuralnetworks",
+        "//apex_available:platform",
+    ],
 }
 
 java_library_static {
diff --git a/services/Android.bp b/services/Android.bp
index fc0bb33..a7cb9bb 100644
--- a/services/Android.bp
+++ b/services/Android.bp
@@ -210,6 +210,35 @@
     },
 }
 
+soong_config_module_type {
+    name: "ondeviceintelligence_module_java_defaults",
+    module_type: "java_defaults",
+    config_namespace: "ANDROID",
+    bool_variables: [
+        "release_ondevice_intelligence_module",
+        "release_ondevice_intelligence_platform",
+    ],
+    properties: [
+        "libs",
+        "srcs",
+        "static_libs",
+    ],
+}
+
+// Conditionally add ondeviceintelligence stubs library
+ondeviceintelligence_module_java_defaults {
+    name: "ondeviceintelligence_conditionally",
+    soong_config_variables: {
+        release_ondevice_intelligence_module: {
+            libs: ["service-ondeviceintelligence.stubs.system_server"],
+        },
+        release_ondevice_intelligence_platform: {
+            srcs: [":service-ondeviceintelligence-sources"],
+            static_libs: ["modules-utils-backgroundthread"],
+        },
+    },
+}
+
 // merge all required services into one jar
 // ============================================================
 soong_config_module_type {
@@ -236,6 +265,7 @@
         "services_java_defaults",
         "art_profile_java_defaults",
         "services_crashrecovery_stubs_conditionally",
+        "ondeviceintelligence_conditionally",
     ],
     installable: true,
 
diff --git a/services/companion/java/com/android/server/companion/BackupRestoreProcessor.java b/services/companion/java/com/android/server/companion/BackupRestoreProcessor.java
index 4bcfb33..7c8604f 100644
--- a/services/companion/java/com/android/server/companion/BackupRestoreProcessor.java
+++ b/services/companion/java/com/android/server/companion/BackupRestoreProcessor.java
@@ -240,9 +240,9 @@
             boolean matchesMacAddress = Objects.equals(
                     associationInfo.getDeviceMacAddress(),
                     restored.getDeviceMacAddress());
-            boolean matchesDeviceId = !Flags.associationTag()
-                    || (associationInfo.getDeviceId() != null
-                        && associationInfo.getDeviceId().isSameDevice(restored.getDeviceId()));
+            boolean matchesDeviceId = Flags.associationTag()
+                    && (associationInfo.getDeviceId() != null
+                    && associationInfo.getDeviceId().isSameDevice(restored.getDeviceId()));
             return matchesMacAddress || matchesDeviceId;
         };
         AssociationInfo local = CollectionUtils.find(localAssociations, isSameDevice);
diff --git a/services/core/Android.bp b/services/core/Android.bp
index ffa259b..9e64559 100644
--- a/services/core/Android.bp
+++ b/services/core/Android.bp
@@ -127,6 +127,7 @@
         "android.hardware.power-java_shared",
         "latest_android_hardware_broadcastradio_java_static",
         "services_crashrecovery_stubs_conditionally",
+        "ondeviceintelligence_conditionally",
     ],
     srcs: [
         ":android.hardware.tv.hdmi.connection-V1-java-source",
@@ -157,6 +158,7 @@
         "android.hardware.light-V2.0-java",
         "android.hardware.gnss-V2-java",
         "android.hardware.vibrator-V3-java",
+        "androidx.annotation_annotation",
         "app-compat-annotations",
         "art_exported_aconfig_flags_lib",
         "framework-tethering.stubs.module_lib",
diff --git a/services/core/java/com/android/server/accounts/AccountManagerService.java b/services/core/java/com/android/server/accounts/AccountManagerService.java
index 3ce6451..719928b 100644
--- a/services/core/java/com/android/server/accounts/AccountManagerService.java
+++ b/services/core/java/com/android/server/accounts/AccountManagerService.java
@@ -2846,6 +2846,14 @@
                                 : AccountsDb.DEBUG_ACTION_SET_PASSWORD;
                         logRecord(action, AccountsDb.TABLE_ACCOUNTS, accountId, accounts,
                                 callingUid);
+
+                        FrameworkStatsLog.write(
+                                FrameworkStatsLog.ACCOUNT_MANAGER_EVENT,
+                                account.type,
+                                callingUid,
+                                TextUtils.isEmpty(password)
+                                ? FrameworkStatsLog.ACCOUNT_MANAGER_EVENT__EVENT_TYPE__PASSWORD_REMOVED
+                                : FrameworkStatsLog.ACCOUNT_MANAGER_EVENT__EVENT_TYPE__PASSWORD_CHANGED);
                     }
                 } finally {
                     accounts.accountsDb.endTransaction();
@@ -2912,7 +2920,7 @@
             if (!accountExistsCache(accounts, account)) {
                 return;
             }
-            setUserdataInternal(accounts, account, key, value);
+            setUserdataInternal(accounts, account, key, value, callingUid);
         } finally {
             restoreCallingIdentity(identityToken);
         }
@@ -2932,7 +2940,7 @@
     }
 
     private void setUserdataInternal(UserAccounts accounts, Account account, String key,
-            String value) {
+            String value, int callingUid) {
         synchronized (accounts.dbLock) {
             accounts.accountsDb.beginTransaction();
             try {
@@ -2958,6 +2966,11 @@
                 AccountManager.invalidateLocalAccountUserDataCaches();
             }
         }
+        FrameworkStatsLog.write(
+                FrameworkStatsLog.ACCOUNT_MANAGER_EVENT,
+                account.type,
+                callingUid,
+                FrameworkStatsLog.ACCOUNT_MANAGER_EVENT__EVENT_TYPE__USER_DATA_CHANGED);
     }
 
     private void onResult(IAccountManagerResponse response, Bundle result) {
diff --git a/services/core/java/com/android/server/am/ActivityManagerService.java b/services/core/java/com/android/server/am/ActivityManagerService.java
index ebe7fa5..cd929c1 100644
--- a/services/core/java/com/android/server/am/ActivityManagerService.java
+++ b/services/core/java/com/android/server/am/ActivityManagerService.java
@@ -361,6 +361,8 @@
 import android.os.incremental.IIncrementalService;
 import android.os.incremental.IncrementalManager;
 import android.os.incremental.IncrementalMetrics;
+import android.os.instrumentation.IOffsetCallback;
+import android.os.instrumentation.MethodDescriptor;
 import android.os.storage.IStorageManager;
 import android.os.storage.StorageManager;
 import android.provider.DeviceConfig;
@@ -509,6 +511,7 @@
 import java.util.List;
 import java.util.Locale;
 import java.util.Map;
+import java.util.NoSuchElementException;
 import java.util.Objects;
 import java.util.Set;
 import java.util.UUID;
@@ -2781,9 +2784,7 @@
                 mIsolatedAppBindArgs = new ArrayMap<>(1);
                 // See b/79378449 about the following exemption.
                 addServiceToMap(mIsolatedAppBindArgs, "package");
-                if (!android.server.Flags.removeJavaServiceManagerCache()) {
-                    addServiceToMap(mIsolatedAppBindArgs, "permissionmgr");
-                }
+                addServiceToMap(mIsolatedAppBindArgs, "permissionmgr");
             }
             return mIsolatedAppBindArgs;
         }
@@ -2794,38 +2795,27 @@
             // Add common services.
             // IMPORTANT: Before adding services here, make sure ephemeral apps can access them too.
             // Enable the check in ApplicationThread.bindApplication() to make sure.
-
-            // Removing User Service and App Ops Service from cache breaks boot for auto.
-            // Removing permissionmgr breaks tests for Android Auto due to SELinux restrictions.
-            // TODO: fix SELinux restrictions and remove caching for Android Auto.
-            if (mContext.getPackageManager().hasSystemFeature(PackageManager.FEATURE_AUTOMOTIVE)
-                    || !android.server.Flags.removeJavaServiceManagerCache()) {
-                addServiceToMap(mAppBindArgs, Context.ALARM_SERVICE);
-                addServiceToMap(mAppBindArgs, Context.DISPLAY_SERVICE);
-                addServiceToMap(mAppBindArgs, Context.NETWORKMANAGEMENT_SERVICE);
-                addServiceToMap(mAppBindArgs, Context.CONNECTIVITY_SERVICE);
-                addServiceToMap(mAppBindArgs, Context.ACCESSIBILITY_SERVICE);
-                addServiceToMap(mAppBindArgs, Context.INPUT_METHOD_SERVICE);
-                addServiceToMap(mAppBindArgs, Context.INPUT_SERVICE);
-                addServiceToMap(mAppBindArgs, "graphicsstats");
-                addServiceToMap(mAppBindArgs, "content");
-                addServiceToMap(mAppBindArgs, Context.JOB_SCHEDULER_SERVICE);
-                addServiceToMap(mAppBindArgs, Context.NOTIFICATION_SERVICE);
-                addServiceToMap(mAppBindArgs, Context.VIBRATOR_SERVICE);
-                addServiceToMap(mAppBindArgs, Context.ACCOUNT_SERVICE);
-                addServiceToMap(mAppBindArgs, Context.POWER_SERVICE);
-                addServiceToMap(mAppBindArgs, "mount");
-                addServiceToMap(mAppBindArgs, Context.PLATFORM_COMPAT_SERVICE);
-            }
-            // See b/79378449
-            // Getting the window service and package service binder from servicemanager
-            // is blocked for Apps. However they are necessary for apps.
-            // TODO: remove exception
             addServiceToMap(mAppBindArgs, "package");
-            addServiceToMap(mAppBindArgs, Context.WINDOW_SERVICE);
-            addServiceToMap(mAppBindArgs, Context.USER_SERVICE);
             addServiceToMap(mAppBindArgs, "permissionmgr");
+            addServiceToMap(mAppBindArgs, Context.WINDOW_SERVICE);
+            addServiceToMap(mAppBindArgs, Context.ALARM_SERVICE);
+            addServiceToMap(mAppBindArgs, Context.DISPLAY_SERVICE);
+            addServiceToMap(mAppBindArgs, Context.NETWORKMANAGEMENT_SERVICE);
+            addServiceToMap(mAppBindArgs, Context.CONNECTIVITY_SERVICE);
+            addServiceToMap(mAppBindArgs, Context.ACCESSIBILITY_SERVICE);
+            addServiceToMap(mAppBindArgs, Context.INPUT_METHOD_SERVICE);
+            addServiceToMap(mAppBindArgs, Context.INPUT_SERVICE);
+            addServiceToMap(mAppBindArgs, "graphicsstats");
             addServiceToMap(mAppBindArgs, Context.APP_OPS_SERVICE);
+            addServiceToMap(mAppBindArgs, "content");
+            addServiceToMap(mAppBindArgs, Context.JOB_SCHEDULER_SERVICE);
+            addServiceToMap(mAppBindArgs, Context.NOTIFICATION_SERVICE);
+            addServiceToMap(mAppBindArgs, Context.VIBRATOR_SERVICE);
+            addServiceToMap(mAppBindArgs, Context.ACCOUNT_SERVICE);
+            addServiceToMap(mAppBindArgs, Context.POWER_SERVICE);
+            addServiceToMap(mAppBindArgs, Context.USER_SERVICE);
+            addServiceToMap(mAppBindArgs, "mount");
+            addServiceToMap(mAppBindArgs, Context.PLATFORM_COMPAT_SERVICE);
         }
         return mAppBindArgs;
     }
@@ -18055,6 +18045,26 @@
         }
 
         @Override
+        public void getExecutableMethodFileOffsets(@NonNull String processName,
+                int pid, int uid, @NonNull MethodDescriptor methodDescriptor,
+                @NonNull IOffsetCallback callback) {
+            final IApplicationThread thread;
+            synchronized (ActivityManagerService.this) {
+                ProcessRecord record = mProcessList.getProcessRecordLocked(processName, uid);
+                if (record == null || record.getPid() != pid) {
+                    throw new NoSuchElementException();
+                }
+                thread = record.getThread();
+            }
+            try {
+                thread.getExecutableMethodFileOffsets(methodDescriptor, callback);
+            } catch (RemoteException e) {
+                throw new RuntimeException(
+                        "IApplicationThread.getExecutableMethodFileOffsets failed", e);
+            }
+        }
+
+        @Override
         public void addCreatorToken(Intent intent, String creatorPackage) {
             ActivityManagerService.this.addCreatorToken(intent, creatorPackage);
         }
@@ -19406,7 +19416,7 @@
             return createOrGetIntentCreatorToken(intent, key);
 
         } else {
-            throw new IllegalArgumentException("intent does not contain a creator token.");
+            return null;
         }
     }
 
diff --git a/services/core/java/com/android/server/am/SettingsToPropertiesMapper.java b/services/core/java/com/android/server/am/SettingsToPropertiesMapper.java
index 6f83d0c..883e09f 100644
--- a/services/core/java/com/android/server/am/SettingsToPropertiesMapper.java
+++ b/services/core/java/com/android/server/am/SettingsToPropertiesMapper.java
@@ -216,6 +216,7 @@
         "pixel_bluetooth",
         "pixel_connectivity_gps",
         "pixel_continuity",
+        "pixel_display",
         "pixel_perf",
         "pixel_sensors",
         "pixel_state_server",
diff --git a/services/core/java/com/android/server/display/DisplayManagerService.java b/services/core/java/com/android/server/display/DisplayManagerService.java
index 5c62995..452dc5f 100644
--- a/services/core/java/com/android/server/display/DisplayManagerService.java
+++ b/services/core/java/com/android/server/display/DisplayManagerService.java
@@ -47,6 +47,7 @@
 import static android.os.Process.FIRST_APPLICATION_UID;
 import static android.os.Process.ROOT_UID;
 import static android.provider.Settings.Global.DEVELOPMENT_FORCE_DESKTOP_MODE_ON_EXTERNAL_DISPLAYS;
+import static android.provider.Settings.Secure.MIRROR_BUILT_IN_DISPLAY;
 import static android.provider.Settings.Secure.RESOLUTION_MODE_FULL;
 import static android.provider.Settings.Secure.RESOLUTION_MODE_HIGH;
 import static android.provider.Settings.Secure.RESOLUTION_MODE_UNKNOWN;
@@ -71,6 +72,7 @@
 import android.compat.annotation.ChangeId;
 import android.compat.annotation.EnabledSince;
 import android.content.BroadcastReceiver;
+import android.content.ContentResolver;
 import android.content.Context;
 import android.content.Intent;
 import android.content.IntentFilter;
@@ -534,6 +536,8 @@
     private final boolean mExtraDisplayEventLogging;
     private final String mExtraDisplayLoggingPackageName;
 
+    private boolean mMirrorBuiltInDisplay;
+
     private final BroadcastReceiver mIdleModeReceiver = new BroadcastReceiver() {
         @Override
         public void onReceive(Context context, Intent intent) {
@@ -782,7 +786,11 @@
                 }
                 dpc.onSwitchUser(newUserId, userSerial, newBrightness);
             });
-            handleSettingsChange();
+            handleMinimalPostProcessingAllowedSettingChange();
+
+            if (mFlags.isDisplayContentModeManagementEnabled()) {
+                updateMirrorBuiltInDisplaySettingLocked();
+            }
         }
     }
 
@@ -825,12 +833,15 @@
             // relevant configuration should be in place.
             recordTopInsetLocked(mLogicalDisplayMapper.getDisplayLocked(Display.DEFAULT_DISPLAY));
 
-            updateSettingsLocked();
+            updateMinimalPostProcessingAllowedSettingLocked();
             updateUserDisabledHdrTypesFromSettingsLocked();
             updateUserPreferredDisplayModeSettingsLocked();
             if (mIsHdrOutputControlEnabled) {
                 updateHdrConversionModeSettingsLocked();
             }
+            if (mFlags.isDisplayContentModeManagementEnabled()) {
+                updateMirrorBuiltInDisplaySettingLocked();
+            }
         }
 
         mDisplayModeDirector.setDesiredDisplayModeSpecsListener(
@@ -1180,27 +1191,61 @@
             mContext.getContentResolver().registerContentObserver(
                     Settings.Secure.getUriFor(
                         Settings.Secure.MINIMAL_POST_PROCESSING_ALLOWED), false, this);
+
+            if (mFlags.isDisplayContentModeManagementEnabled()) {
+                mContext.getContentResolver().registerContentObserver(
+                        Settings.Secure.getUriFor(
+                                MIRROR_BUILT_IN_DISPLAY), false, this, UserHandle.USER_ALL);
+            }
         }
 
         @Override
         public void onChange(boolean selfChange, Uri uri) {
-            handleSettingsChange();
+            if (Settings.Secure.getUriFor(
+                    Settings.Secure.MINIMAL_POST_PROCESSING_ALLOWED).equals(uri)) {
+                handleMinimalPostProcessingAllowedSettingChange();
+                return;
+            }
+
+            if (Settings.Secure.getUriFor(MIRROR_BUILT_IN_DISPLAY).equals(uri)) {
+                if (mFlags.isDisplayContentModeManagementEnabled()) {
+                    updateMirrorBuiltInDisplaySettingLocked();
+                }
+                return;
+            }
         }
     }
 
-    private void handleSettingsChange() {
+    private void handleMinimalPostProcessingAllowedSettingChange() {
         synchronized (mSyncRoot) {
-            updateSettingsLocked();
+            updateMinimalPostProcessingAllowedSettingLocked();
             scheduleTraversalLocked(false);
         }
     }
 
-    private void updateSettingsLocked() {
+    private void updateMinimalPostProcessingAllowedSettingLocked() {
         setMinimalPostProcessingAllowed(Settings.Secure.getIntForUser(
                 mContext.getContentResolver(), Settings.Secure.MINIMAL_POST_PROCESSING_ALLOWED,
                 1, UserHandle.USER_CURRENT) != 0);
     }
 
+    private void updateMirrorBuiltInDisplaySettingLocked() {
+        if (!mFlags.isDisplayContentModeManagementEnabled()) {
+            Slog.e(TAG, "MirrorBuiltInDisplay setting shouldn't be updated when the flag is off.");
+            return;
+        }
+
+        synchronized (mSyncRoot) {
+            ContentResolver resolver = mContext.getContentResolver();
+            final boolean mirrorBuiltInDisplay = Settings.Secure.getIntForUser(resolver,
+                    MIRROR_BUILT_IN_DISPLAY, 0, UserHandle.USER_CURRENT) != 0;
+            if (mMirrorBuiltInDisplay == mirrorBuiltInDisplay) {
+                return;
+            }
+            mMirrorBuiltInDisplay = mirrorBuiltInDisplay;
+        }
+    }
+
     private void restoreResolutionFromBackup() {
         int savedMode = Settings.Secure.getIntForUser(mContext.getContentResolver(),
                 Settings.Secure.SCREEN_RESOLUTION_MODE,
diff --git a/services/core/java/com/android/server/display/feature/DisplayManagerFlags.java b/services/core/java/com/android/server/display/feature/DisplayManagerFlags.java
index 45106f5..585fc44 100644
--- a/services/core/java/com/android/server/display/feature/DisplayManagerFlags.java
+++ b/services/core/java/com/android/server/display/feature/DisplayManagerFlags.java
@@ -256,6 +256,10 @@
             Flags.FLAG_DISPLAY_LISTENER_PERFORMANCE_IMPROVEMENTS,
             Flags::displayListenerPerformanceImprovements
     );
+    private final FlagState mEnableDisplayContentModeManagementFlagState = new FlagState(
+            Flags.FLAG_ENABLE_DISPLAY_CONTENT_MODE_MANAGEMENT,
+            Flags::enableDisplayContentModeManagement
+    );
 
     private final FlagState mSubscribeGranularDisplayEvents = new FlagState(
             Flags.FLAG_SUBSCRIBE_GRANULAR_DISPLAY_EVENTS,
@@ -556,6 +560,10 @@
         return mDisplayListenerPerformanceImprovementsFlagState.isEnabled();
     }
 
+    public boolean isDisplayContentModeManagementEnabled() {
+        return mEnableDisplayContentModeManagementFlagState.isEnabled();
+    }
+
     /**
      * @return {@code true} if the flag for subscribing to granular display events is enabled
      */
@@ -618,6 +626,7 @@
         pw.println(" " + mEnablePluginManagerFlagState);
         pw.println(" " + mDisplayListenerPerformanceImprovementsFlagState);
         pw.println(" " + mSubscribeGranularDisplayEvents);
+        pw.println(" " + mEnableDisplayContentModeManagementFlagState);
     }
 
     private static class FlagState {
diff --git a/services/core/java/com/android/server/display/plugin/PluginEventStorage.java b/services/core/java/com/android/server/display/plugin/PluginEventStorage.java
new file mode 100644
index 0000000..c58ba55
--- /dev/null
+++ b/services/core/java/com/android/server/display/plugin/PluginEventStorage.java
@@ -0,0 +1,134 @@
+/*
+ * 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.server.display.plugin;
+
+import android.util.IndentingPrintWriter;
+
+import com.android.internal.util.RingBuffer;
+
+import java.io.PrintWriter;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+
+class PluginEventStorage {
+    private static final long TIME_FRAME_LENGTH = 60_000;
+    private static final long MIN_EVENT_DELAY = 500;
+    private static final int MAX_TIME_FRAMES = 10;
+    // not thread safe
+    private static final SimpleDateFormat sDateFormat = new SimpleDateFormat(
+            "MM-dd HH:mm:ss.SSS", Locale.US);
+
+    RingBuffer<TimeFrame> mEvents = new RingBuffer<>(
+            TimeFrame::new, TimeFrame[]::new, MAX_TIME_FRAMES);
+
+    private final Map<PluginType<?>, Long> mEventTimes = new HashMap<>();
+    private long mTimeFrameStart = 0;
+    private final Map<PluginType<?>, EventCounter> mCounters = new HashMap<>();
+
+    <T> void onValueUpdated(PluginType<T> type) {
+        long eventTime = System.currentTimeMillis();
+        if (eventTime - TIME_FRAME_LENGTH > mTimeFrameStart) { // event is in next TimeFrame
+            closeCurrentTimeFrame();
+            mTimeFrameStart = eventTime;
+        }
+        updateCurrentTimeFrame(type, eventTime);
+    }
+
+    private void closeCurrentTimeFrame() {
+        if (!mCounters.isEmpty()) {
+            mEvents.append(new TimeFrame(
+                    mTimeFrameStart, mTimeFrameStart + TIME_FRAME_LENGTH, mCounters));
+            mCounters.clear();
+        }
+    }
+
+    private <T> void updateCurrentTimeFrame(PluginType<T> type, long eventTime) {
+        EventCounter counter = mCounters.get(type);
+        long previousTimestamp = mEventTimes.getOrDefault(type, 0L);
+        if (counter == null) {
+            counter = new EventCounter();
+            mCounters.put(type, counter);
+        }
+        counter.increase(eventTime, previousTimestamp);
+        mEventTimes.put(type, eventTime);
+    }
+
+    List<TimeFrame> getTimeFrames() {
+        List<TimeFrame> timeFrames = new ArrayList<>(Arrays.stream(mEvents.toArray()).toList());
+        timeFrames.add(new TimeFrame(
+                mTimeFrameStart, System.currentTimeMillis(), mCounters));
+        return timeFrames;
+    }
+
+    static class TimeFrame {
+        private final long mStart;
+        private final long mEnd;
+        private final  Map<PluginType<?>, EventCounter> mCounters;
+
+        private TimeFrame() {
+            this(0, 0, Map.of());
+        }
+
+        private TimeFrame(long start, long end, Map<PluginType<?>, EventCounter> counters) {
+            mStart = start;
+            mEnd = end;
+            mCounters = new HashMap<>(counters);
+        }
+
+        @SuppressWarnings("JavaUtilDate")
+        void dump(PrintWriter pw) {
+            pw.append("TimeFrame:[")
+                    .append(sDateFormat.format(new Date(mStart)))
+                    .append(" - ")
+                    .append(sDateFormat.format(new Date(mEnd)))
+                    .println("]:");
+            IndentingPrintWriter ipw = new IndentingPrintWriter(pw, "    ");
+            if (mCounters.isEmpty()) {
+                ipw.println("NO EVENTS");
+            } else {
+                for (Map.Entry<PluginType<?>, EventCounter> entry: mCounters.entrySet()) {
+                    ipw.append(entry.getKey().mName).append(" -> {");
+                    entry.getValue().dump(ipw);
+                    ipw.println("}");
+                }
+            }
+        }
+    }
+
+    private static class EventCounter {
+        private int mEventCounter = 0;
+        private int mFastEventCounter = 0;
+
+        private void increase(long timestamp, long previousTimestamp) {
+            mEventCounter++;
+            if (timestamp - previousTimestamp < MIN_EVENT_DELAY) {
+                mFastEventCounter++;
+            }
+        }
+
+        private void dump(PrintWriter pw) {
+            pw.append("Count:").append(String.valueOf(mEventCounter))
+                    .append("; Fast:").append(String.valueOf(mFastEventCounter));
+        }
+    }
+}
diff --git a/services/core/java/com/android/server/display/plugin/PluginStorage.java b/services/core/java/com/android/server/display/plugin/PluginStorage.java
index 2bcea77..dd3415f 100644
--- a/services/core/java/com/android/server/display/plugin/PluginStorage.java
+++ b/services/core/java/com/android/server/display/plugin/PluginStorage.java
@@ -25,6 +25,7 @@
 import java.io.PrintWriter;
 import java.util.HashMap;
 import java.util.LinkedHashSet;
+import java.util.List;
 import java.util.Map;
 import java.util.Set;
 
@@ -39,6 +40,8 @@
     private final Map<PluginType<?>, Object> mValues = new HashMap<>();
     @GuardedBy("mLock")
     private final Map<PluginType<?>, ListenersContainer<?>> mListeners = new HashMap<>();
+    @GuardedBy("mLock")
+    private final PluginEventStorage mPluginEventStorage = new PluginEventStorage();
 
     /**
      * Updates value in storage and forwards it to corresponding listeners.
@@ -50,6 +53,7 @@
         Set<PluginManager.PluginChangeListener<T>> localListeners;
         synchronized (mLock) {
             mValues.put(type, value);
+            mPluginEventStorage.onValueUpdated(type);
             ListenersContainer<T> container = getListenersContainerForTypeLocked(type);
             localListeners = new LinkedHashSet<>(container.mListeners);
         }
@@ -91,13 +95,19 @@
         Map<PluginType<?>, Object> localValues;
         @SuppressWarnings("rawtypes")
         Map<PluginType, Set> localListeners = new HashMap<>();
+        List<PluginEventStorage.TimeFrame> timeFrames;
         synchronized (mLock) {
+            timeFrames = mPluginEventStorage.getTimeFrames();
             localValues = new HashMap<>(mValues);
             mListeners.forEach((type, container) -> localListeners.put(type, container.mListeners));
         }
         pw.println("PluginStorage:");
         pw.println("values=" + localValues);
         pw.println("listeners=" + localListeners);
+        pw.println("PluginEventStorage:");
+        for (PluginEventStorage.TimeFrame timeFrame: timeFrames) {
+            timeFrame.dump(pw);
+        }
     }
 
     @GuardedBy("mLock")
diff --git a/services/core/java/com/android/server/location/contexthub/ContextHubHalEndpointCallback.java b/services/core/java/com/android/server/location/contexthub/ContextHubHalEndpointCallback.java
index 8e72553..9d52c6a 100644
--- a/services/core/java/com/android/server/location/contexthub/ContextHubHalEndpointCallback.java
+++ b/services/core/java/com/android/server/location/contexthub/ContextHubHalEndpointCallback.java
@@ -68,7 +68,7 @@
         }
         HubEndpointInfo[] endpointInfos = new HubEndpointInfo[halEndpointInfos.length];
         for (int i = 0; i < halEndpointInfos.length; i++) {
-            endpointInfos[i++] = new HubEndpointInfo(halEndpointInfos[i]);
+            endpointInfos[i] = new HubEndpointInfo(halEndpointInfos[i]);
         }
         mEndpointLifecycleCallback.onEndpointStarted(endpointInfos);
     }
diff --git a/services/core/java/com/android/server/media/quality/MediaQualityService.java b/services/core/java/com/android/server/media/quality/MediaQualityService.java
index 849751b..1673b8e 100644
--- a/services/core/java/com/android/server/media/quality/MediaQualityService.java
+++ b/services/core/java/com/android/server/media/quality/MediaQualityService.java
@@ -32,6 +32,7 @@
 import android.media.quality.SoundProfile;
 import android.media.quality.SoundProfileHandle;
 import android.os.PersistableBundle;
+import android.os.UserHandle;
 import android.util.Log;
 
 import com.android.server.SystemService;
@@ -81,7 +82,7 @@
     private final class BinderService extends IMediaQualityManager.Stub {
 
         @Override
-        public PictureProfile createPictureProfile(PictureProfile pp, int userId) {
+        public PictureProfile createPictureProfile(PictureProfile pp, UserHandle user) {
             SQLiteDatabase db = mMediaQualityDbHelper.getWritableDatabase();
 
             ContentValues values = new ContentValues();
@@ -100,12 +101,12 @@
         }
 
         @Override
-        public void updatePictureProfile(String id, PictureProfile pp, int userId) {
+        public void updatePictureProfile(String id, PictureProfile pp, UserHandle user) {
             // TODO: implement
         }
 
         @Override
-        public void removePictureProfile(String id, int userId) {
+        public void removePictureProfile(String id, UserHandle user) {
             Long intId = mPictureProfileTempIdMap.inverse().get(id);
             if (intId != null) {
                 SQLiteDatabase db = mMediaQualityDbHelper.getWritableDatabase();
@@ -118,7 +119,8 @@
         }
 
         @Override
-        public PictureProfile getPictureProfile(int type, String name, int userId) {
+        public PictureProfile getPictureProfile(int type, String name, boolean includeParams,
+                UserHandle user) {
             String selection = BaseParameters.PARAMETER_TYPE + " = ? AND "
                     + BaseParameters.PARAMETER_NAME + " = ?";
             String[] selectionArguments = {Integer.toString(type), name};
@@ -144,7 +146,8 @@
         }
 
         @Override
-        public List<PictureProfile> getPictureProfilesByPackage(String packageName, int userId) {
+        public List<PictureProfile> getPictureProfilesByPackage(
+                String packageName, boolean includeParams, UserHandle user) {
             String selection = BaseParameters.PARAMETER_PACKAGE + " = ?";
             String[] selectionArguments = {packageName};
             return getPictureProfilesBasedOnConditions(getAllMediaProfileColumns(), selection,
@@ -152,18 +155,19 @@
         }
 
         @Override
-        public List<PictureProfile> getAvailablePictureProfiles(int userId) {
+        public List<PictureProfile> getAvailablePictureProfiles(
+                boolean includeParams, UserHandle user) {
             return new ArrayList<>();
         }
 
         @Override
-        public boolean setDefaultPictureProfile(String profileId, int userId) {
+        public boolean setDefaultPictureProfile(String profileId, UserHandle user) {
             // TODO: pass the profile ID to MediaQuality HAL when ready.
             return false;
         }
 
         @Override
-        public List<String> getPictureProfilePackageNames(int userId) {
+        public List<String> getPictureProfilePackageNames(UserHandle user) {
             String [] column = {BaseParameters.PARAMETER_PACKAGE};
             List<PictureProfile> pictureProfiles = getPictureProfilesBasedOnConditions(column,
                     null, null);
@@ -174,17 +178,17 @@
         }
 
         @Override
-        public List<PictureProfileHandle> getPictureProfileHandle(String[] id, int userId) {
+        public List<PictureProfileHandle> getPictureProfileHandle(String[] id, UserHandle user) {
             return new ArrayList<>();
         }
 
         @Override
-        public List<SoundProfileHandle> getSoundProfileHandle(String[] id, int userId) {
+        public List<SoundProfileHandle> getSoundProfileHandle(String[] id, UserHandle user) {
             return new ArrayList<>();
         }
 
         @Override
-        public SoundProfile createSoundProfile(SoundProfile sp, int userId) {
+        public SoundProfile createSoundProfile(SoundProfile sp, UserHandle user) {
             SQLiteDatabase db = mMediaQualityDbHelper.getWritableDatabase();
 
             ContentValues values = new ContentValues();
@@ -203,12 +207,12 @@
         }
 
         @Override
-        public void updateSoundProfile(String id, SoundProfile pp, int userId) {
+        public void updateSoundProfile(String id, SoundProfile pp, UserHandle user) {
             // TODO: implement
         }
 
         @Override
-        public void removeSoundProfile(String id, int userId) {
+        public void removeSoundProfile(String id, UserHandle user) {
             Long intId = mSoundProfileTempIdMap.inverse().get(id);
             if (intId != null) {
                 SQLiteDatabase db = mMediaQualityDbHelper.getWritableDatabase();
@@ -221,9 +225,10 @@
         }
 
         @Override
-        public SoundProfile getSoundProfile(int type, String id, int userId) {
+        public SoundProfile getSoundProfile(int type, String id, boolean includeParams,
+                UserHandle user) {
             String selection = BaseParameters.PARAMETER_TYPE + " = ? AND "
-                    + BaseParameters.PARAMETER_NAME + " = ?";
+                    + BaseParameters.PARAMETER_ID + " = ?";
             String[] selectionArguments = {String.valueOf(type), id};
 
             try (
@@ -247,7 +252,8 @@
         }
 
         @Override
-        public List<SoundProfile> getSoundProfilesByPackage(String packageName, int userId) {
+        public List<SoundProfile> getSoundProfilesByPackage(
+                String packageName, boolean includeParams, UserHandle user) {
             String selection = BaseParameters.PARAMETER_PACKAGE + " = ?";
             String[] selectionArguments = {packageName};
             return getSoundProfilesBasedOnConditions(getAllMediaProfileColumns(), selection,
@@ -255,18 +261,19 @@
         }
 
         @Override
-        public List<SoundProfile> getAvailableSoundProfiles(int userId) {
+        public List<SoundProfile> getAvailableSoundProfiles(
+                boolean includeParams, UserHandle user) {
             return new ArrayList<>();
         }
 
         @Override
-        public boolean setDefaultSoundProfile(String profileId, int userId) {
+        public boolean setDefaultSoundProfile(String profileId, UserHandle user) {
             // TODO: pass the profile ID to MediaQuality HAL when ready.
             return false;
         }
 
         @Override
-        public List<String> getSoundProfilePackageNames(int userId) {
+        public List<String> getSoundProfilePackageNames(UserHandle user) {
             String [] column = {BaseParameters.PARAMETER_NAME};
             List<SoundProfile> soundProfiles = getSoundProfilesBasedOnConditions(column,
                     null, null);
@@ -456,70 +463,71 @@
         }
 
         @Override
-        public void setAmbientBacklightSettings(AmbientBacklightSettings settings, int userId) {
+        public void setAmbientBacklightSettings(
+                AmbientBacklightSettings settings, UserHandle user) {
         }
 
         @Override
-        public void setAmbientBacklightEnabled(boolean enabled, int userId) {
+        public void setAmbientBacklightEnabled(boolean enabled, UserHandle user) {
         }
 
         @Override
-        public List<ParamCapability> getParamCapabilities(List<String> names, int userId) {
+        public List<ParamCapability> getParamCapabilities(List<String> names, UserHandle user) {
             return new ArrayList<>();
         }
 
         @Override
-        public List<String> getPictureProfileAllowList(int userId) {
+        public List<String> getPictureProfileAllowList(UserHandle user) {
             return new ArrayList<>();
         }
 
         @Override
-        public void setPictureProfileAllowList(List<String> packages, int userId) {
+        public void setPictureProfileAllowList(List<String> packages, UserHandle user) {
         }
 
         @Override
-        public List<String> getSoundProfileAllowList(int userId) {
+        public List<String> getSoundProfileAllowList(UserHandle user) {
             return new ArrayList<>();
         }
 
         @Override
-        public void setSoundProfileAllowList(List<String> packages, int userId) {
+        public void setSoundProfileAllowList(List<String> packages, UserHandle user) {
         }
 
         @Override
-        public boolean isSupported(int userId) {
+        public boolean isSupported(UserHandle user) {
             return false;
         }
 
         @Override
-        public void setAutoPictureQualityEnabled(boolean enabled, int userId) {
+        public void setAutoPictureQualityEnabled(boolean enabled, UserHandle user) {
         }
 
         @Override
-        public boolean isAutoPictureQualityEnabled(int userId) {
+        public boolean isAutoPictureQualityEnabled(UserHandle user) {
             return false;
         }
 
         @Override
-        public void setSuperResolutionEnabled(boolean enabled, int userId) {
+        public void setSuperResolutionEnabled(boolean enabled, UserHandle user) {
         }
 
         @Override
-        public boolean isSuperResolutionEnabled(int userId) {
+        public boolean isSuperResolutionEnabled(UserHandle user) {
             return false;
         }
 
         @Override
-        public void setAutoSoundQualityEnabled(boolean enabled, int userId) {
+        public void setAutoSoundQualityEnabled(boolean enabled, UserHandle user) {
         }
 
         @Override
-        public boolean isAutoSoundQualityEnabled(int userId) {
+        public boolean isAutoSoundQualityEnabled(UserHandle user) {
             return false;
         }
 
         @Override
-        public boolean isAmbientBacklightEnabled(int userId) {
+        public boolean isAmbientBacklightEnabled(UserHandle user) {
             return false;
         }
     }
diff --git a/services/core/java/com/android/server/notification/NotificationManagerService.java b/services/core/java/com/android/server/notification/NotificationManagerService.java
index 15af36b..39eea74 100644
--- a/services/core/java/com/android/server/notification/NotificationManagerService.java
+++ b/services/core/java/com/android/server/notification/NotificationManagerService.java
@@ -2594,6 +2594,7 @@
                     intent.setPackage(pkg);
                     intent.putExtra(EXTRA_AUTOMATIC_ZEN_RULE_ID, id);
                     intent.putExtra(EXTRA_AUTOMATIC_ZEN_RULE_STATUS, status);
+                    intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT);
                     getContext().sendBroadcastAsUser(intent, UserHandle.of(userId));
                 });
             }
diff --git a/services/core/java/com/android/server/notification/ZenModeHelper.java b/services/core/java/com/android/server/notification/ZenModeHelper.java
index dc173b1..95aff56 100644
--- a/services/core/java/com/android/server/notification/ZenModeHelper.java
+++ b/services/core/java/com/android/server/notification/ZenModeHelper.java
@@ -112,9 +112,10 @@
 import android.util.StatsEvent;
 import android.util.proto.ProtoOutputStream;
 
+import androidx.annotation.VisibleForTesting;
+
 import com.android.internal.R;
 import com.android.internal.annotations.GuardedBy;
-import com.android.internal.annotations.VisibleForTesting;
 import com.android.internal.config.sysui.SystemUiSystemPropertiesFlags;
 import com.android.internal.logging.MetricsLogger;
 import com.android.internal.util.FrameworkStatsLog;
@@ -279,6 +280,11 @@
         mCallbacks.remove(callback);
     }
 
+    @VisibleForTesting(otherwise = VisibleForTesting.NONE)
+    public List<Callback> getCallbacks() {
+        return mCallbacks;
+    }
+
     public void initZenMode() {
         if (DEBUG) Log.d(TAG, "initZenMode");
         synchronized (mConfigLock) {
diff --git a/services/core/java/com/android/server/ondeviceintelligence/OWNERS b/services/core/java/com/android/server/ondeviceintelligence/OWNERS
deleted file mode 100644
index 09774f7..0000000
--- a/services/core/java/com/android/server/ondeviceintelligence/OWNERS
+++ /dev/null
@@ -1 +0,0 @@
-file:/core/java/android/app/ondeviceintelligence/OWNERS
diff --git a/services/core/java/com/android/server/os/instrumentation/DynamicInstrumentationManagerService.java b/services/core/java/com/android/server/os/instrumentation/DynamicInstrumentationManagerService.java
index 8ec7160..871d12e 100644
--- a/services/core/java/com/android/server/os/instrumentation/DynamicInstrumentationManagerService.java
+++ b/services/core/java/com/android/server/os/instrumentation/DynamicInstrumentationManagerService.java
@@ -20,116 +20,100 @@
 import static android.content.Context.DYNAMIC_INSTRUMENTATION_SERVICE;
 
 import android.annotation.NonNull;
-import android.annotation.Nullable;
 import android.annotation.PermissionManuallyEnforced;
+import android.annotation.RequiresPermission;
+import android.app.ActivityManagerInternal;
 import android.content.Context;
+import android.os.RemoteException;
 import android.os.instrumentation.ExecutableMethodFileOffsets;
 import android.os.instrumentation.IDynamicInstrumentationManager;
+import android.os.instrumentation.IOffsetCallback;
 import android.os.instrumentation.MethodDescriptor;
+import android.os.instrumentation.MethodDescriptorParser;
 import android.os.instrumentation.TargetProcess;
 
-import com.android.internal.annotations.VisibleForTesting;
+
+import com.android.server.LocalServices;
 import com.android.server.SystemService;
 
 import dalvik.system.VMDebug;
 
 import java.lang.reflect.Method;
+import java.util.NoSuchElementException;
+import java.util.Objects;
+
 
 /**
  * System private implementation of the {@link IDynamicInstrumentationManager interface}.
  */
 public class DynamicInstrumentationManagerService extends SystemService {
+
+    private ActivityManagerInternal mAmInternal;
+
     public DynamicInstrumentationManagerService(@NonNull Context context) {
         super(context);
     }
 
     @Override
     public void onStart() {
+        mAmInternal = LocalServices.getService(ActivityManagerInternal.class);
         publishBinderService(DYNAMIC_INSTRUMENTATION_SERVICE, new BinderService());
     }
 
     private final class BinderService extends IDynamicInstrumentationManager.Stub {
         @Override
         @PermissionManuallyEnforced
-        public @Nullable ExecutableMethodFileOffsets getExecutableMethodFileOffsets(
-                @NonNull TargetProcess targetProcess, @NonNull MethodDescriptor methodDescriptor) {
+        @RequiresPermission(value = android.Manifest.permission.DYNAMIC_INSTRUMENTATION)
+        public void getExecutableMethodFileOffsets(
+                @NonNull TargetProcess targetProcess, @NonNull MethodDescriptor methodDescriptor,
+                @NonNull IOffsetCallback callback) {
             if (!com.android.art.flags.Flags.executableMethodFileOffsets()) {
                 throw new UnsupportedOperationException();
             }
             getContext().enforceCallingOrSelfPermission(
                     DYNAMIC_INSTRUMENTATION, "Caller must have DYNAMIC_INSTRUMENTATION permission");
+            Objects.requireNonNull(targetProcess.processName);
 
-            if (targetProcess.processName == null
-                    || !targetProcess.processName.equals("system_server")) {
-                throw new UnsupportedOperationException(
-                        "system_server is the only supported target process");
+            if (!targetProcess.processName.equals("system_server")) {
+                try {
+                    mAmInternal.getExecutableMethodFileOffsets(targetProcess.processName,
+                            targetProcess.pid, targetProcess.uid, methodDescriptor,
+                            new IOffsetCallback.Stub() {
+                                @Override
+                                public void onResult(ExecutableMethodFileOffsets result) {
+                                    try {
+                                        callback.onResult(result);
+                                    } catch (RemoteException e) {
+                                        /* ignore */
+                                    }
+                                }
+                            });
+                    return;
+                } catch (NoSuchElementException e) {
+                    throw new IllegalArgumentException(
+                            "The specified app process cannot be found." , e);
+                }
             }
 
-            Method method = parseMethodDescriptor(
+            Method method = MethodDescriptorParser.parseMethodDescriptor(
                     getClass().getClassLoader(), methodDescriptor);
             VMDebug.ExecutableMethodFileOffsets location =
                     VMDebug.getExecutableMethodFileOffsets(method);
 
-            if (location == null) {
-                return null;
-            }
-
-            ExecutableMethodFileOffsets ret = new ExecutableMethodFileOffsets();
-            ret.containerPath = location.getContainerPath();
-            ret.containerOffset = location.getContainerOffset();
-            ret.methodOffset = location.getMethodOffset();
-            return ret;
-        }
-    }
-
-    @VisibleForTesting
-    static Method parseMethodDescriptor(ClassLoader classLoader,
-            @NonNull MethodDescriptor descriptor) {
-        try {
-            Class<?> javaClass = classLoader.loadClass(descriptor.fullyQualifiedClassName);
-            Class<?>[] parameters = new Class[descriptor.fullyQualifiedParameters.length];
-            for (int i = 0; i < descriptor.fullyQualifiedParameters.length; i++) {
-                String typeName = descriptor.fullyQualifiedParameters[i];
-                boolean isArrayType = typeName.endsWith("[]");
-                if (isArrayType) {
-                    typeName = typeName.substring(0, typeName.length() - 2);
+            try {
+                if (location == null) {
+                    callback.onResult(null);
+                    return;
                 }
-                switch (typeName) {
-                    case "boolean":
-                        parameters[i] = isArrayType ? boolean.class.arrayType() : boolean.class;
-                        break;
-                    case "byte":
-                        parameters[i] = isArrayType ? byte.class.arrayType() : byte.class;
-                        break;
-                    case "char":
-                        parameters[i] = isArrayType ? char.class.arrayType() : char.class;
-                        break;
-                    case "short":
-                        parameters[i] = isArrayType ? short.class.arrayType() : short.class;
-                        break;
-                    case "int":
-                        parameters[i] = isArrayType ? int.class.arrayType() : int.class;
-                        break;
-                    case "long":
-                        parameters[i] = isArrayType ? long.class.arrayType() : long.class;
-                        break;
-                    case "float":
-                        parameters[i] = isArrayType ? float.class.arrayType() : float.class;
-                        break;
-                    case "double":
-                        parameters[i] = isArrayType ? double.class.arrayType() : double.class;
-                        break;
-                    default:
-                        parameters[i] = isArrayType ? classLoader.loadClass(typeName).arrayType()
-                                : classLoader.loadClass(typeName);
-                }
-            }
 
-            return javaClass.getDeclaredMethod(descriptor.methodName, parameters);
-        } catch (ClassNotFoundException | NoSuchMethodException e) {
-            throw new IllegalArgumentException(
-                    "The specified method cannot be found. Is this descriptor valid? "
-                            + descriptor, e);
+                ExecutableMethodFileOffsets ret = new ExecutableMethodFileOffsets();
+                ret.containerPath = location.getContainerPath();
+                ret.containerOffset = location.getContainerOffset();
+                ret.methodOffset = location.getMethodOffset();
+                callback.onResult(ret);
+            } catch (RemoteException e) {
+                throw new RuntimeException("Failed to invoke result callback", e);
+            }
         }
     }
 }
diff --git a/services/core/java/com/android/server/pm/ComputerEngine.java b/services/core/java/com/android/server/pm/ComputerEngine.java
index 58b1e49..be2f58d 100644
--- a/services/core/java/com/android/server/pm/ComputerEngine.java
+++ b/services/core/java/com/android/server/pm/ComputerEngine.java
@@ -138,7 +138,8 @@
 import com.android.internal.util.IndentingPrintWriter;
 import com.android.internal.util.Preconditions;
 import com.android.modules.utils.TypedXmlSerializer;
-import com.android.server.ondeviceintelligence.OnDeviceIntelligenceManagerInternal;
+import com.android.server.LocalManagerRegistry;
+import com.android.server.ondeviceintelligence.OnDeviceIntelligenceManagerLocal;
 import com.android.server.pm.dex.DexManager;
 import com.android.server.pm.dex.PackageDexUsage;
 import com.android.server.pm.parsing.PackageInfoUtils;
@@ -5851,10 +5852,10 @@
         if (isHotword) {
             return true;
         }
-        OnDeviceIntelligenceManagerInternal onDeviceIntelligenceManagerInternal =
-                mInjector.getLocalService(OnDeviceIntelligenceManagerInternal.class);
-        return onDeviceIntelligenceManagerInternal != null
-                && uid == onDeviceIntelligenceManagerInternal.getInferenceServiceUid();
+        OnDeviceIntelligenceManagerLocal onDeviceIntelligenceManagerLocal =
+                LocalManagerRegistry.getManager(OnDeviceIntelligenceManagerLocal.class);
+        return onDeviceIntelligenceManagerLocal != null
+                && uid == onDeviceIntelligenceManagerLocal.getInferenceServiceUid();
     }
 
     @Nullable
diff --git a/services/core/java/com/android/server/pm/PackageMonitorCallbackHelper.java b/services/core/java/com/android/server/pm/PackageMonitorCallbackHelper.java
index 4b82de0..ef49f49 100644
--- a/services/core/java/com/android/server/pm/PackageMonitorCallbackHelper.java
+++ b/services/core/java/com/android/server/pm/PackageMonitorCallbackHelper.java
@@ -34,6 +34,7 @@
 import android.os.RemoteException;
 import android.os.UserHandle;
 import android.text.TextUtils;
+import android.util.Pair;
 import android.util.Slog;
 import android.util.SparseArray;
 
@@ -196,21 +197,13 @@
 
     private void doNotifyCallbacksByIntent(Intent intent, int userId,
             int[] broadcastAllowList, Handler handler) {
-        RemoteCallbackList<IRemoteCallback> callbacks;
-        synchronized (mLock) {
-            callbacks = mCallbacks;
-        }
-        doNotifyCallbacks(callbacks, intent, userId, broadcastAllowList, handler,
+        doNotifyCallbacks(intent, userId, broadcastAllowList, handler,
                 null /* filterExtrasFunction */);
     }
 
     private void doNotifyCallbacksByAction(String action, String pkg, Bundle extras, int[] userIds,
             SparseArray<int[]> broadcastAllowList, Handler handler,
             BiFunction<Integer, Bundle, Bundle> filterExtrasFunction) {
-        RemoteCallbackList<IRemoteCallback> callbacks;
-        synchronized (mLock) {
-            callbacks = mCallbacks;
-        }
         for (int userId : userIds) {
             final Intent intent = new Intent(action,
                     pkg != null ? Uri.fromParts(PACKAGE_SCHEME, pkg, null) : null);
@@ -226,48 +219,58 @@
 
             final int[] allowUids =
                     broadcastAllowList != null ? broadcastAllowList.get(userId) : null;
-            doNotifyCallbacks(callbacks, intent, userId, allowUids, handler, filterExtrasFunction);
+            doNotifyCallbacks(intent, userId, allowUids, handler, filterExtrasFunction);
         }
     }
 
-    private void doNotifyCallbacks(RemoteCallbackList<IRemoteCallback> callbacks,
-            Intent intent, int userId, int[] allowUids, Handler handler,
+    private void doNotifyCallbacks(Intent intent, int userId, int[] allowUids, Handler handler,
             BiFunction<Integer, Bundle, Bundle> filterExtrasFunction) {
-        handler.post(() -> callbacks.broadcast((callback, user) -> {
-            RegisterUser registerUser = (RegisterUser) user;
-            if ((registerUser.getUserId() != UserHandle.USER_ALL) && (registerUser.getUserId()
-                    != userId)) {
-                return;
-            }
-            int registerUid = registerUser.getUid();
-            if (allowUids != null && !UserHandle.isSameApp(registerUid, Process.SYSTEM_UID)
-                    && !ArrayUtils.contains(allowUids, registerUid)) {
-                if (DEBUG) {
-                    Slog.w(TAG, "Skip invoke PackageMonitorCallback for " + intent.getAction()
-                            + ", uid " + registerUid);
-                }
-                return;
-            }
-            Intent newIntent = intent;
-            if (filterExtrasFunction != null) {
-                final Bundle extras = intent.getExtras();
-                if (extras != null) {
-                    final Bundle filteredExtras = filterExtrasFunction.apply(registerUid, extras);
-                    if (filteredExtras == null) {
-                        // caller is unable to access this intent
+        handler.post(() -> {
+            final ArrayList<Pair<IRemoteCallback, Intent>> target = new ArrayList<>();
+            synchronized (mLock) {
+                mCallbacks.broadcast((callback, user) -> {
+                    RegisterUser registerUser = (RegisterUser) user;
+                    if ((registerUser.getUserId() != UserHandle.USER_ALL)
+                            && (registerUser.getUserId() != userId)) {
+                        return;
+                    }
+                    int registerUid = registerUser.getUid();
+                    if (allowUids != null && !UserHandle.isSameApp(registerUid, Process.SYSTEM_UID)
+                            && !ArrayUtils.contains(allowUids, registerUid)) {
                         if (DEBUG) {
-                            Slog.w(TAG,
-                                    "Skip invoke PackageMonitorCallback for " + intent.getAction()
-                                            + " because null filteredExtras");
+                            Slog.w(TAG, "Skip invoke PackageMonitorCallback for "
+                                    + intent.getAction() + ", uid " + registerUid);
                         }
                         return;
                     }
-                    newIntent = new Intent(newIntent);
-                    newIntent.replaceExtras(filteredExtras);
-                }
+                    Intent newIntent = intent;
+                    if (filterExtrasFunction != null) {
+                        final Bundle extras = intent.getExtras();
+                        if (extras != null) {
+                            final Bundle filteredExtras =
+                                    filterExtrasFunction.apply(registerUid, extras);
+                            if (filteredExtras == null) {
+                                // caller is unable to access this intent
+                                if (DEBUG) {
+                                    Slog.w(TAG,
+                                            "Skip invoke PackageMonitorCallback for "
+                                                    + intent.getAction()
+                                                    + " because null filteredExtras");
+                                }
+                                return;
+                            }
+                            newIntent = new Intent(newIntent);
+                            newIntent.replaceExtras(filteredExtras);
+                        }
+                    }
+                    target.add(new Pair<>(callback, newIntent));
+                });
             }
-            invokeCallback(callback, newIntent);
-        }));
+            for (int i = 0; i < target.size(); i++) {
+                Pair<IRemoteCallback, Intent> p = target.get(i);
+                invokeCallback(p.first, p.second);
+            }
+        });
     }
 
     private void invokeCallback(IRemoteCallback callback, Intent intent) {
diff --git a/services/core/java/com/android/server/pm/SaferIntentUtils.java b/services/core/java/com/android/server/pm/SaferIntentUtils.java
index 854e142..ec91da9 100644
--- a/services/core/java/com/android/server/pm/SaferIntentUtils.java
+++ b/services/core/java/com/android/server/pm/SaferIntentUtils.java
@@ -213,6 +213,7 @@
      * CTS tests. The code in this method shall properly avoid control flows using these arguments.
      */
     public static void blockNullAction(IntentArgs args, List componentList) {
+        if (args.intent.getAction() != null) return;
         if (ActivityManager.canAccessUnexportedComponents(args.callingUid)) return;
 
         final Computer computer = (Computer) args.snapshot;
@@ -235,14 +236,11 @@
                 }
                 final ParsedMainComponent comp = infoToComponent(
                         resolveInfo.getComponentInfo(), resolver, args.isReceiver);
-                if (comp != null && !comp.getIntents().isEmpty()
-                        && args.intent.getAction() == null) {
+                if (comp != null && !comp.getIntents().isEmpty()) {
                     match = false;
                 }
             } else if (c instanceof IntentFilter) {
-                if (args.intent.getAction() == null) {
-                    match = false;
-                }
+                match = false;
             }
 
             if (!match) {
diff --git a/services/core/java/com/android/server/pm/TEST_MAPPING b/services/core/java/com/android/server/pm/TEST_MAPPING
index 94b49e5..1fda478 100644
--- a/services/core/java/com/android/server/pm/TEST_MAPPING
+++ b/services/core/java/com/android/server/pm/TEST_MAPPING
@@ -165,6 +165,22 @@
       ]
     },
     {
+      "name": "CtsPackageInstallerCUJUpdateOwnerShipTestCases",
+      "file_patterns": [
+        "core/java/.*Install.*",
+        "services/core/.*Install.*",
+        "services/core/java/com/android/server/pm/.*"
+      ],
+      "options":[
+          {
+              "exclude-annotation":"androidx.test.filters.FlakyTest"
+          },
+          {
+              "exclude-annotation":"org.junit.Ignore"
+          }
+      ]
+    },
+    {
       "name": "CtsPackageInstallerCUJUpdateSelfTestCases",
       "file_patterns": [
         "core/java/.*Install.*",
diff --git a/services/core/java/com/android/server/policy/EventLogTags.logtags b/services/core/java/com/android/server/policy/EventLogTags.logtags
index 7563382..a4b6472 100644
--- a/services/core/java/com/android/server/policy/EventLogTags.logtags
+++ b/services/core/java/com/android/server/policy/EventLogTags.logtags
@@ -1,4 +1,4 @@
-# See system/core/logcat/event.logtags for a description of the format of this file.
+# See system/logging/logcat/event.logtags for a description of the format of this file.
 
 option java_package com.android.server.policy
 
diff --git a/services/core/java/com/android/server/policy/PhoneWindowManager.java b/services/core/java/com/android/server/policy/PhoneWindowManager.java
index 7c4d425..f1a4811 100644
--- a/services/core/java/com/android/server/policy/PhoneWindowManager.java
+++ b/services/core/java/com/android/server/policy/PhoneWindowManager.java
@@ -4081,6 +4081,7 @@
                     case KeyGestureEvent.KEY_GESTURE_TYPE_RECENT_APPS:
                     case KeyGestureEvent.KEY_GESTURE_TYPE_APP_SWITCH:
                     case KeyGestureEvent.KEY_GESTURE_TYPE_LAUNCH_ASSISTANT:
+                    case KeyGestureEvent.KEY_GESTURE_TYPE_LAUNCH_VOICE_ASSISTANT:
                     case KeyGestureEvent.KEY_GESTURE_TYPE_HOME:
                     case KeyGestureEvent.KEY_GESTURE_TYPE_LAUNCH_SYSTEM_SETTINGS:
                     case KeyGestureEvent.KEY_GESTURE_TYPE_LOCK_SCREEN:
@@ -4164,6 +4165,7 @@
                 }
                 return true;
             case KeyGestureEvent.KEY_GESTURE_TYPE_LAUNCH_ASSISTANT:
+            case KeyGestureEvent.KEY_GESTURE_TYPE_LAUNCH_VOICE_ASSISTANT:
                 if (complete) {
                     launchAssistAction(Intent.EXTRA_ASSIST_INPUT_HINT_KEYBOARD,
                             deviceId, SystemClock.uptimeMillis(),
diff --git a/services/core/java/com/android/server/security/intrusiondetection/DataAggregator.java b/services/core/java/com/android/server/security/intrusiondetection/DataAggregator.java
index 0ea88e8..687442b 100644
--- a/services/core/java/com/android/server/security/intrusiondetection/DataAggregator.java
+++ b/services/core/java/com/android/server/security/intrusiondetection/DataAggregator.java
@@ -28,6 +28,7 @@
 
 import java.util.ArrayList;
 import java.util.List;
+import java.util.concurrent.atomic.AtomicBoolean;
 
 public class DataAggregator {
     private static final String TAG = "IntrusionDetection DataAggregator";
@@ -36,11 +37,10 @@
     private static final int MSG_DISABLE = 2;
 
     private static final int STORED_EVENTS_SIZE_LIMIT = 1024;
-    private static final IntrusionDetectionAdminReceiver ADMIN_RECEIVER =
-            new IntrusionDetectionAdminReceiver();
 
     private final IntrusionDetectionService mIntrusionDetectionService;
     private final ArrayList<DataSource> mDataSources;
+    private final AtomicBoolean mIsLoggingInitialized = new AtomicBoolean(false);
 
     private Context mContext;
     private List<IntrusionDetectionEvent> mStoredEvents = new ArrayList<>();
@@ -59,30 +59,20 @@
         mHandler = new EventHandler(looper, this);
     }
 
-    /**
-     * Initialize DataSources
-     * @return Whether the initialization succeeds.
-     */
-    public boolean initialize() {
-        SecurityLogSource securityLogSource = new SecurityLogSource(mContext, this);
-        mDataSources.add(securityLogSource);
-
-        NetworkLogSource networkLogSource = new NetworkLogSource(mContext, this);
-        ADMIN_RECEIVER.setNetworkLogEventCallback(networkLogSource);
-        mDataSources.add(networkLogSource);
-
-        for (DataSource ds : mDataSources) {
-            if (!ds.initialize()) {
-                return false;
-            }
-        }
-        return true;
+    /** Initialize DataSources */
+    private void initialize() {
+        mDataSources.add(new SecurityLogSource(mContext, this));
+        mDataSources.add(new NetworkLogSource(mContext, this));
     }
 
     /**
      * Enable the data collection of all DataSources.
      */
     public void enable() {
+        if (!mIsLoggingInitialized.get()) {
+            initialize();
+            mIsLoggingInitialized.set(true);
+        }
         mHandlerThread = new ServiceThread(TAG, android.os.Process.THREAD_PRIORITY_BACKGROUND,
                 /* allowIo */ false);
         mHandlerThread.start();
@@ -111,9 +101,6 @@
      */
     public void disable() {
         mHandler.obtainMessage(MSG_DISABLE).sendToTarget();
-        for (DataSource ds : mDataSources) {
-            ds.disable();
-        }
     }
 
     private void onNewSingleData(IntrusionDetectionEvent event) {
diff --git a/services/core/java/com/android/server/security/intrusiondetection/DataSource.java b/services/core/java/com/android/server/security/intrusiondetection/DataSource.java
index 61fac46..0bc4482 100644
--- a/services/core/java/com/android/server/security/intrusiondetection/DataSource.java
+++ b/services/core/java/com/android/server/security/intrusiondetection/DataSource.java
@@ -18,11 +18,6 @@
 
 public interface DataSource {
     /**
-     * Initialize the data source.
-     */
-    boolean initialize();
-
-    /**
      * Enable the data collection.
      */
     void enable();
diff --git a/services/core/java/com/android/server/security/intrusiondetection/IntrusionDetectionAdminReceiver.java b/services/core/java/com/android/server/security/intrusiondetection/IntrusionDetectionAdminReceiver.java
deleted file mode 100644
index dba7374..0000000
--- a/services/core/java/com/android/server/security/intrusiondetection/IntrusionDetectionAdminReceiver.java
+++ /dev/null
@@ -1,42 +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.server.security.intrusiondetection;
-
-import android.app.admin.DeviceAdminReceiver;
-import android.content.Context;
-import android.content.Intent;
-import android.util.Slog;
-
-public class IntrusionDetectionAdminReceiver extends DeviceAdminReceiver {
-    private static final String TAG = "IntrusionDetectionAdminReceiver";
-
-    private static NetworkLogSource sNetworkLogSource;
-
-    @Override
-    public void onNetworkLogsAvailable(
-            Context context, Intent intent, long batchToken, int networkLogsCount) {
-        if (sNetworkLogSource != null) {
-            sNetworkLogSource.onNetworkLogsAvailable(batchToken);
-        } else {
-            Slog.w(TAG, "Network log receiver is not initialized");
-        }
-    }
-
-    public void setNetworkLogEventCallback(NetworkLogSource networkLogSource) {
-        sNetworkLogSource = networkLogSource;
-    }
-}
diff --git a/services/core/java/com/android/server/security/intrusiondetection/IntrusionDetectionEventTransportConnection.java b/services/core/java/com/android/server/security/intrusiondetection/IntrusionDetectionEventTransportConnection.java
index 2ddbeab..a16e66d 100644
--- a/services/core/java/com/android/server/security/intrusiondetection/IntrusionDetectionEventTransportConnection.java
+++ b/services/core/java/com/android/server/security/intrusiondetection/IntrusionDetectionEventTransportConnection.java
@@ -50,7 +50,7 @@
     private static final String PRODUCTION_BUILD = "user";
     private static final String PROPERTY_BUILD_TYPE = "ro.build.type";
     private static final String PROPERTY_INTRUSION_DETECTION_SERVICE_NAME =
-            "intrusiondetection_service_name";
+            "debug.intrusiondetection_package_name";
     private static final long FUTURE_TIMEOUT_MILLIS = 60 * 1000; // 1 min
     private static final String TAG = "IntrusionDetectionEventTransportConnection";
     private final Context mContext;
@@ -147,9 +147,9 @@
     }
 
     private String getSystemPropertyValue(String propertyName) {
-        String comamandString = "getprop " + propertyName;
+        String commandString = "getprop " + propertyName;
         try {
-            Process process = Runtime.getRuntime().exec(comamandString);
+            Process process = Runtime.getRuntime().exec(commandString);
             BufferedReader reader =
                     new BufferedReader(new InputStreamReader(process.getInputStream()));
             String propertyValue = reader.readLine();
@@ -175,6 +175,10 @@
             mIntrusionDetectionEventTransportConfig =
                     getSystemPropertyValue(PROPERTY_INTRUSION_DETECTION_SERVICE_NAME);
         }
+        Slog.d(
+                TAG,
+                "mIntrusionDetectionEventTransportConfig: "
+                        + mIntrusionDetectionEventTransportConfig);
 
         if (TextUtils.isEmpty(mIntrusionDetectionEventTransportConfig)) {
             Slog.e(TAG, "Unable to find a valid config for the transport service");
diff --git a/services/core/java/com/android/server/security/intrusiondetection/IntrusionDetectionService.java b/services/core/java/com/android/server/security/intrusiondetection/IntrusionDetectionService.java
index 0287b41..8ff1c7f 100644
--- a/services/core/java/com/android/server/security/intrusiondetection/IntrusionDetectionService.java
+++ b/services/core/java/com/android/server/security/intrusiondetection/IntrusionDetectionService.java
@@ -232,12 +232,10 @@
             return;
         }
 
-        // TODO: temporarily disable the following for the CTS IntrusionDetectionManagerTest.
-        //  Enable it when the transport component is ready.
-        // if (!mIntrusionDetectionEventTransportConnection.initialize()) {
-        //     callback.onFailure(ERROR_TRANSPORT_UNAVAILABLE);
-        //   return;
-        // }
+        if (!mIntrusionDetectionEventTransportConnection.initialize()) {
+            callback.onFailure(ERROR_TRANSPORT_UNAVAILABLE);
+            return;
+        }
 
         mDataAggregator.enable();
         mState = STATE_ENABLED;
@@ -252,9 +250,7 @@
             return;
         }
 
-        // TODO: temporarily disable the following for the CTS IntrusionDetectionManagerTest.
-        //  Enable it when the transport component is ready.
-        // mIntrusionDetectionEventTransportConnection.release();
+        mIntrusionDetectionEventTransportConnection.release();
         mDataAggregator.disable();
         mState = STATE_DISABLED;
         notifyStateMonitors();
diff --git a/services/core/java/com/android/server/security/intrusiondetection/NetworkLogSource.java b/services/core/java/com/android/server/security/intrusiondetection/NetworkLogSource.java
index 1c93d3f..083b1fd 100644
--- a/services/core/java/com/android/server/security/intrusiondetection/NetworkLogSource.java
+++ b/services/core/java/com/android/server/security/intrusiondetection/NetworkLogSource.java
@@ -17,118 +17,131 @@
 package com.android.server.security.intrusiondetection;
 
 import android.app.admin.ConnectEvent;
-import android.app.admin.DevicePolicyManager;
 import android.app.admin.DnsEvent;
-import android.app.admin.NetworkEvent;
-import android.content.ComponentName;
 import android.content.Context;
+import android.content.pm.PackageManagerInternal;
+import android.net.IIpConnectivityMetrics;
+import android.net.INetdEventCallback;
+import android.net.metrics.IpConnectivityLog;
+import android.os.RemoteException;
+import android.os.ServiceManager;
 import android.security.intrusiondetection.IntrusionDetectionEvent;
 import android.util.Slog;
 
-import java.util.List;
-import java.util.stream.Collectors;
+import com.android.server.LocalServices;
+import com.android.server.net.BaseNetdEventCallback;
+
+import java.util.concurrent.atomic.AtomicBoolean;
 
 public class NetworkLogSource implements DataSource {
 
     private static final String TAG = "IntrusionDetectionEvent NetworkLogSource";
+    private final AtomicBoolean mIsNetworkLoggingEnabled = new AtomicBoolean(false);
+    private final PackageManagerInternal mPm;
 
-    private DevicePolicyManager mDpm;
-    private ComponentName mAdmin;
     private DataAggregator mDataAggregator;
 
-    public NetworkLogSource(Context context, DataAggregator dataAggregator) {
+    private IIpConnectivityMetrics mIpConnectivityMetrics;
+    private long mId;
+
+    public NetworkLogSource(Context context, DataAggregator dataAggregator)
+            throws SecurityException {
         mDataAggregator = dataAggregator;
-        mDpm = context.getSystemService(DevicePolicyManager.class);
-        mAdmin = new ComponentName(context, IntrusionDetectionAdminReceiver.class);
+        mPm = LocalServices.getService(PackageManagerInternal.class);
+        mId = 0;
+        initIpConnectivityMetrics();
     }
 
-    @Override
-    public boolean initialize() {
-        try {
-            if (!mDpm.isAdminActive(mAdmin)) {
-                Slog.e(TAG, "Admin " + mAdmin.flattenToString() + "is not active admin");
-                return false;
-            }
-        } catch (SecurityException e) {
-            Slog.e(TAG, "Security exception in initialize: ", e);
-            return false;
-        }
-        return true;
+    private void initIpConnectivityMetrics() {
+        mIpConnectivityMetrics =
+                (IIpConnectivityMetrics)
+                        IIpConnectivityMetrics.Stub.asInterface(
+                                ServiceManager.getService(IpConnectivityLog.SERVICE_NAME));
     }
 
     @Override
     public void enable() {
-        enableNetworkLog();
+        if (mIsNetworkLoggingEnabled.get()) {
+            Slog.w(TAG, "Network logging is already enabled");
+            return;
+        }
+        try {
+            if (mIpConnectivityMetrics.addNetdEventCallback(
+                    INetdEventCallback.CALLBACK_CALLER_DEVICE_POLICY, mNetdEventCallback)) {
+                mIsNetworkLoggingEnabled.set(true);
+            } else {
+                Slog.e(TAG, "Failed to enable network logging; invalid callback");
+            }
+        } catch (RemoteException e) {
+            Slog.e(TAG, "Failed to enable network logging; ", e);
+        }
     }
 
     @Override
     public void disable() {
-        disableNetworkLog();
-    }
-
-    private void enableNetworkLog() {
-        if (!isNetworkLogEnabled()) {
-            mDpm.setNetworkLoggingEnabled(mAdmin, true);
+        if (!mIsNetworkLoggingEnabled.get()) {
+            Slog.w(TAG, "Network logging is already disabled");
+            return;
         }
-    }
-
-    private void disableNetworkLog() {
-        if (isNetworkLogEnabled()) {
-            mDpm.setNetworkLoggingEnabled(mAdmin, false);
-        }
-    }
-
-    private boolean isNetworkLogEnabled() {
-        return mDpm.isNetworkLoggingEnabled(mAdmin);
-    }
-
-    /**
-     * Retrieve network logs when onNetworkLogsAvailable callback is received.
-     *
-     * @param batchToken The token representing the current batch of network logs.
-     */
-    public void onNetworkLogsAvailable(long batchToken) {
-        List<NetworkEvent> events;
         try {
-            events = mDpm.retrieveNetworkLogs(mAdmin, batchToken);
-        } catch (SecurityException e) {
-            Slog.e(
-                    TAG,
-                    "Admin "
-                            + mAdmin.flattenToString()
-                            + "does not have permission to retrieve network logs",
-                    e);
-            return;
-        }
-        if (events == null) {
-            if (!isNetworkLogEnabled()) {
-                Slog.w(TAG, "Network logging is disabled");
+            if (!mIpConnectivityMetrics.removeNetdEventCallback(
+                    INetdEventCallback.CALLBACK_CALLER_NETWORK_WATCHLIST)) {
+
+                mIsNetworkLoggingEnabled.set(false);
             } else {
-                Slog.e(TAG, "Invalid batch token: " + batchToken);
+                Slog.e(TAG, "Failed to enable network logging; invalid callback");
             }
-            return;
+        } catch (RemoteException e) {
+            Slog.e(TAG, "Failed to disable network logging; ", e);
         }
-
-        List<IntrusionDetectionEvent> intrusionDetectionEvents =
-                events.stream()
-                        .filter(event -> event != null)
-                        .map(event -> toIntrusionDetectionEvent(event))
-                        .collect(Collectors.toList());
-        mDataAggregator.addBatchData(intrusionDetectionEvents);
     }
 
-    private IntrusionDetectionEvent toIntrusionDetectionEvent(NetworkEvent event) {
-        if (event instanceof DnsEvent) {
-            DnsEvent dnsEvent = (DnsEvent) event;
-            return new IntrusionDetectionEvent(dnsEvent);
-        } else if (event instanceof ConnectEvent) {
-            ConnectEvent connectEvent = (ConnectEvent) event;
-            return new IntrusionDetectionEvent(connectEvent);
+    private void incrementEventID() {
+        if (mId == Long.MAX_VALUE) {
+            Slog.i(TAG, "Reached maximum id value; wrapping around.");
+            mId = 0;
+        } else {
+            mId++;
         }
-        throw new IllegalArgumentException(
-                "Invalid event type with ID: "
-                        + event.getId()
-                        + "from package: "
-                        + event.getPackageName());
     }
+
+    private final INetdEventCallback mNetdEventCallback =
+            new BaseNetdEventCallback() {
+                @Override
+                public void onDnsEvent(
+                        int netId,
+                        int eventType,
+                        int returnCode,
+                        String hostname,
+                        String[] ipAddresses,
+                        int ipAddressesCount,
+                        long timestamp,
+                        int uid) {
+                    if (!mIsNetworkLoggingEnabled.get()) {
+                        return;
+                    }
+                    DnsEvent dnsEvent =
+                            new DnsEvent(
+                                    hostname,
+                                    ipAddresses,
+                                    ipAddressesCount,
+                                    mPm.getNameForUid(uid),
+                                    timestamp);
+                    dnsEvent.setId(mId);
+                    incrementEventID();
+                    mDataAggregator.addSingleData(new IntrusionDetectionEvent(dnsEvent));
+                }
+
+                @Override
+                public void onConnectEvent(String ipAddr, int port, long timestamp, int uid) {
+                    if (!mIsNetworkLoggingEnabled.get()) {
+                        return;
+                    }
+                    ConnectEvent connectEvent =
+                            new ConnectEvent(ipAddr, port, mPm.getNameForUid(uid), timestamp);
+                    connectEvent.setId(mId);
+                    incrementEventID();
+                    mDataAggregator.addSingleData(new IntrusionDetectionEvent(connectEvent));
+                }
+            };
 }
diff --git a/services/core/java/com/android/server/security/intrusiondetection/SecurityLogSource.java b/services/core/java/com/android/server/security/intrusiondetection/SecurityLogSource.java
index c5f736e..5611905 100644
--- a/services/core/java/com/android/server/security/intrusiondetection/SecurityLogSource.java
+++ b/services/core/java/com/android/server/security/intrusiondetection/SecurityLogSource.java
@@ -43,26 +43,9 @@
         mDataAggregator = dataAggregator;
         mDpm = context.getSystemService(DevicePolicyManager.class);
         mExecutor = Executors.newSingleThreadExecutor();
-    }
-
-    @Override
-    public boolean initialize() {
-        // Confirm caller is system and the device is managed. Otherwise logs will
-        // be redacted.
-        try {
-            if (!mDpm.isDeviceManaged()) {
-                Slog.e(TAG, "Caller does not have device owner permissions");
-                return false;
-            }
-        } catch (SecurityException e) {
-            Slog.e(TAG, "Security exception in initialize: ", e);
-            return false;
-        }
         mEventCallback = new SecurityEventCallback();
-        return true;
     }
 
-
     @Override
     @RequiresPermission(permission.MANAGE_DEVICE_POLICY_AUDIT_LOGGING)
     public void enable() {
@@ -99,6 +82,10 @@
 
         @Override
         public void accept(List<SecurityEvent> events) {
+            if (events.size() == 0) {
+                Slog.w(TAG, "No events received; caller may not be authorized");
+                return;
+            }
             List<IntrusionDetectionEvent> intrusionDetectionEvents =
                     events.stream()
                             .filter(event -> event != null)
diff --git a/services/core/java/com/android/server/telecom/TelecomLoaderService.java b/services/core/java/com/android/server/telecom/TelecomLoaderService.java
index 63a3e5a..a38fc5b 100644
--- a/services/core/java/com/android/server/telecom/TelecomLoaderService.java
+++ b/services/core/java/com/android/server/telecom/TelecomLoaderService.java
@@ -23,6 +23,7 @@
 import android.content.Intent;
 import android.content.IntentFilter;
 import android.content.ServiceConnection;
+import android.content.pm.PackageManagerInternal;
 import android.os.IBinder;
 import android.os.RemoteException;
 import android.os.ServiceManager;
@@ -63,7 +64,10 @@
             // as this loader (process="system") that's redundant here.
             try {
                 ITelecomLoader telecomLoader = ITelecomLoader.Stub.asInterface(service);
-                ITelecomService telecomService = telecomLoader.createTelecomService(mServiceRepo);
+                PackageManagerInternal packageManagerInternal =
+                        LocalServices.getService(PackageManagerInternal.class);
+                ITelecomService telecomService = telecomLoader.createTelecomService(mServiceRepo,
+                        packageManagerInternal.getSystemUiServiceComponent().getPackageName());
 
                 SmsApplication.getDefaultMmsApplication(mContext, false);
                 ServiceManager.addService(Context.TELECOM_SERVICE, telecomService.asBinder());
diff --git a/services/core/java/com/android/server/wm/ActivityTaskManagerService.java b/services/core/java/com/android/server/wm/ActivityTaskManagerService.java
index 0ebdaed..afa7ea1 100644
--- a/services/core/java/com/android/server/wm/ActivityTaskManagerService.java
+++ b/services/core/java/com/android/server/wm/ActivityTaskManagerService.java
@@ -1555,7 +1555,8 @@
 
 
             final ActivityRecord[] outActivity = new ActivityRecord[1];
-            getActivityStartController().obtainStarter(intent, "dream")
+            final int res = getActivityStartController()
+                    .obtainStarter(intent, "dream")
                     .setCallingUid(callingUid)
                     .setCallingPid(callingPid)
                     .setCallingPackage(intent.getPackage())
@@ -1569,9 +1570,11 @@
                     .execute();
 
             final ActivityRecord started = outActivity[0];
-            final IAppTask appTask = started == null ? null :
-                    new AppTaskImpl(this, started.getTask().mTaskId, callingUid);
-            return appTask;
+            if (started == null || !ActivityManager.isStartResultSuccessful(res)) {
+                // start the dream activity failed.
+                return null;
+            }
+            return new AppTaskImpl(this, started.getTask().mTaskId, callingUid);
         }
     }
 
diff --git a/services/core/java/com/android/server/wm/ContentRecorder.java b/services/core/java/com/android/server/wm/ContentRecorder.java
index 93ccd74..6ccceb9 100644
--- a/services/core/java/com/android/server/wm/ContentRecorder.java
+++ b/services/core/java/com/android/server/wm/ContentRecorder.java
@@ -243,6 +243,19 @@
         }
     }
 
+    /** Called when the surface of display is changed to a different instance. */
+    void resetRecordingDisplay(int displayId) {
+        if (!isCurrentlyRecording()
+                || mContentRecordingSession.getDisplayToRecord() != displayId) {
+            return;
+        }
+        ProtoLog.v(WM_DEBUG_CONTENT_RECORDING,
+                "Content Recording: Display %d changed surface so stop recording", displayId);
+        mDisplayContent.mWmService.mTransactionFactory.get().remove(mRecordedSurface).apply();
+        mRecordedSurface = null;
+        // Do not un-set the token, in case new surface is ready and recording should begin again.
+    }
+
     /**
      * Pauses recording on this display content. Note the session does not need to be updated,
      * since recording can be resumed still.
diff --git a/services/core/java/com/android/server/wm/DisplayContent.java b/services/core/java/com/android/server/wm/DisplayContent.java
index 3189acb..0b66158 100644
--- a/services/core/java/com/android/server/wm/DisplayContent.java
+++ b/services/core/java/com/android/server/wm/DisplayContent.java
@@ -1272,7 +1272,13 @@
     @Override
     void migrateToNewSurfaceControl(Transaction t) {
         t.remove(mSurfaceControl);
-
+        // Reset the recording displays which were mirroring this display.
+        for (int i = mRootWindowContainer.getChildCount() - 1; i >= 0; i--) {
+            final ContentRecorder recorder = mRootWindowContainer.getChildAt(i).mContentRecorder;
+            if (recorder != null) {
+                recorder.resetRecordingDisplay(mDisplayId);
+            }
+        }
         mLastSurfacePosition.set(0, 0);
         mLastDeltaRotation = Surface.ROTATION_0;
 
diff --git a/services/core/java/com/android/server/wm/RecentTasks.java b/services/core/java/com/android/server/wm/RecentTasks.java
index 27f82d9..7fdc2c6 100644
--- a/services/core/java/com/android/server/wm/RecentTasks.java
+++ b/services/core/java/com/android/server/wm/RecentTasks.java
@@ -40,7 +40,7 @@
 import static android.view.WindowManager.LayoutParams.LAST_APPLICATION_WINDOW;
 
 import static com.android.internal.protolog.WmProtoLogGroups.WM_DEBUG_TASKS;
-import static com.android.launcher3.Flags.enableRefactorTaskThumbnail;
+import static com.android.launcher3.Flags.enableUseTopVisibleActivityForExcludeFromRecentTask;
 import static com.android.server.wm.ActivityRecord.State.RESUMED;
 import static com.android.server.wm.ActivityTaskManagerDebugConfig.DEBUG_RECENTS;
 import static com.android.server.wm.ActivityTaskManagerDebugConfig.DEBUG_RECENTS_TRIM_TASKS;
@@ -1529,7 +1529,7 @@
                 // The Recents is only supported on default display now, we should only keep the
                 // most recent task of home display.
                 boolean isMostRecentTask;
-                if (enableRefactorTaskThumbnail()) {
+                if (enableUseTopVisibleActivityForExcludeFromRecentTask()) {
                     isMostRecentTask = task.getTopVisibleActivity() != null;
                 } else {
                     isMostRecentTask = taskIndex == 0;
diff --git a/services/core/java/com/android/server/wm/Task.java b/services/core/java/com/android/server/wm/Task.java
index 4ed1206..810aa04 100644
--- a/services/core/java/com/android/server/wm/Task.java
+++ b/services/core/java/com/android/server/wm/Task.java
@@ -4489,7 +4489,7 @@
     }
 
     void onPictureInPictureParamsChanged() {
-        if (inPinnedWindowingMode()) {
+        if (inPinnedWindowingMode() || Flags.enableDesktopWindowingPip()) {
             dispatchTaskInfoChangedIfNeeded(true /* force */);
         }
     }
diff --git a/services/core/java/com/android/server/wm/WindowManagerService.java b/services/core/java/com/android/server/wm/WindowManagerService.java
index b42ce64f..bf4cb45 100644
--- a/services/core/java/com/android/server/wm/WindowManagerService.java
+++ b/services/core/java/com/android/server/wm/WindowManagerService.java
@@ -9020,16 +9020,19 @@
 
         clearPointerDownOutsideFocusRunnable();
 
+        final InputTarget focusedInputTarget = mFocusedInputTarget;
         if (shouldDelayTouchOutside(t)) {
-            mPointerDownOutsideFocusRunnable = () -> handlePointerDownOutsideFocus(t);
+            mPointerDownOutsideFocusRunnable =
+                    () -> handlePointerDownOutsideFocus(t, focusedInputTarget);
             mH.postDelayed(mPointerDownOutsideFocusRunnable, POINTER_DOWN_OUTSIDE_FOCUS_TIMEOUT_MS);
         } else if (!fromHandler) {
             // Still post the runnable to handler thread in case there is already a runnable
             // in execution, but still waiting to hold the wm lock.
-            mPointerDownOutsideFocusRunnable = () -> handlePointerDownOutsideFocus(t);
+            mPointerDownOutsideFocusRunnable =
+                    () -> handlePointerDownOutsideFocus(t, focusedInputTarget);
             mH.post(mPointerDownOutsideFocusRunnable);
         } else {
-            handlePointerDownOutsideFocus(t);
+            handlePointerDownOutsideFocus(t, focusedInputTarget);
         }
     }
 
@@ -9061,8 +9064,15 @@
         return shouldDelayTouchForEmbeddedActivity || shouldDelayTouchForFreeform;
     }
 
-    private void handlePointerDownOutsideFocus(InputTarget t) {
+    private void handlePointerDownOutsideFocus(InputTarget t, InputTarget focusedInputTarget) {
         synchronized (mGlobalLock) {
+            if (mFocusedInputTarget != focusedInputTarget) {
+                // Skip if the mFocusedInputTarget is already changed. This is possible if the
+                // pointer-down-outside-focus event is delayed to be handled.
+                ProtoLog.i(WM_DEBUG_FOCUS_LIGHT,
+                        "Skip onPointerDownOutsideFocusLocked due to input target changed %s", t);
+                return;
+            }
             if (mPointerDownOutsideFocusRunnable != null
                     && mH.hasCallbacks(mPointerDownOutsideFocusRunnable)) {
                 // Skip if there's another pending pointer-down-outside-focus event.
diff --git a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
index 4d318f90..2627895 100644
--- a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
+++ b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
@@ -9089,7 +9089,7 @@
         CallerIdentity caller = getCallerIdentity(who);
 
         if (Flags.setAutoTimeEnabledCoexistence()) {
-            Preconditions.checkCallAuthorization(hasPermission(SET_TIME, caller.getPackageName()));
+            Preconditions.checkCallAuthorization(hasPermission(SET_TIME, callerPackageName));
         } else {
             Objects.requireNonNull(who, "ComponentName is null");
             Preconditions.checkCallAuthorization(isProfileOwnerOnUser0(caller)
@@ -9152,7 +9152,7 @@
         EnforcingAdmin enforcingAdmin = enforcePermissionAndGetEnforcingAdmin(
                 /* who */ null,
                 SET_TIME,
-                caller.getPackageName(),
+                callerPackageName,
                 UserHandle.USER_ALL
         );
         Integer state = mDevicePolicyEngine.getGlobalPolicySetByAdmin(
@@ -9197,7 +9197,7 @@
         CallerIdentity caller = getCallerIdentity(who);
         if (Flags.setAutoTimeZoneEnabledCoexistence()) {
             Preconditions.checkCallAuthorization(
-                hasPermission(SET_TIME_ZONE, caller.getPackageName()));
+                hasPermission(SET_TIME_ZONE, callerPackageName));
         } else {
             Objects.requireNonNull(who, "ComponentName is null");
             Preconditions.checkCallAuthorization(isProfileOwnerOnUser0(caller)
@@ -9255,7 +9255,7 @@
         EnforcingAdmin enforcingAdmin = enforcePermissionAndGetEnforcingAdmin(
                 /* who */ null,
                 SET_TIME_ZONE,
-                caller.getPackageName(),
+                callerPackageName,
                 UserHandle.USER_ALL
         );
         Integer state = mDevicePolicyEngine.getGlobalPolicySetByAdmin(
diff --git a/services/java/com/android/server/SystemServer.java b/services/java/com/android/server/SystemServer.java
index aa63c4a..65315af 100644
--- a/services/java/com/android/server/SystemServer.java
+++ b/services/java/com/android/server/SystemServer.java
@@ -201,7 +201,6 @@
 import com.android.server.notification.NotificationManagerService;
 import com.android.server.oemlock.OemLockService;
 import com.android.server.om.OverlayManagerService;
-import com.android.server.ondeviceintelligence.OnDeviceIntelligenceManagerService;
 import com.android.server.os.BugreportManagerService;
 import com.android.server.os.DeviceIdentifiersPolicyService;
 import com.android.server.os.NativeTombstoneManagerService;
@@ -392,6 +391,8 @@
             "com.android.server.sdksandbox.SdkSandboxManagerService$Lifecycle";
     private static final String AD_SERVICES_MANAGER_SERVICE_CLASS =
             "com.android.server.adservices.AdServicesManagerService$Lifecycle";
+    private static final String ON_DEVICE_INTELLIGENCE_MANAGER_SERVICE_CLASS =
+            "com.android.server.ondeviceintelligence.OnDeviceIntelligenceManagerService";
     private static final String ON_DEVICE_PERSONALIZATION_SYSTEM_SERVICE_CLASS =
             "com.android.server.ondevicepersonalization."
                     + "OnDevicePersonalizationSystemService$Lifecycle";
@@ -3453,7 +3454,7 @@
 
     private void startOnDeviceIntelligenceService(TimingsTraceAndSlog t) {
         t.traceBegin("startOnDeviceIntelligenceManagerService");
-        mSystemServiceManager.startService(OnDeviceIntelligenceManagerService.class);
+        mSystemServiceManager.startService(ON_DEVICE_INTELLIGENCE_MANAGER_SERVICE_CLASS);
         t.traceEnd();
     }
 
diff --git a/services/java/com/android/server/flags.aconfig b/services/java/com/android/server/flags.aconfig
index 4412968..0d222fb 100644
--- a/services/java/com/android/server/flags.aconfig
+++ b/services/java/com/android/server/flags.aconfig
@@ -10,14 +10,6 @@
 }
 
 flag {
-    name: "remove_java_service_manager_cache"
-    namespace: "system_performance"
-    description: "This flag turns off Java's Service Manager caching mechanism."
-    bug: "333854840"
-    is_fixed_read_only: true
-}
-
-flag {
      name: "remove_text_service"
      namespace: "wear_frameworks"
      description: "Remove TextServiceManagerService on Wear"
diff --git a/services/proguard.flags b/services/proguard.flags
index 977bd19..0e1f68e 100644
--- a/services/proguard.flags
+++ b/services/proguard.flags
@@ -44,6 +44,9 @@
 -keep,allowoptimization,allowaccessmodification class com.android.server.input.NativeInputManagerService$NativeImpl { *; }
 -keep,allowoptimization,allowaccessmodification class com.android.server.ThreadPriorityBooster { *; }
 
+# allow invoking start-service using class name in both apex and services jar.
+-keep,allowoptimization,allowaccessmodification class com.android.server.ondeviceintelligence.OnDeviceIntelligenceManagerService { *; }
+
 # Keep all aconfig Flag class as they might be statically referenced by other packages
 # An merge or inlining could lead to missing dependencies that cause run time errors
 -keepclassmembernames class android.**.Flags, com.android.**.Flags { public *; }
diff --git a/services/tests/DynamicInstrumentationManagerServiceTests/src/com/android/server/os/instrumentation/ParseMethodDescriptorTest.java b/services/tests/DynamicInstrumentationManagerServiceTests/src/com/android/server/os/instrumentation/ParseMethodDescriptorTest.java
index 5492ba6..6e14bad 100644
--- a/services/tests/DynamicInstrumentationManagerServiceTests/src/com/android/server/os/instrumentation/ParseMethodDescriptorTest.java
+++ b/services/tests/DynamicInstrumentationManagerServiceTests/src/com/android/server/os/instrumentation/ParseMethodDescriptorTest.java
@@ -20,6 +20,7 @@
 import static org.junit.Assert.assertThrows;
 
 import android.os.instrumentation.MethodDescriptor;
+import android.os.instrumentation.MethodDescriptorParser;
 import android.platform.test.annotations.Presubmit;
 
 import androidx.test.filters.SmallTest;
@@ -37,7 +38,7 @@
 
 /**
  * Test class for
- * {@link DynamicInstrumentationManagerService#parseMethodDescriptor(ClassLoader,
+ * {@link MethodDescriptorParser#parseMethodDescriptor(ClassLoader,
  * MethodDescriptor)}.
  * <p>
  * Build/Install/Run:
@@ -119,13 +120,13 @@
     }
 
     private Method parseMethodDescriptor(String fqcn, String methodName) {
-        return DynamicInstrumentationManagerService.parseMethodDescriptor(
+        return MethodDescriptorParser.parseMethodDescriptor(
                 getClass().getClassLoader(),
                 getMethodDescriptor(fqcn, methodName, new String[]{}));
     }
 
     private Method parseMethodDescriptor(String fqcn, String methodName, String[] fqParameters) {
-        return DynamicInstrumentationManagerService.parseMethodDescriptor(
+        return MethodDescriptorParser.parseMethodDescriptor(
                 getClass().getClassLoader(),
                 getMethodDescriptor(fqcn, methodName, fqParameters));
     }
diff --git a/services/tests/ondeviceintelligencetests/Android.bp b/services/tests/ondeviceintelligencetests/Android.bp
index a31a3fb..f235da2 100644
--- a/services/tests/ondeviceintelligencetests/Android.bp
+++ b/services/tests/ondeviceintelligencetests/Android.bp
@@ -44,14 +44,18 @@
         "truth",
         "frameworks-base-testutils",
         "androidx.test.rules",
-    ],
+    ] + select(soong_config_variable("ANDROID", "release_ondevice_intelligence_module"), {
+        "true": [
+            "service-ondeviceintelligence.impl",
+        ],
+        default: [],
+    }),
 
     libs: [
         "android.test.mock.stubs.system",
         "android.test.base.stubs.system",
         "android.test.runner.stubs.system",
     ],
-
     certificate: "platform",
     platform_apis: true,
     test_suites: ["device-tests"],
diff --git a/services/tests/ondeviceintelligencetests/OWNERS b/services/tests/ondeviceintelligencetests/OWNERS
index 09774f7..a4fc758 100644
--- a/services/tests/ondeviceintelligencetests/OWNERS
+++ b/services/tests/ondeviceintelligencetests/OWNERS
@@ -1 +1,3 @@
-file:/core/java/android/app/ondeviceintelligence/OWNERS
+shiqing@google.com
+sandeepbandaru@google.com
+shivanker@google.com
diff --git a/services/tests/ondeviceintelligencetests/src/com/android/server/ondeviceintelligence/InferenceInfoStoreTest.java b/services/tests/ondeviceintelligencetests/src/com/android/server/ondeviceintelligence/InferenceInfoStoreTest.java
index d12579c..28ccb84 100644
--- a/services/tests/ondeviceintelligencetests/src/com/android/server/ondeviceintelligence/InferenceInfoStoreTest.java
+++ b/services/tests/ondeviceintelligencetests/src/com/android/server/ondeviceintelligence/InferenceInfoStoreTest.java
@@ -21,7 +21,6 @@
 import android.app.ondeviceintelligence.InferenceInfo;
 import android.os.Bundle;
 import android.os.PersistableBundle;
-import android.service.ondeviceintelligence.OnDeviceSandboxedInferenceService;
 import android.util.Base64;
 
 import androidx.test.ext.junit.runners.AndroidJUnit4;
@@ -38,6 +37,8 @@
 public class InferenceInfoStoreTest {
     InferenceInfoStore inferenceInfoStore;
 
+    public static final String INFERENCE_INFO_BUNDLE_KEY = "inference_info";
+
     @Before
     public void setUp() {
         inferenceInfoStore = new InferenceInfoStore(1000);
@@ -46,7 +47,7 @@
     @Test
     public void testInferenceInfoParsesFromBundleSuccessfully() throws Exception {
         Bundle bundle = new Bundle();
-        bundle.putByteArray(OnDeviceSandboxedInferenceService.INFERENCE_INFO_BUNDLE_KEY,
+        bundle.putByteArray(INFERENCE_INFO_BUNDLE_KEY,
                 getInferenceInfoBytes(1, 1, 100));
         inferenceInfoStore.addInferenceInfoFromBundle(bundle);
         List<InferenceInfo> inferenceInfos = inferenceInfoStore.getLatestInferenceInfo(0);
@@ -59,7 +60,7 @@
     @Test
     public void testInferenceInfoParsesFromPersistableBundleSuccessfully() throws Exception {
         PersistableBundle bundle = new PersistableBundle();
-        bundle.putString(OnDeviceSandboxedInferenceService.INFERENCE_INFO_BUNDLE_KEY,
+        bundle.putString(INFERENCE_INFO_BUNDLE_KEY,
                 Base64.encodeToString(getInferenceInfoBytes(1, 1, 100), Base64.DEFAULT));
         inferenceInfoStore.addInferenceInfoFromBundle(bundle);
         List<InferenceInfo> inferenceInfos = inferenceInfoStore.getLatestInferenceInfo(0);
@@ -74,11 +75,11 @@
     public void testEvictionAfterMaxAge() throws Exception {
         PersistableBundle bundle = new PersistableBundle();
         long testStartTime = System.currentTimeMillis();
-        bundle.putString(OnDeviceSandboxedInferenceService.INFERENCE_INFO_BUNDLE_KEY,
+        bundle.putString(INFERENCE_INFO_BUNDLE_KEY,
                 Base64.encodeToString(getInferenceInfoBytes(1,  testStartTime - 10,
                         testStartTime + 100), Base64.DEFAULT));
         inferenceInfoStore.addInferenceInfoFromBundle(bundle);
-        bundle.putString(OnDeviceSandboxedInferenceService.INFERENCE_INFO_BUNDLE_KEY,
+        bundle.putString(INFERENCE_INFO_BUNDLE_KEY,
                 Base64.encodeToString(getInferenceInfoBytes(1, testStartTime - 5,
                         testStartTime + 100), Base64.DEFAULT));
         inferenceInfoStore.addInferenceInfoFromBundle(bundle);
diff --git a/services/tests/security/intrusiondetection/AndroidManifest.xml b/services/tests/security/intrusiondetection/AndroidManifest.xml
index 6460a32..d58e0d8 100644
--- a/services/tests/security/intrusiondetection/AndroidManifest.xml
+++ b/services/tests/security/intrusiondetection/AndroidManifest.xml
@@ -23,15 +23,6 @@
 
     <application android:testOnly="true" android:debuggable="true" android:usesCleartextTraffic="true">
       <uses-library android:name="android.test.runner"/>
-        <receiver android:name="com.android.server.security.intrusiondetection.IntrusionDetectionAdminReceiver"
-             android:permission="android.permission.BIND_DEVICE_ADMIN"
-             android:exported="true">
-            <meta-data android:name="android.app.device_admin"
-                 android:resource="@xml/device_admin"/>
-            <intent-filter>
-                <action android:name="android.app.action.DEVICE_ADMIN_ENABLED"/>
-            </intent-filter>
-        </receiver>
     </application>
 
     <queries>
diff --git a/services/tests/security/intrusiondetection/res/xml/device_admin.xml b/services/tests/security/intrusiondetection/res/xml/device_admin.xml
deleted file mode 100644
index f8cd8f0..0000000
--- a/services/tests/security/intrusiondetection/res/xml/device_admin.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- 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.
--->
-
-<device-admin xmlns:android="http://schemas.android.com/apk/res/android">
-</device-admin>
diff --git a/services/tests/security/intrusiondetection/src/com/android/server/security/intrusiondetection/IntrusionDetectionServiceTest.java b/services/tests/security/intrusiondetection/src/com/android/server/security/intrusiondetection/IntrusionDetectionServiceTest.java
index 1380a6f..5cba6b2 100644
--- a/services/tests/security/intrusiondetection/src/com/android/server/security/intrusiondetection/IntrusionDetectionServiceTest.java
+++ b/services/tests/security/intrusiondetection/src/com/android/server/security/intrusiondetection/IntrusionDetectionServiceTest.java
@@ -16,13 +16,12 @@
 
 package com.android.server.security.intrusiondetection;
 
+import static android.Manifest.permission.BIND_INTRUSION_DETECTION_EVENT_TRANSPORT_SERVICE;
 import static android.Manifest.permission.INTERNET;
 import static android.Manifest.permission.MANAGE_INTRUSION_DETECTION_STATE;
 import static android.Manifest.permission.READ_INTRUSION_DETECTION_STATE;
-import static android.Manifest.permission.BIND_INTRUSION_DETECTION_EVENT_TRANSPORT_SERVICE;
 
 import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertThrows;
@@ -45,9 +44,7 @@
 import android.content.Context;
 import android.content.Intent;
 import android.content.ServiceConnection;
-import android.Manifest;
 import android.os.IBinder;
-import android.os.Bundle;
 import android.os.Looper;
 import android.os.PermissionEnforcer;
 import android.os.RemoteException;
@@ -63,17 +60,13 @@
 import androidx.test.core.app.ApplicationProvider;
 
 import com.android.bedstead.harrier.BedsteadJUnit4;
-import com.android.bedstead.harrier.annotations.AfterClass;
-import com.android.bedstead.harrier.annotations.BeforeClass;
 import com.android.bedstead.multiuser.annotations.RequireRunOnSystemUser;
 import com.android.bedstead.nene.TestApis;
 import com.android.bedstead.nene.devicepolicy.DeviceOwner;
-import com.android.bedstead.nene.exceptions.NeneException;
 import com.android.bedstead.permissions.CommonPermissions;
 import com.android.bedstead.permissions.PermissionContext;
 import com.android.bedstead.permissions.annotations.EnsureHasPermission;
 import com.android.coretests.apps.testapp.LocalIntrusionDetectionEventTransport;
-import com.android.internal.infra.AndroidFuture;
 import com.android.server.ServiceThread;
 
 import org.junit.Before;
@@ -131,28 +124,6 @@
         "com.android.coretests.apps.testapp";
     private static final String TEST_SERVICE = TEST_PKG + ".TestLoggingService";
 
-    @BeforeClass
-    public static void setDeviceOwner() {
-        ComponentName admin =
-                new ComponentName(
-                        ApplicationProvider.getApplicationContext(),
-                        IntrusionDetectionAdminReceiver.class);
-        try {
-            sDeviceOwner = TestApis.devicePolicy().setDeviceOwner(admin);
-        } catch (NeneException e) {
-            fail("Failed to set device owner " + admin.flattenToString() + ": " + e);
-        }
-    }
-
-    @AfterClass
-    public static void removeDeviceOwner() {
-        try {
-            sDeviceOwner.remove();
-        } catch (NeneException e) {
-            fail("Failed to remove device owner : " + e);
-        }
-    }
-
     @SuppressLint("VisibleForTests")
     @Before
     public void setUp() throws Exception {
@@ -181,6 +152,7 @@
     }
 
     @Test
+    @EnsureHasPermission(CommonPermissions.MANAGE_DEVICE_POLICY_AUDIT_LOGGING)
     public void testRemoveStateCallback_NoPermission() {
         mPermissionEnforcer.revoke(READ_INTRUSION_DETECTION_STATE);
         StateCallback scb = new StateCallback();
@@ -232,6 +204,7 @@
     }
 
     @Test
+    @Ignore("Unit test does not run as system service UID")
     public void testRemoveStateCallback() throws RemoteException {
         mIntrusionDetectionService.setState(STATE_DISABLED);
         StateCallback scb1 = new StateCallback();
@@ -242,7 +215,6 @@
         assertEquals(STATE_DISABLED, scb1.mState);
         assertEquals(STATE_DISABLED, scb2.mState);
 
-        doReturn(true).when(mDataAggregator).initialize();
         doReturn(true).when(mIntrusionDetectionEventTransportConnection).initialize();
 
         mIntrusionDetectionService.getBinderService().removeStateCallback(scb2);
@@ -255,6 +227,7 @@
         assertNull(ccb.mErrorCode);
     }
 
+    @Ignore("Unit test does not run as system service UID")
     @Test
     public void testEnable_FromDisabled_TwoStateCallbacks() throws RemoteException {
         mIntrusionDetectionService.setState(STATE_DISABLED);
@@ -415,39 +388,13 @@
     }
 
     @Test
-    @RequireRunOnSystemUser
-    public void testDataSources_Initialize_HasDeviceOwner() throws Exception {
-        NetworkLogSource networkLogSource = new NetworkLogSource(mContext, mDataAggregator);
-        SecurityLogSource securityLogSource = new SecurityLogSource(mContext, mDataAggregator);
-
-        assertTrue(networkLogSource.initialize());
-        assertTrue(securityLogSource.initialize());
-    }
-
-    @Test
-    @RequireRunOnSystemUser
-    public void testDataSources_Initialize_NoDeviceOwner() throws Exception {
-        NetworkLogSource networkLogSource = new NetworkLogSource(mContext, mDataAggregator);
-        SecurityLogSource securityLogSource = new SecurityLogSource(mContext, mDataAggregator);
-        ComponentName admin = sDeviceOwner.componentName();
-
-        try {
-            sDeviceOwner.remove();
-            assertFalse(networkLogSource.initialize());
-            assertFalse(securityLogSource.initialize());
-        } finally {
-            sDeviceOwner = TestApis.devicePolicy().setDeviceOwner(admin);
-        }
-    }
-
-    @Test
+    @Ignore("Unit test does not run as system service UID")
     @RequireRunOnSystemUser
     @EnsureHasPermission(CommonPermissions.MANAGE_DEVICE_POLICY_AUDIT_LOGGING)
     public void testDataAggregator_AddSecurityEvent() throws Exception {
         mIntrusionDetectionService.setState(STATE_ENABLED);
         ServiceThread mockThread = spy(ServiceThread.class);
         mDataAggregator.setHandler(mLooperOfDataAggregator, mockThread);
-        assertTrue(mDataAggregator.initialize());
 
         // SecurityLogging generates a number of events and callbacks, so create a latch to wait for
         // the given event.
@@ -491,12 +438,12 @@
 
     @Test
     @RequireRunOnSystemUser
+    @Ignore("Unit test does not run as system service UID")
     @EnsureHasPermission(CommonPermissions.MANAGE_DEVICE_POLICY_AUDIT_LOGGING)
     public void testDataAggregator_AddNetworkEvent() throws Exception {
         mIntrusionDetectionService.setState(STATE_ENABLED);
         ServiceThread mockThread = spy(ServiceThread.class);
         mDataAggregator.setHandler(mLooperOfDataAggregator, mockThread);
-        assertTrue(mDataAggregator.initialize());
 
         // Network logging may log multiple and callbacks, so create a latch to wait for
         // the given event.
diff --git a/services/tests/uiservicestests/src/com/android/server/UiModeManagerServiceTest.java b/services/tests/uiservicestests/src/com/android/server/UiModeManagerServiceTest.java
index 0404b82..c4b8599 100644
--- a/services/tests/uiservicestests/src/com/android/server/UiModeManagerServiceTest.java
+++ b/services/tests/uiservicestests/src/com/android/server/UiModeManagerServiceTest.java
@@ -118,6 +118,7 @@
 import java.time.LocalDateTime;
 import java.time.LocalTime;
 import java.time.ZoneId;
+import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.function.Consumer;
@@ -232,7 +233,8 @@
                 any(AlarmManager.OnAlarmListener.class), any(Handler.class));
 
         doAnswer(inv -> {
-            mCustomListener = () -> {};
+            mCustomListener = () -> {
+            };
             return null;
         }).when(mAlarmManager).cancel(eq(mCustomListener));
         when(mContext.getSystemService(eq(Context.POWER_SERVICE)))
@@ -1321,7 +1323,7 @@
     @Test
     public void enableCarMode_failsForBogusPackageName() throws Exception {
         when(mPackageManager.getPackageUidAsUser(eq(PACKAGE_NAME), anyInt()))
-            .thenReturn(TestInjector.DEFAULT_CALLING_UID + 1);
+                .thenReturn(TestInjector.DEFAULT_CALLING_UID + 1);
 
         assertThrows(SecurityException.class, () -> mService.enableCarMode(0, 0, PACKAGE_NAME));
         assertThat(mService.getCurrentModeType()).isNotEqualTo(Configuration.UI_MODE_TYPE_CAR);
@@ -1343,19 +1345,19 @@
     @Test
     public void disableCarMode_failsForBogusPackageName() throws Exception {
         when(mPackageManager.getPackageUidAsUser(eq(PACKAGE_NAME), anyInt()))
-            .thenReturn(TestInjector.DEFAULT_CALLING_UID);
+                .thenReturn(TestInjector.DEFAULT_CALLING_UID);
         mService.enableCarMode(0, 0, PACKAGE_NAME);
         assertThat(mService.getCurrentModeType()).isEqualTo(Configuration.UI_MODE_TYPE_CAR);
         when(mPackageManager.getPackageUidAsUser(eq(PACKAGE_NAME), anyInt()))
-            .thenReturn(TestInjector.DEFAULT_CALLING_UID + 1);
+                .thenReturn(TestInjector.DEFAULT_CALLING_UID + 1);
 
         assertThrows(SecurityException.class,
-            () -> mService.disableCarModeByCallingPackage(0, PACKAGE_NAME));
+                () -> mService.disableCarModeByCallingPackage(0, PACKAGE_NAME));
         assertThat(mService.getCurrentModeType()).isEqualTo(Configuration.UI_MODE_TYPE_CAR);
 
         // Clean up
         when(mPackageManager.getPackageUidAsUser(eq(PACKAGE_NAME), anyInt()))
-            .thenReturn(TestInjector.DEFAULT_CALLING_UID);
+                .thenReturn(TestInjector.DEFAULT_CALLING_UID);
         mService.disableCarModeByCallingPackage(0, PACKAGE_NAME);
         assertThat(mService.getCurrentModeType()).isNotEqualTo(Configuration.UI_MODE_TYPE_CAR);
     }
@@ -1473,12 +1475,13 @@
             assertFalse(mUiManagerService.getConfiguration().isNightModeActive());
         }
 
-        // attention modes with expected night modes
-        Map<Integer, Boolean> modes = Map.of(
-                MODE_ATTENTION_THEME_OVERLAY_OFF, initialNightMode,
-                MODE_ATTENTION_THEME_OVERLAY_DAY, false,
-                MODE_ATTENTION_THEME_OVERLAY_NIGHT, true
-        );
+        // Attention modes with expected night modes.
+        // Important to keep modes.put(MODE_ATTENTION_THEME_OVERLAY_OFF, initialNightMode) in the
+        // first position, hence LinkedHashMap.
+        Map<Integer, Boolean> modes = new LinkedHashMap<>();
+        modes.put(MODE_ATTENTION_THEME_OVERLAY_OFF, initialNightMode);
+        modes.put(MODE_ATTENTION_THEME_OVERLAY_DAY, false);
+        modes.put(MODE_ATTENTION_THEME_OVERLAY_NIGHT, true);
 
         // test
         for (int attentionMode : modes.keySet()) {
@@ -1562,7 +1565,7 @@
         private final int callingUid;
 
         public TestInjector() {
-          this(DEFAULT_CALLING_UID);
+            this(DEFAULT_CALLING_UID);
         }
 
         public TestInjector(int callingUid) {
diff --git a/services/tests/uiservicestests/src/com/android/server/notification/NotificationManagerServiceTest.java b/services/tests/uiservicestests/src/com/android/server/notification/NotificationManagerServiceTest.java
index 90bf1d3..074cbb5 100644
--- a/services/tests/uiservicestests/src/com/android/server/notification/NotificationManagerServiceTest.java
+++ b/services/tests/uiservicestests/src/com/android/server/notification/NotificationManagerServiceTest.java
@@ -49,10 +49,14 @@
 import static android.app.NotificationChannel.RECS_ID;
 import static android.app.NotificationChannel.SOCIAL_MEDIA_ID;
 import static android.app.NotificationChannel.USER_LOCKED_ALLOW_BUBBLE;
+import static android.app.NotificationManager.ACTION_AUTOMATIC_ZEN_RULE_STATUS_CHANGED;
 import static android.app.NotificationManager.ACTION_INTERRUPTION_FILTER_CHANGED;
+import static android.app.NotificationManager.AUTOMATIC_RULE_STATUS_ACTIVATED;
 import static android.app.NotificationManager.BUBBLE_PREFERENCE_ALL;
 import static android.app.NotificationManager.BUBBLE_PREFERENCE_NONE;
 import static android.app.NotificationManager.BUBBLE_PREFERENCE_SELECTED;
+import static android.app.NotificationManager.EXTRA_AUTOMATIC_ZEN_RULE_ID;
+import static android.app.NotificationManager.EXTRA_AUTOMATIC_ZEN_RULE_STATUS;
 import static android.app.NotificationManager.EXTRA_BLOCKED_STATE;
 import static android.app.NotificationManager.IMPORTANCE_DEFAULT;
 import static android.app.NotificationManager.IMPORTANCE_HIGH;
@@ -369,6 +373,7 @@
 import java.time.Duration;
 import java.util.ArrayList;
 import java.util.Arrays;
+import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
 import java.util.concurrent.CountDownLatch;
@@ -11273,19 +11278,71 @@
                 Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT)), eq(UserHandle.of(102)));
     }
 
+    @Test
+    @EnableFlags(android.app.Flags.FLAG_MODES_API)
+    public void onAutomaticRuleStatusChanged_sendsBroadcastToRuleOwner() throws Exception {
+        mService.mZenModeHelper.getCallbacks().forEach(c -> c.onAutomaticRuleStatusChanged(
+                mUserId, "rule.owner.pkg", "rule_id", AUTOMATIC_RULE_STATUS_ACTIVATED));
+
+        Intent expected = new Intent(ACTION_AUTOMATIC_ZEN_RULE_STATUS_CHANGED)
+                .setPackage("rule.owner.pkg")
+                .putExtra(EXTRA_AUTOMATIC_ZEN_RULE_ID, "rule_id")
+                .putExtra(EXTRA_AUTOMATIC_ZEN_RULE_STATUS, AUTOMATIC_RULE_STATUS_ACTIVATED)
+                .addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT);
+
+        verify(mContext).sendBroadcastAsUser(eqIntent(expected), eq(UserHandle.of(mUserId)));
+    }
+
     private static Intent eqIntent(Intent wanted) {
         return ArgumentMatchers.argThat(
                 new ArgumentMatcher<Intent>() {
                     @Override
                     public boolean matches(Intent argument) {
                         return wanted.filterEquals(argument)
-                                && wanted.getFlags() == argument.getFlags();
+                                && wanted.getFlags() == argument.getFlags()
+                                && equalBundles(wanted.getExtras(), argument.getExtras());
                     }
 
                     @Override
                     public String toString() {
                         return wanted.toString();
                     }
+
+                    private boolean equalBundles(Bundle one, Bundle two) {
+                        if (one == null && two == null) {
+                            return true;
+                        }
+                        if ((one == null) != (two == null)) {
+                            return false;
+                        }
+                        if (one.size() != two.size()) {
+                            return false;
+                        }
+
+                        HashSet<String> setOne = new HashSet<>(one.keySet());
+                        setOne.addAll(two.keySet());
+
+                        for (String key : setOne) {
+                            if (!one.containsKey(key) || !two.containsKey(key)) {
+                                return false;
+                            }
+
+                            Object valueOne = one.get(key);
+                            Object valueTwo = two.get(key);
+                            if (valueOne instanceof Bundle
+                                    && valueTwo instanceof Bundle
+                                    && !equalBundles((Bundle) valueOne, (Bundle) valueTwo)) {
+                                return false;
+                            } else if (valueOne == null) {
+                                if (valueTwo != null) {
+                                    return false;
+                                }
+                            } else if (!valueOne.equals(valueTwo)) {
+                                return false;
+                            }
+                        }
+                        return true;
+                    }
                 });
     }
 
@@ -17314,6 +17371,7 @@
                 .setStyle(new Notification.BigTextStyle().setBigContentTitle("BIG"))
                 .setColor(Color.WHITE)
                 .setColorized(true)
+                .setOngoing(true)
                 .setFlag(FLAG_CAN_COLORIZE, true) // add manually since we're skipping post
                 .build();
 
@@ -17327,6 +17385,7 @@
                 .setStyle(new Notification.BigTextStyle().setBigContentTitle("BIG"))
                 .setColor(Color.WHITE)
                 .setColorized(true)
+                .setOngoing(true)
                 .setFlag(FLAG_CAN_COLORIZE, true) // add manually since we're skipping post
                 .build();
         StatusBarNotification sbn1 = new StatusBarNotification(mPkg, mPkg, 7, null, mUid, 0,
@@ -17339,6 +17398,7 @@
                 .setStyle(new Notification.BigTextStyle().setBigContentTitle("BIG"))
                 .setColor(Color.WHITE)
                 .setColorized(true)
+                .setOngoing(true)
                 .setFlag(FLAG_CAN_COLORIZE, true) // add manually since we're skipping post
                 .build();
         StatusBarNotification sbn2 = new StatusBarNotification(PKG_O, PKG_O, 7, null, UID_O, 0,
@@ -17388,6 +17448,7 @@
                 .setStyle(new Notification.BigTextStyle().setBigContentTitle("BIG"))
                 .setColor(Color.WHITE)
                 .setColorized(true)
+                .setOngoing(true)
                 .setFlag(FLAG_CAN_COLORIZE, true) // add manually since we're skipping post
                 .build();
 
@@ -17420,6 +17481,7 @@
                 .setStyle(new Notification.BigTextStyle().setBigContentTitle("BIG"))
                 .setColor(Color.WHITE)
                 .setColorized(true)
+                .setOngoing(true)
                 .setFlag(FLAG_PROMOTED_ONGOING, true) // add manually since we're skipping post
                 .setFlag(FLAG_CAN_COLORIZE, true) // add manually since we're skipping post
                 .build();
@@ -17434,6 +17496,7 @@
                 .setStyle(new Notification.BigTextStyle().setBigContentTitle("BIG"))
                 .setColor(Color.WHITE)
                 .setColorized(true)
+                .setOngoing(true)
                 .setFlag(FLAG_PROMOTED_ONGOING, true) // add manually since we're skipping post
                 .setFlag(FLAG_CAN_COLORIZE, true) // add manually since we're skipping post
                 .build();
@@ -17483,6 +17546,7 @@
                 .setStyle(new Notification.BigTextStyle().setBigContentTitle("BIG"))
                 .setColor(Color.WHITE)
                 .setColorized(true)
+                .setOngoing(true)
                 .setFlag(FLAG_PROMOTED_ONGOING, true) // add manually since we're skipping post
                 .setFlag(FLAG_CAN_COLORIZE, true) // add manually since we're skipping post
                 .build();
@@ -17515,6 +17579,7 @@
                 .setStyle(new Notification.BigTextStyle().setBigContentTitle("BIG"))
                 .setColor(Color.WHITE)
                 .setColorized(true)
+                .setOngoing(true)
                 .build();
         StatusBarNotification sbn = new StatusBarNotification(mPkg, mPkg, 9, null, mUid, 0,
                 n, UserHandle.getUserHandleForUid(mUid), null, 0);
@@ -17543,6 +17608,7 @@
                 .setStyle(new Notification.BigTextStyle().setBigContentTitle("BIG"))
                 .setColor(Color.WHITE)
                 .setColorized(true)
+                .setOngoing(true)
                 .build();
 
         StatusBarNotification sbn = new StatusBarNotification(mPkg, mPkg, 9, null, mUid, 0,
@@ -17570,6 +17636,7 @@
                 .setStyle(new Notification.BigTextStyle().setBigContentTitle("BIG"))
                 .setColor(Color.WHITE)
                 .setColorized(true)
+                .setOngoing(true)
                 .build();
 
         StatusBarNotification sbn = new StatusBarNotification(mPkg, mPkg, 9, null, mUid, 0,
diff --git a/services/tests/wmtests/src/com/android/server/policy/KeyGestureEventTests.java b/services/tests/wmtests/src/com/android/server/policy/KeyGestureEventTests.java
index 1e9038e..32ba8f5 100644
--- a/services/tests/wmtests/src/com/android/server/policy/KeyGestureEventTests.java
+++ b/services/tests/wmtests/src/com/android/server/policy/KeyGestureEventTests.java
@@ -468,6 +468,14 @@
     }
 
     @Test
+    public void testKeyGestureLaunchVoiceAssistant() {
+        Assert.assertTrue(
+                sendKeyGestureEventComplete(
+                        KeyGestureEvent.KEY_GESTURE_TYPE_LAUNCH_VOICE_ASSISTANT));
+        mPhoneWindowManager.assertSearchManagerLaunchAssist();
+    }
+
+    @Test
     public void testKeyGestureGoHome() {
         Assert.assertTrue(
                 sendKeyGestureEventComplete(KeyGestureEvent.KEY_GESTURE_TYPE_HOME));
diff --git a/services/tests/wmtests/src/com/android/server/wm/RecentTasksTest.java b/services/tests/wmtests/src/com/android/server/wm/RecentTasksTest.java
index aa99250..25b9f4b 100644
--- a/services/tests/wmtests/src/com/android/server/wm/RecentTasksTest.java
+++ b/services/tests/wmtests/src/com/android/server/wm/RecentTasksTest.java
@@ -717,13 +717,13 @@
     }
 
     @Test
-    @DisableFlags(Flags.FLAG_ENABLE_REFACTOR_TASK_THUMBNAIL)
+    @DisableFlags(Flags.FLAG_ENABLE_USE_TOP_VISIBLE_ACTIVITY_FOR_EXCLUDE_FROM_RECENT_TASK)
     public void testVisibleTasks_excludedFromRecents() {
         testVisibleTasks_excludedFromRecents_internal();
     }
 
     @Test
-    @EnableFlags(Flags.FLAG_ENABLE_REFACTOR_TASK_THUMBNAIL)
+    @EnableFlags(Flags.FLAG_ENABLE_USE_TOP_VISIBLE_ACTIVITY_FOR_EXCLUDE_FROM_RECENT_TASK)
     public void testVisibleTasks_excludedFromRecents_withRefactorFlag() {
         testVisibleTasks_excludedFromRecents_internal();
     }
@@ -767,13 +767,13 @@
 
     @Test
     @Ignore("b/342627272")
-    @DisableFlags(Flags.FLAG_ENABLE_REFACTOR_TASK_THUMBNAIL)
+    @DisableFlags(Flags.FLAG_ENABLE_USE_TOP_VISIBLE_ACTIVITY_FOR_EXCLUDE_FROM_RECENT_TASK)
     public void testVisibleTasks_excludedFromRecents_visibleTaskNotFirstTask() {
         testVisibleTasks_excludedFromRecents_visibleTaskNotFirstTask_internal();
     }
 
     @Test
-    @EnableFlags(Flags.FLAG_ENABLE_REFACTOR_TASK_THUMBNAIL)
+    @EnableFlags(Flags.FLAG_ENABLE_USE_TOP_VISIBLE_ACTIVITY_FOR_EXCLUDE_FROM_RECENT_TASK)
     public void testVisibleTasks_excludedFromRecents_visibleTaskNotFirstTask_withRefactorFlag() {
         testVisibleTasks_excludedFromRecents_visibleTaskNotFirstTask_internal();
     }
@@ -816,13 +816,13 @@
     }
 
     @Test
-    @DisableFlags(Flags.FLAG_ENABLE_REFACTOR_TASK_THUMBNAIL)
+    @DisableFlags(Flags.FLAG_ENABLE_USE_TOP_VISIBLE_ACTIVITY_FOR_EXCLUDE_FROM_RECENT_TASK)
     public void testVisibleTasks_excludedFromRecents_firstTaskNotVisible() {
         testVisibleTasks_excludedFromRecents_firstTaskNotVisible_internal();
     }
 
     @Test
-    @EnableFlags(Flags.FLAG_ENABLE_REFACTOR_TASK_THUMBNAIL)
+    @EnableFlags(Flags.FLAG_ENABLE_USE_TOP_VISIBLE_ACTIVITY_FOR_EXCLUDE_FROM_RECENT_TASK)
     public void testVisibleTasks_excludedFromRecents_firstTaskNotVisible_withRefactorFlag() {
         testVisibleTasks_excludedFromRecents_firstTaskNotVisible_internal();
     }
diff --git a/telecomm/java/android/telecom/TelecomManager.java b/telecomm/java/android/telecom/TelecomManager.java
index d89c9c1..7082f00 100644
--- a/telecomm/java/android/telecom/TelecomManager.java
+++ b/telecomm/java/android/telecom/TelecomManager.java
@@ -2049,11 +2049,15 @@
     /**
      * Ends the foreground call on the device.
      * <p>
-     * If there is a ringing call, calling this method rejects the ringing call.  Otherwise the
+     * If there is a ringing call, calling this method rejects the ringing call. Otherwise, the
      * foreground call is ended.
      * <p>
      * Note: this method CANNOT be used to end ongoing emergency calls and will return {@code false}
      * if an attempt is made to end an emergency call.
+     * <p>
+     * Note: If the foreground call on this device is self-managed, this method will only end
+     * the call if the caller of this method is privileged (i.e. system, shell, or root) or system
+     * UI.
      *
      * @return {@code true} if there is a call which will be rejected or terminated, {@code false}
      * otherwise.
@@ -2082,6 +2086,9 @@
      * the incoming call requests.  This means, for example, that an incoming call requesting
      * {@link VideoProfile#STATE_BIDIRECTIONAL} will be answered, accepting that state.
      *
+     * If the ringing incoming call is self-managed, this method will only accept the call if the
+     * caller of this method is privileged (i.e. system, shell, or root) or system UI.
+     *
      * @deprecated Companion apps for wearable devices should use the {@link InCallService} API
      * instead.
      */
diff --git a/telecomm/java/com/android/internal/telecom/ITelecomLoader.aidl b/telecomm/java/com/android/internal/telecom/ITelecomLoader.aidl
index eda0f5b..c4a3670 100644
--- a/telecomm/java/com/android/internal/telecom/ITelecomLoader.aidl
+++ b/telecomm/java/com/android/internal/telecom/ITelecomLoader.aidl
@@ -24,5 +24,5 @@
  * Allows the TelecomLoaderService to pass additional dependencies required for creation.
  */
 interface ITelecomLoader {
-    ITelecomService createTelecomService(IInternalServiceRetriever retriever);
+    ITelecomService createTelecomService(IInternalServiceRetriever retriever, String sysUiName);
 }
diff --git a/telephony/java/android/telephony/Annotation.java b/telephony/java/android/telephony/Annotation.java
index 8fe107c..09b18b6 100644
--- a/telephony/java/android/telephony/Annotation.java
+++ b/telephony/java/android/telephony/Annotation.java
@@ -109,6 +109,7 @@
             //TelephonyManager.NETWORK_TYPE_LTE_CA,
 
             TelephonyManager.NETWORK_TYPE_NR,
+            TelephonyManager.NETWORK_TYPE_NB_IOT_NTN,
     })
     @Retention(RetentionPolicy.SOURCE)
     public @interface NetworkType {
diff --git a/telephony/java/android/telephony/CarrierConfigManager.java b/telephony/java/android/telephony/CarrierConfigManager.java
index 59cb5ff..e5f1841 100644
--- a/telephony/java/android/telephony/CarrierConfigManager.java
+++ b/telephony/java/android/telephony/CarrierConfigManager.java
@@ -9756,9 +9756,8 @@
      * }</pre>
      * <p>
      * This config is empty by default.
-     * @hide
      */
-    @FlaggedApi(Flags.FLAG_CARRIER_ROAMING_NB_IOT_NTN)
+    @FlaggedApi(Flags.FLAG_SATELLITE_SYSTEM_APIS)
     public static final String KEY_REGIONAL_SATELLITE_EARFCN_BUNDLE =
             "regional_satellite_earfcn_bundle";
 
@@ -9885,15 +9884,14 @@
             "remove_satellite_plmn_in_manual_network_scan_bool";
 
     /**
-     * This value is used to set the max datagram size, if the value is not available then the
-     * default one will be used.
-     * If key is {@code true}, retrieve the max datagram value and use this value always,
-     * {@code false} the default value from the modem will be used.
+     * This value is used to set the max datagram size in bytes.
+     * If the value is not available then the default value will be used.
      *
-     * @hide
+     * The default value is 255 bytes.
      */
-    public static final String KEY_SATELLITE_SOS_MAX_DATAGRAM_SIZE =
-            "satellite_sos_max_datagram_size";
+    @FlaggedApi(Flags.FLAG_SATELLITE_SYSTEM_APIS)
+    public static final String KEY_SATELLITE_SOS_MAX_DATAGRAM_SIZE_BYTES_INT =
+            "satellite_sos_max_datagram_size_bytes_int";
 
     /** @hide */
     @IntDef({
@@ -10062,9 +10060,9 @@
 
     /**
      * The display name that will be used for satellite functionality within the UI.
-     * The default string value for this is "Satellite".
-     * @hide
+     * The default string value is empty string.
      */
+    @FlaggedApi(Flags.FLAG_SATELLITE_SYSTEM_APIS)
     public static final String KEY_SATELLITE_DISPLAY_NAME_STRING = "satellite_display_name_string";
 
     /**
@@ -10183,10 +10181,8 @@
      * A string array containing the list of messaging apps that support satellite.
      *
      * The default value contains only "com.google.android.apps.messaging"
-     *
-     * @hide
      */
-    @FlaggedApi(Flags.FLAG_OEM_ENABLED_SATELLITE_FLAG)
+    @FlaggedApi(Flags.FLAG_SATELLITE_SYSTEM_APIS)
     public static final String KEY_SATELLITE_SUPPORTED_MSG_APPS_STRING_ARRAY =
             "satellite_supported_msg_apps_string_array";
 
@@ -11458,7 +11454,7 @@
         sDefaults.putIntArray(KEY_CELLULAR_SERVICE_CAPABILITIES_INT_ARRAY, new int[]{1, 2, 3});
         sDefaults.putInt(KEY_WEAR_CONNECTIVITY_BT_TO_CELL_DELAY_MS_INT, -1);
         sDefaults.putInt(KEY_WEAR_CONNECTIVITY_EXTEND_BT_TO_CELL_DELAY_ON_WIFI_MS_INT, -1);
-        sDefaults.putInt(KEY_SATELLITE_SOS_MAX_DATAGRAM_SIZE, 255);
+        sDefaults.putInt(KEY_SATELLITE_SOS_MAX_DATAGRAM_SIZE_BYTES_INT, 255);
     }
 
     /**
diff --git a/telephony/java/android/telephony/RadioAccessFamily.java b/telephony/java/android/telephony/RadioAccessFamily.java
index 90d6f89..8b52f07 100644
--- a/telephony/java/android/telephony/RadioAccessFamily.java
+++ b/telephony/java/android/telephony/RadioAccessFamily.java
@@ -66,6 +66,9 @@
     // 5G
     public static final int RAF_NR = (int) TelephonyManager.NETWORK_TYPE_BITMASK_NR;
 
+    /** NB-IOT (Narrowband Internet of Things) over Non-Terrestrial-Networks technology. */
+    public static final int RAF_NB_IOT_NTN = (int) TelephonyManager.NETWORK_TYPE_BITMASK_NB_IOT_NTN;
+
     // Grouping of RAFs
     // 2G
     private static final int GSM = RAF_GSM | RAF_GPRS | RAF_EDGE;
@@ -80,6 +83,9 @@
     // 5G
     private static final int NR = RAF_NR;
 
+    /** Non-Terrestrial Network. */
+    private static final int NB_IOT_NTN = RAF_NB_IOT_NTN;
+
     /* Phone ID of phone */
     private int mPhoneId;
 
@@ -258,7 +264,7 @@
         raf = ((EVDO & raf) > 0) ? (EVDO | raf) : raf;
         raf = ((LTE & raf) > 0) ? (LTE | raf) : raf;
         raf = ((NR & raf) > 0) ? (NR | raf) : raf;
-
+        raf = ((NB_IOT_NTN & raf) > 0) ? (NB_IOT_NTN | raf) : raf;
         return raf;
     }
 
@@ -364,6 +370,7 @@
             case "WCDMA":   return WCDMA;
             case "LTE_CA":  return RAF_LTE_CA;
             case "NR":      return RAF_NR;
+            case "NB_IOT_NTN": return RAF_NB_IOT_NTN;
             default:        return RAF_UNKNOWN;
         }
     }
diff --git a/telephony/java/android/telephony/ServiceState.java b/telephony/java/android/telephony/ServiceState.java
index 127bbff..f8c3287 100644
--- a/telephony/java/android/telephony/ServiceState.java
+++ b/telephony/java/android/telephony/ServiceState.java
@@ -233,6 +233,12 @@
     public static final int  RIL_RADIO_TECHNOLOGY_NR = 20;
 
     /**
+     * 3GPP NB-IOT (Narrowband Internet of Things) over Non-Terrestrial-Networks technology.
+     * @hide
+     */
+    public static final int RIL_RADIO_TECHNOLOGY_NB_IOT_NTN = 21;
+
+    /**
      * RIL Radio Annotation
      * @hide
      */
@@ -258,14 +264,16 @@
         ServiceState.RIL_RADIO_TECHNOLOGY_TD_SCDMA,
         ServiceState.RIL_RADIO_TECHNOLOGY_IWLAN,
         ServiceState.RIL_RADIO_TECHNOLOGY_LTE_CA,
-        ServiceState.RIL_RADIO_TECHNOLOGY_NR})
+        ServiceState.RIL_RADIO_TECHNOLOGY_NR,
+        ServiceState.RIL_RADIO_TECHNOLOGY_NB_IOT_NTN
+    })
     public @interface RilRadioTechnology {}
 
 
     /**
      * The number of the radio technologies.
      */
-    private static final int NEXT_RIL_RADIO_TECHNOLOGY = 21;
+    private static final int NEXT_RIL_RADIO_TECHNOLOGY = 22;
 
     /** @hide */
     public static final int RIL_RADIO_CDMA_TECHNOLOGY_BITMASK =
@@ -1125,6 +1133,9 @@
             case RIL_RADIO_TECHNOLOGY_NR:
                 rtString = "NR_SA";
                 break;
+            case RIL_RADIO_TECHNOLOGY_NB_IOT_NTN:
+                rtString = "NB_IOT_NTN";
+                break;
             default:
                 rtString = "Unexpected";
                 Rlog.w(LOG_TAG, "Unexpected radioTechnology=" + rt);
@@ -1668,6 +1679,8 @@
                 return TelephonyManager.NETWORK_TYPE_LTE_CA;
             case RIL_RADIO_TECHNOLOGY_NR:
                 return TelephonyManager.NETWORK_TYPE_NR;
+            case RIL_RADIO_TECHNOLOGY_NB_IOT_NTN:
+                return TelephonyManager.NETWORK_TYPE_NB_IOT_NTN;
             default:
                 return TelephonyManager.NETWORK_TYPE_UNKNOWN;
         }
@@ -1697,6 +1710,7 @@
                 return AccessNetworkType.CDMA2000;
             case RIL_RADIO_TECHNOLOGY_LTE:
             case RIL_RADIO_TECHNOLOGY_LTE_CA:
+            case RIL_RADIO_TECHNOLOGY_NB_IOT_NTN:
                 return AccessNetworkType.EUTRAN;
             case RIL_RADIO_TECHNOLOGY_NR:
                 return AccessNetworkType.NGRAN;
@@ -1757,6 +1771,8 @@
                 return RIL_RADIO_TECHNOLOGY_LTE_CA;
             case TelephonyManager.NETWORK_TYPE_NR:
                 return RIL_RADIO_TECHNOLOGY_NR;
+            case TelephonyManager.NETWORK_TYPE_NB_IOT_NTN:
+                return RIL_RADIO_TECHNOLOGY_NB_IOT_NTN;
             default:
                 return RIL_RADIO_TECHNOLOGY_UNKNOWN;
         }
@@ -1866,7 +1882,8 @@
                 || radioTechnology == RIL_RADIO_TECHNOLOGY_TD_SCDMA
                 || radioTechnology == RIL_RADIO_TECHNOLOGY_IWLAN
                 || radioTechnology == RIL_RADIO_TECHNOLOGY_LTE_CA
-                || radioTechnology == RIL_RADIO_TECHNOLOGY_NR;
+                || radioTechnology == RIL_RADIO_TECHNOLOGY_NR
+                || radioTechnology == RIL_RADIO_TECHNOLOGY_NB_IOT_NTN;
 
     }
 
@@ -1886,7 +1903,8 @@
     public static boolean isPsOnlyTech(int radioTechnology) {
         return radioTechnology == RIL_RADIO_TECHNOLOGY_LTE
                 || radioTechnology == RIL_RADIO_TECHNOLOGY_LTE_CA
-                || radioTechnology == RIL_RADIO_TECHNOLOGY_NR;
+                || radioTechnology == RIL_RADIO_TECHNOLOGY_NR
+                || radioTechnology == RIL_RADIO_TECHNOLOGY_NB_IOT_NTN;
     }
 
     /** @hide */
diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java
index 65a52da..aec11c4 100644
--- a/telephony/java/android/telephony/TelephonyManager.java
+++ b/telephony/java/android/telephony/TelephonyManager.java
@@ -3114,6 +3114,12 @@
      * For 5G NSA, the network type will be {@link #NETWORK_TYPE_LTE}.
      */
     public static final int NETWORK_TYPE_NR = TelephonyProtoEnums.NETWORK_TYPE_NR; // 20.
+    /**
+     * 3GPP NB-IOT (Narrowband Internet of Things) over Non-Terrestrial-Networks technology.
+     */
+    @FlaggedApi(Flags.FLAG_SATELLITE_SYSTEM_APIS)
+    public static final int NETWORK_TYPE_NB_IOT_NTN =
+            TelephonyProtoEnums.NETWORK_TYPE_NB_IOT_NTN; // 21
 
     private static final @NetworkType int[] NETWORK_TYPES = {
             NETWORK_TYPE_GPRS,
@@ -3190,6 +3196,7 @@
      * @see #NETWORK_TYPE_EHRPD
      * @see #NETWORK_TYPE_HSPAP
      * @see #NETWORK_TYPE_NR
+     * @see #NETWORK_TYPE_NB_IOT_NTN
      *
      * @hide
      */
@@ -3250,6 +3257,7 @@
      * @see #NETWORK_TYPE_EHRPD
      * @see #NETWORK_TYPE_HSPAP
      * @see #NETWORK_TYPE_NR
+     * @see #NETWORK_TYPE_NB_IOT_NTN
      *
      * @throws UnsupportedOperationException If the device does not have
      *          {@link PackageManager#FEATURE_TELEPHONY_RADIO_ACCESS}.
@@ -3400,6 +3408,8 @@
                 return "LTE_CA";
             case NETWORK_TYPE_NR:
                 return "NR";
+            case NETWORK_TYPE_NB_IOT_NTN:
+                return "NB_IOT_NTN";
             case NETWORK_TYPE_UNKNOWN:
                 return "UNKNOWN";
             default:
@@ -3450,6 +3460,8 @@
                 return NETWORK_TYPE_BITMASK_LTE;
             case NETWORK_TYPE_NR:
                 return NETWORK_TYPE_BITMASK_NR;
+            case NETWORK_TYPE_NB_IOT_NTN:
+                return NETWORK_TYPE_BITMASK_NB_IOT_NTN;
             case NETWORK_TYPE_IWLAN:
                 return NETWORK_TYPE_BITMASK_IWLAN;
             case NETWORK_TYPE_IDEN:
@@ -10160,6 +10172,9 @@
      * This API will result in allowing an intersection of allowed network types for all reasons,
      * including the configuration done through other reasons.
      *
+     * If device supports satellite service, then
+     * {@link #NETWORK_TYPE_NB_IOT_NTN} is added to allowed network types for reason by default.
+     *
      * @param reason the reason the allowed network type change is taking place
      * @param allowedNetworkTypes The bitmask of allowed network type
      * @throws IllegalStateException if the Telephony process is not currently available.
@@ -10209,6 +10224,10 @@
      * <p>Requires permission: android.Manifest.READ_PRIVILEGED_PHONE_STATE or
      * that the calling app has carrier privileges (see {@link #hasCarrierPrivileges}).
      *
+     * If device supports satellite service, then
+     * {@link #NETWORK_TYPE_NB_IOT_NTN} is added to allowed network types for reason by
+     * default.
+     *
      * @param reason the reason the allowed network type change is taking place
      * @return the allowed network type bitmask
      * @throws IllegalStateException    if the Telephony process is not currently available.
@@ -10275,7 +10294,7 @@
      */
     public static String convertNetworkTypeBitmaskToString(
             @NetworkTypeBitMask long networkTypeBitmask) {
-        String networkTypeName = IntStream.rangeClosed(NETWORK_TYPE_GPRS, NETWORK_TYPE_NR)
+        String networkTypeName = IntStream.rangeClosed(NETWORK_TYPE_GPRS, NETWORK_TYPE_NB_IOT_NTN)
                 .filter(x -> {
                     return (networkTypeBitmask & getBitMaskForNetworkType(x))
                             == getBitMaskForNetworkType(x);
@@ -14905,7 +14924,8 @@
                     NETWORK_TYPE_BITMASK_LTE_CA,
                     NETWORK_TYPE_BITMASK_NR,
                     NETWORK_TYPE_BITMASK_IWLAN,
-                    NETWORK_TYPE_BITMASK_IDEN
+                    NETWORK_TYPE_BITMASK_IDEN,
+                    NETWORK_TYPE_BITMASK_NB_IOT_NTN
             })
     public @interface NetworkTypeBitMask {}
 
@@ -15006,6 +15026,12 @@
      */
     public static final long NETWORK_TYPE_BITMASK_IWLAN = (1 << (NETWORK_TYPE_IWLAN -1));
 
+    /**
+     * network type bitmask indicating the support of readio tech NB IOT NTN.
+     */
+    @FlaggedApi(Flags.FLAG_SATELLITE_SYSTEM_APIS)
+    public static final long NETWORK_TYPE_BITMASK_NB_IOT_NTN = (1 << (NETWORK_TYPE_NB_IOT_NTN - 1));
+
     /** @hide */
     public static final long NETWORK_CLASS_BITMASK_2G = NETWORK_TYPE_BITMASK_GSM
                 | NETWORK_TYPE_BITMASK_GPRS
@@ -15034,6 +15060,9 @@
     public static final long NETWORK_CLASS_BITMASK_5G = NETWORK_TYPE_BITMASK_NR;
 
     /** @hide */
+    public static final long NETWORK_CLASS_BITMASK_NTN = NETWORK_TYPE_BITMASK_NB_IOT_NTN;
+
+    /** @hide */
     public static final long NETWORK_STANDARDS_FAMILY_BITMASK_3GPP = NETWORK_TYPE_BITMASK_GSM
             | NETWORK_TYPE_BITMASK_GPRS
             | NETWORK_TYPE_BITMASK_EDGE
@@ -15045,7 +15074,8 @@
             | NETWORK_TYPE_BITMASK_TD_SCDMA
             | NETWORK_TYPE_BITMASK_LTE
             | NETWORK_TYPE_BITMASK_LTE_CA
-            | NETWORK_TYPE_BITMASK_NR;
+            | NETWORK_TYPE_BITMASK_NR
+            | NETWORK_TYPE_BITMASK_NB_IOT_NTN;
 
     /** @hide */
     public static final long NETWORK_STANDARDS_FAMILY_BITMASK_3GPP2 = NETWORK_TYPE_BITMASK_CDMA
@@ -18083,7 +18113,7 @@
      */
     public static boolean isNetworkTypeValid(@NetworkType int networkType) {
         return networkType >= TelephonyManager.NETWORK_TYPE_UNKNOWN &&
-                networkType <= TelephonyManager.NETWORK_TYPE_NR;
+                networkType <= TelephonyManager.NETWORK_TYPE_NB_IOT_NTN;
     }
 
     /**
diff --git a/telephony/java/android/telephony/satellite/SatelliteDisallowedReasonsCallback.java b/telephony/java/android/telephony/satellite/SatelliteDisallowedReasonsCallback.java
index 5e276aa..0a1eedf 100644
--- a/telephony/java/android/telephony/satellite/SatelliteDisallowedReasonsCallback.java
+++ b/telephony/java/android/telephony/satellite/SatelliteDisallowedReasonsCallback.java
@@ -18,6 +18,7 @@
 
 import android.annotation.FlaggedApi;
 import android.annotation.NonNull;
+import android.annotation.SystemApi;
 
 import com.android.internal.telephony.flags.Flags;
 
@@ -26,13 +27,14 @@
  *
  * @hide
  */
-@FlaggedApi(Flags.FLAG_OEM_ENABLED_SATELLITE_FLAG)
+@SystemApi
+@FlaggedApi(Flags.FLAG_SATELLITE_SYSTEM_APIS)
 public interface SatelliteDisallowedReasonsCallback {
 
     /**
      * Called when disallowed reason of satellite has changed.
      * @param disallowedReasons Integer array of disallowed reasons.
      */
-    @FlaggedApi(Flags.FLAG_OEM_ENABLED_SATELLITE_FLAG)
-    void onSatelliteDisallowedReasonsChanged(@NonNull int[] disallowedReasons);
+    void onSatelliteDisallowedReasonsChanged(
+            @NonNull @SatelliteManager.SatelliteDisallowedReason int[] disallowedReasons);
 }
diff --git a/telephony/java/android/telephony/satellite/SatelliteManager.java b/telephony/java/android/telephony/satellite/SatelliteManager.java
index 1025c15..0f23f33 100644
--- a/telephony/java/android/telephony/satellite/SatelliteManager.java
+++ b/telephony/java/android/telephony/satellite/SatelliteManager.java
@@ -560,6 +560,8 @@
      * There is no valid satellite subscription selected.
      * @hide
      */
+    @SystemApi
+    @FlaggedApi(Flags.FLAG_SATELLITE_SYSTEM_APIS)
     public static final int SATELLITE_RESULT_NO_VALID_SATELLITE_SUBSCRIPTION = 30;
 
     /** @hide */
@@ -2393,8 +2395,9 @@
      *
      * @hide
      */
+    @SystemApi
     @RequiresPermission(Manifest.permission.SATELLITE_COMMUNICATION)
-    @FlaggedApi(Flags.FLAG_CARRIER_ROAMING_NB_IOT_NTN)
+    @FlaggedApi(Flags.FLAG_SATELLITE_SYSTEM_APIS)
     public void requestSatelliteAccessConfigurationForCurrentLocation(
             @NonNull @CallbackExecutor Executor executor,
             @NonNull OutcomeReceiver<SatelliteAccessConfiguration, SatelliteException> callback) {
@@ -2507,7 +2510,7 @@
      * @param executor The executor on which the callback will be called.
      * @param callback The callback object to which the result will be delivered.
      *                 If the request is successful, {@link OutcomeReceiver#onResult(Object)}
-     *                 will return the time after which the satellite will be visible.
+     *                 will return the selected NB IOT satellite subscription ID.
      *                 If the request is not successful, {@link OutcomeReceiver#onError(Throwable)}
      *                 will return a {@link SatelliteException} with the {@link SatelliteResult}.
      *
@@ -2515,6 +2518,8 @@
      *
      * @hide
      */
+    @SystemApi
+    @FlaggedApi(Flags.FLAG_SATELLITE_SYSTEM_APIS)
     @RequiresPermission(Manifest.permission.SATELLITE_COMMUNICATION)
     public void requestSelectedNbIotSatelliteSubscriptionId(
             @NonNull @CallbackExecutor Executor executor,
@@ -2574,6 +2579,8 @@
      *
      * @hide
      */
+    @SystemApi
+    @FlaggedApi(Flags.FLAG_SATELLITE_SYSTEM_APIS)
     @RequiresPermission(Manifest.permission.SATELLITE_COMMUNICATION)
     @SatelliteResult public int registerForSelectedNbIotSatelliteSubscriptionChanged(
             @NonNull @CallbackExecutor Executor executor,
@@ -2619,6 +2626,8 @@
      * @throws IllegalStateException if the Telephony process is not currently available.
      * @hide
      */
+    @SystemApi
+    @FlaggedApi(Flags.FLAG_SATELLITE_SYSTEM_APIS)
     @RequiresPermission(Manifest.permission.SATELLITE_COMMUNICATION)
     public void unregisterForSelectedNbIotSatelliteSubscriptionChanged(
             @NonNull SelectedNbIotSatelliteSubscriptionCallback callback) {
@@ -2897,27 +2906,22 @@
     /**
      * Returns list of disallowed reasons of satellite.
      *
-     * @return list of disallowed reasons of satellite.
+     * @return Integer array of disallowed reasons.
      *
      * @throws SecurityException     if caller doesn't have required permission.
      * @throws IllegalStateException if Telephony process isn't available.
      * @hide
      */
+    @SystemApi
     @RequiresPermission(Manifest.permission.SATELLITE_COMMUNICATION)
     @SatelliteDisallowedReason
-    @FlaggedApi(Flags.FLAG_OEM_ENABLED_SATELLITE_FLAG)
+    @FlaggedApi(Flags.FLAG_SATELLITE_SYSTEM_APIS)
     @NonNull
-    public List<Integer> getSatelliteDisallowedReasons() {
+    public int[] getSatelliteDisallowedReasons() {
         try {
             ITelephony telephony = getITelephony();
             if (telephony != null) {
-                int[] receivedArray = telephony.getSatelliteDisallowedReasons();
-                if (receivedArray.length == 0) {
-                    logd("receivedArray is empty, create empty list");
-                    return new ArrayList<>();
-                } else {
-                    return Arrays.stream(receivedArray).boxed().collect(Collectors.toList());
-                }
+                return telephony.getSatelliteDisallowedReasons();
             } else {
                 throw new IllegalStateException("Telephony service is null.");
             }
@@ -2925,7 +2929,7 @@
             loge("getSatelliteDisallowedReasons() RemoteException: " + ex);
             ex.rethrowAsRuntimeException();
         }
-        return new ArrayList<>();
+        return new int[0];
     }
 
     /**
@@ -2938,8 +2942,9 @@
      * @throws IllegalStateException if Telephony process is not available.
      * @hide
      */
+    @SystemApi
     @RequiresPermission(Manifest.permission.SATELLITE_COMMUNICATION)
-    @FlaggedApi(Flags.FLAG_OEM_ENABLED_SATELLITE_FLAG)
+    @FlaggedApi(Flags.FLAG_SATELLITE_SYSTEM_APIS)
     public void registerForSatelliteDisallowedReasonsChanged(
             @NonNull @CallbackExecutor Executor executor,
             @NonNull SatelliteDisallowedReasonsCallback callback) {
@@ -2981,8 +2986,9 @@
      * @throws IllegalStateException if Telephony process is not available.
      * @hide
      */
+    @SystemApi
     @RequiresPermission(Manifest.permission.SATELLITE_COMMUNICATION)
-    @FlaggedApi(Flags.FLAG_OEM_ENABLED_SATELLITE_FLAG)
+    @FlaggedApi(Flags.FLAG_SATELLITE_SYSTEM_APIS)
     public void unregisterForSatelliteDisallowedReasonsChanged(
             @NonNull SatelliteDisallowedReasonsCallback callback) {
         Objects.requireNonNull(callback);
@@ -3606,8 +3612,8 @@
      * @param executor The executor on which the callback will be called.
      * @param callback The callback object to which the result will be delivered.
      *                 If the request is successful, {@link OutcomeReceiver#onResult(Object)}
-     *                 will return display name of the satellite feature in string format. Defaults
-     *                 to satellite. If the request is not successful,
+     *                 will return display name of the satellite feature in string format. Default
+     *                 display name is "Satellite". If the request is not successful,
      *                 {@link OutcomeReceiver#onError(Throwable)} will return an error with
      *                 a SatelliteException.
      *
@@ -3615,10 +3621,12 @@
      * @throws IllegalStateException if the Telephony process is not currently available.
      * @hide
      */
+    @SystemApi
+    @FlaggedApi(Flags.FLAG_SATELLITE_SYSTEM_APIS)
     @RequiresPermission(Manifest.permission.SATELLITE_COMMUNICATION)
     public void requestSatelliteDisplayName(
             @NonNull @CallbackExecutor Executor executor,
-            @NonNull OutcomeReceiver<String, SatelliteException> callback) {
+            @NonNull OutcomeReceiver<CharSequence, SatelliteException> callback) {
         Objects.requireNonNull(executor);
         Objects.requireNonNull(callback);
 
@@ -3630,7 +3638,7 @@
                     protected void onReceiveResult(int resultCode, Bundle resultData) {
                         if (resultCode == SATELLITE_RESULT_SUCCESS) {
                             if (resultData.containsKey(KEY_SATELLITE_DISPLAY_NAME)) {
-                                String satelliteDisplayName =
+                                CharSequence satelliteDisplayName =
                                         resultData.getString(KEY_SATELLITE_DISPLAY_NAME);
                                 executor.execute(() -> Binder.withCleanCallingIdentity(() ->
                                         callback.onResult(satelliteDisplayName)));
diff --git a/telephony/java/android/telephony/satellite/SelectedNbIotSatelliteSubscriptionCallback.java b/telephony/java/android/telephony/satellite/SelectedNbIotSatelliteSubscriptionCallback.java
index d896554..76caef3 100644
--- a/telephony/java/android/telephony/satellite/SelectedNbIotSatelliteSubscriptionCallback.java
+++ b/telephony/java/android/telephony/satellite/SelectedNbIotSatelliteSubscriptionCallback.java
@@ -16,11 +16,18 @@
 
 package android.telephony.satellite;
 
+import android.annotation.FlaggedApi;
+import android.annotation.SystemApi;
+
+import com.android.internal.telephony.flags.Flags;
+
 /**
  * A callback class for selected satellite subscription changed events.
  *
  * @hide
  */
+@SystemApi
+@FlaggedApi(Flags.FLAG_SATELLITE_SYSTEM_APIS)
 public interface SelectedNbIotSatelliteSubscriptionCallback {
     /**
      * Called when the selected satellite subscription has changed.
