Merge "Remove unnecessary abstraction of classes." into main
diff --git a/apct-tests/perftests/core/src/android/libcore/regression/ExpensiveObjectsPerfTest.java b/apct-tests/perftests/core/src/android/libcore/regression/ExpensiveObjectsPerfTest.java
index ecbfc71..10ec2bf 100644
--- a/apct-tests/perftests/core/src/android/libcore/regression/ExpensiveObjectsPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/regression/ExpensiveObjectsPerfTest.java
@@ -75,8 +75,19 @@
     @Test(timeout = 900000)
     public void timeNewCollator() {
         BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+        int i = 0;
         while (state.keepRunning()) {
             Collator.getInstance(Locale.US);
+
+            if (++i % 1000 == 0) {
+                state.pauseTiming();
+                // GC and finalize occasionally to avoid GC for alloc and/or
+                // blocking on finalization during benchmark time.
+                // See: b/394961590
+                System.gc();
+                System.runFinalization();
+                state.resumeTiming();
+            }
         }
     }
 
@@ -84,8 +95,19 @@
     public void timeClonedCollator() {
         Collator c = Collator.getInstance(Locale.US);
         BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
+        int i = 0;
         while (state.keepRunning()) {
             c.clone();
+
+            if (++i % 1000 == 0) {
+                state.pauseTiming();
+                // GC and finalize occasionally to avoid GC for alloc and/or
+                // blocking on finalization during benchmark time.
+                // See: b/394961590
+                System.gc();
+                System.runFinalization();
+                state.resumeTiming();
+            }
         }
     }
 
diff --git a/api/OWNERS b/api/OWNERS
index 965093c..f2bcf13 100644
--- a/api/OWNERS
+++ b/api/OWNERS
@@ -9,4 +9,4 @@
 per-file Android.bp = file:platform/build/soong:/OWNERS #{LAST_RESORT_SUGGESTION}
 
 # For metalava team to disable lint checks in platform
-per-file Android.bp = aurimas@google.com,emberrose@google.com
+per-file Android.bp = aurimas@google.com
diff --git a/cmds/svc/src/com/android/commands/svc/OWNERS b/cmds/svc/src/com/android/commands/svc/OWNERS
index d5a5d7b..a901dfd 100644
--- a/cmds/svc/src/com/android/commands/svc/OWNERS
+++ b/cmds/svc/src/com/android/commands/svc/OWNERS
@@ -1,2 +1,2 @@
 # Bug component: 48448
-per-file NfcCommand.java = file:platform/packages/apps/Nfc:/OWNERS
+per-file NfcCommand.java = file:platform/packages/modules/Nfc:/OWNERS
diff --git a/core/java/android/accessibilityservice/OWNERS b/core/java/android/accessibilityservice/OWNERS
index 1265dfa..dac64f4 100644
--- a/core/java/android/accessibilityservice/OWNERS
+++ b/core/java/android/accessibilityservice/OWNERS
@@ -1,4 +1,7 @@
-# Bug component: 44215
+# Bug component: 1530954
+#
+# The above component is for automated test bugs. If you are a human looking to report
+# a bug in this codebase then please use component 44215.
 
 # Android Accessibility Framework owners
 include /services/accessibility/OWNERS
\ No newline at end of file
diff --git a/core/java/android/view/accessibility/OWNERS b/core/java/android/view/accessibility/OWNERS
index f62b33f..799ef00 100644
--- a/core/java/android/view/accessibility/OWNERS
+++ b/core/java/android/view/accessibility/OWNERS
@@ -1,4 +1,7 @@
-# Bug component: 44215
+# Bug component: 1530954
+#
+# The above component is for automated test bugs. If you are a human looking to report
+# a bug in this codebase then please use component 44215.
 
 # Android Accessibility Framework owners
 include /services/accessibility/OWNERS
diff --git a/core/java/com/android/internal/accessibility/OWNERS b/core/java/com/android/internal/accessibility/OWNERS
index 1265dfa..dac64f4 100644
--- a/core/java/com/android/internal/accessibility/OWNERS
+++ b/core/java/com/android/internal/accessibility/OWNERS
@@ -1,4 +1,7 @@
-# Bug component: 44215
+# Bug component: 1530954
+#
+# The above component is for automated test bugs. If you are a human looking to report
+# a bug in this codebase then please use component 44215.
 
 # Android Accessibility Framework owners
 include /services/accessibility/OWNERS
\ No newline at end of file
diff --git a/core/java/com/android/internal/graphics/palette/OWNERS b/core/java/com/android/internal/graphics/palette/OWNERS
index 731dca9..df86725 100644
--- a/core/java/com/android/internal/graphics/palette/OWNERS
+++ b/core/java/com/android/internal/graphics/palette/OWNERS
@@ -1,3 +1,2 @@
-# Bug component: 484670

-dupin@google.com

-jamesoleary@google.com
\ No newline at end of file
+# Bug component: 484670
+dupin@google.com
diff --git a/core/java/com/android/internal/os/ZygoteInit.java b/core/java/com/android/internal/os/ZygoteInit.java
index e60879e..38dc198 100644
--- a/core/java/com/android/internal/os/ZygoteInit.java
+++ b/core/java/com/android/internal/os/ZygoteInit.java
@@ -429,6 +429,27 @@
                     null /*dependentPackages*/, null /*dependencies*/, false /*isNative*/));
         }
 
+        if (Flags.enableMediaAndLocationPreload()) {
+            // As these libraries are technically optional and not necessarily inherited from
+            // base_system.mk, only cache them if they exist.
+            final String mediaJarPath = "/system/framework/com.android.media.remotedisplay.jar";
+            if (new File(mediaJarPath).exists()) {
+                libs.add(new SharedLibraryInfo(
+                        mediaJarPath, null /*packageName*/,
+                        null /*codePaths*/, null /*name*/, 0 /*version*/,
+                        SharedLibraryInfo.TYPE_BUILTIN, null /*declaringPackage*/,
+                        null /*dependentPackages*/, null /*dependencies*/, false /*isNative*/));
+            }
+            final String locationJarPath = "/system/framework/com.android.location.provider.jar";
+            if (new File(locationJarPath).exists()) {
+                libs.add(new SharedLibraryInfo(
+                        locationJarPath, null /*packageName*/,
+                        null /*codePaths*/, null /*name*/, 0 /*version*/,
+                        SharedLibraryInfo.TYPE_BUILTIN, null /*declaringPackage*/,
+                        null /*dependentPackages*/, null /*dependencies*/, false /*isNative*/));
+            }
+        }
+
         // WindowManager Extensions is an optional shared library that is required for WindowManager
         // Jetpack to fully function. Since it is a widely used library, preload it to improve apps
         // startup performance.
