Merge "Adding atrace marker to MediaCodec::queueRequest" 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/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/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/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/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/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/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/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/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 47c600e..1f22f08 100644
--- a/services/core/Android.bp
+++ b/services/core/Android.bp
@@ -275,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/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/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/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/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/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;
                 }
             }