Merge "Move ZramMaintenance to com.android.server.memory package" into main
diff --git a/api/StubLibraries.bp b/api/StubLibraries.bp
index 787fdee..3314b4a 100644
--- a/api/StubLibraries.bp
+++ b/api/StubLibraries.bp
@@ -648,7 +648,7 @@
 
 java_api_library {
     name: "android-non-updatable.stubs.module_lib.from-text",
-    api_surface: "module_lib",
+    api_surface: "module-lib",
     api_contributions: [
         "api-stubs-docs-non-updatable.api.contribution",
         "system-api-stubs-docs-non-updatable.api.contribution",
@@ -668,7 +668,7 @@
 // generated from this module, as this module is strictly used for hiddenapi only.
 java_api_library {
     name: "android-non-updatable.stubs.test_module_lib",
-    api_surface: "module_lib",
+    api_surface: "module-lib",
     api_contributions: [
         "api-stubs-docs-non-updatable.api.contribution",
         "system-api-stubs-docs-non-updatable.api.contribution",
@@ -689,7 +689,7 @@
 
 java_api_library {
     name: "android-non-updatable.stubs.system_server.from-text",
-    api_surface: "system_server",
+    api_surface: "system-server",
     api_contributions: [
         "api-stubs-docs-non-updatable.api.contribution",
         "system-api-stubs-docs-non-updatable.api.contribution",
diff --git a/core/api/current.txt b/core/api/current.txt
index ab2d8c3..d8e3a01 100644
--- a/core/api/current.txt
+++ b/core/api/current.txt
@@ -10853,6 +10853,7 @@
     field public static final String TELEPHONY_IMS_SERVICE = "telephony_ims";
     field public static final String TELEPHONY_SERVICE = "phone";
     field public static final String TELEPHONY_SUBSCRIPTION_SERVICE = "telephony_subscription_service";
+    field public static final String TETHERING_SERVICE = "tethering";
     field public static final String TEXT_CLASSIFICATION_SERVICE = "textclassification";
     field public static final String TEXT_SERVICES_MANAGER_SERVICE = "textservices";
     field @FlaggedApi("android.media.tv.flags.enable_ad_service_fw") public static final String TV_AD_SERVICE = "tv_ad";
@@ -18976,13 +18977,13 @@
   public class BiometricManager {
     method @Deprecated @RequiresPermission(android.Manifest.permission.USE_BIOMETRIC) public int canAuthenticate();
     method @RequiresPermission(android.Manifest.permission.USE_BIOMETRIC) public int canAuthenticate(int);
-    method @FlaggedApi("android.hardware.biometrics.last_authentication_time") @RequiresPermission(android.Manifest.permission.USE_BIOMETRIC) public long getLastAuthenticationTime(int);
+    method @RequiresPermission(android.Manifest.permission.USE_BIOMETRIC) public long getLastAuthenticationTime(int);
     method @NonNull @RequiresPermission(android.Manifest.permission.USE_BIOMETRIC) public android.hardware.biometrics.BiometricManager.Strings getStrings(int);
     field public static final int BIOMETRIC_ERROR_HW_UNAVAILABLE = 1; // 0x1
     field public static final int BIOMETRIC_ERROR_NONE_ENROLLED = 11; // 0xb
     field public static final int BIOMETRIC_ERROR_NO_HARDWARE = 12; // 0xc
     field public static final int BIOMETRIC_ERROR_SECURITY_UPDATE_REQUIRED = 15; // 0xf
-    field @FlaggedApi("android.hardware.biometrics.last_authentication_time") public static final long BIOMETRIC_NO_AUTHENTICATION = -1L; // 0xffffffffffffffffL
+    field public static final long BIOMETRIC_NO_AUTHENTICATION = -1L; // 0xffffffffffffffffL
     field public static final int BIOMETRIC_SUCCESS = 0; // 0x0
   }
 
@@ -19032,7 +19033,7 @@
     field public static final int BIOMETRIC_ERROR_UNABLE_TO_PROCESS = 2; // 0x2
     field public static final int BIOMETRIC_ERROR_USER_CANCELED = 10; // 0xa
     field public static final int BIOMETRIC_ERROR_VENDOR = 8; // 0x8
-    field @FlaggedApi("android.hardware.biometrics.last_authentication_time") public static final long BIOMETRIC_NO_AUTHENTICATION = -1L; // 0xffffffffffffffffL
+    field public static final long BIOMETRIC_NO_AUTHENTICATION = -1L; // 0xffffffffffffffffL
   }
 
   public abstract static class BiometricPrompt.AuthenticationCallback {
diff --git a/core/api/system-current.txt b/core/api/system-current.txt
index a1c18eb..34d9000 100644
--- a/core/api/system-current.txt
+++ b/core/api/system-current.txt
@@ -3851,7 +3851,6 @@
     field public static final String STATS_MANAGER = "stats";
     field public static final String SYSTEM_CONFIG_SERVICE = "system_config";
     field public static final String SYSTEM_UPDATE_SERVICE = "system_update";
-    field public static final String TETHERING_SERVICE = "tethering";
     field @FlaggedApi("com.android.net.thread.platform.flags.thread_enabled_platform") public static final String THREAD_NETWORK_SERVICE = "thread_network";
     field public static final String TIME_MANAGER_SERVICE = "time_manager";
     field public static final String TRANSLATION_MANAGER_SERVICE = "translation";
diff --git a/core/java/android/content/Context.java b/core/java/android/content/Context.java
index 7e65439..7786937 100644
--- a/core/java/android/content/Context.java
+++ b/core/java/android/content/Context.java
@@ -4210,6 +4210,7 @@
             //@hide: STATUS_BAR_SERVICE,
             THREAD_NETWORK_SERVICE,
             CONNECTIVITY_SERVICE,
+            TETHERING_SERVICE,
             PAC_PROXY_SERVICE,
             VCN_MANAGEMENT_SERVICE,
             //@hide: IP_MEMORY_STORE_SERVICE,
@@ -4894,10 +4895,10 @@
     /**
      * Use with {@link #getSystemService(String)} to retrieve a {@link android.net.TetheringManager}
      * for managing tethering functions.
-     * @hide
+     *
      * @see android.net.TetheringManager
      */
-    @SystemApi
+    @SuppressLint("UnflaggedApi")
     public static final String TETHERING_SERVICE = "tethering";
 
     /**
diff --git a/core/java/android/hardware/biometrics/BiometricConstants.java b/core/java/android/hardware/biometrics/BiometricConstants.java
index 9355937..caf80d3 100644
--- a/core/java/android/hardware/biometrics/BiometricConstants.java
+++ b/core/java/android/hardware/biometrics/BiometricConstants.java
@@ -319,6 +319,5 @@
      * Returned from {@link BiometricManager#getLastAuthenticationTime(int)} when there has
      * been no successful authentication for the given authenticator since boot.
      */
-    @FlaggedApi(Flags.FLAG_LAST_AUTHENTICATION_TIME)
     long BIOMETRIC_NO_AUTHENTICATION = -1;
 }
diff --git a/core/java/android/hardware/biometrics/BiometricManager.java b/core/java/android/hardware/biometrics/BiometricManager.java
index a4f7485f..078787a 100644
--- a/core/java/android/hardware/biometrics/BiometricManager.java
+++ b/core/java/android/hardware/biometrics/BiometricManager.java
@@ -113,7 +113,6 @@
      * Returned from {@link BiometricManager#getLastAuthenticationTime(int)} when no matching
      * successful authentication has been performed since boot.
      */
-    @FlaggedApi(Flags.FLAG_LAST_AUTHENTICATION_TIME)
     public static final long BIOMETRIC_NO_AUTHENTICATION =
             BiometricConstants.BIOMETRIC_NO_AUTHENTICATION;
 
@@ -770,7 +769,6 @@
      */
     @RequiresPermission(USE_BIOMETRIC)
     @ElapsedRealtimeLong
-    @FlaggedApi(Flags.FLAG_LAST_AUTHENTICATION_TIME)
     public long getLastAuthenticationTime(
             @BiometricManager.Authenticators.Types int authenticators) {
         if (authenticators == 0
diff --git a/core/java/android/hardware/biometrics/flags.aconfig b/core/java/android/hardware/biometrics/flags.aconfig
index 047d1fa..b4c9f4b 100644
--- a/core/java/android/hardware/biometrics/flags.aconfig
+++ b/core/java/android/hardware/biometrics/flags.aconfig
@@ -2,14 +2,6 @@
 container: "system"
 
 flag {
-    name: "last_authentication_time"
-    is_exported: true
-    namespace: "wallet_integration"
-    description: "Feature flag for adding getLastAuthenticationTime API to BiometricManager"
-    bug: "301979982"
-}
-
-flag {
   name: "add_key_agreement_crypto_object"
   is_exported: true
   namespace: "biometrics"
diff --git a/core/java/android/hardware/usb/OWNERS b/core/java/android/hardware/usb/OWNERS
index 37604bc..1de8a24 100644
--- a/core/java/android/hardware/usb/OWNERS
+++ b/core/java/android/hardware/usb/OWNERS
@@ -1,7 +1,7 @@
 # Bug component: 175220
 
-anothermark@google.com
+vmartensson@google.com
+nkapron@google.com
 febinthattil@google.com
-aprasath@google.com
+shubhankarm@google.com
 badhri@google.com
-kumarashishg@google.com
\ No newline at end of file
diff --git a/core/java/android/os/SharedMemory.java b/core/java/android/os/SharedMemory.java
index 46ae9d8..320641d 100644
--- a/core/java/android/os/SharedMemory.java
+++ b/core/java/android/os/SharedMemory.java
@@ -25,8 +25,6 @@
 
 import dalvik.system.VMRuntime;
 
-import libcore.io.IoUtils;
-
 import java.io.Closeable;
 import java.io.FileDescriptor;
 import java.io.IOException;
@@ -65,7 +63,7 @@
 
         mMemoryRegistration = new MemoryRegistration(mSize);
         mCleaner = Cleaner.create(mFileDescriptor,
-                new Closer(mFileDescriptor, mMemoryRegistration));
+                new Closer(mFileDescriptor.getInt$(), mMemoryRegistration));
     }
 
     /**
@@ -278,6 +276,7 @@
      */
     @Override
     public void close() {
+        mFileDescriptor.setInt$(-1);
         if (mCleaner != null) {
             mCleaner.clean();
             mCleaner = null;
@@ -327,20 +326,21 @@
      * Cleaner that closes the FD
      */
     private static final class Closer implements Runnable {
-        private FileDescriptor mFd;
+        private int mFd;
         private MemoryRegistration mMemoryReference;
 
-        private Closer(FileDescriptor fd, MemoryRegistration memoryReference) {
+        private Closer(int fd, MemoryRegistration memoryReference) {
             mFd = fd;
-            IoUtils.setFdOwner(mFd, this);
             mMemoryReference = memoryReference;
         }
 
         @Override
         public void run() {
-            IoUtils.closeQuietly(mFd);
-            mFd = null;
-
+            try {
+                FileDescriptor fd = new FileDescriptor();
+                fd.setInt$(mFd);
+                Os.close(fd);
+            } catch (ErrnoException e) { /* swallow error */ }
             mMemoryReference.release();
             mMemoryReference = null;
         }
diff --git a/core/java/android/os/flags.aconfig b/core/java/android/os/flags.aconfig
index e2f8f99..a1a1e31 100644
--- a/core/java/android/os/flags.aconfig
+++ b/core/java/android/os/flags.aconfig
@@ -19,6 +19,13 @@
 }
 
 flag {
+     name: "disable_madvise_artfile_default"
+     namespace: "system_performance"
+     description: "Disables madvise of .art files by default during app start."
+     bug: "382110550"
+}
+
+flag {
     name: "disallow_cellular_null_ciphers_restriction"
     namespace: "cellular_security"
     description: "Guards a new UserManager user restriction that admins can use to require cellular encryption on their managed devices."
diff --git a/core/java/android/view/InsetsSourceControl.java b/core/java/android/view/InsetsSourceControl.java
index 7877352..c91a330 100644
--- a/core/java/android/view/InsetsSourceControl.java
+++ b/core/java/android/view/InsetsSourceControl.java
@@ -190,7 +190,7 @@
     }
 
     public void release(Consumer<SurfaceControl> surfaceReleaseConsumer) {
-        if (mLeash != null) {
+        if (mLeash != null && mLeash.isValid()) {
             surfaceReleaseConsumer.accept(mLeash);
         }
     }
diff --git a/core/java/android/window/OWNERS b/core/java/android/window/OWNERS
index 77c99b9..82d3724 100644
--- a/core/java/android/window/OWNERS
+++ b/core/java/android/window/OWNERS
@@ -3,3 +3,4 @@
 include /services/core/java/com/android/server/wm/OWNERS
 
 per-file DesktopModeFlags.java = file:/libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/OWNERS
+per-file DesktopExperienceFlags.java = file:/libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/OWNERS
diff --git a/core/java/com/android/internal/os/BaseCommand.java b/core/java/com/android/internal/os/BaseCommand.java
index c85b5d7..af763e4 100644
--- a/core/java/com/android/internal/os/BaseCommand.java
+++ b/core/java/com/android/internal/os/BaseCommand.java
@@ -58,15 +58,23 @@
         mRawArgs = args;
         mArgs.init(null, null, null, null, args, 0);
 
+        int status = 1;
         try {
             onRun();
+            status = 0;
         } catch (IllegalArgumentException e) {
             onShowUsage(System.err);
             System.err.println();
             System.err.println("Error: " + e.getMessage());
+            status = 0;
         } catch (Exception e) {
             e.printStackTrace(System.err);
-            System.exit(1);
+        } finally {
+            System.out.flush();
+            System.err.flush();
+        }
+        if (status != 0) {
+            System.exit(status);
         }
     }
 
diff --git a/core/java/com/android/internal/widget/LockPatternUtils.java b/core/java/com/android/internal/widget/LockPatternUtils.java
index d129762..83750ac 100644
--- a/core/java/com/android/internal/widget/LockPatternUtils.java
+++ b/core/java/com/android/internal/widget/LockPatternUtils.java
@@ -1051,7 +1051,7 @@
         }
         final int patternSize = pattern.size();
 
-        byte[] res = new byte[patternSize];
+        byte[] res = newNonMovableByteArray(patternSize);
         for (int i = 0; i < patternSize; i++) {
             LockPatternView.Cell cell = pattern.get(i);
             res[i] = (byte) (cell.getRow() * 3 + cell.getColumn() + '1');
diff --git a/core/java/com/android/internal/widget/LockscreenCredential.java b/core/java/com/android/internal/widget/LockscreenCredential.java
index 92ce990..2a12c98 100644
--- a/core/java/com/android/internal/widget/LockscreenCredential.java
+++ b/core/java/com/android/internal/widget/LockscreenCredential.java
@@ -81,9 +81,9 @@
     /**
      * Private constructor, use static builder methods instead.
      *
-     * <p> Builder methods should create a private copy of the credential bytes and pass in here.
-     * LockscreenCredential will only store the reference internally without copying. This is to
-     * minimize the number of extra copies introduced.
+     * <p> Builder methods should create a private copy of the credential bytes using a non-movable
+     * array and pass it in here.  LockscreenCredential will only store the reference internally
+     * without copying. This is to minimize the number of extra copies introduced.
      */
     private LockscreenCredential(int type, byte[] credential, boolean hasInvalidChars) {
         Objects.requireNonNull(credential);
@@ -141,7 +141,7 @@
      */
     public static LockscreenCredential createUnifiedProfilePassword(@NonNull byte[] password) {
         return new LockscreenCredential(CREDENTIAL_TYPE_PASSWORD,
-                Arrays.copyOf(password, password.length), /* hasInvalidChars= */ false);
+                copyOfArrayNonMovable(password), /* hasInvalidChars= */ false);
     }
 
     /**
@@ -237,7 +237,7 @@
     /** Create a copy of the credential */
     public LockscreenCredential duplicate() {
         return new LockscreenCredential(mType,
-                mCredential != null ? Arrays.copyOf(mCredential, mCredential.length) : null,
+                mCredential != null ? copyOfArrayNonMovable(mCredential) : null,
                 mHasInvalidChars);
     }
 
@@ -252,6 +252,15 @@
     }
 
     /**
+     * Copies the given array into a new non-movable array.
+     */
+    private static byte[] copyOfArrayNonMovable(byte[] array) {
+        byte[] copy = LockPatternUtils.newNonMovableByteArray(array.length);
+        System.arraycopy(array, 0, copy, 0, array.length);
+        return copy;
+    }
+
+    /**
      * Checks whether the credential meets basic requirements for setting it as a new credential.
      *
      * This is redundant if {@link android.app.admin.PasswordMetrics#validateCredential()}, which
@@ -440,7 +449,7 @@
      * @return A byte array representing the input
      */
     private static byte[] charsToBytesTruncating(CharSequence chars) {
-        byte[] bytes = new byte[chars.length()];
+        byte[] bytes = LockPatternUtils.newNonMovableByteArray(chars.length());
         for (int i = 0; i < chars.length(); i++) {
             bytes[i] = (byte) chars.charAt(i);
         }
diff --git a/core/jni/Android.bp b/core/jni/Android.bp
index 411315e..817284d 100644
--- a/core/jni/Android.bp
+++ b/core/jni/Android.bp
@@ -288,6 +288,7 @@
             ],
 
             static_libs: [
+                "android.os.flags-aconfig-cc",
                 "libasync_safe",
                 "libbinderthreadstateutils",
                 "libdmabufinfo",
diff --git a/core/jni/AndroidRuntime.cpp b/core/jni/AndroidRuntime.cpp
index 3bfc102..0e4da86 100644
--- a/core/jni/AndroidRuntime.cpp
+++ b/core/jni/AndroidRuntime.cpp
@@ -22,6 +22,7 @@
 #include <android-base/parsebool.h>
 #include <android-base/properties.h>
 #include <android/graphics/jni_runtime.h>
+#include <android_os.h>
 #include <android_runtime/AndroidRuntime.h>
 #include <assert.h>
 #include <binder/IBinder.h>
@@ -887,9 +888,13 @@
                        madviseWillNeedFileSizeOdex,
                        "-XMadviseWillNeedOdexFileSize:");
 
-    parseRuntimeOption("dalvik.vm.madvise.artfile.size",
-                       madviseWillNeedFileSizeArt,
-                       "-XMadviseWillNeedArtFileSize:");
+    // Historically, dalvik.vm.madvise.artfile.size was set to UINT_MAX by default. With the
+    // disable_madvise_art_default flag rollout, we use this default only when the flag is disabled.
+    // TODO(b/382110550): Remove this property/flag entirely after validating and ramping.
+    const char* madvise_artfile_size_default =
+            android::os::disable_madvise_artfile_default() ? "" : "4294967295";
+    parseRuntimeOption("dalvik.vm.madvise.artfile.size", madviseWillNeedFileSizeArt,
+                       "-XMadviseWillNeedArtFileSize:", madvise_artfile_size_default);
 
     /*
      * Profile related options.
diff --git a/libs/androidfw/Android.bp b/libs/androidfw/Android.bp
index a13dd78..104ba01 100644
--- a/libs/androidfw/Android.bp
+++ b/libs/androidfw/Android.bp
@@ -287,6 +287,7 @@
         "tests/AttributeResolution_bench.cpp",
         "tests/CursorWindow_bench.cpp",
         "tests/Generic_bench.cpp",
+        "tests/LocaleDataLookup_bench.cpp",
         "tests/SparseEntry_bench.cpp",
         "tests/Theme_bench.cpp",
     ],
diff --git a/libs/androidfw/LocaleDataLookup.cpp b/libs/androidfw/LocaleDataLookup.cpp
index 6e751a7..ea9e9a2 100644
--- a/libs/androidfw/LocaleDataLookup.cpp
+++ b/libs/androidfw/LocaleDataLookup.cpp
@@ -7518,6 +7518,13 @@
      }
 }
 
+/*
+ * TODO: Consider turning the below switch statement into binary search
+ *      to save the disk space when the table is larger in the future.
+ *      Disassembled code shows that the jump table emitted by clang can be
+ *      4x larger than the data in disk size, but it depends on the optimization option.
+ *      However, a switch statement will benefit from the future of compiler improvement.
+ */
 bool isLocaleRepresentative(uint32_t language_and_region, const char* script) {
     const uint64_t packed_locale =
             ((static_cast<uint64_t>(language_and_region)) << 32u) |
diff --git a/libs/androidfw/tests/LocaleDataLookup_bench.cpp b/libs/androidfw/tests/LocaleDataLookup_bench.cpp
new file mode 100644
index 0000000..60ce3b9
--- /dev/null
+++ b/libs/androidfw/tests/LocaleDataLookup_bench.cpp
@@ -0,0 +1,57 @@
+/*
+ * Copyright (C) 2025 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "benchmark/benchmark.h"
+
+#include "androidfw/LocaleDataLookup.h"
+
+namespace android {
+
+static void BM_LocaleDataLookupIsLocaleRepresentative(benchmark::State& state) {
+  for (auto&& _ : state) {
+    isLocaleRepresentative(packLocale("en", "US"), "Latn");
+    isLocaleRepresentative(packLocale("es", "ES"), "Latn");
+    isLocaleRepresentative(packLocale("zh", "CN"), "Hans");
+    isLocaleRepresentative(packLocale("pt", "BR"), "Latn");
+    isLocaleRepresentative(packLocale("ar", "EG"), "Arab");
+    isLocaleRepresentative(packLocale("hi", "IN"), "Deva");
+    isLocaleRepresentative(packLocale("jp", "JP"), "Jpan");
+  }
+}
+BENCHMARK(BM_LocaleDataLookupIsLocaleRepresentative);
+
+static void BM_LocaleDataLookupLikelyScript(benchmark::State& state) {
+  for (auto&& _ : state) {
+    lookupLikelyScript(packLocale("en", ""));
+    lookupLikelyScript(packLocale("es", ""));
+    lookupLikelyScript(packLocale("zh", ""));
+    lookupLikelyScript(packLocale("pt", ""));
+    lookupLikelyScript(packLocale("ar", ""));
+    lookupLikelyScript(packLocale("hi", ""));
+    lookupLikelyScript(packLocale("jp", ""));
+    lookupLikelyScript(packLocale("en", "US"));
+    lookupLikelyScript(packLocale("es", "ES"));
+    lookupLikelyScript(packLocale("zh", "CN"));
+    lookupLikelyScript(packLocale("pt", "BR"));
+    lookupLikelyScript(packLocale("ar", "EG"));
+    lookupLikelyScript(packLocale("hi", "IN"));
+    lookupLikelyScript(packLocale("jp", "JP"));
+  }
+}
+BENCHMARK(BM_LocaleDataLookupLikelyScript);
+
+
+}  // namespace android
diff --git a/media/java/android/media/MediaCodec.java b/media/java/android/media/MediaCodec.java
index c9625c4..871fadf 100644
--- a/media/java/android/media/MediaCodec.java
+++ b/media/java/android/media/MediaCodec.java
@@ -44,6 +44,7 @@
 import android.os.Looper;
 import android.os.Message;
 import android.os.PersistableBundle;
+import android.os.Trace;
 import android.view.Surface;
 
 import java.io.IOException;
@@ -3103,6 +3104,7 @@
             int index,
             int offset, int size, long presentationTimeUs, int flags)
         throws CryptoException {
+        Trace.traceBegin(Trace.TRACE_TAG_VIDEO, "MediaCodec::queueInputBuffer#java");
         if ((flags & BUFFER_FLAG_DECODE_ONLY) != 0
                 && (flags & BUFFER_FLAG_END_OF_STREAM) != 0) {
             throw new InvalidBufferFlagsException(EOS_AND_DECODE_ONLY_ERROR_MESSAGE);
@@ -3122,6 +3124,8 @@
         } catch (CryptoException | IllegalStateException e) {
             revalidateByteBuffer(mCachedInputBuffers, index, true /* input */);
             throw e;
+        } finally {
+            Trace.traceEnd(Trace.TRACE_TAG_VIDEO);
         }
     }
 
@@ -3163,6 +3167,7 @@
     public final void queueInputBuffers(
             int index,
             @NonNull ArrayDeque<BufferInfo> bufferInfos) {
+        Trace.traceBegin(Trace.TRACE_TAG_VIDEO, "MediaCodec::queueInputBuffers#java");
         synchronized(mBufferLock) {
             if (mBufferMode == BUFFER_MODE_BLOCK) {
                 throw new IncompatibleWithBlockModelException("queueInputBuffers() "
@@ -3178,6 +3183,8 @@
         } catch (CryptoException | IllegalStateException | IllegalArgumentException e) {
             revalidateByteBuffer(mCachedInputBuffers, index, true /* input */);
             throw e;
+        } finally {
+            Trace.traceEnd(Trace.TRACE_TAG_VIDEO);
         }
     }
 
@@ -3438,6 +3445,7 @@
             @NonNull CryptoInfo info,
             long presentationTimeUs,
             int flags) throws CryptoException {
+        Trace.traceBegin(Trace.TRACE_TAG_VIDEO, "MediaCodec::queueSecureInputBuffer#java");
         if ((flags & BUFFER_FLAG_DECODE_ONLY) != 0
                 && (flags & BUFFER_FLAG_END_OF_STREAM) != 0) {
             throw new InvalidBufferFlagsException(EOS_AND_DECODE_ONLY_ERROR_MESSAGE);
@@ -3457,6 +3465,8 @@
         } catch (CryptoException | IllegalStateException e) {
             revalidateByteBuffer(mCachedInputBuffers, index, true /* input */);
             throw e;
+        } finally {
+            Trace.traceEnd(Trace.TRACE_TAG_VIDEO);
         }
     }
 
@@ -3487,6 +3497,7 @@
             int index,
             @NonNull ArrayDeque<BufferInfo> bufferInfos,
             @NonNull ArrayDeque<CryptoInfo> cryptoInfos) {
+        Trace.traceBegin(Trace.TRACE_TAG_VIDEO, "MediaCodec::queueSecureInputBuffers#java");
         synchronized(mBufferLock) {
             if (mBufferMode == BUFFER_MODE_BLOCK) {
                 throw new IncompatibleWithBlockModelException("queueSecureInputBuffers() "
@@ -3502,6 +3513,8 @@
         } catch (CryptoException | IllegalStateException | IllegalArgumentException e) {
             revalidateByteBuffer(mCachedInputBuffers, index, true /* input */);
             throw e;
+        } finally {
+            Trace.traceEnd(Trace.TRACE_TAG_VIDEO);
         }
     }
 
@@ -3529,6 +3542,7 @@
      * @throws MediaCodec.CodecException upon codec error.
      */
     public final int dequeueInputBuffer(long timeoutUs) {
+        Trace.traceBegin(Trace.TRACE_TAG_VIDEO, "MediaCodec::dequeueInputBuffer#java");
         synchronized (mBufferLock) {
             if (mBufferMode == BUFFER_MODE_BLOCK) {
                 throw new IncompatibleWithBlockModelException("dequeueInputBuffer() "
@@ -3542,6 +3556,7 @@
                 validateInputByteBufferLocked(mCachedInputBuffers, res);
             }
         }
+        Trace.traceEnd(Trace.TRACE_TAG_VIDEO);
         return res;
     }
 
diff --git a/media/java/android/media/OWNERS b/media/java/android/media/OWNERS
index 8cc42e0..a600017 100644
--- a/media/java/android/media/OWNERS
+++ b/media/java/android/media/OWNERS
@@ -1,6 +1,7 @@
 # Bug component: 1344
-fgoldfain@google.com
+pshehane@google.com
 elaurent@google.com
+etalvala@google.com
 lajos@google.com
 jmtrivi@google.com
 
@@ -15,4 +16,5 @@
 # Haptics team also works on Ringtone
 per-file *Ringtone* = file:/services/core/java/com/android/server/vibrator/OWNERS
 
+per-file flags/media_better_together.aconfig = file:platform/frameworks/av:/media/janitors/better_together_OWNERS
 per-file flags/projection.aconfig = file:projection/OWNERS
diff --git a/media/java/android/mtp/OWNERS b/media/java/android/mtp/OWNERS
index 77ed08b..c57265a 100644
--- a/media/java/android/mtp/OWNERS
+++ b/media/java/android/mtp/OWNERS
@@ -1,9 +1,9 @@
 set noparent
 
-anothermark@google.com
+vmartensson@google.com
+nkapron@google.com
 febinthattil@google.com
-aprasath@google.com
+shubhankarm@google.com
 jsharkey@android.com
 jameswei@google.com
 rmojumder@google.com
-kumarashishg@google.com
diff --git a/media/jni/android_media_MediaCodec.cpp b/media/jni/android_media_MediaCodec.cpp
index 8419ce7..61c287b 100644
--- a/media/jni/android_media_MediaCodec.cpp
+++ b/media/jni/android_media_MediaCodec.cpp
@@ -16,7 +16,9 @@
 
 //#define LOG_NDEBUG 0
 #define LOG_TAG "MediaCodec-JNI"
+#define ATRACE_TAG  ATRACE_TAG_VIDEO
 #include <utils/Log.h>
+#include <utils/Trace.h>
 
 #include <type_traits>
 
@@ -1230,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,
@@ -2106,7 +2118,7 @@
         jlong timestampUs,
         jint flags) {
     ALOGV("android_media_MediaCodec_queueInputBuffer");
-
+    ScopedTrace trace(ATRACE_TAG, "MediaCodec::queueInputBuffer#jni");
     sp<JMediaCodec> codec = getMediaCodec(env, thiz);
 
     if (codec == NULL || codec->initCheck() != OK) {
@@ -2192,6 +2204,7 @@
         jint index,
         jobjectArray objArray) {
     ALOGV("android_media_MediaCodec_queueInputBuffers");
+    ScopedTrace trace(ATRACE_TAG, "MediaCodec::queueInputBuffers#jni");
     sp<JMediaCodec> codec = getMediaCodec(env, thiz);
     if (codec == NULL || codec->initCheck() != OK || objArray == NULL) {
         throwExceptionAsNecessary(env, INVALID_OPERATION, codec);
@@ -2431,6 +2444,7 @@
         jobject cryptoInfoObj,
         jlong timestampUs,
         jint flags) {
+    ScopedTrace trace(ATRACE_TAG, "MediaCodec::queueSecureInputBuffer#jni");
     ALOGV("android_media_MediaCodec_queueSecureInputBuffer");
 
     sp<JMediaCodec> codec = getMediaCodec(env, thiz);
@@ -2641,6 +2655,7 @@
         jint index,
         jobjectArray bufferInfosObjs,
         jobjectArray cryptoInfoObjs) {
+    ScopedTrace trace(ATRACE_TAG, "MediaCodec::queueSecureInputBuffers#jni");
     ALOGV("android_media_MediaCodec_queueSecureInputBuffers");
 
     sp<JMediaCodec> codec = getMediaCodec(env, thiz);
@@ -2685,6 +2700,7 @@
 }
 
 static jobject android_media_MediaCodec_mapHardwareBuffer(JNIEnv *env, jclass, jobject bufferObj) {
+    ScopedTrace trace(ATRACE_TAG, "MediaCodec::mapHardwareBuffer#jni");
     ALOGV("android_media_MediaCodec_mapHardwareBuffer");
     AHardwareBuffer *hardwareBuffer = android_hardware_HardwareBuffer_getNativeHardwareBuffer(
             env, bufferObj);
@@ -3028,6 +3044,7 @@
 static void android_media_MediaCodec_native_queueLinearBlock(
         JNIEnv *env, jobject thiz, jint index, jobject bufferObj,
         jobjectArray cryptoInfoArray, jobjectArray objArray, jobject keys, jobject values) {
+    ScopedTrace trace(ATRACE_TAG, "MediaCodec::queueLinearBlock#jni");
     ALOGV("android_media_MediaCodec_native_queueLinearBlock");
 
     sp<JMediaCodec> codec = getMediaCodec(env, thiz);
@@ -3145,6 +3162,7 @@
         JNIEnv *env, jobject thiz, jint index, jobject bufferObj,
         jlong presentationTimeUs, jint flags, jobject keys, jobject values) {
     ALOGV("android_media_MediaCodec_native_queueHardwareBuffer");
+    ScopedTrace trace(ATRACE_TAG, "MediaCodec::queueHardwareBuffer#jni");
 
     sp<JMediaCodec> codec = getMediaCodec(env, thiz);
 
diff --git a/media/jni/android_mtp_MtpDatabase.cpp b/media/jni/android_mtp_MtpDatabase.cpp
index a77bc9f..a1ce495 100644
--- a/media/jni/android_mtp_MtpDatabase.cpp
+++ b/media/jni/android_mtp_MtpDatabase.cpp
@@ -910,7 +910,7 @@
         case MTP_FORMAT_TIFF:
         case MTP_FORMAT_TIFF_EP:
         case MTP_FORMAT_DEFINED: {
-            String8 temp(path);
+            String8 temp {static_cast<std::string_view>(path)};
             std::unique_ptr<FileStream> stream(new FileStream(temp));
             piex::PreviewImageData image_data;
             if (!GetExifFromRawImage(stream.get(), temp, image_data)) {
@@ -967,7 +967,7 @@
             case MTP_FORMAT_TIFF:
             case MTP_FORMAT_TIFF_EP:
             case MTP_FORMAT_DEFINED: {
-                String8 temp(path);
+                String8 temp {static_cast<std::string_view>(path)};
                 std::unique_ptr<FileStream> stream(new FileStream(temp));
                 piex::PreviewImageData image_data;
                 if (!GetExifFromRawImage(stream.get(), temp, image_data)) {
diff --git a/media/tests/MtpTests/OWNERS b/media/tests/MtpTests/OWNERS
index bdb6cdb..c57265a 100644
--- a/media/tests/MtpTests/OWNERS
+++ b/media/tests/MtpTests/OWNERS
@@ -1,9 +1,9 @@
 set noparent
 
-anothermark@google.com
+vmartensson@google.com
+nkapron@google.com
 febinthattil@google.com
-aprasath@google.com
+shubhankarm@google.com
 jsharkey@android.com
 jameswei@google.com
 rmojumder@google.com
-kumarashishg@google.com
\ No newline at end of file
diff --git a/nfc-non-updatable/flags/flags.aconfig b/nfc-non-updatable/flags/flags.aconfig
index 54ded0c..eb30bbe 100644
--- a/nfc-non-updatable/flags/flags.aconfig
+++ b/nfc-non-updatable/flags/flags.aconfig
@@ -198,10 +198,6 @@
     bug: "380892385"
 }
 
-flag {
-    name: "nfc_hce_latency_events"
-    is_exported: true
-    namespace: "wallet_integration"
-    description: "Enables tracking latency for HCE"
-    bug: "379849603"
-}
+# Unless you are adding a flag for a file under nfc-non-updatable, you should
+# not add a flag here for Android 16+ targeting features. Use the flags
+# in com.android.nfc.module.flags (packages/modules/Nfc/flags) instead.
diff --git a/nfc-non-updatable/java/android/nfc/cardemulation/ApduServiceInfo.java b/nfc-non-updatable/java/android/nfc/cardemulation/ApduServiceInfo.java
index 93d6eb7..e83b9f1 100644
--- a/nfc-non-updatable/java/android/nfc/cardemulation/ApduServiceInfo.java
+++ b/nfc-non-updatable/java/android/nfc/cardemulation/ApduServiceInfo.java
@@ -572,8 +572,10 @@
         if (mAutoTransact.getOrDefault(plf.toUpperCase(Locale.ROOT), false)) {
             return true;
         }
-        List<Pattern> patternMatches = mAutoTransactPatterns.keySet().stream()
-                .filter(p -> p.matcher(plf).matches()).toList();
+        boolean isPattern = plf.contains("?") || plf.contains("*");
+        List<Pattern> patternMatches = mAutoTransactPatterns.keySet().stream().filter(
+            p -> isPattern ? p.toString().equals(plf) : p.matcher(plf).matches()).toList();
+
         if (patternMatches == null || patternMatches.size() == 0) {
             return false;
         }
diff --git a/packages/ExtShared/Android.bp b/packages/ExtShared/Android.bp
index b1fd7f6..58016f7 100644
--- a/packages/ExtShared/Android.bp
+++ b/packages/ExtShared/Android.bp
@@ -38,6 +38,7 @@
     aaptflags: ["--shared-lib"],
     export_package_resources: true,
     optimize: {
+        keep_runtime_invisible_annotations: true,
         proguard_flags_files: ["proguard.proguard"],
     },
 }
diff --git a/packages/ExtShared/proguard.proguard b/packages/ExtShared/proguard.proguard
index e5dfbe1..699fbda 100644
--- a/packages/ExtShared/proguard.proguard
+++ b/packages/ExtShared/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/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java b/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
index ff08403..60fae3f 100644
--- a/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
+++ b/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
@@ -18,10 +18,13 @@
 
 import static android.os.Process.FIRST_APPLICATION_UID;
 
+import static com.android.aconfig_new_storage.Flags.enableAconfigStorageDaemon;
+
 import android.aconfig.Aconfig.flag_permission;
 import android.aconfig.Aconfig.flag_state;
 import android.aconfig.Aconfig.parsed_flag;
 import android.aconfig.Aconfig.parsed_flags;
+import android.aconfigd.AconfigdFlagInfo;
 import android.annotation.NonNull;
 import android.annotation.Nullable;
 import android.content.Context;
@@ -65,14 +68,10 @@
 import java.io.FileInputStream;
 import java.io.FileNotFoundException;
 import java.io.FileOutputStream;
-import java.io.InputStream;
 import java.io.IOException;
 import java.io.PrintWriter;
 import java.nio.file.Files;
 import java.nio.file.Path;
-import java.nio.file.Paths;
-import java.nio.file.attribute.PosixFileAttributes;
-import java.nio.file.attribute.PosixFilePermission;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.HashSet;
@@ -84,18 +83,6 @@
 import java.util.Set;
 import java.util.concurrent.CountDownLatch;
 
-// FOR ACONFIGD TEST MISSION AND ROLLOUT
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import android.util.proto.ProtoInputStream;
-import android.aconfigd.Aconfigd.StorageRequestMessage;
-import android.aconfigd.Aconfigd.StorageRequestMessages;
-import android.aconfigd.Aconfigd.StorageReturnMessage;
-import android.aconfigd.Aconfigd.StorageReturnMessages;
-import android.aconfigd.AconfigdClientSocket;
-import android.aconfigd.AconfigdFlagInfo;
-import android.aconfigd.AconfigdJavaUtils;
-import static com.android.aconfig_new_storage.Flags.enableAconfigStorageDaemon;
 /**
  * This class contains the state for one type of settings. It is responsible
  * for saving the state asynchronously to an XML file after a mutation and
@@ -393,22 +380,6 @@
                     getAllAconfigFlagsFromSettings(mAconfigDefaultFlags);
                 }
             }
-
-            if (isConfigSettingsKey(mKey)) {
-                requests = handleBulkSyncToNewStorage(mAconfigDefaultFlags);
-            }
-        }
-
-        if (enableAconfigStorageDaemon()) {
-            if (isConfigSettingsKey(mKey)){
-                AconfigdClientSocket localSocket = AconfigdJavaUtils.getAconfigdClientSocket();
-                if (requests != null) {
-                    InputStream res = localSocket.send(requests.getBytes());
-                    if (res == null) {
-                        Slog.w(LOG_TAG, "Bulk sync request to acongid failed.");
-                    }
-                }
-            }
         }
     }
 
@@ -482,87 +453,6 @@
         return flag;
     }
 
-
-    // TODO(b/341764371): migrate aconfig flag push to GMS core
-    @VisibleForTesting
-    @GuardedBy("mLock")
-    public ProtoOutputStream handleBulkSyncToNewStorage(
-            Map<String, AconfigdFlagInfo> aconfigFlagMap) {
-        // get marker or add marker if it does not exist
-        Setting markerSetting = mSettings.get(BULK_SYNC_MARKER);
-        int localCounter = 0;
-        if (markerSetting == null) {
-            markerSetting = new Setting(BULK_SYNC_MARKER, "0", false, "aconfig", "aconfig");
-            mSettings.put(BULK_SYNC_MARKER, markerSetting);
-        }
-        try {
-            localCounter = Integer.parseInt(markerSetting.value);
-        } catch (NumberFormatException e) {
-            // reset local counter
-            markerSetting.value = "0";
-        }
-
-        if (enableAconfigStorageDaemon()) {
-            Setting bulkSyncCounter = mSettings.get(BULK_SYNC_TRIGGER_COUNTER);
-            int serverCounter = 0;
-            if (bulkSyncCounter != null) {
-                try {
-                    serverCounter = Integer.parseInt(bulkSyncCounter.value);
-                } catch (NumberFormatException e) {
-                    // reset the local value of server counter
-                    bulkSyncCounter.value = "0";
-                }
-            }
-
-            boolean shouldSync = localCounter < serverCounter;
-            if (!shouldSync) {
-                // CASE 1, flag is on, bulk sync marker true, nothing to do
-                return null;
-            } else {
-                // CASE 2, flag is on, bulk sync marker false. Do following two tasks
-                // (1) Do bulk sync here.
-                // (2) After bulk sync, set marker to true.
-
-                // first add storage reset request
-                ProtoOutputStream requests = new ProtoOutputStream();
-                AconfigdJavaUtils.writeResetStorageRequest(requests);
-
-                // loop over all settings and add flag override requests
-                for (AconfigdFlagInfo flag : aconfigFlagMap.values()) {
-                    // don't sync read_only flags
-                    if (!flag.getIsReadWrite()) {
-                        continue;
-                    }
-
-                    if (flag.getHasServerOverride()) {
-                        AconfigdJavaUtils.writeFlagOverrideRequest(
-                                requests,
-                                flag.getPackageName(),
-                                flag.getFlagName(),
-                                flag.getServerFlagValue(),
-                                StorageRequestMessage.SERVER_ON_REBOOT);
-                    }
-
-                    if (flag.getHasLocalOverride()) {
-                        AconfigdJavaUtils.writeFlagOverrideRequest(
-                                requests,
-                                flag.getPackageName(),
-                                flag.getFlagName(),
-                                flag.getLocalFlagValue(),
-                                StorageRequestMessage.LOCAL_ON_REBOOT);
-                    }
-                }
-
-                // mark sync has been done
-                markerSetting.value = String.valueOf(serverCounter);
-                scheduleWriteIfNeededLocked();
-                return requests;
-            }
-        } else {
-            return null;
-        }
-    }
-
     @GuardedBy("mLock")
     private void loadAconfigDefaultValuesLocked(List<String> filePaths) {
         for (String fileName : filePaths) {
diff --git a/packages/SettingsProvider/test/src/com/android/providers/settings/SettingsStateTest.java b/packages/SettingsProvider/test/src/com/android/providers/settings/SettingsStateTest.java
index f798a35..81e1aa8 100644
--- a/packages/SettingsProvider/test/src/com/android/providers/settings/SettingsStateTest.java
+++ b/packages/SettingsProvider/test/src/com/android/providers/settings/SettingsStateTest.java
@@ -30,19 +30,20 @@
 import android.platform.test.flag.junit.CheckFlagsRule;
 import android.platform.test.flag.junit.DeviceFlagsValueProvider;
 import android.util.Xml;
-import android.util.proto.ProtoOutputStream;
 
 import androidx.test.InstrumentationRegistry;
 import androidx.test.runner.AndroidJUnit4;
 
 import com.android.modules.utils.TypedXmlSerializer;
 
-import android.platform.test.annotations.EnableFlags;
-import android.platform.test.annotations.DisableFlags;
-import android.platform.test.flag.junit.SetFlagsRule;
-
 import com.google.common.base.Strings;
 
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
 import java.io.ByteArrayOutputStream;
 import java.io.File;
 import java.io.FileOutputStream;
@@ -51,11 +52,6 @@
 import java.util.List;
 import java.util.Map;
 
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.runner.RunWith;
 
 @RunWith(AndroidJUnit4.class)
 public class SettingsStateTest {
@@ -1084,124 +1080,6 @@
         assertTrue(flag1.getHasLocalOverride());
     }
 
-    @Rule public final SetFlagsRule mSetFlagsRule = new SetFlagsRule();
-
-    @Test
-    @EnableFlags(com.android.aconfig_new_storage.Flags.FLAG_ENABLE_ACONFIG_STORAGE_DAEMON)
-    public void testHandleBulkSyncWithAconfigdEnabled() {
-        int configKey = SettingsState.makeKey(SettingsState.SETTINGS_TYPE_CONFIG, 0);
-        Object lock = new Object();
-        SettingsState settingsState =
-                new SettingsState(
-                        InstrumentationRegistry.getContext(),
-                        lock,
-                        mSettingsFile,
-                        configKey,
-                        SettingsState.MAX_BYTES_PER_APP_PACKAGE_UNLIMITED,
-                        Looper.getMainLooper());
-
-        Map<String, AconfigdFlagInfo> flags = new HashMap<>();
-        flags.put(
-                "com.android.flags/flag1",
-                AconfigdFlagInfo.newBuilder()
-                        .setPackageName("com.android.flags")
-                        .setFlagName("flag1")
-                        .setBootFlagValue("true")
-                        .setIsReadWrite(true)
-                        .build());
-
-        flags.put(
-                "com.android.flags/flag2",
-                AconfigdFlagInfo.newBuilder()
-                        .setPackageName("com.android.flags")
-                        .setFlagName("flag2")
-                        .setBootFlagValue("true")
-                        .setIsReadWrite(false)
-                        .build());
-
-        String bulkSyncMarker = "aconfigd_marker/bulk_synced";
-        String bulkSyncCounter =
-                "core_experiments_team_internal/" +
-                "BulkSyncTriggerCounterFlag__bulk_sync_trigger_counter";
-
-        synchronized (lock) {
-            settingsState.insertSettingLocked(bulkSyncMarker, "0", null, false, "aconfig");
-            settingsState.insertSettingLocked(bulkSyncCounter, "1", null, false,
-                    "com.google.android.platform.core_experiments_team_internal");
-
-            // first bulk sync
-            ProtoOutputStream requests = settingsState.handleBulkSyncToNewStorage(flags);
-            assertTrue(requests != null);
-            String value = settingsState.getSettingLocked("aconfigd_marker/bulk_synced").getValue();
-            assertEquals("1", value);
-
-            // send time should no longer bulk sync
-            requests = settingsState.handleBulkSyncToNewStorage(flags);
-            assertNull(requests);
-            value = settingsState.getSettingLocked("aconfigd_marker/bulk_synced").getValue();
-            assertEquals("1", value);
-
-            // won't sync if the marker is string
-            settingsState.insertSettingLocked(bulkSyncMarker, "true", null, false, "aconfig");
-            settingsState.insertSettingLocked(bulkSyncCounter, "0", null, false,
-                    "com.google.android.platform.core_experiments_team_internal");
-            requests = settingsState.handleBulkSyncToNewStorage(flags);
-            assertNull(requests);
-            value = settingsState.getSettingLocked("aconfigd_marker/bulk_synced").getValue();
-            assertEquals("0", value);
-
-            // won't sync if the marker and counter value are the same
-            settingsState.insertSettingLocked(bulkSyncMarker, "1", null, false, "aconfig");
-            settingsState.insertSettingLocked(bulkSyncCounter, "1", null, false,
-                    "com.google.android.platform.core_experiments_team_internal");
-            requests = settingsState.handleBulkSyncToNewStorage(flags);
-            assertNull(requests);
-            value = settingsState.getSettingLocked("aconfigd_marker/bulk_synced").getValue();
-            assertEquals("1", value);
-        }
-    }
-
-    @Test
-    @DisableFlags(com.android.aconfig_new_storage.Flags.FLAG_ENABLE_ACONFIG_STORAGE_DAEMON)
-    public void testHandleBulkSyncWithAconfigdDisabled() {
-        int configKey = SettingsState.makeKey(SettingsState.SETTINGS_TYPE_CONFIG, 0);
-        Object lock = new Object();
-        SettingsState settingsState = new SettingsState(
-                InstrumentationRegistry.getContext(), lock, mSettingsFile, configKey,
-                SettingsState.MAX_BYTES_PER_APP_PACKAGE_UNLIMITED, Looper.getMainLooper());
-
-        Map<String, AconfigdFlagInfo> flags = new HashMap<>();
-        String bulkSyncMarker = "aconfigd_marker/bulk_synced";
-        String bulkSyncCounter =
-                "core_experiments_team_internal/" +
-                "BulkSyncTriggerCounterFlag__bulk_sync_trigger_counter";
-        synchronized (lock) {
-            settingsState.insertSettingLocked("aconfigd_marker/bulk_synced",
-                    "true", null, false, "aconfig");
-
-            // when aconfigd is off, should change the marker to false
-            ProtoOutputStream requests = settingsState.handleBulkSyncToNewStorage(flags);
-            assertNull(requests);
-            String value = settingsState.getSettingLocked("aconfigd_marker/bulk_synced").getValue();
-            assertEquals("0", value);
-
-            // marker started with false value, after call, it should remain false
-            requests = settingsState.handleBulkSyncToNewStorage(flags);
-            assertNull(requests);
-            value = settingsState.getSettingLocked("aconfigd_marker/bulk_synced").getValue();
-            assertEquals("0", value);
-
-            // won't sync
-            settingsState.insertSettingLocked(bulkSyncMarker, "0", null, false, "aconfig");
-            settingsState.insertSettingLocked(bulkSyncCounter, "1", null, false,
-                    "com.google.android.platform.core_experiments_team_internal");
-            requests = settingsState.handleBulkSyncToNewStorage(flags);
-            assertNull(requests);
-            value = settingsState.getSettingLocked("aconfigd_marker/bulk_synced").getValue();
-            assertEquals("0", value);
-        }
-    }
-
     @Test
     public void testGetAllAconfigFlagsFromSettings() throws Exception {
         final Object lock = new Object();
diff --git a/packages/SystemUI/accessibility/accessibilitymenu/aconfig/Android.bp b/packages/SystemUI/accessibility/accessibilitymenu/aconfig/Android.bp
index 0ff856e..1d74774c 100644
--- a/packages/SystemUI/accessibility/accessibilitymenu/aconfig/Android.bp
+++ b/packages/SystemUI/accessibility/accessibilitymenu/aconfig/Android.bp
@@ -5,7 +5,7 @@
 aconfig_declarations {
     name: "com_android_a11y_menu_flags",
     package: "com.android.systemui.accessibility.accessibilitymenu",
-    container: "system",
+    container: "system_ext",
     srcs: [
         "accessibility.aconfig",
     ],
diff --git a/packages/SystemUI/accessibility/accessibilitymenu/aconfig/accessibility.aconfig b/packages/SystemUI/accessibility/accessibilitymenu/aconfig/accessibility.aconfig
index 6d79011..bdf6d42 100644
--- a/packages/SystemUI/accessibility/accessibilitymenu/aconfig/accessibility.aconfig
+++ b/packages/SystemUI/accessibility/accessibilitymenu/aconfig/accessibility.aconfig
@@ -1,5 +1,5 @@
 package: "com.android.systemui.accessibility.accessibilitymenu"
-container: "system"
+container: "system_ext"
 
 # NOTE: Keep alphabetized to help limit merge conflicts from multiple simultaneous editors.
 
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/media/dialog/OWNERS b/packages/SystemUI/multivalentTests/src/com/android/systemui/media/dialog/OWNERS
new file mode 100644
index 0000000..739d2ac
--- /dev/null
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/media/dialog/OWNERS
@@ -0,0 +1 @@
+file:/packages/SystemUI/src/com/android/systemui/media/dialog/OWNERS
diff --git a/packages/Vcn/framework-b/framework-vcn-jarjar-rules.txt b/packages/Vcn/framework-b/framework-vcn-jarjar-rules.txt
index 7e27b24..33287b7 100644
--- a/packages/Vcn/framework-b/framework-vcn-jarjar-rules.txt
+++ b/packages/Vcn/framework-b/framework-vcn-jarjar-rules.txt
@@ -1,2 +1,3 @@
 rule android.net.vcn.persistablebundleutils.** android.net.connectivity.android.net.vcn.persistablebundleutils.@1
-rule android.net.vcn.util.** android.net.connectivity.android.net.vcn.util.@1
\ No newline at end of file
+rule android.net.vcn.util.** android.net.connectivity.android.net.vcn.util.@1
+rule android.util.IndentingPrintWriter android.net.connectivity.android.util.IndentingPrintWriter
\ No newline at end of file
diff --git a/ravenwood/Android.bp b/ravenwood/Android.bp
index 8e99842..adbb3af 100644
--- a/ravenwood/Android.bp
+++ b/ravenwood/Android.bp
@@ -175,9 +175,9 @@
 }
 
 java_device_for_host {
-    name: "ravenwood-junit-impl-for-ravenizer",
+    name: "ravenwood-junit-for-ravenizer",
     libs: [
-        "ravenwood-junit-impl",
+        "ravenwood-junit",
     ],
     visibility: [":__subpackages__"],
 }
diff --git a/ravenwood/junit-impl-src/android/platform/test/ravenwood/RavenwoodRuntimeEnvironmentController.java b/ravenwood/junit-impl-src/android/platform/test/ravenwood/RavenwoodRuntimeEnvironmentController.java
index 3cb6c5a..7af03ed 100644
--- a/ravenwood/junit-impl-src/android/platform/test/ravenwood/RavenwoodRuntimeEnvironmentController.java
+++ b/ravenwood/junit-impl-src/android/platform/test/ravenwood/RavenwoodRuntimeEnvironmentController.java
@@ -44,6 +44,7 @@
 import android.content.Context;
 import android.content.pm.ApplicationInfo;
 import android.content.res.Resources;
+import android.icu.util.ULocale;
 import android.os.Binder;
 import android.os.Build;
 import android.os.Build.VERSION_CODES;
@@ -81,6 +82,7 @@
 import java.io.PrintStream;
 import java.util.Collections;
 import java.util.HashMap;
+import java.util.Locale;
 import java.util.Map;
 import java.util.Objects;
 import java.util.Random;
@@ -228,6 +230,9 @@
         RuntimeInit.redirectLogStreams();
 
         dumpCommandLineArgs();
+        dumpEnvironment();
+        dumpJavaProperties();
+        dumpOtherInfo();
 
         // We haven't initialized liblog yet, so directly write to System.out here.
         RavenwoodCommonUtils.log(TAG, "globalInitInner()");
@@ -564,4 +569,34 @@
             Log.v(TAG, "  " + arg);
         }
     }
+
+    private static void dumpJavaProperties() {
+        Log.v(TAG, "JVM properties:");
+        dumpMap(System.getProperties());
+    }
+
+    private static void dumpEnvironment() {
+        Log.v(TAG, "Environment:");
+        dumpMap(System.getenv());
+    }
+
+    private static void dumpMap(Map<?, ?> map) {
+        for (var key : map.keySet().stream().sorted().toList()) {
+            Log.v(TAG, "  " + key + "=" + map.get(key));
+        }
+    }
+
+    private static void dumpOtherInfo() {
+        Log.v(TAG, "Other key information:");
+        var jloc = Locale.getDefault();
+        Log.v(TAG, "  java.util.Locale=" + jloc + " / " + jloc.toLanguageTag());
+        var uloc = ULocale.getDefault();
+        Log.v(TAG, "  android.icu.util.ULocale=" + uloc + " / " + uloc.toLanguageTag());
+
+        var jtz = java.util.TimeZone.getDefault();
+        Log.v(TAG, "  java.util.TimeZone=" + jtz.getDisplayName() + " / " + jtz);
+
+        var itz = android.icu.util.TimeZone.getDefault();
+        Log.v(TAG, "  android.icu.util.TimeZone="  + itz.getDisplayName() + " / " + itz);
+    }
 }
diff --git a/ravenwood/scripts/add-annotations.sh b/ravenwood/scripts/add-annotations.sh
new file mode 100755
index 0000000..3e86037
--- /dev/null
+++ b/ravenwood/scripts/add-annotations.sh
@@ -0,0 +1,84 @@
+#!/bin/bash
+# Copyright (C) 2025 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+#
+# Use "ravehleper mm" to create a shell script which:
+# - Reads read a list of methods from STDIN
+#   Which basically looks like a list of 'com.android.ravenwoodtest.tests.Test1#testA'
+# - Add @DisabledOnRavenwood to them
+#
+# Example usage:
+#
+# ./add-annotations.sh $ANDROID_BUILD_TOP/frameworks/base/ravenwood/tests <METHOD-LIST.txt
+#
+# Use a different annotation instead. (Note, in order to use an at, you need to use a double-at.)
+# ./add-annotations.sh -t '@@Ignore' $ANDROID_BUILD_TOP/frameworks/base/ravenwood/tests <METHOD-LIST.txt
+#
+
+set -e
+
+# Uncomment it to always build ravenhelper (slow)
+# ${BUILD_CMD:-m} ravenhelper
+
+# We add this line to each methods found.
+# Note, if we used a single @, that'd be handled as an at file. Use
+# the double-at instead.
+annotation="@@android.platform.test.annotations.DisabledOnRavenwood"
+while getopts "t:" opt; do
+case "$opt" in
+    t)
+        annotation="$OPTARG"
+        ;;
+    '?')
+        exit 1
+        ;;
+esac
+done
+shift $(($OPTIND - 1))
+
+source_dirs="$@"
+
+OUT_SCRIPT="${OUT_SCRIPT:-/tmp/add-annotations.sh}"
+
+rm -f "$OUT_SCRIPT"
+
+
+with_flag() {
+    local flag="$1"
+    shift
+
+    for arg in "$@"; do
+        echo "$flag $arg"
+    done
+}
+
+run() {
+    echo "Running: $*"
+    "$@"
+}
+
+run ${RAVENHELPER_CMD:-ravenhelper mm} \
+    --output-script $OUT_SCRIPT \
+    --text "$annotation" \
+    $(with_flag --src $source_dirs)
+
+
+if ! [[ -f $OUT_SCRIPT ]] ; then
+    # no operations generated.
+    exit 0
+fi
+
+echo
+echo "Created script at $OUT_SCRIPT. Run it with: sh $OUT_SCRIPT"
diff --git a/ravenwood/scripts/pta-framework.sh b/ravenwood/scripts/pta-framework.sh
index 224ab59..d396839 100755
--- a/ravenwood/scripts/pta-framework.sh
+++ b/ravenwood/scripts/pta-framework.sh
@@ -1,5 +1,5 @@
 #!/bin/bash
-# Copyright (C) 2024 The Android Open Source Project
+# Copyright (C) 2025 The Android Open Source Project
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
@@ -79,6 +79,7 @@
         $extra_args
 
     if ! [[ -f $OUT_SCRIPT ]] ; then
+        echo "No files need updating."
         # no operations generated.
         exit 0
     fi
@@ -88,4 +89,4 @@
     return 0
 }
 
-run_pta "$extra_args"
\ No newline at end of file
+run_pta "$extra_args"
diff --git a/ravenwood/texts/ravenwood-framework-policies.txt b/ravenwood/texts/ravenwood-framework-policies.txt
index 4033782..fff9e6a 100644
--- a/ravenwood/texts/ravenwood-framework-policies.txt
+++ b/ravenwood/texts/ravenwood-framework-policies.txt
@@ -62,4 +62,4 @@
 
 # Just enough to allow ResourcesManager to run
 class android.hardware.display.DisplayManagerGlobal keep # no-pta
-    method getInstance ()Landroid/hardware/display/DisplayManagerGlobal; ignore
+    method getInstance ()Landroid/hardware/display/DisplayManagerGlobal; ignore # no-pta
diff --git a/ravenwood/texts/ravenwood-standard-options.txt b/ravenwood/texts/ravenwood-standard-options.txt
index 27223d8b..91fd928 100644
--- a/ravenwood/texts/ravenwood-standard-options.txt
+++ b/ravenwood/texts/ravenwood-standard-options.txt
@@ -31,6 +31,9 @@
 --remove-annotation
     android.ravenwood.annotation.RavenwoodRemove
 
+--ignore-annotation
+    android.ravenwood.annotation.RavenwoodIgnore
+
 --substitute-annotation
     android.ravenwood.annotation.RavenwoodReplace
 
diff --git a/ravenwood/tools/hoststubgen/src/com/android/hoststubgen/HostStubGenOptions.kt b/ravenwood/tools/hoststubgen/src/com/android/hoststubgen/HostStubGenOptions.kt
index ae9276f..297420d 100644
--- a/ravenwood/tools/hoststubgen/src/com/android/hoststubgen/HostStubGenOptions.kt
+++ b/ravenwood/tools/hoststubgen/src/com/android/hoststubgen/HostStubGenOptions.kt
@@ -354,6 +354,8 @@
  * Scan the arguments, and if any of them starts with an `@`, then load from the file
  * and use its content as arguments.
  *
+ * In order to pass an argument that starts with an '@', use '@@' instead.
+ *
  * In this file, each line is treated as a single argument.
  *
  * The file can contain '#' as comments.
@@ -362,7 +364,10 @@
     val ret = mutableListOf<String>()
 
     args.forEach { arg ->
-        if (!arg.startsWith('@')) {
+        if (arg.startsWith("@@")) {
+            ret += arg.substring(1)
+            return@forEach
+        } else if (!arg.startsWith('@')) {
             ret += arg
             return@forEach
         }
diff --git a/ravenwood/tools/ravenhelper/src/com/android/platform/test/ravenwood/ravenhelper/RavenHelperMain.kt b/ravenwood/tools/ravenhelper/src/com/android/platform/test/ravenwood/ravenhelper/RavenHelperMain.kt
index e6efbf6..0be0c96 100644
--- a/ravenwood/tools/ravenhelper/src/com/android/platform/test/ravenwood/ravenhelper/RavenHelperMain.kt
+++ b/ravenwood/tools/ravenhelper/src/com/android/platform/test/ravenwood/ravenhelper/RavenHelperMain.kt
@@ -27,6 +27,7 @@
 import com.android.hoststubgen.log
 import com.android.hoststubgen.runMainWithBoilerplate
 import com.android.platform.test.ravenwood.ravenhelper.policytoannot.PtaProcessor
+import com.android.platform.test.ravenwood.ravenhelper.sourcemap.MarkMethodHandler
 
 interface SubcommandHandler {
     fun handle(args: List<String>)
@@ -39,7 +40,10 @@
 
         Subcommands:
           pta:        "policy-to-annotations" Convert policy file to annotations.
-                      (See the pta-framework.sh script for usage.) 1
+                      (See the pta-framework.sh script for usage.)
+
+          mm:         "mark methods" Used to add annotations (such as @DisabledOnRavenwood)
+                      to methods.
 
         """.trimIndent())
 }
@@ -60,6 +64,7 @@
         val subcommand = args[0]
         val handler: SubcommandHandler = when (subcommand) {
             "pta" -> PtaProcessor()
+            "mm" -> MarkMethodHandler()
             else -> {
                 usage()
                 throw GeneralUserErrorException("Unknown subcommand '$subcommand'")
diff --git a/ravenwood/tools/ravenhelper/src/com/android/platform/test/ravenwood/ravenhelper/policytoannot/Annotations.kt b/ravenwood/tools/ravenhelper/src/com/android/platform/test/ravenwood/ravenhelper/policytoannot/Annotations.kt
index 4a11259..ef1cb5d 100644
--- a/ravenwood/tools/ravenhelper/src/com/android/platform/test/ravenwood/ravenhelper/policytoannot/Annotations.kt
+++ b/ravenwood/tools/ravenhelper/src/com/android/platform/test/ravenwood/ravenhelper/policytoannot/Annotations.kt
@@ -45,7 +45,8 @@
                 "@android.ravenwood.annotation.RavenwoodRedirect"
             FilterPolicy.Throw ->
                 "@android.ravenwood.annotation.RavenwoodThrow"
-            FilterPolicy.Ignore -> null // Ignore has no annotation. (because it's not very safe.)
+            FilterPolicy.Ignore ->
+                "@android.ravenwood.annotation.RavenwoodIgnore"
             FilterPolicy.Remove ->
                 "@android.ravenwood.annotation.RavenwoodRemove"
         }
diff --git a/ravenwood/tools/ravenhelper/src/com/android/platform/test/ravenwood/ravenhelper/policytoannot/Operations.kt b/ravenwood/tools/ravenhelper/src/com/android/platform/test/ravenwood/ravenhelper/policytoannot/Operations.kt
index 3531ba95..256d123 100644
--- a/ravenwood/tools/ravenhelper/src/com/android/platform/test/ravenwood/ravenhelper/policytoannot/Operations.kt
+++ b/ravenwood/tools/ravenhelper/src/com/android/platform/test/ravenwood/ravenhelper/policytoannot/Operations.kt
@@ -24,6 +24,8 @@
 import com.android.hoststubgen.log
 import java.io.BufferedWriter
 import java.io.File
+import java.io.FileOutputStream
+import java.io.OutputStreamWriter
 
 enum class SourceOperationType {
     /** Insert a line */
@@ -198,4 +200,26 @@
             }
         }
     }
+}
+
+fun createShellScript(ops: SourceOperations, scriptFile: String?): Boolean {
+    if (ops.size == 0) {
+        log.i("No files need to be updated.")
+        return false
+    }
+
+    val scriptWriter = BufferedWriter(
+        OutputStreamWriter(
+            scriptFile?.let { file ->
+            FileOutputStream(file)
+        } ?: System.out
+    ))
+
+    scriptWriter.use { writer ->
+        scriptFile?.let {
+            log.i("Creating script file at $it ...")
+        }
+        createShellScript(ops, writer)
+    }
+    return true
 }
\ No newline at end of file
diff --git a/ravenwood/tools/ravenhelper/src/com/android/platform/test/ravenwood/ravenhelper/policytoannot/PtaProcessor.kt b/ravenwood/tools/ravenhelper/src/com/android/platform/test/ravenwood/ravenhelper/policytoannot/PtaProcessor.kt
index 5984e4f..3657a90 100644
--- a/ravenwood/tools/ravenhelper/src/com/android/platform/test/ravenwood/ravenhelper/policytoannot/PtaProcessor.kt
+++ b/ravenwood/tools/ravenhelper/src/com/android/platform/test/ravenwood/ravenhelper/policytoannot/PtaProcessor.kt
@@ -31,10 +31,7 @@
 import com.android.platform.test.ravenwood.ravenhelper.sourcemap.ClassInfo
 import com.android.platform.test.ravenwood.ravenhelper.sourcemap.MethodInfo
 import com.android.platform.test.ravenwood.ravenhelper.sourcemap.SourceLoader
-import java.io.BufferedWriter
-import java.io.FileOutputStream
 import java.io.FileReader
-import java.io.OutputStreamWriter
 import java.util.regex.Pattern
 
 /**
@@ -55,25 +52,7 @@
         )
         converter.process()
 
-        val ops = converter.resultOperations
-
-        if (ops.size == 0) {
-            log.i("No files need to be updated.")
-            return
-        }
-
-        val scriptWriter = BufferedWriter(OutputStreamWriter(
-            options.outputScriptFile.get?.let { file ->
-                FileOutputStream(file)
-            } ?: System.out
-        ))
-
-        scriptWriter.use { writer ->
-            options.outputScriptFile.get?.let {
-                log.i("Creating script file at $it ...")
-            }
-            createShellScript(ops, writer)
-        }
+        createShellScript(converter.resultOperations, options.outputScriptFile.get)
     }
 }
 
@@ -424,7 +403,7 @@
 
             if (methodsAndAnnot == null) {
                 classHasMember = true
-                return // This policy can't converted.
+                return // This policy can't be converted.
             }
             val methods = methodsAndAnnot.first
             val annot = methodsAndAnnot.second
@@ -476,4 +455,4 @@
             classHasMember = true
         }
     }
-}
\ No newline at end of file
+}
diff --git a/ravenwood/tools/ravenhelper/src/com/android/platform/test/ravenwood/ravenhelper/sourcemap/MapOptions.kt b/ravenwood/tools/ravenhelper/src/com/android/platform/test/ravenwood/ravenhelper/sourcemap/MapOptions.kt
new file mode 100644
index 0000000..ee200bb
--- /dev/null
+++ b/ravenwood/tools/ravenhelper/src/com/android/platform/test/ravenwood/ravenhelper/sourcemap/MapOptions.kt
@@ -0,0 +1,95 @@
+/*
+ * Copyright (C) 2025 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.android.platform.test.ravenwood.ravenhelper.sourcemap
+
+import com.android.hoststubgen.ArgIterator
+import com.android.hoststubgen.ArgumentsException
+import com.android.hoststubgen.SetOnce
+import com.android.hoststubgen.ensureFileExists
+import com.android.hoststubgen.log
+
+/**
+ * Options for the "ravenhelper map" subcommand.
+ */
+class MapOptions(
+    /** Source files or directories. */
+    var sourceFilesOrDirectories: MutableList<String> = mutableListOf(),
+
+    /** Files containing target methods */
+    var targetMethodFiles: MutableList<String> = mutableListOf(),
+
+    /** Output script file. */
+    var outputScriptFile: SetOnce<String?> = SetOnce(null),
+
+    /** Text to insert. */
+    var text: SetOnce<String?> = SetOnce(null),
+) {
+    companion object {
+        fun parseArgs(args: List<String>): MapOptions {
+            val ret = MapOptions()
+            val ai = ArgIterator.withAtFiles(args.toTypedArray())
+
+            while (true) {
+                val arg = ai.nextArgOptional() ?: break
+
+                fun nextArg(): String = ai.nextArgRequired(arg)
+
+                if (log.maybeHandleCommandLineArg(arg) { nextArg() }) {
+                    continue
+                }
+                try {
+                    when (arg) {
+                        // TODO: Write help
+                        "-h", "--help" -> TODO("Help is not implemented yet")
+
+                        "-s", "--src" ->
+                            ret.sourceFilesOrDirectories.add(nextArg().ensureFileExists())
+
+                        "-i", "--input" ->
+                            ret.targetMethodFiles.add(nextArg().ensureFileExists())
+
+                        "-o", "--output-script" ->
+                            ret.outputScriptFile.set(nextArg())
+
+                        "-t", "--text" ->
+                            ret.text.set(nextArg())
+
+                        else -> throw ArgumentsException("Unknown option: $arg")
+                    }
+                } catch (e: SetOnce.SetMoreThanOnceException) {
+                    throw ArgumentsException("Duplicate or conflicting argument found: $arg")
+                }
+            }
+
+            if (ret.sourceFilesOrDirectories.size == 0) {
+                throw ArgumentsException("Must specify at least one source path")
+            }
+
+            return ret
+        }
+    }
+
+    override fun toString(): String {
+        return """
+            PtaOptions{
+              sourceFilesOrDirectories=$sourceFilesOrDirectories
+              targetMethods=$targetMethodFiles
+              outputScriptFile=$outputScriptFile
+              text=$text
+            }
+            """.trimIndent()
+    }
+}
\ No newline at end of file
diff --git a/ravenwood/tools/ravenhelper/src/com/android/platform/test/ravenwood/ravenhelper/sourcemap/MarkMethodHandler.kt b/ravenwood/tools/ravenhelper/src/com/android/platform/test/ravenwood/ravenhelper/sourcemap/MarkMethodHandler.kt
new file mode 100644
index 0000000..8085253
--- /dev/null
+++ b/ravenwood/tools/ravenhelper/src/com/android/platform/test/ravenwood/ravenhelper/sourcemap/MarkMethodHandler.kt
@@ -0,0 +1,197 @@
+/*
+ * Copyright (C) 2025 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.android.platform.test.ravenwood.ravenhelper.sourcemap
+
+import com.android.hoststubgen.GeneralUserErrorException
+import com.android.hoststubgen.log
+import com.android.platform.test.ravenwood.ravenhelper.SubcommandHandler
+import com.android.platform.test.ravenwood.ravenhelper.policytoannot.SourceOperation
+import com.android.platform.test.ravenwood.ravenhelper.policytoannot.SourceOperationType
+import com.android.platform.test.ravenwood.ravenhelper.policytoannot.SourceOperations
+import com.android.platform.test.ravenwood.ravenhelper.policytoannot.createShellScript
+import com.android.platform.test.ravenwood.ravenhelper.psi.createUastEnvironment
+import java.io.BufferedReader
+import java.io.FileReader
+
+/**
+ * This is the main routine of the "mm" subcommands, which marks specified methods with
+ * a given line, which defaults to "@DisabledOnRavenwood". This can be used to add bulk-annotate
+ * tests methods that are failing.
+ *
+ * See the javadoc of [MarkMethodProcessor] for more details.
+ */
+class MarkMethodHandler : SubcommandHandler {
+    override fun handle(args: List<String>) {
+        val options = MapOptions.parseArgs(args)
+
+        log.i("Options: $options")
+
+        // Files from which we load a list of methods.
+        val inputFiles = if (options.targetMethodFiles.isEmpty()) {
+            log.w("[Reading method list from STDIN...]")
+            log.flush()
+            listOf("/dev/stdin")
+        } else {
+            options.targetMethodFiles
+        }
+
+        // A string to inject before each method.
+        val text = if (options.text.isSet) {
+            options.text.get!!
+        } else {
+            "@android.platform.test.annotations.DisabledOnRavenwood"
+        }
+
+        // Process.
+        val processor = MarkMethodProcessor(
+            options.sourceFilesOrDirectories,
+            inputFiles,
+            text,
+        )
+        processor.process()
+
+        // Create the output script.
+        createShellScript(processor.resultOperations, options.outputScriptFile.get)
+    }
+}
+
+/**
+ * Load a list of methods / classes from [targetMethodFiles], and inject [textToInsert] to
+ * each of them, to the source files under [sourceFilesOrDirectories]
+ *
+ * An example input files look like this -- this can be generated from atest output.
+ * <pre>
+
+ # We add @DisabledOnRavenwood to the following methods.
+ com.android.ravenwoodtest.tests.Test1#testA
+ com.android.ravenwoodtest.tests.Test1#testB
+ com.android.ravenwoodtest.tests.Test1#testC
+
+ # We add @DisabledOnRavenwood to the following class.
+ com.android.ravenwoodtest.tests.Test2
+
+ # Special case: we add the annotation to the class too.
+ com.android.ravenwoodtest.tests.Test3#initializationError
+ </pre>
+
+ */
+private class MarkMethodProcessor(
+    private val sourceFilesOrDirectories: List<String>,
+    private val targetMethodFiles: List<String>,
+    private val textToInsert: String,
+) {
+    private val classes = AllClassInfo()
+    val resultOperations = SourceOperations()
+
+    /**
+     * Entry point.
+     */
+    fun process() {
+        val env = createUastEnvironment()
+        try {
+            loadSources()
+
+            processInputFiles()
+        } finally {
+            env.dispose()
+        }
+    }
+
+    private fun loadSources() {
+        val env = createUastEnvironment()
+        try {
+            val loader = SourceLoader(env)
+            loader.load(sourceFilesOrDirectories, classes)
+        } finally {
+            env.dispose()
+        }
+    }
+
+    /**
+     * Process liput files. Input files looks like this:
+     * <pre>
+     * # We add @DisabledOnRavenwood to the following methods.
+     * com.android.ravenwoodtest.tests.Test1#testA
+     * com.android.ravenwoodtest.tests.Test1#testB
+     * com.android.ravenwoodtest.tests.Test1#testC
+     *
+     * # We add @DisabledOnRavenwood to the following class.
+     * com.android.ravenwoodtest.tests.Test2
+     *
+     * # Special case: we add the annotation to the class too.
+     * com.android.ravenwoodtest.tests.Test3#initializationError
+     * </pre>
+     */
+    private fun processInputFiles() {
+        targetMethodFiles.forEach { filename ->
+            BufferedReader(FileReader(filename)).use { reader ->
+                reader.readLines().forEach { line ->
+                    if (line.isBlank() || line.startsWith('#')) {
+                        return@forEach
+                    }
+                    processSingleLine(line)
+                }
+            }
+        }
+    }
+
+    private fun processSingleLine(line: String) {
+        val cm = line.split("#") // Class and method
+        if (cm.size > 2) {
+            throw GeneralUserErrorException("Input line \"$line\" contains too many #'s")
+        }
+        val className = cm[0]
+        val methodName = if (cm.size == 2 && cm[1] != "initializationError") {
+            cm[1]
+        } else {
+            ""
+        }
+
+        // Find class info
+        val ci = classes.findClass(className)
+            ?: throw GeneralUserErrorException("Class \"$className\" not found\"")
+
+        if (methodName == "") {
+            processClass(ci)
+        } else {
+            processMethod(ci, methodName)
+        }
+    }
+
+    private fun processClass(ci: ClassInfo) {
+        addOperation(ci.location, "Class ${ci.fullName}")
+    }
+
+    private fun processMethod(ci: ClassInfo, methodName: String) {
+        var methods = ci.methods[methodName]
+            ?: throw GeneralUserErrorException("method \"$methodName\" not found\"")
+        methods.forEach { mi ->
+            addOperation(mi.location, "Method ${mi.name}")
+        }
+    }
+
+    private fun addOperation(loc: Location, description: String) {
+        resultOperations.add(
+            SourceOperation(
+                loc.file,
+                loc.line,
+                SourceOperationType.Insert,
+                loc.getIndent() + textToInsert,
+                description
+            )
+        )
+    }
+}
diff --git a/ravenwood/tools/ravenizer/Android.bp b/ravenwood/tools/ravenizer/Android.bp
index 2892d07..a52a04b 100644
--- a/ravenwood/tools/ravenizer/Android.bp
+++ b/ravenwood/tools/ravenizer/Android.bp
@@ -19,7 +19,7 @@
         "ow2-asm-tree",
         "ow2-asm-util",
         "junit",
-        "ravenwood-junit-impl-for-ravenizer",
+        "ravenwood-junit-for-ravenizer",
     ],
     visibility: ["//visibility:public"],
 }
diff --git a/services/core/java/com/android/server/BootReceiver.java b/services/core/java/com/android/server/BootReceiver.java
index 23cee9d..16209b1 100644
--- a/services/core/java/com/android/server/BootReceiver.java
+++ b/services/core/java/com/android/server/BootReceiver.java
@@ -50,6 +50,7 @@
 import com.android.modules.utils.TypedXmlSerializer;
 import com.android.server.am.DropboxRateLimiter;
 
+import libcore.io.IoUtils;
 import org.xmlpull.v1.XmlPullParser;
 import org.xmlpull.v1.XmlPullParserException;
 
@@ -147,6 +148,10 @@
 
     @Override
     public void onReceive(final Context context, Intent intent) {
+        if (!Intent.ACTION_BOOT_COMPLETED.equals(intent.getAction())) {
+            return;
+        }
+
         // Log boot events in the background to avoid blocking the main thread with I/O
         new Thread() {
             @Override
@@ -212,6 +217,8 @@
                 } catch (Exception e) {
                     Slog.wtf(TAG, "Error watching for trace events", e);
                     return 0;  // Unregister the handler.
+                } finally {
+                    IoUtils.closeQuietly(fd);
                 }
                 return OnFileDescriptorEventListener.EVENT_INPUT;
             }
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/am/SettingsToPropertiesMapper.java b/services/core/java/com/android/server/am/SettingsToPropertiesMapper.java
index 8d8064f..ccc0a256 100644
--- a/services/core/java/com/android/server/am/SettingsToPropertiesMapper.java
+++ b/services/core/java/com/android/server/am/SettingsToPropertiesMapper.java
@@ -113,6 +113,7 @@
         DeviceConfig.NAMESPACE_LMKD_NATIVE,
         DeviceConfig.NAMESPACE_MEDIA_NATIVE,
         DeviceConfig.NAMESPACE_MGLRU_NATIVE,
+        DeviceConfig.NAMESPACE_MMD_NATIVE,
         DeviceConfig.NAMESPACE_NETD_NATIVE,
         DeviceConfig.NAMESPACE_NNAPI_NATIVE,
         DeviceConfig.NAMESPACE_PROFCOLLECT_NATIVE_BOOT,
diff --git a/services/core/java/com/android/server/audio/AudioService.java b/services/core/java/com/android/server/audio/AudioService.java
index 5b9bab7..ca8dadd 100644
--- a/services/core/java/com/android/server/audio/AudioService.java
+++ b/services/core/java/com/android/server/audio/AudioService.java
@@ -12506,10 +12506,10 @@
                 int uid = intent.getIntExtra(Intent.EXTRA_UID, Process.INVALID_UID);
                 if (intent.getBooleanExtra(EXTRA_REPLACING, false) ||
                         intent.getBooleanExtra(EXTRA_ARCHIVAL, false)) return;
-                if (action.equals(ACTION_PACKAGE_ADDED)) {
+                if (ACTION_PACKAGE_ADDED.equals(action)) {
                     audioserverExecutor.execute(() ->
                             provider.onModifyPackageState(uid, pkgName, false /* isRemoved */));
-                } else if (action.equals(ACTION_PACKAGE_REMOVED)) {
+                } else if (ACTION_PACKAGE_REMOVED.equals(action)) {
                     audioserverExecutor.execute(() ->
                             provider.onModifyPackageState(uid, pkgName, true /* isRemoved */));
                 }
@@ -14153,6 +14153,7 @@
                 for (AudioMix mix : mMixes) {
                     mix.setVirtualDeviceId(mAttributionSource.getDeviceId());
                 }
+                mAudioSystem.registerPolicyMixes(mMixes, false);
                 return mAudioSystem.registerPolicyMixes(mMixes, true);
             } finally {
                 Binder.restoreCallingIdentity(identity);
diff --git a/services/core/java/com/android/server/biometrics/AuthService.java b/services/core/java/com/android/server/biometrics/AuthService.java
index 2d802b2..b6768c9 100644
--- a/services/core/java/com/android/server/biometrics/AuthService.java
+++ b/services/core/java/com/android/server/biometrics/AuthService.java
@@ -38,7 +38,6 @@
 import android.hardware.biometrics.BiometricAuthenticator;
 import android.hardware.biometrics.BiometricManager;
 import android.hardware.biometrics.ComponentInfoInternal;
-import android.hardware.biometrics.Flags;
 import android.hardware.biometrics.IAuthService;
 import android.hardware.biometrics.IBiometricEnabledOnKeyguardCallback;
 import android.hardware.biometrics.IBiometricService;
@@ -399,12 +398,6 @@
 
             final long identity = Binder.clearCallingIdentity();
             try {
-                // We can't do this above because we need the READ_DEVICE_CONFIG permission, which
-                // the calling user may not possess.
-                if (!Flags.lastAuthenticationTime()) {
-                    throw new UnsupportedOperationException();
-                }
-
                 return mBiometricService.getLastAuthenticationTime(userId, authenticators);
             } finally {
                 Binder.restoreCallingIdentity(identity);
diff --git a/services/core/java/com/android/server/biometrics/BiometricService.java b/services/core/java/com/android/server/biometrics/BiometricService.java
index bd1a267..bc1e3c7 100644
--- a/services/core/java/com/android/server/biometrics/BiometricService.java
+++ b/services/core/java/com/android/server/biometrics/BiometricService.java
@@ -43,7 +43,6 @@
 import android.hardware.biometrics.BiometricConstants;
 import android.hardware.biometrics.BiometricPrompt;
 import android.hardware.biometrics.BiometricStateListener;
-import android.hardware.biometrics.Flags;
 import android.hardware.biometrics.IBiometricAuthenticator;
 import android.hardware.biometrics.IBiometricEnabledOnKeyguardCallback;
 import android.hardware.biometrics.IBiometricSensorReceiver;
@@ -100,8 +99,8 @@
 import java.util.Map;
 import java.util.Random;
 import java.util.Set;
-import java.util.concurrent.atomic.AtomicLong;
 import java.util.concurrent.CopyOnWriteArrayList;
+import java.util.concurrent.atomic.AtomicLong;
 import java.util.function.Supplier;
 
 /**
@@ -784,10 +783,6 @@
                 int userId, @Authenticators.Types int authenticators) {
             super.getLastAuthenticationTime_enforcePermission();
 
-            if (!Flags.lastAuthenticationTime()) {
-                throw new UnsupportedOperationException();
-            }
-
             Slogf.d(TAG, "getLastAuthenticationTime(userId=%d, authenticators=0x%x)",
                     userId, authenticators);
 
diff --git a/services/core/java/com/android/server/infra/OWNERS b/services/core/java/com/android/server/infra/OWNERS
index 4fea05d..0f0d382 100644
--- a/services/core/java/com/android/server/infra/OWNERS
+++ b/services/core/java/com/android/server/infra/OWNERS
@@ -1,3 +1,4 @@
 # Bug component: 655446
 
 srazdan@google.com
+reemabajwa@google.com
diff --git a/services/core/java/com/android/server/sensorprivacy/SensorPrivacyService.java b/services/core/java/com/android/server/sensorprivacy/SensorPrivacyService.java
index 8121701..16658e3 100644
--- a/services/core/java/com/android/server/sensorprivacy/SensorPrivacyService.java
+++ b/services/core/java/com/android/server/sensorprivacy/SensorPrivacyService.java
@@ -536,8 +536,12 @@
                     user.getIdentifier());
             String inputMethodPackageName = null;
             if (inputMethodComponent != null) {
-                inputMethodPackageName = ComponentName.unflattenFromString(
-                        inputMethodComponent).getPackageName();
+                ComponentName component = ComponentName.unflattenFromString(inputMethodComponent);
+                if (component != null) {
+                    inputMethodPackageName = component.getPackageName();
+                } else {
+                    Log.w(TAG, "Failed to parse inputMethodComponent: " + inputMethodComponent);
+                }
             }
 
             int capability;
diff --git a/services/foldables/devicestateprovider/src/com/android/server/policy/feature/Android.bp b/services/foldables/devicestateprovider/src/com/android/server/policy/feature/Android.bp
index 6393e11..1db9e8d 100644
--- a/services/foldables/devicestateprovider/src/com/android/server/policy/feature/Android.bp
+++ b/services/foldables/devicestateprovider/src/com/android/server/policy/feature/Android.bp
@@ -1,7 +1,7 @@
 aconfig_declarations {
     name: "device_state_flags",
     package: "com.android.server.policy.feature.flags",
-    container: "system",
+    container: "system_ext",
     srcs: [
         "device_state_flags.aconfig",
     ],
diff --git a/services/foldables/devicestateprovider/src/com/android/server/policy/feature/device_state_flags.aconfig b/services/foldables/devicestateprovider/src/com/android/server/policy/feature/device_state_flags.aconfig
index 21e33dd..f827b55 100644
--- a/services/foldables/devicestateprovider/src/com/android/server/policy/feature/device_state_flags.aconfig
+++ b/services/foldables/devicestateprovider/src/com/android/server/policy/feature/device_state_flags.aconfig
@@ -1,5 +1,5 @@
 package: "com.android.server.policy.feature.flags"
-container: "system"
+container: "system_ext"
 
 flag {
     name: "enable_dual_display_blocking"
diff --git a/services/tests/servicestests/src/com/android/server/biometrics/AuthServiceTest.java b/services/tests/servicestests/src/com/android/server/biometrics/AuthServiceTest.java
index 9cd3186..83753cc 100644
--- a/services/tests/servicestests/src/com/android/server/biometrics/AuthServiceTest.java
+++ b/services/tests/servicestests/src/com/android/server/biometrics/AuthServiceTest.java
@@ -44,7 +44,6 @@
 import android.content.res.Resources;
 import android.hardware.biometrics.AuthenticationStateListener;
 import android.hardware.biometrics.BiometricManager;
-import android.hardware.biometrics.Flags;
 import android.hardware.biometrics.IBiometricEnabledOnKeyguardCallback;
 import android.hardware.biometrics.IBiometricService;
 import android.hardware.biometrics.IBiometricServiceReceiver;
@@ -506,23 +505,9 @@
                 eq(callback));
     }
 
-    @Test(expected = UnsupportedOperationException.class)
-    public void testGetLastAuthenticationTime_flaggedOff_throwsUnsupportedOperationException()
-            throws Exception {
-        mSetFlagsRule.disableFlags(Flags.FLAG_LAST_AUTHENTICATION_TIME);
-        setInternalAndTestBiometricPermissions(mContext, true /* hasPermission */);
-
-        mAuthService = new AuthService(mContext, mInjector);
-        mAuthService.onStart();
-
-        mAuthService.mImpl.getLastAuthenticationTime(0,
-                BiometricManager.Authenticators.BIOMETRIC_STRONG);
-    }
-
     @Test
-    public void testGetLastAuthenticationTime_flaggedOn_callsBiometricService()
+    public void testGetLastAuthenticationTime_callsBiometricService()
             throws Exception {
-        mSetFlagsRule.enableFlags(Flags.FLAG_LAST_AUTHENTICATION_TIME);
         setInternalAndTestBiometricPermissions(mContext, true /* hasPermission */);
 
         mAuthService = new AuthService(mContext, mInjector);
diff --git a/services/tests/servicestests/src/com/android/server/biometrics/BiometricServiceTest.java b/services/tests/servicestests/src/com/android/server/biometrics/BiometricServiceTest.java
index b4b3612..ddc35ed 100644
--- a/services/tests/servicestests/src/com/android/server/biometrics/BiometricServiceTest.java
+++ b/services/tests/servicestests/src/com/android/server/biometrics/BiometricServiceTest.java
@@ -1936,20 +1936,9 @@
         verifyNoMoreInteractions(callback);
     }
 
-    @Test(expected = UnsupportedOperationException.class)
-    public void testGetLastAuthenticationTime_flagOff_throwsUnsupportedOperationException()
-            throws RemoteException {
-        mSetFlagsRule.disableFlags(Flags.FLAG_LAST_AUTHENTICATION_TIME);
-
-        mBiometricService = new BiometricService(mContext, mInjector, mBiometricHandlerProvider);
-        mBiometricService.mImpl.getLastAuthenticationTime(0, Authenticators.BIOMETRIC_STRONG);
-    }
-
     @Test
-    public void testGetLastAuthenticationTime_flagOn_callsKeystoreAuthorization()
+    public void testGetLastAuthenticationTime_callsKeystoreAuthorization()
             throws RemoteException {
-        mSetFlagsRule.enableFlags(Flags.FLAG_LAST_AUTHENTICATION_TIME);
-
         final int[] hardwareAuthenticators = new int[] {
                 HardwareAuthenticatorType.PASSWORD,
                 HardwareAuthenticatorType.FINGERPRINT
diff --git a/services/tests/servicestests/src/com/android/server/media/projection/OWNERS b/services/tests/servicestests/src/com/android/server/media/projection/OWNERS
index 832bcd9..3caf7fa 100644
--- a/services/tests/servicestests/src/com/android/server/media/projection/OWNERS
+++ b/services/tests/servicestests/src/com/android/server/media/projection/OWNERS
@@ -1 +1,2 @@
+# Bug component: 1345447
 include /media/java/android/media/projection/OWNERS
diff --git a/services/usb/OWNERS b/services/usb/OWNERS
index 2dff392..2592612 100644
--- a/services/usb/OWNERS
+++ b/services/usb/OWNERS
@@ -1,9 +1,9 @@
-anothermark@google.com
+vmartensson@google.com
+nkapron@google.com
 febinthattil@google.com
-aprasath@google.com
+shubhankarm@google.com
 badhri@google.com
 elaurent@google.com
 albertccwang@google.com
 jameswei@google.com
 howardyen@google.com
-kumarashishg@google.com
\ No newline at end of file
diff --git a/tests/CompanionDeviceMultiDeviceTests/host/Android.bp b/tests/CompanionDeviceMultiDeviceTests/host/Android.bp
index a0e0477..1fb18a6 100644
--- a/tests/CompanionDeviceMultiDeviceTests/host/Android.bp
+++ b/tests/CompanionDeviceMultiDeviceTests/host/Android.bp
@@ -39,13 +39,4 @@
     device_common_data: [
         ":cdm_snippet_legacy",
     ],
-    version: {
-        py2: {
-            enabled: false,
-        },
-        py3: {
-            enabled: true,
-            embedded_launcher: true,
-        },
-    },
 }
diff --git a/tools/localedata/extract_icu_data.py b/tools/localedata/extract_icu_data.py
index ec53127..899cd7f 100755
--- a/tools/localedata/extract_icu_data.py
+++ b/tools/localedata/extract_icu_data.py
@@ -180,7 +180,14 @@
 
 def dump_representative_locales(representative_locales):
     """Dump the set of representative locales."""
-    print()
+    print('''
+/*
+ * TODO: Consider turning the below switch statement into binary search
+ *      to save the disk space when the table is larger in the future.
+ *      Disassembled code shows that the jump table emitted by clang can be
+ *      4x larger than the data in disk size, but it depends on the optimization option.
+ *      However, a switch statement will benefit from the future of compiler improvement.
+ */''')
     print('bool isLocaleRepresentative(uint32_t language_and_region, const char* script) {')
     print('    const uint64_t packed_locale =')
     print('            ((static_cast<uint64_t>(language_and_region)) << 32u) |')