diff --git a/core/java/com/android/internal/os/flags.aconfig b/core/java/com/android/internal/os/flags.aconfig
index f82df85..16d471b 100644
--- a/core/java/com/android/internal/os/flags.aconfig
+++ b/core/java/com/android/internal/os/flags.aconfig
@@ -53,6 +53,13 @@
 }
 
 flag {
+    name: "enable_media_and_location_preload"
+    namespace: "system_performance"
+    description: "Enables zygote preload of non-BCP media and location libraries."
+    bug: "241474956"
+}
+
+flag {
     name: "use_transaction_codes_for_unknown_methods"
     namespace: "stability"
     description: "Use transaction codes when the method names is unknown"
diff --git a/core/java/com/android/internal/widget/remotecompose/OWNERS b/core/java/com/android/internal/widget/remotecompose/OWNERS
index 54facab..e163474 100644
--- a/core/java/com/android/internal/widget/remotecompose/OWNERS
+++ b/core/java/com/android/internal/widget/remotecompose/OWNERS
@@ -5,4 +5,3 @@
 sunnygoyal@google.com
 oscarad@google.com
 pinyaoting@google.com
-zakcohen@google.com
diff --git a/core/jni/Android.bp b/core/jni/Android.bp
index 817284d..c76e8e9 100644
--- a/core/jni/Android.bp
+++ b/core/jni/Android.bp
@@ -42,6 +42,8 @@
 
         "-DU_USING_ICU_NAMESPACE=0",
 
+        "-DANDROID_UTILS_REF_BASE_DISABLE_IMPLICIT_CONSTRUCTION",
+
         "-Wall",
         "-Werror",
         "-Wextra",
diff --git a/core/jni/android_content_res_ObbScanner.cpp b/core/jni/android_content_res_ObbScanner.cpp
index 760037f..5b412ab1 100644
--- a/core/jni/android_content_res_ObbScanner.cpp
+++ b/core/jni/android_content_res_ObbScanner.cpp
@@ -13,6 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+#undef ANDROID_UTILS_REF_BASE_DISABLE_IMPLICIT_CONSTRUCTION // TODO:remove this and fix code
 
 #define LOG_TAG "ObbScanner"
 
diff --git a/core/jni/android_graphics_BLASTBufferQueue.cpp b/core/jni/android_graphics_BLASTBufferQueue.cpp
index b9c3bf7..ed547ef 100644
--- a/core/jni/android_graphics_BLASTBufferQueue.cpp
+++ b/core/jni/android_graphics_BLASTBufferQueue.cpp
@@ -13,6 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+#undef ANDROID_UTILS_REF_BASE_DISABLE_IMPLICIT_CONSTRUCTION // TODO:remove this and fix code
 
 #define LOG_TAG "BLASTBufferQueue"
 
diff --git a/core/jni/android_graphics_GraphicBuffer.cpp b/core/jni/android_graphics_GraphicBuffer.cpp
index d5765f1..61dbb32 100644
--- a/core/jni/android_graphics_GraphicBuffer.cpp
+++ b/core/jni/android_graphics_GraphicBuffer.cpp
@@ -13,6 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+#undef ANDROID_UTILS_REF_BASE_DISABLE_IMPLICIT_CONSTRUCTION // TODO:remove this and fix code
 
 #define LOG_TAG "GraphicBuffer"
 
diff --git a/core/jni/android_graphics_SurfaceTexture.cpp b/core/jni/android_graphics_SurfaceTexture.cpp
index 8dd63cc..93d1e2e 100644
--- a/core/jni/android_graphics_SurfaceTexture.cpp
+++ b/core/jni/android_graphics_SurfaceTexture.cpp
@@ -13,6 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+#undef ANDROID_UTILS_REF_BASE_DISABLE_IMPLICIT_CONSTRUCTION // TODO:remove this and fix code
 
 #undef LOG_TAG
 #define LOG_TAG "SurfaceTexture"
diff --git a/core/jni/android_hardware_Camera.cpp b/core/jni/android_hardware_Camera.cpp
index 3f74fac..13c4fb7 100644
--- a/core/jni/android_hardware_Camera.cpp
+++ b/core/jni/android_hardware_Camera.cpp
@@ -14,6 +14,7 @@
 ** See the License for the specific language governing permissions and
 ** limitations under the License.
 */
+#undef ANDROID_UTILS_REF_BASE_DISABLE_IMPLICIT_CONSTRUCTION // TODO:remove this and fix code
 
 //#define LOG_NDEBUG 0
 #define LOG_TAG "Camera-JNI"
diff --git a/core/jni/android_hardware_HardwareBuffer.cpp b/core/jni/android_hardware_HardwareBuffer.cpp
index 2ea2158d..c8059f3 100644
--- a/core/jni/android_hardware_HardwareBuffer.cpp
+++ b/core/jni/android_hardware_HardwareBuffer.cpp
@@ -13,6 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+#undef ANDROID_UTILS_REF_BASE_DISABLE_IMPLICIT_CONSTRUCTION // TODO:remove this and fix code
 
 #define LOG_TAG "HardwareBuffer"
 
diff --git a/core/jni/android_hardware_SensorManager.cpp b/core/jni/android_hardware_SensorManager.cpp
index 56ea52d..2864a57 100644
--- a/core/jni/android_hardware_SensorManager.cpp
+++ b/core/jni/android_hardware_SensorManager.cpp
@@ -13,6 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+#undef ANDROID_UTILS_REF_BASE_DISABLE_IMPLICIT_CONSTRUCTION // TODO:remove this and fix code
 #define LOG_TAG "SensorManager"
 
 #include <nativehelper/JNIHelp.h>
diff --git a/core/jni/android_hardware_camera2_CameraMetadata.cpp b/core/jni/android_hardware_camera2_CameraMetadata.cpp
index 041fed7..e343438 100644
--- a/core/jni/android_hardware_camera2_CameraMetadata.cpp
+++ b/core/jni/android_hardware_camera2_CameraMetadata.cpp
@@ -14,6 +14,7 @@
 ** See the License for the specific language governing permissions and
 ** limitations under the License.
 */
+#undef ANDROID_UTILS_REF_BASE_DISABLE_IMPLICIT_CONSTRUCTION // TODO:remove this and fix code
 
 // #define LOG_NDEBUG 0
 #include <memory>
diff --git a/core/jni/android_hardware_camera2_DngCreator.cpp b/core/jni/android_hardware_camera2_DngCreator.cpp
index 82570be8..828f2eb 100644
--- a/core/jni/android_hardware_camera2_DngCreator.cpp
+++ b/core/jni/android_hardware_camera2_DngCreator.cpp
@@ -13,6 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+#undef ANDROID_UTILS_REF_BASE_DISABLE_IMPLICIT_CONSTRUCTION // TODO:remove this and fix code
 
 //#define LOG_NDEBUG 0
 #define LOG_TAG "DngCreator_JNI"
diff --git a/core/jni/android_hardware_input_InputWindowHandle.cpp b/core/jni/android_hardware_input_InputWindowHandle.cpp
index 69f6334..bfc5419 100644
--- a/core/jni/android_hardware_input_InputWindowHandle.cpp
+++ b/core/jni/android_hardware_input_InputWindowHandle.cpp
@@ -13,6 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+#undef ANDROID_UTILS_REF_BASE_DISABLE_IMPLICIT_CONSTRUCTION // TODO:remove this and fix code
 
 #define LOG_TAG "InputWindowHandle"
 
diff --git a/core/jni/android_media_AudioRecord.cpp b/core/jni/android_media_AudioRecord.cpp
index f9d00ed..c763959 100644
--- a/core/jni/android_media_AudioRecord.cpp
+++ b/core/jni/android_media_AudioRecord.cpp
@@ -13,6 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+#undef ANDROID_UTILS_REF_BASE_DISABLE_IMPLICIT_CONSTRUCTION // TODO:remove this and fix code
 
 //#define LOG_NDEBUG 0
 
diff --git a/core/jni/android_media_AudioSystem.cpp b/core/jni/android_media_AudioSystem.cpp
index 9bccf5a..a50fb89 100644
--- a/core/jni/android_media_AudioSystem.cpp
+++ b/core/jni/android_media_AudioSystem.cpp
@@ -14,6 +14,7 @@
 ** See the License for the specific language governing permissions and
 ** limitations under the License.
 */
+#undef ANDROID_UTILS_REF_BASE_DISABLE_IMPLICIT_CONSTRUCTION // TODO:remove this and fix code
 
 //#define LOG_NDEBUG 0
 
diff --git a/core/jni/android_media_AudioTrack.cpp b/core/jni/android_media_AudioTrack.cpp
index 1557f9e..a660f0b 100644
--- a/core/jni/android_media_AudioTrack.cpp
+++ b/core/jni/android_media_AudioTrack.cpp
@@ -13,6 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+#undef ANDROID_UTILS_REF_BASE_DISABLE_IMPLICIT_CONSTRUCTION // TODO:remove this and fix code
 //#define LOG_NDEBUG 0
 
 #define LOG_TAG "AudioTrack-JNI"
diff --git a/core/jni/android_media_AudioVolumeGroupCallback.cpp b/core/jni/android_media_AudioVolumeGroupCallback.cpp
index cb4ddbd..d130a4b 100644
--- a/core/jni/android_media_AudioVolumeGroupCallback.cpp
+++ b/core/jni/android_media_AudioVolumeGroupCallback.cpp
@@ -13,6 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+#undef ANDROID_UTILS_REF_BASE_DISABLE_IMPLICIT_CONSTRUCTION // TODO:remove this and fix code
 
 //#define LOG_NDEBUG 0
 
diff --git a/core/jni/android_media_RemoteDisplay.cpp b/core/jni/android_media_RemoteDisplay.cpp
index 3b517f1..cf96f02 100644
--- a/core/jni/android_media_RemoteDisplay.cpp
+++ b/core/jni/android_media_RemoteDisplay.cpp
@@ -13,6 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+#undef ANDROID_UTILS_REF_BASE_DISABLE_IMPLICIT_CONSTRUCTION // TODO:remove this and fix code
 
 #define LOG_TAG "RemoteDisplay"
 
diff --git a/core/jni/android_media_ToneGenerator.cpp b/core/jni/android_media_ToneGenerator.cpp
index cc4657d..3c590c3 100644
--- a/core/jni/android_media_ToneGenerator.cpp
+++ b/core/jni/android_media_ToneGenerator.cpp
@@ -14,6 +14,7 @@
  ** See the License for the specific language governing permissions and
  ** limitations under the License.
  */
+#undef ANDROID_UTILS_REF_BASE_DISABLE_IMPLICIT_CONSTRUCTION // TODO:remove this and fix code
 
 #define LOG_TAG "ToneGenerator"
 #include <stdio.h>
diff --git a/core/jni/android_opengl_EGL14.cpp b/core/jni/android_opengl_EGL14.cpp
index 917d283..7e9beef 100644
--- a/core/jni/android_opengl_EGL14.cpp
+++ b/core/jni/android_opengl_EGL14.cpp
@@ -632,7 +632,7 @@
     if (producer == NULL)
         goto not_valid_surface;
 
-    window = new android::Surface(producer, true);
+    window = android::sp<android::Surface>::make(producer, true);
 
     if (window == NULL)
         goto not_valid_surface;
diff --git a/core/jni/android_os_HwBinder.cpp b/core/jni/android_os_HwBinder.cpp
index 734b5f4..8060e62 100644
--- a/core/jni/android_os_HwBinder.cpp
+++ b/core/jni/android_os_HwBinder.cpp
@@ -13,6 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+#undef ANDROID_UTILS_REF_BASE_DISABLE_IMPLICIT_CONSTRUCTION // TODO:remove this and fix code
 
 //#define LOG_NDEBUG 0
 #define LOG_TAG "android_os_HwBinder"
diff --git a/core/jni/android_os_HwBlob.cpp b/core/jni/android_os_HwBlob.cpp
index e554b44..df579af 100644
--- a/core/jni/android_os_HwBlob.cpp
+++ b/core/jni/android_os_HwBlob.cpp
@@ -13,6 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+#undef ANDROID_UTILS_REF_BASE_DISABLE_IMPLICIT_CONSTRUCTION // TODO:remove this and fix code
 
 //#define LOG_NDEBUG 0
 #define LOG_TAG "android_os_HwBlob"
diff --git a/core/jni/android_os_HwParcel.cpp b/core/jni/android_os_HwParcel.cpp
index c786652..727455c 100644
--- a/core/jni/android_os_HwParcel.cpp
+++ b/core/jni/android_os_HwParcel.cpp
@@ -13,6 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+#undef ANDROID_UTILS_REF_BASE_DISABLE_IMPLICIT_CONSTRUCTION // TODO:remove this and fix code
 
 //#define LOG_NDEBUG 0
 #define LOG_TAG "android_os_HwParcel"
diff --git a/core/jni/android_os_HwRemoteBinder.cpp b/core/jni/android_os_HwRemoteBinder.cpp
index d2d7213..3b56709 100644
--- a/core/jni/android_os_HwRemoteBinder.cpp
+++ b/core/jni/android_os_HwRemoteBinder.cpp
@@ -13,6 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+#undef ANDROID_UTILS_REF_BASE_DISABLE_IMPLICIT_CONSTRUCTION // TODO:remove this and fix code
 
 //#define LOG_NDEBUG 0
 #define LOG_TAG "JHwRemoteBinder"
diff --git a/core/jni/android_os_MessageQueue.cpp b/core/jni/android_os_MessageQueue.cpp
index 30d9ea1..d5d5521 100644
--- a/core/jni/android_os_MessageQueue.cpp
+++ b/core/jni/android_os_MessageQueue.cpp
@@ -13,6 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+#undef ANDROID_UTILS_REF_BASE_DISABLE_IMPLICIT_CONSTRUCTION // TODO:remove this and fix code
 
 #define LOG_TAG "MessageQueue-JNI"
 
diff --git a/core/jni/android_tracing_PerfettoDataSource.cpp b/core/jni/android_tracing_PerfettoDataSource.cpp
index fec2898..ea896e1 100644
--- a/core/jni/android_tracing_PerfettoDataSource.cpp
+++ b/core/jni/android_tracing_PerfettoDataSource.cpp
@@ -13,6 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+#undef ANDROID_UTILS_REF_BASE_DISABLE_IMPLICIT_CONSTRUCTION // TODO:remove this and fix code
 
 #define LOG_TAG "NativeJavaPerfettoDs"
 
@@ -489,4 +490,4 @@
     return 0;
 }
 
-} // namespace android
\ No newline at end of file
+} // namespace android
diff --git a/core/jni/android_util_Binder.cpp b/core/jni/android_util_Binder.cpp
index 8003bb7..7f54516 100644
--- a/core/jni/android_util_Binder.cpp
+++ b/core/jni/android_util_Binder.cpp
@@ -13,9 +13,8 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
 #define LOG_TAG "JavaBinder"
-//#define LOG_NDEBUG 0
+// #define LOG_NDEBUG 0
 
 #include "android_util_Binder.h"
 
@@ -478,7 +477,7 @@
         if (b) return b;
 
         // b/360067751: constructor may trigger GC, so call outside lock
-        b = new JavaBBinder(env, obj);
+        b = sp<JavaBBinder>::make(env, obj);
 
         {
             AutoMutex _l(mLock);
@@ -645,11 +644,17 @@
         } else {
             mObject = env->NewGlobalRef(object);
         }
+    }
+
+    void onFirstRef() override {
+        T::onFirstRef();
+
+        sp<RecipientList<T>> list = mList.promote();
         // These objects manage their own lifetimes so are responsible for final bookkeeping.
         // The list holds a strong reference to this object.
         LOG_DEATH_FREEZE("%s Adding JavaRecipient %p to RecipientList %p", logPrefix<T>(), this,
                          list.get());
-        list->add(this);
+        list->add(sp<JavaRecipient>::fromExisting(this));
     }
 
     void clearReference() {
@@ -657,7 +662,7 @@
         if (list != NULL) {
             LOG_DEATH_FREEZE("%s Removing JavaRecipient %p from RecipientList %p", logPrefix<T>(),
                              this, list.get());
-            list->remove(this);
+            list->remove(sp<JavaRecipient>::fromExisting(this));
         } else {
             LOG_DEATH_FREEZE("%s clearReference() on JavaRecipient %p but RecipientList wp purged",
                              logPrefix<T>(), this);
@@ -939,7 +944,7 @@
     // Frozen state change callbacks for mObject. Reference counted only because
     // JavaFrozenStateChangeCallback hold a weak reference that can be
     // temporarily promoted.
-    sp<FrozenStateChangeCallbackList> mFrozenStateChangCallbackList;
+    sp<FrozenStateChangeCallbackList> mFrozenStateChangeCallbackList;
 };
 
 BinderProxyNativeData* getBPNativeData(JNIEnv* env, jobject obj) {
@@ -964,8 +969,8 @@
     }
 
     BinderProxyNativeData* nativeData = new BinderProxyNativeData();
-    nativeData->mOrgue = new DeathRecipientList;
-    nativeData->mFrozenStateChangCallbackList = new FrozenStateChangeCallbackList;
+    nativeData->mOrgue = sp<DeathRecipientList>::make();
+    nativeData->mFrozenStateChangeCallbackList = sp<FrozenStateChangeCallbackList>::make();
     nativeData->mObject = val;
 
     jobject object = env->CallStaticObjectMethod(gBinderProxyOffsets.mClass,
@@ -1571,8 +1576,8 @@
     LOG_DEATH_FREEZE("linkToDeath: binder=%p recipient=%p\n", target, recipient);
 
     if (!target->localBinder()) {
-        DeathRecipientList* list = nd->mOrgue.get();
-        sp<JavaDeathRecipient> jdr = new JavaDeathRecipient(env, recipient, list);
+        sp<DeathRecipientList> list = nd->mOrgue;
+        sp<JavaDeathRecipient> jdr = sp<JavaDeathRecipient>::make(env, recipient, list);
         status_t err = target->linkToDeath(jdr, NULL, flags);
         if (err != NO_ERROR) {
             // Failure adding the death recipient, so clear its reference
@@ -1648,7 +1653,7 @@
     LOG_DEATH_FREEZE("addFrozenStateChangeCallback: binder=%p callback=%p\n", target, callback);
 
     if (!target->localBinder()) {
-        FrozenStateChangeCallbackList* list = nd->mFrozenStateChangCallbackList.get();
+        sp<FrozenStateChangeCallbackList> list = nd->mFrozenStateChangeCallbackList;
         auto jfscc = sp<JavaFrozenStateChangeCallback>::make(env, callback, list);
         status_t err = target->addFrozenStateChangeCallback(jfscc);
         if (err != NO_ERROR) {
@@ -1682,7 +1687,7 @@
         status_t err = NAME_NOT_FOUND;
 
         // If we find the matching callback, proceed to unlink using that
-        FrozenStateChangeCallbackList* list = nd->mFrozenStateChangCallbackList.get();
+        FrozenStateChangeCallbackList* list = nd->mFrozenStateChangeCallbackList.get();
         sp<JavaRecipient<IBinder::FrozenStateChangeCallback> > origJFSCC = list->find(callback);
         LOG_DEATH_FREEZE("   removeFrozenStateChangeCallback found list %p and JFSCC %p", list,
                          origJFSCC.get());
@@ -1711,7 +1716,7 @@
     BinderProxyNativeData * nativeData = (BinderProxyNativeData *) rawNativeData;
     LOG_DEATH_FREEZE("Destroying BinderProxy: binder=%p drl=%p fsccl=%p\n",
                      nativeData->mObject.get(), nativeData->mOrgue.get(),
-                     nativeData->mFrozenStateChangCallbackList.get());
+                     nativeData->mFrozenStateChangeCallbackList.get());
     delete nativeData;
     IPCThreadState::self()->flushCommands();
 }
diff --git a/core/jni/android_view_CompositionSamplingListener.cpp b/core/jni/android_view_CompositionSamplingListener.cpp
index 59c01dc..28616a0 100644
--- a/core/jni/android_view_CompositionSamplingListener.cpp
+++ b/core/jni/android_view_CompositionSamplingListener.cpp
@@ -13,6 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+#undef ANDROID_UTILS_REF_BASE_DISABLE_IMPLICIT_CONSTRUCTION // TODO:remove this and fix code
 
 #define LOG_TAG "CompositionSamplingListener"
 
diff --git a/core/jni/android_view_DisplayEventReceiver.cpp b/core/jni/android_view_DisplayEventReceiver.cpp
index f007cc5..8587cb2 100644
--- a/core/jni/android_view_DisplayEventReceiver.cpp
+++ b/core/jni/android_view_DisplayEventReceiver.cpp
@@ -13,6 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+#undef ANDROID_UTILS_REF_BASE_DISABLE_IMPLICIT_CONSTRUCTION // TODO:remove this and fix code
 
 #define LOG_TAG "DisplayEventReceiver"
 
diff --git a/core/jni/android_view_InputEventReceiver.cpp b/core/jni/android_view_InputEventReceiver.cpp
index 3a1e883..0b350c5 100644
--- a/core/jni/android_view_InputEventReceiver.cpp
+++ b/core/jni/android_view_InputEventReceiver.cpp
@@ -13,6 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+#undef ANDROID_UTILS_REF_BASE_DISABLE_IMPLICIT_CONSTRUCTION // TODO:remove this and fix code
 
 #define LOG_TAG "InputEventReceiver"
 #define ATRACE_TAG ATRACE_TAG_INPUT
diff --git a/core/jni/android_view_InputEventSender.cpp b/core/jni/android_view_InputEventSender.cpp
index 88b02ba..01309b7 100644
--- a/core/jni/android_view_InputEventSender.cpp
+++ b/core/jni/android_view_InputEventSender.cpp
@@ -13,6 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+#undef ANDROID_UTILS_REF_BASE_DISABLE_IMPLICIT_CONSTRUCTION // TODO:remove this and fix code
 
 #define LOG_TAG "InputEventSender"
 
diff --git a/core/jni/android_view_InputQueue.cpp b/core/jni/android_view_InputQueue.cpp
index 50d2cbe..17165d8 100644
--- a/core/jni/android_view_InputQueue.cpp
+++ b/core/jni/android_view_InputQueue.cpp
@@ -13,6 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+#undef ANDROID_UTILS_REF_BASE_DISABLE_IMPLICIT_CONSTRUCTION // TODO:remove this and fix code
 
 #define LOG_TAG "InputQueue"
 
diff --git a/core/jni/android_view_Surface.cpp b/core/jni/android_view_Surface.cpp
index ac6298d..312c206 100644
--- a/core/jni/android_view_Surface.cpp
+++ b/core/jni/android_view_Surface.cpp
@@ -13,6 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+#undef ANDROID_UTILS_REF_BASE_DISABLE_IMPLICIT_CONSTRUCTION // TODO:remove this and fix code
 
 #define LOG_TAG "Surface"
 
diff --git a/core/jni/android_view_SurfaceControl.cpp b/core/jni/android_view_SurfaceControl.cpp
index 17c89f8..3f6698b 100644
--- a/core/jni/android_view_SurfaceControl.cpp
+++ b/core/jni/android_view_SurfaceControl.cpp
@@ -13,6 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+#undef ANDROID_UTILS_REF_BASE_DISABLE_IMPLICIT_CONSTRUCTION // TODO:remove this and fix code
 
 #define LOG_TAG "SurfaceControl"
 #define LOG_NDEBUG 0
diff --git a/core/jni/android_view_SurfaceControlHdrLayerInfoListener.cpp b/core/jni/android_view_SurfaceControlHdrLayerInfoListener.cpp
index 443f99a..09cb811 100644
--- a/core/jni/android_view_SurfaceControlHdrLayerInfoListener.cpp
+++ b/core/jni/android_view_SurfaceControlHdrLayerInfoListener.cpp
@@ -13,6 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+#undef ANDROID_UTILS_REF_BASE_DISABLE_IMPLICIT_CONSTRUCTION // TODO:remove this and fix code
 
 #define LOG_TAG "SurfaceControlHdrLayerInfoListener"
 
diff --git a/core/jni/android_view_SurfaceSession.cpp b/core/jni/android_view_SurfaceSession.cpp
index 0aac07d..6ad109e 100644
--- a/core/jni/android_view_SurfaceSession.cpp
+++ b/core/jni/android_view_SurfaceSession.cpp
@@ -13,6 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+#undef ANDROID_UTILS_REF_BASE_DISABLE_IMPLICIT_CONSTRUCTION // TODO:remove this and fix code
 
 #define LOG_TAG "SurfaceSession"
 
diff --git a/core/jni/android_view_TextureView.cpp b/core/jni/android_view_TextureView.cpp
index 391f515..21fe1f0 100644
--- a/core/jni/android_view_TextureView.cpp
+++ b/core/jni/android_view_TextureView.cpp
@@ -13,6 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+#undef ANDROID_UTILS_REF_BASE_DISABLE_IMPLICIT_CONSTRUCTION // TODO:remove this and fix code
 
 #include "jni.h"
 #include <nativehelper/JNIHelp.h>
diff --git a/core/jni/android_view_TunnelModeEnabledListener.cpp b/core/jni/android_view_TunnelModeEnabledListener.cpp
index d9ab957..fd78a94 100644
--- a/core/jni/android_view_TunnelModeEnabledListener.cpp
+++ b/core/jni/android_view_TunnelModeEnabledListener.cpp
@@ -13,6 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+#undef ANDROID_UTILS_REF_BASE_DISABLE_IMPLICIT_CONSTRUCTION // TODO:remove this and fix code
 
 #define LOG_TAG "TunnelModeEnabledListener"
 
diff --git a/core/jni/android_window_InputTransferToken.cpp b/core/jni/android_window_InputTransferToken.cpp
index 5bcea9b..f92d128 100644
--- a/core/jni/android_window_InputTransferToken.cpp
+++ b/core/jni/android_window_InputTransferToken.cpp
@@ -13,6 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+#undef ANDROID_UTILS_REF_BASE_DISABLE_IMPLICIT_CONSTRUCTION // TODO:remove this and fix code
 
 #define LOG_TAG "InputTransferToken"
 
@@ -137,4 +138,4 @@
     return err;
 }
 
-} // namespace android
\ No newline at end of file
+} // namespace android
diff --git a/core/jni/android_window_ScreenCapture.cpp b/core/jni/android_window_ScreenCapture.cpp
index 1a52fb7..59ff746 100644
--- a/core/jni/android_window_ScreenCapture.cpp
+++ b/core/jni/android_window_ScreenCapture.cpp
@@ -13,6 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+#undef ANDROID_UTILS_REF_BASE_DISABLE_IMPLICIT_CONSTRUCTION // TODO:remove this and fix code
 
 #define LOG_TAG "ScreenCapture"
 // #define LOG_NDEBUG 0
diff --git a/core/jni/android_window_WindowInfosListener.cpp b/core/jni/android_window_WindowInfosListener.cpp
index c39d5e2..30846ef 100644
--- a/core/jni/android_window_WindowInfosListener.cpp
+++ b/core/jni/android_window_WindowInfosListener.cpp
@@ -13,6 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+#undef ANDROID_UTILS_REF_BASE_DISABLE_IMPLICIT_CONSTRUCTION // TODO:remove this and fix code
 
 #define LOG_TAG "WindowInfosListener"
 
diff --git a/core/jni/com_google_android_gles_jni_EGLImpl.cpp b/core/jni/com_google_android_gles_jni_EGLImpl.cpp
index 5aea848..75330be 100644
--- a/core/jni/com_google_android_gles_jni_EGLImpl.cpp
+++ b/core/jni/com_google_android_gles_jni_EGLImpl.cpp
@@ -14,6 +14,7 @@
 ** See the License for the specific language governing permissions and
 ** limitations under the License.
 */
+#undef ANDROID_UTILS_REF_BASE_DISABLE_IMPLICIT_CONSTRUCTION // TODO:remove this and fix code
 
 #include <nativehelper/JNIHelp.h>
 #include <android_runtime/AndroidRuntime.h>
diff --git a/core/proto/android/nfc/OWNERS b/core/proto/android/nfc/OWNERS
index ca16721..36823ae 100644
--- a/core/proto/android/nfc/OWNERS
+++ b/core/proto/android/nfc/OWNERS
@@ -1 +1 @@
-include platform/packages/apps/Nfc:/OWNERS
\ No newline at end of file
+include platform/packages/modules/Nfc:/OWNERS
\ No newline at end of file
diff --git a/core/res/AndroidManifest.xml b/core/res/AndroidManifest.xml
index 45c4ea0..c084bdd 100644
--- a/core/res/AndroidManifest.xml
+++ b/core/res/AndroidManifest.xml
@@ -8910,7 +8910,7 @@
                 android:permission="android.permission.BIND_JOB_SERVICE" >
         </service>
 
-        <service android:name="com.android.server.ZramMaintenance"
+        <service android:name="com.android.server.memory.ZramMaintenance"
                  android:exported="false"
                  android:permission="android.permission.BIND_JOB_SERVICE" >
         </service>
diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml
index c01a8a9..c735b27 100644
--- a/core/res/res/values/config.xml
+++ b/core/res/res/values/config.xml
@@ -3183,6 +3183,14 @@
          as private. {@see android.view.Display#FLAG_PRIVATE} -->
     <integer-array translatable="false" name="config_localPrivateDisplayPorts"></integer-array>
 
+    <!-- Controls if local secondary displays should be able to steal focus and become top display.
+         Value specified in the array represents physical port address of each display and displays
+         in this list due to flag dependencies will be marked with the following flags:
+         {@see android.view.Display#FLAG_STEAL_TOP_FOCUS_DISABLED}
+         {@see android.view.Display#FLAG_OWN_FOCUS} -->
+    <integer-array translatable="false" name="config_localNotStealTopFocusDisplayPorts">
+    </integer-array>
+
     <!-- The default mode for the default display. One of the following values (See Display.java):
              0 - COLOR_MODE_DEFAULT
              7 - COLOR_MODE_SRGB
diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml
index a3d5be7..cbdf5a1 100644
--- a/core/res/res/values/symbols.xml
+++ b/core/res/res/values/symbols.xml
@@ -425,6 +425,7 @@
   <java-symbol type="bool" name="config_enableProximityService" />
   <java-symbol type="bool" name="config_enableVirtualDeviceManager" />
   <java-symbol type="array" name="config_localPrivateDisplayPorts" />
+  <java-symbol type="array" name="config_localNotStealTopFocusDisplayPorts" />
   <java-symbol type="integer" name="config_defaultDisplayDefaultColorMode" />
   <java-symbol type="bool" name="config_enableAppWidgetService" />
   <java-symbol type="dimen" name="config_pictureInPictureMinAspectRatio" />
diff --git a/data/etc/OWNERS b/data/etc/OWNERS
index 85dae63..712042f 100644
--- a/data/etc/OWNERS
+++ b/data/etc/OWNERS
@@ -5,7 +5,6 @@
 hackbod@google.com
 jeffv@google.com
 jsharkey@android.com
-jsharkey@google.com
 lorenzo@google.com
 yamasani@google.com
 
diff --git a/data/etc/platform.xml b/data/etc/platform.xml
index 7b96699..d06fadb 100644
--- a/data/etc/platform.xml
+++ b/data/etc/platform.xml
@@ -210,6 +210,7 @@
     <assign-permission name="android.permission.STATSCOMPANION" uid="statsd" />
     <assign-permission name="android.permission.UPDATE_APP_OPS_STATS" uid="statsd" />
 
+    <assign-permission name="android.permission.REGISTER_STATS_PULL_ATOM" uid="mmd" />
     <assign-permission name="android.permission.REGISTER_STATS_PULL_ATOM" uid="gpu_service" />
     <assign-permission name="android.permission.REGISTER_STATS_PULL_ATOM" uid="keystore" />
 
diff --git a/data/fonts/script/test/test_commandline.py b/data/fonts/script/test/test_commandline.py
index 75318cc..dbcba41 100755
--- a/data/fonts/script/test/test_commandline.py
+++ b/data/fonts/script/test/test_commandline.py
@@ -75,20 +75,20 @@
         functools.partial(CommandlineTest.fileread, filemap),
     )
 
-    self.assertEquals("output.xml", args.outfile)
+    self.assertEqual("output.xml", args.outfile)
 
-    self.assertEquals(1, len(args.aliases))
-    self.assertEquals("sans-serif-thin", args.aliases[0].name)
-    self.assertEquals("sans-serif", args.aliases[0].to)
-    self.assertEquals(100, args.aliases[0].weight)
+    self.assertEqual(1, len(args.aliases))
+    self.assertEqual("sans-serif-thin", args.aliases[0].name)
+    self.assertEqual("sans-serif", args.aliases[0].to)
+    self.assertEqual(100, args.aliases[0].weight)
 
-    self.assertEquals(2, len(args.fallback))
+    self.assertEqual(2, len(args.fallback))
     # Order is not a part of expectation. Check the expected lang is included.
     langs = set(["und-Arab", "und-Ethi"])
     self.assertTrue(args.fallback[0].lang in langs)
     self.assertTrue(args.fallback[1].lang in langs)
 
-    self.assertEquals(3, len(args.families))
+    self.assertEqual(3, len(args.families))
     # Order is not a part of expectation. Check the expected name is included.
     names = set(["sans-serif", "sans-serif-condensed", "roboto-flex"])
     self.assertTrue(args.families[0].name in names)
diff --git a/data/fonts/script/test/test_xml_builder.py b/data/fonts/script/test/test_xml_builder.py
index 24a033b..f15c513 100755
--- a/data/fonts/script/test/test_xml_builder.py
+++ b/data/fonts/script/test/test_xml_builder.py
@@ -328,16 +328,16 @@
       self.expect_xml(xml)
 
   def expect_xml(self, xml):
-    self.assertEquals("sans-serif", xml.families[0].name)  # _SANS_SERIF
-    self.assertEquals("serif", xml.families[1].name)  # _SERIF
-    self.assertEquals("und-Arab", xml.families[2].lang)  # __ARABIC
-    self.assertEquals("elegant", xml.families[2].variant)
-    self.assertEquals("und-Arab", xml.families[3].lang)  # _ARABIC_UI
-    self.assertEquals("zh-Hans", xml.families[4].lang)  # _HANS (_HANS_SERIF)
-    self.assertEquals(2, len(xml.families[4].fonts))
-    self.assertEquals("serif", xml.families[4].fonts[1].fallback_for)
-    self.assertEquals("ja", xml.families[5].lang)  # _HANS (_HANS_SERIF)
-    self.assertEquals("serif", xml.families[5].fonts[1].fallback_for)
+    self.assertEqual("sans-serif", xml.families[0].name)  # _SANS_SERIF
+    self.assertEqual("serif", xml.families[1].name)  # _SERIF
+    self.assertEqual("und-Arab", xml.families[2].lang)  # __ARABIC
+    self.assertEqual("elegant", xml.families[2].variant)
+    self.assertEqual("und-Arab", xml.families[3].lang)  # _ARABIC_UI
+    self.assertEqual("zh-Hans", xml.families[4].lang)  # _HANS (_HANS_SERIF)
+    self.assertEqual(2, len(xml.families[4].fonts))
+    self.assertEqual("serif", xml.families[4].fonts[1].fallback_for)
+    self.assertEqual("ja", xml.families[5].lang)  # _HANS (_HANS_SERIF)
+    self.assertEqual("serif", xml.families[5].fonts[1].fallback_for)
 
 
 if __name__ == "__main__":
diff --git a/libs/WindowManager/Shell/OWNERS b/libs/WindowManager/Shell/OWNERS
index 394093c6..ab2f3ef 100644
--- a/libs/WindowManager/Shell/OWNERS
+++ b/libs/WindowManager/Shell/OWNERS
@@ -1,7 +1,7 @@
-xutan@google.com
+jorgegil@google.com
 pbdr@google.com
 pragyabajoria@google.com
 
 # Give submodule owners in shell resource approval
-per-file res*/*/*.xml = atsjenk@google.com, hwwang@google.com, jorgegil@google.com, lbill@google.com, madym@google.com, vaniadesmonda@google.com, pbdr@google.com, tkachenkoi@google.com, mpodolian@google.com, liranb@google.com, pragyabajoria@google.com, uysalorhan@google.com, gsennton@google.com, mattsziklay@google.com, mdehaini@google.com
+per-file res*/*/*.xml = atsjenk@google.com, hwwang@google.com, lbill@google.com, madym@google.com, vaniadesmonda@google.com, pbdr@google.com, mpodolian@google.com, liranb@google.com, pragyabajoria@google.com, uysalorhan@google.com, gsennton@google.com, mattsziklay@google.com, mdehaini@google.com
 per-file res*/*/tv_*.xml = bronger@google.com
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/OWNERS b/libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/OWNERS
index afdda8f..47b3ae8 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/OWNERS
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/OWNERS
@@ -3,7 +3,6 @@
 jorgegil@google.com
 madym@google.com
 pbdr@google.com
-tkachenkoi@google.com
 vaniadesmonda@google.com
 pragyabajoria@google.com
 uysalorhan@google.com
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/freeform/OWNERS b/libs/WindowManager/Shell/src/com/android/wm/shell/freeform/OWNERS
index 83b5bf6..44d46ee 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/freeform/OWNERS
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/freeform/OWNERS
@@ -4,7 +4,6 @@
 madym@google.com
 nmusgrave@google.com
 pbdr@google.com
-tkachenkoi@google.com
 vaniadesmonda@google.com
 pragyabajoria@google.com
 uysalorhan@google.com
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/OWNERS b/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/OWNERS
index 3f828f5..9924025 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/OWNERS
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/OWNERS
@@ -1,3 +1,2 @@
-jorgegil@google.com
 mattsziklay@google.com
 mdehaini@google.com
diff --git a/libs/WindowManager/Shell/tests/OWNERS b/libs/WindowManager/Shell/tests/OWNERS
index 65e50f8..5ba90ac 100644
--- a/libs/WindowManager/Shell/tests/OWNERS
+++ b/libs/WindowManager/Shell/tests/OWNERS
@@ -11,7 +11,6 @@
 jorgegil@google.com
 vaniadesmonda@google.com
 pbdr@google.com
-tkachenkoi@google.com
 mpodolian@google.com
 jeremysim@google.com
 peanutbutter@google.com
diff --git a/libs/hwui/OWNERS b/libs/hwui/OWNERS
index bc17459..70d13ab 100644
--- a/libs/hwui/OWNERS
+++ b/libs/hwui/OWNERS
@@ -4,7 +4,6 @@
 djsollen@google.com
 jreck@google.com
 njawad@google.com
-scroggo@google.com
 sumir@google.com
 
 # For text, e.g. Typeface, Font, Minikin, etc.
diff --git a/media/java/android/media/MediaCodec.java b/media/java/android/media/MediaCodec.java
index 871fadf..0bea5a9 100644
--- a/media/java/android/media/MediaCodec.java
+++ b/media/java/android/media/MediaCodec.java
@@ -4054,6 +4054,7 @@
          * Finish building a queue request and queue the buffers with tunings.
          */
         public void queue() {
+            Trace.traceBegin(Trace.TRACE_TAG_VIDEO, "MediaCodec::queueRequest-queue#java");
             if (!isAccessible()) {
                 throw new IllegalStateException("The request is stale");
             }
@@ -4082,6 +4083,7 @@
                         mTuningKeys, mTuningValues);
             }
             clear();
+            Trace.traceEnd(Trace.TRACE_TAG_VIDEO);
         }
 
         @NonNull QueueRequest clear() {
diff --git a/media/java/android/media/session/MediaSessionManager.java b/media/java/android/media/session/MediaSessionManager.java
index 371b47f..22f4182 100644
--- a/media/java/android/media/session/MediaSessionManager.java
+++ b/media/java/android/media/session/MediaSessionManager.java
@@ -155,11 +155,6 @@
     }
 
     /**
-     * This API is not generally intended for third party application developers.
-     * Use the <a href="{@docRoot}jetpack/androidx.html">AndroidX</a>
-     * <a href="{@docRoot}reference/androidx/media2/session/package-summary.html">Media2 session
-     * Library</a> for consistent behavior across all devices.
-     * <p>
      * Notifies that a new {@link MediaSession2} with type {@link Session2Token#TYPE_SESSION} is
      * created.
      * <p>
@@ -283,16 +278,16 @@
     }
 
     /**
-     * This API is not generally intended for third party application developers.
-     * Use the <a href="{@docRoot}jetpack/androidx.html">AndroidX</a>
-     * <a href="{@docRoot}reference/androidx/media2/session/package-summary.html">Media2 session
-     * Library</a> for consistent behavior across all devices.
-     * <p>
      * Gets a list of {@link Session2Token} with type {@link Session2Token#TYPE_SESSION} for the
      * current user.
      * <p>
      * Although this API can be used without any restriction, each session owners can accept or
      * reject your uses of {@link MediaSession2}.
+     * <p>
+     * This API is not generally intended for third party application developers. Apps wanting media
+     * session functionality should use the
+     * <a href="{@docRoot}reference/androidx/media3/session/package-summary.html">AndroidX Media3
+     * Session Library</a>.
      *
      * @return A list of {@link Session2Token}.
      */
@@ -417,12 +412,12 @@
     }
 
     /**
-     * This API is not generally intended for third party application developers.
-     * Use the <a href="{@docRoot}jetpack/androidx.html">AndroidX</a>
-     * <a href="{@docRoot}reference/androidx/media2/session/package-summary.html">Media2 session
-     * Library</a> for consistent behavior across all devices.
-     * <p>
      * Adds a listener to be notified when the {@link #getSession2Tokens()} changes.
+     * <p>
+     * This API is not generally intended for third party application developers. Apps wanting media
+     * session functionality should use the
+     * <a href="{@docRoot}reference/androidx/media3/session/package-summary.html">AndroidX Media3
+     * Session Library</a>.
      *
      * @param listener The listener to add
      */
@@ -433,12 +428,12 @@
     }
 
     /**
-     * This API is not generally intended for third party application developers.
-     * Use the <a href="{@docRoot}jetpack/androidx.html">AndroidX</a>
-     * <a href="{@docRoot}reference/androidx/media2/session/package-summary.html">Media2 session
-     * Library</a> for consistent behavior across all devices.
-     * <p>
      * Adds a listener to be notified when the {@link #getSession2Tokens()} changes.
+     * <p>
+     * This API is not generally intended for third party application developers. Apps wanting media
+     * session functionality should use the
+     * <a href="{@docRoot}reference/androidx/media3/session/package-summary.html">AndroidX Media3
+     * Session Library</a>.
      *
      * @param listener The listener to add
      * @param handler The handler to call listener on.
@@ -451,16 +446,16 @@
     }
 
     /**
-     * This API is not generally intended for third party application developers.
-     * Use the <a href="{@docRoot}jetpack/androidx.html">AndroidX</a>
-     * <a href="{@docRoot}reference/androidx/media2/session/package-summary.html">Media2 session
-     * Library</a> for consistent behavior across all devices.
-     * <p>
      * Adds a listener to be notified when the {@link #getSession2Tokens()} changes.
      * <p>
      * The calling application needs to hold the
      * {@link android.Manifest.permission#INTERACT_ACROSS_USERS_FULL} permission in order to
      * add listeners for user ids that do not belong to current process.
+     * <p>
+     * This API is not generally intended for third party application developers. Apps wanting media
+     * session functionality should use the
+     * <a href="{@docRoot}reference/androidx/media3/session/package-summary.html">AndroidX Media3
+     * Session Library</a>.
      *
      * @param userHandle The userHandle to listen for changes on
      * @param listener The listener to add
@@ -496,12 +491,12 @@
     }
 
     /**
-     * This API is not generally intended for third party application developers.
-     * Use the <a href="{@docRoot}jetpack/androidx.html">AndroidX</a>
-     * <a href="{@docRoot}reference/androidx/media2/session/package-summary.html">Media2 session
-     * Library</a> for consistent behavior across all devices.
-     * <p>
      * Removes the {@link OnSession2TokensChangedListener} to stop receiving session token updates.
+     * <p>
+     * This API is not generally intended for third party application developers. Apps wanting media
+     * session functionality should use the
+     * <a href="{@docRoot}reference/androidx/media3/session/package-summary.html">AndroidX Media3
+     * Session Library</a>.
      *
      * @param listener The listener to remove.
      */
@@ -1061,13 +1056,13 @@
     }
 
     /**
-     * This API is not generally intended for third party application developers.
-     * Use the <a href="{@docRoot}jetpack/androidx.html">AndroidX</a>
-     * <a href="{@docRoot}reference/androidx/media2/session/package-summary.html">Media2 session
-     * Library</a> for consistent behavior across all devices.
-     * <p>
      * Listens for changes to the {@link #getSession2Tokens()}. This can be added
      * using {@link #addOnSession2TokensChangedListener(OnSession2TokensChangedListener, Handler)}.
+     * <p>
+     * This API is not generally intended for third party application developers. Apps wanting media
+     * session functionality should use the
+     * <a href="{@docRoot}reference/androidx/media3/session/package-summary.html">AndroidX Media3
+     * Session Library</a>.
      */
     public interface OnSession2TokensChangedListener {
         /**
diff --git a/media/jni/android_media_MediaCodec.cpp b/media/jni/android_media_MediaCodec.cpp
index 3bc238a..61c287b 100644
--- a/media/jni/android_media_MediaCodec.cpp
+++ b/media/jni/android_media_MediaCodec.cpp
@@ -1232,63 +1232,73 @@
     sp<ABuffer> ivBuffer;
     CryptoPlugin::Mode mode;
     CryptoPlugin::Pattern pattern;
-    CHECK(msg->findInt32("mode", (int*)&mode));
-    CHECK(msg->findSize("numSubSamples", &numSubSamples));
-    CHECK(msg->findBuffer("subSamples", &subSamplesBuffer));
-    CHECK(msg->findInt32("encryptBlocks", (int32_t *)&pattern.mEncryptBlocks));
-    CHECK(msg->findInt32("skipBlocks", (int32_t *)&pattern.mSkipBlocks));
-    CHECK(msg->findBuffer("iv", &ivBuffer));
-    CHECK(msg->findBuffer("key", &keyBuffer));
-
-    // subsamples
+    CryptoPlugin::SubSample *samplesArray = nullptr;
+    ScopedLocalRef<jbyteArray> keyArray(env, env->NewByteArray(16));
+    ScopedLocalRef<jbyteArray> ivArray(env, env->NewByteArray(16));
+    jboolean isCopy;
+    sp<RefBase> cryptoInfosObj;
+    if (msg->findObject("cryptoInfos", &cryptoInfosObj)) {
+        sp<CryptoInfosWrapper> cryptoInfos((CryptoInfosWrapper*)cryptoInfosObj.get());
+        CHECK(!cryptoInfos->value.empty() && (cryptoInfos->value[0] != nullptr));
+        std::unique_ptr<CodecCryptoInfo> &info = cryptoInfos->value[0];
+        mode = info->mMode;
+        numSubSamples = info->mNumSubSamples;
+        samplesArray = info->mSubSamples;
+        pattern = info->mPattern;
+        if (info->mKey != nullptr) {
+            jbyte * dstKey = env->GetByteArrayElements(keyArray.get(), &isCopy);
+            memcpy(dstKey, info->mKey, 16);
+            env->ReleaseByteArrayElements(keyArray.get(), dstKey, 0);
+        }
+        if (info->mIv != nullptr) {
+            jbyte * dstIv = env->GetByteArrayElements(ivArray.get(), &isCopy);
+            memcpy(dstIv, info->mIv, 16);
+            env->ReleaseByteArrayElements(ivArray.get(), dstIv, 0);
+        }
+    } else {
+        CHECK(msg->findInt32("mode", (int*)&mode));
+        CHECK(msg->findSize("numSubSamples", &numSubSamples));
+        CHECK(msg->findBuffer("subSamples", &subSamplesBuffer));
+        CHECK(msg->findInt32("encryptBlocks", (int32_t *)&pattern.mEncryptBlocks));
+        CHECK(msg->findInt32("skipBlocks", (int32_t *)&pattern.mSkipBlocks));
+        CHECK(msg->findBuffer("iv", &ivBuffer));
+        CHECK(msg->findBuffer("key", &keyBuffer));
+        samplesArray =
+                (CryptoPlugin::SubSample*)(subSamplesBuffer.get()->data());
+        if (keyBuffer.get() != nullptr && keyBuffer->size() > 0) {
+            jbyte * dstKey = env->GetByteArrayElements(keyArray.get(), &isCopy);
+            memcpy(dstKey, keyBuffer->data(), keyBuffer->size());
+            env->ReleaseByteArrayElements(keyArray.get(), dstKey, 0);
+        }
+        if (ivBuffer.get() != nullptr && ivBuffer->size() > 0) {
+            jbyte * dstIv = env->GetByteArrayElements(ivArray.get(), &isCopy);
+            memcpy(dstIv, ivBuffer->data(), ivBuffer->size());
+            env->ReleaseByteArrayElements(ivArray.get(), dstIv, 0);
+        }
+    }
     ScopedLocalRef<jintArray> samplesOfEncryptedDataArr(env, env->NewIntArray(numSubSamples));
     ScopedLocalRef<jintArray> samplesOfClearDataArr(env, env->NewIntArray(numSubSamples));
-    jboolean isCopy;
-    jint *dstEncryptedSamples =
-        env->GetIntArrayElements(samplesOfEncryptedDataArr.get(), &isCopy);
-    jint * dstClearSamples =
-        env->GetIntArrayElements(samplesOfClearDataArr.get(), &isCopy);
-
-    CryptoPlugin::SubSample * samplesArray =
-        (CryptoPlugin::SubSample*)(subSamplesBuffer.get()->data());
-
-    for(int i = 0 ; i < numSubSamples ; i++) {
-        dstEncryptedSamples[i] = samplesArray[i].mNumBytesOfEncryptedData;
-        dstClearSamples[i] = samplesArray[i].mNumBytesOfClearData;
+    if (numSubSamples > 0) {
+        jint *dstEncryptedSamples =
+            env->GetIntArrayElements(samplesOfEncryptedDataArr.get(), &isCopy);
+        jint * dstClearSamples =
+            env->GetIntArrayElements(samplesOfClearDataArr.get(), &isCopy);
+        for(int i = 0 ; i < numSubSamples ; i++) {
+            dstEncryptedSamples[i] = samplesArray[i].mNumBytesOfEncryptedData;
+            dstClearSamples[i] = samplesArray[i].mNumBytesOfClearData;
+        }
+        env->ReleaseIntArrayElements(samplesOfEncryptedDataArr.get(), dstEncryptedSamples, 0);
+        env->ReleaseIntArrayElements(samplesOfClearDataArr.get(), dstClearSamples, 0);
     }
-    env->ReleaseIntArrayElements(samplesOfEncryptedDataArr.get(), dstEncryptedSamples, 0);
-    env->ReleaseIntArrayElements(samplesOfClearDataArr.get(), dstClearSamples, 0);
-    // key and iv
-    jbyteArray keyArray = NULL;
-    jbyteArray ivArray = NULL;
-    if (keyBuffer.get() != nullptr && keyBuffer->size() > 0) {
-        keyArray = env->NewByteArray(keyBuffer->size());
-        jbyte * dstKey = env->GetByteArrayElements(keyArray, &isCopy);
-        memcpy(dstKey, keyBuffer->data(), keyBuffer->size());
-        env->ReleaseByteArrayElements(keyArray,dstKey,0);
-    }
-    if (ivBuffer.get() != nullptr && ivBuffer->size() > 0) {
-        ivArray = env->NewByteArray(ivBuffer->size());
-        jbyte *dstIv = env->GetByteArrayElements(ivArray, &isCopy);
-        memcpy(dstIv, ivBuffer->data(), ivBuffer->size());
-        env->ReleaseByteArrayElements(ivArray, dstIv,0);
-    }
-    // set samples, key and iv
     env->CallVoidMethod(
         obj,
         gFields.cryptoInfoSetID,
         (jint)numSubSamples,
         samplesOfClearDataArr.get(),
         samplesOfEncryptedDataArr.get(),
-        keyArray,
-        ivArray,
+        keyArray.get(),
+        ivArray.get(),
         mode);
-    if (keyArray != NULL) {
-        env->DeleteLocalRef(keyArray);
-    }
-    if (ivArray != NULL) {
-        env->DeleteLocalRef(ivArray);
-    }
     // set pattern
     env->CallVoidMethod(
         obj,
diff --git a/nfc-extras/OWNERS b/nfc-extras/OWNERS
index 35e9713..2b82bc8 100644
--- a/nfc-extras/OWNERS
+++ b/nfc-extras/OWNERS
@@ -1,2 +1,2 @@
 # Bug component: 48448
-include platform/packages/apps/Nfc:/OWNERS
+include platform/packages/modules/Nfc:/OWNERS
diff --git a/nfc-non-updatable/OWNERS b/nfc-non-updatable/OWNERS
index f46dccd..47f209f 100644
--- a/nfc-non-updatable/OWNERS
+++ b/nfc-non-updatable/OWNERS
@@ -1,2 +1,2 @@
 # Bug component: 48448
-include platform/packages/apps/Nfc:/OWNERS
\ No newline at end of file
+include platform/packages/modules/Nfc:/OWNERS
\ No newline at end of file
diff --git a/nfc-non-updatable/java/android/nfc/cardemulation/ApduServiceInfo.java b/nfc-non-updatable/java/android/nfc/cardemulation/ApduServiceInfo.java
index e83b9f1..f2a68af 100644
--- a/nfc-non-updatable/java/android/nfc/cardemulation/ApduServiceInfo.java
+++ b/nfc-non-updatable/java/android/nfc/cardemulation/ApduServiceInfo.java
@@ -70,6 +70,11 @@
 public final class ApduServiceInfo implements Parcelable {
     private static final String TAG = "ApduServiceInfo";
 
+    private static final Pattern PLPF_PATTERN =
+            Pattern.compile("[0-9A-Fa-f]{2,}[0-9A-Fa-f,\\?,\\*\\.]*");
+    private static final Pattern PLF_PATTERN =
+            Pattern.compile("[0-9A-Fa-f]{2,}");
+
     /**
      * Component level {@link android.content.pm.PackageManager.Property PackageManager
      * .Property} for a system application to change its icon and label
@@ -472,7 +477,12 @@
                     boolean autoTransact = a.getBoolean(
                             com.android.internal.R.styleable.PollingLoopFilter_autoTransact,
                             false);
-                    if (!mOnHost && !autoTransact) {
+                    boolean isValidFilter = PLF_PATTERN.matcher(plf).matches()
+                            && plf.length() % 2 == 0;
+                    if (!isValidFilter) {
+                        Log.e(TAG, "Ignoring polling-loop-filter " + plf
+                                + " it is not a valid filter");
+                    } else if (!mOnHost && !autoTransact) {
                         Log.e(TAG, "Ignoring polling-loop-filter " + plf
                                 + " for offhost service that isn't autoTransact");
                     } else {
@@ -489,8 +499,12 @@
                     boolean autoTransact = a.getBoolean(
                             com.android.internal.R.styleable.PollingLoopFilter_autoTransact,
                             false);
-                    if (!mOnHost && !autoTransact) {
-                        Log.e(TAG, "Ignoring polling-loop-filter " + plf
+                    boolean isValidFilter = PLPF_PATTERN.matcher(plf).matches();
+                    if (!isValidFilter) {
+                        Log.e(TAG, "Ignoring polling-loop-pattern-filter " + plf
+                                + " it is not a valid pattern filter");
+                    } else if (!mOnHost && !autoTransact) {
+                        Log.e(TAG, "Ignoring polling-loop-pattern-filter " + plf
                                 + " for offhost service that isn't autoTransact");
                     } else {
                         mAutoTransactPatterns.put(Pattern.compile(plf), autoTransact);
@@ -814,10 +828,16 @@
     @FlaggedApi(Flags.FLAG_NFC_READ_POLLING_LOOP)
     public void addPollingLoopFilter(@NonNull String pollingLoopFilter,
             boolean autoTransact) {
+        if (!PLF_PATTERN.matcher(pollingLoopFilter).matches()
+                || pollingLoopFilter.length() % 2 != 0) {
+            throw new IllegalArgumentException(
+                    "Polling loop filter must contain an even number of characters 0-9 or A-F"
+            );
+        }
         if (!mOnHost && !autoTransact) {
             return;
         }
-        mAutoTransact.put(pollingLoopFilter, autoTransact);
+        mAutoTransact.put(pollingLoopFilter.toUpperCase(Locale.ROOT), autoTransact);
     }
 
     /**
@@ -842,10 +862,16 @@
     @FlaggedApi(Flags.FLAG_NFC_READ_POLLING_LOOP)
     public void addPollingLoopPatternFilter(@NonNull String pollingLoopPatternFilter,
             boolean autoTransact) {
+        if (!PLPF_PATTERN.matcher(pollingLoopPatternFilter).matches()) {
+            throw new IllegalArgumentException(
+                    "Polling loop pattern filter is invalid"
+            );
+        }
         if (!mOnHost && !autoTransact) {
             return;
         }
-        mAutoTransactPatterns.put(Pattern.compile(pollingLoopPatternFilter), autoTransact);
+        mAutoTransactPatterns.put(Pattern.compile(
+                pollingLoopPatternFilter.toUpperCase(Locale.ROOT)), autoTransact);
     }
 
     /**
diff --git a/omapi/OWNERS b/omapi/OWNERS
index 39c5c5b..375d643 100644
--- a/omapi/OWNERS
+++ b/omapi/OWNERS
@@ -1,2 +1,2 @@
 # Bug component: 456592
-include platform/packages/apps/Nfc:/OWNERS
+include platform/packages/modules/Nfc:/OWNERS
diff --git a/omapi/java/android/se/OWNERS b/omapi/java/android/se/OWNERS
index 39c5c5b..375d643 100644
--- a/omapi/java/android/se/OWNERS
+++ b/omapi/java/android/se/OWNERS
@@ -1,2 +1,2 @@
 # Bug component: 456592
-include platform/packages/apps/Nfc:/OWNERS
+include platform/packages/modules/Nfc:/OWNERS
diff --git a/omapi/java/android/se/omapi/OWNERS b/omapi/java/android/se/omapi/OWNERS
index 39c5c5b..375d643 100644
--- a/omapi/java/android/se/omapi/OWNERS
+++ b/omapi/java/android/se/omapi/OWNERS
@@ -1,2 +1,2 @@
 # Bug component: 456592
-include platform/packages/apps/Nfc:/OWNERS
+include platform/packages/modules/Nfc:/OWNERS
diff --git a/packages/SettingsLib/src/com/android/settingslib/media/OWNERS b/packages/SettingsLib/src/com/android/settingslib/media/OWNERS
index d58add4..a34876d 100644
--- a/packages/SettingsLib/src/com/android/settingslib/media/OWNERS
+++ b/packages/SettingsLib/src/com/android/settingslib/media/OWNERS
@@ -3,5 +3,8 @@
 michaelmikhil@google.com
 apotapov@google.com
 
+# Output Switcher OWNERS
+file:/packages/SystemUI/src/com/android/systemui/media/dialog/OWNERS
+
 #Android Media - For minor changes and renames only.
 aquilescanta@google.com #{LAST_RESORT_SUGGESTION}
diff --git a/packages/SystemUI/OWNERS b/packages/SystemUI/OWNERS
index 7fadcc4..09c0cf7 100644
--- a/packages/SystemUI/OWNERS
+++ b/packages/SystemUI/OWNERS
@@ -13,7 +13,6 @@
 andonian@google.com
 amiko@google.com
 austindelgado@google.com
-aroederer@google.com
 arteiro@google.com
 asc@google.com
 awickham@google.com
@@ -103,7 +102,6 @@
 syeonlee@google.com
 sunnygoyal@google.com
 thiruram@google.com
-tkachenkoi@google.com
 tracyzhou@google.com
 tsuji@google.com
 twickham@google.com
diff --git a/packages/SystemUI/plugin_core/proguard.flags b/packages/SystemUI/plugin_core/proguard.flags
index 6240898..8b78ba4 100644
--- a/packages/SystemUI/plugin_core/proguard.flags
+++ b/packages/SystemUI/plugin_core/proguard.flags
@@ -8,4 +8,7 @@
 -keep interface com.android.systemui.plugins.annotations.** {
     *;
 }
--keep,allowshrinking,allowoptimization,allowobfuscation,allowaccessmodification @com.android.systemui.plugins.annotations.** class *
+# TODO(b/373579455): Evaluate if <init> needs to be kept.
+-keep,allowshrinking,allowoptimization,allowobfuscation,allowaccessmodification @com.android.systemui.plugins.annotations.** class * {
+    void <init>();
+}
diff --git a/packages/SystemUI/proguard_common.flags b/packages/SystemUI/proguard_common.flags
index 02b2bcf..2224837 100644
--- a/packages/SystemUI/proguard_common.flags
+++ b/packages/SystemUI/proguard_common.flags
@@ -12,8 +12,14 @@
 # Note that we restrict this to SysUISingleton classes, as other registering
 # classes should either *always* unregister or *never* register from their
 # constructor. We also keep callback class names for easier debugging.
--keepnames @com.android.systemui.util.annotations.WeaklyReferencedCallback class *
--keepnames class * extends @com.android.systemui.util.annotations.WeaklyReferencedCallback **
+# TODO(b/373579455): Evaluate if <init> needs to be kept.
+-keepnames @com.android.systemui.util.annotations.WeaklyReferencedCallback class * {
+  void <init>();
+}
+# TODO(b/373579455): Evaluate if <init> needs to be kept.
+-keepnames class * extends @com.android.systemui.util.annotations.WeaklyReferencedCallback ** {
+  void <init>();
+}
 -if @com.android.systemui.util.annotations.WeaklyReferencedCallback class *
 -keepclassmembers,allowaccessmodification @com.android.systemui.dagger.SysUISingleton class * {
   <1> *;
@@ -23,10 +29,16 @@
   <1> *;
 }
 
--keep class androidx.core.app.CoreComponentFactory
+# TODO(b/373579455): Evaluate if <init> needs to be kept.
+-keep class androidx.core.app.CoreComponentFactory {
+  void <init>();
+}
 
 # Keep the wm shell lib
--keep class com.android.wm.shell.*
+# TODO(b/373579455): Evaluate if <init> needs to be kept.
+-keep class com.android.wm.shell.* {
+  void <init>();
+}
 # Keep the protolog group methods that are called by the generated code
 -keepclassmembers class com.android.wm.shell.protolog.ShellProtoLogGroup {
     *;
diff --git a/packages/SystemUI/src/com/android/systemui/accessibility/OWNERS b/packages/SystemUI/src/com/android/systemui/accessibility/OWNERS
index 1ed8c06..5a59b7a 100644
--- a/packages/SystemUI/src/com/android/systemui/accessibility/OWNERS
+++ b/packages/SystemUI/src/com/android/systemui/accessibility/OWNERS
@@ -1,4 +1,7 @@
-# Bug component: 44215
+# Bug component: 1530954
+#
+# The above component is for automated test bugs. If you are a human looking to report
+# a bug in this codebase then please use component 44215.
 
 include /core/java/android/view/accessibility/OWNERS
 jonesriley@google.com
\ No newline at end of file
diff --git a/packages/SystemUI/src/com/android/systemui/ailabs/OWNERS b/packages/SystemUI/src/com/android/systemui/ailabs/OWNERS
index b65d29c..429b4b0 100644
--- a/packages/SystemUI/src/com/android/systemui/ailabs/OWNERS
+++ b/packages/SystemUI/src/com/android/systemui/ailabs/OWNERS
@@ -5,5 +5,4 @@
 pauldpong@google.com
 praveenj@google.com
 vicliang@google.com
-mfolkerts@google.com
 yuklimko@google.com
diff --git a/packages/SystemUI/src/com/android/systemui/notetask/OWNERS b/packages/SystemUI/src/com/android/systemui/notetask/OWNERS
index 0ec996b..9b4902a 100644
--- a/packages/SystemUI/src/com/android/systemui/notetask/OWNERS
+++ b/packages/SystemUI/src/com/android/systemui/notetask/OWNERS
@@ -6,5 +6,4 @@
 mgalhardo@google.com
 petrcermak@google.com
 stevenckng@google.com
-tkachenkoi@google.com
-vanjan@google.com
\ No newline at end of file
+vanjan@google.com
diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/dialog/InternetDialogDelegate.java b/packages/SystemUI/src/com/android/systemui/qs/tiles/dialog/InternetDialogDelegate.java
index 89b9eee..70221a3 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/tiles/dialog/InternetDialogDelegate.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/dialog/InternetDialogDelegate.java
@@ -565,8 +565,10 @@
                 }
                 mSecondaryMobileNetworkLayout = mDialogView.findViewById(
                         R.id.secondary_mobile_network_layout);
-                mSecondaryMobileNetworkLayout.setOnClickListener(
-                        this::onClickConnectedSecondarySub);
+                if (mCanConfigMobileData) {
+                    mSecondaryMobileNetworkLayout.setOnClickListener(
+                            this::onClickConnectedSecondarySub);
+                }
                 mSecondaryMobileNetworkLayout.setBackground(mBackgroundOn);
 
                 TextView mSecondaryMobileTitleText = mDialogView.requireViewById(
@@ -599,7 +601,8 @@
                         mDialogView.requireViewById(R.id.secondary_settings_icon);
                 mSecondaryMobileSettingsIcon.setColorFilter(
                         dialog.getContext().getColor(R.color.connected_network_primary_color));
-
+                mSecondaryMobileSettingsIcon.setVisibility(mCanConfigMobileData ?
+                        View.VISIBLE : View.INVISIBLE);
                 // set secondary visual for default data sub
                 mMobileNetworkLayout.setBackground(mBackgroundOff);
                 mMobileTitleText.setTextAppearance(R.style.TextAppearance_InternetDialog);
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/OWNERS b/packages/SystemUI/src/com/android/systemui/statusbar/notification/OWNERS
index 5558ab1..d284cde 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/OWNERS
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/OWNERS
@@ -3,7 +3,6 @@
 # Bug component: 78010
 
 aioana@google.com
-aroederer@google.com
 iyz@google.com
 jeffdq@google.com
 juliacr@google.com
diff --git a/packages/SystemUI/src/com/android/systemui/stylus/OWNERS b/packages/SystemUI/src/com/android/systemui/stylus/OWNERS
index 0ec996b..9b4902a 100644
--- a/packages/SystemUI/src/com/android/systemui/stylus/OWNERS
+++ b/packages/SystemUI/src/com/android/systemui/stylus/OWNERS
@@ -6,5 +6,4 @@
 mgalhardo@google.com
 petrcermak@google.com
 stevenckng@google.com
-tkachenkoi@google.com
-vanjan@google.com
\ No newline at end of file
+vanjan@google.com
diff --git a/packages/SystemUI/tests/src/com/android/systemui/notetask/OWNERS b/packages/SystemUI/tests/src/com/android/systemui/notetask/OWNERS
index 0ec996b..9b4902a 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/notetask/OWNERS
+++ b/packages/SystemUI/tests/src/com/android/systemui/notetask/OWNERS
@@ -6,5 +6,4 @@
 mgalhardo@google.com
 petrcermak@google.com
 stevenckng@google.com
-tkachenkoi@google.com
-vanjan@google.com
\ No newline at end of file
+vanjan@google.com
diff --git a/packages/SystemUI/tests/src/com/android/systemui/stylus/OWNERS b/packages/SystemUI/tests/src/com/android/systemui/stylus/OWNERS
index 0ec996b..9b4902a 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/stylus/OWNERS
+++ b/packages/SystemUI/tests/src/com/android/systemui/stylus/OWNERS
@@ -6,5 +6,4 @@
 mgalhardo@google.com
 petrcermak@google.com
 stevenckng@google.com
-tkachenkoi@google.com
-vanjan@google.com
\ No newline at end of file
+vanjan@google.com
diff --git a/services/accessibility/OWNERS b/services/accessibility/OWNERS
index 4e11750..ab1e9ff 100644
--- a/services/accessibility/OWNERS
+++ b/services/accessibility/OWNERS
@@ -1,4 +1,7 @@
-# Bug component: 44215
+# Bug component: 1530954
+#
+# The above component is for automated test bugs. If you are a human looking to report
+# a bug in this codebase then please use component 44215.
 
 # Android Accessibility Framework owners
 danielnorman@google.com
diff --git a/services/accessibility/java/com/android/server/accessibility/magnification/OWNERS b/services/accessibility/java/com/android/server/accessibility/magnification/OWNERS
new file mode 100644
index 0000000..ff812ad
--- /dev/null
+++ b/services/accessibility/java/com/android/server/accessibility/magnification/OWNERS
@@ -0,0 +1,8 @@
+# Bug component: 1530954
+#
+# The above component is for automated test bugs. If you are a human looking to report
+# a bug in this codebase then please use component 770744.
+
+juchengchou@google.com
+chenjean@google.com
+chihtinglo@google.com
diff --git a/services/core/Android.bp b/services/core/Android.bp
index 717a2d4..1f22f08 100644
--- a/services/core/Android.bp
+++ b/services/core/Android.bp
@@ -243,6 +243,7 @@
         "aconfig_new_storage_flags_lib",
         "powerstats_flags_lib",
         "locksettings_flags_lib",
+        "MmdProperties",
         "mmd_flags_lib",
     ],
     javac_shard_size: 50,
@@ -274,9 +275,15 @@
     out: ["services.core.priorityboosted.jar"],
 }
 
+java_genrule_combiner {
+    name: "services.core.combined",
+    static_libs: ["services.core.priorityboosted"],
+    headers: ["services.core.unboosted"],
+}
+
 java_library {
     name: "services.core",
-    static_libs: ["services.core.priorityboosted"],
+    static_libs: ["services.core.combined"],
 }
 
 java_library_host {
diff --git a/services/core/java/com/android/server/OWNERS b/services/core/java/com/android/server/OWNERS
index ef769cf..6858e29 100644
--- a/services/core/java/com/android/server/OWNERS
+++ b/services/core/java/com/android/server/OWNERS
@@ -9,7 +9,6 @@
 
 # Zram writeback
 per-file ZramWriteback.java = minchan@google.com, rajekumar@google.com
-per-file ZramMaintenance.java = kawasin@google.com
 
 # ServiceWatcher
 per-file ServiceWatcher.java = sooniln@google.com
diff --git a/services/core/java/com/android/server/StorageManagerService.java b/services/core/java/com/android/server/StorageManagerService.java
index 6045f63..ebaf6bc 100644
--- a/services/core/java/com/android/server/StorageManagerService.java
+++ b/services/core/java/com/android/server/StorageManagerService.java
@@ -126,6 +126,7 @@
 import android.provider.MediaStore;
 import android.provider.Settings;
 import android.service.storage.ExternalStorageService;
+import android.sysprop.MmdProperties;
 import android.text.TextUtils;
 import android.text.format.DateUtils;
 import android.util.ArrayMap;
@@ -155,6 +156,7 @@
 import com.android.internal.util.Preconditions;
 import com.android.modules.utils.TypedXmlPullParser;
 import com.android.modules.utils.TypedXmlSerializer;
+import com.android.server.memory.ZramMaintenance;
 import com.android.server.pm.Installer;
 import com.android.server.pm.UserManagerInternal;
 import com.android.server.storage.AppFuseBridge;
@@ -933,21 +935,21 @@
         // Start scheduling nominally-daily fstrim operations
         MountServiceIdler.scheduleIdlePass(mContext);
 
-        // Toggle zram-enable system property in response to settings
-        mContext.getContentResolver().registerContentObserver(
-            Settings.Global.getUriFor(Settings.Global.ZRAM_ENABLED),
-            false /*notifyForDescendants*/,
-            new ContentObserver(null /* current thread */) {
-                @Override
-                public void onChange(boolean selfChange) {
-                    refreshZramSettings();
-                }
-            });
-        refreshZramSettings();
-
-        if (mmdEnabled()) {
+        if (mmdEnabled() && MmdProperties.mmd_zram_enabled().orElse(false)) {
             ZramMaintenance.startZramMaintenance(mContext);
         } else {
+            // Toggle zram-enable system property in response to settings
+            mContext.getContentResolver().registerContentObserver(
+                    Settings.Global.getUriFor(Settings.Global.ZRAM_ENABLED),
+                    false /*notifyForDescendants*/,
+                    new ContentObserver(null /* current thread */) {
+                        @Override
+                        public void onChange(boolean selfChange) {
+                            refreshZramSettings();
+                        }
+                    });
+            refreshZramSettings();
+
             // Schedule zram writeback unless zram is disabled by persist.sys.zram_enabled
             String zramPropValue = SystemProperties.get(ZRAM_ENABLED_PROPERTY);
             if (!zramPropValue.equals("0")
@@ -981,7 +983,7 @@
             // sole writer.
             SystemProperties.set(ZRAM_ENABLED_PROPERTY, desiredPropertyValue);
             // Schedule writeback only if zram is being enabled.
-            if (!mmdEnabled() && desiredPropertyValue.equals("1")
+            if (desiredPropertyValue.equals("1")
                     && mContext.getResources().getBoolean(
                         com.android.internal.R.bool.config_zramWriteback)) {
                 ZramWriteback.scheduleZramWriteback(mContext);
diff --git a/services/core/java/com/android/server/am/AppBatteryTracker.java b/services/core/java/com/android/server/am/AppBatteryTracker.java
index 374abe0..0bc816e 100644
--- a/services/core/java/com/android/server/am/AppBatteryTracker.java
+++ b/services/core/java/com/android/server/am/AppBatteryTracker.java
@@ -818,8 +818,10 @@
     void dump(PrintWriter pw, String prefix) {
         pw.print(prefix);
         pw.println("APP BATTERY STATE TRACKER:");
-        // Force an update.
-        updateBatteryUsageStatsIfNecessary(mInjector.currentTimeMillis(), true);
+        if (mInjector.getActivityManagerInternal().isBooted()) {
+            // Force an update.
+            updateBatteryUsageStatsIfNecessary(mInjector.currentTimeMillis(), true);
+        }
         // Force a check.
         scheduleBgBatteryUsageStatsCheck();
         // Wait for its completion (as it runs in handler thread for the sake of thread safe)
@@ -878,8 +880,10 @@
 
     @Override
     void dumpAsProto(ProtoOutputStream proto, int uid) {
-        // Force an update.
-        updateBatteryUsageStatsIfNecessary(mInjector.currentTimeMillis(), true);
+        if (mInjector.getActivityManagerInternal().isBooted()) {
+            // Force an update.
+            updateBatteryUsageStatsIfNecessary(mInjector.currentTimeMillis(), true);
+        }
         synchronized (mLock) {
             final SparseArray<ImmutableBatteryUsage> uidConsumers = mUidBatteryUsageInWindow;
             if (uid != android.os.Process.INVALID_UID) {
diff --git a/services/core/java/com/android/server/audio/AudioService.java b/services/core/java/com/android/server/audio/AudioService.java
index ca8dadd..8d01181 100644
--- a/services/core/java/com/android/server/audio/AudioService.java
+++ b/services/core/java/com/android/server/audio/AudioService.java
@@ -14678,11 +14678,13 @@
         final String key = "additional_output_device_delay";
         final String reply = AudioSystem.getParameters(
                 key + "=" + device.getInternalType() + "," + device.getAddress());
-        long delayMillis;
-        try {
-            delayMillis = Long.parseLong(reply.substring(key.length() + 1));
-        } catch (NullPointerException e) {
-            delayMillis = 0;
+        long delayMillis = 0;
+        if (reply.contains(key)) {
+            try {
+                delayMillis = Long.parseLong(reply.substring(key.length() + 1));
+            } catch (NullPointerException e) {
+                delayMillis = 0;
+            }
         }
         return delayMillis;
     }
@@ -14708,11 +14710,13 @@
         final String key = "max_additional_output_device_delay";
         final String reply = AudioSystem.getParameters(
                 key + "=" + device.getInternalType() + "," + device.getAddress());
-        long delayMillis;
-        try {
-            delayMillis = Long.parseLong(reply.substring(key.length() + 1));
-        } catch (NullPointerException e) {
-            delayMillis = 0;
+        long delayMillis = 0;
+        if (reply.contains(key)) {
+            try {
+                delayMillis = Long.parseLong(reply.substring(key.length() + 1));
+            } catch (NullPointerException e) {
+                delayMillis = 0;
+            }
         }
         return delayMillis;
     }
diff --git a/services/core/java/com/android/server/display/LocalDisplayAdapter.java b/services/core/java/com/android/server/display/LocalDisplayAdapter.java
index 0570b2a..34d59d8 100644
--- a/services/core/java/com/android/server/display/LocalDisplayAdapter.java
+++ b/services/core/java/com/android/server/display/LocalDisplayAdapter.java
@@ -725,6 +725,11 @@
                     if (isDisplayPrivate(physicalAddress)) {
                         mInfo.flags |= DisplayDeviceInfo.FLAG_PRIVATE;
                     }
+
+                    if (isDisplayStealTopFocusDisabled(physicalAddress)) {
+                        mInfo.flags |= DisplayDeviceInfo.FLAG_OWN_FOCUS;
+                        mInfo.flags |= DisplayDeviceInfo.FLAG_STEAL_TOP_FOCUS_DISABLED;
+                    }
                 }
 
                 if (DisplayCutout.getMaskBuiltInDisplayCutout(res, mInfo.uniqueId)) {
@@ -1395,6 +1400,23 @@
             }
             return false;
         }
+
+        private boolean isDisplayStealTopFocusDisabled(DisplayAddress.Physical physicalAddress) {
+            if (physicalAddress == null) {
+                return false;
+            }
+            final Resources res = getOverlayContext().getResources();
+            int[] ports = res.getIntArray(R.array.config_localNotStealTopFocusDisplayPorts);
+            if (ports != null) {
+                int port = physicalAddress.getPort();
+                for (int p : ports) {
+                    if (p == port) {
+                        return true;
+                    }
+                }
+            }
+            return false;
+        }
     }
 
     private boolean hdrTypesEqual(int[] modeHdrTypes, int[] recordHdrTypes) {
diff --git a/services/core/java/com/android/server/logcat/OWNERS b/services/core/java/com/android/server/logcat/OWNERS
index 33e1873..2913cc9 100644
--- a/services/core/java/com/android/server/logcat/OWNERS
+++ b/services/core/java/com/android/server/logcat/OWNERS
@@ -3,6 +3,5 @@
 cbrubaker@google.com
 eunjeongshin@google.com
 georgechan@google.com
-jsharkey@google.com
 wenhaowang@google.com
 xiaozhenl@google.com
diff --git a/services/core/java/com/android/server/memory/OWNERS b/services/core/java/com/android/server/memory/OWNERS
new file mode 100644
index 0000000..dc0e898
--- /dev/null
+++ b/services/core/java/com/android/server/memory/OWNERS
@@ -0,0 +1,3 @@
+include /MEMORY_OWNERS
+
+per-file ZramMaintenance.java = kawasin@google.com
diff --git a/services/core/java/com/android/server/ZramMaintenance.java b/services/core/java/com/android/server/memory/ZramMaintenance.java
similarity index 98%
rename from services/core/java/com/android/server/ZramMaintenance.java
rename to services/core/java/com/android/server/memory/ZramMaintenance.java
index 099e5b3..560d2d7 100644
--- a/services/core/java/com/android/server/ZramMaintenance.java
+++ b/services/core/java/com/android/server/memory/ZramMaintenance.java
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package com.android.server;
+package com.android.server.memory;
 
 import android.app.job.JobInfo;
 import android.app.job.JobParameters;
@@ -71,7 +71,7 @@
     private static final boolean DEFAULT_REQUIRE_DEVICE_IDLE =
             true;
     private static final String REQUIRE_BATTERY_NOT_LOW_PROP =
-            "zram.maintenance.require_battry_not_low";
+            "zram.maintenance.require_battery_not_low";
     private static final boolean DEFAULT_REQUIRE_BATTERY_NOT_LOW =
             true;
 
diff --git a/services/core/java/com/android/server/notification/OWNERS b/services/core/java/com/android/server/notification/OWNERS
index 9f16662..43c68d1 100644
--- a/services/core/java/com/android/server/notification/OWNERS
+++ b/services/core/java/com/android/server/notification/OWNERS
@@ -2,8 +2,7 @@
 
 juliacr@google.com
 yurilin@google.com
-aroederer@google.com
 matiashe@google.com
 valiiftime@google.com
 jeffdq@google.com
-dsandler@android.com
\ No newline at end of file
+dsandler@android.com
diff --git a/services/core/java/com/android/server/pm/PackageManagerService.java b/services/core/java/com/android/server/pm/PackageManagerService.java
index 2a03dcb..6f9d53d 100644
--- a/services/core/java/com/android/server/pm/PackageManagerService.java
+++ b/services/core/java/com/android/server/pm/PackageManagerService.java
@@ -1476,7 +1476,7 @@
         ArchiveState archiveState;
         synchronized (mLock) {
             PackageSetting ps = mSettings.getPackageLPr(packageName);
-            if (ps == null) {
+            if (ps == null || snapshot.shouldFilterApplication(ps, binderUid, userId)) {
                 return null;
             }
             var psi = ps.getUserStateOrDefault(userId);
diff --git a/services/core/java/com/android/server/power/ShutdownCheckPoints.java b/services/core/java/com/android/server/power/ShutdownCheckPoints.java
index dafaa7d..399e214 100644
--- a/services/core/java/com/android/server/power/ShutdownCheckPoints.java
+++ b/services/core/java/com/android/server/power/ShutdownCheckPoints.java
@@ -350,17 +350,23 @@
 
         private final ShutdownCheckPoints mInstance;
         private final File mBaseFile;
+        private final File mBaseDir;
         private final int mFileCountLimit;
 
         FileDumperThread(ShutdownCheckPoints instance, File baseFile, int fileCountLimit) {
             mInstance = instance;
             mBaseFile = baseFile;
+            mBaseDir = baseFile.getParentFile();
             mFileCountLimit = fileCountLimit;
         }
 
         @Override
         public void run() {
-            mBaseFile.getParentFile().mkdirs();
+            if (!mBaseDir.exists()) {
+                mBaseDir.mkdirs();
+                mBaseDir.setExecutable(true, false);
+                mBaseDir.setReadable(true, false);
+            }
             File[] checkPointFiles = listCheckPointsFiles();
 
             int filesToDelete = checkPointFiles.length - mFileCountLimit + 1;
@@ -375,7 +381,7 @@
 
         private File[] listCheckPointsFiles() {
             String filePrefix = mBaseFile.getName() + "-";
-            File[] files = mBaseFile.getParentFile().listFiles(new FilenameFilter() {
+            File[] files = mBaseDir.listFiles(new FilenameFilter() {
                 @Override
                 public boolean accept(File dir, String name) {
                     if (!name.startsWith(filePrefix)) {
@@ -412,6 +418,7 @@
                 }
             }
             mBaseFile.renameTo(file);
+            file.setReadable(true, false);
         }
     }
 }
diff --git a/services/core/java/com/android/server/power/stats/OWNERS b/services/core/java/com/android/server/power/stats/OWNERS
index 4068e2b..208b2dd 100644
--- a/services/core/java/com/android/server/power/stats/OWNERS
+++ b/services/core/java/com/android/server/power/stats/OWNERS
@@ -1 +1,4 @@
+# Bug component: 987260
+set noparent
+
 include /BATTERY_STATS_OWNERS
diff --git a/services/core/java/com/android/server/security/OWNERS b/services/core/java/com/android/server/security/OWNERS
index fa4bf22..7a31a00 100644
--- a/services/core/java/com/android/server/security/OWNERS
+++ b/services/core/java/com/android/server/security/OWNERS
@@ -3,5 +3,6 @@
 include /core/java/android/security/OWNERS
 
 per-file *AttestationVerification* = file:/core/java/android/security/attestationverification/OWNERS
+per-file *CertificateRevocationStatus* = file:/core/java/android/security/attestationverification/OWNERS
 per-file FileIntegrity*.java = victorhsieh@google.com
 per-file KeyChainSystemService.java = file:platform/packages/apps/KeyChain:/OWNERS
diff --git a/services/core/java/com/android/server/wm/WindowManagerService.java b/services/core/java/com/android/server/wm/WindowManagerService.java
index 4f9b1cc..1a3f54a 100644
--- a/services/core/java/com/android/server/wm/WindowManagerService.java
+++ b/services/core/java/com/android/server/wm/WindowManagerService.java
@@ -723,8 +723,14 @@
             new WallpaperVisibilityListeners();
 
     IDisplayChangeWindowController mDisplayChangeController = null;
-    private final DeathRecipient mDisplayChangeControllerDeath =
-            () -> mDisplayChangeController = null;
+    private final DeathRecipient mDisplayChangeControllerDeath = new DeathRecipient() {
+        @Override
+        public void binderDied() {
+            synchronized (mGlobalLock) {
+                mDisplayChangeController = null;
+            }
+        }
+    };
 
     final DisplayWindowListenerController mDisplayNotificationController;
     final TaskSystemBarsListenerController mTaskSystemBarsListenerController;
diff --git a/services/java/com/android/server/SystemServer.java b/services/java/com/android/server/SystemServer.java
index 7972d9c..e4ab768 100644
--- a/services/java/com/android/server/SystemServer.java
+++ b/services/java/com/android/server/SystemServer.java
@@ -875,6 +875,17 @@
 
             SystemServiceRegistry.sEnableServiceNotFoundWtf = true;
 
+            // Prepare the thread pool for init tasks that can be parallelized
+            SystemServerInitThreadPool tp = SystemServerInitThreadPool.start();
+            mDumper.addDumpable(tp);
+
+            if (android.server.Flags.earlySystemConfigInit()) {
+                // SystemConfig init is expensive, so enqueue the work as early as possible to allow
+                // concurrent execution before it's needed (typically by ActivityManagerService).
+                // As native library loading is also expensive, this is a good place to start.
+                startSystemConfigInit(t);
+            }
+
             // Initialize native services.
             System.loadLibrary("android_servers");
 
@@ -907,9 +918,6 @@
             mDumper.addDumpable(mSystemServiceManager);
 
             LocalServices.addService(SystemServiceManager.class, mSystemServiceManager);
-            // Prepare the thread pool for init tasks that can be parallelized
-            SystemServerInitThreadPool tp = SystemServerInitThreadPool.start();
-            mDumper.addDumpable(tp);
 
             // Lazily load the pre-installed system font map in SystemServer only if we're not doing
             // the optimized font loading in the FontManagerService.
@@ -1057,6 +1065,14 @@
         }
     }
 
+    private void startSystemConfigInit(TimingsTraceAndSlog t) {
+        Slog.i(TAG, "Reading configuration...");
+        final String tagSystemConfig = "ReadingSystemConfig";
+        t.traceBegin(tagSystemConfig);
+        SystemServerInitThreadPool.submit(SystemConfig::getInstance, tagSystemConfig);
+        t.traceEnd();
+    }
+
     private void createSystemContext() {
         ActivityThread activityThread = ActivityThread.systemMain();
         mSystemContext = activityThread.getSystemContext();
@@ -1095,11 +1111,11 @@
         mDumper.addDumpable(watchdog);
         t.traceEnd();
 
-        Slog.i(TAG, "Reading configuration...");
-        final String TAG_SYSTEM_CONFIG = "ReadingSystemConfig";
-        t.traceBegin(TAG_SYSTEM_CONFIG);
-        SystemServerInitThreadPool.submit(SystemConfig::getInstance, TAG_SYSTEM_CONFIG);
-        t.traceEnd();
+        // Legacy entry point for starting SystemConfig init, only needed if the early init flag is
+        // disabled and we haven't already triggered init before bootstrap services.
+        if (!android.server.Flags.earlySystemConfigInit()) {
+            startSystemConfigInit(t);
+        }
 
         // Orchestrates some ProtoLogging functionality.
         if (android.tracing.Flags.clientSideProtoLogging()) {
diff --git a/services/java/com/android/server/flags.aconfig b/services/java/com/android/server/flags.aconfig
index ec74ef19..7ab209aa 100644
--- a/services/java/com/android/server/flags.aconfig
+++ b/services/java/com/android/server/flags.aconfig
@@ -10,6 +10,13 @@
 }
 
 flag {
+     namespace: "system_performance"
+     name: "early_system_config_init"
+     description: "Perform earlier initialization of SystemConfig in system server startup."
+     bug: "383869534"
+}
+
+flag {
      name: "remove_text_service"
      namespace: "wear_frameworks"
      description: "Remove TextServiceManagerService on Wear"
diff --git a/services/proguard.flags b/services/proguard.flags
index cdd41ab..1ab10dc 100644
--- a/services/proguard.flags
+++ b/services/proguard.flags
@@ -15,7 +15,10 @@
 
 # APIs referenced by dependent JAR files and modules
 # TODO(b/300514883): Pull @SystemApi keep rules from system-api.pro.
--keep interface android.annotation.SystemApi
+# TODO(b/373579455): Evaluate if <init> needs to be kept.
+-keep interface android.annotation.SystemApi {
+  void <init>();
+}
 -keep @android.annotation.SystemApi class * {
   public protected *;
 }
diff --git a/services/tests/displayservicetests/src/com/android/server/display/LocalDisplayAdapterTest.java b/services/tests/displayservicetests/src/com/android/server/display/LocalDisplayAdapterTest.java
index 120cc84..0dd6455 100644
--- a/services/tests/displayservicetests/src/com/android/server/display/LocalDisplayAdapterTest.java
+++ b/services/tests/displayservicetests/src/com/android/server/display/LocalDisplayAdapterTest.java
@@ -250,6 +250,34 @@
                 PORT_C, false);
     }
 
+    /**
+     * Confirm that display is marked as trusted, has own focus, disables steal top focus when it
+     * is listed in com.android.internal.R.array.config_localNotStealTopFocusDisplayPorts.
+     */
+    @Test
+    public void testStealTopFocusDisabledDisplay() throws Exception {
+        setUpDisplay(new FakeDisplay(PORT_A));
+        setUpDisplay(new FakeDisplay(PORT_B));
+        setUpDisplay(new FakeDisplay(PORT_C));
+        updateAvailableDisplays();
+
+        doReturn(new int[]{ PORT_B }).when(mMockedResources).getIntArray(
+                com.android.internal.R.array.config_localNotStealTopFocusDisplayPorts);
+        mAdapter.registerLocked();
+
+        waitForHandlerToComplete(mHandler, HANDLER_WAIT_MS);
+
+        // This should not have the flags
+        assertNotStealTopFocusFlag(mListener.addedDisplays.get(0).getDisplayDeviceInfoLocked(),
+                PORT_A, false);
+        // This should have the flags
+        assertNotStealTopFocusFlag(mListener.addedDisplays.get(1).getDisplayDeviceInfoLocked(),
+                PORT_B, true);
+        // This should not have the flags
+        assertNotStealTopFocusFlag(mListener.addedDisplays.get(2).getDisplayDeviceInfoLocked(),
+                PORT_C, false);
+    }
+
     @Test
     public void testSupportedDisplayModesGetOverriddenWhenDisplayIsUpdated()
             throws InterruptedException {
@@ -314,6 +342,42 @@
     }
 
     /**
+     * Confirm that all local displays are not trusted, do not have their own focus, and do not
+     * steal top focus when config_localNotStealTopFocusDisplayPorts is empty:
+     */
+    @Test
+    public void testDisplayFlagsForNoConfigLocalNotStealTopFocusDisplayPorts() throws Exception {
+        setUpDisplay(new FakeDisplay(PORT_A));
+        setUpDisplay(new FakeDisplay(PORT_C));
+        updateAvailableDisplays();
+
+        // config_localNotStealTopFocusDisplayPorts is null
+        mAdapter.registerLocked();
+
+        waitForHandlerToComplete(mHandler, HANDLER_WAIT_MS);
+
+        // This should not have the flags
+        assertNotStealTopFocusFlag(mListener.addedDisplays.get(0).getDisplayDeviceInfoLocked(),
+                PORT_A, false);
+        // This should not have the flags
+        assertNotStealTopFocusFlag(mListener.addedDisplays.get(1).getDisplayDeviceInfoLocked(),
+                PORT_C, false);
+    }
+
+    private static void assertNotStealTopFocusFlag(
+            DisplayDeviceInfo info, int expectedPort, boolean shouldHaveFlags) {
+        final DisplayAddress.Physical address = (DisplayAddress.Physical) info.address;
+        assertNotNull(address);
+        assertEquals(expectedPort, address.getPort());
+        assertEquals(DISPLAY_MODEL, address.getModel());
+        assertEquals(shouldHaveFlags,
+                (info.flags & DisplayDeviceInfo.FLAG_STEAL_TOP_FOCUS_DISABLED) != 0);
+        assertEquals(shouldHaveFlags, (info.flags & DisplayDeviceInfo.FLAG_OWN_FOCUS) != 0);
+        // display is always trusted since it is created by the system
+        assertEquals(true, (info.flags & DisplayDeviceInfo.FLAG_TRUSTED) != 0);
+    }
+
+    /**
      * Confirm that external display uses physical density.
      */
     @Test
diff --git a/services/tests/ondeviceintelligencetests/OWNERS b/services/tests/ondeviceintelligencetests/OWNERS
index a4fc758..d08d34a 100644
--- a/services/tests/ondeviceintelligencetests/OWNERS
+++ b/services/tests/ondeviceintelligencetests/OWNERS
@@ -1,3 +1,2 @@
 shiqing@google.com
 sandeepbandaru@google.com
-shivanker@google.com
diff --git a/services/tests/servicestests/src/com/android/server/accessibility/OWNERS b/services/tests/servicestests/src/com/android/server/accessibility/OWNERS
index c824c39..c7c23f0 100644
--- a/services/tests/servicestests/src/com/android/server/accessibility/OWNERS
+++ b/services/tests/servicestests/src/com/android/server/accessibility/OWNERS
@@ -1,3 +1,6 @@
-# Bug component: 44215
+# Bug component: 1530954
+#
+# The above component is for automated test bugs. If you are a human looking to report
+# a bug in this codebase then please use component 44215.
 
 include /core/java/android/view/accessibility/OWNERS
diff --git a/services/tests/servicestests/src/com/android/server/accessibility/magnification/OWNERS b/services/tests/servicestests/src/com/android/server/accessibility/magnification/OWNERS
new file mode 100644
index 0000000..9592bfd
--- /dev/null
+++ b/services/tests/servicestests/src/com/android/server/accessibility/magnification/OWNERS
@@ -0,0 +1,6 @@
+# Bug component: 1530954
+#
+# The above component is for automated test bugs. If you are a human looking to report
+# a bug in this codebase then please use component 770744.
+
+include /services/accessibility/java/com/android/server/accessibility/magnification/OWNERS
diff --git a/services/tests/servicestests/src/com/android/server/memory/OWNERS b/services/tests/servicestests/src/com/android/server/memory/OWNERS
new file mode 100644
index 0000000..4df08c1
--- /dev/null
+++ b/services/tests/servicestests/src/com/android/server/memory/OWNERS
@@ -0,0 +1,3 @@
+include /MEMORY_OWNERS
+
+per-file ZramMaintenanceTest.kt = kawasin@google.com
diff --git a/services/tests/servicestests/src/com/android/server/zram/ZramMaintenanceTest.kt b/services/tests/servicestests/src/com/android/server/memory/ZramMaintenanceTest.kt
similarity index 98%
rename from services/tests/servicestests/src/com/android/server/zram/ZramMaintenanceTest.kt
rename to services/tests/servicestests/src/com/android/server/memory/ZramMaintenanceTest.kt
index 5448a05..1f59f45 100644
--- a/services/tests/servicestests/src/com/android/server/zram/ZramMaintenanceTest.kt
+++ b/services/tests/servicestests/src/com/android/server/memory/ZramMaintenanceTest.kt
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package com.android.server.zram
+package com.android.server.memory
 
 import android.app.job.JobInfo
 import android.app.job.JobParameters
@@ -26,7 +26,6 @@
 import androidx.test.filters.SmallTest
 import androidx.test.platform.app.InstrumentationRegistry
 
-import com.android.server.ZramMaintenance
 import com.google.common.truth.Truth.assertThat
 
 import org.junit.Before
diff --git a/services/usb/java/com/android/server/usb/UsbPortManager.java b/services/usb/java/com/android/server/usb/UsbPortManager.java
index 55a8923..86468b0 100644
--- a/services/usb/java/com/android/server/usb/UsbPortManager.java
+++ b/services/usb/java/com/android/server/usb/UsbPortManager.java
@@ -200,7 +200,11 @@
         mHandler.sendEmptyMessage(MSG_SYSTEM_READY);
     }
 
-    private void updateContaminantNotification() {
+    private void updateContaminantNotificationLocked() {
+        if (mNotificationManager == null) {
+            return;
+        }
+
         PortInfo currentPortInfo = null;
         Resources r = mContext.getResources();
         int contaminantStatus = UsbPortStatus.CONTAMINANT_DETECTION_NOT_DETECTED;
@@ -1171,7 +1175,7 @@
     private void handlePortLocked(PortInfo portInfo, IndentingPrintWriter pw) {
         sendPortChangedBroadcastLocked(portInfo);
         logToStatsd(portInfo, pw);
-        updateContaminantNotification();
+        updateContaminantNotificationLocked();
     }
 
     private void handlePortAddedLocked(PortInfo portInfo, IndentingPrintWriter pw) {
@@ -1433,6 +1437,9 @@
                 case MSG_SYSTEM_READY: {
                     mNotificationManager = (NotificationManager)
                             mContext.getSystemService(Context.NOTIFICATION_SERVICE);
+                    synchronized (mLock) {
+                        updateContaminantNotificationLocked();
+                    }
                     break;
                 }
             }
diff --git a/tests/SharedLibrary/lib/Android.bp b/tests/SharedLibrary/lib/Android.bp
index 0595cb1..abfd0e8 100644
--- a/tests/SharedLibrary/lib/Android.bp
+++ b/tests/SharedLibrary/lib/Android.bp
@@ -15,6 +15,7 @@
     export_package_resources: true,
     privileged: true,
     optimize: {
+        keep_runtime_invisible_annotations: true,
         proguard_flags_files: ["proguard.proguard"],
     },
 }
diff --git a/tests/SharedLibrary/lib/proguard.proguard b/tests/SharedLibrary/lib/proguard.proguard
index e5dfbe1..699fbda 100644
--- a/tests/SharedLibrary/lib/proguard.proguard
+++ b/tests/SharedLibrary/lib/proguard.proguard
@@ -1,6 +1,8 @@
 -keepparameternames
 -keepattributes Exceptions,InnerClasses,Signature,Deprecated,
-                SourceFile,LineNumberTable,*Annotation*,EnclosingMethod
+                SourceFile,LineNumberTable,EnclosingMethod,
+                RuntimeVisibleAnnotations,RuntimeVisibleParameterAnnotations,
+                RuntimeVisibleTypeAnnotations,AnnotationDefault
 
 -keep public class * {
     public protected *;
diff --git a/tools/aosp/upload_aosp.sh b/tools/aosp/upload_aosp.sh
new file mode 100755
index 0000000..c36057b
--- /dev/null
+++ b/tools/aosp/upload_aosp.sh
@@ -0,0 +1,116 @@
+#!/bin/bash
+
+set -eu
+
+DRYRUN=false
+VERBOSE=false
+DEST_BRANCH_NAME="main"
+AOSP_URL=""
+
+function log_info() {
+  echo -e "\033[32m$1\033[m"
+}
+
+function log_warn() {
+  echo -e "\033[33m$1\033[m"
+}
+
+function log_fatal() {
+  echo -e "\033[31mERROR: $1\033[m" > /dev/stderr
+  exit 1
+}
+
+while [[ $# -gt 0 ]]; do
+  case $1 in
+    -b|--branch)
+      DEST_BRANCH_NAME=$2
+      shift
+      shift
+      ;;
+    -v|--verbose)
+      set -x
+      VERBOSE=true
+      shift
+      ;;
+    -n|--dryrun)
+      DRYRUN=true
+      shift
+      ;;
+    -u|--url)
+      AOSP_URL=$2
+      shift
+      shift
+      ;;
+    --help)
+      echo "$0 <options>"
+      echo
+      echo "Options:"
+      echo "    -b, --branch <branch> : destination AOSP branch, default is $DEST_BRANCH_NAME"
+      echo "    -n, --dryrun          : do not upload CL"
+      echo "    -u, --url             : AOSP repo URL. Default is to use existing 'aosp' remote or guess the URL."
+      echo "    -v, --verbose         : show verbose output"
+      echo
+      exit 0
+      ;;
+    -*|--*)
+      echo "Unknown option $i"
+      exit 1
+      ;;
+    *)
+      ;;
+  esac
+done
+
+if $VERBOSE; then
+  log_info "DRYRUN=$DRYRUN"
+  log_info "DEST_BRANCH_NAME=$DEST_BRANCH_NAME"
+fi
+
+current_branch=$(git branch --no-color --show-current)
+if [ -z "$current_branch" ]; then
+  log_fatal "use 'repo start' first"
+fi
+
+tmp_branch="aosp_$current_branch"
+
+if [ -z "$AOSP_URL" ]; then
+  AOSP_URL=$(git config --get remote.goog.url | sed 's/googleplex-//')
+fi
+
+if $VERBOSE; then
+  log_info "AOSP_URL=$AOSP_URL"
+  log_info "current_branch=$current_branch"
+  log_info "tmp_branch=$tmp_branch"
+fi
+
+log_info "Running repo hooks..."
+repo upload -c . -n -y
+
+log_info "Setting up AOSP repo..."
+existing_aosp_url=$(git config --get remote.aosp.url 2>/dev/null || true)
+if [ -z "$existing_aosp_url" ]; then
+  git remote add aosp $AOSP_URL
+elif [ "$existing_aosp_url" != "$AOSP_URL"]; then
+  log_warn "Remote 'aosp' uses $existing_aosp_url. Expected $AOSP_URL"
+fi
+
+log_info "Fetching '$DEST_BRANCH_NAME'"
+git fetch aosp $DEST_BRANCH_NAME
+
+log_info "Creating $tmp_branch and cherry-picking..."
+git branch -D $tmp_branch 2>/dev/null || true
+git checkout -b $tmp_branch
+git branch --set-upstream-to aosp/$DEST_BRANCH_NAME
+git reset --hard aosp/$DEST_BRANCH_NAME
+git cherry-pick goog/$DEST_BRANCH_NAME..$current_branch
+
+if $DRYRUN; then
+  log_info "Dryrun specified, skipping CL upload"
+else
+  log_info "Pushing to AOSP..."
+  git push aosp HEAD:refs/for/$DEST_BRANCH_NAME
+fi
+
+log_info "Cleaning up..."
+git checkout $current_branch
+git branch -D $tmp_branch
\ No newline at end of file