diff --git a/appfunctions/appfunctions-common/api/current.txt b/appfunctions/appfunctions-common/api/current.txt
index f2cf427..ba35715 100644
--- a/appfunctions/appfunctions-common/api/current.txt
+++ b/appfunctions/appfunctions-common/api/current.txt
@@ -1,6 +1,17 @@
 // Signature format: 4.0
 package androidx.appfunctions {
 
+  public abstract class AppFunctionAppException extends androidx.appfunctions.AppFunctionException {
+  }
+
+  public final class AppFunctionAppUnknownException extends androidx.appfunctions.AppFunctionAppException {
+    ctor public AppFunctionAppUnknownException(optional String? errorMessage);
+  }
+
+  public final class AppFunctionCancelledException extends androidx.appfunctions.AppFunctionSystemException {
+    ctor public AppFunctionCancelledException(optional String? errorMessage);
+  }
+
   public interface AppFunctionContext {
     method public String getCallingPackageName();
     method public android.content.pm.SigningInfo getCallingPackageSigningInfo();
@@ -10,53 +21,69 @@
     property public abstract android.content.Context context;
   }
 
-  @kotlin.annotation.Retention(kotlin.annotation.AnnotationRetention.SOURCE) @kotlin.annotation.Target(allowedTargets=kotlin.annotation.AnnotationTarget.CLASS) public @interface AppFunctionEntity {
+  public final class AppFunctionDeniedException extends androidx.appfunctions.AppFunctionRequestException {
+    ctor public AppFunctionDeniedException(optional String? errorMessage);
   }
 
-  public final class AppFunctionException {
+  public final class AppFunctionDisabledException extends androidx.appfunctions.AppFunctionRequestException {
+    ctor public AppFunctionDisabledException(optional String? errorMessage);
+  }
+
+  public final class AppFunctionElementAlreadyExistsException extends androidx.appfunctions.AppFunctionRequestException {
+    ctor public AppFunctionElementAlreadyExistsException(optional String? errorMessage);
+  }
+
+  public final class AppFunctionElementNotFoundException extends androidx.appfunctions.AppFunctionRequestException {
+    ctor public AppFunctionElementNotFoundException(optional String? errorMessage);
+  }
+
+  public abstract class AppFunctionException extends java.lang.Exception {
     ctor public AppFunctionException(int errorCode, optional String? errorMessage);
-    method public int getErrorCategory();
-    method public int getErrorCode();
-    method public String? getErrorMessage();
-    property public final int errorCategory;
-    property public final int errorCode;
+    method public final String? getErrorMessage();
     property public final String? errorMessage;
     field public static final androidx.appfunctions.AppFunctionException.Companion Companion;
-    field public static final int ERROR_APP_UNKNOWN_ERROR = 3000; // 0xbb8
-    field public static final int ERROR_CANCELLED = 2001; // 0x7d1
-    field public static final int ERROR_CATEGORY_APP = 3; // 0x3
-    field public static final int ERROR_CATEGORY_REQUEST_ERROR = 1; // 0x1
-    field public static final int ERROR_CATEGORY_SYSTEM = 2; // 0x2
-    field public static final int ERROR_CATEGORY_UNKNOWN = 0; // 0x0
-    field public static final int ERROR_DENIED = 1000; // 0x3e8
-    field public static final int ERROR_DISABLED = 1002; // 0x3ea
-    field public static final int ERROR_FUNCTION_NOT_FOUND = 1003; // 0x3eb
-    field public static final int ERROR_INVALID_ARGUMENT = 1001; // 0x3e9
-    field public static final int ERROR_LIMIT_EXCEEDED = 1501; // 0x5dd
-    field public static final int ERROR_NOT_SUPPORTED = 3501; // 0xdad
-    field public static final int ERROR_PERMISSION_REQUIRED = 3500; // 0xdac
-    field public static final int ERROR_RESOURCE_ALREADY_EXISTS = 1502; // 0x5de
-    field public static final int ERROR_RESOURCE_NOT_FOUND = 1500; // 0x5dc
-    field public static final int ERROR_SYSTEM_ERROR = 2000; // 0x7d0
   }
 
   public static final class AppFunctionException.Companion {
-    property public static final int ERROR_APP_UNKNOWN_ERROR;
-    property public static final int ERROR_CANCELLED;
-    property public static final int ERROR_CATEGORY_APP;
-    property public static final int ERROR_CATEGORY_REQUEST_ERROR;
-    property public static final int ERROR_CATEGORY_SYSTEM;
-    property public static final int ERROR_CATEGORY_UNKNOWN;
-    property public static final int ERROR_DENIED;
-    property public static final int ERROR_DISABLED;
-    property public static final int ERROR_FUNCTION_NOT_FOUND;
-    property public static final int ERROR_INVALID_ARGUMENT;
-    property public static final int ERROR_LIMIT_EXCEEDED;
-    property public static final int ERROR_NOT_SUPPORTED;
-    property public static final int ERROR_PERMISSION_REQUIRED;
-    property public static final int ERROR_RESOURCE_ALREADY_EXISTS;
-    property public static final int ERROR_RESOURCE_NOT_FOUND;
-    property public static final int ERROR_SYSTEM_ERROR;
+  }
+
+  public final class AppFunctionFunctionNotFoundException extends androidx.appfunctions.AppFunctionRequestException {
+    ctor public AppFunctionFunctionNotFoundException(optional String? errorMessage);
+  }
+
+  public final class AppFunctionInvalidArgumentException extends androidx.appfunctions.AppFunctionRequestException {
+    ctor public AppFunctionInvalidArgumentException(optional String? errorMessage);
+  }
+
+  public final class AppFunctionLimitExceededException extends androidx.appfunctions.AppFunctionRequestException {
+    ctor public AppFunctionLimitExceededException(optional String? errorMessage);
+  }
+
+  public final class AppFunctionNotSupportedException extends androidx.appfunctions.AppFunctionAppException {
+    ctor public AppFunctionNotSupportedException(optional String? errorMessage);
+  }
+
+  public final class AppFunctionPermissionRequiredException extends androidx.appfunctions.AppFunctionAppException {
+    ctor public AppFunctionPermissionRequiredException(optional String? errorMessage);
+  }
+
+  public abstract class AppFunctionRequestException extends androidx.appfunctions.AppFunctionException {
+  }
+
+  @kotlin.annotation.Retention(kotlin.annotation.AnnotationRetention.SOURCE) @kotlin.annotation.Target(allowedTargets=kotlin.annotation.AnnotationTarget.CLASS) public @interface AppFunctionSerializable {
+  }
+
+  public abstract class AppFunctionSystemException extends androidx.appfunctions.AppFunctionException {
+  }
+
+  public final class AppFunctionSystemUnknownException extends androidx.appfunctions.AppFunctionSystemException {
+    ctor public AppFunctionSystemUnknownException(optional String? errorMessage);
+  }
+
+  public final class AppFunctionUnknownException extends androidx.appfunctions.AppFunctionException {
+    ctor public AppFunctionUnknownException(int unknownErrorCode, optional String? errorMessage);
+    method public int getUnknownErrorCode();
+    property public final int unknownErrorCode;
   }
 
 }
diff --git a/appfunctions/appfunctions-common/api/restricted_current.txt b/appfunctions/appfunctions-common/api/restricted_current.txt
index f2cf427..ba35715 100644
--- a/appfunctions/appfunctions-common/api/restricted_current.txt
+++ b/appfunctions/appfunctions-common/api/restricted_current.txt
@@ -1,6 +1,17 @@
 // Signature format: 4.0
 package androidx.appfunctions {
 
+  public abstract class AppFunctionAppException extends androidx.appfunctions.AppFunctionException {
+  }
+
+  public final class AppFunctionAppUnknownException extends androidx.appfunctions.AppFunctionAppException {
+    ctor public AppFunctionAppUnknownException(optional String? errorMessage);
+  }
+
+  public final class AppFunctionCancelledException extends androidx.appfunctions.AppFunctionSystemException {
+    ctor public AppFunctionCancelledException(optional String? errorMessage);
+  }
+
   public interface AppFunctionContext {
     method public String getCallingPackageName();
     method public android.content.pm.SigningInfo getCallingPackageSigningInfo();
@@ -10,53 +21,69 @@
     property public abstract android.content.Context context;
   }
 
-  @kotlin.annotation.Retention(kotlin.annotation.AnnotationRetention.SOURCE) @kotlin.annotation.Target(allowedTargets=kotlin.annotation.AnnotationTarget.CLASS) public @interface AppFunctionEntity {
+  public final class AppFunctionDeniedException extends androidx.appfunctions.AppFunctionRequestException {
+    ctor public AppFunctionDeniedException(optional String? errorMessage);
   }
 
-  public final class AppFunctionException {
+  public final class AppFunctionDisabledException extends androidx.appfunctions.AppFunctionRequestException {
+    ctor public AppFunctionDisabledException(optional String? errorMessage);
+  }
+
+  public final class AppFunctionElementAlreadyExistsException extends androidx.appfunctions.AppFunctionRequestException {
+    ctor public AppFunctionElementAlreadyExistsException(optional String? errorMessage);
+  }
+
+  public final class AppFunctionElementNotFoundException extends androidx.appfunctions.AppFunctionRequestException {
+    ctor public AppFunctionElementNotFoundException(optional String? errorMessage);
+  }
+
+  public abstract class AppFunctionException extends java.lang.Exception {
     ctor public AppFunctionException(int errorCode, optional String? errorMessage);
-    method public int getErrorCategory();
-    method public int getErrorCode();
-    method public String? getErrorMessage();
-    property public final int errorCategory;
-    property public final int errorCode;
+    method public final String? getErrorMessage();
     property public final String? errorMessage;
     field public static final androidx.appfunctions.AppFunctionException.Companion Companion;
-    field public static final int ERROR_APP_UNKNOWN_ERROR = 3000; // 0xbb8
-    field public static final int ERROR_CANCELLED = 2001; // 0x7d1
-    field public static final int ERROR_CATEGORY_APP = 3; // 0x3
-    field public static final int ERROR_CATEGORY_REQUEST_ERROR = 1; // 0x1
-    field public static final int ERROR_CATEGORY_SYSTEM = 2; // 0x2
-    field public static final int ERROR_CATEGORY_UNKNOWN = 0; // 0x0
-    field public static final int ERROR_DENIED = 1000; // 0x3e8
-    field public static final int ERROR_DISABLED = 1002; // 0x3ea
-    field public static final int ERROR_FUNCTION_NOT_FOUND = 1003; // 0x3eb
-    field public static final int ERROR_INVALID_ARGUMENT = 1001; // 0x3e9
-    field public static final int ERROR_LIMIT_EXCEEDED = 1501; // 0x5dd
-    field public static final int ERROR_NOT_SUPPORTED = 3501; // 0xdad
-    field public static final int ERROR_PERMISSION_REQUIRED = 3500; // 0xdac
-    field public static final int ERROR_RESOURCE_ALREADY_EXISTS = 1502; // 0x5de
-    field public static final int ERROR_RESOURCE_NOT_FOUND = 1500; // 0x5dc
-    field public static final int ERROR_SYSTEM_ERROR = 2000; // 0x7d0
   }
 
   public static final class AppFunctionException.Companion {
-    property public static final int ERROR_APP_UNKNOWN_ERROR;
-    property public static final int ERROR_CANCELLED;
-    property public static final int ERROR_CATEGORY_APP;
-    property public static final int ERROR_CATEGORY_REQUEST_ERROR;
-    property public static final int ERROR_CATEGORY_SYSTEM;
-    property public static final int ERROR_CATEGORY_UNKNOWN;
-    property public static final int ERROR_DENIED;
-    property public static final int ERROR_DISABLED;
-    property public static final int ERROR_FUNCTION_NOT_FOUND;
-    property public static final int ERROR_INVALID_ARGUMENT;
-    property public static final int ERROR_LIMIT_EXCEEDED;
-    property public static final int ERROR_NOT_SUPPORTED;
-    property public static final int ERROR_PERMISSION_REQUIRED;
-    property public static final int ERROR_RESOURCE_ALREADY_EXISTS;
-    property public static final int ERROR_RESOURCE_NOT_FOUND;
-    property public static final int ERROR_SYSTEM_ERROR;
+  }
+
+  public final class AppFunctionFunctionNotFoundException extends androidx.appfunctions.AppFunctionRequestException {
+    ctor public AppFunctionFunctionNotFoundException(optional String? errorMessage);
+  }
+
+  public final class AppFunctionInvalidArgumentException extends androidx.appfunctions.AppFunctionRequestException {
+    ctor public AppFunctionInvalidArgumentException(optional String? errorMessage);
+  }
+
+  public final class AppFunctionLimitExceededException extends androidx.appfunctions.AppFunctionRequestException {
+    ctor public AppFunctionLimitExceededException(optional String? errorMessage);
+  }
+
+  public final class AppFunctionNotSupportedException extends androidx.appfunctions.AppFunctionAppException {
+    ctor public AppFunctionNotSupportedException(optional String? errorMessage);
+  }
+
+  public final class AppFunctionPermissionRequiredException extends androidx.appfunctions.AppFunctionAppException {
+    ctor public AppFunctionPermissionRequiredException(optional String? errorMessage);
+  }
+
+  public abstract class AppFunctionRequestException extends androidx.appfunctions.AppFunctionException {
+  }
+
+  @kotlin.annotation.Retention(kotlin.annotation.AnnotationRetention.SOURCE) @kotlin.annotation.Target(allowedTargets=kotlin.annotation.AnnotationTarget.CLASS) public @interface AppFunctionSerializable {
+  }
+
+  public abstract class AppFunctionSystemException extends androidx.appfunctions.AppFunctionException {
+  }
+
+  public final class AppFunctionSystemUnknownException extends androidx.appfunctions.AppFunctionSystemException {
+    ctor public AppFunctionSystemUnknownException(optional String? errorMessage);
+  }
+
+  public final class AppFunctionUnknownException extends androidx.appfunctions.AppFunctionException {
+    ctor public AppFunctionUnknownException(int unknownErrorCode, optional String? errorMessage);
+    method public int getUnknownErrorCode();
+    property public final int unknownErrorCode;
   }
 
 }
diff --git a/appfunctions/appfunctions-common/build.gradle b/appfunctions/appfunctions-common/build.gradle
index f950ea4..7d83505 100644
--- a/appfunctions/appfunctions-common/build.gradle
+++ b/appfunctions/appfunctions-common/build.gradle
@@ -36,6 +36,7 @@
 
     // Internal dependencies
     implementation("androidx.annotation:annotation:1.8.1")
+    implementation("androidx.core:core:1.1.0")
 
     // Compile only dependencies
     compileOnly(project(":appfunctions:appfunctions-stubs"))
diff --git a/appfunctions/appfunctions-common/src/androidTest/java/androidx/appfunctions/AppFunctionAppExceptionsTest.kt b/appfunctions/appfunctions-common/src/androidTest/java/androidx/appfunctions/AppFunctionAppExceptionsTest.kt
new file mode 100644
index 0000000..2172ea5
--- /dev/null
+++ b/appfunctions/appfunctions-common/src/androidTest/java/androidx/appfunctions/AppFunctionAppExceptionsTest.kt
@@ -0,0 +1,40 @@
+/*
+ * Copyright 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 androidx.appfunctions
+
+import com.google.common.truth.Truth.assertThat
+import org.junit.Test
+
+class AppFunctionAppExceptionsTest {
+    @Test
+    fun testErrorCategory_AppError() {
+        assertThat(AppFunctionAppUnknownException().errorCode)
+            .isEqualTo(AppFunctionException.ERROR_APP_UNKNOWN_ERROR)
+        assertThat(AppFunctionAppUnknownException().errorCategory)
+            .isEqualTo(AppFunctionException.ERROR_CATEGORY_APP)
+
+        assertThat(AppFunctionPermissionRequiredException().errorCode)
+            .isEqualTo(AppFunctionException.ERROR_PERMISSION_REQUIRED)
+        assertThat(AppFunctionPermissionRequiredException().errorCategory)
+            .isEqualTo(AppFunctionException.ERROR_CATEGORY_APP)
+
+        assertThat(AppFunctionNotSupportedException().errorCode)
+            .isEqualTo(AppFunctionException.ERROR_NOT_SUPPORTED)
+        assertThat(AppFunctionNotSupportedException().errorCategory)
+            .isEqualTo(AppFunctionException.ERROR_CATEGORY_APP)
+    }
+}
diff --git a/appfunctions/appfunctions-common/src/androidTest/java/androidx/appfunctions/AppFunctionExceptionTest.kt b/appfunctions/appfunctions-common/src/androidTest/java/androidx/appfunctions/AppFunctionExceptionTest.kt
index 7652f91..a8cbef9 100644
--- a/appfunctions/appfunctions-common/src/androidTest/java/androidx/appfunctions/AppFunctionExceptionTest.kt
+++ b/appfunctions/appfunctions-common/src/androidTest/java/androidx/appfunctions/AppFunctionExceptionTest.kt
@@ -17,124 +17,102 @@
 package androidx.appfunctions
 
 import android.os.Bundle
-import com.google.common.truth.Truth
+import com.google.common.truth.Truth.assertThat
 import org.junit.AssumptionViolatedException
 import org.junit.Test
 
 class AppFunctionExceptionTest {
     @Test
-    fun testConstructor_withoutMessageAndExtras() {
-        val exception = AppFunctionException(AppFunctionException.ERROR_DENIED)
-
-        Truth.assertThat(exception.errorCode).isEqualTo(AppFunctionException.ERROR_DENIED)
-        Truth.assertThat(exception.errorMessage).isNull()
-        Truth.assertThat(exception.extras).isEqualTo(Bundle.EMPTY)
-    }
-
-    @Test
-    fun testConstructor_withoutExtras() {
-        val exception = AppFunctionException(AppFunctionException.ERROR_DENIED, "testMessage")
-
-        Truth.assertThat(exception.errorCode).isEqualTo(AppFunctionException.ERROR_DENIED)
-        Truth.assertThat(exception.errorMessage).isEqualTo("testMessage")
-        Truth.assertThat(exception.extras).isEqualTo(Bundle.EMPTY)
-    }
-
-    @Test
-    fun testConstructor() {
-        val extras = Bundle().apply { putString("testKey", "testValue") }
-        val exception =
-            AppFunctionException(AppFunctionException.ERROR_DENIED, "testMessage", extras)
-
-        Truth.assertThat(exception.errorCode).isEqualTo(AppFunctionException.ERROR_DENIED)
-        Truth.assertThat(exception.errorMessage).isEqualTo("testMessage")
-        Truth.assertThat(exception.extras.getString("testKey")).isEqualTo("testValue")
-    }
-
-    @Test
-    fun testErrorCategory_RequestError() {
-        Truth.assertThat(AppFunctionException(AppFunctionException.ERROR_DENIED).errorCategory)
-            .isEqualTo(AppFunctionException.ERROR_CATEGORY_REQUEST_ERROR)
-        Truth.assertThat(
-                AppFunctionException(AppFunctionException.ERROR_INVALID_ARGUMENT).errorCategory
-            )
-            .isEqualTo(AppFunctionException.ERROR_CATEGORY_REQUEST_ERROR)
-        Truth.assertThat(AppFunctionException(AppFunctionException.ERROR_DISABLED).errorCategory)
-            .isEqualTo(AppFunctionException.ERROR_CATEGORY_REQUEST_ERROR)
-        Truth.assertThat(
-                AppFunctionException(AppFunctionException.ERROR_FUNCTION_NOT_FOUND).errorCategory
-            )
-            .isEqualTo(AppFunctionException.ERROR_CATEGORY_REQUEST_ERROR)
-        Truth.assertThat(
-                AppFunctionException(AppFunctionException.ERROR_RESOURCE_NOT_FOUND).errorCategory
-            )
-            .isEqualTo(AppFunctionException.ERROR_CATEGORY_REQUEST_ERROR)
-        Truth.assertThat(
-                AppFunctionException(AppFunctionException.ERROR_LIMIT_EXCEEDED).errorCategory
-            )
-            .isEqualTo(AppFunctionException.ERROR_CATEGORY_REQUEST_ERROR)
-        Truth.assertThat(
-                AppFunctionException(AppFunctionException.ERROR_RESOURCE_ALREADY_EXISTS)
-                    .errorCategory
-            )
-            .isEqualTo(AppFunctionException.ERROR_CATEGORY_REQUEST_ERROR)
-    }
-
-    @Test
-    fun testErrorCategory_SystemError() {
-        Truth.assertThat(
-                AppFunctionException(AppFunctionException.ERROR_SYSTEM_ERROR).errorCategory
-            )
-            .isEqualTo(AppFunctionException.ERROR_CATEGORY_SYSTEM)
-        Truth.assertThat(AppFunctionException(AppFunctionException.ERROR_CANCELLED).errorCategory)
-            .isEqualTo(AppFunctionException.ERROR_CATEGORY_SYSTEM)
-    }
-
-    @Test
-    fun testErrorCategory_AppError() {
-        Truth.assertThat(
-                AppFunctionException(AppFunctionException.ERROR_APP_UNKNOWN_ERROR).errorCategory
-            )
-            .isEqualTo(AppFunctionException.ERROR_CATEGORY_APP)
-        Truth.assertThat(
-                AppFunctionException(AppFunctionException.ERROR_PERMISSION_REQUIRED).errorCategory
-            )
-            .isEqualTo(AppFunctionException.ERROR_CATEGORY_APP)
-        Truth.assertThat(
-                AppFunctionException(AppFunctionException.ERROR_NOT_SUPPORTED).errorCategory
-            )
-            .isEqualTo(AppFunctionException.ERROR_CATEGORY_APP)
-    }
-
-    @Test
     fun testTransformToPlatformExtensionsClass() {
         assumeAppFunctionExtensionLibraryAvailable()
         val extras = Bundle().apply { putString("testKey", "testValue") }
-        val exception =
-            AppFunctionException(AppFunctionException.ERROR_DENIED, "testMessage", extras)
+        val exception = AppFunctionDeniedException("testMessage", extras)
 
         val platformException = exception.toPlatformExtensionsClass()
 
-        Truth.assertThat(platformException.errorCode).isEqualTo(AppFunctionException.ERROR_DENIED)
-        Truth.assertThat(platformException.errorMessage).isEqualTo("testMessage")
-        Truth.assertThat(platformException.extras.getString("testKey")).isEqualTo("testValue")
+        assertThat(platformException.errorCode).isEqualTo(AppFunctionException.ERROR_DENIED)
+        assertThat(platformException.errorMessage).isEqualTo("testMessage")
+        assertThat(platformException.extras.getString("testKey")).isEqualTo("testValue")
     }
 
     @Test
-    fun testCreateFromPlatformExtensionsClass() {
+    fun testCreateFromPlatformExtensionsClass_knownClasses() {
+        assumeAppFunctionExtensionLibraryAvailable()
+
+        testCreateFromPlatformExtensionsClass(
+            AppFunctionException.ERROR_APP_UNKNOWN_ERROR,
+            AppFunctionAppUnknownException::class.java
+        )
+        testCreateFromPlatformExtensionsClass(
+            AppFunctionException.ERROR_PERMISSION_REQUIRED,
+            AppFunctionPermissionRequiredException::class.java
+        )
+        testCreateFromPlatformExtensionsClass(
+            AppFunctionException.ERROR_NOT_SUPPORTED,
+            AppFunctionNotSupportedException::class.java
+        )
+
+        testCreateFromPlatformExtensionsClass(
+            AppFunctionException.ERROR_DENIED,
+            AppFunctionDeniedException::class.java
+        )
+        testCreateFromPlatformExtensionsClass(
+            AppFunctionException.ERROR_INVALID_ARGUMENT,
+            AppFunctionInvalidArgumentException::class.java
+        )
+        testCreateFromPlatformExtensionsClass(
+            AppFunctionException.ERROR_DISABLED,
+            AppFunctionDisabledException::class.java
+        )
+        testCreateFromPlatformExtensionsClass(
+            AppFunctionException.ERROR_FUNCTION_NOT_FOUND,
+            AppFunctionFunctionNotFoundException::class.java
+        )
+        testCreateFromPlatformExtensionsClass(
+            AppFunctionException.ERROR_LIMIT_EXCEEDED,
+            AppFunctionLimitExceededException::class.java
+        )
+        testCreateFromPlatformExtensionsClass(
+            AppFunctionException.ERROR_RESOURCE_ALREADY_EXISTS,
+            AppFunctionElementAlreadyExistsException::class.java
+        )
+
+        testCreateFromPlatformExtensionsClass(
+            AppFunctionException.ERROR_SYSTEM_ERROR,
+            AppFunctionSystemUnknownException::class.java
+        )
+        testCreateFromPlatformExtensionsClass(
+            AppFunctionException.ERROR_CANCELLED,
+            AppFunctionCancelledException::class.java
+        )
+    }
+
+    @Test
+    fun testCreateFromPlatformExtensionsClass_unknownErrorCode() {
+        assumeAppFunctionExtensionLibraryAvailable()
+
+        testCreateFromPlatformExtensionsClass(123456, AppFunctionUnknownException::class.java)
+    }
+
+    private fun <E : AppFunctionException> testCreateFromPlatformExtensionsClass(
+        errorCode: Int,
+        exceptionClass: Class<E>
+    ) {
         assumeAppFunctionExtensionLibraryAvailable()
         val extras = Bundle().apply { putString("testKey", "testValue") }
         val platformException =
             com.android.extensions.appfunctions.AppFunctionException(
-                AppFunctionException.ERROR_DENIED,
+                errorCode,
                 "testMessage",
                 extras
             )
 
         val exception = AppFunctionException.fromPlatformExtensionsClass(platformException)
-        Truth.assertThat(exception.errorCode).isEqualTo(AppFunctionException.ERROR_DENIED)
-        Truth.assertThat(exception.errorMessage).isEqualTo("testMessage")
-        Truth.assertThat(exception.extras.getString("testKey")).isEqualTo("testValue")
+
+        assertThat(exception).isInstanceOf(exceptionClass)
+        assertThat(exception.errorCode).isEqualTo(errorCode)
+        assertThat(exception.errorMessage).isEqualTo("testMessage")
+        assertThat(exception.extras.getString("testKey")).isEqualTo("testValue")
     }
 
     private fun assumeAppFunctionExtensionLibraryAvailable(): Boolean {
diff --git a/appfunctions/appfunctions-common/src/androidTest/java/androidx/appfunctions/AppFunctionRequestExceptionsTest.kt b/appfunctions/appfunctions-common/src/androidTest/java/androidx/appfunctions/AppFunctionRequestExceptionsTest.kt
new file mode 100644
index 0000000..f98c39f
--- /dev/null
+++ b/appfunctions/appfunctions-common/src/androidTest/java/androidx/appfunctions/AppFunctionRequestExceptionsTest.kt
@@ -0,0 +1,60 @@
+/*
+ * Copyright 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 androidx.appfunctions
+
+import com.google.common.truth.Truth.assertThat
+import org.junit.Test
+
+class AppFunctionRequestExceptionsTest {
+    @Test
+    fun testErrorCategory_RequestError() {
+        assertThat(AppFunctionDeniedException().errorCode)
+            .isEqualTo(AppFunctionException.ERROR_DENIED)
+        assertThat(AppFunctionDeniedException().errorCategory)
+            .isEqualTo(AppFunctionException.ERROR_CATEGORY_REQUEST_ERROR)
+
+        assertThat(AppFunctionInvalidArgumentException().errorCode)
+            .isEqualTo(AppFunctionException.ERROR_INVALID_ARGUMENT)
+        assertThat(AppFunctionInvalidArgumentException().errorCategory)
+            .isEqualTo(AppFunctionException.ERROR_CATEGORY_REQUEST_ERROR)
+
+        assertThat(AppFunctionDisabledException().errorCode)
+            .isEqualTo(AppFunctionException.ERROR_DISABLED)
+        assertThat(AppFunctionDisabledException().errorCategory)
+            .isEqualTo(AppFunctionException.ERROR_CATEGORY_REQUEST_ERROR)
+
+        assertThat(AppFunctionFunctionNotFoundException().errorCode)
+            .isEqualTo(AppFunctionException.ERROR_FUNCTION_NOT_FOUND)
+        assertThat(AppFunctionFunctionNotFoundException().errorCategory)
+            .isEqualTo(AppFunctionException.ERROR_CATEGORY_REQUEST_ERROR)
+
+        assertThat(AppFunctionElementNotFoundException().errorCode)
+            .isEqualTo(AppFunctionException.ERROR_RESOURCE_NOT_FOUND)
+        assertThat(AppFunctionElementNotFoundException().errorCategory)
+            .isEqualTo(AppFunctionException.ERROR_CATEGORY_REQUEST_ERROR)
+
+        assertThat(AppFunctionLimitExceededException().errorCode)
+            .isEqualTo(AppFunctionException.ERROR_LIMIT_EXCEEDED)
+        assertThat(AppFunctionLimitExceededException().errorCategory)
+            .isEqualTo(AppFunctionException.ERROR_CATEGORY_REQUEST_ERROR)
+
+        assertThat(AppFunctionElementAlreadyExistsException().errorCode)
+            .isEqualTo(AppFunctionException.ERROR_RESOURCE_ALREADY_EXISTS)
+        assertThat(AppFunctionElementAlreadyExistsException().errorCategory)
+            .isEqualTo(AppFunctionException.ERROR_CATEGORY_REQUEST_ERROR)
+    }
+}
diff --git a/appfunctions/appfunctions-common/src/androidTest/java/androidx/appfunctions/AppFunctionSystemExceptionsTest.kt b/appfunctions/appfunctions-common/src/androidTest/java/androidx/appfunctions/AppFunctionSystemExceptionsTest.kt
new file mode 100644
index 0000000..89ccbf0
--- /dev/null
+++ b/appfunctions/appfunctions-common/src/androidTest/java/androidx/appfunctions/AppFunctionSystemExceptionsTest.kt
@@ -0,0 +1,35 @@
+/*
+ * Copyright 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 androidx.appfunctions
+
+import com.google.common.truth.Truth.assertThat
+import org.junit.Test
+
+class AppFunctionSystemExceptionsTest {
+    @Test
+    fun testErrorCategory_SystemError() {
+        assertThat(AppFunctionSystemUnknownException().errorCode)
+            .isEqualTo(AppFunctionException.ERROR_SYSTEM_ERROR)
+        assertThat(AppFunctionSystemUnknownException().errorCategory)
+            .isEqualTo(AppFunctionException.ERROR_CATEGORY_SYSTEM)
+
+        assertThat(AppFunctionCancelledException().errorCode)
+            .isEqualTo(AppFunctionException.ERROR_CANCELLED)
+        assertThat(AppFunctionCancelledException().errorCategory)
+            .isEqualTo(AppFunctionException.ERROR_CATEGORY_SYSTEM)
+    }
+}
diff --git a/appfunctions/appfunctions-common/src/main/java/androidx/appfunctions/AppFunctionAppExceptions.kt b/appfunctions/appfunctions-common/src/main/java/androidx/appfunctions/AppFunctionAppExceptions.kt
new file mode 100644
index 0000000..441c6bb
--- /dev/null
+++ b/appfunctions/appfunctions-common/src/main/java/androidx/appfunctions/AppFunctionAppExceptions.kt
@@ -0,0 +1,71 @@
+/*
+ * Copyright 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 androidx.appfunctions
+
+import android.os.Bundle
+
+/**
+ * Thrown when an error is caused by the app providing the function.
+ *
+ * <p>For example, the app crashed when the system is executing the request.
+ */
+public abstract class AppFunctionAppException
+internal constructor(errorCode: Int, errorMessage: String? = null, extras: Bundle) :
+    AppFunctionException(errorCode, errorMessage, extras)
+
+/**
+ * Thrown when an unknown error occurred while processing the call in the AppFunctionService.
+ *
+ * <p>This error is thrown when the service is connected in the remote application but an unexpected
+ * error is thrown from the bound application.
+ */
+public class AppFunctionAppUnknownException
+internal constructor(errorMessage: String? = null, extras: Bundle) :
+    AppFunctionAppException(ERROR_APP_UNKNOWN_ERROR, errorMessage, extras) {
+
+    public constructor(errorMessage: String? = null) : this(errorMessage, Bundle.EMPTY)
+}
+
+/**
+ * Thrown when the app lacks the necessary permission to fulfill the request.
+ *
+ * <p>This occurs when the app attempts an operation requiring user-granted permission that has not
+ * been provided. For example, creating a calendar event requires access to the calendar content. If
+ * the user hasn't granted this permission, this error should be thrown.
+ *
+ * <p> This is different from [AppFunctionDeniedException] in that the required permission is
+ * missing from the target app, as opposed to the caller.
+ */
+public class AppFunctionPermissionRequiredException
+internal constructor(errorMessage: String? = null, extras: Bundle) :
+    AppFunctionAppException(ERROR_PERMISSION_REQUIRED, errorMessage, extras) {
+
+    public constructor(errorMessage: String? = null) : this(errorMessage, Bundle.EMPTY)
+}
+
+/**
+ * Thrown when an app receives a request to perform an unsupported action.
+ *
+ * <p>For example, a clock app might support updating timer properties such as label but may not
+ * allow updating the timer's duration once the timer has already started.
+ */
+public class AppFunctionNotSupportedException
+internal constructor(errorMessage: String? = null, extras: Bundle) :
+    AppFunctionAppException(ERROR_NOT_SUPPORTED, errorMessage, extras) {
+
+    public constructor(errorMessage: String? = null) : this(errorMessage, Bundle.EMPTY)
+}
diff --git a/appfunctions/appfunctions-common/src/main/java/androidx/appfunctions/AppFunctionException.kt b/appfunctions/appfunctions-common/src/main/java/androidx/appfunctions/AppFunctionException.kt
index cf82d12..e273dd4 100644
--- a/appfunctions/appfunctions-common/src/main/java/androidx/appfunctions/AppFunctionException.kt
+++ b/appfunctions/appfunctions-common/src/main/java/androidx/appfunctions/AppFunctionException.kt
@@ -25,14 +25,14 @@
  *
  * This exception can be used by the app to report errors to the caller.
  */
-public class AppFunctionException
+public abstract class AppFunctionException
 internal constructor(
     /** The error code. */
-    @ErrorCode public val errorCode: Int,
+    @ErrorCode internal val errorCode: Int,
     /** The error message. */
     public val errorMessage: String?,
     internal val extras: Bundle
-) {
+) : Exception(errorMessage) {
     /**
      * Create an [AppFunctionException].
      *
@@ -65,7 +65,7 @@
      * error category.
      */
     @ErrorCategory
-    public val errorCategory: Int =
+    internal val errorCategory: Int =
         when (errorCode) {
             in 1000..1999 -> ERROR_CATEGORY_REQUEST_ERROR
             in 2000..2999 -> ERROR_CATEGORY_SYSTEM
@@ -109,16 +109,45 @@
         public fun fromPlatformExtensionsClass(
             exception: com.android.extensions.appfunctions.AppFunctionException
         ): AppFunctionException {
-            return AppFunctionException(
-                exception.errorCode,
-                exception.errorMessage,
-                exception.extras
-            )
+            return when (exception.errorCode) {
+                ERROR_DENIED -> AppFunctionDeniedException(exception.errorMessage, exception.extras)
+                ERROR_INVALID_ARGUMENT ->
+                    AppFunctionInvalidArgumentException(exception.errorMessage, exception.extras)
+                ERROR_DISABLED ->
+                    AppFunctionDisabledException(exception.errorMessage, exception.extras)
+                ERROR_FUNCTION_NOT_FOUND ->
+                    AppFunctionFunctionNotFoundException(exception.errorMessage, exception.extras)
+                ERROR_RESOURCE_NOT_FOUND ->
+                    AppFunctionElementNotFoundException(exception.errorMessage, exception.extras)
+                ERROR_LIMIT_EXCEEDED ->
+                    AppFunctionLimitExceededException(exception.errorMessage, exception.extras)
+                ERROR_RESOURCE_ALREADY_EXISTS ->
+                    AppFunctionElementAlreadyExistsException(
+                        exception.errorMessage,
+                        exception.extras
+                    )
+                ERROR_SYSTEM_ERROR ->
+                    AppFunctionSystemUnknownException(exception.errorMessage, exception.extras)
+                ERROR_CANCELLED ->
+                    AppFunctionCancelledException(exception.errorMessage, exception.extras)
+                ERROR_APP_UNKNOWN_ERROR ->
+                    AppFunctionAppUnknownException(exception.errorMessage, exception.extras)
+                ERROR_PERMISSION_REQUIRED ->
+                    AppFunctionPermissionRequiredException(exception.errorMessage, exception.extras)
+                ERROR_NOT_SUPPORTED ->
+                    AppFunctionNotSupportedException(exception.errorMessage, exception.extras)
+                else ->
+                    AppFunctionUnknownException(
+                        exception.errorCode,
+                        exception.errorMessage,
+                        exception.extras,
+                    )
+            }
         }
 
         // Error categories
         /** The error category is unknown. */
-        public const val ERROR_CATEGORY_UNKNOWN: Int = 0
+        internal const val ERROR_CATEGORY_UNKNOWN: Int = 0
 
         /**
          * The error is caused by the app requesting a function execution.
@@ -128,7 +157,7 @@
          *
          * <p>Errors in the category fall in the range 1000-1999 inclusive.
          */
-        public const val ERROR_CATEGORY_REQUEST_ERROR: Int = 1
+        internal const val ERROR_CATEGORY_REQUEST_ERROR: Int = 1
 
         /**
          * The error is caused by an issue in the system.
@@ -137,7 +166,7 @@
          *
          * <p>Errors in the category fall in the range 2000-2999 inclusive.
          */
-        public const val ERROR_CATEGORY_SYSTEM: Int = 2
+        internal const val ERROR_CATEGORY_SYSTEM: Int = 2
 
         /**
          * The error is caused by the app providing the function.
@@ -146,15 +175,18 @@
          *
          * <p>Errors in the category fall in the range 3000-3999 inclusive.
          */
-        public const val ERROR_CATEGORY_APP: Int = 3
+        internal const val ERROR_CATEGORY_APP: Int = 3
 
         // Error codes
         /**
          * The caller does not have the permission to execute an app function.
          *
+         * <p> This is different from [ERROR_PERMISSION_REQUIRED] in that the caller is missing this
+         * specific permission, as opposed to the target app missing a permission.
+         *
          * <p>This error is in the [ERROR_CATEGORY_REQUEST_ERROR] category.
          */
-        public const val ERROR_DENIED: Int = 1000
+        internal const val ERROR_DENIED: Int = 1000
 
         /**
          * The caller supplied invalid arguments to the execution request.
@@ -163,21 +195,21 @@
          *
          * <p>This error is in the [ERROR_CATEGORY_REQUEST_ERROR] category.
          */
-        public const val ERROR_INVALID_ARGUMENT: Int = 1001
+        internal const val ERROR_INVALID_ARGUMENT: Int = 1001
 
         /**
          * The caller tried to execute a disabled app function.
          *
          * <p>This error is in the [ERROR_CATEGORY_REQUEST_ERROR] category.
          */
-        public const val ERROR_DISABLED: Int = 1002
+        internal const val ERROR_DISABLED: Int = 1002
 
         /**
          * The caller tried to execute a function that does not exist.
          *
          * <p>This error is in the [ERROR_CATEGORY_REQUEST_ERROR] category.
          */
-        public const val ERROR_FUNCTION_NOT_FOUND: Int = 1003
+        internal const val ERROR_FUNCTION_NOT_FOUND: Int = 1003
 
         // SDK-defined error codes in the [ERROR_CATEGORY_REQUEST_ERROR] category start from 1500.
         /**
@@ -185,14 +217,14 @@
          *
          * <p>This error is in the [ERROR_CATEGORY_REQUEST_ERROR] category.
          */
-        public const val ERROR_RESOURCE_NOT_FOUND: Int = 1500
+        internal const val ERROR_RESOURCE_NOT_FOUND: Int = 1500
 
         /**
          * The caller exceeded the allowed request rate.
          *
          * <p>This error is in the [ERROR_CATEGORY_REQUEST_ERROR] category.
          */
-        public const val ERROR_LIMIT_EXCEEDED: Int = 1501
+        internal const val ERROR_LIMIT_EXCEEDED: Int = 1501
 
         /**
          * The caller tried to create a resource/entity that already exists or has conflicts with
@@ -200,14 +232,14 @@
          *
          * <p>This error is in the [ERROR_CATEGORY_REQUEST_ERROR] category.
          */
-        public const val ERROR_RESOURCE_ALREADY_EXISTS: Int = 1502
+        internal const val ERROR_RESOURCE_ALREADY_EXISTS: Int = 1502
 
         /**
          * An internal unexpected error coming from the system.
          *
          * <p>This error is in the [ERROR_CATEGORY_SYSTEM] category.
          */
-        public const val ERROR_SYSTEM_ERROR: Int = 2000
+        internal const val ERROR_SYSTEM_ERROR: Int = 2000
 
         /**
          * The operation was cancelled. Use this error code to report that a cancellation is done
@@ -215,7 +247,7 @@
          *
          * <p>This error is in the [ERROR_CATEGORY_SYSTEM] category.
          */
-        public const val ERROR_CANCELLED: Int = 2001
+        internal const val ERROR_CANCELLED: Int = 2001
 
         /**
          * An unknown error occurred while processing the call in the AppFunctionService.
@@ -225,7 +257,7 @@
          *
          * <p>This error is in the [ERROR_CATEGORY_APP] category.
          */
-        public const val ERROR_APP_UNKNOWN_ERROR: Int = 3000
+        internal const val ERROR_APP_UNKNOWN_ERROR: Int = 3000
 
         // SDK-defined error codes in the [ERROR_CATEGORY_APP] category start from 3500.
         /**
@@ -236,9 +268,12 @@
          * calendar content. If the user hasn't granted this permission, this error should be
          * thrown.
          *
+         * <p> This is different from [ERROR_DENIED] in that the required permission is missing from
+         * the target app, as opposed to the caller.
+         *
          * <p>This error is in the [ERROR_CATEGORY_APP] category.
          */
-        public const val ERROR_PERMISSION_REQUIRED: Int = 3500
+        internal const val ERROR_PERMISSION_REQUIRED: Int = 3500
 
         /**
          * Indicates the action is not supported by the app.
@@ -249,6 +284,25 @@
          *
          * <p>This error is in the [ERROR_CATEGORY_APP] category.
          */
-        public const val ERROR_NOT_SUPPORTED: Int = 3501
+        internal const val ERROR_NOT_SUPPORTED: Int = 3501
     }
 }
+
+/**
+ * Thrown when an unknown error has occurred.
+ *
+ * <p> This Exception is used when the error doesn't belong to any other AppFunctionException. Note
+ * that this different from [AppFunctionAppUnknownException], in that the error wasn't necessarily
+ * caused by the app.
+ */
+public class AppFunctionUnknownException
+internal constructor(
+    public val unknownErrorCode: Int,
+    errorMessage: String? = null,
+    extras: Bundle
+) : AppFunctionException(unknownErrorCode, errorMessage, extras) {
+    public constructor(
+        unknownErrorCode: Int,
+        errorMessage: String? = null
+    ) : this(unknownErrorCode, errorMessage, Bundle.EMPTY)
+}
diff --git a/appfunctions/appfunctions-common/src/main/java/androidx/appfunctions/AppFunctionRequestExceptions.kt b/appfunctions/appfunctions-common/src/main/java/androidx/appfunctions/AppFunctionRequestExceptions.kt
new file mode 100644
index 0000000..fc16714
--- /dev/null
+++ b/appfunctions/appfunctions-common/src/main/java/androidx/appfunctions/AppFunctionRequestExceptions.kt
@@ -0,0 +1,103 @@
+/*
+ * Copyright 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 androidx.appfunctions
+
+import android.os.Bundle
+
+/**
+ * Thrown when the error is caused by the app requesting a function execution.
+ *
+ * <p>For example, the caller provided invalid parameters in the execution request e.g. an invalid
+ * function ID.
+ */
+public abstract class AppFunctionRequestException
+internal constructor(errorCode: Int, errorMessage: String? = null, extras: Bundle) :
+    AppFunctionException(errorCode, errorMessage, extras)
+
+/**
+ * Thrown when the caller does not have the permission to execute an app function.
+ *
+ * <p> This is different from [AppFunctionPermissionRequiredException] in that the caller is missing
+ * this specific permission, as opposed to the target app missing a permission.
+ */
+public class AppFunctionDeniedException
+internal constructor(errorMessage: String? = null, extras: Bundle) :
+    AppFunctionRequestException(ERROR_DENIED, errorMessage, extras) {
+
+    public constructor(errorMessage: String? = null) : this(errorMessage, Bundle.EMPTY)
+}
+
+/**
+ * Thrown when the caller supplied invalid arguments to ExecuteAppFunctionRequest's parameters.
+ *
+ * <p>This error may be considered similar to [IllegalArgumentException].
+ */
+// TODO(b/389738031): add reference to ExecuteAppFunctionRequest's builder when it is added.
+public class AppFunctionInvalidArgumentException
+internal constructor(errorMessage: String? = null, extras: Bundle) :
+    AppFunctionRequestException(ERROR_INVALID_ARGUMENT, errorMessage, extras) {
+
+    public constructor(errorMessage: String? = null) : this(errorMessage, Bundle.EMPTY)
+}
+
+/**
+ * Thrown when the caller tried to execute a disabled app function. An app function can be enabled
+ * at runtime through the AppFunctionManager or by setting enabledByDefault=true in the AppFunction
+ * annotation.
+ */
+// TODO(b/389738031): add reference to setAppFunctionEnabled and @AppFunction when they are added.
+public class AppFunctionDisabledException
+internal constructor(errorMessage: String? = null, extras: Bundle) :
+    AppFunctionRequestException(ERROR_DISABLED, errorMessage, extras) {
+
+    public constructor(errorMessage: String? = null) : this(errorMessage, Bundle.EMPTY)
+}
+
+/** Thrown when the caller tries to execute a function that does not exist. */
+public class AppFunctionFunctionNotFoundException
+internal constructor(errorMessage: String? = null, extras: Bundle) :
+    AppFunctionRequestException(ERROR_FUNCTION_NOT_FOUND, errorMessage, extras) {
+
+    public constructor(errorMessage: String? = null) : this(errorMessage, Bundle.EMPTY)
+}
+
+/** Thrown when the caller tried to request a resource/entity that does not exist. */
+public class AppFunctionElementNotFoundException
+internal constructor(errorMessage: String? = null, extras: Bundle) :
+    AppFunctionRequestException(ERROR_RESOURCE_NOT_FOUND, errorMessage, extras) {
+
+    public constructor(errorMessage: String? = null) : this(errorMessage, Bundle.EMPTY)
+}
+
+/** Thrown when the caller exceeded the allowed request rate. */
+public class AppFunctionLimitExceededException
+internal constructor(errorMessage: String? = null, extras: Bundle) :
+    AppFunctionRequestException(ERROR_LIMIT_EXCEEDED, errorMessage, extras) {
+
+    public constructor(errorMessage: String? = null) : this(errorMessage, Bundle.EMPTY)
+}
+
+/**
+ * Thrown when the caller tried to create a resource/entity that already exists or has conflicts
+ * with existing resource/entity.
+ */
+public class AppFunctionElementAlreadyExistsException
+internal constructor(errorMessage: String? = null, extras: Bundle) :
+    AppFunctionRequestException(ERROR_RESOURCE_ALREADY_EXISTS, errorMessage, extras) {
+
+    public constructor(errorMessage: String? = null) : this(errorMessage, Bundle.EMPTY)
+}
diff --git a/appfunctions/appfunctions-common/src/main/java/androidx/appfunctions/AppFunctionEntity.kt b/appfunctions/appfunctions-common/src/main/java/androidx/appfunctions/AppFunctionSerializable.kt
similarity index 78%
rename from appfunctions/appfunctions-common/src/main/java/androidx/appfunctions/AppFunctionEntity.kt
rename to appfunctions/appfunctions-common/src/main/java/androidx/appfunctions/AppFunctionSerializable.kt
index 29eb0c7..4688942 100644
--- a/appfunctions/appfunctions-common/src/main/java/androidx/appfunctions/AppFunctionEntity.kt
+++ b/appfunctions/appfunctions-common/src/main/java/androidx/appfunctions/AppFunctionSerializable.kt
@@ -17,16 +17,17 @@
 package androidx.appfunctions
 
 /**
- * Annotates a class intended to represent structured input or output for an AppFunction.
+ * Annotates a class to indicate that it can be serialized and transferred between processes using
+ * AppFunction.
  *
- * When a class is annotated with `@AppFunctionEntity` and is used as a parameter or return type
- * (directly or as a nested entity) in an AppFunction, the shape of the entity defined within its
- * primary constructor will be exposed to the caller as an
+ * When a class is annotated with `@AppFunctionSerializable` and is used as a parameter or return
+ * type (directly or as a nested entity) in an AppFunction, the shape of the entity defined within
+ * its primary constructor will be exposed to the caller as an
  * [androidx.appfunctions.metadata.AppFunctionMetadata]. This information allows the caller to
  * construct the structure input to call an AppFunction or understand what properties are provided
  * in the structured output.
  *
- * **Constraints for Classes Annotated with `@AppFunctionEntity`:**
+ * **Constraints for Classes Annotated with `@AppFunctionSerializable`:**
  * * **Primary Constructor Parameters:** Only properties declared in the primary constructor that
  *   expose a getter method are eligible for inclusion in the AppFunctionMetadata. Critically, it is
  *   a **requirement** to place properties with a getter in primary constructor. Attempting to
@@ -47,8 +48,8 @@
  *     * `BooleanArray`
  *     * `ByteArray`
  *     * `List<String>`
- *     * Another class annotated with `@AppFunctionEntity` (enabling nested structures) or a list of
- *       a class annotated with `@AppFunctionEntity`
+ *     * Another class annotated with `@AppFunctionSerializable` (enabling nested structures) or a
+ *       list of a class annotated with `@AppFunctionSerializable`
  * * **Public Primary Constructor:** The primary constructor of the annotated class must have public
  *   visibility to allow instantiation.
  * * **
@@ -64,24 +65,24 @@
  * **Example:**
  *
  * ```
- * @AppFunctionEntity
+ * @AppFunctionSerializable
  * class Location(val latitude: Double, val longitude: Double)
  *
- * @AppFunctionEntity
+ * @AppFunctionSerializable
  * class Place(
  *     val name: String,
- *     val location: Location, // Nested AppFunctionEntity
+ *     val location: Location, // Nested AppFunctionSerializable
  *     // Nullable String is allowed, if missing, will be null. The default value will not be used
  *     // when the value is missing
  *     val notes: String? = "default"
  * )
  *
- * @AppFunctionEntity
+ * @AppFunctionSerializable
  * class SearchPlaceResult(
  *     val places: List<Place> // If missing, will be an empty list
  * )
  *
- * @AppFunctionEntity
+ * @AppFunctionSerializable
  * class Attachment(
  *   uri: String // Putting constructor parameter without getter will result in compiler error
  * )
@@ -89,4 +90,4 @@
  */
 @Retention(AnnotationRetention.SOURCE)
 @Target(AnnotationTarget.CLASS)
-public annotation class AppFunctionEntity
+public annotation class AppFunctionSerializable
diff --git a/appfunctions/appfunctions-common/src/main/java/androidx/appfunctions/AppFunctionSystemExceptions.kt b/appfunctions/appfunctions-common/src/main/java/androidx/appfunctions/AppFunctionSystemExceptions.kt
new file mode 100644
index 0000000..66596b4
--- /dev/null
+++ b/appfunctions/appfunctions-common/src/main/java/androidx/appfunctions/AppFunctionSystemExceptions.kt
@@ -0,0 +1,48 @@
+/*
+ * Copyright 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 androidx.appfunctions
+
+import android.os.Bundle
+
+/**
+ * Thrown when an internal unexpected error comes from the system.
+ *
+ * <p>For example, the AppFunctionService implementation is not found by the system.
+ */
+public abstract class AppFunctionSystemException
+internal constructor(errorCode: Int, errorMessage: String? = null, extras: Bundle) :
+    AppFunctionException(errorCode, errorMessage, extras)
+
+/**
+ * Thrown when an internal unexpected error comes from the system.
+ *
+ * <p>For example, the AppFunctionService implementation is not found by the system.
+ */
+public class AppFunctionSystemUnknownException
+internal constructor(errorMessage: String? = null, extras: Bundle) :
+    AppFunctionSystemException(ERROR_SYSTEM_ERROR, errorMessage, extras) {
+
+    public constructor(errorMessage: String? = null) : this(errorMessage, Bundle.EMPTY)
+}
+
+/** Thrown when an operation was cancelled. */
+public class AppFunctionCancelledException
+internal constructor(errorMessage: String? = null, extras: Bundle) :
+    AppFunctionSystemException(ERROR_CANCELLED, errorMessage, extras) {
+
+    public constructor(errorMessage: String? = null) : this(errorMessage, Bundle.EMPTY)
+}
diff --git a/appsearch/appsearch-local-storage/src/androidTest/java/androidx/appsearch/localstorage/AppSearchImplTest.java b/appsearch/appsearch-local-storage/src/androidTest/java/androidx/appsearch/localstorage/AppSearchImplTest.java
index 898e680..724fb0b 100644
--- a/appsearch/appsearch-local-storage/src/androidTest/java/androidx/appsearch/localstorage/AppSearchImplTest.java
+++ b/appsearch/appsearch-local-storage/src/androidTest/java/androidx/appsearch/localstorage/AppSearchImplTest.java
@@ -110,6 +110,7 @@
 import org.junit.rules.TemporaryFolder;
 
 import java.io.File;
+import java.io.FileOutputStream;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
@@ -2300,6 +2301,42 @@
 
     @Test
     @RequiresFlagsEnabled(Flags.FLAG_ENABLE_BLOB_STORE)
+    public void testWriteAfterCommit_notAllowed() throws Exception {
+        mAppSearchImpl = AppSearchImpl.create(
+                mAppSearchDir,
+                new AppSearchConfigImpl(new UnlimitedLimitConfig(),
+                        new LocalStorageIcingOptionsConfig()),
+                /*initStatsBuilder=*/ null,
+                /*visibilityChecker=*/ null,
+                new JetpackRevocableFileDescriptorStore(mUnlimitedConfig),
+                ALWAYS_OPTIMIZE);
+        byte[] data = generateRandomBytes(20 * 1024); // 20 KiB
+        byte[] digest = calculateDigest(data);
+        AppSearchBlobHandle handle = AppSearchBlobHandle.createWithSha256(
+                digest, "package", "db1", "ns");
+        // Open a pfd for write, write the blob data without close the pfd.
+        ParcelFileDescriptor writePfd = mAppSearchImpl.openWriteBlob("package", "db1", handle);
+        try (FileOutputStream outputStream = new FileOutputStream(writePfd.getFileDescriptor())) {
+            outputStream.write(data);
+            outputStream.flush();
+        }
+
+        // Commit the blob.
+        mAppSearchImpl.commitBlob("package", "db1", handle);
+
+        // Keep writing to the pfd for write.
+        assertThrows(IOException.class,
+                () -> {
+                try (FileOutputStream outputStream =
+                         new FileOutputStream(writePfd.getFileDescriptor())) {
+                    outputStream.write(data);
+                    outputStream.flush();
+                }
+            });
+    }
+
+    @Test
+    @RequiresFlagsEnabled(Flags.FLAG_ENABLE_BLOB_STORE)
     public void testRemovePendingBlob() throws Exception {
         mAppSearchImpl = AppSearchImpl.create(
                 mAppSearchDir,
@@ -2470,6 +2507,66 @@
 
     @Test
     @RequiresFlagsEnabled(Flags.FLAG_ENABLE_BLOB_STORE)
+    public void testOpenMultipleBlobForWrite() throws Exception {
+        mAppSearchImpl = AppSearchImpl.create(
+                mAppSearchDir,
+                new AppSearchConfigImpl(new UnlimitedLimitConfig(),
+                        new LocalStorageIcingOptionsConfig()),
+                /*initStatsBuilder=*/ null,
+                /*visibilityChecker=*/ null,
+                new JetpackRevocableFileDescriptorStore(mUnlimitedConfig),
+                ALWAYS_OPTIMIZE);
+        byte[] data = generateRandomBytes(20); // 20 Bytes
+        byte[] digest = calculateDigest(data);
+        AppSearchBlobHandle handle = AppSearchBlobHandle.createWithSha256(
+                digest, "package", "db1", "ns");
+
+        // only allow open 1 fd for writing.
+        try (ParcelFileDescriptor writePfd1 =
+                     mAppSearchImpl.openWriteBlob("package", "db1", handle);
+                ParcelFileDescriptor writePfd2 =
+                        mAppSearchImpl.openWriteBlob("package", "db1", handle)) {
+            assertThat(writePfd1).isEqualTo(writePfd2);
+        }
+    }
+
+    @Test
+    @RequiresFlagsEnabled(Flags.FLAG_ENABLE_BLOB_STORE)
+    public void testOpenMultipleBlobForRead() throws Exception {
+        mAppSearchImpl = AppSearchImpl.create(
+                mAppSearchDir,
+                new AppSearchConfigImpl(new UnlimitedLimitConfig(),
+                        new LocalStorageIcingOptionsConfig()),
+                /*initStatsBuilder=*/ null,
+                /*visibilityChecker=*/ null,
+                new JetpackRevocableFileDescriptorStore(mUnlimitedConfig),
+                ALWAYS_OPTIMIZE);
+        byte[] data = generateRandomBytes(20); // 20 Bytes
+        byte[] digest = calculateDigest(data);
+        AppSearchBlobHandle handle = AppSearchBlobHandle.createWithSha256(
+                digest, "package", "db1", "ns");
+
+        // write a blob first.
+        try (ParcelFileDescriptor writePfd = mAppSearchImpl.openWriteBlob("package", "db1", handle);
+                OutputStream outputStream = new ParcelFileDescriptor
+                        .AutoCloseOutputStream(writePfd)) {
+            outputStream.write(data);
+            outputStream.flush();
+        }
+        // commit the change and read the blob.
+        mAppSearchImpl.commitBlob("package", "db1", handle);
+
+        // allow open multiple fd for reading.
+        try (ParcelFileDescriptor readPfd1 =
+                     mAppSearchImpl.openReadBlob("package", "db1", handle);
+                ParcelFileDescriptor readPfd2 =
+                        mAppSearchImpl.openReadBlob("package", "db1", handle)) {
+            assertThat(readPfd1).isNotEqualTo(readPfd2);
+        }
+    }
+
+    @Test
+    @RequiresFlagsEnabled(Flags.FLAG_ENABLE_BLOB_STORE)
     public void testOptimizeBlob() throws Exception {
         // Create a new AppSearchImpl with lower orphan blob time to live.
         mAppSearchImpl.close();
@@ -6110,6 +6207,19 @@
                         + "descriptors. Some file descriptors must be closed to open additional "
                         + "ones.");
 
+        // Open new fd for write will also fail since read and write share the same limit.
+        byte[] data2 = generateRandomBytes(20 * 1024); // 20 KiB
+        byte[] digest2 = calculateDigest(data2);
+        AppSearchBlobHandle handle2 = AppSearchBlobHandle.createWithSha256(
+                digest2, mContext.getPackageName(), "db1", "ns");
+        e = assertThrows(AppSearchException.class,
+                () -> mAppSearchImpl.openWriteBlob(mContext.getPackageName(), "db1", handle2));
+        assertThat(e.getResultCode()).isEqualTo(RESULT_OUT_OF_SPACE);
+        assertThat(e).hasMessageThat().contains(
+                "Package \"" + mContext.getPackageName() + "\" exceeded limit of 2 opened file "
+                        + "descriptors. Some file descriptors must be closed to open additional "
+                        + "ones.");
+
         // Close 1st fd and open 3rd fd will success
         reader1.close();
         ParcelFileDescriptor reader3 =
diff --git a/appsearch/appsearch-local-storage/src/main/java/androidx/appsearch/localstorage/AppSearchImpl.java b/appsearch/appsearch-local-storage/src/main/java/androidx/appsearch/localstorage/AppSearchImpl.java
index 1dfb53a..4dbbaf5 100644
--- a/appsearch/appsearch-local-storage/src/main/java/androidx/appsearch/localstorage/AppSearchImpl.java
+++ b/appsearch/appsearch-local-storage/src/main/java/androidx/appsearch/localstorage/AppSearchImpl.java
@@ -31,6 +31,7 @@
 import android.util.Log;
 
 import androidx.annotation.GuardedBy;
+import androidx.annotation.OptIn;
 import androidx.annotation.RestrictTo;
 import androidx.annotation.VisibleForTesting;
 import androidx.annotation.WorkerThread;
@@ -248,6 +249,7 @@
     @GuardedBy("mReadWriteLock")
     private int mOptimizeIntervalCountLocked = 0;
 
+    @ExperimentalAppSearchApi
     private final @Nullable RevocableFileDescriptorStore mRevocableFileDescriptorStore;
 
     /** Whether this instance has been closed, and therefore unusable. */
@@ -270,6 +272,7 @@
      *                          access to aa specific schema. Pass null will lost that ability and
      *                          global querier could only get their own data.
      */
+    @OptIn(markerClass = ExperimentalAppSearchApi.class)
     public static @NonNull AppSearchImpl create(
             @NonNull File icingDir,
             @NonNull AppSearchConfig config,
@@ -285,6 +288,7 @@
     /**
      * @param initStatsBuilder collects stats for initialization if provided.
      */
+    @OptIn(markerClass = ExperimentalAppSearchApi.class)
     private AppSearchImpl(
             @NonNull File icingDir,
             @NonNull AppSearchConfig config,
@@ -481,6 +485,7 @@
      * create a new, usable instance.
      */
     @Override
+    @OptIn(markerClass = ExperimentalAppSearchApi.class)
     public void close() {
         mReadWriteLock.writeLock().lock();
         try {
@@ -1145,6 +1150,10 @@
      * Gets the {@link ParcelFileDescriptor} for write purpose of the given
      * {@link AppSearchBlobHandle}.
      *
+     * <p> Only one opened {@link ParcelFileDescriptor} is allowed for each
+     * {@link AppSearchBlobHandle}. The same {@link ParcelFileDescriptor} will be returned if it is
+     * not closed by caller.
+     *
      * @param packageName    The package name that owns this blob.
      * @param databaseName   The databaseName this blob resides in.
      * @param handle         The {@link AppSearchBlobHandle} represent the blob.
@@ -1163,19 +1172,26 @@
         try {
             throwIfClosedLocked();
             verifyCallingBlobHandle(packageName, databaseName, handle);
+            ParcelFileDescriptor pfd = mRevocableFileDescriptorStore
+                    .getOpenedRevocableFileDescriptorForWrite(packageName, handle);
+            if (pfd != null) {
+                // There is already an opened pfd for write with same blob handle, just return the
+                // already opened one.
+                return pfd;
+            }
             mRevocableFileDescriptorStore.checkBlobStoreLimit(packageName);
             PropertyProto.BlobHandleProto blobHandleProto =
                     BlobHandleToProtoConverter.toBlobHandleProto(handle);
             BlobProto result = mIcingSearchEngineLocked.openWriteBlob(blobHandleProto);
 
             checkSuccess(result.getStatus());
-            ParcelFileDescriptor pfd = ParcelFileDescriptor.adoptFd(result.getFileDescriptor());
+            pfd = ParcelFileDescriptor.adoptFd(result.getFileDescriptor());
 
             mNamespaceCacheLocked.addToBlobNamespaceMap(createPrefix(packageName, databaseName),
                     blobHandleProto.getNamespace());
 
-            return mRevocableFileDescriptorStore
-                    .wrapToRevocableFileDescriptor(handle.getPackageName(), pfd);
+            return mRevocableFileDescriptorStore.wrapToRevocableFileDescriptor(
+                    packageName, handle, pfd, ParcelFileDescriptor.MODE_READ_WRITE);
         } finally {
             mReadWriteLock.writeLock().unlock();
         }
@@ -1211,6 +1227,7 @@
                     BlobHandleToProtoConverter.toBlobHandleProto(handle));
 
             checkSuccess(result.getStatus());
+            mRevocableFileDescriptorStore.revokeFdForWrite(packageName, handle);
         } finally {
             mReadWriteLock.writeLock().unlock();
         }
@@ -1230,7 +1247,7 @@
     public void commitBlob(
             @NonNull String packageName,
             @NonNull String databaseName,
-            @NonNull AppSearchBlobHandle handle) throws AppSearchException {
+            @NonNull AppSearchBlobHandle handle) throws AppSearchException, IOException {
         if (mRevocableFileDescriptorStore == null) {
             throw new UnsupportedOperationException(
                     "BLOB_STORAGE is not available on this AppSearch implementation.");
@@ -1243,6 +1260,8 @@
                     BlobHandleToProtoConverter.toBlobHandleProto(handle));
 
             checkSuccess(result.getStatus());
+            // The blob is committed and sealed, revoke the sent pfd for writing.
+            mRevocableFileDescriptorStore.revokeFdForWrite(packageName, handle);
         } finally {
             mReadWriteLock.writeLock().unlock();
         }
@@ -1280,7 +1299,10 @@
             checkSuccess(result.getStatus());
 
             ParcelFileDescriptor pfd = ParcelFileDescriptor.fromFd(result.getFileDescriptor());
-            return mRevocableFileDescriptorStore.wrapToRevocableFileDescriptor(packageName, pfd);
+            // We do NOT need to look up the revocable file descriptor for read, skip passing the
+            // blob handle key.
+            return mRevocableFileDescriptorStore.wrapToRevocableFileDescriptor(
+                    packageName, /*blobHandle=*/null, pfd, ParcelFileDescriptor.MODE_READ_ONLY);
         } finally {
             mReadWriteLock.readLock().unlock();
         }
@@ -1330,8 +1352,13 @@
             checkSuccess(result.getStatus());
 
             ParcelFileDescriptor pfd = ParcelFileDescriptor.fromFd(result.getFileDescriptor());
-            return mRevocableFileDescriptorStore
-                    .wrapToRevocableFileDescriptor(access.getCallingPackageName(), pfd);
+            // We do NOT need to look up the revocable file descriptor for read, skip passing the
+            // blob handle key.
+            return mRevocableFileDescriptorStore.wrapToRevocableFileDescriptor(
+                    access.getCallingPackageName(),
+                    /*blobHandle=*/null,
+                    pfd,
+                    ParcelFileDescriptor.MODE_READ_ONLY);
         } finally {
             mReadWriteLock.readLock().unlock();
         }
@@ -2580,6 +2607,7 @@
      * @param packageName The name of package to be removed.
      * @throws AppSearchException if we cannot remove the data.
      */
+    @OptIn(markerClass = ExperimentalAppSearchApi.class)
     public void clearPackageData(@NonNull String packageName) throws AppSearchException,
             IOException {
         mReadWriteLock.writeLock().lock();
diff --git a/appsearch/appsearch-local-storage/src/main/java/androidx/appsearch/localstorage/AppSearchRevocableFileDescriptor.java b/appsearch/appsearch-local-storage/src/main/java/androidx/appsearch/localstorage/AppSearchRevocableFileDescriptor.java
new file mode 100644
index 0000000..bf0f134
--- /dev/null
+++ b/appsearch/appsearch-local-storage/src/main/java/androidx/appsearch/localstorage/AppSearchRevocableFileDescriptor.java
@@ -0,0 +1,68 @@
+/*
+ * Copyright 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package androidx.appsearch.localstorage;
+
+import android.os.ParcelFileDescriptor;
+import android.os.ParcelFileDescriptor.OnCloseListener;
+
+import androidx.annotation.RestrictTo;
+
+import org.jspecify.annotations.NonNull;
+
+import java.io.IOException;
+
+/**
+ * A custom {@link ParcelFileDescriptor} that provides an additional mechanism to register
+ * a {@link ParcelFileDescriptor.OnCloseListener} which will be invoked when the file
+ * descriptor is closed.
+ * @exportToFramework:hide
+ */
+@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
+public interface AppSearchRevocableFileDescriptor {
+
+    /**
+     * Gets the mode of this {@link AppSearchRevocableFileDescriptor}, It should be
+     * {@link ParcelFileDescriptor#MODE_READ_ONLY} or {@link ParcelFileDescriptor#MODE_READ_WRITE}.
+     */
+    int getMode();
+
+    /**
+     * Gets the revocable {@link ParcelFileDescriptor} that could be sent to an untrusted caller.
+     *
+     * <p> AppSearch will retain control of this {@link ParcelFileDescriptor}'s access to the file.
+     *
+     * <p> Call {@link #revoke()} to invoke the sent {@link ParcelFileDescriptor}.
+     */
+    @NonNull
+    ParcelFileDescriptor getRevocableFileDescriptor();
+
+    /**
+     * Revoke the sent {@link ParcelFileDescriptor} returned by
+     * {@link #getRevocableFileDescriptor()}.
+     *
+     * <p>After calling this method, any access to the file descriptors will fail.
+     *
+     * @throws IOException If an I/O error occurs while revoking file descriptors.
+     */
+    void revoke() throws IOException;
+
+    /**
+     * Callback for indicating that the {@link ParcelFileDescriptor} returned by
+     * {@link #getRevocableFileDescriptor()} has been closed.
+     */
+    void setOnCloseListener(@NonNull OnCloseListener onCloseListener);
+}
diff --git a/appsearch/appsearch-local-storage/src/main/java/androidx/appsearch/localstorage/JetpackAppSearchRevocableFileDescriptor.java b/appsearch/appsearch-local-storage/src/main/java/androidx/appsearch/localstorage/JetpackAppSearchRevocableFileDescriptor.java
new file mode 100644
index 0000000..c28a5d0
--- /dev/null
+++ b/appsearch/appsearch-local-storage/src/main/java/androidx/appsearch/localstorage/JetpackAppSearchRevocableFileDescriptor.java
@@ -0,0 +1,96 @@
+/*
+ * Copyright 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// @exportToFramework:copyToPath(../../../cts/tests/appsearch/testutils/src/android/app/appsearch/testutil/external/JetpackAppSearchRevocableFileDescriptor.java)
+
+package androidx.appsearch.localstorage;
+
+import android.os.ParcelFileDescriptor;
+
+import androidx.annotation.RestrictTo;
+import androidx.core.util.Preconditions;
+
+import org.jspecify.annotations.NonNull;
+
+import java.io.IOException;
+
+/**
+ * The local storage implementation of {@link AppSearchRevocableFileDescriptor}.
+ *
+ * <p> Since the {@link ParcelFileDescriptor} sent to the client side from the local storage
+ * won't cross the binder, we could revoke the {@link ParcelFileDescriptor} in the client side
+ * by directly close the one in AppSearch side. This class just adding close listener to the
+ * inner {@link ParcelFileDescriptor}.
+ * @exportToFramework:hide
+ */
+@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
+public class JetpackAppSearchRevocableFileDescriptor extends ParcelFileDescriptor
+        implements AppSearchRevocableFileDescriptor {
+    private ParcelFileDescriptor.OnCloseListener mOnCloseListener;
+    private int mMode;
+
+    /**
+     * Create a new ParcelFileDescriptor wrapped around another descriptor. By
+     * default all method calls are delegated to the wrapped descriptor.
+     */
+    JetpackAppSearchRevocableFileDescriptor(@NonNull ParcelFileDescriptor parcelFileDescriptor,
+            int mode) {
+        super(parcelFileDescriptor);
+        mMode = mode;
+    }
+
+    @Override
+    public int getMode() {
+        return mMode;
+    }
+
+    @Override
+    @NonNull
+    public ParcelFileDescriptor getRevocableFileDescriptor() {
+        return this;
+    }
+
+    @Override
+    public void setOnCloseListener(@NonNull OnCloseListener onCloseListener) {
+        if (mOnCloseListener != null) {
+            throw new IllegalStateException("The close listener has already been set.");
+        }
+        mOnCloseListener = Preconditions.checkNotNull(onCloseListener);
+    }
+
+    @Override
+    public void revoke() throws IOException {
+        // In jetpack, we already remove this revokeFd from cached map, we could directly close the
+        // super ParcelFileDescriptor without invoke close listener.
+        super.close();
+    }
+
+    @Override
+    public void close() throws IOException {
+        try {
+            super.close();
+            if (mOnCloseListener != null) {
+                // Success closed and invoke call back without exception.
+                mOnCloseListener.onClose(null);
+            }
+        } catch (IOException e) {
+            if (mOnCloseListener != null) {
+                mOnCloseListener.onClose(e);
+            }
+            throw e;
+        }
+    }
+}
diff --git a/appsearch/appsearch-local-storage/src/main/java/androidx/appsearch/localstorage/JetpackRevocableFileDescriptorStore.java b/appsearch/appsearch-local-storage/src/main/java/androidx/appsearch/localstorage/JetpackRevocableFileDescriptorStore.java
index 84013ac..b454028 100644
--- a/appsearch/appsearch-local-storage/src/main/java/androidx/appsearch/localstorage/JetpackRevocableFileDescriptorStore.java
+++ b/appsearch/appsearch-local-storage/src/main/java/androidx/appsearch/localstorage/JetpackRevocableFileDescriptorStore.java
@@ -19,20 +19,11 @@
 
 import android.os.ParcelFileDescriptor;
 
-import androidx.annotation.GuardedBy;
 import androidx.annotation.RestrictTo;
-import androidx.appsearch.app.AppSearchResult;
-import androidx.appsearch.exceptions.AppSearchException;
-import androidx.collection.ArrayMap;
-import androidx.core.util.Preconditions;
+import androidx.appsearch.app.ExperimentalAppSearchApi;
 
 import org.jspecify.annotations.NonNull;
 
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
 /**
  * The local storage implementation of {@link RevocableFileDescriptorStore}.
  *
@@ -46,149 +37,18 @@
  * @exportToFramework:hide
  */
 @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
-public class JetpackRevocableFileDescriptorStore implements
+@ExperimentalAppSearchApi
+public class JetpackRevocableFileDescriptorStore extends
         RevocableFileDescriptorStore {
 
-    private final Object mLock  = new Object();
-    private final AppSearchConfig mConfig;
-
     public JetpackRevocableFileDescriptorStore(@NonNull AppSearchConfig config) {
-        mConfig = Preconditions.checkNotNull(config);
-    }
-
-    @GuardedBy("mLock")
-    // <package, List<sent rfds> map to tracking all sent rfds.
-    private final Map<String, List<JetpackRevocableFileDescriptor>>
-            mSentAppSearchParcelFileDescriptorsLocked = new ArrayMap<>();
-
-    @Override
-    public @NonNull ParcelFileDescriptor wrapToRevocableFileDescriptor(@NonNull String packageName,
-            @NonNull ParcelFileDescriptor parcelFileDescriptor) {
-        JetpackRevocableFileDescriptor revocableFileDescriptor =
-                new JetpackRevocableFileDescriptor(parcelFileDescriptor);
-        setCloseListenerToFd(revocableFileDescriptor, packageName);
-        addToSentAppSearchParcelFileDescriptorMap(revocableFileDescriptor, packageName);
-        return revocableFileDescriptor;
+        super(config);
     }
 
     @Override
-    public void revokeAll() throws IOException {
-        synchronized (mLock) {
-            for (String packageName : mSentAppSearchParcelFileDescriptorsLocked.keySet()) {
-                revokeForPackage(packageName);
-            }
-        }
-    }
-
-    @Override
-    public void revokeForPackage(@NonNull String packageName) throws IOException {
-        synchronized (mLock) {
-            List<JetpackRevocableFileDescriptor> rfds =
-                    mSentAppSearchParcelFileDescriptorsLocked.remove(packageName);
-            if (rfds != null) {
-                for (int i = rfds.size() - 1; i >= 0; i--) {
-                    rfds.get(i).closeSuperDirectly();
-                }
-            }
-        }
-    }
-
-    @Override
-    public void checkBlobStoreLimit(@NonNull String packageName) throws AppSearchException {
-        synchronized (mLock) {
-            List<JetpackRevocableFileDescriptor> rfdsForPackage =
-                    mSentAppSearchParcelFileDescriptorsLocked.get(packageName);
-            if (rfdsForPackage == null) {
-                return;
-            }
-            if (rfdsForPackage.size() >= mConfig.getMaxOpenBlobCount()) {
-                throw new AppSearchException(AppSearchResult.RESULT_OUT_OF_SPACE,
-                        "Package \"" + packageName + "\" exceeded limit of "
-                                + mConfig.getMaxOpenBlobCount()
-                                + " opened file descriptors. Some file descriptors "
-                                + "must be closed to open additional ones.");
-            }
-        }
-    }
-
-    private void setCloseListenerToFd(
-            @NonNull JetpackRevocableFileDescriptor revocableFileDescriptor,
-            @NonNull String packageName) {
-        revocableFileDescriptor.setCloseListener(e -> {
-            synchronized (mLock) {
-                List<JetpackRevocableFileDescriptor> fdsForPackage =
-                        mSentAppSearchParcelFileDescriptorsLocked.get(packageName);
-                if (fdsForPackage != null) {
-                    fdsForPackage.remove(revocableFileDescriptor);
-                    if (fdsForPackage.isEmpty()) {
-                        mSentAppSearchParcelFileDescriptorsLocked.remove(packageName);
-                    }
-                }
-            }
-        });
-    }
-
-    private void addToSentAppSearchParcelFileDescriptorMap(
-            @NonNull JetpackRevocableFileDescriptor revocableFileDescriptor,
-            @NonNull String packageName) {
-        synchronized (mLock) {
-            List<JetpackRevocableFileDescriptor> rfdsForPackage =
-                    mSentAppSearchParcelFileDescriptorsLocked.get(packageName);
-            if (rfdsForPackage == null) {
-                rfdsForPackage = new ArrayList<>();
-                mSentAppSearchParcelFileDescriptorsLocked.put(packageName, rfdsForPackage);
-            }
-            rfdsForPackage.add(revocableFileDescriptor);
-        }
-    }
-
-    /**
-     * A custom {@link ParcelFileDescriptor} that provides an additional mechanism to register
-     * a {@link ParcelFileDescriptor.OnCloseListener} which will be invoked when the file
-     * descriptor is closed.
-     *
-     * <p> Since the {@link ParcelFileDescriptor} sent to the client side from the local storage
-     * won't cross the binder, we could revoke the {@link ParcelFileDescriptor} in the client side
-     * by directly close the one in AppSearch side. This class just adding close listener to the
-     * inner {@link ParcelFileDescriptor}.
-     */
-    static class JetpackRevocableFileDescriptor extends ParcelFileDescriptor {
-        private ParcelFileDescriptor.OnCloseListener mOnCloseListener;
-
-        /**
-         * Create a new ParcelFileDescriptor wrapped around another descriptor. By
-         * default all method calls are delegated to the wrapped descriptor.
-         */
-        JetpackRevocableFileDescriptor(@NonNull ParcelFileDescriptor parcelFileDescriptor) {
-            super(parcelFileDescriptor);
-        }
-
-        void setCloseListener(
-                ParcelFileDescriptor.@NonNull OnCloseListener onCloseListener) {
-            if (mOnCloseListener != null) {
-                throw new IllegalStateException("The close listener has already been set.");
-            }
-            mOnCloseListener = Preconditions.checkNotNull(onCloseListener);
-        }
-
-        /**  Close the super {@link ParcelFileDescriptor} without invoke close listener.         */
-        void closeSuperDirectly() throws IOException {
-            super.close();
-        }
-
-        @Override
-        public void close() throws IOException {
-            try {
-                super.close();
-                if (mOnCloseListener != null) {
-                    mOnCloseListener.onClose(null);
-                }
-            } catch (IOException e) {
-                if (mOnCloseListener != null) {
-                    mOnCloseListener.onClose(e);
-                }
-                throw e;
-            }
-        }
+    protected @NonNull AppSearchRevocableFileDescriptor wrapToRevocableFileDescriptor(
+            @NonNull ParcelFileDescriptor parcelFileDescriptor,
+            int mode) {
+        return new JetpackAppSearchRevocableFileDescriptor(parcelFileDescriptor, mode);
     }
 }
diff --git a/appsearch/appsearch-local-storage/src/main/java/androidx/appsearch/localstorage/LocalStorage.java b/appsearch/appsearch-local-storage/src/main/java/androidx/appsearch/localstorage/LocalStorage.java
index d3377ee..d7d38b3 100644
--- a/appsearch/appsearch-local-storage/src/main/java/androidx/appsearch/localstorage/LocalStorage.java
+++ b/appsearch/appsearch-local-storage/src/main/java/androidx/appsearch/localstorage/LocalStorage.java
@@ -20,12 +20,14 @@
 import android.os.SystemClock;
 import android.util.Log;
 
+import androidx.annotation.OptIn;
 import androidx.annotation.RestrictTo;
 import androidx.annotation.VisibleForTesting;
 import androidx.annotation.WorkerThread;
 import androidx.appsearch.annotation.Document;
 import androidx.appsearch.app.AppSearchEnvironmentFactory;
 import androidx.appsearch.app.AppSearchSession;
+import androidx.appsearch.app.ExperimentalAppSearchApi;
 import androidx.appsearch.app.GlobalSearchSession;
 import androidx.appsearch.exceptions.AppSearchException;
 import androidx.appsearch.flags.Flags;
@@ -359,6 +361,7 @@
     }
 
     @WorkerThread
+    @OptIn(markerClass = ExperimentalAppSearchApi.class)
     private LocalStorage(
             @NonNull Context context,
             @NonNull Executor executor,
diff --git a/appsearch/appsearch-local-storage/src/main/java/androidx/appsearch/localstorage/RevocableFileDescriptorStore.java b/appsearch/appsearch-local-storage/src/main/java/androidx/appsearch/localstorage/RevocableFileDescriptorStore.java
index 200b5b7..12ecb4b 100644
--- a/appsearch/appsearch-local-storage/src/main/java/androidx/appsearch/localstorage/RevocableFileDescriptorStore.java
+++ b/appsearch/appsearch-local-storage/src/main/java/androidx/appsearch/localstorage/RevocableFileDescriptorStore.java
@@ -18,39 +18,135 @@
 
 import android.os.ParcelFileDescriptor;
 
+
+import androidx.annotation.GuardedBy;
 import androidx.annotation.RestrictTo;
+import androidx.appsearch.app.AppSearchBlobHandle;
+import androidx.appsearch.app.AppSearchResult;
+import androidx.appsearch.app.ExperimentalAppSearchApi;
 import androidx.appsearch.exceptions.AppSearchException;
+import androidx.collection.ArrayMap;
+import androidx.collection.ArraySet;
+import androidx.core.util.Preconditions;
 
 import org.jspecify.annotations.NonNull;
+import org.jspecify.annotations.Nullable;
 
 import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
 
 /**
- * Interface for revocable file descriptors storage.
+ * The base class for revocable file descriptors storage.
  *
  * <p>This store allows wrapping {@link ParcelFileDescriptor} instances into revocable file
  * descriptors, enabling the ability to close and revoke it's access to the file even if the
  * {@link ParcelFileDescriptor} has been sent to the client side.
  *
- * <p> Implementations of this interface can provide controlled access to resources by associating
- * each file descriptor with a package and allowing them to be individually revoked by package
- * or revoked all at once.
+ * <p> This class can provide controlled access to resources by associating each file descriptor
+ * with a package and allowing them to be individually revoked by package or revoked all at once.
+ *
+ * <p> The sub-class must define how to wrap a {@link ParcelFileDescriptor} to a
+ * {@link AppSearchRevocableFileDescriptor}.
+ *
+ * <p> This class stores {@link AppSearchBlobHandle} and returned
+ * {@link AppSearchRevocableFileDescriptor} for writing in key-value pairs map. Only one opened
+ * {@link AppSearchRevocableFileDescriptor} for writing will be allowed for each
+ * {@link AppSearchBlobHandle}.
+ *
+ * <p> This class stores {@link AppSearchRevocableFileDescriptor} for reading in a list. There is no
+ * use case to look up and invoke a single {@link AppSearchRevocableFileDescriptor} for reading.
  *
  * @exportToFramework:hide
  */
 @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
-public interface RevocableFileDescriptorStore {
+@ExperimentalAppSearchApi
+public abstract class RevocableFileDescriptorStore {
+
+    private final Object mLock  = new Object();
+    private final AppSearchConfig mConfig;
+
+    public RevocableFileDescriptorStore(@NonNull AppSearchConfig config) {
+        mConfig = Preconditions.checkNotNull(config);
+    }
+
+    @GuardedBy("mLock")
+    // Map<package, Map<blob handle, sent rfds>> map to track all sent rfds for writing. We only
+    // allow user to open 1 pfd for write for same file.
+    private final Map<String, Map<AppSearchBlobHandle, AppSearchRevocableFileDescriptor>>
+            mSentRevocableFileDescriptorsForWriteLocked = new ArrayMap<>();
+
+    @GuardedBy("mLock")
+    // <package, List<sent rfds> map to track all sent rfds for reading. We allow opening
+    // multiple pfds for read for the same file.
+    private final Map<String, List<AppSearchRevocableFileDescriptor>>
+            mSentRevocableFileDescriptorsForReadLocked = new ArrayMap<>();
 
     /**
-     * Wraps the provided ParcelFileDescriptor into a revocable file descriptor.
-     * This allows for controlled access to the file descriptor, making it revocable by the store.
+     * Wraps the provided {@link ParcelFileDescriptor} into a revocable file descriptor.
+     *
+     * <p>This allows for controlled access to the file descriptor, making it revocable by the
+     * store.
      *
      * @param packageName The package name requesting the revocable file descriptor.
-     * @param parcelFileDescriptor The original ParcelFileDescriptor to be wrapped.
-     * @return A ParcelFileDescriptor that can be revoked by the store.
+     * @param blobHandle The blob handle associated with the file descriptor. It cannot be null if
+     *                   the mode is READ_WRITE.
+     * @param parcelFileDescriptor The original {@link ParcelFileDescriptor} to be wrapped.
+     * @param mode  The mode of the given {@link ParcelFileDescriptor}. It should be
+     * {@link ParcelFileDescriptor#MODE_READ_ONLY} or {@link ParcelFileDescriptor#MODE_READ_WRITE}.
+     * @return A {@link ParcelFileDescriptor} that can be revoked by the store.
+     * @throws IOException if an I/O error occurs while creating the revocable file descriptor.
      */
-    @NonNull ParcelFileDescriptor wrapToRevocableFileDescriptor(@NonNull String packageName,
-            @NonNull ParcelFileDescriptor parcelFileDescriptor) throws IOException;
+    public  @NonNull ParcelFileDescriptor wrapToRevocableFileDescriptor(
+            @NonNull String packageName,
+            @Nullable AppSearchBlobHandle blobHandle,
+            @NonNull ParcelFileDescriptor parcelFileDescriptor,
+            int mode) throws IOException {
+        AppSearchRevocableFileDescriptor revocableFileDescriptor =
+                wrapToRevocableFileDescriptor(parcelFileDescriptor, mode);
+        setCloseListenerToFd(packageName, blobHandle, revocableFileDescriptor);
+        addToSentRevocableFileDescriptorMap(packageName, blobHandle,
+                revocableFileDescriptor);
+        return revocableFileDescriptor.getRevocableFileDescriptor();
+    }
+
+    /**
+     * Wraps the provided {@link ParcelFileDescriptor} into a specific type of
+     * {@link AppSearchRevocableFileDescriptor}.
+     */
+    protected abstract @NonNull AppSearchRevocableFileDescriptor wrapToRevocableFileDescriptor(
+            @NonNull ParcelFileDescriptor parcelFileDescriptor,
+            int mode) throws IOException;
+
+    /**
+     * Gets the opened revocable file descriptor for write associated with the given
+     * {@link AppSearchBlobHandle}.
+     *
+     * @param packageName The package name associated with the file descriptor.
+     * @param blobHandle The blob handle associated with the file descriptor.
+     * @return The opened revocable file descriptor, or {@code null} if not found.
+     */
+    public @Nullable ParcelFileDescriptor getOpenedRevocableFileDescriptorForWrite(
+            @NonNull String packageName,
+            @NonNull AppSearchBlobHandle blobHandle) {
+        synchronized (mLock) {
+            Map<AppSearchBlobHandle, AppSearchRevocableFileDescriptor> rfdsForPackage =
+                    mSentRevocableFileDescriptorsForWriteLocked.get(packageName);
+            if (rfdsForPackage == null) {
+                return null;
+            }
+            AppSearchRevocableFileDescriptor revocableFileDescriptor =
+                    rfdsForPackage.get(blobHandle);
+            if (revocableFileDescriptor == null) {
+                return null;
+            }
+            // The revocableFileDescriptor should never be revoked, otherwise it should be removed
+            // from the map.
+            return revocableFileDescriptor.getRevocableFileDescriptor();
+        }
+    }
 
     /**
      * Revokes all revocable file descriptors previously issued by the store.
@@ -58,7 +154,16 @@
      *
      * @throws IOException If an I/O error occurs while revoking file descriptors.
      */
-    void revokeAll() throws IOException;
+    public void revokeAll() throws IOException {
+        synchronized (mLock) {
+            Set<String> packageNames =
+                    new ArraySet<>(mSentRevocableFileDescriptorsForReadLocked.keySet());
+            packageNames.addAll(mSentRevocableFileDescriptorsForWriteLocked.keySet());
+            for (String packageName : packageNames) {
+                revokeForPackage(packageName);
+            }
+        }
+    }
 
     /**
      * Revokes all revocable file descriptors for a specified package.
@@ -67,8 +172,184 @@
      * @param packageName The package name whose file descriptors should be revoked.
      * @throws IOException If an I/O error occurs while revoking file descriptors.
      */
-    void revokeForPackage(@NonNull String packageName) throws IOException;
+    public void revokeForPackage(@NonNull String packageName) throws IOException {
+        synchronized (mLock) {
+            List<AppSearchRevocableFileDescriptor> rfdsForRead =
+                    mSentRevocableFileDescriptorsForReadLocked.remove(packageName);
+            if (rfdsForRead != null) {
+                for (int i = rfdsForRead.size() - 1; i >= 0; i--) {
+                    rfdsForRead.get(i).revoke();
+                }
+            }
+
+            Map<AppSearchBlobHandle, AppSearchRevocableFileDescriptor> rfdsForWrite =
+                    mSentRevocableFileDescriptorsForWriteLocked.remove(packageName);
+            if (rfdsForWrite != null) {
+                for (AppSearchRevocableFileDescriptor rfdForWrite : rfdsForWrite.values()) {
+                    rfdForWrite.revoke();
+                }
+            }
+        }
+    }
+
+    /**
+     * Revokes the revocable file descriptors for write associated with the given
+     * {@link AppSearchBlobHandle}.
+     *
+     * <p> Once a blob is sealed, we should call this method to revoke the sent file descriptor for
+     * write. Otherwise, the user could keep writing to the committed file.
+     *
+     * @param packageName The package name whose file descriptors should be revoked.
+     * @param blobHandle  The blob handle associated with the file descriptors.
+     * @throws IOException If an I/O error occurs while revoking file descriptors.
+     */
+    public void revokeFdForWrite(@NonNull String packageName,
+            @NonNull AppSearchBlobHandle blobHandle) throws IOException {
+        synchronized (mLock) {
+            Map<AppSearchBlobHandle, AppSearchRevocableFileDescriptor> rfdsForWrite =
+                    mSentRevocableFileDescriptorsForWriteLocked.remove(packageName);
+            if (rfdsForWrite == null) {
+                return;
+            }
+            AppSearchRevocableFileDescriptor revocableFileDescriptor =
+                    rfdsForWrite.remove(blobHandle);
+            if (revocableFileDescriptor == null) {
+                return;
+            }
+            revocableFileDescriptor.revoke();
+            if (rfdsForWrite.isEmpty()) {
+                mSentRevocableFileDescriptorsForWriteLocked.remove(packageName);
+            }
+        }
+    }
 
     /**  Checks if the specified package has reached its blob storage limit. */
-    void checkBlobStoreLimit(@NonNull String packageName) throws AppSearchException;
+    public void checkBlobStoreLimit(@NonNull String packageName) throws AppSearchException {
+        synchronized (mLock) {
+            int totalOpenFdSize = 0;
+            List<AppSearchRevocableFileDescriptor> rfdsForRead =
+                    mSentRevocableFileDescriptorsForReadLocked.get(packageName);
+            if (rfdsForRead != null) {
+                totalOpenFdSize += rfdsForRead.size();
+            }
+            Map<AppSearchBlobHandle, AppSearchRevocableFileDescriptor> rfdsForWrite =
+                    mSentRevocableFileDescriptorsForWriteLocked.get(packageName);
+            if (rfdsForWrite != null) {
+                totalOpenFdSize += rfdsForWrite.size();
+            }
+            if (totalOpenFdSize >= mConfig.getMaxOpenBlobCount()) {
+                throw new AppSearchException(AppSearchResult.RESULT_OUT_OF_SPACE,
+                        "Package \"" + packageName + "\" exceeded limit of "
+                                + mConfig.getMaxOpenBlobCount()
+                                + " opened file descriptors. Some file descriptors "
+                                + "must be closed to open additional ones.");
+            }
+        }
+    }
+
+    /**
+     * Sets a close listener to the revocable file descriptor for write.
+     *
+     * <p>The listener will be invoked when the file descriptor is closed.
+     *
+     * @param packageName The package name associated with the file descriptor.
+     * @param blobHandle The blob handle associated with the file descriptor. It cannot be null if
+     *                   the mode is READ_WRITE.
+     * @param revocableFileDescriptor The revocable file descriptor to set the listener to.
+     */
+    private void setCloseListenerToFd(
+            @NonNull String packageName,
+            @Nullable AppSearchBlobHandle blobHandle,
+            @NonNull AppSearchRevocableFileDescriptor revocableFileDescriptor) {
+        ParcelFileDescriptor.OnCloseListener closeListener;
+        switch (revocableFileDescriptor.getMode()) {
+            case ParcelFileDescriptor.MODE_READ_ONLY:
+                closeListener = e -> {
+                    synchronized (mLock) {
+                        List<AppSearchRevocableFileDescriptor> fdsForPackage =
+                                mSentRevocableFileDescriptorsForReadLocked.get(packageName);
+                        if (fdsForPackage != null) {
+                            fdsForPackage.remove(revocableFileDescriptor);
+                            if (fdsForPackage.isEmpty()) {
+                                mSentRevocableFileDescriptorsForReadLocked.remove(packageName);
+                            }
+                        }
+                    }
+                };
+                break;
+            case ParcelFileDescriptor.MODE_READ_WRITE:
+                Preconditions.checkNotNull(blobHandle);
+                closeListener = e -> {
+                    synchronized (mLock) {
+                        Map<AppSearchBlobHandle, AppSearchRevocableFileDescriptor>
+                                rfdsForPackage = mSentRevocableFileDescriptorsForWriteLocked
+                                .get(packageName);
+                        if (rfdsForPackage != null) {
+                            AppSearchRevocableFileDescriptor rfd =
+                                    rfdsForPackage.remove(blobHandle);
+                            if (rfd != null) {
+                                try {
+                                    rfd.revoke();
+                                } catch (IOException ioException) {
+                                    // ignore, the sent RevocableFileDescriptor should already
+                                    // be closed.
+                                }
+                            }
+                            if (rfdsForPackage.isEmpty()) {
+                                mSentRevocableFileDescriptorsForWriteLocked.remove(packageName);
+                            }
+                        }
+                    }
+                };
+                break;
+            default:
+                throw new UnsupportedOperationException(
+                        "Cannot support the AppSearchRevocableFileDescriptor mode: "
+                                + revocableFileDescriptor.getMode());
+        }
+        revocableFileDescriptor.setOnCloseListener(closeListener);
+    }
+
+    /**
+     * Adds a revocable file descriptor to the sent revocable file descriptor map.
+     *
+     * @param packageName The package name associated with the file descriptor.
+     * @param blobHandle The blob handle associated with the file descriptor. It cannot be null if
+     *                   the mode is READ_WRITE.
+     * @param revocableFileDescriptor The revocable file descriptor to add.
+     */
+    private void addToSentRevocableFileDescriptorMap(
+            @NonNull String packageName,
+            @Nullable AppSearchBlobHandle blobHandle,
+            @NonNull AppSearchRevocableFileDescriptor revocableFileDescriptor) {
+        synchronized (mLock) {
+            switch (revocableFileDescriptor.getMode()) {
+                case ParcelFileDescriptor.MODE_READ_ONLY:
+                    List<AppSearchRevocableFileDescriptor> rfdListForPackage =
+                            mSentRevocableFileDescriptorsForReadLocked.get(packageName);
+                    if (rfdListForPackage == null) {
+                        rfdListForPackage = new ArrayList<>();
+                        mSentRevocableFileDescriptorsForReadLocked.put(packageName,
+                                rfdListForPackage);
+                    }
+                    rfdListForPackage.add(revocableFileDescriptor);
+                    break;
+                case ParcelFileDescriptor.MODE_READ_WRITE:
+                    Preconditions.checkNotNull(blobHandle);
+                    Map<AppSearchBlobHandle, AppSearchRevocableFileDescriptor> rfdMapForPackage =
+                            mSentRevocableFileDescriptorsForWriteLocked.get(packageName);
+                    if (rfdMapForPackage == null) {
+                        rfdMapForPackage = new ArrayMap<>();
+                        mSentRevocableFileDescriptorsForWriteLocked.put(packageName,
+                                rfdMapForPackage);
+                    }
+                    rfdMapForPackage.put(blobHandle, revocableFileDescriptor);
+                    break;
+                default:
+                    throw new UnsupportedOperationException(
+                            "Cannot support the AppSearchRevocableFileDescriptor mode: "
+                                    + revocableFileDescriptor.getMode());
+            }
+        }
+    }
 }
diff --git a/appsearch/appsearch/src/androidTest/java/androidx/appsearch/cts/app/AppSearchSessionBlobCtsTestBase.java b/appsearch/appsearch/src/androidTest/java/androidx/appsearch/cts/app/AppSearchSessionBlobCtsTestBase.java
index fd4cb7a..17621bf 100644
--- a/appsearch/appsearch/src/androidTest/java/androidx/appsearch/cts/app/AppSearchSessionBlobCtsTestBase.java
+++ b/appsearch/appsearch/src/androidTest/java/androidx/appsearch/cts/app/AppSearchSessionBlobCtsTestBase.java
@@ -62,6 +62,7 @@
 import org.junit.Test;
 import org.junit.rules.RuleChain;
 
+import java.io.FileOutputStream;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
@@ -173,6 +174,38 @@
 
     @Test
     @RequiresFlagsEnabled(Flags.FLAG_ENABLE_BLOB_STORE)
+    public void testWriteAfterCommit() throws Exception {
+        assumeTrue(mDb1.getFeatures().isFeatureSupported(Features.BLOB_STORAGE));
+
+        OpenBlobForWriteResponse writeResponse =
+                mDb1.openBlobForWriteAsync(ImmutableSet.of(mHandle1)).get();
+        AppSearchBatchResult<AppSearchBlobHandle, ParcelFileDescriptor> writeResult =
+                writeResponse.getResult();
+        assertTrue(writeResult.isSuccess());
+
+        // Write data without close the pfd for write
+        ParcelFileDescriptor writePfd = writeResult.getSuccesses().get(mHandle1);
+        try (FileOutputStream outputStream = new FileOutputStream(writePfd.getFileDescriptor())) {
+            outputStream.write(mData1);
+            outputStream.flush();
+        }
+
+        // Commit the blob will revoke the pfd for write.
+        assertTrue(mDb1.commitBlobAsync(ImmutableSet.of(mHandle1)).get().getResult()
+                .isSuccess());
+
+        // Cannot keep writing to the blob after commit.
+        assertThrows(IOException.class, () -> {
+            try (FileOutputStream outputStream =
+                         new FileOutputStream(writePfd.getFileDescriptor())) {
+                outputStream.write(mData1);
+                outputStream.flush();
+            }
+        });
+    }
+
+    @Test
+    @RequiresFlagsEnabled(Flags.FLAG_ENABLE_BLOB_STORE)
     public void testRemovePendingBlob() throws Exception {
         assumeTrue(mDb1.getFeatures().isFeatureSupported(Features.BLOB_STORAGE));
 
diff --git a/benchmark/benchmark-common/api/current.txt b/benchmark/benchmark-common/api/current.txt
index f1f1bfe..44c9777 100644
--- a/benchmark/benchmark-common/api/current.txt
+++ b/benchmark/benchmark-common/api/current.txt
@@ -2,20 +2,13 @@
 package androidx.benchmark {
 
   public final class BenchmarkState {
-    ctor @SuppressCompatibility @androidx.benchmark.ExperimentalBenchmarkStateApi public BenchmarkState(optional Integer? warmupCount, optional Integer? repeatCount);
-    method @SuppressCompatibility @androidx.benchmark.ExperimentalBenchmarkStateApi public java.util.List<java.lang.Double> getMeasurementTimeNs();
     method public boolean keepRunning();
     method public void pauseTiming();
-    method @SuppressCompatibility @androidx.benchmark.BenchmarkState.Companion.ExperimentalExternalReport public static void reportData(String className, String testName, @IntRange(from=0L) long totalRunTimeNs, java.util.List<java.lang.Long> dataNs, @IntRange(from=0L) int warmupIterations, @IntRange(from=0L) long thermalThrottleSleepSeconds, @IntRange(from=1L) int repeatIterations);
     method public void resumeTiming();
     field public static final androidx.benchmark.BenchmarkState.Companion Companion;
   }
 
   public static final class BenchmarkState.Companion {
-    method @SuppressCompatibility @androidx.benchmark.BenchmarkState.Companion.ExperimentalExternalReport public void reportData(String className, String testName, @IntRange(from=0L) long totalRunTimeNs, java.util.List<java.lang.Long> dataNs, @IntRange(from=0L) int warmupIterations, @IntRange(from=0L) long thermalThrottleSleepSeconds, @IntRange(from=1L) int repeatIterations);
-  }
-
-  @SuppressCompatibility @kotlin.RequiresOptIn @kotlin.annotation.Retention(kotlin.annotation.AnnotationRetention.BINARY) @kotlin.annotation.Target(allowedTargets=kotlin.annotation.AnnotationTarget.FUNCTION) public static @interface BenchmarkState.Companion.ExperimentalExternalReport {
   }
 
   @SuppressCompatibility @androidx.benchmark.ExperimentalBlackHoleApi public final class BlackHole {
@@ -61,15 +54,19 @@
 
   @SuppressCompatibility @androidx.benchmark.ExperimentalBenchmarkConfigApi public final class MicrobenchmarkConfig {
     ctor public MicrobenchmarkConfig();
-    ctor public MicrobenchmarkConfig(optional java.util.List<? extends androidx.benchmark.MetricCapture> metrics, optional boolean traceAppTagEnabled, optional boolean perfettoSdkTracingEnabled, optional androidx.benchmark.ProfilerConfig? profiler);
+    ctor public MicrobenchmarkConfig(optional java.util.List<? extends androidx.benchmark.MetricCapture> metrics, optional boolean traceAppTagEnabled, optional boolean perfettoSdkTracingEnabled, optional androidx.benchmark.ProfilerConfig? profiler, optional Integer? warmupCount, optional Integer? measurementCount);
+    method public Integer? getMeasurementCount();
     method public java.util.List<androidx.benchmark.MetricCapture> getMetrics();
     method public androidx.benchmark.ProfilerConfig? getProfiler();
+    method public Integer? getWarmupCount();
     method public boolean isPerfettoSdkTracingEnabled();
     method public boolean isTraceAppTagEnabled();
+    property public final Integer? measurementCount;
     property public final java.util.List<androidx.benchmark.MetricCapture> metrics;
     property public final boolean perfettoSdkTracingEnabled;
     property public final androidx.benchmark.ProfilerConfig? profiler;
     property public final boolean traceAppTagEnabled;
+    property public final Integer? warmupCount;
   }
 
   @SuppressCompatibility @androidx.benchmark.ExperimentalBenchmarkConfigApi public abstract sealed class ProfilerConfig {
diff --git a/benchmark/benchmark-common/api/restricted_current.txt b/benchmark/benchmark-common/api/restricted_current.txt
index 7271b61..f25ea8e 100644
--- a/benchmark/benchmark-common/api/restricted_current.txt
+++ b/benchmark/benchmark-common/api/restricted_current.txt
@@ -2,12 +2,9 @@
 package androidx.benchmark {
 
   public final class BenchmarkState {
-    ctor @SuppressCompatibility @androidx.benchmark.ExperimentalBenchmarkStateApi public BenchmarkState(optional Integer? warmupCount, optional Integer? repeatCount);
-    method @SuppressCompatibility @androidx.benchmark.ExperimentalBenchmarkStateApi public java.util.List<java.lang.Double> getMeasurementTimeNs();
     method public boolean keepRunning();
     method @kotlin.PublishedApi internal boolean keepRunningInternal();
     method public void pauseTiming();
-    method @SuppressCompatibility @androidx.benchmark.BenchmarkState.Companion.ExperimentalExternalReport public static void reportData(String className, String testName, @IntRange(from=0L) long totalRunTimeNs, java.util.List<java.lang.Long> dataNs, @IntRange(from=0L) int warmupIterations, @IntRange(from=0L) long thermalThrottleSleepSeconds, @IntRange(from=1L) int repeatIterations);
     method public void resumeTiming();
     property @kotlin.PublishedApi internal final int iterationsRemaining;
     field public static final androidx.benchmark.BenchmarkState.Companion Companion;
@@ -15,10 +12,6 @@
   }
 
   public static final class BenchmarkState.Companion {
-    method @SuppressCompatibility @androidx.benchmark.BenchmarkState.Companion.ExperimentalExternalReport public void reportData(String className, String testName, @IntRange(from=0L) long totalRunTimeNs, java.util.List<java.lang.Long> dataNs, @IntRange(from=0L) int warmupIterations, @IntRange(from=0L) long thermalThrottleSleepSeconds, @IntRange(from=1L) int repeatIterations);
-  }
-
-  @SuppressCompatibility @kotlin.RequiresOptIn @kotlin.annotation.Retention(kotlin.annotation.AnnotationRetention.BINARY) @kotlin.annotation.Target(allowedTargets=kotlin.annotation.AnnotationTarget.FUNCTION) public static @interface BenchmarkState.Companion.ExperimentalExternalReport {
   }
 
   @SuppressCompatibility @androidx.benchmark.ExperimentalBlackHoleApi public final class BlackHole {
@@ -64,15 +57,19 @@
 
   @SuppressCompatibility @androidx.benchmark.ExperimentalBenchmarkConfigApi public final class MicrobenchmarkConfig {
     ctor public MicrobenchmarkConfig();
-    ctor public MicrobenchmarkConfig(optional java.util.List<? extends androidx.benchmark.MetricCapture> metrics, optional boolean traceAppTagEnabled, optional boolean perfettoSdkTracingEnabled, optional androidx.benchmark.ProfilerConfig? profiler);
+    ctor public MicrobenchmarkConfig(optional java.util.List<? extends androidx.benchmark.MetricCapture> metrics, optional boolean traceAppTagEnabled, optional boolean perfettoSdkTracingEnabled, optional androidx.benchmark.ProfilerConfig? profiler, optional Integer? warmupCount, optional Integer? measurementCount);
+    method public Integer? getMeasurementCount();
     method public java.util.List<androidx.benchmark.MetricCapture> getMetrics();
     method public androidx.benchmark.ProfilerConfig? getProfiler();
+    method public Integer? getWarmupCount();
     method public boolean isPerfettoSdkTracingEnabled();
     method public boolean isTraceAppTagEnabled();
+    property public final Integer? measurementCount;
     property public final java.util.List<androidx.benchmark.MetricCapture> metrics;
     property public final boolean perfettoSdkTracingEnabled;
     property public final androidx.benchmark.ProfilerConfig? profiler;
     property public final boolean traceAppTagEnabled;
+    property public final Integer? warmupCount;
   }
 
   @SuppressCompatibility @androidx.benchmark.ExperimentalBenchmarkConfigApi public abstract sealed class ProfilerConfig {
diff --git a/benchmark/benchmark-common/build.gradle b/benchmark/benchmark-common/build.gradle
index d1537e3..e22a1e6 100644
--- a/benchmark/benchmark-common/build.gradle
+++ b/benchmark/benchmark-common/build.gradle
@@ -85,6 +85,7 @@
     implementation("androidx.test:monitor:1.6.1")
     implementation(libs.wireRuntime)
     implementation(libs.moshi)
+    implementation(libs.kotlinCoroutinesAndroid)
     ksp(libs.moshiCodeGen)
 
     androidTestImplementation(libs.testRules)
diff --git a/benchmark/benchmark-common/src/androidTest/java/androidx/benchmark/BenchmarkStateConfigTest.kt b/benchmark/benchmark-common/src/androidTest/java/androidx/benchmark/BenchmarkStateLegacyConfigTest.kt
similarity index 98%
rename from benchmark/benchmark-common/src/androidTest/java/androidx/benchmark/BenchmarkStateConfigTest.kt
rename to benchmark/benchmark-common/src/androidTest/java/androidx/benchmark/BenchmarkStateLegacyConfigTest.kt
index bc0ea41..0fa1ce6 100644
--- a/benchmark/benchmark-common/src/androidTest/java/androidx/benchmark/BenchmarkStateConfigTest.kt
+++ b/benchmark/benchmark-common/src/androidTest/java/androidx/benchmark/BenchmarkStateLegacyConfigTest.kt
@@ -27,7 +27,7 @@
 
 @SmallTest
 @RunWith(AndroidJUnit4::class)
-class BenchmarkStateConfigTest {
+class BenchmarkStateLegacyConfigTest {
     private fun validateConfig(
         config: MicrobenchmarkPhase.Config,
         expectedWarmups: Int?,
@@ -36,7 +36,7 @@
         expectedUsesProfiler: Boolean = false,
         expectedProfilerIterations: Int = 0
     ) {
-        val state = BenchmarkState(config)
+        val state = BenchmarkStateLegacy(config)
         var count = 0
         while (state.keepRunning()) {
             // This spin loop works around an issue where nanoTime is only precise to 30us on some
diff --git a/benchmark/benchmark-common/src/androidTest/java/androidx/benchmark/BenchmarkStateTest.kt b/benchmark/benchmark-common/src/androidTest/java/androidx/benchmark/BenchmarkStateLegacyTest.kt
similarity index 85%
rename from benchmark/benchmark-common/src/androidTest/java/androidx/benchmark/BenchmarkStateTest.kt
rename to benchmark/benchmark-common/src/androidTest/java/androidx/benchmark/BenchmarkStateLegacyTest.kt
index fc41186..616b446 100644
--- a/benchmark/benchmark-common/src/androidTest/java/androidx/benchmark/BenchmarkStateTest.kt
+++ b/benchmark/benchmark-common/src/androidTest/java/androidx/benchmark/BenchmarkStateLegacyTest.kt
@@ -18,8 +18,6 @@
 
 import android.Manifest
 import androidx.annotation.RequiresApi
-import androidx.benchmark.BenchmarkState.Companion.ExperimentalExternalReport
-import androidx.benchmark.json.BenchmarkData
 import androidx.test.ext.junit.runners.AndroidJUnit4
 import androidx.test.filters.FlakyTest
 import androidx.test.filters.LargeTest
@@ -39,7 +37,7 @@
 
 @LargeTest
 @RunWith(AndroidJUnit4::class)
-class BenchmarkStateTest {
+class BenchmarkStateLegacyTest {
     private fun us2ns(ms: Long): Long = TimeUnit.MICROSECONDS.toNanos(ms)
 
     @get:Rule
@@ -63,7 +61,7 @@
     @Test
     @FlakyTest(bugId = 187711141)
     fun validateMetrics() {
-        val state = BenchmarkState()
+        val state = BenchmarkStateLegacy()
         while (state.keepRunning()) {
             runAndSpin(durationUs = 300) {
                 // note, important here to not do too much work - this test may run on an
@@ -88,7 +86,7 @@
 
     @Test
     fun keepRunningMissingResume() {
-        val state = BenchmarkState()
+        val state = BenchmarkStateLegacy()
 
         assertEquals(true, state.keepRunning())
         state.pauseTiming()
@@ -97,7 +95,7 @@
 
     @Test
     fun pauseCalledTwice() {
-        val state = BenchmarkState()
+        val state = BenchmarkStateLegacy()
 
         assertEquals(true, state.keepRunning())
         state.pauseTiming()
@@ -114,7 +112,7 @@
         )
 
         // verify priority is only bumped during loop (NOTE: lower number means higher priority)
-        val state = BenchmarkState()
+        val state = BenchmarkStateLegacy()
         while (state.keepRunning()) {
             val currentJitPriority = ThreadPriority.getJit()
             assertTrue(
@@ -136,7 +134,7 @@
         )
 
         // verify priority is only bumped during loop (NOTE: lower number means higher priority)
-        val state = BenchmarkState()
+        val state = BenchmarkStateLegacy()
         while (state.keepRunning()) {
             val currentPriority = ThreadPriority.get()
             assertTrue(
@@ -150,7 +148,7 @@
     private fun iterationCheck(simplifiedTimingOnlyMode: Boolean) {
         // disable thermal throttle checks, since it can cause loops to be thrown out
         // note that this bypasses allocation count
-        val state = BenchmarkState(simplifiedTimingOnlyMode = simplifiedTimingOnlyMode)
+        val state = BenchmarkStateLegacy(simplifiedTimingOnlyMode = simplifiedTimingOnlyMode)
         var total = 0
         while (state.keepRunning()) {
             total++
@@ -161,7 +159,7 @@
         // '50' assumes we're not running in a special mode
         // that affects repeat count (dry run)
         val expectedRepeatCount =
-            50 + if (simplifiedTimingOnlyMode) 0 else BenchmarkState.REPEAT_COUNT_ALLOCATION
+            50 + if (simplifiedTimingOnlyMode) 0 else BenchmarkStateLegacy.REPEAT_COUNT_ALLOCATION
         val expectedCount =
             testResult.warmupIterations!! +
                 testResult.repeatIterations!! * expectedRepeatCount +
@@ -198,7 +196,7 @@
     @Suppress("DEPRECATION")
     fun bundle() {
         val bundle =
-            BenchmarkState()
+            BenchmarkStateLegacy()
                 .apply {
                     while (keepRunning()) {
                         // nothing, we're ignoring numbers
@@ -236,7 +234,7 @@
     fun notStarted() {
         val initialPriority = ThreadPriority.get()
         try {
-            BenchmarkState().peekTestResult().metrics["timeNs"]!!.median
+            BenchmarkStateLegacy().peekTestResult().metrics["timeNs"]!!.median
             fail("expected exception")
         } catch (e: IllegalStateException) {
             assertEquals(initialPriority, ThreadPriority.get())
@@ -248,7 +246,7 @@
     fun notFinished() {
         val initialPriority = ThreadPriority.get()
         try {
-            BenchmarkState().run {
+            BenchmarkStateLegacy().run {
                 keepRunning()
                 peekTestResult().metrics["timeNs"]!!.median
             }
@@ -260,48 +258,25 @@
         }
     }
 
-    @OptIn(ExperimentalExternalReport::class)
-    @Test
-    fun reportResult() {
-        BenchmarkState.reportData(
-            className = "className",
-            testName = "testName",
-            totalRunTimeNs = 900000000,
-            dataNs = listOf(100L, 200L, 300L),
-            warmupIterations = 1,
-            thermalThrottleSleepSeconds = 0,
-            repeatIterations = 1
-        )
-        val expectedReport =
-            BenchmarkData.TestResult(
-                className = "className",
-                name = "testName",
-                totalRunTimeNs = 900000000,
-                metrics = listOf(MetricResult(name = "timeNs", data = listOf(100.0, 200.0, 300.0))),
-                repeatIterations = 1,
-                thermalThrottleSleepSeconds = 0,
-                warmupIterations = 1,
-                profilerOutputs = null,
-            )
-        assertEquals(expectedReport, ResultWriter.reports.last())
-    }
-
     @RequiresApi(22) // 21 profiler has flaky platform crashes, see b/353716346
     private fun validateProfilerUsage(simplifiedTimingOnlyMode: Boolean?) {
         val config = MicrobenchmarkConfig(profiler = ProfilerConfig.StackSamplingLegacy())
 
-        val benchmarkState =
+        val benchmarkStateLegacy =
             if (simplifiedTimingOnlyMode != null) {
-                BenchmarkState(config = config, simplifiedTimingOnlyMode = simplifiedTimingOnlyMode)
+                BenchmarkStateLegacy(
+                    config = config,
+                    simplifiedTimingOnlyMode = simplifiedTimingOnlyMode
+                )
             } else {
-                BenchmarkState(config)
+                BenchmarkStateLegacy(config)
             }
 
         // count iters with profiler enabled vs disabled
         var profilerDisabledIterations = 0
         var profilerEnabledIterations = 0
         var profilerAllocationIterations = 0
-        while (benchmarkState.keepRunning()) {
+        while (benchmarkStateLegacy.keepRunning()) {
             if (StackSamplingLegacy.isRunning) {
                 profilerEnabledIterations++
             } else {
@@ -345,10 +320,10 @@
     @Test
     fun experimentalConstructor() {
         // min values that don't fail
-        BenchmarkState(warmupCount = null, measurementCount = 1)
+        BenchmarkStateLegacy(warmupCount = null, measurementCount = 1)
 
         // test failures
-        assertFailsWith<IllegalArgumentException> { BenchmarkState(warmupCount = 0) }
-        assertFailsWith<IllegalArgumentException> { BenchmarkState(measurementCount = 0) }
+        assertFailsWith<IllegalArgumentException> { BenchmarkStateLegacy(warmupCount = 0) }
+        assertFailsWith<IllegalArgumentException> { BenchmarkStateLegacy(measurementCount = 0) }
     }
 }
diff --git a/benchmark/benchmark-common/src/androidTest/java/androidx/benchmark/BenchmarkStateConfigTest.kt b/benchmark/benchmark-common/src/androidTest/java/androidx/benchmark/MicrobenchmarkPhaseConfigTest.kt
similarity index 74%
copy from benchmark/benchmark-common/src/androidTest/java/androidx/benchmark/BenchmarkStateConfigTest.kt
copy to benchmark/benchmark-common/src/androidTest/java/androidx/benchmark/MicrobenchmarkPhaseConfigTest.kt
index bc0ea41..5fea55f 100644
--- a/benchmark/benchmark-common/src/androidTest/java/androidx/benchmark/BenchmarkStateConfigTest.kt
+++ b/benchmark/benchmark-common/src/androidTest/java/androidx/benchmark/MicrobenchmarkPhaseConfigTest.kt
@@ -22,12 +22,13 @@
 import androidx.test.filters.SmallTest
 import kotlin.test.assertEquals
 import kotlin.test.assertNotEquals
+import kotlinx.coroutines.runBlocking
 import org.junit.Test
 import org.junit.runner.RunWith
 
 @SmallTest
 @RunWith(AndroidJUnit4::class)
-class BenchmarkStateConfigTest {
+class MicrobenchmarkPhaseConfigTest {
     private fun validateConfig(
         config: MicrobenchmarkPhase.Config,
         expectedWarmups: Int?,
@@ -36,18 +37,39 @@
         expectedUsesProfiler: Boolean = false,
         expectedProfilerIterations: Int = 0
     ) {
-        val state = BenchmarkState(config)
         var count = 0
-        while (state.keepRunning()) {
-            // This spin loop works around an issue where nanoTime is only precise to 30us on some
-            // devices. This was reproduced on api 17 and emulators api 33. (b/331226761)
-            val start = System.nanoTime()
-            @Suppress("ControlFlowWithEmptyBody") while (System.nanoTime() == start) {}
-            count++
+        val output = runBlocking {
+            val microbenchmark =
+                Microbenchmark(
+                    TestDefinition(
+                        "MicrobenchmarkPhaseConfigTest",
+                        "MicrobenchmarkPhaseConfigTest",
+                        "methodName"
+                    ),
+                    phaseConfig = config,
+                    yieldThreadPeriodically = false,
+                    scopeFactory = { state: MicrobenchmarkRunningState ->
+                        MicrobenchmarkScope(state)
+                    },
+                    loopedMeasurementBlock = { _, loops ->
+                        repeat(loops) {
+                            // This spin loop works around an issue where nanoTime is only precise
+                            // to 30us on some
+                            // devices. This was reproduced on api 17 and emulators api 33.
+                            // (b/331226761)
+                            val start = System.nanoTime()
+                            @Suppress("ControlFlowWithEmptyBody")
+                            while (System.nanoTime() == start) {}
+                            count++
+                        }
+                    }
+                )
+            microbenchmark.executePhases()
+            microbenchmark.output(null)
         }
 
         val calculatedIterations =
-            state.warmupRepeats + expectedMeasurements * state.iterationsPerRepeat
+            output.warmupIterations + expectedMeasurements * output.repeatIterations
 
         val usesProfiler = config.generatePhases().any { it.profiler != null }
 
@@ -63,9 +85,11 @@
             assertEquals(expectedIterations, count)
         }
         if (expectedWarmups != null) {
-            assertEquals(expectedWarmups, state.warmupRepeats)
+            assertEquals(expectedWarmups, output.warmupIterations)
         }
-        assertNotEquals(0.0, state.getMinTimeNanos()) // just verify some value is set
+
+        val minNanos = output.metricResults.single { it.name == "timeNs" }.min
+        assertNotEquals(0.0, minNanos) // just verify some value is set
     }
 
     @Test
@@ -141,6 +165,24 @@
             expectedIterations = null, // iterations are dynamic
         )
 
+    @Test
+    fun trivial() =
+        validateConfig(
+            MicrobenchmarkPhase.Config(
+                dryRunMode = false,
+                startupMode = false,
+                simplifiedTimingOnlyMode = false,
+                profiler = null,
+                profilerPerfCompareMode = false,
+                warmupCount = 3,
+                measurementCount = 2,
+                metrics = arrayOf(TimeCapture()),
+            ),
+            expectedWarmups = 3,
+            expectedMeasurements = 7, // includes allocations
+            expectedIterations = null, // iterations are dynamic
+        )
+
     @SdkSuppress(minSdkVersion = 22) // See b/300658578
     @Test
     fun profilerMethodTracing() =
diff --git a/benchmark/benchmark-common/src/main/java/androidx/benchmark/Arguments.kt b/benchmark/benchmark-common/src/main/java/androidx/benchmark/Arguments.kt
index c352a21..ad3e72c 100644
--- a/benchmark/benchmark-common/src/main/java/androidx/benchmark/Arguments.kt
+++ b/benchmark/benchmark-common/src/main/java/androidx/benchmark/Arguments.kt
@@ -28,8 +28,9 @@
 @get:RestrictTo(RestrictTo.Scope.LIBRARY)
 @set:RestrictTo(RestrictTo.Scope.LIBRARY)
 @VisibleForTesting
-public var argumentSource: Bundle? = null
+var argumentSource: Bundle? = null
 
+@Suppress("NullableBooleanElvis") // suggestion makes boolean argument defaults less clear
 @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
 object Arguments {
     // public properties are shared by micro + macro benchmarks
diff --git a/benchmark/benchmark-common/src/main/java/androidx/benchmark/BenchmarkState.kt b/benchmark/benchmark-common/src/main/java/androidx/benchmark/BenchmarkState.kt
index 3c0e979..8114e29 100644
--- a/benchmark/benchmark-common/src/main/java/androidx/benchmark/BenchmarkState.kt
+++ b/benchmark/benchmark-common/src/main/java/androidx/benchmark/BenchmarkState.kt
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016 The Android Open Source Project
+ * Copyright 2024 The Android Open Source Project
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -16,25 +16,93 @@
 
 package androidx.benchmark
 
-import android.annotation.SuppressLint
-import android.os.Bundle
-import android.os.Looper
-import android.util.Log
-import androidx.annotation.IntRange
 import androidx.annotation.RestrictTo
-import androidx.annotation.VisibleForTesting
-import androidx.benchmark.Errors.PREFIX
-import androidx.benchmark.InstrumentationResults.instrumentationReport
-import androidx.benchmark.InstrumentationResults.reportBundle
-import androidx.benchmark.json.BenchmarkData
 import java.util.concurrent.TimeUnit
+import kotlin.coroutines.Continuation
+import kotlin.coroutines.CoroutineContext
+import kotlin.coroutines.EmptyCoroutineContext
+import kotlin.coroutines.intrinsics.COROUTINE_SUSPENDED
+import kotlin.coroutines.intrinsics.createCoroutineUnintercepted
+import kotlin.coroutines.intrinsics.suspendCoroutineUninterceptedOrReturn
+import kotlin.coroutines.resume
 
 /**
- * Control object for benchmarking in the code in Java.
+ * This function is used to allow BenchmarkState to provide its non-suspending keepRunning(), but
+ * underneath incrementally progress the underlying coroutine microbenchmark API as needed.
+ *
+ * It is optimized to allow the underlying coroutine API to be incrementally upgraded without any
+ * changes to BenchmarkState.
+ *
+ * This is modeled after the suspending iterator {} sequence builder in kotlin, but optimized for:
+ * - minimal allocation
+ * - keeping yields:resumes at 1:1 (for simplicity)
+ * - minimal virtual functions
+ *
+ * @see kotlin.sequences.iterator
+ */
+private fun createSuspendedLoop(
+    block: suspend SuspendedLoopTrigger.() -> Unit
+): SuspendedLoopTrigger {
+    val suspendedLoopTrigger = SuspendedLoopTrigger()
+    suspendedLoopTrigger.nextStep =
+        block.createCoroutineUnintercepted(
+            receiver = suspendedLoopTrigger,
+            completion = suspendedLoopTrigger
+        )
+    return suspendedLoopTrigger
+}
+
+/**
+ * SuspendedLoopTrigger functions as the bridge between the new coroutine measureRepeated
+ * implementation and the (soon to be) legacy Java API.
+ *
+ * It allows the vast majority of the benchmark library to be written in coroutines (with very
+ * deliberate suspend calls, generally just for yielding the main thread) and still function within
+ * a runBlocking block inside of `benchmarkState.keepRunning()`
+ *
+ * Eventually, the BenchmarkState api will be deprecated in favor of a Java-friendly variant of
+ * measureRepeated, but this code will remain (ideally without significant change) to support the
+ * BenchmarkState API in the long term.
+ */
+private class SuspendedLoopTrigger : Continuation<Unit> {
+    @JvmField var nextStep: Continuation<Unit>? = null
+    private var next: Int = -1
+    private var done: Boolean = false
+
+    /**
+     * Schedule the loop manager Yields a value of loops to be run by the user of the
+     * SuspendedLoopTrigger.
+     */
+    suspend fun awaitLoops(loopCount: Int) {
+        next = loopCount
+        suspendCoroutineUninterceptedOrReturn { c ->
+            nextStep = c
+            COROUTINE_SUSPENDED
+        }
+    }
+
+    /** Gets the number of loops to run before calling [getNextLoopCount] again */
+    fun getNextLoopCount(): Int {
+        if (done) return 0
+        nextStep!!.resume(Unit)
+        return next
+    }
+
+    override val context: CoroutineContext
+        get() = EmptyCoroutineContext
+
+    override fun resumeWith(result: Result<Unit>) {
+        result.getOrThrow() // just rethrow exception if it is there
+        done = true
+    }
+}
+
+/**
+ * Control object for microbenchmarking in Java.
  *
  * Query a state object with [androidx.benchmark.junit4.BenchmarkRule.getState], and use it to
- * measure a block of Java with [BenchmarkState.keepRunning]:
- * ```java
+ * measure a block of Java with [BenchmarkStateLegacy.keepRunning]:
+ * ```
  * @Rule
  * public BenchmarkRule benchmarkRule = new BenchmarkRule();
  *
@@ -50,589 +118,72 @@
  * }
  * ```
  *
- * @see androidx.benchmark.junit4.BenchmarkRule.getState()
+ * Note that BenchmarkState does not give access to Perfetto traces.
  */
-class BenchmarkState internal constructor(phaseConfig: MicrobenchmarkPhase.Config) {
-
-    /**
-     * Create a BenchmarkState for custom measurement behavior.
-     *
-     * @param warmupCount Number of non-measured warmup iterations to perform, leave null to
-     *   determine automatically
-     * @param repeatCount Number of measurements to perform, leave null for default behavior
-     */
-    @ExperimentalBenchmarkStateApi
-    constructor(
-        @SuppressWarnings("AutoBoxing") // allocations for tests not relevant, not in critical path
-        warmupCount: Int? = null,
-        @SuppressWarnings("AutoBoxing") // allocations for tests not relevant, not in critical path
-        repeatCount: Int? = null
-    ) : this(
-        warmupCount = warmupCount,
-        measurementCount = repeatCount,
-        simplifiedTimingOnlyMode = false
-    )
-
-    /** Constructor used for standard uses of BenchmarkState, e.g. in BenchmarkRule */
+class BenchmarkState
+@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
+constructor(testDefinition: TestDefinition, private val config: MicrobenchmarkConfig) {
+    // Secondary explicit constructor allows for internal usage without experimental config opt in
     @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
-    constructor(
-        config: MicrobenchmarkConfig? = null
-    ) : this(warmupCount = null, simplifiedTimingOnlyMode = false, config = config)
+    constructor(testDefinition: TestDefinition) : this(testDefinition, MicrobenchmarkConfig())
 
-    internal constructor(
-        warmupCount: Int? = null,
-        measurementCount: Int? = null,
-        simplifiedTimingOnlyMode: Boolean = false,
-        config: MicrobenchmarkConfig? = null
-    ) : this(
-        MicrobenchmarkPhase.Config(
-            dryRunMode = Arguments.dryRunMode,
-            startupMode = Arguments.startupMode,
-            profiler = config?.profiler?.profiler ?: Arguments.profiler,
-            profilerPerfCompareMode = Arguments.profilerPerfCompareEnable,
-            warmupCount = warmupCount,
-            measurementCount = Arguments.iterations ?: measurementCount,
-            simplifiedTimingOnlyMode = simplifiedTimingOnlyMode,
-            metrics =
-                config?.metrics?.toTypedArray()
-                    ?: if (Arguments.cpuEventCounterMask != 0) {
-                        arrayOf(
-                            TimeCapture(),
-                            CpuEventCounterCapture(
-                                MicrobenchmarkPhase.cpuEventCounter,
-                                Arguments.cpuEventCounterMask
-                            )
-                        )
-                    } else {
-                        arrayOf(TimeCapture())
-                    }
+    @JvmField
+    @PublishedApi // Previously used by [BenchmarkState.keepRunningInline()]
+    internal var iterationsRemaining = 0
+
+    /** Ideally we'd call into the top level function, but it's non-suspending */
+    private var internalIter = createSuspendedLoop {
+        // Theoretically we'd ideally call into the top level measureRepeated function, but
+        // that function isn't suspending. Making it suspend would allow this call to perform
+        // tracing, but would significantly complicate the thread management of outer layers (e.g.
+        // carefully scheduling where trace capture start/end happens). As this is compat code, we
+        // don't bother.
+        measureRepeatedImplNoTracing(
+            testDefinition,
+            config = config,
+            loopedMeasurementBlock = { microbenchScope, loops ->
+                scope = microbenchScope
+                awaitLoops(loops)
+            }
         )
-    )
-
-    /**
-     * Set this to true to run a simplified timing loop - no allocation tracking, and no global
-     * state set/reset (such as thread priorities)
-     *
-     * This var is used in one of two cases, either set to true by [ThrottleDetector.measureWorkNs]
-     * when device performance testing for thermal throttling in between benchmarks, or in
-     * correctness tests of this library.
-     *
-     * When set to true, indicates that this BenchmarkState **should not**:
-     * - touch thread priorities
-     * - perform allocation counting (only timing results matter)
-     * - call [ThrottleDetector], since it would infinitely recurse
-     */
-    private val simplifiedTimingOnlyMode = phaseConfig.simplifiedTimingOnlyMode
-
-    @get:RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
-    @set:RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
-    var traceUniqueName: String = "benchmark"
-
-    internal var warmupRepeats = 0 // number of warmup repeats that occurred
-
-    /**
-     * Decreasing iteration count used when running a multi-iteration measurement phase Used to
-     * determine when a main measurement stage finishes.
-     */
-    @JvmField // Used by [BenchmarkState.keepRunningInline()]
-    @PublishedApi
-    internal var iterationsRemaining: Int = -1
-
-    @Suppress("NOTHING_TO_INLINE")
-    @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
-    inline fun getIterationsRemaining() = iterationsRemaining
-
-    /**
-     * Number of iterations in a repeat.
-     *
-     * This value is defined in the json, but is written as maximum iterationsPerRepeat across
-     * phases, since nowadays there can be an arbitrary number of phases.
-     *
-     * This is fully compatible for now since e.g. timing and allocation measurement use the same
-     * value, but we should consider tracking and reporting this differently in the json if this
-     * changes.
-     */
-    @VisibleForTesting internal var iterationsPerRepeat = 1
-
-    private val warmupManager = phaseConfig.warmupManager
-
-    private var paused = false
-
-    /** The total duration of sleep due to thermal throttling. */
-    private var thermalThrottleSleepSeconds: Long = 0
-    private var totalRunTimeStartNs: Long = 0 // System.nanoTime() at start of benchmark.
-    private var totalRunTimeNs: Long = 0 // Total run time of a benchmark.
-
-    private var warmupEstimatedIterationTimeNs: Long = -1L
-
-    private val metricResults = mutableListOf<MetricResult>()
-    private var profilerResult: Profiler.ResultFile? = null
-    private val phases = phaseConfig.generatePhases()
-
-    // tracking current phase state
-    private var phaseIndex = -1
-    private var currentPhase: MicrobenchmarkPhase = phases[0]
-    private var currentMetrics: MetricsContainer = phases[0].metricsContainer
-    private var currentMeasurement = 0
-    private var currentLoopsPerMeasurement = 0
-
-    @SuppressLint("MethodNameUnits")
-    @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
-    fun getMinTimeNanos(): Double {
-        checkFinished()
-        return metricResults.first { it.name == "timeNs" }.min
     }
 
-    private fun checkFinished() {
-        check(phaseIndex >= 0) { "Attempting to interact with a benchmark that wasn't started!" }
-        check(phaseIndex >= phases.size) {
-            "The benchmark hasn't finished! In Java, use " +
-                "while(BenchmarkState.keepRunning()) to ensure keepRunning() returns " +
-                "false before ending your test. In Kotlin, just use " +
-                "benchmarkRule.measureRepeated {} to avoid the problem."
-        }
-    }
+    @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP) @JvmField var scope: MicrobenchmarkScope? = null
 
-    /**
-     * Stops the benchmark timer.
-     *
-     * This method can be called only when the timer is running.
-     *
-     * ```
-     * @Test
-     * public void bitmapProcessing() {
-     *     final BenchmarkState state = mBenchmarkRule.getState();
-     *     while (state.keepRunning()) {
-     *         state.pauseTiming();
-     *         // disable timing while constructing test input
-     *         Bitmap input = constructTestBitmap();
-     *         state.resumeTiming();
-     *
-     *         processBitmap(input);
-     *     }
-     * }
-     * ```
-     *
-     * @throws [IllegalStateException] if the benchmark is already paused.
-     * @see resumeTiming
-     */
     fun pauseTiming() {
-        check(!paused) { "Unable to pause the benchmark. The benchmark has already paused." }
-        currentMetrics.capturePaused()
-        paused = true
+        scope!!.pauseMeasurement()
     }
 
-    /**
-     * Resumes the benchmark timer.
-     *
-     * This method can be called only when the timer is stopped.
-     *
-     * ```
-     * @Test
-     * public void bitmapProcessing() {
-     *     final BenchmarkState state = mBenchmarkRule.getState();
-     *     while (state.keepRunning()) {
-     *         state.pauseTiming();
-     *         // disable timing while constructing test input
-     *         Bitmap input = constructTestBitmap();
-     *         state.resumeTiming();
-     *
-     *         processBitmap(input);
-     *     }
-     * }
-     * ```
-     *
-     * @throws [IllegalStateException] if the benchmark is already running.
-     * @see pauseTiming
-     */
     fun resumeTiming() {
-        check(paused) { "Unable to resume the benchmark. The benchmark is already running." }
-        currentMetrics.captureResumed()
-        paused = false
+        scope!!.resumeMeasurement()
     }
 
-    private fun startNextPhase(): Boolean {
-        check(phaseIndex < phases.size)
-
-        if (phaseIndex >= 0) {
-            currentPhase.profiler?.run { inMemoryTrace("profiler.stop()") { stop() } }
-            InMemoryTracing.endSection() // end phase
-            thermalThrottleSleepSeconds += currentPhase.thermalThrottleSleepSeconds
-            if (currentPhase.loopMode.warmupManager == null) {
-                // Save captured metrics except during warmup, where we intentionally discard
-                metricResults.addAll(
-                    currentMetrics.captureFinished(maxIterations = currentLoopsPerMeasurement)
-                )
-            }
-        }
-        phaseIndex++
-        if (phaseIndex == phases.size) {
-            afterBenchmark()
-            return false
-        }
-        currentPhase = phases[phaseIndex]
-        currentMetrics = currentPhase.metricsContainer
-        currentMeasurement = 0
-
-        currentMetrics.captureInit()
-        if (currentPhase.gcBeforePhase) {
-            // Run GC to avoid memory pressure from previous run from affecting this one.
-            // Note, we don't use System.gc() because it doesn't always have consistent behavior
-            Runtime.getRuntime().gc()
-        }
-
-        currentLoopsPerMeasurement =
-            currentPhase.loopMode.getIterations(warmupEstimatedIterationTimeNs)
-
-        iterationsPerRepeat = iterationsPerRepeat.coerceAtLeast(currentLoopsPerMeasurement)
-
-        InMemoryTracing.beginSection(currentPhase.label)
-        val phaseProfilerResult =
-            currentPhase.profiler?.run {
-                val estimatedMethodTraceDurNs =
-                    warmupEstimatedIterationTimeNs * METHOD_TRACING_ESTIMATED_SLOWDOWN_FACTOR
-                if (
-                    this == MethodTracing &&
-                        Looper.myLooper() == Looper.getMainLooper() &&
-                        estimatedMethodTraceDurNs > METHOD_TRACING_MAX_DURATION_NS &&
-                        Arguments.profilerSkipWhenDurationRisksAnr
-                ) {
-                    val expectedDurSec = estimatedMethodTraceDurNs / 1_000_000_000.0
-                    InstrumentationResults.scheduleIdeWarningOnNextReport(
-                        """
-                        Skipping method trace of estimated duration $expectedDurSec sec to avoid ANR
-
-                        To disable this behavior, set instrumentation arg:
-                            androidx.benchmark.profiling.skipWhenDurationRisksAnr = false
-                    """
-                            .trimIndent()
-                    )
-                    null
-                } else {
-                    inMemoryTrace("start profiling") { start(traceUniqueName) }
-                }
-            }
-        if (phaseProfilerResult != null) {
-            require(profilerResult == null) {
-                "ProfileResult already set, only support one profiling phase"
-            }
-            profilerResult = phaseProfilerResult
-        }
-
-        // Warm up the metrics data structure to reduce the impact on the first measurement.
-        currentMetrics.captureStart()
-        currentMetrics.captureStop()
-        currentMetrics.captureInit()
-
-        currentMetrics.captureStart()
-        return true
-    }
-
-    /** @return true if the benchmark should still keep running */
-    private fun onMeasurementComplete(): Boolean {
-        currentMetrics.captureStop()
-        throwIfPaused()
-        currentMeasurement++
-
-        val tryStartNextPhase =
-            currentPhase.loopMode.let {
-                if (it.warmupManager != null) {
-                    // warmup phase
-                    currentMetrics.captureInit()
-                    // Note that warmup is based on repeat time, *not* the timeNs metric, since we
-                    // want
-                    // to account for paused time during warmup (paused work should stabilize too)
-                    val lastMeasuredWarmupValue = currentMetrics.peekSingleRepeatTime()
-                    if (it.warmupManager.onNextIteration(lastMeasuredWarmupValue)) {
-                        warmupEstimatedIterationTimeNs = lastMeasuredWarmupValue
-                        warmupRepeats = currentMeasurement
-                        true
-                    } else {
-                        false
-                    }
-                } else {
-                    currentMeasurement == currentPhase.measurementCount
-                }
-            }
-        return if (tryStartNextPhase) {
-            if (currentPhase.tryEnd()) {
-                startNextPhase()
-            } else {
-                // failed capture (due to thermal throttling), restart profiler and metrics
-                currentPhase.profiler?.apply {
-                    stop()
-                    profilerResult = inMemoryTrace("start profiling") { start(traceUniqueName) }
-                }
-                currentMetrics.captureInit()
-                currentMeasurement = 0
-                true
-            }
-        } else {
-            currentMetrics.captureStart()
-            true
-        }
-    }
-
-    /**
-     * Inline fast-path function for inner benchmark loop.
-     *
-     * Kotlin users should use `BenchmarkRule.measureRepeated`
-     *
-     * This code path uses exclusively @JvmField/const members, so there are no method calls at all
-     * in the inlined loop. On recent Android Platform versions, ART inlines these accessors anyway,
-     * but we want to be sure it's as simple as possible.
-     */
-    @Suppress("NOTHING_TO_INLINE")
-    @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
-    inline fun keepRunningInline(): Boolean {
-        if (iterationsRemaining > 1) {
-            iterationsRemaining--
-            return true
-        }
-        return keepRunningInternal()
-    }
-
-    /**
-     * Returns true if the benchmark needs more samples - use this as the condition of a while loop.
-     *
-     * ```
-     * while (state.keepRunning()) {
-     *     int[] dest = new int[src.length];
-     *     System.arraycopy(src, 0, dest, 0, src.length);
-     * }
-     * ```
-     */
-    fun keepRunning(): Boolean {
-        if (iterationsRemaining > 1) {
-            iterationsRemaining--
-            return true
-        }
-        return keepRunningInternal()
-    }
-
-    /**
-     * Reimplementation of Kotlin check, which also resets thread priority, since we don't want to
-     * leave a thread with bumped thread priority
-     */
-    private inline fun check(value: Boolean, lazyMessage: () -> String) {
-        if (!value) {
-            cleanupBeforeThrow()
-            throw IllegalStateException(lazyMessage())
-        }
-    }
-
-    /**
-     * Ideally this would only be called when an exception is observed in measureRepeated, but to
-     * account for java callers, we explicitly trigger before throwing as well.
-     */
-    @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
-    fun cleanupBeforeThrow() {
-        if (phaseIndex >= 0 && phaseIndex <= phases.size) {
-            Log.d(TAG, "aborting and cancelling benchmark")
-            // current phase cancelled, complete current phase cleanup (trace event and profiling)
-            InMemoryTracing.endSection()
-            currentPhase.profiler?.run { inMemoryTrace("profiling stop") { stop() } }
-
-            // for safety, set other state to done and do broader cleanup
-            phaseIndex = phases.size
-            afterBenchmark()
-        }
-    }
-
-    /**
-     * Internal loop control for benchmarks - will return true as long as there are more
-     * measurements to perform.
-     *
-     * Actual benchmarks should always go through [keepRunning] or [keepRunningInline], since they
-     * optimize the *Iteration* step to have extremely minimal logic performed.
-     *
-     * The looping behavior is functionally multiple nested loops, e.g.:
-     * - Stage - RUNNING_WARMUP vs RUNNING_TIME
-     * - Measurement - how many times iterations are measured
-     * - Iteration - how many iterations/loops are run between each measurement
-     *
-     * This has the effect of a 3 layer nesting loop structure, but all condensed to a single method
-     * returning true/false to simplify the entry point.
-     *
-     * @return whether the benchmarking system has anything left to do
-     */
     @PublishedApi
     internal fun keepRunningInternal(): Boolean {
-        val shouldKeepRunning =
-            if (phaseIndex == -1) {
-                // Initialize
-                beforeBenchmark()
-                startNextPhase()
-            } else {
-                // Trigger another repeat within current phase
-                onMeasurementComplete()
-            }
-
-        iterationsRemaining = currentLoopsPerMeasurement
-        return shouldKeepRunning
+        iterationsRemaining = internalIter.getNextLoopCount()
+        if (iterationsRemaining > 0) {
+            iterationsRemaining--
+            return true
+        }
+        return false
     }
 
-    private fun beforeBenchmark() {
-        Errors.throwIfError()
-        if (!firstBenchmark && Arguments.startupMode) {
-            throw AssertionError(
-                "Error - multiple benchmarks in startup mode. Only one " +
-                    "benchmark may be run per 'am instrument' call, to ensure result " +
-                    "isolation."
-            )
+    fun keepRunning(): Boolean {
+        if (iterationsRemaining > 0) {
+            iterationsRemaining--
+            return true
         }
-        check(DeviceInfo.artMainlineVersion != DeviceInfo.ART_MAINLINE_VERSION_UNDETECTED_ERROR) {
-            "Unable to detect ART mainline module version to check for interference from method" +
-                " tracing, please see logcat for details, and/or file a bug with logcat."
-        }
-        check(
-            !enableMethodTracingAffectsMeasurementError ||
-                !DeviceInfo.methodTracingAffectsMeasurements ||
-                !MethodTracing.hasBeenUsed
-        ) {
-            "Measurement prevented by method trace - Running on a device/configuration where " +
-                "method tracing affects measurements, and a method trace has been captured " +
-                "- no additional benchmarks can be run without restarting the test suite. Use " +
-                "ProfilerConfig.MethodTracing.affectsMeasurementOnThisDevice to detect affected " +
-                "devices, see its documentation for more info."
-        }
-
-        thermalThrottleSleepSeconds = 0
-
-        if (!simplifiedTimingOnlyMode) {
-            ThrottleDetector.computeThrottleBaselineIfNeeded()
-            ThreadPriority.bumpCurrentThreadPriority()
-        }
-
-        totalRunTimeStartNs = System.nanoTime() // Record this time to find total duration
+        return keepRunningInternal()
     }
 
-    private fun afterBenchmark() {
-        totalRunTimeNs = System.nanoTime() - totalRunTimeStartNs
-
-        if (!simplifiedTimingOnlyMode) {
-            // Don't modify thread priority when checking for thermal throttling, since 'outer'
-            // BenchmarkState owns thread priority
-            ThreadPriority.resetBumpedThread()
-        }
-        warmupManager.logInfo()
-    }
-
-    private fun throwIfPaused() =
-        check(!paused) {
-            "Benchmark loop finished in paused state." +
-                " Call BenchmarkState.resumeTiming() before BenchmarkState.keepRunning()."
-        }
-
-    private fun getTestResult(testName: String, className: String, perfettoTracePath: String?) =
-        BenchmarkData.TestResult(
-            name = testName,
-            className = className,
-            totalRunTimeNs = totalRunTimeNs,
-            metrics = metricResults,
-            warmupIterations = warmupRepeats,
-            repeatIterations = iterationsPerRepeat,
-            thermalThrottleSleepSeconds = thermalThrottleSleepSeconds,
-            profilerOutputs =
-                listOfNotNull(
-                    perfettoTracePath?.let {
-                        BenchmarkData.TestResult.ProfilerOutput(
-                            Profiler.ResultFile.ofPerfettoTrace(
-                                label = "Trace",
-                                absolutePath = perfettoTracePath
-                            )
-                        )
-                    },
-                    profilerResult?.let { BenchmarkData.TestResult.ProfilerOutput(it) }
-                )
-        )
-
-    @ExperimentalBenchmarkStateApi
-    fun getMeasurementTimeNs(): List<Double> = metricResults.first { it.name == "timeNs" }.data
-
-    internal fun peekTestResult() =
-        checkFinished().run {
-            getTestResult(testName = "", className = "", perfettoTracePath = null)
-        }
-
-    /**
-     * Acquires a status report bundle
-     *
-     * @param key Run identifier, prepended to bundle properties.
-     * @param reportMetrics True if stats should be included in the output bundle.
-     */
-    internal fun getFullStatusReport(
-        key: String,
-        reportMetrics: Boolean,
-        tracePath: String?
-    ): Bundle {
-        Log.i(TAG, key + metricResults.map { it.getSummary() } + "count=$iterationsPerRepeat")
-        val status = Bundle()
-        if (reportMetrics) {
-            // these 'legacy' CI output metrics are considered output
-            metricResults.forEach { it.putInBundle(status, PREFIX) }
-        }
-        InstrumentationResultScope(status)
-            .reportSummaryToIde(
-                testName = key,
-                measurements =
-                    Measurements(singleMetrics = metricResults, sampledMetrics = emptyList()),
-                profilerResults =
-                    listOfNotNull(
-                        tracePath?.let {
-                            Profiler.ResultFile.ofPerfettoTrace(
-                                label = "Trace",
-                                absolutePath = tracePath
-                            )
-                        },
-                        profilerResult
-                    )
-            )
-        return status
-    }
-
-    @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
-    fun report(
-        fullClassName: String,
-        simpleClassName: String,
-        methodName: String,
-        perfettoTracePath: String?
-    ) {
-        if (phaseIndex == -1) {
-            return // nothing to report, BenchmarkState wasn't used
-        }
-
-        profilerResult?.convertBeforeSync?.invoke()
-        if (perfettoTracePath != null) {
-            profilerResult?.embedInPerfettoTrace(perfettoTracePath)
-        }
-
-        checkFinished() // this method is triggered externally
-        val fullTestName = "$PREFIX$simpleClassName.$methodName"
-        val bundle =
-            getFullStatusReport(
-                key = fullTestName,
-                reportMetrics = !Arguments.dryRunMode,
-                tracePath = perfettoTracePath
-            )
-        reportBundle(bundle)
-        ResultWriter.appendTestResult(
-            getTestResult(
-                testName = PREFIX + methodName,
-                className = fullClassName,
-                perfettoTracePath = perfettoTracePath
-            )
-        )
-    }
-
+    // Note: Constants left here to avoid churn, but should eventually be moved out to more
+    // appropriate locations
     companion object {
         internal const val TAG = "Benchmark"
 
-        internal const val REPEAT_COUNT_ALLOCATION = 5
-
         /**
-         * Conservative estimate for how much method tracing slows down runtime how much longer will
-         * `methodTrace {x()}` be than `x()`
+         * Conservative estimate for how much method tracing slows down runtime - how much longer
+         * will `methodTrace {x()}` be than `x()` for nontrivial workloads.
          *
          * This is a conservative estimate, better version of this would account for OS/Art version
          *
@@ -649,11 +200,10 @@
         internal const val METHOD_TRACING_MAX_DURATION_NS = 4_000_000_000
 
         internal val DEFAULT_MEASUREMENT_DURATION_NS = TimeUnit.MILLISECONDS.toNanos(100)
+
         internal val SAMPLED_PROFILER_DURATION_NS =
             TimeUnit.SECONDS.toNanos(Arguments.profilerSampleDurationSeconds)
 
-        private var firstBenchmark = true
-
         /**
          * Used to disable error to enable internal correctness tests, which need to use method
          * tracing and can safely ignore measurement accuracy
@@ -662,67 +212,5 @@
          * error functionality doesn't handle changing error states dynamically
          */
         internal var enableMethodTracingAffectsMeasurementError = true
-
-        @RequiresOptIn
-        @Retention(AnnotationRetention.BINARY)
-        @Target(AnnotationTarget.FUNCTION)
-        annotation class ExperimentalExternalReport
-
-        /**
-         * Hooks for benchmarks not using [androidx.benchmark.junit4.BenchmarkRule] to register
-         * results.
-         *
-         * Results are printed to Studio console, and added to the output JSON file.
-         *
-         * @param className Name of class the benchmark runs in
-         * @param testName Name of the benchmark
-         * @param totalRunTimeNs The total run time of the benchmark
-         * @param dataNs List of all measured timing results, in nanoseconds
-         * @param warmupIterations Number of iterations of warmup before measurements started.
-         *   Should be no less than 0.
-         * @param thermalThrottleSleepSeconds Number of seconds benchmark was paused during thermal
-         *   throttling.
-         * @param repeatIterations Number of iterations in between each measurement. Should be no
-         *   less than 1.
-         */
-        @JvmStatic
-        @ExperimentalExternalReport
-        fun reportData(
-            className: String,
-            testName: String,
-            @IntRange(from = 0) totalRunTimeNs: Long,
-            dataNs: List<Long>,
-            @IntRange(from = 0) warmupIterations: Int,
-            @IntRange(from = 0) thermalThrottleSleepSeconds: Long,
-            @IntRange(from = 1) repeatIterations: Int
-        ) {
-            val metricsContainer = MetricsContainer(repeatCount = dataNs.size)
-            dataNs.forEachIndexed { index, value -> metricsContainer.data[index][0] = value }
-            val metrics = metricsContainer.captureFinished(maxIterations = 1)
-            val report =
-                BenchmarkData.TestResult(
-                    className = className,
-                    name = testName,
-                    totalRunTimeNs = totalRunTimeNs,
-                    metrics = metrics,
-                    repeatIterations = repeatIterations,
-                    thermalThrottleSleepSeconds = thermalThrottleSleepSeconds,
-                    warmupIterations = warmupIterations,
-                    profilerOutputs = null,
-                )
-            // Report value to Studio console
-            val fullTestName =
-                PREFIX + if (className.isNotEmpty()) "$className.$testName" else testName
-
-            instrumentationReport {
-                reportSummaryToIde(
-                    testName = fullTestName,
-                    measurements = Measurements(metrics, emptyList()),
-                )
-            }
-
-            // Report values to file output
-            ResultWriter.appendTestResult(report)
-        }
     }
 }
diff --git a/benchmark/benchmark-common/src/main/java/androidx/benchmark/BenchmarkStateLegacy.kt b/benchmark/benchmark-common/src/main/java/androidx/benchmark/BenchmarkStateLegacy.kt
new file mode 100644
index 0000000..54021db
--- /dev/null
+++ b/benchmark/benchmark-common/src/main/java/androidx/benchmark/BenchmarkStateLegacy.kt
@@ -0,0 +1,722 @@
+/*
+ * Copyright (C) 2016 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 androidx.benchmark
+
+import android.annotation.SuppressLint
+import android.os.Bundle
+import android.os.Looper
+import android.util.Log
+import androidx.annotation.IntRange
+import androidx.annotation.RestrictTo
+import androidx.annotation.VisibleForTesting
+import androidx.benchmark.Errors.PREFIX
+import androidx.benchmark.InstrumentationResults.instrumentationReport
+import androidx.benchmark.InstrumentationResults.reportBundle
+import androidx.benchmark.json.BenchmarkData
+import java.util.concurrent.TimeUnit
+
+/**
+ * Control object for benchmarking in the code in Java.
+ *
+ * Query a state object with [androidx.benchmark.junit4.BenchmarkRule.getState], and use it to
+ * measure a block of Java with [BenchmarkStateLegacy.keepRunning]:
+ * ```java
+ * @Rule
+ * public BenchmarkRule benchmarkRule = new BenchmarkRule();
+ *
+ * @Test
+ * public void sampleMethod() {
+ *     BenchmarkState state = benchmarkRule.getState();
+ *
+ *     int[] src = new int[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
+ *     while (state.keepRunning()) {
+ *         int[] dest = new int[src.length];
+ *         System.arraycopy(src, 0, dest, 0, src.length);
+ *     }
+ * }
+ * ```
+ *
+ * @see androidx.benchmark.junit4.BenchmarkRule.getState()
+ */
+@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP) // temporarily left in place
+class BenchmarkStateLegacy internal constructor(phaseConfig: MicrobenchmarkPhase.Config) {
+
+    /**
+     * Create a BenchmarkState for custom measurement behavior.
+     *
+     * @param warmupCount Number of non-measured warmup iterations to perform, leave null to
+     *   determine automatically
+     * @param repeatCount Number of measurements to perform, leave null for default behavior
+     */
+    @ExperimentalBenchmarkStateApi
+    constructor(
+        @SuppressWarnings("AutoBoxing") // allocations for tests not relevant, not in critical path
+        warmupCount: Int? = null,
+        @SuppressWarnings("AutoBoxing") // allocations for tests not relevant, not in critical path
+        repeatCount: Int? = null
+    ) : this(
+        warmupCount = warmupCount,
+        measurementCount = repeatCount,
+        simplifiedTimingOnlyMode = false
+    )
+
+    /** Constructor used for standard uses of BenchmarkState, e.g. in BenchmarkRule */
+    @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
+    constructor(
+        config: MicrobenchmarkConfig? = null
+    ) : this(warmupCount = null, simplifiedTimingOnlyMode = false, config = config)
+
+    internal constructor(
+        warmupCount: Int? = null,
+        measurementCount: Int? = null,
+        simplifiedTimingOnlyMode: Boolean = false,
+        config: MicrobenchmarkConfig? = null
+    ) : this(
+        MicrobenchmarkPhase.Config(
+            dryRunMode = Arguments.dryRunMode,
+            startupMode = Arguments.startupMode,
+            profiler = config?.profiler?.profiler ?: Arguments.profiler,
+            profilerPerfCompareMode = Arguments.profilerPerfCompareEnable,
+            warmupCount = warmupCount,
+            measurementCount = Arguments.iterations ?: measurementCount,
+            simplifiedTimingOnlyMode = simplifiedTimingOnlyMode,
+            metrics =
+                config?.metrics?.toTypedArray()
+                    ?: if (Arguments.cpuEventCounterMask != 0) {
+                        arrayOf(
+                            TimeCapture(),
+                            CpuEventCounterCapture(
+                                MicrobenchmarkPhase.cpuEventCounter,
+                                Arguments.cpuEventCounterMask
+                            )
+                        )
+                    } else {
+                        arrayOf(TimeCapture())
+                    }
+        )
+    )
+
+    /**
+     * Set this to true to run a simplified timing loop - no allocation tracking, and no global
+     * state set/reset (such as thread priorities)
+     *
+     * This var is used in one of two cases, either set to true by [ThrottleDetector.measureWorkNs]
+     * when device performance testing for thermal throttling in between benchmarks, or in
+     * correctness tests of this library.
+     *
+     * When set to true, indicates that this BenchmarkState **should not**:
+     * - touch thread priorities
+     * - perform allocation counting (only timing results matter)
+     * - call [ThrottleDetector], since it would infinitely recurse
+     */
+    private val simplifiedTimingOnlyMode = phaseConfig.simplifiedTimingOnlyMode
+
+    @get:RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
+    @set:RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
+    var traceUniqueName: String = "benchmark"
+
+    internal var warmupRepeats = 0 // number of warmup repeats that occurred
+
+    /**
+     * Decreasing iteration count used when running a multi-iteration measurement phase Used to
+     * determine when a main measurement stage finishes.
+     */
+    @Suppress("ShowingMemberInHiddenClass")
+    @JvmField
+    @PublishedApi // previously used by [BenchmarkState.keepRunningInline()]
+    internal var iterationsRemaining: Int = -1
+
+    @Suppress("NOTHING_TO_INLINE")
+    @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
+    inline fun getIterationsRemaining() = iterationsRemaining
+
+    /**
+     * Number of iterations in a repeat.
+     *
+     * This value is defined in the json, but is written as maximum iterationsPerRepeat across
+     * phases, since nowadays there can be an arbitrary number of phases.
+     *
+     * This is fully compatible for now since e.g. timing and allocation measurement use the same
+     * value, but we should consider tracking and reporting this differently in the json if this
+     * changes.
+     */
+    @VisibleForTesting internal var iterationsPerRepeat = 1
+
+    private val warmupManager = phaseConfig.warmupManager
+
+    private var paused = false
+
+    /** The total duration of sleep due to thermal throttling. */
+    private var thermalThrottleSleepSeconds: Long = 0
+    private var totalRunTimeStartNs: Long = 0 // System.nanoTime() at start of benchmark.
+    private var totalRunTimeNs: Long = 0 // Total run time of a benchmark.
+
+    private var warmupEstimatedIterationTimeNs: Long = -1L
+
+    private val metricResults = mutableListOf<MetricResult>()
+    private var profilerResult: Profiler.ResultFile? = null
+    private val phases = phaseConfig.generatePhases()
+
+    // tracking current phase state
+    private var phaseIndex = -1
+    private var currentPhase: MicrobenchmarkPhase = phases[0]
+    private var currentMetrics: MetricsContainer = phases[0].metricsContainer
+    private var currentMeasurement = 0
+    private var currentLoopsPerMeasurement = 0
+
+    @SuppressLint("MethodNameUnits")
+    @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
+    fun getMinTimeNanos(): Double {
+        checkFinished()
+        return metricResults.first { it.name == "timeNs" }.min
+    }
+
+    private fun checkFinished() {
+        check(phaseIndex >= 0) { "Attempting to interact with a benchmark that wasn't started!" }
+        check(phaseIndex >= phases.size) {
+            "The benchmark hasn't finished! In Java, use " +
+                "while(BenchmarkState.keepRunning()) to ensure keepRunning() returns " +
+                "false before ending your test. In Kotlin, just use " +
+                "benchmarkRule.measureRepeated {} to avoid the problem."
+        }
+    }
+
+    /**
+     * Stops the benchmark timer.
+     *
+     * This method can be called only when the timer is running.
+     *
+     * ```
+     * @Test
+     * public void bitmapProcessing() {
+     *     final BenchmarkState state = mBenchmarkRule.getState();
+     *     while (state.keepRunning()) {
+     *         state.pauseTiming();
+     *         // disable timing while constructing test input
+     *         Bitmap input = constructTestBitmap();
+     *         state.resumeTiming();
+     *
+     *         processBitmap(input);
+     *     }
+     * }
+     * ```
+     *
+     * @throws [IllegalStateException] if the benchmark is already paused.
+     * @see resumeTiming
+     */
+    fun pauseTiming() {
+        check(!paused) { "Unable to pause the benchmark. The benchmark has already paused." }
+        currentMetrics.capturePaused()
+        paused = true
+    }
+
+    /**
+     * Resumes the benchmark timer.
+     *
+     * This method can be called only when the timer is stopped.
+     *
+     * ```
+     * @Test
+     * public void bitmapProcessing() {
+     *     final BenchmarkState state = mBenchmarkRule.getState();
+     *     while (state.keepRunning()) {
+     *         state.pauseTiming();
+     *         // disable timing while constructing test input
+     *         Bitmap input = constructTestBitmap();
+     *         state.resumeTiming();
+     *
+     *         processBitmap(input);
+     *     }
+     * }
+     * ```
+     *
+     * @throws [IllegalStateException] if the benchmark is already running.
+     * @see pauseTiming
+     */
+    fun resumeTiming() {
+        check(paused) { "Unable to resume the benchmark. The benchmark is already running." }
+        currentMetrics.captureResumed()
+        paused = false
+    }
+
+    private fun startNextPhase(): Boolean {
+        check(phaseIndex < phases.size)
+
+        if (phaseIndex >= 0) {
+            currentPhase.profiler?.run { inMemoryTrace("profiler.stop()") { stop() } }
+            InMemoryTracing.endSection() // end phase
+            thermalThrottleSleepSeconds += currentPhase.thermalThrottleSleepSeconds
+            if (currentPhase.loopMode.warmupManager == null) {
+                // Save captured metrics except during warmup, where we intentionally discard
+                metricResults.addAll(
+                    currentMetrics.captureFinished(maxIterations = currentLoopsPerMeasurement)
+                )
+            }
+        }
+        phaseIndex++
+        if (phaseIndex == phases.size) {
+            afterBenchmark()
+            return false
+        }
+        currentPhase = phases[phaseIndex]
+        currentMetrics = currentPhase.metricsContainer
+        currentMeasurement = 0
+
+        currentMetrics.captureInit()
+        if (currentPhase.gcBeforePhase) {
+            // Run GC to avoid memory pressure from previous run from affecting this one.
+            // Note, we don't use System.gc() because it doesn't always have consistent behavior
+            Runtime.getRuntime().gc()
+        }
+
+        currentLoopsPerMeasurement =
+            currentPhase.loopMode.getIterations(warmupEstimatedIterationTimeNs)
+
+        iterationsPerRepeat = iterationsPerRepeat.coerceAtLeast(currentLoopsPerMeasurement)
+
+        InMemoryTracing.beginSection(currentPhase.label)
+        val phaseProfilerResult =
+            currentPhase.profiler?.run {
+                val estimatedMethodTraceDurNs =
+                    warmupEstimatedIterationTimeNs * METHOD_TRACING_ESTIMATED_SLOWDOWN_FACTOR
+                if (
+                    this == MethodTracing &&
+                        Looper.myLooper() == Looper.getMainLooper() &&
+                        estimatedMethodTraceDurNs > METHOD_TRACING_MAX_DURATION_NS &&
+                        Arguments.profilerSkipWhenDurationRisksAnr
+                ) {
+                    val expectedDurSec = estimatedMethodTraceDurNs / 1_000_000_000.0
+                    InstrumentationResults.scheduleIdeWarningOnNextReport(
+                        """
+                        Skipping method trace of estimated duration $expectedDurSec sec to avoid ANR
+
+                        To disable this behavior, set instrumentation arg:
+                            androidx.benchmark.profiling.skipWhenDurationRisksAnr = false
+                    """
+                            .trimIndent()
+                    )
+                    null
+                } else {
+                    inMemoryTrace("start profiling") { start(traceUniqueName) }
+                }
+            }
+        if (phaseProfilerResult != null) {
+            require(profilerResult == null) {
+                "ProfileResult already set, only support one profiling phase"
+            }
+            profilerResult = phaseProfilerResult
+        }
+
+        // Warm up the metrics data structure to reduce the impact on the first measurement.
+        currentMetrics.captureStart()
+        currentMetrics.captureStop()
+        currentMetrics.captureInit()
+
+        currentMetrics.captureStart()
+        return true
+    }
+
+    /** @return true if the benchmark should still keep running */
+    private fun onMeasurementComplete(): Boolean {
+        currentMetrics.captureStop()
+        throwIfPaused()
+        currentMeasurement++
+
+        val tryStartNextPhase =
+            currentPhase.loopMode.let {
+                if (it.warmupManager != null) {
+                    // warmup phase
+                    currentMetrics.captureInit()
+                    // Note that warmup is based on repeat time, *not* the timeNs metric, since we
+                    // want
+                    // to account for paused time during warmup (paused work should stabilize too)
+                    val lastMeasuredWarmupValue = currentMetrics.peekSingleRepeatTime()
+                    if (it.warmupManager.onNextIteration(lastMeasuredWarmupValue)) {
+                        warmupEstimatedIterationTimeNs = lastMeasuredWarmupValue
+                        warmupRepeats = currentMeasurement
+                        true
+                    } else {
+                        false
+                    }
+                } else {
+                    currentMeasurement == currentPhase.measurementCount
+                }
+            }
+        return if (tryStartNextPhase) {
+            if (currentPhase.tryEnd()) {
+                startNextPhase()
+            } else {
+                // failed capture (due to thermal throttling), restart profiler and metrics
+                currentPhase.profiler?.apply {
+                    stop()
+                    profilerResult = inMemoryTrace("start profiling") { start(traceUniqueName) }
+                }
+                currentMetrics.captureInit()
+                currentMeasurement = 0
+                true
+            }
+        } else {
+            currentMetrics.captureStart()
+            true
+        }
+    }
+
+    /**
+     * Inline fast-path function for inner benchmark loop.
+     *
+     * Kotlin users should use `BenchmarkRule.measureRepeated`
+     *
+     * This code path uses exclusively @JvmField/const members, so there are no method calls at all
+     * in the inlined loop. On recent Android Platform versions, ART inlines these accessors anyway,
+     * but we want to be sure it's as simple as possible.
+     */
+    @Suppress("NOTHING_TO_INLINE")
+    @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
+    inline fun keepRunningInline(): Boolean {
+        if (iterationsRemaining > 1) {
+            iterationsRemaining--
+            return true
+        }
+        return keepRunningInternal()
+    }
+
+    /**
+     * Returns true if the benchmark needs more samples - use this as the condition of a while loop.
+     *
+     * ```
+     * while (state.keepRunning()) {
+     *     int[] dest = new int[src.length];
+     *     System.arraycopy(src, 0, dest, 0, src.length);
+     * }
+     * ```
+     */
+    fun keepRunning(): Boolean {
+        if (iterationsRemaining > 1) {
+            iterationsRemaining--
+            return true
+        }
+        return keepRunningInternal()
+    }
+
+    /**
+     * Reimplementation of Kotlin check, which also resets thread priority, since we don't want to
+     * leave a thread with bumped thread priority
+     */
+    private inline fun check(value: Boolean, lazyMessage: () -> String) {
+        if (!value) {
+            cleanupBeforeThrow()
+            throw IllegalStateException(lazyMessage())
+        }
+    }
+
+    /**
+     * Ideally this would only be called when an exception is observed in measureRepeated, but to
+     * account for java callers, we explicitly trigger before throwing as well.
+     */
+    @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
+    fun cleanupBeforeThrow() {
+        if (phaseIndex >= 0 && phaseIndex <= phases.size) {
+            Log.d(TAG, "aborting and cancelling benchmark")
+            // current phase cancelled, complete current phase cleanup (trace event and profiling)
+            InMemoryTracing.endSection()
+            currentPhase.profiler?.run { inMemoryTrace("profiling stop") { stop() } }
+
+            // for safety, set other state to done and do broader cleanup
+            phaseIndex = phases.size
+            afterBenchmark()
+        }
+    }
+
+    /**
+     * Internal loop control for benchmarks - will return true as long as there are more
+     * measurements to perform.
+     *
+     * Actual benchmarks should always go through [keepRunning] or [keepRunningInline], since they
+     * optimize the *Iteration* step to have extremely minimal logic performed.
+     *
+     * The looping behavior is functionally multiple nested loops, e.g.:
+     * - Stage - RUNNING_WARMUP vs RUNNING_TIME
+     * - Measurement - how many times iterations are measured
+     * - Iteration - how many iterations/loops are run between each measurement
+     *
+     * This has the effect of a 3 layer nesting loop structure, but all condensed to a single method
+     * returning true/false to simplify the entry point.
+     *
+     * @return whether the benchmarking system has anything left to do
+     */
+    @Suppress("ShowingMemberInHiddenClass")
+    @PublishedApi
+    internal fun keepRunningInternal(): Boolean {
+        val shouldKeepRunning =
+            if (phaseIndex == -1) {
+                // Initialize
+                beforeBenchmark()
+                startNextPhase()
+            } else {
+                // Trigger another repeat within current phase
+                onMeasurementComplete()
+            }
+
+        iterationsRemaining = currentLoopsPerMeasurement
+        return shouldKeepRunning
+    }
+
+    private fun beforeBenchmark() {
+        Errors.throwIfError()
+        if (!firstBenchmark && Arguments.startupMode) {
+            throw AssertionError(
+                "Error - multiple benchmarks in startup mode. Only one " +
+                    "benchmark may be run per 'am instrument' call, to ensure result " +
+                    "isolation."
+            )
+        }
+        check(DeviceInfo.artMainlineVersion != DeviceInfo.ART_MAINLINE_VERSION_UNDETECTED_ERROR) {
+            "Unable to detect ART mainline module version to check for interference from method" +
+                " tracing, please see logcat for details, and/or file a bug with logcat."
+        }
+        check(
+            !BenchmarkState.enableMethodTracingAffectsMeasurementError ||
+                !DeviceInfo.methodTracingAffectsMeasurements ||
+                !MethodTracing.hasBeenUsed
+        ) {
+            "Measurement prevented by method trace - Running on a device/configuration where " +
+                "method tracing affects measurements, and a method trace has been captured " +
+                "- no additional benchmarks can be run without restarting the test suite. Use " +
+                "ProfilerConfig.MethodTracing.affectsMeasurementOnThisDevice to detect affected " +
+                "devices, see its documentation for more info."
+        }
+
+        thermalThrottleSleepSeconds = 0
+
+        if (!simplifiedTimingOnlyMode) {
+            ThrottleDetector.computeThrottleBaselineIfNeeded()
+            ThreadPriority.bumpCurrentThreadPriority()
+        }
+
+        totalRunTimeStartNs = System.nanoTime() // Record this time to find total duration
+    }
+
+    private fun afterBenchmark() {
+        totalRunTimeNs = System.nanoTime() - totalRunTimeStartNs
+
+        if (!simplifiedTimingOnlyMode) {
+            // Don't modify thread priority when checking for thermal throttling, since 'outer'
+            // BenchmarkState owns thread priority
+            ThreadPriority.resetBumpedThread()
+        }
+        warmupManager.logInfo()
+    }
+
+    private fun throwIfPaused() =
+        check(!paused) {
+            "Benchmark loop finished in paused state." +
+                " Call BenchmarkState.resumeTiming() before BenchmarkState.keepRunning()."
+        }
+
+    private fun getTestResult(testName: String, className: String, perfettoTracePath: String?) =
+        BenchmarkData.TestResult(
+            name = testName,
+            className = className,
+            totalRunTimeNs = totalRunTimeNs,
+            metrics = metricResults,
+            warmupIterations = warmupRepeats,
+            repeatIterations = iterationsPerRepeat,
+            thermalThrottleSleepSeconds = thermalThrottleSleepSeconds,
+            profilerOutputs =
+                listOfNotNull(
+                    perfettoTracePath?.let {
+                        BenchmarkData.TestResult.ProfilerOutput(
+                            Profiler.ResultFile.ofPerfettoTrace(
+                                label = "Trace",
+                                absolutePath = perfettoTracePath
+                            )
+                        )
+                    },
+                    profilerResult?.let { BenchmarkData.TestResult.ProfilerOutput(it) }
+                )
+        )
+
+    @ExperimentalBenchmarkStateApi
+    fun getMeasurementTimeNs(): List<Double> = metricResults.first { it.name == "timeNs" }.data
+
+    internal fun peekTestResult() =
+        checkFinished().run {
+            getTestResult(testName = "", className = "", perfettoTracePath = null)
+        }
+
+    /**
+     * Acquires a status report bundle
+     *
+     * @param key Run identifier, prepended to bundle properties.
+     * @param reportMetrics True if stats should be included in the output bundle.
+     */
+    internal fun getFullStatusReport(
+        key: String,
+        reportMetrics: Boolean,
+        tracePath: String?
+    ): Bundle {
+        Log.i(TAG, key + metricResults.map { it.getSummary() } + "count=$iterationsPerRepeat")
+        val status = Bundle()
+        if (reportMetrics) {
+            // these 'legacy' CI output metrics are considered output
+            metricResults.forEach { it.putInBundle(status, PREFIX) }
+        }
+        InstrumentationResultScope(status)
+            .reportSummaryToIde(
+                testName = key,
+                measurements =
+                    Measurements(singleMetrics = metricResults, sampledMetrics = emptyList()),
+                profilerResults =
+                    listOfNotNull(
+                        tracePath?.let {
+                            Profiler.ResultFile.ofPerfettoTrace(
+                                label = "Trace",
+                                absolutePath = tracePath
+                            )
+                        },
+                        profilerResult
+                    )
+            )
+        return status
+    }
+
+    @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
+    fun report(
+        fullClassName: String,
+        simpleClassName: String,
+        methodName: String,
+        perfettoTracePath: String?
+    ) {
+        if (phaseIndex == -1) {
+            return // nothing to report, BenchmarkState wasn't used
+        }
+
+        profilerResult?.convertBeforeSync?.invoke()
+        if (perfettoTracePath != null) {
+            profilerResult?.embedInPerfettoTrace(perfettoTracePath)
+        }
+
+        checkFinished() // this method is triggered externally
+        val fullTestName = "$PREFIX$simpleClassName.$methodName"
+        val bundle =
+            getFullStatusReport(
+                key = fullTestName,
+                reportMetrics = !Arguments.dryRunMode,
+                tracePath = perfettoTracePath
+            )
+        reportBundle(bundle)
+        ResultWriter.appendTestResult(
+            getTestResult(
+                testName = PREFIX + methodName,
+                className = fullClassName,
+                perfettoTracePath = perfettoTracePath
+            )
+        )
+    }
+
+    companion object {
+        internal const val TAG = "Benchmark"
+
+        internal const val REPEAT_COUNT_ALLOCATION = 5
+
+        /**
+         * Conservative estimate for how much method tracing slows down runtime how much longer will
+         * `methodTrace {x()}` be than `x()`
+         *
+         * This is a conservative estimate, better version of this would account for OS/Art version
+         *
+         * Value derived from observed numbers on bramble API 31 (600-800x slowdown)
+         */
+        internal const val METHOD_TRACING_ESTIMATED_SLOWDOWN_FACTOR = 1000
+
+        /**
+         * Maximum duration to trace on main thread to avoid ANRs
+         *
+         * In practice, other types of tracing can be equally dangerous for ANRs, but method tracing
+         * is the default tracing mode.
+         */
+        internal const val METHOD_TRACING_MAX_DURATION_NS = 4_000_000_000
+
+        internal val DEFAULT_MEASUREMENT_DURATION_NS = TimeUnit.MILLISECONDS.toNanos(100)
+        internal val SAMPLED_PROFILER_DURATION_NS =
+            TimeUnit.SECONDS.toNanos(Arguments.profilerSampleDurationSeconds)
+
+        private var firstBenchmark = true
+
+        @RequiresOptIn
+        @Retention(AnnotationRetention.BINARY)
+        @Target(AnnotationTarget.FUNCTION)
+        annotation class ExperimentalExternalReport
+
+        /**
+         * Hooks for benchmarks not using [androidx.benchmark.junit4.BenchmarkRule] to register
+         * results.
+         *
+         * Results are printed to Studio console, and added to the output JSON file.
+         *
+         * @param className Name of class the benchmark runs in
+         * @param testName Name of the benchmark
+         * @param totalRunTimeNs The total run time of the benchmark
+         * @param dataNs List of all measured timing results, in nanoseconds
+         * @param warmupIterations Number of iterations of warmup before measurements started.
+         *   Should be no less than 0.
+         * @param thermalThrottleSleepSeconds Number of seconds benchmark was paused during thermal
+         *   throttling.
+         * @param repeatIterations Number of iterations in between each measurement. Should be no
+         *   less than 1.
+         */
+        @JvmStatic
+        @ExperimentalExternalReport
+        fun reportData(
+            className: String,
+            testName: String,
+            @IntRange(from = 0) totalRunTimeNs: Long,
+            dataNs: List<Long>,
+            @IntRange(from = 0) warmupIterations: Int,
+            @IntRange(from = 0) thermalThrottleSleepSeconds: Long,
+            @IntRange(from = 1) repeatIterations: Int
+        ) {
+            val metricsContainer = MetricsContainer(repeatCount = dataNs.size)
+            dataNs.forEachIndexed { index, value -> metricsContainer.data[index][0] = value }
+            val metrics = metricsContainer.captureFinished(maxIterations = 1)
+            val report =
+                BenchmarkData.TestResult(
+                    className = className,
+                    name = testName,
+                    totalRunTimeNs = totalRunTimeNs,
+                    metrics = metrics,
+                    repeatIterations = repeatIterations,
+                    thermalThrottleSleepSeconds = thermalThrottleSleepSeconds,
+                    warmupIterations = warmupIterations,
+                    profilerOutputs = null,
+                )
+            // Report value to Studio console
+            val fullTestName =
+                PREFIX + if (className.isNotEmpty()) "$className.$testName" else testName
+
+            instrumentationReport {
+                reportSummaryToIde(
+                    testName = fullTestName,
+                    measurements = Measurements(metrics, emptyList()),
+                )
+            }
+
+            // Report values to file output
+            ResultWriter.appendTestResult(report)
+        }
+    }
+}
diff --git a/benchmark/benchmark-common/src/main/java/androidx/benchmark/Microbenchmark.kt b/benchmark/benchmark-common/src/main/java/androidx/benchmark/Microbenchmark.kt
new file mode 100644
index 0000000..0fa13ee
--- /dev/null
+++ b/benchmark/benchmark-common/src/main/java/androidx/benchmark/Microbenchmark.kt
@@ -0,0 +1,466 @@
+/*
+ * Copyright 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package androidx.benchmark
+
+import android.os.Build
+import android.util.Log
+import androidx.annotation.RestrictTo
+import androidx.benchmark.BenchmarkState.Companion.enableMethodTracingAffectsMeasurementError
+import androidx.benchmark.perfetto.PerfettoCapture
+import androidx.benchmark.perfetto.PerfettoCaptureWrapper
+import androidx.benchmark.perfetto.PerfettoConfig
+import androidx.benchmark.perfetto.UiState
+import androidx.benchmark.perfetto.appendUiState
+import androidx.test.platform.app.InstrumentationRegistry
+import androidx.tracing.Trace
+import androidx.tracing.trace
+import java.io.File
+import java.util.concurrent.TimeUnit
+import kotlinx.coroutines.CoroutineScope
+import kotlinx.coroutines.Dispatchers
+import kotlinx.coroutines.runBlocking
+import kotlinx.coroutines.yield
+
+@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
+open class MicrobenchmarkScope(internal val state: MicrobenchmarkRunningState) {
+    inline fun <T> runWithMeasurementDisabled(block: () -> T): T {
+        pauseMeasurement()
+        // Note: we only bother with tracing for the runWithTimingDisabled function for
+        // Kotlin callers, as it's more difficult to corrupt the trace with incorrectly
+        // paired BenchmarkState pause/resume calls
+        val ret: T =
+            try {
+                // TODO: use `trace() {}` instead of this manual try/finally,
+                //  once the block parameter is marked crossinline.
+                Trace.beginSection("runWithTimingDisabled")
+                block()
+            } finally {
+                Trace.endSection()
+            }
+        resumeMeasurement()
+        return ret
+    }
+
+    /**
+     * Resume measurement after a call to [pauseMeasurement].
+     *
+     * Kotlin callers should generally instead use [runWithTimingDisabled].
+     */
+    fun pauseMeasurement() {
+        state.pauseMeasurement()
+    }
+
+    /**
+     * Resume measurement after a call to [pauseMeasurement]
+     *
+     * Kotlin callers should generally instead use [runWithTimingDisabled].
+     */
+    fun resumeMeasurement() {
+        state.resumeMeasurement()
+    }
+}
+
+/**
+ * State carried across multiple phases, including metric and output files
+ *
+ * This is maintained as a state object rather than return objects from each phase to avoid
+ * allocation
+ */
+@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
+class MicrobenchmarkRunningState
+internal constructor(metrics: MetricsContainer, val yieldThreadPeriodically: Boolean) {
+    internal var warmupEstimatedIterationTimeNs: Long = 0
+    internal var warmupIterations: Int = 0
+    internal var totalThermalThrottleSleepSeconds: Long = 0
+    internal var maxIterationsPerRepeat = 0
+    internal var metrics: MetricsContainer = metrics
+    internal var metricResults = mutableListOf<MetricResult>()
+    internal var profilerResults = mutableListOf<Profiler.ResultFile>()
+    internal var paused = false
+
+    internal var initialTimeNs: Long = 0
+    internal var softDeadlineNs: Long = 0
+    internal var hardDeadlineNs: Long = 0
+
+    fun pauseMeasurement() {
+        check(!paused) { "Unable to pause the benchmark. The benchmark has already paused." }
+        metrics.capturePaused()
+        paused = true
+    }
+
+    fun resumeMeasurement() {
+        check(paused) { "Unable to resume the benchmark. The benchmark is already running." }
+        metrics.captureResumed()
+        paused = false
+    }
+
+    fun beginTaskTrace() {
+        if (yieldThreadPeriodically) {
+            Trace.beginSection("benchmark task")
+            initialTimeNs = System.nanoTime()
+            // we try to stop next measurement after soft deadline...
+            softDeadlineNs = initialTimeNs + TimeUnit.SECONDS.toNanos(2)
+            // ... and throw if took longer than hard deadline
+            hardDeadlineNs = initialTimeNs + TimeUnit.SECONDS.toNanos(10)
+        }
+    }
+
+    fun endTaskTrace() {
+        if (yieldThreadPeriodically) {
+            Trace.endSection()
+        }
+    }
+
+    internal suspend inline fun yieldThreadIfDeadlinePassed() {
+        if (yieldThreadPeriodically) {
+            val timeNs = System.nanoTime()
+            if (timeNs >= softDeadlineNs) {
+
+                if (timeNs > hardDeadlineNs && Arguments.measureRepeatedOnMainThrowOnDeadline) {
+                    val overrunInSec = (timeNs - hardDeadlineNs) / 1_000_000_000.0
+                    // note - we throw without cancelling task trace, since outer layer handles that
+                    throw IllegalStateException(
+                        "Benchmark loop overran hard time limit by $overrunInSec seconds"
+                    )
+                }
+
+                // pause and resume task trace around yield
+                endTaskTrace()
+                yield()
+                beginTaskTrace()
+            }
+        }
+    }
+}
+
+private var firstBenchmark = true
+
+private fun checkForErrors() {
+    Errors.throwIfError()
+    if (!firstBenchmark && Arguments.startupMode) {
+        throw AssertionError(
+            "Error - multiple benchmarks in startup mode. Only one " +
+                "benchmark may be run per 'am instrument' call, to ensure result " +
+                "isolation."
+        )
+    }
+    check(DeviceInfo.artMainlineVersion != DeviceInfo.ART_MAINLINE_VERSION_UNDETECTED_ERROR) {
+        "Unable to detect ART mainline module version to check for interference from method" +
+            " tracing, please see logcat for details, and/or file a bug with logcat."
+    }
+    check(
+        !enableMethodTracingAffectsMeasurementError ||
+            !DeviceInfo.methodTracingAffectsMeasurements ||
+            !MethodTracing.hasBeenUsed
+    ) {
+        "Measurement prevented by method trace - Running on a device/configuration where " +
+            "method tracing affects measurements, and a method trace has been captured " +
+            "- no additional benchmarks can be run without restarting the test suite. Use " +
+            "ProfilerConfig.MethodTracing.affectsMeasurementOnThisDevice to detect affected " +
+            "devices, see its documentation for more info."
+    }
+}
+
+internal typealias LoopedMeasurementBlock = suspend (MicrobenchmarkScope, Int) -> Unit
+
+internal typealias ScopeFactory = (MicrobenchmarkRunningState) -> MicrobenchmarkScope
+
+private fun <T> runBlockingOverrideMain(
+    runOnMainDispatcher: Boolean,
+    block: suspend CoroutineScope.() -> T
+): T {
+    return if (runOnMainDispatcher) {
+        runBlocking(Dispatchers.Main, block)
+    } else {
+        runBlocking { block(this) }
+    }
+}
+
+internal fun captureMicroPerfettoTrace(
+    definition: TestDefinition,
+    config: MicrobenchmarkConfig?,
+    block: () -> Unit
+): String? =
+    PerfettoCaptureWrapper()
+        .record(
+            fileLabel = definition.traceUniqueName,
+            config =
+                PerfettoConfig.Benchmark(
+                    appTagPackages =
+                        if (config?.traceAppTagEnabled == true) {
+                            listOf(InstrumentationRegistry.getInstrumentation().context.packageName)
+                        } else {
+                            emptyList()
+                        },
+                    useStackSamplingConfig = false
+                ),
+            // TODO(290918736): add support for Perfetto SDK Tracing in
+            //  Microbenchmark in other cases, outside of MicrobenchmarkConfig
+            perfettoSdkConfig =
+                if (
+                    config?.perfettoSdkTracingEnabled == true &&
+                        Build.VERSION.SDK_INT >= Build.VERSION_CODES.M
+                ) {
+                    PerfettoCapture.PerfettoSdkConfig(
+                        InstrumentationRegistry.getInstrumentation().context.packageName,
+                        PerfettoCapture.PerfettoSdkConfig.InitialProcessState.Alive
+                    )
+                } else {
+                    null
+                },
+
+            // Optimize throughput in dryRunMode, since trace isn't useful, and extremely
+            //   expensive on some emulators. Could alternately use UserspaceTracing if
+            // desired
+            // Additionally, skip on misconfigured devices to still enable benchmarking.
+            enableTracing = !Arguments.dryRunMode && !DeviceInfo.misconfiguredForTracing,
+            inMemoryTracingLabel = "Microbenchmark",
+            block = block
+        )
+
+/**
+ * Core engine of microbenchmark, used in one of three ways:
+ * 1. [measureRepeatedImplWithTracing] - standard tracing microbenchmark
+ * 2. [measureRepeatedImplNoTracing] - legacy, non-tracing, suspending functionality backing
+ *    [BenchmarkState] compatibility
+ * 3. [measureRepeatedCheckNanosReentrant] - microbenchmark which avoids modifying global state,
+ *    which runs *within* other variants to check for thermal throttling
+ */
+internal class Microbenchmark(
+    private val definition: TestDefinition,
+    private val phaseConfig: MicrobenchmarkPhase.Config,
+    private val yieldThreadPeriodically: Boolean,
+    private val scopeFactory: ScopeFactory,
+    private val loopedMeasurementBlock: LoopedMeasurementBlock
+) {
+    constructor(
+        definition: TestDefinition,
+        config: MicrobenchmarkConfig,
+        simplifiedTimingOnlyMode: Boolean,
+        yieldThreadPeriodically: Boolean,
+        scopeFactory: ScopeFactory = { runningState -> MicrobenchmarkScope(runningState) },
+        loopedMeasurementBlock: LoopedMeasurementBlock
+    ) : this(
+        definition = definition,
+        phaseConfig = MicrobenchmarkPhase.Config(config, simplifiedTimingOnlyMode),
+        yieldThreadPeriodically = yieldThreadPeriodically,
+        scopeFactory = scopeFactory,
+        loopedMeasurementBlock = loopedMeasurementBlock
+    )
+
+    private var startTimeNs = System.nanoTime()
+
+    init {
+        if (!phaseConfig.simplifiedTimingOnlyMode) {
+            Log.d(TAG, "-- Running ${definition.fullNameUnsanitized} --")
+            checkForErrors()
+        }
+    }
+
+    private val phases = phaseConfig.generatePhases()
+    private val state =
+        MicrobenchmarkRunningState(phases[0].metricsContainer, yieldThreadPeriodically)
+    private val scope = scopeFactory(state)
+
+    suspend fun executePhases() {
+        state.beginTaskTrace()
+        try {
+            if (!phaseConfig.simplifiedTimingOnlyMode) {
+                ThrottleDetector.computeThrottleBaselineIfNeeded()
+                ThreadPriority.bumpCurrentThreadPriority()
+            }
+            firstBenchmark = false
+            phases.forEach {
+                it.execute(
+                    traceUniqueName = definition.traceUniqueName,
+                    scope = scope,
+                    state = state,
+                    loopedMeasurementBlock = loopedMeasurementBlock
+                )
+            }
+        } finally {
+            if (!phaseConfig.simplifiedTimingOnlyMode) {
+                // Don't modify thread priority in simplified timing mode, since 'outer'
+                // measureRepeated owns thread priority
+                ThreadPriority.resetBumpedThread()
+            }
+            phaseConfig.warmupManager.logInfo()
+            state.endTaskTrace()
+        }
+    }
+
+    fun output(perfettoTracePath: String?): MicrobenchmarkOutput {
+        Log.i(
+            BenchmarkState.TAG,
+            definition.outputTestName +
+                state.metricResults.map { it.getSummary() } +
+                "count=${state.maxIterationsPerRepeat}"
+        )
+        return MicrobenchmarkOutput(
+                definition = definition,
+                metricResults = state.metricResults,
+                profilerResults = processProfilerResults(perfettoTracePath),
+                totalRunTimeNs = System.nanoTime() - startTimeNs,
+                warmupIterations = state.warmupIterations,
+                repeatIterations = state.maxIterationsPerRepeat,
+                thermalThrottleSleepSeconds = state.totalThermalThrottleSleepSeconds,
+                reportMetricsInBundle = !Arguments.dryRunMode
+            )
+            .apply {
+                InstrumentationResults.reportBundle(createBundle())
+                ResultWriter.appendTestResult(createJsonTestResult())
+            }
+    }
+
+    fun getMinTimeNanos(): Double {
+        return state.metricResults.first { it.name == "timeNs" }.min
+    }
+
+    private fun processProfilerResults(perfettoTracePath: String?): List<Profiler.ResultFile> {
+        // prepare profiling result files
+        perfettoTracePath?.apply {
+            // trace completed, and copied into shell writeable dir
+            val file = File(this)
+            file.appendUiState(
+                UiState(
+                    timelineStart = null,
+                    timelineEnd = null,
+                    highlightPackage =
+                        InstrumentationRegistry.getInstrumentation().context.packageName
+                )
+            )
+        }
+        state.profilerResults.forEach {
+            it.convertBeforeSync?.invoke()
+            if (perfettoTracePath != null) {
+                it.embedInPerfettoTrace(perfettoTracePath)
+            }
+        }
+        val profilerResults =
+            listOfNotNull(
+                perfettoTracePath?.let {
+                    Profiler.ResultFile.ofPerfettoTrace(label = "Trace", absolutePath = it)
+                }
+            ) + state.profilerResults
+        return profilerResults
+    }
+
+    companion object {
+        internal const val TAG = "Benchmark"
+    }
+}
+
+internal inline fun measureRepeatedCheckNanosReentrant(
+    crossinline measureBlock: MicrobenchmarkScope.() -> Unit
+): Double {
+    return Microbenchmark(
+            TestDefinition(
+                fullClassName = "ThrottleDetector",
+                simpleClassName = "ThrottleDetector",
+                methodName = "checkThrottle"
+            ),
+            config = MicrobenchmarkConfig(),
+            simplifiedTimingOnlyMode = true,
+            yieldThreadPeriodically = false,
+            loopedMeasurementBlock = { scope, iterations ->
+                var remainingIterations = iterations
+                do {
+                    measureBlock.invoke(scope)
+                    remainingIterations--
+                } while (remainingIterations > 0)
+            }
+        )
+        .run {
+            runBlocking { executePhases() }
+            getMinTimeNanos()
+        }
+}
+
+/**
+ * Limited version of [measureRepeatedImplWithTracing] which doesn't capture a trace, and doesn't
+ * support posting work to main thread.
+ */
+internal suspend fun measureRepeatedImplNoTracing(
+    definition: TestDefinition,
+    config: MicrobenchmarkConfig,
+    loopedMeasurementBlock: LoopedMeasurementBlock
+) {
+    Microbenchmark(
+            definition = definition,
+            config = config,
+            simplifiedTimingOnlyMode = false,
+            yieldThreadPeriodically = false,
+            loopedMeasurementBlock = loopedMeasurementBlock
+        )
+        .apply {
+            executePhases()
+            output(perfettoTracePath = null)
+        }
+}
+
+@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
+fun measureRepeatedImplWithTracing(
+    definition: TestDefinition,
+    config: MicrobenchmarkConfig?,
+    postToMainThread: Boolean,
+    scopeFactory: ScopeFactory = { runningState -> MicrobenchmarkScope(runningState) },
+    loopedMeasurementBlock: LoopedMeasurementBlock
+) {
+    val microbenchmark =
+        Microbenchmark(
+            definition = definition,
+            config = config ?: MicrobenchmarkConfig(),
+            simplifiedTimingOnlyMode = false,
+            yieldThreadPeriodically = postToMainThread,
+            scopeFactory = scopeFactory,
+            loopedMeasurementBlock = loopedMeasurementBlock
+        )
+    val perfettoTracePath =
+        captureMicroPerfettoTrace(definition, config) {
+            trace(definition.fullNameUnsanitized) {
+                runBlockingOverrideMain(runOnMainDispatcher = postToMainThread) {
+                    microbenchmark.executePhases()
+                }
+            }
+        }
+    microbenchmark.output(perfettoTracePath)
+}
+
+/**
+ * Top level entry point for capturing a microbenchmark with a trace.
+ *
+ * Eventually this method (or one like it) should be public, and also expose a results object
+ */
+@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
+inline fun measureRepeated(
+    definition: TestDefinition,
+    config: MicrobenchmarkConfig? = null,
+    crossinline measureBlock: MicrobenchmarkScope.() -> Unit
+) {
+    measureRepeatedImplWithTracing(
+        postToMainThread = false,
+        definition = definition,
+        config = config,
+        loopedMeasurementBlock = { scope, iterations ->
+            var remainingIterations = iterations
+            do {
+                measureBlock.invoke(scope)
+                remainingIterations--
+            } while (remainingIterations > 0)
+        }
+    )
+}
diff --git a/benchmark/benchmark-common/src/main/java/androidx/benchmark/MicrobenchmarkConfig.kt b/benchmark/benchmark-common/src/main/java/androidx/benchmark/MicrobenchmarkConfig.kt
index 58ec6af..102de5e 100644
--- a/benchmark/benchmark-common/src/main/java/androidx/benchmark/MicrobenchmarkConfig.kt
+++ b/benchmark/benchmark-common/src/main/java/androidx/benchmark/MicrobenchmarkConfig.kt
@@ -29,7 +29,18 @@
      *
      * Defaults to [TimeCapture].
      */
-    val metrics: List<MetricCapture> = listOf(TimeCapture()),
+    val metrics: List<MetricCapture> =
+        if (Arguments.cpuEventCounterMask != 0) {
+            listOf(
+                TimeCapture(),
+                CpuEventCounterCapture(
+                    MicrobenchmarkPhase.cpuEventCounter,
+                    Arguments.cpuEventCounterMask
+                )
+            )
+        } else {
+            listOf(TimeCapture())
+        },
 
     /**
      * Set to true to enable capture of `trace("foo") {}` blocks in the output Perfetto trace.
@@ -52,4 +63,10 @@
 
     /** Optional profiler to be used after the primary timing phase. */
     val profiler: ProfilerConfig? = null,
+    @Suppress("AutoBoxing") // null is distinct, and boxing cost is trivial (off critical path)
+    @get:Suppress("AutoBoxing") // null is distinct, and boxing cost is trivial (off critical path)
+    val warmupCount: Int? = null,
+    @Suppress("AutoBoxing") // null is distinct, and boxing cost is trivial (off critical path)
+    @get:Suppress("AutoBoxing") // null is distinct, and boxing cost is trivial (off critical path)
+    val measurementCount: Int? = null
 )
diff --git a/benchmark/benchmark-common/src/main/java/androidx/benchmark/MicrobenchmarkOutput.kt b/benchmark/benchmark-common/src/main/java/androidx/benchmark/MicrobenchmarkOutput.kt
new file mode 100644
index 0000000..a3fab45
--- /dev/null
+++ b/benchmark/benchmark-common/src/main/java/androidx/benchmark/MicrobenchmarkOutput.kt
@@ -0,0 +1,59 @@
+/*
+ * Copyright 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package androidx.benchmark
+
+import android.os.Bundle
+import androidx.benchmark.Errors.PREFIX
+import androidx.benchmark.json.BenchmarkData
+
+internal class MicrobenchmarkOutput(
+    val definition: TestDefinition,
+    val metricResults: List<MetricResult>,
+    val profilerResults: List<Profiler.ResultFile>,
+    val totalRunTimeNs: Long,
+    val warmupIterations: Int,
+    val repeatIterations: Int,
+    val thermalThrottleSleepSeconds: Long,
+    val reportMetricsInBundle: Boolean
+) {
+    fun createBundle() =
+        Bundle().apply {
+            if (reportMetricsInBundle) {
+                // these 'legacy' CI output metrics are considered output
+                metricResults.forEach { it.putInBundle(this, PREFIX) }
+            }
+            InstrumentationResultScope(this)
+                .reportSummaryToIde(
+                    testName = definition.outputTestName,
+                    measurements =
+                        Measurements(singleMetrics = metricResults, sampledMetrics = emptyList()),
+                    profilerResults = profilerResults
+                )
+        }
+
+    fun createJsonTestResult() =
+        BenchmarkData.TestResult(
+            name = definition.outputMethodName,
+            className = definition.fullClassName,
+            totalRunTimeNs = totalRunTimeNs,
+            metrics = metricResults,
+            warmupIterations = warmupIterations,
+            repeatIterations = repeatIterations,
+            thermalThrottleSleepSeconds = thermalThrottleSleepSeconds,
+            profilerOutputs = profilerResults.map { BenchmarkData.TestResult.ProfilerOutput(it) }
+        )
+}
diff --git a/benchmark/benchmark-common/src/main/java/androidx/benchmark/MicrobenchmarkPhase.kt b/benchmark/benchmark-common/src/main/java/androidx/benchmark/MicrobenchmarkPhase.kt
index 96d686e..8370a6e 100644
--- a/benchmark/benchmark-common/src/main/java/androidx/benchmark/MicrobenchmarkPhase.kt
+++ b/benchmark/benchmark-common/src/main/java/androidx/benchmark/MicrobenchmarkPhase.kt
@@ -4,6 +4,7 @@
 import android.util.Log
 import androidx.benchmark.CpuEventCounter.Event
 import java.util.concurrent.TimeUnit
+import kotlinx.coroutines.delay
 
 internal class MicrobenchmarkPhase(
     val label: String,
@@ -60,6 +61,109 @@
             else -> false
         }
 
+    internal suspend inline fun execute(
+        traceUniqueName: String,
+        scope: MicrobenchmarkScope,
+        state: MicrobenchmarkRunningState,
+        loopedMeasurementBlock: LoopedMeasurementBlock
+    ) {
+        var thermalThrottleSleepsRemaining = thermalThrottleSleepsMax
+        val loopsPerMeasurement = loopMode.getIterations(state.warmupEstimatedIterationTimeNs)
+        state.maxIterationsPerRepeat =
+            state.maxIterationsPerRepeat.coerceAtLeast(loopsPerMeasurement)
+
+        var phaseProfilerResult: Profiler.ResultFile?
+        try {
+            InMemoryTracing.beginSection(label)
+            if (gcBeforePhase) {
+                // Run GC to avoid memory pressure from previous run from affecting this one.
+                // Note, we don't use System.gc() because it doesn't always have consistent behavior
+                Runtime.getRuntime().gc()
+            }
+            while (true) { // keep running until phase successful
+                try {
+                    phaseProfilerResult =
+                        profiler?.run {
+                            inMemoryTrace("start profiling") {
+                                startIfNotRiskingAnrDeadline(
+                                    traceUniqueName = traceUniqueName,
+                                    estimatedDurationNs = state.warmupEstimatedIterationTimeNs
+                                )
+                            }
+                        }
+                    state.metrics = metricsContainer // needed for pausing
+                    metricsContainer.captureInit()
+
+                    // warmup the container
+                    metricsContainer.captureStart()
+                    metricsContainer.captureStop()
+                    metricsContainer.captureInit()
+
+                    repeat(measurementCount) {
+                        // perform measurement
+                        metricsContainer.captureStart()
+                        loopedMeasurementBlock.invoke(scope, loopsPerMeasurement)
+                        metricsContainer.captureStop()
+                        state.yieldThreadIfDeadlinePassed()
+                    }
+                    if (loopMode.warmupManager != null) {
+                        // warmup, so retry until complete
+                        metricsContainer.captureInit()
+                        // Note that warmup is based on repeat time, *not* the timeNs metric, since
+                        // we
+                        // want to account for paused time during warmup (paused work should
+                        // stabilize
+                        // too)
+                        val lastMeasuredWarmupValue = metricsContainer.peekSingleRepeatTime()
+                        if (loopMode.warmupManager.onNextIteration(lastMeasuredWarmupValue)) {
+                            state.warmupEstimatedIterationTimeNs = lastMeasuredWarmupValue
+                            state.warmupIterations = loopMode.warmupManager.iteration
+                            break
+                        } else {
+                            continue
+                        }
+                    }
+                } finally {
+                    profiler?.run { inMemoryTrace("profiler.stop()") { stop() } }
+                    state.yieldThreadIfDeadlinePassed()
+                }
+                if (!ThrottleDetector.isDeviceThermalThrottled()) {
+                    // not thermal throttled, phase complete
+                    break
+                } else {
+                    // thermal throttled! delay and retry!
+                    Log.d(
+                        BenchmarkState.TAG,
+                        "THERMAL THROTTLE DETECTED, DELAYING FOR " +
+                            "${Arguments.thermalThrottleSleepDurationSeconds} SECONDS"
+                    )
+                    val startTimeNs = System.nanoTime()
+                    inMemoryTrace("Sleep due to Thermal Throttle") {
+                        delay(
+                            TimeUnit.SECONDS.toMillis(Arguments.thermalThrottleSleepDurationSeconds)
+                        )
+                    }
+                    val sleepTimeNs = System.nanoTime() - startTimeNs
+                    state.totalThermalThrottleSleepSeconds +=
+                        TimeUnit.NANOSECONDS.toSeconds(sleepTimeNs)
+                    thermalThrottleSleepsRemaining--
+                    if (thermalThrottleSleepsRemaining <= 0) break
+                }
+            }
+        } finally {
+            InMemoryTracing.endSection()
+        }
+        if (loopMode.warmupManager == null) {
+            // Save captured metrics except during warmup, where we intentionally discard
+            state.metricResults.addAll(
+                metricsContainer.captureFinished(maxIterations = loopsPerMeasurement)
+            )
+        }
+        if (phaseProfilerResult != null) {
+            state.profilerResults.add(phaseProfilerResult)
+        }
+    }
+
     internal sealed class LoopMode(val warmupManager: WarmupManager? = null) {
         /** Warmup looping mode - reports a single iteration, but there is specialized code in */
         class Warmup(warmupManager: WarmupManager) : LoopMode(warmupManager) {
@@ -207,6 +311,20 @@
         val measurementCount: Int?,
         val metrics: Array<MetricCapture>,
     ) {
+        constructor(
+            microbenchmarkConfig: MicrobenchmarkConfig,
+            simplifiedTimingOnlyMode: Boolean
+        ) : this(
+            dryRunMode = Arguments.dryRunMode,
+            startupMode = Arguments.startupMode,
+            profiler = microbenchmarkConfig.profiler?.profiler ?: Arguments.profiler,
+            profilerPerfCompareMode = Arguments.profilerPerfCompareEnable,
+            warmupCount = microbenchmarkConfig.warmupCount,
+            measurementCount = Arguments.iterations ?: microbenchmarkConfig.measurementCount,
+            simplifiedTimingOnlyMode = simplifiedTimingOnlyMode,
+            metrics = microbenchmarkConfig.metrics.toTypedArray()
+        )
+
         val warmupManager = WarmupManager(overrideCount = warmupCount)
 
         init {
diff --git a/benchmark/benchmark-common/src/main/java/androidx/benchmark/Profiler.kt b/benchmark/benchmark-common/src/main/java/androidx/benchmark/Profiler.kt
index 950f6d7..931af7b 100644
--- a/benchmark/benchmark-common/src/main/java/androidx/benchmark/Profiler.kt
+++ b/benchmark/benchmark-common/src/main/java/androidx/benchmark/Profiler.kt
@@ -19,10 +19,13 @@
 import android.annotation.SuppressLint
 import android.os.Build
 import android.os.Debug
+import android.os.Looper
 import android.util.Log
 import androidx.annotation.RequiresApi
 import androidx.annotation.RestrictTo
 import androidx.annotation.VisibleForTesting
+import androidx.benchmark.BenchmarkState.Companion.METHOD_TRACING_ESTIMATED_SLOWDOWN_FACTOR
+import androidx.benchmark.BenchmarkState.Companion.METHOD_TRACING_MAX_DURATION_NS
 import androidx.benchmark.BenchmarkState.Companion.TAG
 import androidx.benchmark.Outputs.dateToFileName
 import androidx.benchmark.json.BenchmarkData.TestResult.ProfilerOutput
@@ -99,6 +102,35 @@
 
     abstract fun start(traceUniqueName: String): ResultFile?
 
+    /** Start profiling only if expected trace duration is unlikely to trigger an ANR */
+    fun startIfNotRiskingAnrDeadline(
+        traceUniqueName: String,
+        estimatedDurationNs: Long
+    ): ResultFile? {
+        val estimatedMethodTraceDurNs =
+            estimatedDurationNs * METHOD_TRACING_ESTIMATED_SLOWDOWN_FACTOR
+        return if (
+            this == MethodTracing &&
+                Looper.myLooper() == Looper.getMainLooper() &&
+                estimatedMethodTraceDurNs > METHOD_TRACING_MAX_DURATION_NS &&
+                Arguments.profilerSkipWhenDurationRisksAnr
+        ) {
+            val expectedDurSec = estimatedMethodTraceDurNs / 1_000_000_000.0
+            InstrumentationResults.scheduleIdeWarningOnNextReport(
+                """
+                        Skipping method trace of estimated duration $expectedDurSec sec to avoid ANR
+
+                        To disable this behavior, set instrumentation arg:
+                            androidx.benchmark.profiling.skipWhenDurationRisksAnr = false
+                    """
+                    .trimIndent()
+            )
+            null
+        } else {
+            start(traceUniqueName)
+        }
+    }
+
     abstract fun stop()
 
     internal open fun config(packageNames: List<String>): StackSamplingConfig? = null
diff --git a/benchmark/benchmark-common/src/main/java/androidx/benchmark/TestDefinition.kt b/benchmark/benchmark-common/src/main/java/androidx/benchmark/TestDefinition.kt
new file mode 100644
index 0000000..69ff620
--- /dev/null
+++ b/benchmark/benchmark-common/src/main/java/androidx/benchmark/TestDefinition.kt
@@ -0,0 +1,32 @@
+/*
+ * Copyright 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package androidx.benchmark
+
+import androidx.annotation.RestrictTo
+import androidx.benchmark.Errors.PREFIX
+
+@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
+class TestDefinition(
+    val fullClassName: String,
+    val simpleClassName: String,
+    val methodName: String,
+) {
+    val outputMethodName: String = PREFIX + methodName
+    val outputTestName: String = "$PREFIX$simpleClassName.$methodName"
+    val fullNameUnsanitized: String = "$fullClassName#$methodName"
+    val traceUniqueName: String = simpleClassName + "_" + methodName
+}
diff --git a/benchmark/benchmark-common/src/main/java/androidx/benchmark/ThrottleDetector.kt b/benchmark/benchmark-common/src/main/java/androidx/benchmark/ThrottleDetector.kt
index f89e6cc..9b0b435 100644
--- a/benchmark/benchmark-common/src/main/java/androidx/benchmark/ThrottleDetector.kt
+++ b/benchmark/benchmark-common/src/main/java/androidx/benchmark/ThrottleDetector.kt
@@ -33,12 +33,12 @@
         repeat(10) { System.arraycopy(a, 0, b, 0, a.size) }
     }
 
-    internal fun measureWorkNs(): Double {
+    internal fun measureWorkNs1(): Double {
         // Access a non-trivial amount of data to try and 'reset' any cache state.
         // Have observed this to give more consistent performance when clocks are unlocked.
         copySomeData()
 
-        val state = BenchmarkState(simplifiedTimingOnlyMode = true)
+        val state = BenchmarkStateLegacy(simplifiedTimingOnlyMode = true)
         val sourceMatrix = FloatArray(16) { System.nanoTime().toFloat() }
         val resultMatrix = FloatArray(16)
 
@@ -50,6 +50,20 @@
         return state.getMinTimeNanos()
     }
 
+    internal fun measureWorkNs(): Double =
+        inMemoryTrace("measureWorkNs") {
+            // Access a non-trivial amount of data to try and 'reset' any cache state.
+            // Have observed this to give more consistent performance when clocks are unlocked.
+            copySomeData()
+            val sourceMatrix = FloatArray(16) { System.nanoTime().toFloat() }
+            val resultMatrix = FloatArray(16)
+
+            return measureRepeatedCheckNanosReentrant {
+                // Benchmark a trivial consistent task
+                Matrix.translateM(resultMatrix, 0, sourceMatrix, 0, 1F, 2F, 3F)
+            }
+        }
+
     /**
      * Called to calculate throttling baseline, will be ignored after first call until reset.
      *
diff --git a/benchmark/benchmark-common/src/main/java/androidx/benchmark/perfetto/PerfettoCaptureWrapper.kt b/benchmark/benchmark-common/src/main/java/androidx/benchmark/perfetto/PerfettoCaptureWrapper.kt
index 0bfa464..7dd4e03 100644
--- a/benchmark/benchmark-common/src/main/java/androidx/benchmark/perfetto/PerfettoCaptureWrapper.kt
+++ b/benchmark/benchmark-common/src/main/java/androidx/benchmark/perfetto/PerfettoCaptureWrapper.kt
@@ -34,6 +34,9 @@
 import androidx.tracing.perfetto.handshake.protocol.ResponseResultCodes.RESULT_CODE_SUCCESS
 import java.io.FileOutputStream
 import java.lang.RuntimeException
+import kotlin.contracts.ExperimentalContracts
+import kotlin.contracts.InvocationKind
+import kotlin.contracts.contract
 
 /** Wrapper for [PerfettoCapture] which does nothing below API 23. */
 @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
@@ -109,6 +112,7 @@
         }
     }
 
+    @OptIn(ExperimentalContracts::class)
     fun record(
         fileLabel: String,
         config: PerfettoConfig,
@@ -118,6 +122,7 @@
         inMemoryTracingLabel: String? = null,
         block: () -> Unit
     ): String? {
+        contract { callsInPlace(block, InvocationKind.EXACTLY_ONCE) }
         // skip if Perfetto not supported, or if caller opts out
         if (Build.VERSION.SDK_INT < 23 || !isAbiSupported() || !enableTracing) {
             block()
diff --git a/benchmark/benchmark-junit4/api/current.txt b/benchmark/benchmark-junit4/api/current.txt
index 9cf3391..9f33a3c 100644
--- a/benchmark/benchmark-junit4/api/current.txt
+++ b/benchmark/benchmark-junit4/api/current.txt
@@ -9,10 +9,15 @@
     ctor public BenchmarkRule();
     ctor @SuppressCompatibility @androidx.benchmark.ExperimentalBenchmarkConfigApi public BenchmarkRule(androidx.benchmark.MicrobenchmarkConfig config);
     method public org.junit.runners.model.Statement apply(org.junit.runners.model.Statement base, org.junit.runner.Description description);
+    method public androidx.benchmark.MicrobenchmarkConfig getConfig();
     method public androidx.benchmark.BenchmarkState getState();
+    property public final androidx.benchmark.MicrobenchmarkConfig config;
   }
 
   public final class BenchmarkRule.Scope {
+    method public final void pauseMeasurement();
+    method public final void resumeMeasurement();
+    method public final <T> T! runWithMeasurementDisabled(kotlin.jvm.functions.Function0<? extends T!>);
     method public inline <T> T runWithTimingDisabled(kotlin.jvm.functions.Function0<? extends T> block);
   }
 
diff --git a/benchmark/benchmark-junit4/api/restricted_current.txt b/benchmark/benchmark-junit4/api/restricted_current.txt
index 13794ef..e34a578 100644
--- a/benchmark/benchmark-junit4/api/restricted_current.txt
+++ b/benchmark/benchmark-junit4/api/restricted_current.txt
@@ -9,11 +9,18 @@
     ctor public BenchmarkRule();
     ctor @SuppressCompatibility @androidx.benchmark.ExperimentalBenchmarkConfigApi public BenchmarkRule(androidx.benchmark.MicrobenchmarkConfig config);
     method public org.junit.runners.model.Statement apply(org.junit.runners.model.Statement base, org.junit.runner.Description description);
+    method public androidx.benchmark.MicrobenchmarkConfig getConfig();
     method public androidx.benchmark.BenchmarkState getState();
+    property public final androidx.benchmark.MicrobenchmarkConfig config;
+    property @kotlin.PublishedApi internal final androidx.benchmark.TestDefinition? testDefinition;
+    field @kotlin.PublishedApi internal androidx.benchmark.TestDefinition? testDefinition;
   }
 
   public final class BenchmarkRule.Scope {
     method @kotlin.PublishedApi internal androidx.benchmark.BenchmarkState getOuterState();
+    method public final void pauseMeasurement();
+    method public final void resumeMeasurement();
+    method public final <T> T! runWithMeasurementDisabled(kotlin.jvm.functions.Function0<? extends T!>);
     method public inline <T> T runWithTimingDisabled(kotlin.jvm.functions.Function0<? extends T> block);
   }
 
diff --git a/benchmark/benchmark-junit4/src/androidTest/java/androidx/benchmark/junit4/BenchmarkRuleAnnotationTest.kt b/benchmark/benchmark-junit4/src/androidTest/java/androidx/benchmark/junit4/BenchmarkRuleAnnotationTest.kt
index 59039df..ed17189 100644
--- a/benchmark/benchmark-junit4/src/androidTest/java/androidx/benchmark/junit4/BenchmarkRuleAnnotationTest.kt
+++ b/benchmark/benchmark-junit4/src/androidTest/java/androidx/benchmark/junit4/BenchmarkRuleAnnotationTest.kt
@@ -37,4 +37,9 @@
     fun throwsIfNotAnnotatedMeasure() {
         unannotatedRule.measureRepeated {}
     }
+
+    @Test(expected = IllegalStateException::class)
+    fun throwsIfNotAnnotatedMeasureMain() {
+        unannotatedRule.measureRepeatedOnMainThread {}
+    }
 }
diff --git a/benchmark/benchmark-junit4/src/androidTest/java/androidx/benchmark/junit4/BenchmarkRuleLegacyTest.kt b/benchmark/benchmark-junit4/src/androidTest/java/androidx/benchmark/junit4/BenchmarkRuleLegacyTest.kt
new file mode 100644
index 0000000..84ccc31
--- /dev/null
+++ b/benchmark/benchmark-junit4/src/androidTest/java/androidx/benchmark/junit4/BenchmarkRuleLegacyTest.kt
@@ -0,0 +1,88 @@
+/*
+ * Copyright 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package androidx.benchmark.junit4
+
+import android.annotation.SuppressLint
+import android.os.Looper
+import androidx.test.annotation.UiThreadTest
+import androidx.test.ext.junit.runners.AndroidJUnit4
+import androidx.test.filters.LargeTest
+import androidx.test.filters.SmallTest
+import java.util.concurrent.TimeUnit
+import kotlin.test.assertEquals
+import kotlin.test.assertFailsWith
+import kotlin.test.assertTrue
+import org.junit.Assert
+import org.junit.Rule
+import org.junit.Test
+import org.junit.runner.RunWith
+
+@LargeTest
+@RunWith(AndroidJUnit4::class)
+class BenchmarkRuleLegacyTest {
+    @get:Rule val benchmarkRule = BenchmarkRuleLegacy()
+
+    @SuppressLint("BanThreadSleep") // doesn't affect runtime, since we have target time
+    @Test
+    fun runWithTimingDisabled() {
+        benchmarkRule.measureRepeated { runWithTimingDisabled { Thread.sleep(5) } }
+        val min = benchmarkRule.getState().getMinTimeNanos()
+        Assert.assertTrue(
+            "minimum $min should be less than 1ms",
+            min < TimeUnit.MILLISECONDS.toNanos(1)
+        )
+    }
+
+    @Test
+    fun measureRepeatedMainThread() {
+        var scheduledOnMain = false
+
+        // validate rethrow behavior
+        assertFailsWith<IllegalStateException> {
+            benchmarkRule.measureRepeatedOnMainThread {
+                scheduledOnMain = Looper.myLooper() == Looper.getMainLooper()
+
+                throw IllegalStateException("just a test")
+            }
+        }
+
+        // validate work done on main thread
+        assertTrue(scheduledOnMain)
+
+        // let a benchmark actually run, so "benchmark hasn't finished" isn't thrown
+        benchmarkRule.measureRepeatedOnMainThread {}
+    }
+
+    @SmallTest
+    @Test
+    @UiThreadTest
+    fun measureRepeatedOnMainThread_throwOnMain() {
+        assertEquals(Looper.myLooper(), Looper.getMainLooper())
+        // validate rethrow behavior
+        val exception =
+            assertFailsWith<IllegalStateException> {
+                benchmarkRule.measureRepeatedOnMainThread {
+                    // Doesn't matter
+                }
+            }
+        assertTrue(
+            exception.message!!.contains(
+                "Cannot invoke measureRepeatedOnMainThread from the main thread"
+            )
+        )
+    }
+}
diff --git a/benchmark/benchmark-junit4/src/androidTest/java/androidx/benchmark/junit4/BenchmarkRuleTest.kt b/benchmark/benchmark-junit4/src/androidTest/java/androidx/benchmark/junit4/BenchmarkRuleTest.kt
index 8adb35b..f0fa7fe 100644
--- a/benchmark/benchmark-junit4/src/androidTest/java/androidx/benchmark/junit4/BenchmarkRuleTest.kt
+++ b/benchmark/benchmark-junit4/src/androidTest/java/androidx/benchmark/junit4/BenchmarkRuleTest.kt
@@ -16,17 +16,14 @@
 
 package androidx.benchmark.junit4
 
-import android.annotation.SuppressLint
 import android.os.Looper
 import androidx.test.annotation.UiThreadTest
 import androidx.test.ext.junit.runners.AndroidJUnit4
 import androidx.test.filters.LargeTest
 import androidx.test.filters.SmallTest
-import java.util.concurrent.TimeUnit
 import kotlin.test.assertEquals
 import kotlin.test.assertFailsWith
 import kotlin.test.assertTrue
-import org.junit.Assert
 import org.junit.Rule
 import org.junit.Test
 import org.junit.runner.RunWith
@@ -36,17 +33,6 @@
 class BenchmarkRuleTest {
     @get:Rule val benchmarkRule: BenchmarkRule = BenchmarkRule()
 
-    @SuppressLint("BanThreadSleep") // doesn't affect runtime, since we have target time
-    @Test
-    fun runWithTimingDisabled() {
-        benchmarkRule.measureRepeated { runWithTimingDisabled { Thread.sleep(5) } }
-        val min = benchmarkRule.getState().getMinTimeNanos()
-        Assert.assertTrue(
-            "minimum $min should be less than 1ms",
-            min < TimeUnit.MILLISECONDS.toNanos(1)
-        )
-    }
-
     @Test
     fun measureRepeatedMainThread() {
         var scheduledOnMain = false
diff --git a/benchmark/benchmark-junit4/src/main/java/androidx/benchmark/junit4/BenchmarkRule.kt b/benchmark/benchmark-junit4/src/main/java/androidx/benchmark/junit4/BenchmarkRule.kt
index b1afdf0..ac56c23 100644
--- a/benchmark/benchmark-junit4/src/main/java/androidx/benchmark/junit4/BenchmarkRule.kt
+++ b/benchmark/benchmark-junit4/src/main/java/androidx/benchmark/junit4/BenchmarkRule.kt
@@ -17,30 +17,18 @@
 package androidx.benchmark.junit4
 
 import android.Manifest
-import android.os.Build
 import android.os.Looper
-import android.util.Log
 import androidx.annotation.RestrictTo
 import androidx.benchmark.Arguments
 import androidx.benchmark.BenchmarkState
 import androidx.benchmark.DeviceInfo
 import androidx.benchmark.ExperimentalBenchmarkConfigApi
 import androidx.benchmark.MicrobenchmarkConfig
-import androidx.benchmark.perfetto.PerfettoCapture
-import androidx.benchmark.perfetto.PerfettoCaptureWrapper
-import androidx.benchmark.perfetto.PerfettoConfig
-import androidx.benchmark.perfetto.UiState
-import androidx.benchmark.perfetto.appendUiState
-import androidx.test.platform.app.InstrumentationRegistry
-import androidx.test.platform.app.InstrumentationRegistry.getInstrumentation
+import androidx.benchmark.MicrobenchmarkRunningState
+import androidx.benchmark.MicrobenchmarkScope
+import androidx.benchmark.TestDefinition
+import androidx.benchmark.measureRepeatedImplWithTracing
 import androidx.test.rule.GrantPermissionRule
-import androidx.tracing.Trace
-import androidx.tracing.trace
-import java.io.File
-import java.util.concurrent.ExecutionException
-import java.util.concurrent.FutureTask
-import java.util.concurrent.TimeUnit
-import org.junit.Assert.assertTrue
 import org.junit.Assume.assumeFalse
 import org.junit.Assume.assumeTrue
 import org.junit.rules.RuleChain
@@ -66,25 +54,31 @@
  * @sample androidx.benchmark.samples.benchmarkRuleSample
  */
 class BenchmarkRule
-private constructor(
-    private val config: MicrobenchmarkConfig?,
-    /**
-     * This param is ignored, and just present to disambiguate the internal (nullable) vs external
-     * (non-null) variants of the constructor, since a lint failure occurs if they have the same
-     * signature, even if the external variant uses `this(config as MicrobenchmarkConfig?)`.
-     *
-     * In the future, we should just always pass a "default" config object, which can reference
-     * default values from Arguments, but that's a deeper change.
-     */
-    @Suppress("UNUSED_PARAMETER") ignored: Boolean = true
+@ExperimentalBenchmarkConfigApi
+constructor(
+    val config: MicrobenchmarkConfig,
 ) : TestRule {
-    constructor() : this(config = null, ignored = true)
+    constructor() : this(config = MicrobenchmarkConfig())
 
-    @ExperimentalBenchmarkConfigApi
-    constructor(config: MicrobenchmarkConfig) : this(config, ignored = true)
+    @PublishedApi
+    internal // synthetic access
+    var testDefinition: TestDefinition? = null
+        get() {
+            throwIfNotApplied()
+            return field
+        }
 
     internal // synthetic access
-    var internalState = BenchmarkState(config)
+    var internalState: BenchmarkState? = null
+
+    internal fun throwIfNotApplied() {
+        if (!applied) {
+            throw IllegalStateException(
+                "Cannot get state before BenchmarkRule is applied to a test. Check that your " +
+                    "BenchmarkRule is annotated correctly (@Rule in Java, @get:Rule in Kotlin)."
+            )
+        }
+    }
 
     /**
      * Object used for benchmarking in Java.
@@ -106,56 +100,65 @@
      *
      * @throws [IllegalStateException] if the BenchmarkRule isn't correctly applied to a test.
      */
-    public fun getState(): BenchmarkState {
+    fun getState(): BenchmarkState {
         // Note: this is an explicit method instead of an accessor to help convey it's only for Java
         // Kotlin users should call the [measureRepeated] method.
-        if (!applied) {
-            throw IllegalStateException(
-                "Cannot get state before BenchmarkRule is applied to a test. Check that your " +
-                    "BenchmarkRule is annotated correctly (@Rule in Java, @get:Rule in Kotlin)."
-            )
-        }
-        return internalState
+        throwIfNotApplied()
+        return internalState!!
     }
 
     internal // synthetic access
     var applied = false
 
-    @get:RestrictTo(RestrictTo.Scope.LIBRARY) public val scope: Scope = Scope()
+    // can we avoid published API here?
+    @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
+    @get:RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
+    val scopeFactory: (MicrobenchmarkRunningState) -> MicrobenchmarkScope = { runningState ->
+        Scope(runningState)
+    }
 
-    /** Handle used for controlling timing during [measureRepeated]. */
-    public inner class Scope internal constructor() {
-        /**
-         * Disable timing for a block of code.
+    /** Handle used for controlling measurement during [measureRepeated]. */
+    inner class Scope internal constructor(internal val state: MicrobenchmarkRunningState) :
+
+        /*
+         * Ideally, the microbenchmark scope concept would live entirely in benchmark-common so that
+         * we can define it in common code, without a dependence on benchmark-junit / JUnit.
          *
-         * Used for disabling timing for work that isn't part of the benchmark:
+         * To preserve compatibility though, we have to preserve this copy, which causes the
+         * following layering compromises:
+         *
+         * 1. The top level `measureRepeated` function accepts a `scopeFactory` function to let it
+         * construct a BenchmarkRule.Scope object, even though it's a trivial wrapper around
+         * MicrobenchmarkScope.
+         *
+         * 2. To let scope-ish calls go from BenchmarkState -> MicrobenchmarkScope ->
+         * MicrobenchmarkRunningState, BenchmarkState has a LIBRARY_GROUP mutable var, so both
+         * legacy BenchmarkState.keepRunning() and modern BenchmarkRule.measureRepeated have to
+         * separately set BenchmarkState.scope after scope is constructed. This stinks, but it's the
+         * price of compat. Both are needed only because it was valid to pause timing in a pure
+         * Kotlin benchmark with rule.getState().pauseTiming()
+         */
+        MicrobenchmarkScope(state) {
+
+        /**
+         * Disable measurement for a block of code.
+         *
+         * Used for disabling timing/measurement for work that isn't part of the benchmark:
          * - When constructing per-loop randomized inputs for operations with caching,
          * - Controlling which parts of multi-stage work are measured (e.g. View measure/layout)
-         * - Disabling timing during per-loop verification
+         * - Per-loop verification
          *
          * @sample androidx.benchmark.samples.runWithTimingDisabledSample
          */
-        public inline fun <T> runWithTimingDisabled(block: () -> T): T {
-            getOuterState().pauseTiming()
-            // Note: we only bother with tracing for the runWithTimingDisabled function for
-            // Kotlin callers, as it's more difficult to corrupt the trace with incorrectly
-            // paired BenchmarkState pause/resume calls
-            val ret: T =
-                try {
-                    // TODO: use `trace() {}` instead of this manual try/finally,
-                    //  once the block parameter is marked crossinline.
-                    Trace.beginSection("runWithTimingDisabled")
-                    block()
-                } finally {
-                    Trace.endSection()
-                }
-            getOuterState().resumeTiming()
-            return ret
+        inline fun <T> runWithTimingDisabled(block: () -> T): T {
+            return runWithMeasurementDisabled(block)
         }
 
         /**
-         * Allows the inline function [runWithTimingDisabled] to be called outside of this scope.
+         * Allows the inline function [runWithTimingDisabled] to be called outside of this scope for
+         * compat with compiled code using old versions of the library.
          */
+        @Suppress("unused")
         @PublishedApi
         internal fun getOuterState(): BenchmarkState {
             return getState()
@@ -184,84 +187,18 @@
             )
         }
 
-        var invokeMethodName = description.methodName
-        Log.d(TAG, "-- Running ${description.className}#$invokeMethodName --")
+        testDefinition =
+            TestDefinition(
+                fullClassName = description.className,
+                simpleClassName = description.testClass.simpleName,
+                methodName = description.methodName
+            )
 
-        // validate and simplify the function name.
-        // First, remove the "test" prefix which normally comes from CTS test.
-        // Then make sure the [subTestName] is valid, not just numbers like [0].
-        if (invokeMethodName.startsWith("test")) {
-            assertTrue("The test name $invokeMethodName is too short", invokeMethodName.length > 5)
-            invokeMethodName =
-                invokeMethodName.substring(4, 5).lowercase() + invokeMethodName.substring(5)
-        }
-        val uniqueName = description.testClass.simpleName + "_" + invokeMethodName
-        internalState.traceUniqueName = uniqueName
+        // only used with legacy getState() API, which is intended to be deprecated in the future,
+        // to be replaced by Java variant of measureRepeated
+        internalState = BenchmarkState(testDefinition!!, config)
 
-        val tracePath =
-            PerfettoCaptureWrapper()
-                .record(
-                    fileLabel = uniqueName,
-                    config =
-                        PerfettoConfig.Benchmark(
-                            appTagPackages =
-                                if (config?.traceAppTagEnabled == true) {
-                                    listOf(
-                                        InstrumentationRegistry.getInstrumentation()
-                                            .context
-                                            .packageName
-                                    )
-                                } else {
-                                    emptyList()
-                                },
-                            useStackSamplingConfig = false
-                        ),
-                    // TODO(290918736): add support for Perfetto SDK Tracing in
-                    //  Microbenchmark in other cases, outside of MicrobenchmarkConfig
-                    perfettoSdkConfig =
-                        if (
-                            config?.perfettoSdkTracingEnabled == true &&
-                                Build.VERSION.SDK_INT >= Build.VERSION_CODES.M
-                        ) {
-                            PerfettoCapture.PerfettoSdkConfig(
-                                getInstrumentation().context.packageName,
-                                PerfettoCapture.PerfettoSdkConfig.InitialProcessState.Alive
-                            )
-                        } else {
-                            null
-                        },
-
-                    // Optimize throughput in dryRunMode, since trace isn't useful, and extremely
-                    //   expensive on some emulators. Could alternately use UserspaceTracing if
-                    // desired
-                    // Additionally, skip on misconfigured devices to still enable benchmarking.
-                    enableTracing = !Arguments.dryRunMode && !DeviceInfo.misconfiguredForTracing,
-                    inMemoryTracingLabel = "Microbenchmark"
-                ) {
-                    trace(description.displayName) { base.evaluate() }
-                }
-                ?.apply {
-                    // trace completed, and copied into shell writeable dir
-                    val file = File(this)
-                    file.appendUiState(
-                        UiState(
-                            timelineStart = null,
-                            timelineEnd = null,
-                            highlightPackage = getInstrumentation().context.packageName
-                        )
-                    )
-                }
-
-        internalState.report(
-            fullClassName = description.className,
-            simpleClassName = description.testClass.simpleName,
-            methodName = invokeMethodName,
-            perfettoTracePath = tracePath
-        )
-    }
-
-    internal companion object {
-        private const val TAG = "Benchmark"
+        base.evaluate()
     }
 }
 
@@ -273,26 +210,27 @@
  */
 public inline fun BenchmarkRule.measureRepeated(crossinline block: BenchmarkRule.Scope.() -> Unit) {
     // Note: this is an extension function to discourage calling from Java.
-
     if (Arguments.throwOnMainThreadMeasureRepeated) {
         check(Looper.myLooper() != Looper.getMainLooper()) {
             "Cannot invoke measureRepeated from the main thread. Instead use" +
                 " measureRepeatedOnMainThread()"
         }
     }
-
-    // Extract members to locals, to ensure we check #applied, and we don't hit accessors
-    val localState = getState()
-    val localScope = scope
-
-    try {
-        while (localState.keepRunningInline()) {
-            block(localScope)
+    measureRepeatedImplWithTracing(
+        postToMainThread = false,
+        definition = testDefinition!!,
+        config = config,
+        scopeFactory = scopeFactory, // inflate custom Scope object to respect/maintain public API
+        loopedMeasurementBlock = { scope, iterations ->
+            val ruleScope = scope as BenchmarkRule.Scope // cast back to outer scope type
+            getState().scope = scope
+            var remainingIterations = iterations
+            do {
+                block.invoke(ruleScope)
+                remainingIterations--
+            } while (remainingIterations > 0)
         }
-    } catch (t: Throwable) {
-        localState.cleanupBeforeThrow()
-        throw t
-    }
+    )
 }
 
 /**
@@ -315,76 +253,21 @@
         "Cannot invoke measureRepeatedOnMainThread from the main thread"
     }
 
-    var resumeScheduled = false
-    while (true) {
-        val task = FutureTask {
-            // Extract members to locals, to ensure we check #applied, and we don't hit accessors
-            val localState = getState()
-            val localScope = scope
-
-            val initialTimeNs = System.nanoTime()
-            // we try to stop next measurement after soft deadline...
-            val softDeadlineNs = initialTimeNs + TimeUnit.SECONDS.toNanos(2)
-            // ... and throw if took longer than hard deadline
-            val hardDeadlineNs = initialTimeNs + TimeUnit.SECONDS.toNanos(10)
-            var timeNs: Long = 0
-
-            try {
-                Trace.beginSection("measureRepeatedOnMainThread task")
-
-                if (resumeScheduled) {
-                    localState.resumeTiming()
-                }
-
-                do {
-                    // note that this function can still block for considerable time, e.g. when
-                    // setting up / tearing down profiling, or sleeping to let the device cool off.
-                    if (!localState.keepRunningInline()) {
-                        return@FutureTask false
-                    }
-
-                    block(localScope)
-
-                    // Avoid checking for deadline on all but last iteration per measurement,
-                    // to amortize cost of System.nanoTime(). Without this optimization, minimum
-                    // measured time can be 10x higher.
-                    if (localState.getIterationsRemaining() != 1) {
-                        continue
-                    }
-                    timeNs = System.nanoTime()
-                } while (timeNs <= softDeadlineNs)
-
-                resumeScheduled = true
-                localState.pauseTiming()
-
-                if (timeNs > hardDeadlineNs && Arguments.measureRepeatedOnMainThrowOnDeadline) {
-                    localState.cleanupBeforeThrow()
-                    val overrunInSec = (timeNs - hardDeadlineNs) / 1_000_000_000.0
-                    throw IllegalStateException(
-                        "Benchmark loop overran hard time limit by $overrunInSec seconds"
-                    )
-                }
-
-                return@FutureTask true // continue
-            } finally {
-                Trace.endSection()
-            }
+    measureRepeatedImplWithTracing(
+        postToMainThread = true,
+        definition = testDefinition!!,
+        config = config,
+        scopeFactory = scopeFactory, // inflate custom Scope object to respect/maintain public API
+        loopedMeasurementBlock = { scope, iterations ->
+            val ruleScope = scope as BenchmarkRule.Scope // cast back to outer scope type
+            getState().scope = scope
+            var remainingIterations = iterations
+            do {
+                block.invoke(ruleScope)
+                remainingIterations--
+            } while (remainingIterations > 0)
         }
-        getInstrumentation().runOnMainSync(task)
-        val shouldContinue: Boolean =
-            try {
-                // Ideally we'd implement the delay here, as a timeout, but we can't do this until
-                // have a way to move thermal throttle sleeping off the UI thread.
-                task.get()
-            } catch (e: ExecutionException) {
-                // Expose the original exception
-                throw e.cause!!
-            }
-        if (!shouldContinue) {
-            // all done
-            break
-        }
-    }
+    )
 }
 
 internal inline fun Statement(crossinline evaluate: () -> Unit) =
diff --git a/benchmark/benchmark-junit4/src/main/java/androidx/benchmark/junit4/BenchmarkRuleLegacy.kt b/benchmark/benchmark-junit4/src/main/java/androidx/benchmark/junit4/BenchmarkRuleLegacy.kt
new file mode 100644
index 0000000..cdbe16e
--- /dev/null
+++ b/benchmark/benchmark-junit4/src/main/java/androidx/benchmark/junit4/BenchmarkRuleLegacy.kt
@@ -0,0 +1,389 @@
+/*
+ * Copyright 2018 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 androidx.benchmark.junit4
+
+import android.Manifest
+import android.os.Build
+import android.os.Looper
+import android.util.Log
+import androidx.annotation.RestrictTo
+import androidx.benchmark.Arguments
+import androidx.benchmark.BenchmarkStateLegacy
+import androidx.benchmark.DeviceInfo
+import androidx.benchmark.ExperimentalBenchmarkConfigApi
+import androidx.benchmark.MicrobenchmarkConfig
+import androidx.benchmark.perfetto.PerfettoCapture
+import androidx.benchmark.perfetto.PerfettoCaptureWrapper
+import androidx.benchmark.perfetto.PerfettoConfig
+import androidx.benchmark.perfetto.UiState
+import androidx.benchmark.perfetto.appendUiState
+import androidx.test.platform.app.InstrumentationRegistry.getInstrumentation
+import androidx.test.rule.GrantPermissionRule
+import androidx.tracing.Trace
+import androidx.tracing.trace
+import java.io.File
+import java.util.concurrent.ExecutionException
+import java.util.concurrent.FutureTask
+import java.util.concurrent.TimeUnit
+import org.junit.Assert.assertTrue
+import org.junit.Assume.assumeFalse
+import org.junit.Assume.assumeTrue
+import org.junit.rules.RuleChain
+import org.junit.rules.TestRule
+import org.junit.runner.Description
+import org.junit.runners.model.Statement
+
+/**
+ * JUnit rule for benchmarking code on an Android device.
+ *
+ * In Kotlin, benchmark with [measureRepeated]. In Java, use [getState].
+ *
+ * Benchmark results will be output:
+ * - Summary in Android Studio in the test log
+ * - In JSON format, on the host
+ * - In simple form in Logcat with the tag "Benchmark"
+ *
+ * Every test in the Class using this @Rule must contain a single benchmark.
+ *
+ * See the [Benchmark Guide](https://developer.android.com/studio/profile/benchmark) for more
+ * information on writing Benchmarks.
+ *
+ * @sample androidx.benchmark.samples.benchmarkRuleSample
+ */
+@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
+class BenchmarkRuleLegacy
+private constructor(
+    private val config: MicrobenchmarkConfig?,
+    /**
+     * This param is ignored, and just present to disambiguate the internal (nullable) vs external
+     * (non-null) variants of the constructor, since a lint failure occurs if they have the same
+     * signature, even if the external variant uses `this(config as MicrobenchmarkConfig?)`.
+     *
+     * In the future, we should just always pass a "default" config object, which can reference
+     * default values from Arguments, but that's a deeper change.
+     */
+    @Suppress("UNUSED_PARAMETER") ignored: Boolean = true
+) : TestRule {
+    constructor() : this(config = null, ignored = true)
+
+    @ExperimentalBenchmarkConfigApi
+    constructor(config: MicrobenchmarkConfig) : this(config, ignored = true)
+
+    internal // synthetic access
+    var internalState = BenchmarkStateLegacy(config)
+
+    /**
+     * Object used for benchmarking in Java.
+     *
+     * ```java
+     * @Rule
+     * public BenchmarkRule benchmarkRule = new BenchmarkRule();
+     *
+     * @Test
+     * public void myBenchmark() {
+     *     ...
+     *     BenchmarkState state = benchmarkRule.getBenchmarkState();
+     *     while (state.keepRunning()) {
+     *         doSomeWork();
+     *     }
+     *     ...
+     * }
+     * ```
+     *
+     * @throws [IllegalStateException] if the BenchmarkRule isn't correctly applied to a test.
+     */
+    public fun getState(): BenchmarkStateLegacy {
+        // Note: this is an explicit method instead of an accessor to help convey it's only for Java
+        // Kotlin users should call the [measureRepeated] method.
+        if (!applied) {
+            throw IllegalStateException(
+                "Cannot get state before BenchmarkRule is applied to a test. Check that your " +
+                    "BenchmarkRule is annotated correctly (@Rule in Java, @get:Rule in Kotlin)."
+            )
+        }
+        return internalState
+    }
+
+    internal // synthetic access
+    var applied = false
+
+    @get:RestrictTo(RestrictTo.Scope.LIBRARY) public val scope: Scope = Scope()
+
+    /** Handle used for controlling timing during [measureRepeated]. */
+    inner class Scope internal constructor() {
+        /**
+         * Disable timing for a block of code.
+         *
+         * Used for disabling timing for work that isn't part of the benchmark:
+         * - When constructing per-loop randomized inputs for operations with caching,
+         * - Controlling which parts of multi-stage work are measured (e.g. View measure/layout)
+         * - Disabling timing during per-loop verification
+         *
+         * @sample androidx.benchmark.samples.runWithTimingDisabledSample
+         */
+        public inline fun <T> runWithTimingDisabled(block: () -> T): T {
+            getOuterState().pauseTiming()
+            // Note: we only bother with tracing for the runWithTimingDisabled function for
+            // Kotlin callers, as it's more difficult to corrupt the trace with incorrectly
+            // paired BenchmarkState pause/resume calls
+            val ret: T =
+                try {
+                    // TODO: use `trace() {}` instead of this manual try/finally,
+                    //  once the block parameter is marked crossinline.
+                    Trace.beginSection("runWithTimingDisabled")
+                    block()
+                } finally {
+                    Trace.endSection()
+                }
+            getOuterState().resumeTiming()
+            return ret
+        }
+
+        /**
+         * Allows the inline function [runWithTimingDisabled] to be called outside of this scope.
+         */
+        @Suppress("ShowingMemberInHiddenClass")
+        @PublishedApi
+        internal fun getOuterState(): BenchmarkStateLegacy {
+            return getState()
+        }
+    }
+
+    override fun apply(base: Statement, description: Description): Statement {
+        return RuleChain.outerRule(
+                GrantPermissionRule.grant(Manifest.permission.WRITE_EXTERNAL_STORAGE)
+            )
+            .around(::applyInternal)
+            .apply(base, description)
+    }
+
+    private fun applyInternal(base: Statement, description: Description) = Statement {
+        applied = true
+
+        assumeTrue(Arguments.RuleType.Microbenchmark in Arguments.enabledRules)
+
+        // When running on emulator and argument `skipOnEmulator` is passed,
+        // the test is skipped.
+        if (Arguments.skipBenchmarksOnEmulator) {
+            assumeFalse(
+                "Skipping test because it's running on emulator and `skipOnEmulator` is enabled",
+                DeviceInfo.isEmulator
+            )
+        }
+
+        var invokeMethodName = description.methodName
+        Log.d(TAG, "-- Running ${description.className}#$invokeMethodName --")
+
+        // validate and simplify the function name.
+        // First, remove the "test" prefix which normally comes from CTS test.
+        // Then make sure the [subTestName] is valid, not just numbers like [0].
+        if (invokeMethodName.startsWith("test")) {
+            assertTrue("The test name $invokeMethodName is too short", invokeMethodName.length > 5)
+            invokeMethodName =
+                invokeMethodName.substring(4, 5).lowercase() + invokeMethodName.substring(5)
+        }
+        val uniqueName = description.testClass.simpleName + "_" + invokeMethodName
+        internalState.traceUniqueName = uniqueName
+
+        val tracePath =
+            PerfettoCaptureWrapper()
+                .record(
+                    fileLabel = uniqueName,
+                    config =
+                        PerfettoConfig.Benchmark(
+                            appTagPackages =
+                                if (config?.traceAppTagEnabled == true) {
+                                    listOf(getInstrumentation().context.packageName)
+                                } else {
+                                    emptyList()
+                                },
+                            useStackSamplingConfig = false
+                        ),
+                    // TODO(290918736): add support for Perfetto SDK Tracing in
+                    //  Microbenchmark in other cases, outside of MicrobenchmarkConfig
+                    perfettoSdkConfig =
+                        if (
+                            config?.perfettoSdkTracingEnabled == true &&
+                                Build.VERSION.SDK_INT >= Build.VERSION_CODES.M
+                        ) {
+                            PerfettoCapture.PerfettoSdkConfig(
+                                getInstrumentation().context.packageName,
+                                PerfettoCapture.PerfettoSdkConfig.InitialProcessState.Alive
+                            )
+                        } else {
+                            null
+                        },
+
+                    // Optimize throughput in dryRunMode, since trace isn't useful, and extremely
+                    //   expensive on some emulators. Could alternately use UserspaceTracing if
+                    // desired
+                    // Additionally, skip on misconfigured devices to still enable benchmarking.
+                    enableTracing = !Arguments.dryRunMode && !DeviceInfo.misconfiguredForTracing,
+                    inMemoryTracingLabel = "Microbenchmark"
+                ) {
+                    trace(description.displayName) { base.evaluate() }
+                }
+                ?.apply {
+                    // trace completed, and copied into shell writeable dir
+                    val file = File(this)
+                    file.appendUiState(
+                        UiState(
+                            timelineStart = null,
+                            timelineEnd = null,
+                            highlightPackage = getInstrumentation().context.packageName
+                        )
+                    )
+                }
+
+        internalState.report(
+            fullClassName = description.className,
+            simpleClassName = description.testClass.simpleName,
+            methodName = invokeMethodName,
+            perfettoTracePath = tracePath
+        )
+    }
+
+    internal companion object {
+        private const val TAG = "Benchmark"
+    }
+}
+
+/**
+ * Benchmark a block of code.
+ *
+ * @param block The block of code to benchmark.
+ * @sample androidx.benchmark.samples.benchmarkRuleSample
+ */
+@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
+inline fun BenchmarkRuleLegacy.measureRepeated(
+    crossinline block: BenchmarkRuleLegacy.Scope.() -> Unit
+) {
+    // Note: this is an extension function to discourage calling from Java.
+
+    if (Arguments.throwOnMainThreadMeasureRepeated) {
+        check(Looper.myLooper() != Looper.getMainLooper()) {
+            "Cannot invoke measureRepeated from the main thread. Instead use" +
+                " measureRepeatedOnMainThread()"
+        }
+    }
+
+    // Extract members to locals, to ensure we check #applied, and we don't hit accessors
+    val localState = getState()
+    val localScope = scope
+
+    try {
+        while (localState.keepRunningInline()) {
+            block(localScope)
+        }
+    } catch (t: Throwable) {
+        localState.cleanupBeforeThrow()
+        throw t
+    }
+}
+
+/**
+ * Benchmark a block of code, which runs on the main thread, and can safely interact with UI.
+ *
+ * While `@UiThreadRule` works for a standard test, it doesn't work for benchmarks of arbitrary
+ * duration, as they may run for much more than 5 seconds and suffer ANRs, especially in continuous
+ * runs.
+ *
+ * @param block The block of code to benchmark.
+ * @throws java.lang.Throwable when an exception is thrown on the main thread.
+ * @throws IllegalStateException if a hard deadline is exceeded while the block is running on the
+ *   main thread.
+ * @sample androidx.benchmark.samples.measureRepeatedOnMainThreadSample
+ */
+@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
+inline fun BenchmarkRuleLegacy.measureRepeatedOnMainThread(
+    crossinline block: BenchmarkRuleLegacy.Scope.() -> Unit
+) {
+    check(Looper.myLooper() != Looper.getMainLooper()) {
+        "Cannot invoke measureRepeatedOnMainThread from the main thread"
+    }
+
+    var resumeScheduled = false
+    while (true) {
+        val task = FutureTask {
+            // Extract members to locals, to ensure we check #applied, and we don't hit accessors
+            val localState = getState()
+            val localScope = scope
+
+            val initialTimeNs = System.nanoTime()
+            // we try to stop next measurement after soft deadline...
+            val softDeadlineNs = initialTimeNs + TimeUnit.SECONDS.toNanos(2)
+            // ... and throw if took longer than hard deadline
+            val hardDeadlineNs = initialTimeNs + TimeUnit.SECONDS.toNanos(10)
+            var timeNs: Long = 0
+
+            try {
+                Trace.beginSection("measureRepeatedOnMainThread task")
+
+                if (resumeScheduled) {
+                    localState.resumeTiming()
+                }
+
+                do {
+                    // note that this function can still block for considerable time, e.g. when
+                    // setting up / tearing down profiling, or sleeping to let the device cool off.
+                    if (!localState.keepRunningInline()) {
+                        return@FutureTask false
+                    }
+
+                    block(localScope)
+
+                    // Avoid checking for deadline on all but last iteration per measurement,
+                    // to amortize cost of System.nanoTime(). Without this optimization, minimum
+                    // measured time can be 10x higher.
+                    if (localState.getIterationsRemaining() != 1) {
+                        continue
+                    }
+                    timeNs = System.nanoTime()
+                } while (timeNs <= softDeadlineNs)
+
+                resumeScheduled = true
+                localState.pauseTiming()
+
+                if (timeNs > hardDeadlineNs && Arguments.measureRepeatedOnMainThrowOnDeadline) {
+                    localState.cleanupBeforeThrow()
+                    val overrunInSec = (timeNs - hardDeadlineNs) / 1_000_000_000.0
+                    throw IllegalStateException(
+                        "Benchmark loop overran hard time limit by $overrunInSec seconds"
+                    )
+                }
+
+                return@FutureTask true // continue
+            } finally {
+                Trace.endSection()
+            }
+        }
+        getInstrumentation().runOnMainSync(task)
+        val shouldContinue: Boolean =
+            try {
+                // Ideally we'd implement the delay here, as a timeout, but we can't do this until
+                // have a way to move thermal throttle sleeping off the UI thread.
+                task.get()
+            } catch (e: ExecutionException) {
+                // Expose the original exception
+                throw e.cause!!
+            }
+        if (!shouldContinue) {
+            // all done
+            break
+        }
+    }
+}
diff --git a/benchmark/benchmark/src/androidTest/java/androidx/benchmark/benchmark/BenchmarkStateBenchmark.kt b/benchmark/benchmark/src/androidTest/java/androidx/benchmark/benchmark/BenchmarkStateBenchmark.kt
index a1d8c31..f71a6a7 100644
--- a/benchmark/benchmark/src/androidTest/java/androidx/benchmark/benchmark/BenchmarkStateBenchmark.kt
+++ b/benchmark/benchmark/src/androidTest/java/androidx/benchmark/benchmark/BenchmarkStateBenchmark.kt
@@ -17,7 +17,7 @@
 package androidx.benchmark.benchmark
 
 import androidx.benchmark.BenchmarkState
-import androidx.benchmark.ExperimentalBenchmarkStateApi
+import androidx.benchmark.TestDefinition
 import androidx.test.ext.junit.runners.AndroidJUnit4
 import androidx.test.filters.LargeTest
 import org.junit.Test
@@ -26,13 +26,19 @@
 @LargeTest
 @RunWith(AndroidJUnit4::class)
 class BenchmarkStateBenchmark {
-    @OptIn(ExperimentalBenchmarkStateApi::class)
+    /** Proof of concept benchmark using BenchmarkState without a JUnit Rule */
     @Test
     fun nothing() {
-        val state = BenchmarkState(warmupCount = 10, repeatCount = 10)
+        val state =
+            BenchmarkState(
+                TestDefinition(
+                    "androidx.benchmark.benchmark.BenchmarkState2Benchmark",
+                    "BenchmarkState2Benchmark",
+                    "increment"
+                ),
+            )
         while (state.keepRunning()) {
-            // do nothing
+            //
         }
-        state.getMeasurementTimeNs()
     }
 }
diff --git a/benchmark/benchmark/src/androidTest/java/androidx/benchmark/benchmark/BenchmarkStateLegacyBenchmark.kt b/benchmark/benchmark/src/androidTest/java/androidx/benchmark/benchmark/BenchmarkStateLegacyBenchmark.kt
new file mode 100644
index 0000000..2824881
--- /dev/null
+++ b/benchmark/benchmark/src/androidTest/java/androidx/benchmark/benchmark/BenchmarkStateLegacyBenchmark.kt
@@ -0,0 +1,38 @@
+/*
+ * Copyright 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package androidx.benchmark.benchmark
+
+import androidx.benchmark.BenchmarkStateLegacy
+import androidx.benchmark.ExperimentalBenchmarkStateApi
+import androidx.test.ext.junit.runners.AndroidJUnit4
+import androidx.test.filters.LargeTest
+import org.junit.Test
+import org.junit.runner.RunWith
+
+@LargeTest
+@RunWith(AndroidJUnit4::class)
+class BenchmarkStateLegacyBenchmark {
+    @OptIn(ExperimentalBenchmarkStateApi::class)
+    @Test
+    fun nothing() {
+        val state = BenchmarkStateLegacy(warmupCount = 10, repeatCount = 10)
+        while (state.keepRunning()) {
+            // do nothing
+        }
+        state.getMeasurementTimeNs()
+    }
+}
diff --git a/benchmark/benchmark/src/androidTest/java/androidx/benchmark/benchmark/MeasureRepeatedSampleBenchmark.kt b/benchmark/benchmark/src/androidTest/java/androidx/benchmark/benchmark/MeasureRepeatedSampleBenchmark.kt
new file mode 100644
index 0000000..7cbe0c6
--- /dev/null
+++ b/benchmark/benchmark/src/androidTest/java/androidx/benchmark/benchmark/MeasureRepeatedSampleBenchmark.kt
@@ -0,0 +1,47 @@
+/*
+ * Copyright 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package androidx.benchmark.benchmark
+
+import androidx.benchmark.ExperimentalBenchmarkConfigApi
+import androidx.benchmark.ExperimentalBlackHoleApi
+import androidx.benchmark.TestDefinition
+import androidx.benchmark.measureRepeated
+import androidx.test.ext.junit.runners.AndroidJUnit4
+import androidx.test.filters.LargeTest
+import org.junit.Test
+import org.junit.runner.RunWith
+
+@OptIn(ExperimentalBenchmarkConfigApi::class, ExperimentalBlackHoleApi::class)
+@LargeTest
+@RunWith(AndroidJUnit4::class)
+class MeasureRepeatedSampleBenchmark {
+    /** Proof of concept of top-level benchmark function, without a JUnit Rule */
+    @Test
+    fun increment() {
+        println("increment")
+        var i: Int = 0
+        measureRepeated(
+            TestDefinition(
+                "androidx.benchmark.benchmark.MeasureRepeatedSampleBenchmark",
+                "MeasureRepeatedSampleBenchmark",
+                "increment"
+            )
+        ) {
+            i++
+        }
+    }
+}
diff --git a/benchmark/benchmark/src/androidTest/java/androidx/benchmark/benchmark/TrivialKotlinBenchmarkLegacy.kt b/benchmark/benchmark/src/androidTest/java/androidx/benchmark/benchmark/TrivialKotlinBenchmarkLegacy.kt
new file mode 100644
index 0000000..97c91c3
--- /dev/null
+++ b/benchmark/benchmark/src/androidTest/java/androidx/benchmark/benchmark/TrivialKotlinBenchmarkLegacy.kt
@@ -0,0 +1,42 @@
+/*
+ * Copyright 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package androidx.benchmark.benchmark
+
+import android.annotation.SuppressLint
+import androidx.benchmark.junit4.BenchmarkRuleLegacy
+import androidx.benchmark.junit4.measureRepeated
+import androidx.test.ext.junit.runners.AndroidJUnit4
+import androidx.test.filters.LargeTest
+import org.junit.Rule
+import org.junit.Test
+import org.junit.runner.RunWith
+
+@LargeTest
+@RunWith(AndroidJUnit4::class)
+class TrivialKotlinBenchmarkLegacy {
+    @get:Rule val benchmarkRule = BenchmarkRuleLegacy()
+
+    @SuppressLint("BanThreadSleep") // intentional bad behavior / regression
+    @Test
+    fun nothing() = benchmarkRule.measureRepeated { Thread.sleep(1) }
+
+    @Test
+    fun increment() {
+        var i = 0
+        benchmarkRule.measureRepeated { i++ }
+    }
+}
diff --git a/camera/camera-camera2-pipe/src/main/java/androidx/camera/camera2/pipe/compat/Camera2DeviceManager.kt b/camera/camera-camera2-pipe/src/main/java/androidx/camera/camera2/pipe/compat/Camera2DeviceManager.kt
index 0a28700..1fcd4f7 100644
--- a/camera/camera-camera2-pipe/src/main/java/androidx/camera/camera2/pipe/compat/Camera2DeviceManager.kt
+++ b/camera/camera-camera2-pipe/src/main/java/androidx/camera/camera2/pipe/compat/Camera2DeviceManager.kt
@@ -25,6 +25,7 @@
 import androidx.camera.camera2.pipe.core.PruningProcessingQueue
 import androidx.camera.camera2.pipe.core.PruningProcessingQueue.Companion.processIn
 import androidx.camera.camera2.pipe.core.Threads
+import androidx.camera.camera2.pipe.core.Token
 import androidx.camera.camera2.pipe.core.WakeLock
 import androidx.camera.camera2.pipe.graph.GraphListener
 import androidx.camera.camera2.pipe.graph.GraphRequestProcessor
@@ -138,8 +139,14 @@
         }
     }
 
-    suspend fun connectTo(virtualCameraState: VirtualCameraState) {
-        val token = wakelock.acquire()
+    // Acquire this ActiveCamera. This ensures the camera stay opened for as long as the token is
+    // held. This is important for camera open scenarios where the device manager should acquire
+    // the ActiveCamera for the duration under which it's processing an open request.
+    fun acquire() = wakelock.acquire()
+
+    // TODO: b/389758537, b/390530866 - Make Token non-nullable. If we cannot acquire a token, the
+    //  ActiveCamera has issued a RequestClose for this ActiveCamera already.
+    suspend fun connectTo(virtualCameraState: VirtualCameraState, token: Token?) {
         val previous = current
         current = virtualCameraState
 
@@ -179,8 +186,18 @@
     private val queue =
         PruningProcessingQueue<CameraRequest>(prune = ::prune) { process(it) }.processIn(scope)
     private val activeCameras: MutableSet<ActiveCamera> = mutableSetOf()
-    private val pendingRequestOpens = mutableListOf<RequestOpen>()
-    private val pendingRequestOpenActiveCameraMap = mutableMapOf<RequestOpen, ActiveCamera>()
+
+    // PendingRequestOpen stores the context information for the pending RequestOpens to be
+    // connected in concurrent camera scenarios. It contains the request itself, the active camera
+    // it should be connected with, and the usage token for the active camera. The token should
+    // always be closed if the context is removed without being connected to a VirtualCamera.
+    private class PendingRequestOpen(
+        val request: RequestOpen,
+        val activeCamera: ActiveCamera,
+        val token: Token,
+    )
+
+    private val pendingRequestOpens = mutableListOf<PendingRequestOpen>()
 
     override fun open(
         cameraId: CameraId,
@@ -358,12 +375,9 @@
         if (camerasToClose.isNotEmpty()) {
             // Shutdown of cameras should always happen first (and suspend until complete)
             activeCameras.removeAll(camerasToClose)
-            for (requestOpen in pendingRequestOpens) {
-                if (camerasToClose.contains(pendingRequestOpenActiveCameraMap[requestOpen])) {
-                    pendingRequestOpens.remove(requestOpen)
-                    pendingRequestOpenActiveCameraMap.remove(requestOpen)
-                }
-            }
+            disconnectPendingRequestOpens(
+                pendingRequestOpens.filter { camerasToClose.contains(it.activeCamera) }
+            )
             for (camera in camerasToClose) {
                 camera.close()
             }
@@ -374,51 +388,37 @@
 
         // Step 2: Open the camera if not opened already.
         camera2ErrorProcessor.setActiveVirtualCamera(cameraIdToOpen, request.virtualCamera)
-        var realCamera = activeCameras.firstOrNull { it.cameraId == cameraIdToOpen }
-        if (realCamera == null) {
-            val openResult =
-                openCameraWithRetry(
-                    cameraIdToOpen,
-                    request.sharedCameraIds,
-                    request.isForegroundObserver,
-                    scope,
-                )
-            when (openResult) {
-                is OpenVirtualCameraResult.Success -> {
-                    realCamera = openResult.activeCamera
-                    activeCameras.add(realCamera)
-                }
-                is OpenVirtualCameraResult.Error -> {
-                    request.virtualCamera.disconnect(openResult.lastCameraError)
-                    return
-                }
-            }
+        val result = retrieveActiveCamera(cameraIdToOpen, request)
+        if (result == null) {
+            Log.error { "Failed to retrieve active camera for $cameraIdToOpen" }
+            return
         }
+        val realCamera = result.activeCamera
+        val realCameraToken = result.token
 
         // Step 3: Connect the opened camera(s).
         if (request.sharedCameraIds.isNotEmpty()) {
-            // Both sharedCameraIds and activeCameras are small collections. Looping over them
-            // in what equates to nested for-loops are actually going to be more efficient than
-            // say, replacing activeCameras with a hashmap.
+            // Both sharedCameraIds and pendingRequestOpenContexts are small collections. Looping
+            // over them in what equates to nested for-loops are actually going to be more efficient
+            // than say, replacing activeCameras with a hashmap.
             if (
                 request.sharedCameraIds.all { cameraId ->
-                    activeCameras.any { it.cameraId == cameraId }
+                    pendingRequestOpens.any { it.activeCamera.cameraId == cameraId }
                 }
             ) {
                 // If the camera of the request and the cameras it is shared with have been
                 // opened, we can connect the ActiveCameras.
                 check(!request.isPrewarm)
-                realCamera.connectTo(request.virtualCamera)
-                connectPendingRequestOpens(request.sharedCameraIds)
+                realCamera.connectTo(request.virtualCamera, realCameraToken)
+                connectPendingRequestOpens(request.sharedCameraIds.toSet())
             } else {
                 // Else, save the request in the pending request queue, and connect the request
                 // once other cameras are opened.
-                pendingRequestOpens.add(request)
-                pendingRequestOpenActiveCameraMap[request] = realCamera
+                pendingRequestOpens.add(PendingRequestOpen(request, realCamera, realCameraToken))
             }
         } else {
             if (!request.isPrewarm) {
-                realCamera.connectTo(request.virtualCamera)
+                realCamera.connectTo(request.virtualCamera, realCameraToken)
             }
         }
     }
@@ -430,16 +430,13 @@
         if (activeCameras.contains(request.activeCamera)) {
             activeCameras.remove(request.activeCamera)
         }
-        for (requestOpen in pendingRequestOpens) {
-            // Edge case: There is a possibility that we receive RequestClose after a RequestOpen
-            // for concurrent cameras has been processed. As such, we don't want to close the
-            // ActiveCamera newly created by the RequestOpen, but only the one RequestClose is
-            // aiming to close.
-            if (pendingRequestOpenActiveCameraMap[requestOpen] == request.activeCamera) {
-                pendingRequestOpens.remove(requestOpen)
-                pendingRequestOpenActiveCameraMap.remove(requestOpen)
-            }
-        }
+
+        // Edge case: There is a possibility that we receive RequestClose after a RequestOpen for
+        // concurrent cameras has been processed. As such, we don't want to close the ActiveCamera
+        // newly created by the RequestOpen, but only the one RequestClose is aiming to close.
+        disconnectPendingRequestOpens(
+            pendingRequestOpens.filter { it.activeCamera == request.activeCamera }
+        )
         request.activeCamera.close()
         request.activeCamera.awaitClosed()
     }
@@ -448,12 +445,9 @@
         val cameraId = request.activeCameraId
         Log.info { "PruningCamera2DeviceManager#processRequestCloseById(${request.activeCameraId}" }
 
-        for (requestOpen in pendingRequestOpens) {
-            if (requestOpen.virtualCamera.cameraId == cameraId) {
-                pendingRequestOpens.remove(requestOpen)
-                pendingRequestOpenActiveCameraMap.remove(requestOpen)
-            }
-        }
+        disconnectPendingRequestOpens(
+            pendingRequestOpens.filter { it.request.virtualCamera.cameraId == cameraId }
+        )
         val activeCamera = activeCameras.firstOrNull { it.cameraId == cameraId }
         if (activeCamera != null) {
             activeCameras.remove(activeCamera)
@@ -466,8 +460,7 @@
     private suspend fun processRequestCloseAll(requestCloseAll: RequestCloseAll) {
         Log.info { "PruningCamera2DeviceManager#processRequestCloseAll()" }
 
-        pendingRequestOpens.clear()
-        pendingRequestOpenActiveCameraMap.clear()
+        disconnectPendingRequestOpens(pendingRequestOpens)
         for (activeCamera in activeCameras) {
             activeCamera.close()
         }
@@ -478,6 +471,59 @@
         requestCloseAll.deferred.complete(Unit)
     }
 
+    private suspend fun retrieveActiveCamera(
+        cameraId: CameraId,
+        requestOpen: RequestOpen,
+    ): RetrieveActiveCameraResult? {
+        var realCamera: ActiveCamera? = null
+        var realCameraToken: Token? = null
+        for (activeCamera in activeCameras) {
+            if (activeCamera.cameraId == cameraId) {
+                // Important: When we retrieve an active camera, there is a chance it has already
+                // reached its idle timeout, but we haven't processed the close request and remove
+                // it from the list. It's also possible that after we fetch this camera, this camera
+                // then gets closed in parallel by the idle timeout. Therefore, here we should
+                // acquire a token from this active camera to mark it as used and keep it opened.
+                val token = activeCamera.acquire()
+                if (token != null) {
+                    realCamera = activeCamera
+                    realCameraToken = token
+                    break
+                } else {
+                    // This ActiveCamera is already disconnected (i.e., WakeLock closed). Make sure
+                    // the camera is closed before reopening.
+                    activeCamera.close()
+                    activeCamera.awaitClosed()
+                    activeCameras.remove(activeCamera)
+                }
+            }
+        }
+        if (realCamera == null) {
+            val openResult =
+                openCameraWithRetry(
+                    cameraId,
+                    requestOpen.sharedCameraIds,
+                    requestOpen.isForegroundObserver,
+                    scope,
+                )
+            when (openResult) {
+                is OpenVirtualCameraResult.Success -> {
+                    Log.info { "PruningCameraDeviceManager: $cameraId opened successfully" }
+                    realCamera = openResult.activeCamera
+                    // Acquire a token to mark this active camera as used.
+                    realCameraToken = checkNotNull(realCamera.acquire())
+                    activeCameras.add(realCamera)
+                }
+                is OpenVirtualCameraResult.Error -> {
+                    Log.info { "PruningCameraDeviceManager: Failed to open $cameraId" }
+                    requestOpen.virtualCamera.disconnect(openResult.lastCameraError)
+                    return null
+                }
+            }
+        }
+        return RetrieveActiveCameraResult(realCamera, checkNotNull(realCameraToken))
+    }
+
     private suspend fun openCameraWithRetry(
         cameraId: CameraId,
         sharedCameraIds: List<CameraId>,
@@ -509,23 +555,32 @@
         )
     }
 
-    private suspend fun connectPendingRequestOpens(cameraIds: List<CameraId>) {
-        val requestOpensToRemove = mutableListOf<RequestOpen>()
-        val requestOpens =
-            pendingRequestOpens.filter { cameraIds.contains(it.virtualCamera.cameraId) }
-        for (request in requestOpens) {
-            // If the request is shared with this pending request, then we should be
-            // able to connect this pending request too, since we don't allow
-            // overlapping.
+    private suspend fun connectPendingRequestOpens(cameraIds: Set<CameraId>) {
+        val filteredPendingRequestOpens =
+            pendingRequestOpens.filter { cameraIds.contains(it.request.virtualCamera.cameraId) }
+        for (pendingRequestOpen in filteredPendingRequestOpens) {
+            val request = pendingRequestOpen.request
+
+            // If the request is shared with this pending request, then we should be able to connect
+            // this pending request too, since we don't allow overlapping.
             val allCameraIds = listOf(request.virtualCamera.cameraId) + request.sharedCameraIds
             check(allCameraIds.all { cameraId -> activeCameras.any { it.cameraId == cameraId } })
 
-            val realCamera = activeCameras.find { it.cameraId == request.virtualCamera.cameraId }
-            checkNotNull(realCamera)
-            realCamera.connectTo(request.virtualCamera)
-            requestOpensToRemove.add(request)
+            pendingRequestOpen.activeCamera.connectTo(
+                request.virtualCamera,
+                pendingRequestOpen.token
+            )
+            pendingRequestOpens.remove(pendingRequestOpen)
         }
-        pendingRequestOpens.removeAll(requestOpensToRemove)
+    }
+
+    private suspend fun disconnectPendingRequestOpens(
+        pendingRequestOpensToDisconnect: List<PendingRequestOpen>,
+    ) {
+        for (pendingRequestOpen in pendingRequestOpensToDisconnect) {
+            pendingRequestOpen.token.release()
+            pendingRequestOpens.remove(pendingRequestOpen)
+        }
     }
 
     private inline fun <T> List<T>.firstFromIndexOrNull(
@@ -548,6 +603,8 @@
         return removedElements
     }
 
+    private class RetrieveActiveCameraResult(val activeCamera: ActiveCamera, val token: Token)
+
     private sealed interface OpenVirtualCameraResult {
         data class Success(val activeCamera: ActiveCamera) : OpenVirtualCameraResult
 
@@ -788,7 +845,7 @@
                     // If the camera of the request and the cameras it is shared with have been
                     // opened, we can connect the ActiveCameras.
                     check(!request.isPrewarm)
-                    realCamera.connectTo(request.virtualCamera)
+                    realCamera.connectTo(request.virtualCamera, realCamera.acquire())
                     connectPendingRequestOpens(request.sharedCameraIds)
                 } else {
                     // Else, save the request in the pending request queue, and connect the request
@@ -797,7 +854,7 @@
                 }
             } else {
                 if (!request.isPrewarm) {
-                    realCamera.connectTo(request.virtualCamera)
+                    realCamera.connectTo(request.virtualCamera, realCamera.acquire())
                 }
             }
             requests.remove(request)
@@ -850,7 +907,7 @@
 
             val realCamera = activeCameras.find { it.cameraId == request.virtualCamera.cameraId }
             checkNotNull(realCamera)
-            realCamera.connectTo(request.virtualCamera)
+            realCamera.connectTo(request.virtualCamera, realCamera.acquire())
             requestOpensToRemove.add(request)
         }
         pendingRequestOpens.removeAll(requestOpensToRemove)
diff --git a/camera/camera-camera2-pipe/src/main/java/androidx/camera/camera2/pipe/compat/Camera2Quirks.kt b/camera/camera-camera2-pipe/src/main/java/androidx/camera/camera2/pipe/compat/Camera2Quirks.kt
index 3732cf5..96c7d56 100644
--- a/camera/camera-camera2-pipe/src/main/java/androidx/camera/camera2/pipe/compat/Camera2Quirks.kt
+++ b/camera/camera-camera2-pipe/src/main/java/androidx/camera/camera2/pipe/compat/Camera2Quirks.kt
@@ -83,7 +83,7 @@
 
     /**
      * A quirk that closes the camera devices before creating a new capture session. This is needed
-     * on legacy devices where creating a capture session directly may lead to deadlocks, NPEs or
+     * on certain devices where creating a capture session directly may lead to deadlocks, NPEs or
      * other undesirable behaviors. When [shouldCreateEmptyCaptureSessionBeforeClosing] is also
      * required, a regular camera device closure would then be expanded to:
      * 1. Close the camera device.
@@ -91,13 +91,20 @@
      * 3. Create an empty capture session.
      * 4. Close the capture session.
      * 5. Close the camera device.
-     * - Bug(s): b/237341513, b/359062845, b/342263275, b/379347826
+     * - Bug(s): b/237341513, b/359062845, b/342263275, b/379347826, b/359062845
      * - Device(s): Camera devices on hardware level LEGACY
      * - API levels: 23 (M) – 31 (S_V2)
      */
-    internal fun shouldCloseCameraBeforeCreatingCaptureSession(cameraId: CameraId): Boolean =
-        Build.VERSION.SDK_INT in (Build.VERSION_CODES.M..Build.VERSION_CODES.S_V2) &&
-            metadataProvider.awaitCameraMetadata(cameraId).isHardwareLevelLegacy
+    internal fun shouldCloseCameraBeforeCreatingCaptureSession(cameraId: CameraId): Boolean {
+        val isLegacyDevice =
+            Build.VERSION.SDK_INT in (Build.VERSION_CODES.M..Build.VERSION_CODES.S_V2) &&
+                metadataProvider.awaitCameraMetadata(cameraId).isHardwareLevelLegacy
+        val isQuirkyDevice =
+            "motorola".equals(Build.BRAND, ignoreCase = true) &&
+                "moto e20".equals(Build.MODEL, ignoreCase = true) &&
+                cameraId.value == "1"
+        return isLegacyDevice || isQuirkyDevice
+    }
 
     companion object {
         private val SHOULD_WAIT_FOR_REPEATING_DEVICE_MAP =
diff --git a/camera/camera-camera2-pipe/src/test/java/androidx/camera/camera2/pipe/compat/Camera2DeviceManagerTest.kt b/camera/camera-camera2-pipe/src/test/java/androidx/camera/camera2/pipe/compat/Camera2DeviceManagerTest.kt
index cb7ac0b..d8b0924 100644
--- a/camera/camera-camera2-pipe/src/test/java/androidx/camera/camera2/pipe/compat/Camera2DeviceManagerTest.kt
+++ b/camera/camera-camera2-pipe/src/test/java/androidx/camera/camera2/pipe/compat/Camera2DeviceManagerTest.kt
@@ -315,7 +315,7 @@
             val virtualCamera1 =
                 deviceManager.open(cameraId0, listOf(cameraId1), fakeGraphListener1, false) { true }
             assertNotNull(virtualCamera1)
-            // Advance time by just a bit to allow coroutines to finish but not closing the camera.
+            // Advance time by just a bit to allow coroutines to finish.
             advanceTimeBy(100)
 
             assertEquals(fakeRetryingCameraStateOpener.androidCameraStates.size, 1)
@@ -344,6 +344,42 @@
         }
 
     @Test
+    fun pendingCamerasShouldBeHeldWhenOpeningConcurrentCameras() =
+        testScope.runTest {
+            val virtualCamera1 =
+                deviceManager.open(cameraId0, listOf(cameraId1), fakeGraphListener1, false) { true }
+            assertNotNull(virtualCamera1)
+            // Advance until idle. This is the only but notable difference between this and the
+            // prior test. Note that here because the request is still pending, the active camera
+            // should not be closed.
+            advanceUntilIdle()
+
+            assertEquals(fakeRetryingCameraStateOpener.androidCameraStates.size, 1)
+            val androidCameraState1 = fakeRetryingCameraStateOpener.androidCameraStates.first()
+            androidCameraState1.onOpened(fakeCameraDevice0)
+            advanceUntilIdle()
+
+            // Since camera 1 is not yet opened, the virtual camera should not be connected yet.
+            var virtualCameraState1 = virtualCamera1.value
+            assertIsNot<CameraStateOpen>(virtualCameraState1)
+
+            val virtualCamera2 =
+                deviceManager.open(cameraId1, listOf(cameraId0), fakeGraphListener2, false) { true }
+            assertNotNull(virtualCamera2)
+            advanceUntilIdle()
+
+            assertEquals(fakeRetryingCameraStateOpener.androidCameraStates.size, 2)
+            val androidCameraState2 = fakeRetryingCameraStateOpener.androidCameraStates.last()
+            androidCameraState2.onOpened(fakeCameraDevice1)
+            advanceUntilIdle()
+
+            virtualCameraState1 = virtualCamera1.value
+            assertIs<CameraStateOpen>(virtualCameraState1)
+            val virtualCameraState2 = virtualCamera2.value
+            assertIs<CameraStateOpen>(virtualCameraState2)
+        }
+
+    @Test
     fun singleCameraShouldBeClosedWhenConcurrentCamerasAreRequested() =
         testScope.runTest {
             // First open camera 0 in regular (single) camera mode.
@@ -395,7 +431,7 @@
             val virtualCamera1 =
                 deviceManager.open(cameraId0, listOf(cameraId1), fakeGraphListener1, false) { true }
             assertNotNull(virtualCamera1)
-            // Advance time by just a bit to allow coroutines to finish but not closing the camera.
+            // Advance time by just a bit to allow coroutines to finish.
             advanceTimeBy(100)
 
             assertEquals(fakeRetryingCameraStateOpener.androidCameraStates.size, 1)
diff --git a/camera/camera-camera2/src/androidTest/java/androidx/camera/camera2/internal/TorchControlDeviceTest.java b/camera/camera-camera2/src/androidTest/java/androidx/camera/camera2/internal/TorchControlDeviceTest.java
index de994f6..8bcdb8c 100644
--- a/camera/camera-camera2/src/androidTest/java/androidx/camera/camera2/internal/TorchControlDeviceTest.java
+++ b/camera/camera-camera2/src/androidTest/java/androidx/camera/camera2/internal/TorchControlDeviceTest.java
@@ -23,6 +23,7 @@
 
 import androidx.camera.camera2.Camera2Config;
 import androidx.camera.camera2.internal.util.TestUtil;
+import androidx.camera.core.CameraInfo;
 import androidx.camera.core.CameraSelector;
 import androidx.camera.core.CameraXConfig;
 import androidx.camera.core.ImageAnalysis;
@@ -88,7 +89,8 @@
         mCamera = CameraUtil.createCameraAndAttachUseCase(context, cameraSelector, imageAnalysis);
         mCameraControl = TestUtil.getCamera2CameraControlImpl(mCamera.getCameraControl());
         mTorchControl = mCameraControl.getTorchControl();
-        mIsTorchStrengthSupported = mCamera.getCameraInfo().getMaxTorchStrengthLevel() > 1;
+        mIsTorchStrengthSupported = mCamera.getCameraInfo().getMaxTorchStrengthLevel()
+                != CameraInfo.TORCH_STRENGTH_LEVEL_UNSUPPORTED;
     }
 
     @After
@@ -118,7 +120,7 @@
 
     @Test(timeout = 5000L)
     @SdkSuppress(minSdkVersion = Build.VERSION_CODES.VANILLA_ICE_CREAM)
-    public void setTorchStrengthLevel_futureCompleteWhenTorchIsOnLevel()
+    public void setTorchStrengthLevel_futureCompleteWhenTorchIsOn()
             throws ExecutionException, InterruptedException {
         assumeTrue(mIsTorchStrengthSupported);
 
@@ -132,7 +134,7 @@
 
     @Test(timeout = 5000L)
     @SdkSuppress(minSdkVersion = Build.VERSION_CODES.VANILLA_ICE_CREAM)
-    public void setTorchStrengthLevel_futureCompleteWhenTorchIsOffLevel()
+    public void setTorchStrengthLevel_futureCompleteWhenTorchIsOff()
             throws ExecutionException, InterruptedException {
         assumeTrue(mIsTorchStrengthSupported);
 
diff --git a/camera/camera-camera2/src/main/java/androidx/camera/camera2/internal/Camera2CameraControlImpl.java b/camera/camera-camera2/src/main/java/androidx/camera/camera2/internal/Camera2CameraControlImpl.java
index 8a2a439..d6321f2 100644
--- a/camera/camera-camera2/src/main/java/androidx/camera/camera2/internal/Camera2CameraControlImpl.java
+++ b/camera/camera-camera2/src/main/java/androidx/camera/camera2/internal/Camera2CameraControlImpl.java
@@ -516,6 +516,10 @@
             return Futures.immediateFailedFuture(
                     new OperationCanceledException("Camera is not active."));
         }
+        if (!mCameraCharacteristics.isTorchStrengthLevelSupported()) {
+            return Futures.immediateFailedFuture(new UnsupportedOperationException(
+                    "The device doesn't support configuring torch strength level."));
+        }
         if (torchStrengthLevel < 1
                 || torchStrengthLevel > mCameraCharacteristics.getMaxTorchStrengthLevel()) {
             return Futures.immediateFailedFuture(new IllegalArgumentException(
diff --git a/camera/camera-camera2/src/main/java/androidx/camera/camera2/internal/Camera2CameraInfoImpl.java b/camera/camera-camera2/src/main/java/androidx/camera/camera2/internal/Camera2CameraInfoImpl.java
index aeb7058..4804b521 100644
--- a/camera/camera-camera2/src/main/java/androidx/camera/camera2/internal/Camera2CameraInfoImpl.java
+++ b/camera/camera-camera2/src/main/java/androidx/camera/camera2/internal/Camera2CameraInfoImpl.java
@@ -719,9 +719,11 @@
     }
 
     @Override
-    @IntRange(from = 1)
+    @IntRange(from = 0)
     public int getMaxTorchStrengthLevel() {
-        return mCameraCharacteristicsCompat.getMaxTorchStrengthLevel();
+        return mCameraCharacteristicsCompat.isTorchStrengthLevelSupported()
+                ? mCameraCharacteristicsCompat.getMaxTorchStrengthLevel()
+                : TORCH_STRENGTH_LEVEL_UNSUPPORTED;
     }
 
     @Override
@@ -730,7 +732,9 @@
             if (mCamera2CameraControlImpl == null) {
                 if (mRedirectTorchStrengthLiveData == null) {
                     mRedirectTorchStrengthLiveData = new RedirectableLiveData<>(
-                            mCameraCharacteristicsCompat.getDefaultTorchStrengthLevel());
+                            mCameraCharacteristicsCompat.isTorchStrengthLevelSupported()
+                                    ? mCameraCharacteristicsCompat.getDefaultTorchStrengthLevel()
+                                    : TORCH_STRENGTH_LEVEL_UNSUPPORTED);
                 }
                 return mRedirectTorchStrengthLiveData;
             }
diff --git a/camera/camera-camera2/src/main/java/androidx/camera/camera2/internal/CaptureSession.java b/camera/camera-camera2/src/main/java/androidx/camera/camera2/internal/CaptureSession.java
index 95d9e1c..49ef6d6 100644
--- a/camera/camera-camera2/src/main/java/androidx/camera/camera2/internal/CaptureSession.java
+++ b/camera/camera-camera2/src/main/java/androidx/camera/camera2/internal/CaptureSession.java
@@ -16,7 +16,6 @@
 
 package androidx.camera.camera2.internal;
 
-import android.annotation.SuppressLint;
 import android.graphics.ImageFormat;
 import android.hardware.camera2.CameraAccessException;
 import android.hardware.camera2.CameraCaptureSession;
@@ -68,8 +67,6 @@
 import org.jspecify.annotations.NonNull;
 import org.jspecify.annotations.Nullable;
 
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
@@ -1067,7 +1064,8 @@
                 continue;
             }
             List<OutputConfiguration> outputConfigurations =
-                    createInstancesForMultiResolutionOutput(streamInfos, imageFormat);
+                    OutputConfiguration.createInstancesForMultiResolutionOutput(streamInfos,
+                            imageFormat);
             if (outputConfigurations != null) {
                 for (SessionConfig.OutputConfig outputConfig : groupIdToOutputConfigsMap.get(
                         groupId)) {
@@ -1082,31 +1080,6 @@
         return outputConfigToOutputConfigurationCompatMap;
     }
 
-    /**
-     * Use java reflection to access the API so that we don't need to upgrade compileSdk as 35 in
-     * the release branch. When this method is invoked, the API has become public on the device. It
-     * won't cause the problem about accessing the non-SDK API.
-     */
-    /** @noinspection unchecked */
-    @SuppressLint("BanUncheckedReflection")
-    @SuppressWarnings("unchecked")
-    @RequiresApi(35)
-    private static @Nullable List<OutputConfiguration> createInstancesForMultiResolutionOutput(
-            @NonNull List<MultiResolutionStreamInfo> streamInfos, int format) {
-        // TODO(b/376185185): Invoke the API directly after the androidx code base upgrades to
-        //  compile by API 35 SDK.
-        try {
-            Method createInstanceMethod = OutputConfiguration.class.getMethod(
-                    "createInstancesForMultiResolutionOutput", Collection.class, int.class);
-            return (List<OutputConfiguration>) createInstanceMethod.invoke(null, streamInfos,
-                    format);
-        } catch (NoSuchMethodException | InvocationTargetException | IllegalAccessException e) {
-            Logger.e(TAG,
-                    "Failed to create instances for multi-resolution output, " + e.getMessage());
-            return null;
-        }
-    }
-
     // Debugging note: these states are kept in ordinal order. Any additions or changes should try
     // to maintain the same order such that the highest ordinal is the state of largest resource
     // utilization.
diff --git a/camera/camera-camera2/src/main/java/androidx/camera/camera2/internal/TorchControl.java b/camera/camera-camera2/src/main/java/androidx/camera/camera2/internal/TorchControl.java
index 7ea9db9..1bb729d 100644
--- a/camera/camera-camera2/src/main/java/androidx/camera/camera2/internal/TorchControl.java
+++ b/camera/camera-camera2/src/main/java/androidx/camera/camera2/internal/TorchControl.java
@@ -103,10 +103,10 @@
         mExecutor = executor;
 
         mHasFlashUnit = FlashAvailabilityChecker.isFlashAvailable(cameraCharacteristics::get);
-        mIsTorchStrengthSupported =
-                mHasFlashUnit && Build.VERSION.SDK_INT >= Build.VERSION_CODES.VANILLA_ICE_CREAM
-                        && cameraCharacteristics.getMaxTorchStrengthLevel() > 1;
-        mDefaultTorchStrength = cameraCharacteristics.getDefaultTorchStrengthLevel();
+        mIsTorchStrengthSupported = cameraCharacteristics.isTorchStrengthLevelSupported();
+        mDefaultTorchStrength = mHasFlashUnit && mIsTorchStrengthSupported
+                ? cameraCharacteristics.getDefaultTorchStrengthLevel()
+                : Camera2CameraInfoImpl.TORCH_STRENGTH_LEVEL_UNSUPPORTED;
         mTargetTorchStrength = mDefaultTorchStrength;
         mTorchState = new MutableLiveData<>(DEFAULT_TORCH_STATE);
         mTorchStrength = new MutableLiveData<>(mDefaultTorchStrength);
diff --git a/camera/camera-camera2/src/main/java/androidx/camera/camera2/internal/compat/CameraCharacteristicsCompat.java b/camera/camera-camera2/src/main/java/androidx/camera/camera2/internal/compat/CameraCharacteristicsCompat.java
index 1f2cc60..766cfec 100644
--- a/camera/camera-camera2/src/main/java/androidx/camera/camera2/internal/compat/CameraCharacteristicsCompat.java
+++ b/camera/camera-camera2/src/main/java/androidx/camera/camera2/internal/compat/CameraCharacteristicsCompat.java
@@ -22,6 +22,7 @@
 import android.os.Build;
 
 import androidx.annotation.GuardedBy;
+import androidx.annotation.IntRange;
 import androidx.annotation.VisibleForTesting;
 import androidx.camera.camera2.internal.compat.workaround.OutputSizesCorrector;
 
@@ -135,23 +136,40 @@
      */
     public int getDefaultTorchStrengthLevel() {
         Integer defaultLevel = null;
-        if (Build.VERSION.SDK_INT >= 35) {
+        if (hasFlashUnit() && Build.VERSION.SDK_INT >= 35) {
             defaultLevel = get(CameraCharacteristics.FLASH_TORCH_STRENGTH_DEFAULT_LEVEL);
         }
+        // The framework returns 1 when the device doesn't support configuring torch strength. So
+        // also return 1 if the device doesn't have flash unit or is unable to provide the
+        // information.
         return defaultLevel == null ? 1 : defaultLevel;
     }
 
     /**
      * Returns the maximum torch strength level.
      */
+    @IntRange(from = 1)
     public int getMaxTorchStrengthLevel() {
         Integer maxLevel = null;
-        if (Build.VERSION.SDK_INT >= 35) {
+        if (hasFlashUnit() && Build.VERSION.SDK_INT >= 35) {
             maxLevel = get(CameraCharacteristics.FLASH_TORCH_STRENGTH_MAX_LEVEL);
         }
+        // The framework returns 1 when the device doesn't support configuring torch strength. So
+        // also return 1 if the device doesn't have flash unit or is unable to provide the
+        // information.
         return maxLevel == null ? 1 : maxLevel;
     }
 
+    public boolean isTorchStrengthLevelSupported() {
+        return hasFlashUnit() && Build.VERSION.SDK_INT >= Build.VERSION_CODES.VANILLA_ICE_CREAM
+                && getMaxTorchStrengthLevel() > 1;
+    }
+
+    private boolean hasFlashUnit() {
+        Boolean flashInfoAvailable = get(CameraCharacteristics.FLASH_INFO_AVAILABLE);
+        return flashInfoAvailable != null && flashInfoAvailable;
+    }
+
     /**
      * Obtains the {@link StreamConfigurationMapCompat} which contains the output sizes related
      * workarounds in it.
diff --git a/camera/camera-camera2/src/test/java/androidx/camera/camera2/internal/Camera2CameraInfoImplTest.java b/camera/camera-camera2/src/test/java/androidx/camera/camera2/internal/Camera2CameraInfoImplTest.java
index e7fcc70..1d87d00 100644
--- a/camera/camera-camera2/src/test/java/androidx/camera/camera2/internal/Camera2CameraInfoImplTest.java
+++ b/camera/camera-camera2/src/test/java/androidx/camera/camera2/internal/Camera2CameraInfoImplTest.java
@@ -916,6 +916,30 @@
         assertThat(cameraInfo.getMaxTorchStrengthLevel()).isEqualTo(CAMERA0_MAX_TORCH_STRENGTH);
     }
 
+    @Config(minSdk = Build.VERSION_CODES.VANILLA_ICE_CREAM)
+    @Test
+    public void apiVersionMet_canReturnMaxTorchStrengthUnsupported()
+            throws CameraAccessExceptionCompat {
+        init(/* hasAvailableCapabilities = */ true);
+
+        final CameraInfo cameraInfo = new Camera2CameraInfoImpl(CAMERA1_ID, mCameraManagerCompat);
+
+        assertThat(cameraInfo.getMaxTorchStrengthLevel()).isEqualTo(
+                CameraInfo.TORCH_STRENGTH_LEVEL_UNSUPPORTED);
+    }
+
+    @Config(minSdk = Build.VERSION_CODES.VANILLA_ICE_CREAM)
+    @Test
+    public void apiVersionMet_canReturnTorchStrengthUnsupported()
+            throws CameraAccessExceptionCompat {
+        init(/* hasAvailableCapabilities = */ true);
+
+        final CameraInfo cameraInfo = new Camera2CameraInfoImpl(CAMERA1_ID, mCameraManagerCompat);
+
+        assertThat(cameraInfo.getTorchStrengthLevel().getValue()).isEqualTo(
+                CameraInfo.TORCH_STRENGTH_LEVEL_UNSUPPORTED);
+    }
+
     @Config(minSdk = 33)
     @Test
     public void apiVersionMet_canReturnSupportedDynamicRanges_fromFullySpecified()
@@ -944,13 +968,14 @@
 
     @Config(maxSdk = Build.VERSION_CODES.VANILLA_ICE_CREAM - 1)
     @Test
-    public void apiVersionNotMet_returnMaxTorchStrengthOne()
+    public void apiVersionNotMet_returnMaxTorchStrengthUnsupported()
             throws CameraAccessExceptionCompat {
         init(/* hasAvailableCapabilities = */ true);
 
         final CameraInfo cameraInfo = new Camera2CameraInfoImpl(CAMERA0_ID, mCameraManagerCompat);
 
-        assertThat(cameraInfo.getMaxTorchStrengthLevel()).isEqualTo(1);
+        assertThat(cameraInfo.getMaxTorchStrengthLevel()).isEqualTo(
+                CameraInfo.TORCH_STRENGTH_LEVEL_UNSUPPORTED);
     }
 
     @Config(maxSdk = 32)
diff --git a/camera/camera-camera2/src/test/java/androidx/camera/camera2/internal/TorchControlTest.java b/camera/camera-camera2/src/test/java/androidx/camera/camera2/internal/TorchControlTest.java
index d725f7f..9f45cd9 100644
--- a/camera/camera-camera2/src/test/java/androidx/camera/camera2/internal/TorchControlTest.java
+++ b/camera/camera-camera2/src/test/java/androidx/camera/camera2/internal/TorchControlTest.java
@@ -155,6 +155,17 @@
     }
 
     @Test
+    public void setTorchStrengthLevel_throwExceptionWhenNoFlashUnit() throws InterruptedException {
+        Throwable cause = null;
+        try {
+            mNoFlashUnitTorchControl.setTorchStrengthLevel(1).get();
+        } catch (ExecutionException e) {
+            cause = e.getCause();
+        }
+        assertThat(cause).isInstanceOf(UnsupportedOperationException.class);
+    }
+
+    @Test
     public void enableTorch_whenInactive() throws InterruptedException {
         mTorchControl.setActive(false);
         ListenableFuture<Void> listenableFuture = mTorchControl.enableTorch(true);
diff --git a/camera/camera-core/api/current.txt b/camera/camera-core/api/current.txt
index 7837ece..893b313 100644
--- a/camera/camera-core/api/current.txt
+++ b/camera/camera-core/api/current.txt
@@ -18,6 +18,7 @@
     method public com.google.common.util.concurrent.ListenableFuture<java.lang.Void!> enableTorch(boolean);
     method public com.google.common.util.concurrent.ListenableFuture<java.lang.Integer!> setExposureCompensationIndex(int);
     method public com.google.common.util.concurrent.ListenableFuture<java.lang.Void!> setLinearZoom(@FloatRange(from=0.0f, to=1.0f) float);
+    method public default com.google.common.util.concurrent.ListenableFuture<java.lang.Void!> setTorchStrengthLevelAsync(@IntRange(from=1) int);
     method public com.google.common.util.concurrent.ListenableFuture<java.lang.Void!> setZoomRatio(float);
     method public com.google.common.util.concurrent.ListenableFuture<androidx.camera.core.FocusMeteringResult!> startFocusAndMetering(androidx.camera.core.FocusMeteringAction);
   }
@@ -48,11 +49,13 @@
     method @FloatRange(from=0, fromInclusive=false) public default float getIntrinsicZoomRatio();
     method public default int getLensFacing();
     method public default androidx.lifecycle.LiveData<java.lang.Integer!> getLowLightBoostState();
+    method @IntRange(from=0) public default int getMaxTorchStrengthLevel();
     method public default java.util.Set<androidx.camera.core.CameraInfo!> getPhysicalCameraInfos();
     method public int getSensorRotationDegrees();
     method public int getSensorRotationDegrees(int);
     method public default java.util.Set<android.util.Range<java.lang.Integer!>!> getSupportedFrameRateRanges();
     method public androidx.lifecycle.LiveData<java.lang.Integer!> getTorchState();
+    method public default androidx.lifecycle.LiveData<java.lang.Integer!> getTorchStrengthLevel();
     method public androidx.lifecycle.LiveData<androidx.camera.core.ZoomState!> getZoomState();
     method public boolean hasFlashUnit();
     method public default boolean isFocusMeteringSupported(androidx.camera.core.FocusMeteringAction);
@@ -61,6 +64,7 @@
     method @SuppressCompatibility @androidx.camera.core.ExperimentalZeroShutterLag public default boolean isZslSupported();
     method public static boolean mustPlayShutterSound();
     method public default java.util.Set<androidx.camera.core.DynamicRange!> querySupportedDynamicRanges(java.util.Set<androidx.camera.core.DynamicRange!>);
+    field public static final int TORCH_STRENGTH_LEVEL_UNSUPPORTED = 0; // 0x0
   }
 
   public final class CameraInfoUnavailableException extends java.lang.Exception {
diff --git a/camera/camera-core/api/restricted_current.txt b/camera/camera-core/api/restricted_current.txt
index 7837ece..893b313 100644
--- a/camera/camera-core/api/restricted_current.txt
+++ b/camera/camera-core/api/restricted_current.txt
@@ -18,6 +18,7 @@
     method public com.google.common.util.concurrent.ListenableFuture<java.lang.Void!> enableTorch(boolean);
     method public com.google.common.util.concurrent.ListenableFuture<java.lang.Integer!> setExposureCompensationIndex(int);
     method public com.google.common.util.concurrent.ListenableFuture<java.lang.Void!> setLinearZoom(@FloatRange(from=0.0f, to=1.0f) float);
+    method public default com.google.common.util.concurrent.ListenableFuture<java.lang.Void!> setTorchStrengthLevelAsync(@IntRange(from=1) int);
     method public com.google.common.util.concurrent.ListenableFuture<java.lang.Void!> setZoomRatio(float);
     method public com.google.common.util.concurrent.ListenableFuture<androidx.camera.core.FocusMeteringResult!> startFocusAndMetering(androidx.camera.core.FocusMeteringAction);
   }
@@ -48,11 +49,13 @@
     method @FloatRange(from=0, fromInclusive=false) public default float getIntrinsicZoomRatio();
     method public default int getLensFacing();
     method public default androidx.lifecycle.LiveData<java.lang.Integer!> getLowLightBoostState();
+    method @IntRange(from=0) public default int getMaxTorchStrengthLevel();
     method public default java.util.Set<androidx.camera.core.CameraInfo!> getPhysicalCameraInfos();
     method public int getSensorRotationDegrees();
     method public int getSensorRotationDegrees(int);
     method public default java.util.Set<android.util.Range<java.lang.Integer!>!> getSupportedFrameRateRanges();
     method public androidx.lifecycle.LiveData<java.lang.Integer!> getTorchState();
+    method public default androidx.lifecycle.LiveData<java.lang.Integer!> getTorchStrengthLevel();
     method public androidx.lifecycle.LiveData<androidx.camera.core.ZoomState!> getZoomState();
     method public boolean hasFlashUnit();
     method public default boolean isFocusMeteringSupported(androidx.camera.core.FocusMeteringAction);
@@ -61,6 +64,7 @@
     method @SuppressCompatibility @androidx.camera.core.ExperimentalZeroShutterLag public default boolean isZslSupported();
     method public static boolean mustPlayShutterSound();
     method public default java.util.Set<androidx.camera.core.DynamicRange!> querySupportedDynamicRanges(java.util.Set<androidx.camera.core.DynamicRange!>);
+    field public static final int TORCH_STRENGTH_LEVEL_UNSUPPORTED = 0; // 0x0
   }
 
   public final class CameraInfoUnavailableException extends java.lang.Exception {
diff --git a/camera/camera-core/src/main/java/androidx/camera/core/CameraControl.java b/camera/camera-core/src/main/java/androidx/camera/core/CameraControl.java
index 09718fb..2332ad6 100644
--- a/camera/camera-core/src/main/java/androidx/camera/core/CameraControl.java
+++ b/camera/camera-core/src/main/java/androidx/camera/core/CameraControl.java
@@ -245,11 +245,14 @@
      * {@link ListenableFuture} will fail with an {@link IllegalArgumentException} and it won't
      * modify the torch strength.
      *
+     * <p>If the device doesn't have a flash unit or doesn't support configuring torch strength
+     * level, the returned {@link ListenableFuture} will fail with an
+     * {@link UnsupportedOperationException}.
+     *
      * @param torchStrengthLevel The desired torch strength level.
      * @return a {@link ListenableFuture} that is completed when the torch strength has been
      * applied.
      */
-    @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
     default @NonNull ListenableFuture<Void> setTorchStrengthLevelAsync(
             @IntRange(from = 1) int torchStrengthLevel) {
         return Futures.immediateFailedFuture(new UnsupportedOperationException(
diff --git a/camera/camera-core/src/main/java/androidx/camera/core/CameraInfo.java b/camera/camera-core/src/main/java/androidx/camera/core/CameraInfo.java
index 91b2f00..cd2f8a2 100644
--- a/camera/camera-core/src/main/java/androidx/camera/core/CameraInfo.java
+++ b/camera/camera-core/src/main/java/androidx/camera/core/CameraInfo.java
@@ -50,6 +50,12 @@
 public interface CameraInfo {
 
     /**
+     * The torch strength level when the device doesn't have a flash unit or doesn't support
+     * adjusting torch strength.
+     */
+    int TORCH_STRENGTH_LEVEL_UNSUPPORTED = 0;
+
+    /**
      * An unknown intrinsic zoom ratio. Usually to indicate the camera is unable to provide
      * necessary information to resolve its intrinsic zoom ratio.
      *
@@ -429,13 +435,12 @@
     /**
      * Returns the maximum torch strength level.
      *
-     * @return The maximum strength level. If the device doesn't support configuring torch
-     * strength, returns {@code 1}.
+     * @return The maximum strength level, or {@link #TORCH_STRENGTH_LEVEL_UNSUPPORTED} if the
+     * device doesn't have a flash unit or doesn't support configuring torch strength.
      */
-    @RestrictTo(Scope.LIBRARY_GROUP)
-    @IntRange(from = 1)
+    @IntRange(from = 0)
     default int getMaxTorchStrengthLevel() {
-        return 1;
+        return TORCH_STRENGTH_LEVEL_UNSUPPORTED;
     }
 
     /**
@@ -443,10 +448,12 @@
      *
      * <p>The value of the {@link LiveData} will be the default torch strength level of this
      * device if {@link CameraControl#setTorchStrengthLevelAsync(int)} hasn't been called.
+     *
+     * <p>The value of the {@link LiveData} will be {@link #TORCH_STRENGTH_LEVEL_UNSUPPORTED} if
+     * the device doesn't have a flash unit or doesn't support configuring torch strength.
      */
-    @RestrictTo(Scope.LIBRARY_GROUP)
     default @NonNull LiveData<Integer> getTorchStrengthLevel() {
-        return new MutableLiveData<>(1);
+        return new MutableLiveData<>(TORCH_STRENGTH_LEVEL_UNSUPPORTED);
     }
 
     @StringDef(open = true, value = {IMPLEMENTATION_TYPE_UNKNOWN,
diff --git a/camera/camera-core/src/main/java/androidx/camera/core/impl/ForwardingCameraInfo.java b/camera/camera-core/src/main/java/androidx/camera/core/impl/ForwardingCameraInfo.java
index 10d896a..de7943c 100644
--- a/camera/camera-core/src/main/java/androidx/camera/core/impl/ForwardingCameraInfo.java
+++ b/camera/camera-core/src/main/java/androidx/camera/core/impl/ForwardingCameraInfo.java
@@ -19,6 +19,7 @@
 import android.util.Range;
 import android.util.Size;
 
+import androidx.annotation.IntRange;
 import androidx.camera.core.CameraInfo;
 import androidx.camera.core.CameraSelector;
 import androidx.camera.core.CameraState;
@@ -78,6 +79,7 @@
     }
 
     @Override
+    @IntRange(from = 0)
     public int getMaxTorchStrengthLevel() {
         return mCameraInfoInternal.getMaxTorchStrengthLevel();
     }
diff --git a/camera/camera-video/src/androidTest/java/androidx/camera/video/VideoRecordingTest.kt b/camera/camera-video/src/androidTest/java/androidx/camera/video/VideoRecordingTest.kt
index befe1c0..c3aa6d1 100644
--- a/camera/camera-video/src/androidTest/java/androidx/camera/video/VideoRecordingTest.kt
+++ b/camera/camera-video/src/androidTest/java/androidx/camera/video/VideoRecordingTest.kt
@@ -365,13 +365,13 @@
     fun getResolutionInfo_shouldMatchRecordedVideoResolution() {
         // Arrange.
         checkAndBindUseCases(preview, videoCapture)
+        val resolutionInfo = videoCapture.resolutionInfo!!
 
         // Act.
         val result = recordingSession.createRecording().recordAndVerify()
 
         // Assert: the resolution of the video file should match the resolution calculated by
         // rotating the cropRect specified in the ResolutionInfo.
-        val resolutionInfo = videoCapture.resolutionInfo!!
         val expectedResolution =
             rotateSize(rectToSize(resolutionInfo.cropRect), resolutionInfo.rotationDegrees)
         verifyVideoResolution(context, result.file, expectedResolution)
diff --git a/camera/integration-tests/coretestapp/src/main/java/androidx/camera/integration/core/CameraXActivity.java b/camera/integration-tests/coretestapp/src/main/java/androidx/camera/integration/core/CameraXActivity.java
index 19331ab..de52e38 100644
--- a/camera/integration-tests/coretestapp/src/main/java/androidx/camera/integration/core/CameraXActivity.java
+++ b/camera/integration-tests/coretestapp/src/main/java/androidx/camera/integration/core/CameraXActivity.java
@@ -1322,7 +1322,7 @@
         Bundle bundle = this.getIntent().getExtras();
         if (bundle != null) {
             mTargetAspectRatio = bundle.getInt(INTENT_EXTRA_TARGET_ASPECT_RATIO,
-                    AspectRatio.RATIO_4_3);
+                    AspectRatio.RATIO_DEFAULT);
             int scaleType = bundle.getInt(INTENT_EXTRA_SCALE_TYPE, INTENT_EXTRA_FILL_CENTER);
             if (scaleType == INTENT_EXTRA_FIT_CENTER) {
                 // Scale the view according to the target aspect ratio, display size and device
diff --git a/car/app/app/src/main/java/androidx/car/app/CarToast.java b/car/app/app/src/main/java/androidx/car/app/CarToast.java
index 0df1034..97bc2a4b 100644
--- a/car/app/app/src/main/java/androidx/car/app/CarToast.java
+++ b/car/app/app/src/main/java/androidx/car/app/CarToast.java
@@ -72,6 +72,7 @@
     /**
      * Creates and sets the text and duration for the toast view.
      *
+     * @param carContext the context used for string localization
      * @param textResId the resource id for the text to show. If the {@code textResId} is 0, the
      *                  text will be set to empty
      * @param duration  how long to display the message. Either {@link #LENGTH_SHORT} or {@link
@@ -89,6 +90,7 @@
     /**
      * Creates and sets the text and duration for the toast view.
      *
+     * @param carContext the CarContext providing the service used to show the toast
      * @param text     the text to show
      * @param duration how long to display the message. Either {@link #LENGTH_SHORT} or {@link
      *                 #LENGTH_LONG}
diff --git a/car/app/app/src/main/java/androidx/car/app/model/AlertCallbackDelegate.java b/car/app/app/src/main/java/androidx/car/app/model/AlertCallbackDelegate.java
index b104443..73f61f3 100644
--- a/car/app/app/src/main/java/androidx/car/app/model/AlertCallbackDelegate.java
+++ b/car/app/app/src/main/java/androidx/car/app/model/AlertCallbackDelegate.java
@@ -34,6 +34,7 @@
     /**
      * Notifies that a cancel event happened with given {@code reason}.
      *
+     * @param reason the {@link AlertCallback.Reason} for which the alert was cancelled
      * @param callback the {@link OnDoneCallback} to trigger when the client finishes handling
      *                 the event
      */
diff --git a/compose/animation/animation-core/proguard-rules.pro b/compose/animation/animation-core/proguard-rules.pro
index 72f4a6c..67d118b 100644
--- a/compose/animation/animation-core/proguard-rules.pro
+++ b/compose/animation/animation-core/proguard-rules.pro
@@ -15,7 +15,7 @@
 # Keep all the functions created to throw an exception. We don't want these functions to be
 # inlined in any way, which R8 will do by default. The whole point of these functions is to
 # reduce the amount of code generated at the call site.
--keepclassmembers,allowshrinking,allowobfuscation class androidx.compose.**.* {
+-keep,allowshrinking,allowobfuscation class androidx.compose.**.* {
     static void throw*Exception(...);
     static void throw*ExceptionForNullCheck(...);
     # For methods returning Nothing
diff --git a/compose/foundation/foundation-layout/proguard-rules.pro b/compose/foundation/foundation-layout/proguard-rules.pro
index 72f4a6c..67d118b 100644
--- a/compose/foundation/foundation-layout/proguard-rules.pro
+++ b/compose/foundation/foundation-layout/proguard-rules.pro
@@ -15,7 +15,7 @@
 # Keep all the functions created to throw an exception. We don't want these functions to be
 # inlined in any way, which R8 will do by default. The whole point of these functions is to
 # reduce the amount of code generated at the call site.
--keepclassmembers,allowshrinking,allowobfuscation class androidx.compose.**.* {
+-keep,allowshrinking,allowobfuscation class androidx.compose.**.* {
     static void throw*Exception(...);
     static void throw*ExceptionForNullCheck(...);
     # For methods returning Nothing
diff --git a/compose/foundation/foundation-layout/src/commonMain/kotlin/androidx/compose/foundation/layout/AlignmentLine.kt b/compose/foundation/foundation-layout/src/commonMain/kotlin/androidx/compose/foundation/layout/AlignmentLine.kt
index 99d2381..fb9ac8c05 100644
--- a/compose/foundation/foundation-layout/src/commonMain/kotlin/androidx/compose/foundation/layout/AlignmentLine.kt
+++ b/compose/foundation/foundation-layout/src/commonMain/kotlin/androidx/compose/foundation/layout/AlignmentLine.kt
@@ -33,7 +33,6 @@
 import androidx.compose.ui.unit.Constraints
 import androidx.compose.ui.unit.Dp
 import androidx.compose.ui.unit.TextUnit
-import androidx.compose.ui.unit.isSpecified
 import androidx.compose.ui.unit.isUnspecified
 import kotlin.math.max
 
@@ -143,14 +142,14 @@
 @Stable
 fun Modifier.paddingFromBaseline(top: Dp = Dp.Unspecified, bottom: Dp = Dp.Unspecified) =
     this.then(
-            if (top.isSpecified) {
+            if (top != Dp.Unspecified) {
                 Modifier.paddingFrom(FirstBaseline, before = top)
             } else {
                 Modifier
             }
         )
         .then(
-            if (bottom.isSpecified) {
+            if (bottom != Dp.Unspecified) {
                 Modifier.paddingFrom(LastBaseline, after = bottom)
             } else {
                 Modifier
@@ -193,8 +192,8 @@
 ) : ModifierNodeElement<AlignmentLineOffsetDpNode>() {
     init {
         requirePrecondition(
-            (before.value >= 0f || before.isUnspecified) and
-                (after.value >= 0f || after.isUnspecified)
+            (before.value >= 0f || before == Dp.Unspecified) &&
+                (after.value >= 0f || after == Dp.Unspecified)
         ) {
             "Padding from alignment line must be a non-negative number"
         }
@@ -320,12 +319,12 @@
     val axisMax = if (alignmentLine.horizontal) constraints.maxHeight else constraints.maxWidth
     // Compute padding required to satisfy the total before and after offsets.
     val paddingBefore =
-        ((if (before.isSpecified) before.roundToPx() else 0) - linePosition).coerceIn(
+        ((if (before != Dp.Unspecified) before.roundToPx() else 0) - linePosition).coerceIn(
             0,
             axisMax - axis
         )
     val paddingAfter =
-        ((if (after.isSpecified) after.roundToPx() else 0) - axis + linePosition).coerceIn(
+        ((if (after != Dp.Unspecified) after.roundToPx() else 0) - axis + linePosition).coerceIn(
             0,
             axisMax - axis - paddingBefore
         )
diff --git a/compose/foundation/foundation-layout/src/commonMain/kotlin/androidx/compose/foundation/layout/Padding.kt b/compose/foundation/foundation-layout/src/commonMain/kotlin/androidx/compose/foundation/layout/Padding.kt
index c038279..24ac686 100644
--- a/compose/foundation/foundation-layout/src/commonMain/kotlin/androidx/compose/foundation/layout/Padding.kt
+++ b/compose/foundation/foundation-layout/src/commonMain/kotlin/androidx/compose/foundation/layout/Padding.kt
@@ -33,7 +33,6 @@
 import androidx.compose.ui.unit.constrainHeight
 import androidx.compose.ui.unit.constrainWidth
 import androidx.compose.ui.unit.dp
-import androidx.compose.ui.unit.isUnspecified
 import androidx.compose.ui.unit.offset
 
 /**
@@ -204,14 +203,10 @@
     ) : PaddingValues {
 
         init {
-            requirePrecondition(
-                (left.value >= 0f) and
-                    (top.value >= 0f) and
-                    (right.value >= 0f) and
-                    (bottom.value >= 0f)
-            ) {
-                "Padding must be non-negative"
-            }
+            requirePrecondition(left.value >= 0) { "Left padding must be non-negative" }
+            requirePrecondition(top.value >= 0) { "Top padding must be non-negative" }
+            requirePrecondition(right.value >= 0) { "Right padding must be non-negative" }
+            requirePrecondition(bottom.value >= 0) { "Bottom padding must be non-negative" }
         }
 
         override fun calculateLeftPadding(layoutDirection: LayoutDirection) = left
@@ -296,11 +291,10 @@
 ) : PaddingValues {
 
     init {
-        requirePrecondition(
-            (start.value >= 0f) and (top.value >= 0f) and (end.value >= 0f) and (bottom.value >= 0f)
-        ) {
-            "Padding must be non-negative"
-        }
+        requirePrecondition(start.value >= 0) { "Start padding must be non-negative" }
+        requirePrecondition(top.value >= 0) { "Top padding must be non-negative" }
+        requirePrecondition(end.value >= 0) { "End padding must be non-negative" }
+        requirePrecondition(bottom.value >= 0) { "Bottom padding must be non-negative" }
     }
 
     override fun calculateLeftPadding(layoutDirection: LayoutDirection) =
@@ -338,10 +332,10 @@
 
     init {
         requirePrecondition(
-            (start.value >= 0f || start.isUnspecified) and
-                (top.value >= 0f || top.isUnspecified) and
-                (end.value >= 0f || end.isUnspecified) and
-                (bottom.value >= 0f || bottom.isUnspecified)
+            (start.value >= 0f || start == Dp.Unspecified) &&
+                (top.value >= 0f || top == Dp.Unspecified) &&
+                (end.value >= 0f || end == Dp.Unspecified) &&
+                (bottom.value >= 0f || bottom == Dp.Unspecified)
         ) {
             "Padding must be non-negative"
         }
@@ -442,30 +436,30 @@
         measurable: Measurable,
         constraints: Constraints
     ): MeasureResult {
-        val leftPadding = paddingValues.calculateLeftPadding(layoutDirection)
-        val topPadding = paddingValues.calculateTopPadding()
-        val rightPadding = paddingValues.calculateRightPadding(layoutDirection)
-        val bottomPadding = paddingValues.calculateBottomPadding()
-
         requirePrecondition(
-            (leftPadding >= 0.dp) and
-                (topPadding >= 0.dp) and
-                (rightPadding >= 0.dp) and
-                (bottomPadding >= 0.dp)
+            paddingValues.calculateLeftPadding(layoutDirection) >= 0.dp &&
+                paddingValues.calculateTopPadding() >= 0.dp &&
+                paddingValues.calculateRightPadding(layoutDirection) >= 0.dp &&
+                paddingValues.calculateBottomPadding() >= 0.dp
         ) {
             "Padding must be non-negative"
         }
-
-        val roundedLeftPadding = leftPadding.roundToPx()
-        val horizontal = roundedLeftPadding + rightPadding.roundToPx()
-
-        val roundedTopPadding = topPadding.roundToPx()
-        val vertical = roundedTopPadding + bottomPadding.roundToPx()
+        val horizontal =
+            paddingValues.calculateLeftPadding(layoutDirection).roundToPx() +
+                paddingValues.calculateRightPadding(layoutDirection).roundToPx()
+        val vertical =
+            paddingValues.calculateTopPadding().roundToPx() +
+                paddingValues.calculateBottomPadding().roundToPx()
 
         val placeable = measurable.measure(constraints.offset(-horizontal, -vertical))
 
         val width = constraints.constrainWidth(placeable.width + horizontal)
         val height = constraints.constrainHeight(placeable.height + vertical)
-        return layout(width, height) { placeable.place(roundedLeftPadding, roundedTopPadding) }
+        return layout(width, height) {
+            placeable.place(
+                paddingValues.calculateLeftPadding(layoutDirection).roundToPx(),
+                paddingValues.calculateTopPadding().roundToPx()
+            )
+        }
     }
 }
diff --git a/compose/foundation/foundation-layout/src/commonMain/kotlin/androidx/compose/foundation/layout/Size.kt b/compose/foundation/foundation-layout/src/commonMain/kotlin/androidx/compose/foundation/layout/Size.kt
index 52e00de..b221c8b 100644
--- a/compose/foundation/foundation-layout/src/commonMain/kotlin/androidx/compose/foundation/layout/Size.kt
+++ b/compose/foundation/foundation-layout/src/commonMain/kotlin/androidx/compose/foundation/layout/Size.kt
@@ -39,10 +39,6 @@
 import androidx.compose.ui.unit.constrain
 import androidx.compose.ui.unit.constrainHeight
 import androidx.compose.ui.unit.constrainWidth
-import androidx.compose.ui.unit.isSpecified
-import androidx.compose.ui.util.fastCoerceAtLeast
-import androidx.compose.ui.util.fastCoerceAtMost
-import androidx.compose.ui.util.fastCoerceIn
 import androidx.compose.ui.util.fastRoundToInt
 
 /**
@@ -698,7 +694,7 @@
             val width =
                 (constraints.maxWidth * fraction)
                     .fastRoundToInt()
-                    .fastCoerceIn(constraints.minWidth, constraints.maxWidth)
+                    .coerceIn(constraints.minWidth, constraints.maxWidth)
             minWidth = width
             maxWidth = width
         } else {
@@ -711,7 +707,7 @@
             val height =
                 (constraints.maxHeight * fraction)
                     .fastRoundToInt()
-                    .fastCoerceIn(constraints.minHeight, constraints.maxHeight)
+                    .coerceIn(constraints.minHeight, constraints.maxHeight)
             minHeight = height
             maxHeight = height
         } else {
@@ -786,28 +782,28 @@
     private val Density.targetConstraints: Constraints
         get() {
             val maxWidth =
-                if (maxWidth.isSpecified) {
-                    maxWidth.roundToPx().fastCoerceAtLeast(0)
+                if (maxWidth != Dp.Unspecified) {
+                    maxWidth.roundToPx().coerceAtLeast(0)
                 } else {
                     Constraints.Infinity
                 }
             val maxHeight =
-                if (maxHeight.isSpecified) {
-                    maxHeight.roundToPx().fastCoerceAtLeast(0)
+                if (maxHeight != Dp.Unspecified) {
+                    maxHeight.roundToPx().coerceAtLeast(0)
                 } else {
                     Constraints.Infinity
                 }
             val minWidth =
-                if (minWidth.isSpecified) {
-                    minWidth.roundToPx().fastCoerceIn(0, maxWidth).let {
+                if (minWidth != Dp.Unspecified) {
+                    minWidth.roundToPx().coerceAtMost(maxWidth).coerceAtLeast(0).let {
                         if (it != Constraints.Infinity) it else 0
                     }
                 } else {
                     0
                 }
             val minHeight =
-                if (minHeight.isSpecified) {
-                    minHeight.roundToPx().fastCoerceIn(0, maxHeight).let {
+                if (minHeight != Dp.Unspecified) {
+                    minHeight.roundToPx().coerceAtMost(maxHeight).coerceAtLeast(0).let {
                         if (it != Constraints.Infinity) it else 0
                     }
                 } else {
@@ -831,28 +827,28 @@
                     constraints.constrain(targetConstraints)
                 } else {
                     val resolvedMinWidth =
-                        if (minWidth.isSpecified) {
+                        if (minWidth != Dp.Unspecified) {
                             targetConstraints.minWidth
                         } else {
-                            constraints.minWidth.fastCoerceAtMost(targetConstraints.maxWidth)
+                            constraints.minWidth.coerceAtMost(targetConstraints.maxWidth)
                         }
                     val resolvedMaxWidth =
-                        if (maxWidth.isSpecified) {
+                        if (maxWidth != Dp.Unspecified) {
                             targetConstraints.maxWidth
                         } else {
-                            constraints.maxWidth.fastCoerceAtLeast(targetConstraints.minWidth)
+                            constraints.maxWidth.coerceAtLeast(targetConstraints.minWidth)
                         }
                     val resolvedMinHeight =
-                        if (minHeight.isSpecified) {
+                        if (minHeight != Dp.Unspecified) {
                             targetConstraints.minHeight
                         } else {
-                            constraints.minHeight.fastCoerceAtMost(targetConstraints.maxHeight)
+                            constraints.minHeight.coerceAtMost(targetConstraints.maxHeight)
                         }
                     val resolvedMaxHeight =
-                        if (maxHeight.isSpecified) {
+                        if (maxHeight != Dp.Unspecified) {
                             targetConstraints.maxHeight
                         } else {
-                            constraints.maxHeight.fastCoerceAtLeast(targetConstraints.minHeight)
+                            constraints.maxHeight.coerceAtLeast(targetConstraints.minHeight)
                         }
                     Constraints(
                         resolvedMinWidth,
@@ -1076,14 +1072,14 @@
     ): MeasureResult {
         val wrappedConstraints =
             Constraints(
-                if (minWidth.isSpecified && constraints.minWidth == 0) {
-                    minWidth.roundToPx().fastCoerceIn(0, constraints.maxWidth)
+                if (minWidth != Dp.Unspecified && constraints.minWidth == 0) {
+                    minWidth.roundToPx().coerceAtMost(constraints.maxWidth).coerceAtLeast(0)
                 } else {
                     constraints.minWidth
                 },
                 constraints.maxWidth,
-                if (minHeight.isSpecified && constraints.minHeight == 0) {
-                    minHeight.roundToPx().fastCoerceIn(0, constraints.maxHeight)
+                if (minHeight != Dp.Unspecified && constraints.minHeight == 0) {
+                    minHeight.roundToPx().coerceAtMost(constraints.maxHeight).coerceAtLeast(0)
                 } else {
                     constraints.minHeight
                 },
@@ -1099,7 +1095,7 @@
     ) =
         measurable
             .minIntrinsicWidth(height)
-            .fastCoerceAtLeast(if (minWidth.isSpecified) minWidth.roundToPx() else 0)
+            .coerceAtLeast(if (minWidth != Dp.Unspecified) minWidth.roundToPx() else 0)
 
     override fun IntrinsicMeasureScope.maxIntrinsicWidth(
         measurable: IntrinsicMeasurable,
@@ -1107,7 +1103,7 @@
     ) =
         measurable
             .maxIntrinsicWidth(height)
-            .fastCoerceAtLeast(if (minWidth.isSpecified) minWidth.roundToPx() else 0)
+            .coerceAtLeast(if (minWidth != Dp.Unspecified) minWidth.roundToPx() else 0)
 
     override fun IntrinsicMeasureScope.minIntrinsicHeight(
         measurable: IntrinsicMeasurable,
@@ -1115,7 +1111,7 @@
     ) =
         measurable
             .minIntrinsicHeight(width)
-            .fastCoerceAtLeast(if (minHeight.isSpecified) minHeight.roundToPx() else 0)
+            .coerceAtLeast(if (minHeight != Dp.Unspecified) minHeight.roundToPx() else 0)
 
     override fun IntrinsicMeasureScope.maxIntrinsicHeight(
         measurable: IntrinsicMeasurable,
@@ -1123,7 +1119,7 @@
     ) =
         measurable
             .maxIntrinsicHeight(width)
-            .fastCoerceAtLeast(if (minHeight.isSpecified) minHeight.roundToPx() else 0)
+            .coerceAtLeast(if (minHeight != Dp.Unspecified) minHeight.roundToPx() else 0)
 }
 
 internal enum class Direction {
diff --git a/compose/foundation/foundation/build.gradle b/compose/foundation/foundation/build.gradle
index 91a0069..0d84d31 100644
--- a/compose/foundation/foundation/build.gradle
+++ b/compose/foundation/foundation/build.gradle
@@ -50,7 +50,6 @@
                 implementation(project(":compose:ui:ui-text"))
                 implementation(project(":compose:ui:ui-util"))
                 implementation(project(":compose:foundation:foundation-layout"))
-                implementation(project(":performance:performance-annotation"))
             }
         }
 
@@ -81,16 +80,12 @@
             dependsOn(commonMain)
         }
 
-        nonAndroidStubsMain {
+        jvmStubsMain {
             dependsOn(commonStubsMain)
         }
 
-        jvmStubsMain {
-            dependsOn(nonAndroidStubsMain)
-        }
-
         linuxx64StubsMain {
-            dependsOn(nonAndroidStubsMain)
+            dependsOn(commonStubsMain)
         }
 
         androidInstrumentedTest {
diff --git a/compose/foundation/foundation/proguard-rules.pro b/compose/foundation/foundation/proguard-rules.pro
index 2d14261..d07663a 100644
--- a/compose/foundation/foundation/proguard-rules.pro
+++ b/compose/foundation/foundation/proguard-rules.pro
@@ -15,12 +15,8 @@
 # Keep all the functions created to throw an exception. We don't want these functions to be
 # inlined in any way, which R8 will do by default. The whole point of these functions is to
 # reduce the amount of code generated at the call site.
--keepclassmembers,allowshrinking,allowobfuscation class androidx.compose.**.* {
+-keep,allowshrinking,allowobfuscation class androidx.compose.**.* {
     static void throw*Exception(...);
     # For methods returning Nothing
     static java.lang.Void throw*Exception(...);
 }
-
--keepclassmembers class * {
-    @dalvik.annotation.optimization.NeverInline *;
-}
diff --git a/compose/foundation/foundation/src/androidInstrumentedTest/kotlin/androidx/compose/foundation/text/input/BasicTextFieldTest.kt b/compose/foundation/foundation/src/androidInstrumentedTest/kotlin/androidx/compose/foundation/text/input/BasicTextFieldTest.kt
index 78ac040..7f8b8f7 100644
--- a/compose/foundation/foundation/src/androidInstrumentedTest/kotlin/androidx/compose/foundation/text/input/BasicTextFieldTest.kt
+++ b/compose/foundation/foundation/src/androidInstrumentedTest/kotlin/androidx/compose/foundation/text/input/BasicTextFieldTest.kt
@@ -16,6 +16,7 @@
 
 package androidx.compose.foundation.text.input
 
+import android.R
 import android.os.Build
 import android.text.InputType
 import android.text.SpannableStringBuilder
@@ -40,7 +41,10 @@
 import androidx.compose.foundation.text.TEST_FONT_FAMILY
 import androidx.compose.foundation.text.computeSizeForDefaultText
 import androidx.compose.foundation.text.input.TextFieldBuffer.ChangeList
+import androidx.compose.foundation.text.input.internal.TextLayoutState
+import androidx.compose.foundation.text.input.internal.TransformedTextFieldState
 import androidx.compose.foundation.text.input.internal.selection.FakeClipboard
+import androidx.compose.foundation.text.input.internal.selection.TextFieldSelectionState
 import androidx.compose.foundation.text.input.internal.setComposingRegion
 import androidx.compose.foundation.text.selection.fetchTextLayoutResult
 import androidx.compose.foundation.verticalScroll
@@ -127,6 +131,9 @@
 import org.junit.Rule
 import org.junit.Test
 import org.junit.runner.RunWith
+import org.mockito.kotlin.mock
+import org.mockito.kotlin.times
+import org.mockito.kotlin.verify
 
 @OptIn(ExperimentalFoundationApi::class, ExperimentalTestApi::class)
 @LargeTest
@@ -1130,9 +1137,7 @@
 
         requestFocus(Tag)
 
-        inputMethodInterceptor.withInputConnection {
-            performContextMenuAction(android.R.id.selectAll)
-        }
+        inputMethodInterceptor.withInputConnection { performContextMenuAction(R.id.selectAll) }
 
         rule.runOnIdle {
             assertThat(state.selection).isEqualTo(TextRange(0, 5))
@@ -1152,7 +1157,7 @@
 
         requestFocus(Tag)
 
-        inputMethodInterceptor.withInputConnection { performContextMenuAction(android.R.id.cut) }
+        inputMethodInterceptor.withInputConnection { performContextMenuAction(R.id.cut) }
 
         rule.waitForIdle()
         assertThat(clipboard.getClipEntry()?.readText()).isEqualTo("He")
@@ -1171,7 +1176,7 @@
 
         requestFocus(Tag)
 
-        inputMethodInterceptor.withInputConnection { performContextMenuAction(android.R.id.copy) }
+        inputMethodInterceptor.withInputConnection { performContextMenuAction(R.id.copy) }
 
         rule.waitForIdle()
         assertThat(clipboard.getClipEntry()?.readText()).isEqualTo("He")
@@ -1189,7 +1194,7 @@
 
         requestFocus(Tag)
 
-        inputMethodInterceptor.withInputConnection { performContextMenuAction(android.R.id.paste) }
+        inputMethodInterceptor.withInputConnection { performContextMenuAction(R.id.paste) }
 
         rule.runOnIdle {
             assertThat(state.text.toString()).isEqualTo("Worldo")
@@ -1299,6 +1304,34 @@
     }
 
     @Test
+    fun textField_state_invokesAutofill() {
+        val mockLambda: () -> Unit = mock()
+        var density by mutableStateOf(Density(1f))
+
+        val manager =
+            TextFieldSelectionState(
+                    // other parameters not necessary to test autofill invocation
+                    textFieldState =
+                        TransformedTextFieldState(
+                            textFieldState = TextFieldState(),
+                            inputTransformation = null,
+                            codepointTransformation = null,
+                            outputTransformation = null
+                        ),
+                    textLayoutState = TextLayoutState(),
+                    density = density,
+                    enabled = true,
+                    readOnly = false,
+                    isFocused = false,
+                    isPassword = false
+                )
+                .apply { requestAutofillAction = mockLambda }
+
+        manager.autofill()
+        verify(mockLambda, times(1)).invoke()
+    }
+
+    @Test
     fun changingInputTransformation_doesNotRestartInput() {
         var inputTransformation by mutableStateOf(InputTransformation.maxLength(10))
         inputMethodInterceptor.setTextFieldTestContent {
diff --git a/compose/foundation/foundation/src/androidInstrumentedTest/kotlin/androidx/compose/foundation/text/input/TextFieldKeyEventTest.kt b/compose/foundation/foundation/src/androidInstrumentedTest/kotlin/androidx/compose/foundation/text/input/TextFieldKeyEventTest.kt
index a90d80a..50eb946 100644
--- a/compose/foundation/foundation/src/androidInstrumentedTest/kotlin/androidx/compose/foundation/text/input/TextFieldKeyEventTest.kt
+++ b/compose/foundation/foundation/src/androidInstrumentedTest/kotlin/androidx/compose/foundation/text/input/TextFieldKeyEventTest.kt
@@ -30,6 +30,7 @@
 import androidx.compose.foundation.text.input.TextFieldLineLimits.SingleLine
 import androidx.compose.foundation.text.input.internal.selection.FakeClipboard
 import androidx.compose.runtime.CompositionLocalProvider
+import androidx.compose.runtime.mutableIntStateOf
 import androidx.compose.ui.Modifier
 import androidx.compose.ui.focus.FocusRequester
 import androidx.compose.ui.focus.focusRequester
@@ -854,6 +855,38 @@
         }
     }
 
+    @Test
+    fun textField_keyEvent_functionReference() {
+        val state = mutableIntStateOf(0)
+        var handled = -1
+        val focusRequester = FocusRequester()
+        rule.setContent {
+            val stateValue = state.value
+
+            @Suppress("UNUSED_PARAMETER")
+            fun handle(key: KeyEvent): Boolean {
+                handled = stateValue
+                return true
+            }
+
+            BasicTextField(
+                value = "text",
+                onValueChange = {},
+                modifier = Modifier.focusRequester(focusRequester).testTag(tag).onKeyEvent(::handle)
+            )
+        }
+
+        rule.runOnIdle { focusRequester.requestFocus() }
+        rule.onNodeWithTag(tag).performKeyInput { pressKey(Key.A) }
+        rule.runOnIdle {
+            assertThat(handled).isEqualTo(0)
+            state.value += 1
+        }
+
+        rule.onNodeWithTag(tag).performKeyInput { pressKey(Key.A) }
+        rule.runOnIdle { assertThat(handled).isEqualTo(1) }
+    }
+
     private inner class SequenceScope(
         val state: TextFieldState,
         val clipboard: Clipboard,
diff --git a/compose/foundation/foundation/src/androidUnitTest/kotlin/androidx/compose/foundation/text/selection/TextFieldSelectionManagerTest.kt b/compose/foundation/foundation/src/androidUnitTest/kotlin/androidx/compose/foundation/text/selection/TextFieldSelectionManagerTest.kt
index fb28556..9d8e33e 100644
--- a/compose/foundation/foundation/src/androidUnitTest/kotlin/androidx/compose/foundation/text/selection/TextFieldSelectionManagerTest.kt
+++ b/compose/foundation/foundation/src/androidUnitTest/kotlin/androidx/compose/foundation/text/selection/TextFieldSelectionManagerTest.kt
@@ -23,7 +23,6 @@
 import androidx.compose.foundation.text.LegacyTextFieldState
 import androidx.compose.foundation.text.TextDelegate
 import androidx.compose.foundation.text.TextLayoutResultProxy
-import androidx.compose.ui.autofill.AutofillManager
 import androidx.compose.ui.focus.FocusRequester
 import androidx.compose.ui.geometry.Offset
 import androidx.compose.ui.geometry.Rect
@@ -98,7 +97,6 @@
     private val hapticFeedback = mock<HapticFeedback>()
     private val focusRequester = mock<FocusRequester>()
     private val multiParagraph = mock<MultiParagraph>()
-    private val autofillManager = mock<AutofillManager>()
 
     @Before
     fun setup() {
@@ -110,7 +108,6 @@
         manager.textToolbar = textToolbar
         manager.hapticFeedBack = hapticFeedback
         manager.focusRequester = focusRequester
-        manager.autofillManager = autofillManager
         manager.coroutineScope = null
 
         whenever(layoutResult.layoutInput)
@@ -370,10 +367,12 @@
     @Test
     fun autofill_selection_collapse() {
         manager.value = TextFieldValue(text = text, selection = TextRange(4, 4))
+        val mockLambda: () -> Unit = mock()
+        val manager = TextFieldSelectionManager().apply { requestAutofillAction = mockLambda }
 
         manager.autofill()
 
-        verify(autofillManager, times(1)).requestAutofillForActiveElement()
+        verify(mockLambda, times(1)).invoke()
         assertThat(state.handleState).isEqualTo(HandleState.None)
     }
 
diff --git a/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/Scroll.kt b/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/Scroll.kt
index 7c73fa8..7a034224 100644
--- a/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/Scroll.kt
+++ b/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/Scroll.kt
@@ -443,28 +443,44 @@
         measurable: IntrinsicMeasurable,
         height: Int
     ): Int {
-        return measurable.minIntrinsicWidth(if (isVertical) Constraints.Infinity else height)
+        return if (isVertical) {
+            measurable.minIntrinsicWidth(Constraints.Infinity)
+        } else {
+            measurable.minIntrinsicWidth(height)
+        }
     }
 
     override fun IntrinsicMeasureScope.minIntrinsicHeight(
         measurable: IntrinsicMeasurable,
         width: Int
     ): Int {
-        return measurable.minIntrinsicHeight(if (isVertical) width else Constraints.Infinity)
+        return if (isVertical) {
+            measurable.minIntrinsicHeight(width)
+        } else {
+            measurable.minIntrinsicHeight(Constraints.Infinity)
+        }
     }
 
     override fun IntrinsicMeasureScope.maxIntrinsicWidth(
         measurable: IntrinsicMeasurable,
         height: Int
     ): Int {
-        return measurable.maxIntrinsicWidth(if (isVertical) Constraints.Infinity else height)
+        return if (isVertical) {
+            measurable.maxIntrinsicWidth(Constraints.Infinity)
+        } else {
+            measurable.maxIntrinsicWidth(height)
+        }
     }
 
     override fun IntrinsicMeasureScope.maxIntrinsicHeight(
         measurable: IntrinsicMeasurable,
         width: Int
     ): Int {
-        return measurable.maxIntrinsicHeight(if (isVertical) width else Constraints.Infinity)
+        return if (isVertical) {
+            measurable.maxIntrinsicHeight(width)
+        } else {
+            measurable.maxIntrinsicHeight(Constraints.Infinity)
+        }
     }
 
     override fun SemanticsPropertyReceiver.applySemantics() {
diff --git a/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/gestures/AnchoredDraggable.kt b/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/gestures/AnchoredDraggable.kt
index db0c790..dd3ef0b 100644
--- a/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/gestures/AnchoredDraggable.kt
+++ b/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/gestures/AnchoredDraggable.kt
@@ -62,7 +62,6 @@
 import androidx.compose.ui.unit.LayoutDirection
 import androidx.compose.ui.unit.Velocity
 import androidx.compose.ui.unit.dp
-import dalvik.annotation.optimization.NeverInline
 import kotlin.math.abs
 import kotlin.math.max
 import kotlin.math.min
@@ -633,7 +632,6 @@
         positions[keys.size - 1] = position
     }
 
-    @NeverInline
     internal fun buildPositions(): FloatArray {
         // We might have expanded more than we actually need, so trim the array
         return positions.copyOfRange(
@@ -645,7 +643,6 @@
 
     internal fun buildKeys(): List<T> = keys
 
-    @NeverInline
     private fun expandPositions() {
         positions = positions.copyOf(keys.size + 2)
     }
@@ -1653,7 +1650,7 @@
     }
 }
 
-internal expect inline fun assertOnJvm(statement: Boolean, message: () -> String)
+internal expect inline fun assertOnJvm(statement: Boolean, message: () -> String): Unit
 
 internal val AnchoredDraggableMinFlingVelocity = 125.dp
 
diff --git a/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/internal/InlineClassHelper.kt b/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/internal/InlineClassHelper.kt
index 686d885..4af862a 100644
--- a/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/internal/InlineClassHelper.kt
+++ b/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/internal/InlineClassHelper.kt
@@ -53,7 +53,7 @@
     }
 }
 
-@Suppress("NOTHING_TO_INLINE", "BanInlineOptIn", "KotlinRedundantDiagnosticSuppress")
+@Suppress("NOTHING_TO_INLINE", "BanInlineOptIn")
 @OptIn(ExperimentalContracts::class)
 internal inline fun checkPrecondition(value: Boolean) {
     contract { returns() implies value }
diff --git a/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/BasicTextField.kt b/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/BasicTextField.kt
index 925ecfd..7e63192 100644
--- a/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/BasicTextField.kt
+++ b/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/BasicTextField.kt
@@ -68,7 +68,6 @@
 import androidx.compose.ui.graphics.SolidColor
 import androidx.compose.ui.input.pointer.pointerHoverIcon
 import androidx.compose.ui.input.pointer.pointerInput
-import androidx.compose.ui.platform.LocalAutofillManager
 import androidx.compose.ui.platform.LocalClipboard
 import androidx.compose.ui.platform.LocalDensity
 import androidx.compose.ui.platform.LocalHapticFeedback
@@ -301,7 +300,6 @@
     val currentHapticFeedback = LocalHapticFeedback.current
     val currentClipboard = LocalClipboard.current
     val currentTextToolbar = LocalTextToolbar.current
-    val autofillManager = LocalAutofillManager.current
 
     val textToolbarHandler =
         remember(coroutineScope, currentTextToolbar) {
@@ -360,7 +358,6 @@
             enabled = enabled,
             readOnly = readOnly,
             isPassword = isPassword,
-            autofillManager = autofillManager,
             showTextToolbar = textToolbarHandler
         )
     }
diff --git a/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/CoreTextField.kt b/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/CoreTextField.kt
index 14f8402..494f392 100644
--- a/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/CoreTextField.kt
+++ b/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/CoreTextField.kt
@@ -27,6 +27,7 @@
 import androidx.compose.foundation.relocation.BringIntoViewRequester
 import androidx.compose.foundation.relocation.bringIntoViewRequester
 import androidx.compose.foundation.text.handwriting.stylusHandwriting
+import androidx.compose.foundation.text.input.internal.CoreTextFieldSemanticsModifier
 import androidx.compose.foundation.text.input.internal.createLegacyPlatformTextInputServiceAdapter
 import androidx.compose.foundation.text.input.internal.legacyTextInputAdapter
 import androidx.compose.foundation.text.selection.LocalTextSelectionColors
@@ -58,7 +59,6 @@
 import androidx.compose.runtime.snapshotFlow
 import androidx.compose.runtime.snapshots.Snapshot
 import androidx.compose.ui.Modifier
-import androidx.compose.ui.autofill.ContentDataType
 import androidx.compose.ui.draw.drawBehind
 import androidx.compose.ui.focus.FocusManager
 import androidx.compose.ui.focus.FocusRequester
@@ -82,7 +82,6 @@
 import androidx.compose.ui.layout.MeasureResult
 import androidx.compose.ui.layout.MeasureScope
 import androidx.compose.ui.layout.onGloballyPositioned
-import androidx.compose.ui.platform.LocalAutofillManager
 import androidx.compose.ui.platform.LocalClipboard
 import androidx.compose.ui.platform.LocalDensity
 import androidx.compose.ui.platform.LocalFocusManager
@@ -92,33 +91,13 @@
 import androidx.compose.ui.platform.LocalTextToolbar
 import androidx.compose.ui.platform.LocalWindowInfo
 import androidx.compose.ui.platform.SoftwareKeyboardController
-import androidx.compose.ui.semantics.contentDataType
-import androidx.compose.ui.semantics.copyText
-import androidx.compose.ui.semantics.cutText
-import androidx.compose.ui.semantics.disabled
-import androidx.compose.ui.semantics.editableText
-import androidx.compose.ui.semantics.getTextLayoutResult
-import androidx.compose.ui.semantics.insertTextAtCursor
-import androidx.compose.ui.semantics.isEditable
-import androidx.compose.ui.semantics.onAutofillText
-import androidx.compose.ui.semantics.onClick
-import androidx.compose.ui.semantics.onImeAction
-import androidx.compose.ui.semantics.onLongClick
-import androidx.compose.ui.semantics.password
-import androidx.compose.ui.semantics.pasteText
 import androidx.compose.ui.semantics.semantics
-import androidx.compose.ui.semantics.setSelection
-import androidx.compose.ui.semantics.setText
-import androidx.compose.ui.semantics.textSelectionRange
 import androidx.compose.ui.text.AnnotatedString
 import androidx.compose.ui.text.TextLayoutResult
 import androidx.compose.ui.text.TextRange
 import androidx.compose.ui.text.TextStyle
 import androidx.compose.ui.text.font.FontFamily
-import androidx.compose.ui.text.input.CommitTextCommand
-import androidx.compose.ui.text.input.DeleteAllCommand
 import androidx.compose.ui.text.input.EditProcessor
-import androidx.compose.ui.text.input.FinishComposingTextCommand
 import androidx.compose.ui.text.input.ImeAction
 import androidx.compose.ui.text.input.ImeOptions
 import androidx.compose.ui.text.input.KeyboardType
@@ -316,7 +295,6 @@
     manager.coroutineScope = coroutineScope
     manager.textToolbar = LocalTextToolbar.current
     manager.hapticFeedBack = LocalHapticFeedback.current
-    manager.autofillManager = LocalAutofillManager.current
     manager.focusRequester = focusRequester
     manager.editable = !readOnly
     manager.enabled = enabled
@@ -474,151 +452,18 @@
 
     val isPassword = visualTransformation is PasswordVisualTransformation
     val semanticsModifier =
-        Modifier.semantics(true) {
-            // focused semantics are handled by Modifier.focusable()
-            this.editableText = transformedText.text
-            this.textSelectionRange = value.selection
-
-            // The developer will set `contentType`. CTF populates the other autofill-related
-            // semantics. And since we're in a TextField, set the `contentDataType` to be "Text".
-            this.contentDataType = ContentDataType.Text
-            onAutofillText { text ->
-                state.justAutofilled = true
-                state.autofillHighlightOn = true
-                handleTextUpdateFromSemantics(state, text.text, readOnly, enabled)
-                true
-            }
-
-            if (!enabled) this.disabled()
-            if (isPassword) this.password()
-            val editable = enabled && !readOnly
-            isEditable = editable
-            getTextLayoutResult {
-                if (state.layoutResult != null) {
-                    it.add(state.layoutResult!!.value)
-                    true
-                } else {
-                    false
-                }
-            }
-            if (editable) {
-                setText { text ->
-                    handleTextUpdateFromSemantics(state, text.text, readOnly, enabled)
-                    true
-                }
-
-                insertTextAtCursor { text ->
-                    if (readOnly || !enabled) return@insertTextAtCursor false
-
-                    // If the action is performed while in an active text editing session, treat
-                    // this like an IME command and update the text by going through the buffer.
-                    // This keeps the buffer state consistent if other IME commands are performed
-                    // before the next recomposition, and is used for the testing code path.
-                    state.inputSession?.let { session ->
-                        TextFieldDelegate.onEditCommand(
-                            // Finish composing text first because when the field is focused the IME
-                            // might
-                            // set composition.
-                            ops = listOf(FinishComposingTextCommand(), CommitTextCommand(text, 1)),
-                            editProcessor = state.processor,
-                            state.onValueChange,
-                            session
-                        )
-                    }
-                        ?: run {
-                            val newText =
-                                value.text.replaceRange(
-                                    value.selection.start,
-                                    value.selection.end,
-                                    text
-                                )
-                            val newCursor = TextRange(value.selection.start + text.length)
-                            state.onValueChange(TextFieldValue(newText, newCursor))
-                        }
-                    true
-                }
-            }
-
-            setSelection { selectionStart, selectionEnd, relativeToOriginalText ->
-                // in traversal mode we get selection from the `textSelectionRange` semantics which
-                // is
-                // selection in original text. In non-traversal mode selection comes from the
-                // Talkback
-                // and indices are relative to the transformed text
-                val start =
-                    if (relativeToOriginalText) {
-                        selectionStart
-                    } else {
-                        offsetMapping.transformedToOriginal(selectionStart)
-                    }
-                val end =
-                    if (relativeToOriginalText) {
-                        selectionEnd
-                    } else {
-                        offsetMapping.transformedToOriginal(selectionEnd)
-                    }
-
-                if (!enabled) {
-                    false
-                } else if (start == value.selection.start && end == value.selection.end) {
-                    false
-                } else if (
-                    minOf(start, end) >= 0 && maxOf(start, end) <= value.annotatedString.length
-                ) {
-                    // Do not show toolbar if it's a traversal mode (with the volume keys), or
-                    // if the cursor just moved to beginning or end.
-                    if (relativeToOriginalText || start == end) {
-                        manager.exitSelectionMode()
-                    } else {
-                        manager.enterSelectionMode()
-                    }
-                    state.onValueChange(
-                        TextFieldValue(value.annotatedString, TextRange(start, end))
-                    )
-                    true
-                } else {
-                    manager.exitSelectionMode()
-                    false
-                }
-            }
-            onImeAction(imeOptions.imeAction) {
-                // This will perform the appropriate default action if no handler has been
-                // specified, so
-                // as far as the platform is concerned, we always handle the action and never want
-                // to
-                // defer to the default _platform_ implementation.
-                state.onImeActionPerformed(imeOptions.imeAction)
-                true
-            }
-            onClick {
-                // according to the documentation, we still need to provide proper semantics actions
-                // even if the state is 'disabled'
-                tapToFocus(state, focusRequester, !readOnly)
-                true
-            }
-            onLongClick {
-                manager.enterSelectionMode()
-                true
-            }
-            if (!value.selection.collapsed && !isPassword) {
-                copyText {
-                    manager.copy()
-                    true
-                }
-                if (enabled && !readOnly) {
-                    cutText {
-                        manager.cut()
-                        true
-                    }
-                }
-            }
-            if (enabled && !readOnly) {
-                pasteText {
-                    manager.paste()
-                    true
-                }
-            }
-        }
+        CoreTextFieldSemanticsModifier(
+            transformedText,
+            value,
+            state,
+            readOnly,
+            enabled,
+            isPassword,
+            offsetMapping,
+            manager,
+            imeOptions,
+            focusRequester
+        )
 
     val showCursor = enabled && !readOnly && windowInfo.isWindowFocused && !state.hasHighlight()
     val cursorModifier = Modifier.cursor(state, value, offsetMapping, cursorBrush, showCursor)
@@ -884,30 +729,6 @@
     }
 }
 
-/**
- * In an active input session, semantics updates are handled just as user updates coming from the
- * IME. Otherwise the updates are directly applied on the current state.
- */
-private fun handleTextUpdateFromSemantics(
-    state: LegacyTextFieldState,
-    text: String,
-    readOnly: Boolean,
-    enabled: Boolean
-) {
-    if (readOnly || !enabled) return
-
-    // If the action is performed while in an active text editing session, treat this
-    // like an IME command and update the text by going through the buffer.
-    state.inputSession?.let { session ->
-        TextFieldDelegate.onEditCommand(
-            ops = listOf(DeleteAllCommand(), CommitTextCommand(text, 1)),
-            editProcessor = state.processor,
-            state.onValueChange,
-            session
-        )
-    } ?: run { state.onValueChange(TextFieldValue(text, TextRange(text.length))) }
-}
-
 internal class LegacyTextFieldState(
     var textDelegate: TextDelegate,
     val recomposeScope: RecomposeScope,
@@ -1108,7 +929,7 @@
 }
 
 /** Request focus on tap. If already focused, makes sure the keyboard is requested. */
-private fun tapToFocus(
+internal fun tapToFocus(
     state: LegacyTextFieldState,
     focusRequester: FocusRequester,
     allowKeyboard: Boolean
diff --git a/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/input/internal/CoreTextFieldSemanticsModifier.kt b/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/input/internal/CoreTextFieldSemanticsModifier.kt
new file mode 100644
index 0000000..a5fe111
--- /dev/null
+++ b/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/input/internal/CoreTextFieldSemanticsModifier.kt
@@ -0,0 +1,334 @@
+/*
+ * Copyright 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 androidx.compose.foundation.text.input.internal
+
+import androidx.compose.foundation.text.LegacyTextFieldState
+import androidx.compose.foundation.text.TextFieldDelegate
+import androidx.compose.foundation.text.selection.TextFieldSelectionManager
+import androidx.compose.foundation.text.tapToFocus
+import androidx.compose.ui.autofill.ContentDataType
+import androidx.compose.ui.focus.FocusRequester
+import androidx.compose.ui.node.DelegatingNode
+import androidx.compose.ui.node.ModifierNodeElement
+import androidx.compose.ui.node.SemanticsModifierNode
+import androidx.compose.ui.node.invalidateSemantics
+import androidx.compose.ui.node.requestAutofill
+import androidx.compose.ui.platform.InspectorInfo
+import androidx.compose.ui.semantics.SemanticsPropertyReceiver
+import androidx.compose.ui.semantics.contentDataType
+import androidx.compose.ui.semantics.copyText
+import androidx.compose.ui.semantics.cutText
+import androidx.compose.ui.semantics.disabled
+import androidx.compose.ui.semantics.editableText
+import androidx.compose.ui.semantics.getTextLayoutResult
+import androidx.compose.ui.semantics.insertTextAtCursor
+import androidx.compose.ui.semantics.isEditable
+import androidx.compose.ui.semantics.onAutofillText
+import androidx.compose.ui.semantics.onClick
+import androidx.compose.ui.semantics.onImeAction
+import androidx.compose.ui.semantics.onLongClick
+import androidx.compose.ui.semantics.password
+import androidx.compose.ui.semantics.pasteText
+import androidx.compose.ui.semantics.setSelection
+import androidx.compose.ui.semantics.setText
+import androidx.compose.ui.semantics.textSelectionRange
+import androidx.compose.ui.text.TextRange
+import androidx.compose.ui.text.input.CommitTextCommand
+import androidx.compose.ui.text.input.DeleteAllCommand
+import androidx.compose.ui.text.input.FinishComposingTextCommand
+import androidx.compose.ui.text.input.ImeOptions
+import androidx.compose.ui.text.input.OffsetMapping
+import androidx.compose.ui.text.input.TextFieldValue
+import androidx.compose.ui.text.input.TransformedText
+
+internal data class CoreTextFieldSemanticsModifier(
+    val transformedText: TransformedText,
+    val value: TextFieldValue,
+    val state: LegacyTextFieldState,
+    val readOnly: Boolean,
+    val enabled: Boolean,
+    val isPassword: Boolean,
+    val offsetMapping: OffsetMapping,
+    val manager: TextFieldSelectionManager,
+    val imeOptions: ImeOptions,
+    val focusRequester: FocusRequester
+) : ModifierNodeElement<CoreTextFieldSemanticsModifierNode>() {
+    override fun create(): CoreTextFieldSemanticsModifierNode =
+        CoreTextFieldSemanticsModifierNode(
+            transformedText = transformedText,
+            value = value,
+            state = state,
+            readOnly = readOnly,
+            enabled = enabled,
+            isPassword = isPassword,
+            offsetMapping = offsetMapping,
+            manager = manager,
+            imeOptions = imeOptions,
+            focusRequester = focusRequester
+        )
+
+    override fun update(node: CoreTextFieldSemanticsModifierNode) {
+        node.updateNodeSemantics(
+            transformedText = transformedText,
+            value = value,
+            state = state,
+            readOnly = readOnly,
+            enabled = enabled,
+            isPassword = isPassword,
+            offsetMapping = offsetMapping,
+            manager = manager,
+            imeOptions = imeOptions,
+            focusRequester = focusRequester
+        )
+    }
+
+    override fun InspectorInfo.inspectableProperties() {
+        // Show nothing in the inspector.
+    }
+}
+
+internal class CoreTextFieldSemanticsModifierNode(
+    var transformedText: TransformedText,
+    var value: TextFieldValue,
+    var state: LegacyTextFieldState,
+    var readOnly: Boolean,
+    var enabled: Boolean,
+    var isPassword: Boolean,
+    var offsetMapping: OffsetMapping,
+    var manager: TextFieldSelectionManager,
+    var imeOptions: ImeOptions,
+    var focusRequester: FocusRequester
+) : DelegatingNode(), SemanticsModifierNode {
+    init {
+        manager.requestAutofillAction = { requestAutofill() }
+    }
+
+    override val shouldMergeDescendantSemantics: Boolean
+        get() = true
+
+    override fun SemanticsPropertyReceiver.applySemantics() {
+        this.editableText = transformedText.text
+        this.textSelectionRange = value.selection
+
+        // The developer will set `contentType`. CTF populates the other autofill-related
+        // semantics. And since we're in a TextField, set the `contentDataType` to be "Text".
+        this.contentDataType = ContentDataType.Text
+        onAutofillText { text ->
+            state.justAutofilled = true
+            state.autofillHighlightOn = true
+            handleTextUpdateFromSemantics(state, text.text, readOnly, enabled)
+            true
+        }
+
+        if (!enabled) this.disabled()
+        if (isPassword) this.password()
+        val editable = enabled && !readOnly
+        isEditable = editable
+        getTextLayoutResult {
+            if (state.layoutResult != null) {
+                it.add(state.layoutResult!!.value)
+                true
+            } else {
+                false
+            }
+        }
+
+        if (editable) {
+            setText { text ->
+                handleTextUpdateFromSemantics(state, text.text, readOnly, enabled)
+                true
+            }
+
+            insertTextAtCursor { text ->
+                if (readOnly || !enabled) return@insertTextAtCursor false
+
+                // If the action is performed while in an active text editing session, treat
+                // this like an IME command and update the text by going through the buffer.
+                // This keeps the buffer state consistent if other IME commands are performed
+                // before the next recomposition, and is used for the testing code path.
+                state.inputSession?.let { session ->
+                    TextFieldDelegate.onEditCommand(
+                        // Finish composing text first because when the field is focused the IME
+                        // might
+                        // set composition.
+                        ops = listOf(FinishComposingTextCommand(), CommitTextCommand(text, 1)),
+                        editProcessor = state.processor,
+                        state.onValueChange,
+                        session
+                    )
+                }
+                    ?: run {
+                        val newText =
+                            value.text.replaceRange(
+                                value.selection.start,
+                                value.selection.end,
+                                text
+                            )
+                        val newCursor = TextRange(value.selection.start + text.length)
+                        state.onValueChange(TextFieldValue(newText, newCursor))
+                    }
+                true
+            }
+        }
+
+        setSelection { selectionStart, selectionEnd, relativeToOriginalText ->
+            // in traversal mode we get selection from the `textSelectionRange` semantics which
+            // is selection in original text. In non-traversal mode selection comes from the
+            // Talkback and indices are relative to the transformed text
+            val start =
+                if (relativeToOriginalText) {
+                    selectionStart
+                } else {
+                    offsetMapping.transformedToOriginal(selectionStart)
+                }
+            val end =
+                if (relativeToOriginalText) {
+                    selectionEnd
+                } else {
+                    offsetMapping.transformedToOriginal(selectionEnd)
+                }
+
+            if (!enabled) {
+                false
+            } else if (start == value.selection.start && end == value.selection.end) {
+                false
+            } else if (
+                minOf(start, end) >= 0 && maxOf(start, end) <= value.annotatedString.length
+            ) {
+                // Do not show toolbar if it's a traversal mode (with the volume keys), or
+                // if the cursor just moved to beginning or end.
+                if (relativeToOriginalText || start == end) {
+                    manager.exitSelectionMode()
+                } else {
+                    manager.enterSelectionMode()
+                }
+                state.onValueChange(TextFieldValue(value.annotatedString, TextRange(start, end)))
+                true
+            } else {
+                manager.exitSelectionMode()
+                false
+            }
+        }
+        onImeAction(imeOptions.imeAction) {
+            // This will perform the appropriate default action if no handler has been
+            // specified, so
+            // as far as the platform is concerned, we always handle the action and never want
+            // to
+            // defer to the default _platform_ implementation.
+            state.onImeActionPerformed(imeOptions.imeAction)
+            true
+        }
+        onClick {
+            // according to the documentation, we still need to provide proper semantics actions
+            // even if the state is 'disabled'
+            tapToFocus(state, focusRequester, !readOnly)
+            true
+        }
+        onLongClick {
+            manager.enterSelectionMode()
+            true
+        }
+        if (!value.selection.collapsed && !isPassword) {
+            copyText {
+                manager.copy()
+                true
+            }
+            if (enabled && !readOnly) {
+                cutText {
+                    manager.cut()
+                    true
+                }
+            }
+        }
+        if (enabled && !readOnly) {
+            pasteText {
+                manager.paste()
+                true
+            }
+        }
+    }
+
+    fun updateNodeSemantics(
+        transformedText: TransformedText,
+        value: TextFieldValue,
+        state: LegacyTextFieldState,
+        readOnly: Boolean,
+        enabled: Boolean,
+        isPassword: Boolean,
+        offsetMapping: OffsetMapping,
+        manager: TextFieldSelectionManager,
+        imeOptions: ImeOptions,
+        focusRequester: FocusRequester
+    ) {
+        // Find the diff: current previous and new values before updating current.
+        val previousEditable = this.enabled && !this.readOnly
+        val previousEnabled = this.enabled
+        val previousIsPassword = this.isPassword
+        val previousImeOptions = this.imeOptions
+        val previousManager = this.manager
+        val editable = enabled && !readOnly
+
+        // Apply the diff.
+        this.transformedText = transformedText
+        this.value = value
+        this.state = state
+        this.readOnly = readOnly
+        this.enabled = enabled
+        this.offsetMapping = offsetMapping
+        this.manager = manager
+        this.imeOptions = imeOptions
+        this.focusRequester = focusRequester
+
+        if (
+            enabled != previousEnabled ||
+                editable != previousEditable ||
+                imeOptions != previousImeOptions ||
+                isPassword != previousIsPassword ||
+                !value.selection.collapsed
+        ) {
+            invalidateSemantics()
+        }
+
+        if (manager != previousManager) {
+            manager.requestAutofillAction = { requestAutofill() }
+        }
+    }
+
+    /**
+     * In an active input session, semantics updates are handled just as user updates coming from
+     * the IME. Otherwise the updates are directly applied on the current state.
+     */
+    private fun handleTextUpdateFromSemantics(
+        state: LegacyTextFieldState,
+        text: String,
+        readOnly: Boolean,
+        enabled: Boolean
+    ) {
+        if (readOnly || !enabled) return
+
+        // If the action is performed while in an active text editing session, treat this
+        // like an IME command and update the text by going through the buffer.
+        state.inputSession?.let { session ->
+            TextFieldDelegate.onEditCommand(
+                ops = listOf(DeleteAllCommand(), CommitTextCommand(text, 1)),
+                editProcessor = state.processor,
+                state.onValueChange,
+                session
+            )
+        } ?: run { state.onValueChange(TextFieldValue(text, TextRange(text.length))) }
+    }
+}
diff --git a/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/input/internal/OffsetMappingCalculator.kt b/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/input/internal/OffsetMappingCalculator.kt
index eaa2856..b6fb607 100644
--- a/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/input/internal/OffsetMappingCalculator.kt
+++ b/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/input/internal/OffsetMappingCalculator.kt
@@ -370,18 +370,18 @@
  */
 @kotlin.jvm.JvmInline
 private value class OpArray private constructor(private val values: IntArray) {
-    constructor(size: Int) : this(IntArray(size * OpArrayElementSize))
+    constructor(size: Int) : this(IntArray(size * ElementSize))
 
     val size: Int
-        get() = values.size / OpArrayElementSize
+        get() = values.size / ElementSize
 
     fun set(index: Int, offset: Int, srcLen: Int, destLen: Int) {
-        values[index * OpArrayElementSize] = offset
-        values[index * OpArrayElementSize + 1] = srcLen
-        values[index * OpArrayElementSize + 2] = destLen
+        values[index * ElementSize] = offset
+        values[index * ElementSize + 1] = srcLen
+        values[index * ElementSize + 2] = destLen
     }
 
-    fun copyOf(newSize: Int) = OpArray(values.copyOf(newSize * OpArrayElementSize))
+    fun copyOf(newSize: Int) = OpArray(values.copyOf(newSize * ElementSize))
 
     /**
      * Loops through the array between 0 and [max] (exclusive). If [reversed] is false (the
@@ -399,20 +399,22 @@
         // duplication here keeps the more complicated logic at the callsite more readable.
         if (reversed) {
             for (i in max - 1 downTo 0) {
-                val offset = values[i * OpArrayElementSize]
-                val srcLen = values[i * OpArrayElementSize + 1]
-                val destLen = values[i * OpArrayElementSize + 2]
+                val offset = values[i * ElementSize]
+                val srcLen = values[i * ElementSize + 1]
+                val destLen = values[i * ElementSize + 2]
                 block(offset, srcLen, destLen)
             }
         } else {
             for (i in 0 until max) {
-                val offset = values[i * OpArrayElementSize]
-                val srcLen = values[i * OpArrayElementSize + 1]
-                val destLen = values[i * OpArrayElementSize + 2]
+                val offset = values[i * ElementSize]
+                val srcLen = values[i * ElementSize + 1]
+                val destLen = values[i * ElementSize + 2]
                 block(offset, srcLen, destLen)
             }
         }
     }
-}
 
-private const val OpArrayElementSize = 3
+    private companion object {
+        const val ElementSize = 3
+    }
+}
diff --git a/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/input/internal/TextFieldDecoratorModifier.kt b/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/input/internal/TextFieldDecoratorModifier.kt
index c9eb589..d7810f9 100644
--- a/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/input/internal/TextFieldDecoratorModifier.kt
+++ b/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/input/internal/TextFieldDecoratorModifier.kt
@@ -66,6 +66,7 @@
 import androidx.compose.ui.node.currentValueOf
 import androidx.compose.ui.node.invalidateSemantics
 import androidx.compose.ui.node.observeReads
+import androidx.compose.ui.node.requestAutofill
 import androidx.compose.ui.platform.InspectorInfo
 import androidx.compose.ui.platform.LocalFocusManager
 import androidx.compose.ui.platform.LocalSoftwareKeyboardController
@@ -202,8 +203,9 @@
     ObserverModifierNode,
     LayoutAwareModifierNode {
 
-    private val editable
-        get() = enabled && !readOnly
+    init {
+        textFieldSelectionState.requestAutofillAction = { requestAutofill() }
+    }
 
     private val pointerInputNode =
         delegate(
@@ -430,9 +432,7 @@
         stylusHandwritingTrigger: MutableSharedFlow<Unit>?
     ) {
         // Find the diff: current previous and new values before updating current.
-        val previousEditable = this.editable
-        val editable = enabled && !readOnly
-
+        val previousEditable = this.enabled && !this.readOnly
         val previousEnabled = this.enabled
         val previousTextFieldState = this.textFieldState
         val previousKeyboardOptions = this.keyboardOptions
@@ -440,6 +440,7 @@
         val previousInteractionSource = this.interactionSource
         val previousIsPassword = this.isPassword
         val previousStylusHandwritingTrigger = this.stylusHandwritingTrigger
+        val editable = enabled && !readOnly
 
         // Apply the diff.
         this.textFieldState = textFieldState
@@ -487,6 +488,7 @@
                 textFieldSelectionState.receiveContentConfiguration =
                     receiveContentConfigurationProvider
             }
+            textFieldSelectionState.requestAutofillAction = { requestAutofill() }
         }
 
         if (interactionSource != previousInteractionSource) {
@@ -507,7 +509,8 @@
         if (!enabled) disabled()
         if (isPassword) password()
 
-        isEditable = this@TextFieldDecoratorModifierNode.editable
+        val editable = enabled && !readOnly
+        isEditable = editable
 
         // The developer will set `contentType`. TF populates the other autofill-related
         // semantics. And since we're in a TextField, set the `contentDataType` to be "Text".
@@ -630,6 +633,7 @@
         isElementFocused = focusState.isFocused
         onFocusChange()
 
+        val editable = enabled && !readOnly
         if (focusState.isFocused) {
             // Deselect when losing focus even if readonly.
             if (editable) {
diff --git a/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/input/internal/selection/TextFieldSelectionState.kt b/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/input/internal/selection/TextFieldSelectionState.kt
index 5baa1a8..0a6c258 100644
--- a/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/input/internal/selection/TextFieldSelectionState.kt
+++ b/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/input/internal/selection/TextFieldSelectionState.kt
@@ -66,7 +66,6 @@
 import androidx.compose.runtime.setValue
 import androidx.compose.runtime.snapshotFlow
 import androidx.compose.runtime.snapshots.Snapshot
-import androidx.compose.ui.autofill.AutofillManager
 import androidx.compose.ui.geometry.Offset
 import androidx.compose.ui.geometry.Rect
 import androidx.compose.ui.geometry.isSpecified
@@ -115,9 +114,6 @@
     var isFocused: Boolean,
     private var isPassword: Boolean,
 ) {
-    /** [AutofillManager] to perform Autofill. */
-    private var autofillManager: AutofillManager? = null
-
     /** [HapticFeedback] handle to perform haptic feedback. */
     private var hapticFeedBack: HapticFeedback? = null
 
@@ -130,6 +126,9 @@
     /** Whether user is interacting with the UI in touch mode. */
     var isInTouchMode: Boolean by mutableStateOf(true)
 
+    /** The action to invoke when autofill is requested in text toolbar. */
+    var requestAutofillAction: (() -> Unit)? = null
+
     /**
      * Reduced [ReceiveContentConfiguration] from the attached modifier node hierarchy. This value
      * is set by [TextFieldDecoratorModifierNode].
@@ -353,8 +352,7 @@
         density: Density,
         enabled: Boolean,
         readOnly: Boolean,
-        isPassword: Boolean,
-        autofillManager: AutofillManager?
+        isPassword: Boolean
     ) {
         if (!enabled) {
             hideTextToolbar()
@@ -366,7 +364,6 @@
         this.enabled = enabled
         this.readOnly = readOnly
         this.isPassword = isPassword
-        this.autofillManager = autofillManager
     }
 
     /** Implements the complete set of gestures supported by the cursor handle. */
@@ -443,7 +440,6 @@
 
         clipboard = null
         hapticFeedBack = null
-        autofillManager = null
     }
 
     /**
@@ -1395,7 +1391,7 @@
      * Inserts credentials (if there exist any that match this field type) into the text field.
      */
     fun autofill() {
-        autofillManager?.requestAutofillForActiveElement()
+        requestAutofillAction?.invoke()
     }
 
     fun deselect() {
diff --git a/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/modifiers/SelectableTextAnnotatedStringNode.kt b/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/modifiers/SelectableTextAnnotatedStringNode.kt
index 363a279..a47838d 100644
--- a/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/modifiers/SelectableTextAnnotatedStringNode.kt
+++ b/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/modifiers/SelectableTextAnnotatedStringNode.kt
@@ -62,6 +62,8 @@
     autoSize: TextAutoSize? = null,
     private var onShowTranslation: ((TextAnnotatedStringNode.TextSubstitutionValue) -> Unit)? = null
 ) : DelegatingNode(), LayoutModifierNode, DrawModifierNode, GlobalPositionAwareModifierNode {
+    override val shouldAutoInvalidate: Boolean
+        get() = false
 
     private val textAnnotatedStringNode =
         delegate(
diff --git a/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/modifiers/TextAnnotatedStringNode.kt b/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/modifiers/TextAnnotatedStringNode.kt
index 8a5c009..e8543a8 100644
--- a/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/modifiers/TextAnnotatedStringNode.kt
+++ b/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/modifiers/TextAnnotatedStringNode.kt
@@ -82,6 +82,9 @@
     private var autoSize: TextAutoSize? = null,
     private var onShowTranslation: ((TextSubstitutionValue) -> Unit)? = null
 ) : Modifier.Node(), LayoutModifierNode, DrawModifierNode, SemanticsModifierNode {
+    override val shouldAutoInvalidate: Boolean
+        get() = false
+
     @Suppress("PrimitiveInCollection")
     private var baselineCache: MutableMap<AlignmentLine, Int>? = null
 
diff --git a/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/modifiers/TextStringSimpleNode.kt b/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/modifiers/TextStringSimpleNode.kt
index a8dd10b..e561553 100644
--- a/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/modifiers/TextStringSimpleNode.kt
+++ b/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/modifiers/TextStringSimpleNode.kt
@@ -77,6 +77,9 @@
     private var minLines: Int = DefaultMinLines,
     private var overrideColor: ColorProducer? = null
 ) : Modifier.Node(), LayoutModifierNode, DrawModifierNode, SemanticsModifierNode {
+    override val shouldAutoInvalidate: Boolean
+        get() = false
+
     @Suppress("PrimitiveInCollection") // Map required for use in public API.
     // Usages of this collection are so few that the gains of using
     // MutableObjectIntMap<AlignmentLine> and then converting to a Map<AlignmentLine, Int>
diff --git a/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/selection/TextFieldSelectionManager.kt b/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/selection/TextFieldSelectionManager.kt
index 674b87a..6f75364 100644
--- a/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/selection/TextFieldSelectionManager.kt
+++ b/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/selection/TextFieldSelectionManager.kt
@@ -38,7 +38,6 @@
 import androidx.compose.runtime.remember
 import androidx.compose.runtime.setValue
 import androidx.compose.ui.Modifier
-import androidx.compose.ui.autofill.AutofillManager
 import androidx.compose.ui.focus.FocusRequester
 import androidx.compose.ui.geometry.Offset
 import androidx.compose.ui.geometry.Rect
@@ -100,8 +99,8 @@
      */
     internal var visualTransformation: VisualTransformation = VisualTransformation.None
 
-    /** [AutofillManager] to perform clipboard features. */
-    internal var autofillManager: AutofillManager? = null
+    /** The action to invoke when autofill is requested in text toolbar. */
+    internal var requestAutofillAction: (() -> Unit)? = null
 
     /** [Clipboard] to perform clipboard features. */
     internal var clipboard: Clipboard? = null
@@ -705,7 +704,7 @@
     }
 
     internal fun autofill() {
-        autofillManager?.requestAutofillForActiveElement()
+        requestAutofillAction?.invoke()
     }
 
     internal fun getHandlePosition(isStartHandle: Boolean): Offset {
diff --git a/compose/material/material/src/androidInstrumentedTest/kotlin/androidx/compose/material/TextTest.kt b/compose/material/material/src/androidInstrumentedTest/kotlin/androidx/compose/material/TextTest.kt
index 68e6215..d2c14a0 100644
--- a/compose/material/material/src/androidInstrumentedTest/kotlin/androidx/compose/material/TextTest.kt
+++ b/compose/material/material/src/androidInstrumentedTest/kotlin/androidx/compose/material/TextTest.kt
@@ -18,11 +18,13 @@
 
 import androidx.compose.foundation.background
 import androidx.compose.foundation.layout.Box
+import androidx.compose.runtime.mutableStateOf
 import androidx.compose.ui.Modifier
 import androidx.compose.ui.graphics.Color
 import androidx.compose.ui.platform.testTag
 import androidx.compose.ui.semantics.SemanticsActions
 import androidx.compose.ui.semantics.getOrNull
+import androidx.compose.ui.semantics.semantics
 import androidx.compose.ui.test.SemanticsMatcher
 import androidx.compose.ui.test.assert
 import androidx.compose.ui.test.assertTextEquals
@@ -112,6 +114,25 @@
     }
 
     @Test
+    fun testChangingFontSizeDoesNotInvalidateSemantics() {
+        val fontSize = mutableStateOf(16.sp)
+        var count = 0
+        val countModifier = Modifier.semantics { count++ }
+        rule.setContent {
+            ProvideTextStyle(ExpectedTextStyle) {
+                Box(Modifier.background(Color.White)) {
+                    Text(modifier = countModifier, text = TestText, fontSize = fontSize.value)
+                }
+            }
+        }
+        rule.runOnIdle {
+            count = 0
+            fontSize.value = 20.sp
+        }
+        rule.runOnIdle { assertThat(count).isEqualTo(0) }
+    }
+
+    @Test
     fun settingCustomTextStyle() {
         var textColor: Color? = null
         var textAlign: TextAlign? = null
diff --git a/compose/material3/adaptive/adaptive-layout/api/current.ignore b/compose/material3/adaptive/adaptive-layout/api/current.ignore
new file mode 100644
index 0000000..6562a08
--- /dev/null
+++ b/compose/material3/adaptive/adaptive-layout/api/current.ignore
@@ -0,0 +1,3 @@
+// Baseline format: 1.0
+ParameterNameChange: androidx.compose.material3.adaptive.layout.ThreePaneScaffoldDestinationItem#ThreePaneScaffoldDestinationItem(androidx.compose.material3.adaptive.layout.ThreePaneScaffoldRole, T) parameter #1:
+    Attempted to change parameter name from content to contentKey in constructor androidx.compose.material3.adaptive.layout.ThreePaneScaffoldDestinationItem
diff --git a/compose/material3/adaptive/adaptive-layout/api/current.txt b/compose/material3/adaptive/adaptive-layout/api/current.txt
index cbaeb22..b4cd5c9 100644
--- a/compose/material3/adaptive/adaptive-layout/api/current.txt
+++ b/compose/material3/adaptive/adaptive-layout/api/current.txt
@@ -94,7 +94,7 @@
     property public androidx.compose.material3.adaptive.layout.ThreePaneScaffoldValue targetState;
   }
 
-  @SuppressCompatibility @androidx.compose.material3.adaptive.ExperimentalMaterial3AdaptiveApi @kotlin.jvm.JvmInline public final value class PaneAdaptedValue {
+  @kotlin.jvm.JvmInline public final value class PaneAdaptedValue {
     field public static final androidx.compose.material3.adaptive.layout.PaneAdaptedValue.Companion Companion;
   }
 
@@ -110,12 +110,28 @@
     property @androidx.compose.runtime.Composable public abstract String description;
   }
 
-  public static final class PaneExpansionAnchor.Offset extends androidx.compose.material3.adaptive.layout.PaneExpansionAnchor {
-    ctor public PaneExpansionAnchor.Offset(float offset);
-    method @androidx.compose.runtime.Composable public String getDescription();
-    method public float getOffset();
-    property @androidx.compose.runtime.Composable public String description;
+  public abstract static class PaneExpansionAnchor.Offset extends androidx.compose.material3.adaptive.layout.PaneExpansionAnchor {
+    method public final int getDirection();
+    method public final float getOffset();
+    property public final int direction;
     property public final float offset;
+    field public static final androidx.compose.material3.adaptive.layout.PaneExpansionAnchor.Offset.Companion Companion;
+  }
+
+  public static final class PaneExpansionAnchor.Offset.Companion {
+    method public androidx.compose.material3.adaptive.layout.PaneExpansionAnchor.Offset fromEnd(float offset);
+    method public androidx.compose.material3.adaptive.layout.PaneExpansionAnchor.Offset fromStart(float offset);
+  }
+
+  @kotlin.jvm.JvmInline public static final value class PaneExpansionAnchor.Offset.Direction {
+    field public static final androidx.compose.material3.adaptive.layout.PaneExpansionAnchor.Offset.Direction.Companion Companion;
+  }
+
+  public static final class PaneExpansionAnchor.Offset.Direction.Companion {
+    method public int getFromEnd();
+    method public int getFromStart();
+    property public final int FromEnd;
+    property public final int FromStart;
   }
 
   public static final class PaneExpansionAnchor.Proportion extends androidx.compose.material3.adaptive.layout.PaneExpansionAnchor {
@@ -131,10 +147,13 @@
   }
 
   @SuppressCompatibility @androidx.compose.material3.adaptive.ExperimentalMaterial3AdaptiveApi @androidx.compose.runtime.Stable public final class PaneExpansionState {
+    method public suspend Object? animateTo(androidx.compose.material3.adaptive.layout.PaneExpansionAnchor anchor, optional float initialVelocity, kotlin.coroutines.Continuation<? super kotlin.Unit>);
     method public void clear();
+    method public androidx.compose.material3.adaptive.layout.PaneExpansionAnchor? getCurrentAnchor();
     method public boolean isUnspecified();
     method public void setFirstPaneProportion(@FloatRange(from=0.0, to=1.0) float firstPaneProportion);
     method public void setFirstPaneWidth(int firstPaneWidth);
+    property public final androidx.compose.material3.adaptive.layout.PaneExpansionAnchor? currentAnchor;
     field public static final androidx.compose.material3.adaptive.layout.PaneExpansionState.Companion Companion;
     field public static final int Unspecified = -1; // 0xffffffff
   }
@@ -168,12 +187,8 @@
     property @SuppressCompatibility @androidx.compose.material3.adaptive.ExperimentalMaterial3AdaptiveComponentOverrideApi public static final androidx.compose.runtime.ProvidableCompositionLocal<androidx.compose.material3.adaptive.layout.AnimatedPaneOverride> LocalAnimatedPaneOverride;
   }
 
-  @SuppressCompatibility @androidx.compose.material3.adaptive.ExperimentalMaterial3AdaptiveApi public interface PaneMotion {
-    method public androidx.compose.animation.EnterTransition getEnterTransition(androidx.compose.material3.adaptive.layout.PaneScaffoldMotionDataProvider<? extends java.lang.Object?>);
-    method public androidx.compose.animation.ExitTransition getExitTransition(androidx.compose.material3.adaptive.layout.PaneScaffoldMotionDataProvider<? extends java.lang.Object?>);
+  @SuppressCompatibility @androidx.compose.material3.adaptive.ExperimentalMaterial3AdaptiveApi @androidx.compose.runtime.Stable public sealed interface PaneMotion {
     method public int getType();
-    property public androidx.compose.animation.EnterTransition enterTransition;
-    property public androidx.compose.animation.ExitTransition exitTransition;
     property public abstract int type;
     field public static final androidx.compose.material3.adaptive.layout.PaneMotion.Companion Companion;
   }
@@ -248,6 +263,8 @@
   }
 
   public final class PaneMotionKt {
+    method @SuppressCompatibility @androidx.compose.material3.adaptive.ExperimentalMaterial3AdaptiveApi public static <Role> androidx.compose.animation.EnterTransition calculateDefaultEnterTransition(androidx.compose.material3.adaptive.layout.PaneScaffoldMotionDataProvider<Role>, Role role);
+    method @SuppressCompatibility @androidx.compose.material3.adaptive.ExperimentalMaterial3AdaptiveApi public static <Role> androidx.compose.animation.ExitTransition calculateDefaultExitTransition(androidx.compose.material3.adaptive.layout.PaneScaffoldMotionDataProvider<Role>, Role role);
     method @SuppressCompatibility @androidx.compose.material3.adaptive.ExperimentalMaterial3AdaptiveApi public static inline <Role> void forEach(androidx.compose.material3.adaptive.layout.PaneScaffoldMotionDataProvider<Role>, kotlin.jvm.functions.Function2<? super Role,? super androidx.compose.material3.adaptive.layout.PaneMotionData,kotlin.Unit> action);
     method @SuppressCompatibility @androidx.compose.material3.adaptive.ExperimentalMaterial3AdaptiveApi public static inline <Role> void forEachReversed(androidx.compose.material3.adaptive.layout.PaneScaffoldMotionDataProvider<Role>, kotlin.jvm.functions.Function2<? super Role,? super androidx.compose.material3.adaptive.layout.PaneMotionData,kotlin.Unit> action);
   }
@@ -276,8 +293,8 @@
   }
 
   public final class PaneScaffoldDirectiveKt {
-    method @SuppressCompatibility @androidx.compose.material3.adaptive.ExperimentalMaterial3AdaptiveApi public static androidx.compose.material3.adaptive.layout.PaneScaffoldDirective calculatePaneScaffoldDirective(androidx.compose.material3.adaptive.WindowAdaptiveInfo windowAdaptiveInfo, optional int verticalHingePolicy);
-    method @SuppressCompatibility @androidx.compose.material3.adaptive.ExperimentalMaterial3AdaptiveApi public static androidx.compose.material3.adaptive.layout.PaneScaffoldDirective calculatePaneScaffoldDirectiveWithTwoPanesOnMediumWidth(androidx.compose.material3.adaptive.WindowAdaptiveInfo windowAdaptiveInfo, optional int verticalHingePolicy);
+    method public static androidx.compose.material3.adaptive.layout.PaneScaffoldDirective calculatePaneScaffoldDirective(androidx.compose.material3.adaptive.WindowAdaptiveInfo windowAdaptiveInfo, optional int verticalHingePolicy);
+    method public static androidx.compose.material3.adaptive.layout.PaneScaffoldDirective calculatePaneScaffoldDirectiveWithTwoPanesOnMediumWidth(androidx.compose.material3.adaptive.WindowAdaptiveInfo windowAdaptiveInfo, optional int verticalHingePolicy);
   }
 
   @SuppressCompatibility @androidx.compose.material3.adaptive.ExperimentalMaterial3AdaptiveApi public sealed interface PaneScaffoldMotionDataProvider<Role> {
@@ -312,13 +329,9 @@
   }
 
   @SuppressCompatibility @androidx.compose.material3.adaptive.ExperimentalMaterial3AdaptiveApi public sealed interface PaneScaffoldTransitionScope<Role, ScaffoldValue extends androidx.compose.material3.adaptive.layout.PaneScaffoldValue<Role>> {
-    method public default androidx.compose.animation.EnterTransition getEnterTransition(androidx.compose.material3.adaptive.layout.PaneMotion);
-    method public default androidx.compose.animation.ExitTransition getExitTransition(androidx.compose.material3.adaptive.layout.PaneMotion);
     method public androidx.compose.material3.adaptive.layout.PaneScaffoldMotionDataProvider<Role> getMotionDataProvider();
     method @FloatRange(from=0.0, to=1.0) public float getMotionProgress();
     method public androidx.compose.animation.core.Transition<ScaffoldValue> getScaffoldStateTransition();
-    property public androidx.compose.animation.EnterTransition enterTransition;
-    property public androidx.compose.animation.ExitTransition exitTransition;
     property public abstract androidx.compose.material3.adaptive.layout.PaneScaffoldMotionDataProvider<Role> motionDataProvider;
     property @FloatRange(from=0.0, to=1.0) public abstract float motionProgress;
     property public abstract androidx.compose.animation.core.Transition<ScaffoldValue> scaffoldStateTransition;
@@ -338,7 +351,7 @@
     method @SuppressCompatibility @androidx.compose.material3.adaptive.ExperimentalMaterial3AdaptiveApi @androidx.compose.runtime.Composable public static void SupportingPaneScaffold(androidx.compose.material3.adaptive.layout.PaneScaffoldDirective directive, androidx.compose.material3.adaptive.layout.ThreePaneScaffoldValue value, kotlin.jvm.functions.Function1<? super androidx.compose.material3.adaptive.layout.ThreePaneScaffoldPaneScope,kotlin.Unit> mainPane, kotlin.jvm.functions.Function1<? super androidx.compose.material3.adaptive.layout.ThreePaneScaffoldPaneScope,kotlin.Unit> supportingPane, optional androidx.compose.ui.Modifier modifier, optional kotlin.jvm.functions.Function1<? super androidx.compose.material3.adaptive.layout.ThreePaneScaffoldPaneScope,kotlin.Unit>? extraPane, optional kotlin.jvm.functions.Function2<? super androidx.compose.material3.adaptive.layout.ThreePaneScaffoldScope,? super androidx.compose.material3.adaptive.layout.PaneExpansionState,kotlin.Unit>? paneExpansionDragHandle, optional androidx.compose.material3.adaptive.layout.PaneExpansionState? paneExpansionState);
   }
 
-  @SuppressCompatibility @androidx.compose.material3.adaptive.ExperimentalMaterial3AdaptiveApi public final class SupportingPaneScaffoldRole {
+  public final class SupportingPaneScaffoldRole {
     method public androidx.compose.material3.adaptive.layout.ThreePaneScaffoldRole getExtra();
     method public androidx.compose.material3.adaptive.layout.ThreePaneScaffoldRole getMain();
     method public androidx.compose.material3.adaptive.layout.ThreePaneScaffoldRole getSupporting();
@@ -363,7 +376,7 @@
     method public operator androidx.compose.material3.adaptive.layout.AdaptStrategy get(androidx.compose.material3.adaptive.layout.ThreePaneScaffoldRole role);
   }
 
-  @SuppressCompatibility @androidx.compose.material3.adaptive.ExperimentalMaterial3AdaptiveApi public final class ThreePaneScaffoldDestinationItem<T> {
+  public final class ThreePaneScaffoldDestinationItem<T> {
     ctor public ThreePaneScaffoldDestinationItem(androidx.compose.material3.adaptive.layout.ThreePaneScaffoldRole pane, optional T? contentKey);
     method public T? getContentKey();
     method public androidx.compose.material3.adaptive.layout.ThreePaneScaffoldRole getPane();
@@ -434,7 +447,7 @@
     property public abstract androidx.compose.material3.adaptive.layout.ThreePaneScaffoldValue targetState;
   }
 
-  @SuppressCompatibility @androidx.compose.material3.adaptive.ExperimentalMaterial3AdaptiveApi @androidx.compose.runtime.Immutable public final class ThreePaneScaffoldValue implements androidx.compose.material3.adaptive.layout.PaneExpansionStateKeyProvider androidx.compose.material3.adaptive.layout.PaneScaffoldValue<androidx.compose.material3.adaptive.layout.ThreePaneScaffoldRole> {
+  @androidx.compose.runtime.Immutable public final class ThreePaneScaffoldValue implements androidx.compose.material3.adaptive.layout.PaneExpansionStateKeyProvider androidx.compose.material3.adaptive.layout.PaneScaffoldValue<androidx.compose.material3.adaptive.layout.ThreePaneScaffoldRole> {
     ctor public ThreePaneScaffoldValue(String primary, String secondary, String tertiary);
     method public operator String get(androidx.compose.material3.adaptive.layout.ThreePaneScaffoldRole role);
     method public androidx.compose.material3.adaptive.layout.PaneExpansionStateKey getPaneExpansionStateKey();
diff --git a/compose/material3/adaptive/adaptive-layout/api/restricted_current.ignore b/compose/material3/adaptive/adaptive-layout/api/restricted_current.ignore
new file mode 100644
index 0000000..6562a08
--- /dev/null
+++ b/compose/material3/adaptive/adaptive-layout/api/restricted_current.ignore
@@ -0,0 +1,3 @@
+// Baseline format: 1.0
+ParameterNameChange: androidx.compose.material3.adaptive.layout.ThreePaneScaffoldDestinationItem#ThreePaneScaffoldDestinationItem(androidx.compose.material3.adaptive.layout.ThreePaneScaffoldRole, T) parameter #1:
+    Attempted to change parameter name from content to contentKey in constructor androidx.compose.material3.adaptive.layout.ThreePaneScaffoldDestinationItem
diff --git a/compose/material3/adaptive/adaptive-layout/api/restricted_current.txt b/compose/material3/adaptive/adaptive-layout/api/restricted_current.txt
index cbaeb22..b4cd5c9 100644
--- a/compose/material3/adaptive/adaptive-layout/api/restricted_current.txt
+++ b/compose/material3/adaptive/adaptive-layout/api/restricted_current.txt
@@ -94,7 +94,7 @@
     property public androidx.compose.material3.adaptive.layout.ThreePaneScaffoldValue targetState;
   }
 
-  @SuppressCompatibility @androidx.compose.material3.adaptive.ExperimentalMaterial3AdaptiveApi @kotlin.jvm.JvmInline public final value class PaneAdaptedValue {
+  @kotlin.jvm.JvmInline public final value class PaneAdaptedValue {
     field public static final androidx.compose.material3.adaptive.layout.PaneAdaptedValue.Companion Companion;
   }
 
@@ -110,12 +110,28 @@
     property @androidx.compose.runtime.Composable public abstract String description;
   }
 
-  public static final class PaneExpansionAnchor.Offset extends androidx.compose.material3.adaptive.layout.PaneExpansionAnchor {
-    ctor public PaneExpansionAnchor.Offset(float offset);
-    method @androidx.compose.runtime.Composable public String getDescription();
-    method public float getOffset();
-    property @androidx.compose.runtime.Composable public String description;
+  public abstract static class PaneExpansionAnchor.Offset extends androidx.compose.material3.adaptive.layout.PaneExpansionAnchor {
+    method public final int getDirection();
+    method public final float getOffset();
+    property public final int direction;
     property public final float offset;
+    field public static final androidx.compose.material3.adaptive.layout.PaneExpansionAnchor.Offset.Companion Companion;
+  }
+
+  public static final class PaneExpansionAnchor.Offset.Companion {
+    method public androidx.compose.material3.adaptive.layout.PaneExpansionAnchor.Offset fromEnd(float offset);
+    method public androidx.compose.material3.adaptive.layout.PaneExpansionAnchor.Offset fromStart(float offset);
+  }
+
+  @kotlin.jvm.JvmInline public static final value class PaneExpansionAnchor.Offset.Direction {
+    field public static final androidx.compose.material3.adaptive.layout.PaneExpansionAnchor.Offset.Direction.Companion Companion;
+  }
+
+  public static final class PaneExpansionAnchor.Offset.Direction.Companion {
+    method public int getFromEnd();
+    method public int getFromStart();
+    property public final int FromEnd;
+    property public final int FromStart;
   }
 
   public static final class PaneExpansionAnchor.Proportion extends androidx.compose.material3.adaptive.layout.PaneExpansionAnchor {
@@ -131,10 +147,13 @@
   }
 
   @SuppressCompatibility @androidx.compose.material3.adaptive.ExperimentalMaterial3AdaptiveApi @androidx.compose.runtime.Stable public final class PaneExpansionState {
+    method public suspend Object? animateTo(androidx.compose.material3.adaptive.layout.PaneExpansionAnchor anchor, optional float initialVelocity, kotlin.coroutines.Continuation<? super kotlin.Unit>);
     method public void clear();
+    method public androidx.compose.material3.adaptive.layout.PaneExpansionAnchor? getCurrentAnchor();
     method public boolean isUnspecified();
     method public void setFirstPaneProportion(@FloatRange(from=0.0, to=1.0) float firstPaneProportion);
     method public void setFirstPaneWidth(int firstPaneWidth);
+    property public final androidx.compose.material3.adaptive.layout.PaneExpansionAnchor? currentAnchor;
     field public static final androidx.compose.material3.adaptive.layout.PaneExpansionState.Companion Companion;
     field public static final int Unspecified = -1; // 0xffffffff
   }
@@ -168,12 +187,8 @@
     property @SuppressCompatibility @androidx.compose.material3.adaptive.ExperimentalMaterial3AdaptiveComponentOverrideApi public static final androidx.compose.runtime.ProvidableCompositionLocal<androidx.compose.material3.adaptive.layout.AnimatedPaneOverride> LocalAnimatedPaneOverride;
   }
 
-  @SuppressCompatibility @androidx.compose.material3.adaptive.ExperimentalMaterial3AdaptiveApi public interface PaneMotion {
-    method public androidx.compose.animation.EnterTransition getEnterTransition(androidx.compose.material3.adaptive.layout.PaneScaffoldMotionDataProvider<? extends java.lang.Object?>);
-    method public androidx.compose.animation.ExitTransition getExitTransition(androidx.compose.material3.adaptive.layout.PaneScaffoldMotionDataProvider<? extends java.lang.Object?>);
+  @SuppressCompatibility @androidx.compose.material3.adaptive.ExperimentalMaterial3AdaptiveApi @androidx.compose.runtime.Stable public sealed interface PaneMotion {
     method public int getType();
-    property public androidx.compose.animation.EnterTransition enterTransition;
-    property public androidx.compose.animation.ExitTransition exitTransition;
     property public abstract int type;
     field public static final androidx.compose.material3.adaptive.layout.PaneMotion.Companion Companion;
   }
@@ -248,6 +263,8 @@
   }
 
   public final class PaneMotionKt {
+    method @SuppressCompatibility @androidx.compose.material3.adaptive.ExperimentalMaterial3AdaptiveApi public static <Role> androidx.compose.animation.EnterTransition calculateDefaultEnterTransition(androidx.compose.material3.adaptive.layout.PaneScaffoldMotionDataProvider<Role>, Role role);
+    method @SuppressCompatibility @androidx.compose.material3.adaptive.ExperimentalMaterial3AdaptiveApi public static <Role> androidx.compose.animation.ExitTransition calculateDefaultExitTransition(androidx.compose.material3.adaptive.layout.PaneScaffoldMotionDataProvider<Role>, Role role);
     method @SuppressCompatibility @androidx.compose.material3.adaptive.ExperimentalMaterial3AdaptiveApi public static inline <Role> void forEach(androidx.compose.material3.adaptive.layout.PaneScaffoldMotionDataProvider<Role>, kotlin.jvm.functions.Function2<? super Role,? super androidx.compose.material3.adaptive.layout.PaneMotionData,kotlin.Unit> action);
     method @SuppressCompatibility @androidx.compose.material3.adaptive.ExperimentalMaterial3AdaptiveApi public static inline <Role> void forEachReversed(androidx.compose.material3.adaptive.layout.PaneScaffoldMotionDataProvider<Role>, kotlin.jvm.functions.Function2<? super Role,? super androidx.compose.material3.adaptive.layout.PaneMotionData,kotlin.Unit> action);
   }
@@ -276,8 +293,8 @@
   }
 
   public final class PaneScaffoldDirectiveKt {
-    method @SuppressCompatibility @androidx.compose.material3.adaptive.ExperimentalMaterial3AdaptiveApi public static androidx.compose.material3.adaptive.layout.PaneScaffoldDirective calculatePaneScaffoldDirective(androidx.compose.material3.adaptive.WindowAdaptiveInfo windowAdaptiveInfo, optional int verticalHingePolicy);
-    method @SuppressCompatibility @androidx.compose.material3.adaptive.ExperimentalMaterial3AdaptiveApi public static androidx.compose.material3.adaptive.layout.PaneScaffoldDirective calculatePaneScaffoldDirectiveWithTwoPanesOnMediumWidth(androidx.compose.material3.adaptive.WindowAdaptiveInfo windowAdaptiveInfo, optional int verticalHingePolicy);
+    method public static androidx.compose.material3.adaptive.layout.PaneScaffoldDirective calculatePaneScaffoldDirective(androidx.compose.material3.adaptive.WindowAdaptiveInfo windowAdaptiveInfo, optional int verticalHingePolicy);
+    method public static androidx.compose.material3.adaptive.layout.PaneScaffoldDirective calculatePaneScaffoldDirectiveWithTwoPanesOnMediumWidth(androidx.compose.material3.adaptive.WindowAdaptiveInfo windowAdaptiveInfo, optional int verticalHingePolicy);
   }
 
   @SuppressCompatibility @androidx.compose.material3.adaptive.ExperimentalMaterial3AdaptiveApi public sealed interface PaneScaffoldMotionDataProvider<Role> {
@@ -312,13 +329,9 @@
   }
 
   @SuppressCompatibility @androidx.compose.material3.adaptive.ExperimentalMaterial3AdaptiveApi public sealed interface PaneScaffoldTransitionScope<Role, ScaffoldValue extends androidx.compose.material3.adaptive.layout.PaneScaffoldValue<Role>> {
-    method public default androidx.compose.animation.EnterTransition getEnterTransition(androidx.compose.material3.adaptive.layout.PaneMotion);
-    method public default androidx.compose.animation.ExitTransition getExitTransition(androidx.compose.material3.adaptive.layout.PaneMotion);
     method public androidx.compose.material3.adaptive.layout.PaneScaffoldMotionDataProvider<Role> getMotionDataProvider();
     method @FloatRange(from=0.0, to=1.0) public float getMotionProgress();
     method public androidx.compose.animation.core.Transition<ScaffoldValue> getScaffoldStateTransition();
-    property public androidx.compose.animation.EnterTransition enterTransition;
-    property public androidx.compose.animation.ExitTransition exitTransition;
     property public abstract androidx.compose.material3.adaptive.layout.PaneScaffoldMotionDataProvider<Role> motionDataProvider;
     property @FloatRange(from=0.0, to=1.0) public abstract float motionProgress;
     property public abstract androidx.compose.animation.core.Transition<ScaffoldValue> scaffoldStateTransition;
@@ -338,7 +351,7 @@
     method @SuppressCompatibility @androidx.compose.material3.adaptive.ExperimentalMaterial3AdaptiveApi @androidx.compose.runtime.Composable public static void SupportingPaneScaffold(androidx.compose.material3.adaptive.layout.PaneScaffoldDirective directive, androidx.compose.material3.adaptive.layout.ThreePaneScaffoldValue value, kotlin.jvm.functions.Function1<? super androidx.compose.material3.adaptive.layout.ThreePaneScaffoldPaneScope,kotlin.Unit> mainPane, kotlin.jvm.functions.Function1<? super androidx.compose.material3.adaptive.layout.ThreePaneScaffoldPaneScope,kotlin.Unit> supportingPane, optional androidx.compose.ui.Modifier modifier, optional kotlin.jvm.functions.Function1<? super androidx.compose.material3.adaptive.layout.ThreePaneScaffoldPaneScope,kotlin.Unit>? extraPane, optional kotlin.jvm.functions.Function2<? super androidx.compose.material3.adaptive.layout.ThreePaneScaffoldScope,? super androidx.compose.material3.adaptive.layout.PaneExpansionState,kotlin.Unit>? paneExpansionDragHandle, optional androidx.compose.material3.adaptive.layout.PaneExpansionState? paneExpansionState);
   }
 
-  @SuppressCompatibility @androidx.compose.material3.adaptive.ExperimentalMaterial3AdaptiveApi public final class SupportingPaneScaffoldRole {
+  public final class SupportingPaneScaffoldRole {
     method public androidx.compose.material3.adaptive.layout.ThreePaneScaffoldRole getExtra();
     method public androidx.compose.material3.adaptive.layout.ThreePaneScaffoldRole getMain();
     method public androidx.compose.material3.adaptive.layout.ThreePaneScaffoldRole getSupporting();
@@ -363,7 +376,7 @@
     method public operator androidx.compose.material3.adaptive.layout.AdaptStrategy get(androidx.compose.material3.adaptive.layout.ThreePaneScaffoldRole role);
   }
 
-  @SuppressCompatibility @androidx.compose.material3.adaptive.ExperimentalMaterial3AdaptiveApi public final class ThreePaneScaffoldDestinationItem<T> {
+  public final class ThreePaneScaffoldDestinationItem<T> {
     ctor public ThreePaneScaffoldDestinationItem(androidx.compose.material3.adaptive.layout.ThreePaneScaffoldRole pane, optional T? contentKey);
     method public T? getContentKey();
     method public androidx.compose.material3.adaptive.layout.ThreePaneScaffoldRole getPane();
@@ -434,7 +447,7 @@
     property public abstract androidx.compose.material3.adaptive.layout.ThreePaneScaffoldValue targetState;
   }
 
-  @SuppressCompatibility @androidx.compose.material3.adaptive.ExperimentalMaterial3AdaptiveApi @androidx.compose.runtime.Immutable public final class ThreePaneScaffoldValue implements androidx.compose.material3.adaptive.layout.PaneExpansionStateKeyProvider androidx.compose.material3.adaptive.layout.PaneScaffoldValue<androidx.compose.material3.adaptive.layout.ThreePaneScaffoldRole> {
+  @androidx.compose.runtime.Immutable public final class ThreePaneScaffoldValue implements androidx.compose.material3.adaptive.layout.PaneExpansionStateKeyProvider androidx.compose.material3.adaptive.layout.PaneScaffoldValue<androidx.compose.material3.adaptive.layout.ThreePaneScaffoldRole> {
     ctor public ThreePaneScaffoldValue(String primary, String secondary, String tertiary);
     method public operator String get(androidx.compose.material3.adaptive.layout.ThreePaneScaffoldRole role);
     method public androidx.compose.material3.adaptive.layout.PaneExpansionStateKey getPaneExpansionStateKey();
diff --git a/compose/material3/adaptive/adaptive-layout/src/androidInstrumentedTest/kotlin/androidx/compose/material3/adaptive/layout/PaneExpansionStateTest.kt b/compose/material3/adaptive/adaptive-layout/src/androidInstrumentedTest/kotlin/androidx/compose/material3/adaptive/layout/PaneExpansionStateTest.kt
index 681cae4..344c0f6 100644
--- a/compose/material3/adaptive/adaptive-layout/src/androidInstrumentedTest/kotlin/androidx/compose/material3/adaptive/layout/PaneExpansionStateTest.kt
+++ b/compose/material3/adaptive/adaptive-layout/src/androidInstrumentedTest/kotlin/androidx/compose/material3/adaptive/layout/PaneExpansionStateTest.kt
@@ -233,7 +233,7 @@
                         ThreePaneScaffoldRole.Secondary,
                         ThreePaneScaffoldRole.Tertiary
                     ),
-                    PaneExpansionStateData(7, 0.8F, 9, PaneExpansionAnchor.Offset(200.dp))
+                    PaneExpansionStateData(7, 0.8F, 9, PaneExpansionAnchor.Offset.fromStart(200.dp))
                 ),
                 Pair(
                     TwoPaneExpansionStateKeyImpl(
@@ -271,12 +271,12 @@
 @OptIn(ExperimentalMaterial3AdaptiveApi::class)
 private val MockAnchor0 = PaneExpansionAnchor.Proportion(0f)
 @OptIn(ExperimentalMaterial3AdaptiveApi::class)
-private val MockAnchor1 = PaneExpansionAnchor.Offset(200.dp)
+private val MockAnchor1 = PaneExpansionAnchor.Offset.fromStart(200.dp)
 @OptIn(ExperimentalMaterial3AdaptiveApi::class)
 private val MockAnchor2 = PaneExpansionAnchor.Proportion(0.5f)
 @OptIn(ExperimentalMaterial3AdaptiveApi::class)
-private val MockAnchor3 = PaneExpansionAnchor.Offset((-200).dp)
+private val MockAnchor3 = PaneExpansionAnchor.Offset.fromEnd(200.dp)
 @OptIn(ExperimentalMaterial3AdaptiveApi::class)
 private val MockAnchor4 = PaneExpansionAnchor.Proportion(1f)
 @OptIn(ExperimentalMaterial3AdaptiveApi::class)
-private val MockAnchor5 = PaneExpansionAnchor.Offset(500.dp)
+private val MockAnchor5 = PaneExpansionAnchor.Offset.fromStart(500.dp)
diff --git a/compose/material3/adaptive/adaptive-layout/src/androidInstrumentedTest/kotlin/androidx/compose/material3/adaptive/layout/ThreePaneScaffoldTest.kt b/compose/material3/adaptive/adaptive-layout/src/androidInstrumentedTest/kotlin/androidx/compose/material3/adaptive/layout/ThreePaneScaffoldTest.kt
index 591c322..3677863 100644
--- a/compose/material3/adaptive/adaptive-layout/src/androidInstrumentedTest/kotlin/androidx/compose/material3/adaptive/layout/ThreePaneScaffoldTest.kt
+++ b/compose/material3/adaptive/adaptive-layout/src/androidInstrumentedTest/kotlin/androidx/compose/material3/adaptive/layout/ThreePaneScaffoldTest.kt
@@ -34,6 +34,7 @@
 import androidx.test.ext.junit.runners.AndroidJUnit4
 import androidx.test.filters.MediumTest
 import com.google.common.truth.Truth.assertThat
+import kotlin.test.assertFailsWith
 import kotlinx.coroutines.CoroutineScope
 import kotlinx.coroutines.launch
 import org.junit.Rule
@@ -178,7 +179,7 @@
             mockPaneExpansionState = rememberPaneExpansionState(anchors = MockPaneExpansionAnchors)
             mockDraggingPx = with(LocalDensity.current) { 200.dp.toPx() }
             expectedSettledOffsetPx =
-                with(LocalDensity.current) { MockPaneExpansionMiddleAnchor.toPx().toInt() }
+                with(LocalDensity.current) { MockPaneExpansionMiddleAnchor.roundToPx() }
             SampleThreePaneScaffoldWithPaneExpansion(mockPaneExpansionState) { MockDragHandle(it) }
         }
 
@@ -302,12 +303,12 @@
                     anchors =
                         listOf(
                             PaneExpansionAnchor.Proportion(0f),
-                            PaneExpansionAnchor.Offset(MockPaneExpansionMiddleAnchor)
+                            PaneExpansionAnchor.Offset.fromStart(MockPaneExpansionMiddleAnchor)
                         )
                 )
             mockDraggingPx = with(LocalDensity.current) { 200.dp.toPx() }
             expectedSettledOffsetPx =
-                with(LocalDensity.current) { MockPaneExpansionMiddleAnchor.toPx().toInt() }
+                with(LocalDensity.current) { MockPaneExpansionMiddleAnchor.roundToPx() }
             SampleThreePaneScaffoldWithPaneExpansion(mockPaneExpansionState) { MockDragHandle(it) }
         }
 
@@ -321,6 +322,83 @@
                 .isEqualTo(expectedSettledOffsetPx)
         }
     }
+
+    @Test
+    fun threePaneScaffold_paneExpansionWithDragHandle_animateToAnchor() {
+        var expectedSettledOffsetPx = 0
+        lateinit var mockPaneExpansionState: PaneExpansionState
+        lateinit var scope: CoroutineScope
+
+        rule.setContentWithSimulatedSize(simulatedWidth = 1024.dp, simulatedHeight = 800.dp) {
+            scope = rememberCoroutineScope()
+            mockPaneExpansionState = rememberPaneExpansionState(anchors = MockPaneExpansionAnchors)
+            expectedSettledOffsetPx =
+                with(LocalDensity.current) { MockPaneExpansionMiddleAnchor.roundToPx() }
+            SampleThreePaneScaffoldWithPaneExpansion(mockPaneExpansionState) { MockDragHandle(it) }
+        }
+
+        rule.runOnIdle {
+            scope.launch {
+                mockPaneExpansionState.animateTo(
+                    PaneExpansionAnchor.Offset.fromStart(MockPaneExpansionMiddleAnchor)
+                )
+            }
+        }
+
+        rule.runOnIdle {
+            assertThat(mockPaneExpansionState.currentMeasuredDraggingOffset)
+                .isEqualTo(expectedSettledOffsetPx)
+        }
+    }
+
+    @Test
+    fun threePaneScaffold_paneExpansionWithDragHandle_animateToAnchorWithVelocity() {
+        var expectedSettledOffsetPx = 0
+        lateinit var mockPaneExpansionState: PaneExpansionState
+        lateinit var scope: CoroutineScope
+
+        rule.setContentWithSimulatedSize(simulatedWidth = 1024.dp, simulatedHeight = 800.dp) {
+            scope = rememberCoroutineScope()
+            mockPaneExpansionState = rememberPaneExpansionState(anchors = MockPaneExpansionAnchors)
+            expectedSettledOffsetPx =
+                with(LocalDensity.current) { MockPaneExpansionMiddleAnchor.roundToPx() }
+            SampleThreePaneScaffoldWithPaneExpansion(mockPaneExpansionState) { MockDragHandle(it) }
+        }
+
+        rule.runOnIdle {
+            scope.launch {
+                mockPaneExpansionState.animateTo(
+                    PaneExpansionAnchor.Offset.fromStart(MockPaneExpansionMiddleAnchor),
+                    200F
+                )
+            }
+        }
+
+        rule.runOnIdle {
+            assertThat(mockPaneExpansionState.currentMeasuredDraggingOffset)
+                .isEqualTo(expectedSettledOffsetPx)
+        }
+    }
+
+    @Test
+    fun threePaneScaffold_paneExpansionWithDragHandle_animateToNonExistAnchorThrows() {
+        lateinit var mockPaneExpansionState: PaneExpansionState
+        lateinit var scope: CoroutineScope
+
+        rule.setContentWithSimulatedSize(simulatedWidth = 1024.dp, simulatedHeight = 800.dp) {
+            scope = rememberCoroutineScope()
+            mockPaneExpansionState = rememberPaneExpansionState(anchors = MockPaneExpansionAnchors)
+            SampleThreePaneScaffoldWithPaneExpansion(mockPaneExpansionState) { MockDragHandle(it) }
+        }
+
+        rule.runOnIdle {
+            scope.launch {
+                assertFailsWith<IllegalArgumentException> {
+                    mockPaneExpansionState.animateTo(PaneExpansionAnchor.Offset.fromStart(10.dp))
+                }
+            }
+        }
+    }
 }
 
 private val MockScaffoldDirective = PaneScaffoldDirective.Default
@@ -333,7 +411,7 @@
 private val MockPaneExpansionAnchors =
     listOf(
         PaneExpansionAnchor.Proportion(0f),
-        PaneExpansionAnchor.Offset(MockPaneExpansionMiddleAnchor),
+        PaneExpansionAnchor.Offset.fromStart(MockPaneExpansionMiddleAnchor),
         PaneExpansionAnchor.Proportion(1f),
     )
 
diff --git a/compose/material3/adaptive/adaptive-layout/src/androidMain/kotlin/androidx/compose/material3/adaptive/layout/Strings.android.kt b/compose/material3/adaptive/adaptive-layout/src/androidMain/kotlin/androidx/compose/material3/adaptive/layout/Strings.android.kt
index a563fe9..5bab1c8 100644
--- a/compose/material3/adaptive/adaptive-layout/src/androidMain/kotlin/androidx/compose/material3/adaptive/layout/Strings.android.kt
+++ b/compose/material3/adaptive/adaptive-layout/src/androidMain/kotlin/androidx/compose/material3/adaptive/layout/Strings.android.kt
@@ -59,7 +59,12 @@
             get() =
                 Strings(R.string.m3_adaptive_default_pane_expansion_proportion_anchor_description)
 
-        actual inline val defaultPaneExpansionOffsetAnchorDescription
-            get() = Strings(R.string.m3_adaptive_default_pane_expansion_offset_anchor_description)
+        actual inline val defaultPaneExpansionStartOffsetAnchorDescription
+            get() =
+                Strings(R.string.m3_adaptive_default_pane_expansion_start_offset_anchor_description)
+
+        actual inline val defaultPaneExpansionEndOffsetAnchorDescription
+            get() =
+                Strings(R.string.m3_adaptive_default_pane_expansion_end_offset_anchor_description)
     }
 }
diff --git a/compose/material3/adaptive/adaptive-layout/src/androidMain/res/values-as/strings.xml b/compose/material3/adaptive/adaptive-layout/src/androidMain/res/values-as/strings.xml
index d550f15..120b08a 100644
--- a/compose/material3/adaptive/adaptive-layout/src/androidMain/res/values-as/strings.xml
+++ b/compose/material3/adaptive/adaptive-layout/src/androidMain/res/values-as/strings.xml
@@ -20,5 +20,4 @@
     <string name="m3_adaptive_default_pane_expansion_drag_handle_content_description" msgid="9058489142432490820">"পে’ন সম্প্ৰসাৰণ কৰিবলৈ টনা হেণ্ডেল"</string>
     <string name="m3_adaptive_default_pane_expansion_drag_handle_action_description" msgid="9031621431415014327">"পে’নৰ বিভাজন %sলৈ সলনি কৰক"</string>
     <string name="m3_adaptive_default_pane_expansion_proportion_anchor_description" msgid="1205294531112795522">"%d শতাংশ"</string>
-    <string name="m3_adaptive_default_pane_expansion_offset_anchor_description" msgid="8189074525698747223">"%d DPs"</string>
 </resources>
diff --git a/compose/material3/adaptive/adaptive-layout/src/androidMain/res/values-en-rCA/strings.xml b/compose/material3/adaptive/adaptive-layout/src/androidMain/res/values-en-rCA/strings.xml
index 33e0970..c1e08b3 100644
--- a/compose/material3/adaptive/adaptive-layout/src/androidMain/res/values-en-rCA/strings.xml
+++ b/compose/material3/adaptive/adaptive-layout/src/androidMain/res/values-en-rCA/strings.xml
@@ -20,5 +20,4 @@
     <string name="m3_adaptive_default_pane_expansion_drag_handle_content_description" msgid="9058489142432490820">"Pane expansion drag handle"</string>
     <string name="m3_adaptive_default_pane_expansion_drag_handle_action_description" msgid="9031621431415014327">"Change pane split to %s"</string>
     <string name="m3_adaptive_default_pane_expansion_proportion_anchor_description" msgid="1205294531112795522">"%d percent"</string>
-    <string name="m3_adaptive_default_pane_expansion_offset_anchor_description" msgid="8189074525698747223">"%d DPs"</string>
 </resources>
diff --git a/compose/material3/adaptive/adaptive-layout/src/androidMain/res/values-hi/strings.xml b/compose/material3/adaptive/adaptive-layout/src/androidMain/res/values-hi/strings.xml
index d25df6b..f333cf2 100644
--- a/compose/material3/adaptive/adaptive-layout/src/androidMain/res/values-hi/strings.xml
+++ b/compose/material3/adaptive/adaptive-layout/src/androidMain/res/values-hi/strings.xml
@@ -20,5 +20,4 @@
     <string name="m3_adaptive_default_pane_expansion_drag_handle_content_description" msgid="9058489142432490820">"पैनल को बड़ा करने के लिए, खींचकर छोड़ने वाला हैंडल"</string>
     <string name="m3_adaptive_default_pane_expansion_drag_handle_action_description" msgid="9031621431415014327">"पैनल स्प्लिट को %s में बदलें"</string>
     <string name="m3_adaptive_default_pane_expansion_proportion_anchor_description" msgid="1205294531112795522">"%d प्रतिशत"</string>
-    <string name="m3_adaptive_default_pane_expansion_offset_anchor_description" msgid="8189074525698747223">"%d डीपी"</string>
 </resources>
diff --git a/compose/material3/adaptive/adaptive-layout/src/androidMain/res/values-ja/strings.xml b/compose/material3/adaptive/adaptive-layout/src/androidMain/res/values-ja/strings.xml
index c287ba9..bfbceb0 100644
--- a/compose/material3/adaptive/adaptive-layout/src/androidMain/res/values-ja/strings.xml
+++ b/compose/material3/adaptive/adaptive-layout/src/androidMain/res/values-ja/strings.xml
@@ -20,5 +20,4 @@
     <string name="m3_adaptive_default_pane_expansion_drag_handle_content_description" msgid="9058489142432490820">"ペインの展開のドラッグ ハンドル"</string>
     <string name="m3_adaptive_default_pane_expansion_drag_handle_action_description" msgid="9031621431415014327">"ペインの分割を %s に変更"</string>
     <string name="m3_adaptive_default_pane_expansion_proportion_anchor_description" msgid="1205294531112795522">"%d パーセント"</string>
-    <string name="m3_adaptive_default_pane_expansion_offset_anchor_description" msgid="8189074525698747223">"%d DP"</string>
 </resources>
diff --git a/compose/material3/adaptive/adaptive-layout/src/androidMain/res/values-ka/strings.xml b/compose/material3/adaptive/adaptive-layout/src/androidMain/res/values-ka/strings.xml
index d5cbb1b..f9f4e65 100644
--- a/compose/material3/adaptive/adaptive-layout/src/androidMain/res/values-ka/strings.xml
+++ b/compose/material3/adaptive/adaptive-layout/src/androidMain/res/values-ka/strings.xml
@@ -20,5 +20,4 @@
     <string name="m3_adaptive_default_pane_expansion_drag_handle_content_description" msgid="9058489142432490820">"არეს გაფართოების სახელური ჩავლებისთვის"</string>
     <string name="m3_adaptive_default_pane_expansion_drag_handle_action_description" msgid="9031621431415014327">"არეს გაყოფის შეცვლა %s-ით"</string>
     <string name="m3_adaptive_default_pane_expansion_proportion_anchor_description" msgid="1205294531112795522">"%d პროცენტი"</string>
-    <string name="m3_adaptive_default_pane_expansion_offset_anchor_description" msgid="8189074525698747223">"%d DPs"</string>
 </resources>
diff --git a/compose/material3/adaptive/adaptive-layout/src/androidMain/res/values-ml/strings.xml b/compose/material3/adaptive/adaptive-layout/src/androidMain/res/values-ml/strings.xml
index 0747fcb..2b63179c 100644
--- a/compose/material3/adaptive/adaptive-layout/src/androidMain/res/values-ml/strings.xml
+++ b/compose/material3/adaptive/adaptive-layout/src/androidMain/res/values-ml/strings.xml
@@ -20,5 +20,4 @@
     <string name="m3_adaptive_default_pane_expansion_drag_handle_content_description" msgid="9058489142432490820">"പെയിൻ വികസിപ്പിക്കാനായി വലിച്ചിടുന്നതിനുള്ള ഹാൻഡിൽ"</string>
     <string name="m3_adaptive_default_pane_expansion_drag_handle_action_description" msgid="9031621431415014327">"പെയിൻ വിഭജനം %s ആയി മാറ്റുക"</string>
     <string name="m3_adaptive_default_pane_expansion_proportion_anchor_description" msgid="1205294531112795522">"%d ശതമാനം"</string>
-    <string name="m3_adaptive_default_pane_expansion_offset_anchor_description" msgid="8189074525698747223">"%d DP-കൾ"</string>
 </resources>
diff --git a/compose/material3/adaptive/adaptive-layout/src/androidMain/res/values-ms/strings.xml b/compose/material3/adaptive/adaptive-layout/src/androidMain/res/values-ms/strings.xml
index 81f4fb8..889db66e 100644
--- a/compose/material3/adaptive/adaptive-layout/src/androidMain/res/values-ms/strings.xml
+++ b/compose/material3/adaptive/adaptive-layout/src/androidMain/res/values-ms/strings.xml
@@ -20,5 +20,4 @@
     <string name="m3_adaptive_default_pane_expansion_drag_handle_content_description" msgid="9058489142432490820">"Pemegang seret pengembangan anak tetingkap"</string>
     <string name="m3_adaptive_default_pane_expansion_drag_handle_action_description" msgid="9031621431415014327">"Tukar anak tetingkap terpisah kepada %s"</string>
     <string name="m3_adaptive_default_pane_expansion_proportion_anchor_description" msgid="1205294531112795522">"%d peratus"</string>
-    <string name="m3_adaptive_default_pane_expansion_offset_anchor_description" msgid="8189074525698747223">"%d DP"</string>
 </resources>
diff --git a/compose/material3/adaptive/adaptive-layout/src/androidMain/res/values-pl/strings.xml b/compose/material3/adaptive/adaptive-layout/src/androidMain/res/values-pl/strings.xml
index 19a0cd0..ec85843 100644
--- a/compose/material3/adaptive/adaptive-layout/src/androidMain/res/values-pl/strings.xml
+++ b/compose/material3/adaptive/adaptive-layout/src/androidMain/res/values-pl/strings.xml
@@ -20,5 +20,4 @@
     <string name="m3_adaptive_default_pane_expansion_drag_handle_content_description" msgid="9058489142432490820">"Uchwyt do przeciągania panelu"</string>
     <string name="m3_adaptive_default_pane_expansion_drag_handle_action_description" msgid="9031621431415014327">"Zmień podział panelu na %s"</string>
     <string name="m3_adaptive_default_pane_expansion_proportion_anchor_description" msgid="1205294531112795522">"%d procent"</string>
-    <string name="m3_adaptive_default_pane_expansion_offset_anchor_description" msgid="8189074525698747223">"%d DP"</string>
 </resources>
diff --git a/compose/material3/adaptive/adaptive-layout/src/androidMain/res/values-pt-rPT/strings.xml b/compose/material3/adaptive/adaptive-layout/src/androidMain/res/values-pt-rPT/strings.xml
index 2dae797..115f3c0 100644
--- a/compose/material3/adaptive/adaptive-layout/src/androidMain/res/values-pt-rPT/strings.xml
+++ b/compose/material3/adaptive/adaptive-layout/src/androidMain/res/values-pt-rPT/strings.xml
@@ -20,5 +20,4 @@
     <string name="m3_adaptive_default_pane_expansion_drag_handle_content_description" msgid="9058489142432490820">"Indicador para arrastar de expansão do painel"</string>
     <string name="m3_adaptive_default_pane_expansion_drag_handle_action_description" msgid="9031621431415014327">"Altere a divisão do painel para %s"</string>
     <string name="m3_adaptive_default_pane_expansion_proportion_anchor_description" msgid="1205294531112795522">"%d por cento"</string>
-    <string name="m3_adaptive_default_pane_expansion_offset_anchor_description" msgid="8189074525698747223">"%d DPs"</string>
 </resources>
diff --git a/compose/material3/adaptive/adaptive-layout/src/androidMain/res/values/strings.xml b/compose/material3/adaptive/adaptive-layout/src/androidMain/res/values/strings.xml
index 38b807f..94e3ffa 100644
--- a/compose/material3/adaptive/adaptive-layout/src/androidMain/res/values/strings.xml
+++ b/compose/material3/adaptive/adaptive-layout/src/androidMain/res/values/strings.xml
@@ -28,7 +28,14 @@
     <string name="m3_adaptive_default_pane_expansion_proportion_anchor_description">
         %d percent
     </string>
-    <!-- Spoken description of a pane expansion anchor point based on offset in DPs a user can
-         anchor the pane expansion to. -->
-    <string name="m3_adaptive_default_pane_expansion_offset_anchor_description">%d DPs</string>
+    <!-- Spoken description of a pane expansion anchor point based on offset from start in DPs a
+         user can anchor the pane expansion to. -->
+    <string name="m3_adaptive_default_pane_expansion_start_offset_anchor_description">
+        %d DPs from start
+    </string>
+    <!-- Spoken description of a pane expansion anchor point based on offset from end in DPs a user
+         can anchor the pane expansion to. -->
+    <string name="m3_adaptive_default_pane_expansion_end_offset_anchor_description">
+        %d DPs from end
+    </string>
 </resources>
diff --git a/compose/material3/adaptive/adaptive-layout/src/androidUnitTest/kotlin/androidx/compose/material3/adaptive/layout/PaneMotionTest.kt b/compose/material3/adaptive/adaptive-layout/src/androidUnitTest/kotlin/androidx/compose/material3/adaptive/layout/PaneMotionTest.kt
index a32b7ec..0355530 100644
--- a/compose/material3/adaptive/adaptive-layout/src/androidUnitTest/kotlin/androidx/compose/material3/adaptive/layout/PaneMotionTest.kt
+++ b/compose/material3/adaptive/adaptive-layout/src/androidUnitTest/kotlin/androidx/compose/material3/adaptive/layout/PaneMotionTest.kt
@@ -83,12 +83,21 @@
         expectedEnterTransition: EnterTransition,
         expectedExitTransition: ExitTransition
     ) {
+        mockPaneScaffoldMotionDataProvider.updateMotions(this, NoMotion, NoMotion)
         // Can't compare equality directly because of lambda. Check string representation instead
         assertWithMessage("Enter transition of $this: ")
-            .that(mockPaneScaffoldMotionDataProvider.enterTransition.toString())
+            .that(
+                mockPaneScaffoldMotionDataProvider
+                    .calculateDefaultEnterTransition(ThreePaneScaffoldRole.Primary)
+                    .toString()
+            )
             .isEqualTo(expectedEnterTransition.toString())
         assertWithMessage("Exit transition of $this: ")
-            .that(mockPaneScaffoldMotionDataProvider.exitTransition.toString())
+            .that(
+                mockPaneScaffoldMotionDataProvider
+                    .calculateDefaultExitTransition(ThreePaneScaffoldRole.Primary)
+                    .toString()
+            )
             .isEqualTo(expectedExitTransition.toString())
     }
 
@@ -274,6 +283,32 @@
                     mockPaneScaffoldMotionDataProvider[1].currentLeft
             )
     }
+
+    @Test
+    fun hiddenPaneCurrentLeft_useRightEdgeOfLeftShownPane() {
+        mockPaneScaffoldMotionDataProvider.updateMotions(
+            ExitToLeft,
+            EnterFromRight,
+            EnterWithExpand
+        )
+        assertThat(
+                mockPaneScaffoldMotionDataProvider.getHiddenPaneCurrentLeft(
+                    ThreePaneScaffoldRole.Tertiary
+                )
+            )
+            .isEqualTo(mockPaneScaffoldMotionDataProvider[0].currentRight)
+    }
+
+    @Test
+    fun hidingPaneTargetLeft_useRightEdgeOfLeftShowingPane() {
+        mockPaneScaffoldMotionDataProvider.updateMotions(EnterFromLeft, ExitToRight, ExitWithShrink)
+        assertThat(
+                mockPaneScaffoldMotionDataProvider.getHidingPaneTargetLeft(
+                    ThreePaneScaffoldRole.Tertiary
+                )
+            )
+            .isEqualTo(mockPaneScaffoldMotionDataProvider[0].targetRight)
+    }
 }
 
 @OptIn(ExperimentalMaterial3AdaptiveApi::class)
@@ -471,8 +506,10 @@
 
 @OptIn(ExperimentalMaterial3AdaptiveApi::class)
 private val mockEnterWithExpandTransition =
-    expandHorizontally(PaneMotionDefaults.SizeAnimationSpec, Alignment.CenterHorizontally)
+    expandHorizontally(PaneMotionDefaults.SizeAnimationSpec, Alignment.CenterHorizontally) +
+        slideInHorizontally(PaneMotionDefaults.OffsetAnimationSpec)
 
 @OptIn(ExperimentalMaterial3AdaptiveApi::class)
 private val mockExitWithShrinkTransition =
-    shrinkHorizontally(PaneMotionDefaults.SizeAnimationSpec, Alignment.CenterHorizontally)
+    shrinkHorizontally(PaneMotionDefaults.SizeAnimationSpec, Alignment.CenterHorizontally) +
+        slideOutHorizontally(PaneMotionDefaults.OffsetAnimationSpec)
diff --git a/compose/material3/adaptive/adaptive-layout/src/commonMain/kotlin/androidx/compose/material3/adaptive/layout/Pane.kt b/compose/material3/adaptive/adaptive-layout/src/commonMain/kotlin/androidx/compose/material3/adaptive/layout/Pane.kt
index 862c541..49dd66a 100644
--- a/compose/material3/adaptive/adaptive-layout/src/commonMain/kotlin/androidx/compose/material3/adaptive/layout/Pane.kt
+++ b/compose/material3/adaptive/adaptive-layout/src/commonMain/kotlin/androidx/compose/material3/adaptive/layout/Pane.kt
@@ -93,8 +93,8 @@
 @Composable
 fun <S, T : PaneScaffoldValue<S>> ExtendedPaneScaffoldPaneScope<S, T>.AnimatedPane(
     modifier: Modifier = Modifier,
-    enterTransition: EnterTransition = paneMotion.enterTransition,
-    exitTransition: ExitTransition = paneMotion.exitTransition,
+    enterTransition: EnterTransition = motionDataProvider.calculateDefaultEnterTransition(paneRole),
+    exitTransition: ExitTransition = motionDataProvider.calculateDefaultExitTransition(paneRole),
     boundsAnimationSpec: FiniteAnimationSpec<IntRect> = PaneMotionDefaults.AnimationSpec,
     content: (@Composable AnimatedPaneScope.() -> Unit),
 ) {
diff --git a/compose/material3/adaptive/adaptive-layout/src/commonMain/kotlin/androidx/compose/material3/adaptive/layout/PaneAdaptedValue.kt b/compose/material3/adaptive/adaptive-layout/src/commonMain/kotlin/androidx/compose/material3/adaptive/layout/PaneAdaptedValue.kt
index 00deed0..080903b 100644
--- a/compose/material3/adaptive/adaptive-layout/src/commonMain/kotlin/androidx/compose/material3/adaptive/layout/PaneAdaptedValue.kt
+++ b/compose/material3/adaptive/adaptive-layout/src/commonMain/kotlin/androidx/compose/material3/adaptive/layout/PaneAdaptedValue.kt
@@ -16,13 +16,10 @@
 
 package androidx.compose.material3.adaptive.layout
 
-import androidx.compose.material3.adaptive.ExperimentalMaterial3AdaptiveApi
-
 /**
  * The adapted state of a pane. It gives clues to pane scaffolds about if a certain pane should be
  * composed and how.
  */
-@ExperimentalMaterial3AdaptiveApi
 @JvmInline
 value class PaneAdaptedValue private constructor(private val description: String) {
     companion object {
diff --git a/compose/material3/adaptive/adaptive-layout/src/commonMain/kotlin/androidx/compose/material3/adaptive/layout/PaneExpansionState.kt b/compose/material3/adaptive/adaptive-layout/src/commonMain/kotlin/androidx/compose/material3/adaptive/layout/PaneExpansionState.kt
index 910b42e7..733dc1f 100644
--- a/compose/material3/adaptive/adaptive-layout/src/commonMain/kotlin/androidx/compose/material3/adaptive/layout/PaneExpansionState.kt
+++ b/compose/material3/adaptive/adaptive-layout/src/commonMain/kotlin/androidx/compose/material3/adaptive/layout/PaneExpansionState.kt
@@ -222,8 +222,14 @@
             currentMeasuredDraggingOffset = coercedValue
         }
 
-    @VisibleForTesting
-    internal var currentAnchor
+    /**
+     * The current anchor that pane expansion has been settled or is settling to. Note that this
+     * field might be `null` if:
+     * 1. No anchors have been set to the state.
+     * 2. Pane expansion is set directly via [setFirstPaneWidth] or set [setFirstPaneProportion].
+     * 3. Pane expansion is in its initial state without an initial anchor provided.
+     */
+    var currentAnchor
         get() = data.currentAnchorState
         private set(value) {
             data.currentAnchorState = value
@@ -335,6 +341,7 @@
         data.firstPaneProportionState = Float.NaN
         data.currentDraggingOffsetState = Unspecified
         data.firstPaneWidthState = firstPaneWidth
+        currentAnchor = null
     }
 
     /**
@@ -351,6 +358,24 @@
         data.firstPaneWidthState = Unspecified
         data.currentDraggingOffsetState = Unspecified
         data.firstPaneProportionState = firstPaneProportion
+        currentAnchor = null
+    }
+
+    /**
+     * Animate the pane expansion to the given [PaneExpansionAnchor]. Note that the given anchor
+     * must be one of the provided anchor when creating the state with [rememberPaneExpansionState];
+     * otherwise the function throws.
+     *
+     * @param anchor the anchor to animate to
+     * @param initialVelocity the initial velocity of the animation
+     */
+    suspend fun animateTo(anchor: PaneExpansionAnchor, initialVelocity: Float = 0F) {
+        require(anchors.contains(anchor)) { "The provided $anchor is not in the anchor list!" }
+        currentAnchor = anchor
+        measuredDensity?.apply {
+            val position = anchor.positionIn(maxExpansionWidth, this)
+            animateToInternal(position, initialVelocity)
+        }
     }
 
     /**
@@ -377,11 +402,11 @@
                     anchors.toPositions(
                         // When maxExpansionWidth is updated, the anchor positions will be
                         // recalculated.
-                        Snapshot.withoutReadObservation { maxExpansionWidth },
+                        maxExpansionWidth,
                         it
                     )
             }
-            if (!anchors.contains(Snapshot.withoutReadObservation { currentAnchor })) {
+            if (!anchors.contains(currentAnchor)) {
                 currentAnchor = null
             }
             this.anchoringAnimationSpec = anchoringAnimationSpec
@@ -426,30 +451,39 @@
         }
 
         dragMutex.mutate(MutatePriority.PreventUserInput) {
-            isSettling = true
-            val leftVelocity = flingBehavior.run { dragScope.performFling(velocity) }
-            val anchorPosition =
-                measuredAnchorPositions.getPositionOfTheClosestAnchor(
-                    currentMeasuredDraggingOffset,
-                    leftVelocity
-                )
             try {
+                isSettling = true
+                val leftVelocity = flingBehavior.run { dragScope.performFling(velocity) }
+                val anchorPosition =
+                    measuredAnchorPositions.getPositionOfTheClosestAnchor(
+                        currentMeasuredDraggingOffset,
+                        leftVelocity
+                    )
                 currentAnchor = anchors[anchorPosition.index]
-                animate(
-                    currentMeasuredDraggingOffset.toFloat(),
-                    anchorPosition.position.toFloat(),
-                    leftVelocity,
-                    anchoringAnimationSpec,
-                ) { value, _ ->
-                    currentDraggingOffset = value.toInt()
-                }
+                animateToInternal(anchorPosition.position, leftVelocity)
             } finally {
-                currentDraggingOffset = anchorPosition.position
                 isSettling = false
             }
         }
     }
 
+    private suspend fun animateToInternal(offset: Int, initialVelocity: Float) {
+        try {
+            isSettling = true
+            animate(
+                currentMeasuredDraggingOffset.toFloat(),
+                offset.toFloat(),
+                initialVelocity,
+                anchoringAnimationSpec,
+            ) { value, _ ->
+                currentDraggingOffset = value.toInt()
+            }
+        } finally {
+            currentDraggingOffset = offset
+            isSettling = false
+        }
+    }
+
     private fun IndexedAnchorPositionList.getPositionOfTheClosestAnchor(
         currentPosition: Int,
         velocity: Float
@@ -554,7 +588,10 @@
      * [PaneExpansionAnchor] implementation that specifies the anchor position in the proportion of
      * the total size of the layout at the start side of the anchor.
      *
-     * @property proportion the proportion of the layout at the start side of the anchor. layout.
+     * @param proportion the proportion of the layout at the start side of the anchor. For example,
+     *   if the current layout from the start to the end is list-detail, when the proportion value
+     *   is 0.3 and this anchor is used, the list pane will occupy 30% of the layout and the detail
+     *   pane will occupy 70% of it.
      */
     class Proportion(@FloatRange(0.0, 1.0) val proportion: Float) : PaneExpansionAnchor() {
         override val type = ProportionType
@@ -582,40 +619,107 @@
     }
 
     /**
-     * [PaneExpansionAnchor] implementation that specifies the anchor position in the offset in
-     * [Dp]. If a positive value is provided, the offset will be treated as a start offset, on the
-     * other hand, if a negative value is provided, the absolute value of the provided offset will
-     * be used as an end offset. For example, if -150.dp is provided, the resulted anchor will be at
-     * the position that is 150dp away from the end side of the associated layout.
+     * [PaneExpansionAnchor] implementation that specifies the anchor position based on the offset
+     * in [Dp].
      *
      * @property offset the offset of the anchor in [Dp].
      */
-    class Offset(val offset: Dp) : PaneExpansionAnchor() {
-        override val type = OffsetType
-
-        override val description
-            @Composable
-            get() =
-                getString(Strings.defaultPaneExpansionOffsetAnchorDescription, offset.value.toInt())
-
-        override fun positionIn(totalSizePx: Int, density: Density) =
-            with(density) { offset.toPx() }.toInt().let { if (it < 0) totalSizePx + it else it }
+    abstract class Offset internal constructor(val offset: Dp, override internal val type: Int) :
+        PaneExpansionAnchor() {
+        /**
+         * Indicates the direction of the offset.
+         *
+         * @see Direction.FromStart
+         * @see Direction.FromEnd
+         */
+        val direction: Direction = Direction(type)
 
         override fun equals(other: Any?): Boolean {
             if (this === other) return true
             if (other !is Offset) return false
-            return offset == other.offset
+            return offset == other.offset && direction == other.direction
         }
 
         override fun hashCode(): Int {
-            return offset.hashCode()
+            return offset.hashCode() * 31 + direction.hashCode()
+        }
+
+        /** Represents the direction from where the offset will be calculated. */
+        @JvmInline
+        value class Direction internal constructor(internal val value: Int) {
+            companion object {
+                /**
+                 * Indicates the offset will be calculated from the start. For example, if the
+                 * offset is 150.dp, the resulted anchor will be at the position that is 150dp away
+                 * from the start side of the associated layout.
+                 */
+                val FromStart = Direction(OffsetFromStartType)
+
+                /**
+                 * Indicates the offset will be calculated from the end. For example, if the offset
+                 * is 150.dp, the resulted anchor will be at the position that is 150dp away from
+                 * the end side of the associated layout.
+                 */
+                val FromEnd = Direction(OffsetFromEndType)
+            }
+        }
+
+        private class StartOffset(offset: Dp) : Offset(offset, OffsetFromStartType) {
+            override val description
+                @Composable
+                get() =
+                    getString(
+                        Strings.defaultPaneExpansionStartOffsetAnchorDescription,
+                        offset.value.toInt()
+                    )
+
+            override fun positionIn(totalSizePx: Int, density: Density) =
+                with(density) { offset.roundToPx() }
+        }
+
+        private class EndOffset(offset: Dp) : Offset(offset, OffsetFromEndType) {
+            override val description
+                @Composable
+                get() =
+                    getString(
+                        Strings.defaultPaneExpansionEndOffsetAnchorDescription,
+                        offset.value.toInt()
+                    )
+
+            override fun positionIn(totalSizePx: Int, density: Density) =
+                totalSizePx - with(density) { offset.roundToPx() }
+        }
+
+        companion object {
+            /**
+             * Create an [androidx.compose.material3.adaptive.layout.PaneExpansionAnchor.Offset]
+             * anchor from the start side of the layout.
+             *
+             * @param offset offset to be used in [Dp].
+             */
+            fun fromStart(offset: Dp): Offset {
+                require(offset >= 0.dp) { "Offset must larger than or equal to 0 dp." }
+                return StartOffset(offset)
+            }
+
+            /**
+             * Create an [androidx.compose.material3.adaptive.layout.PaneExpansionAnchor.Offset]
+             * anchor from the end side of the layout.
+             *
+             * @param offset offset to be used in [Dp].
+             */
+            fun fromEnd(offset: Dp): Offset {
+                require(offset >= 0.dp) { "Offset must larger than or equal to 0 dp." }
+                return EndOffset(offset)
+            }
         }
     }
 
     internal companion object {
         internal const val UnspecifiedType = 0
         internal const val ProportionType = 1
-        internal const val OffsetType = 2
+        internal const val OffsetFromStartType = 2
+        internal const val OffsetFromEndType = 3
     }
 }
 
@@ -691,8 +795,10 @@
                 when (currentAnchorType) {
                     PaneExpansionAnchor.ProportionType ->
                         PaneExpansionAnchor.Proportion(it[6] as Float)
-                    PaneExpansionAnchor.OffsetType ->
-                        PaneExpansionAnchor.Offset((it[6] as Float).dp)
+                    PaneExpansionAnchor.OffsetFromStartType ->
+                        PaneExpansionAnchor.Offset.fromStart((it[6] as Float).dp)
+                    PaneExpansionAnchor.OffsetFromEndType ->
+                        PaneExpansionAnchor.Offset.fromEnd((it[6] as Float).dp)
                     else -> null
                 }
             object : Map.Entry<PaneExpansionStateKey, PaneExpansionStateData> {
diff --git a/compose/material3/adaptive/adaptive-layout/src/commonMain/kotlin/androidx/compose/material3/adaptive/layout/PaneMotion.kt b/compose/material3/adaptive/adaptive-layout/src/commonMain/kotlin/androidx/compose/material3/adaptive/layout/PaneMotion.kt
index d1c2452..984a3f89 100644
--- a/compose/material3/adaptive/adaptive-layout/src/commonMain/kotlin/androidx/compose/material3/adaptive/layout/PaneMotion.kt
+++ b/compose/material3/adaptive/adaptive-layout/src/commonMain/kotlin/androidx/compose/material3/adaptive/layout/PaneMotion.kt
@@ -31,6 +31,8 @@
 import androidx.compose.animation.slideInHorizontally
 import androidx.compose.animation.slideOutHorizontally
 import androidx.compose.material3.adaptive.ExperimentalMaterial3AdaptiveApi
+import androidx.compose.runtime.Immutable
+import androidx.compose.runtime.Stable
 import androidx.compose.ui.Alignment
 import androidx.compose.ui.unit.IntOffset
 import androidx.compose.ui.unit.IntRect
@@ -350,15 +352,101 @@
         return 0
     }
 
+@OptIn(ExperimentalMaterial3AdaptiveApi::class)
+@VisibleForTesting
+internal fun <Role> PaneScaffoldMotionDataProvider<Role>.getHiddenPaneCurrentLeft(role: Role): Int {
+    var currentLeft = 0
+    forEach { paneRole, data ->
+        // Find the right edge of the shown pane next to the left.
+        if (paneRole == role) {
+            return currentLeft
+        }
+        if (
+            data.motion.type == PaneMotion.Type.Shown || data.motion.type == PaneMotion.Type.Exiting
+        ) {
+            currentLeft = data.currentRight
+        }
+    }
+    return currentLeft
+}
+
+@OptIn(ExperimentalMaterial3AdaptiveApi::class)
+@VisibleForTesting
+internal fun <Role> PaneScaffoldMotionDataProvider<Role>.getHidingPaneTargetLeft(role: Role): Int {
+    var targetLeft = 0
+    forEach { paneRole, data ->
+        // Find the right edge of the shown pane next to the left.
+        if (paneRole == role) {
+            return targetLeft
+        }
+        if (
+            data.motion.type == PaneMotion.Type.Shown ||
+                data.motion.type == PaneMotion.Type.Entering
+        ) {
+            targetLeft = data.targetRight
+        }
+    }
+    return targetLeft
+}
+
+/**
+ * Calculates the default [EnterTransition] of the pane associated to the given role when it's
+ * showing. The [PaneMotion] and pane measurement data provided by [PaneScaffoldMotionDataProvider]
+ * will be used to decide the transition type and relevant values like sliding offsets.
+ *
+ * @param role the role of the pane that is supposed to perform the [EnterTransition] when showing.
+ */
+@ExperimentalMaterial3AdaptiveApi
+fun <Role> PaneScaffoldMotionDataProvider<Role>.calculateDefaultEnterTransition(role: Role) =
+    when (this[role].motion) {
+        PaneMotion.EnterFromLeft ->
+            slideInHorizontally(PaneMotionDefaults.OffsetAnimationSpec) { slideInFromLeftOffset }
+        PaneMotion.EnterFromLeftDelayed ->
+            slideInHorizontally(PaneMotionDefaults.DelayedOffsetAnimationSpec) {
+                slideInFromLeftOffset
+            }
+        PaneMotion.EnterFromRight ->
+            slideInHorizontally(PaneMotionDefaults.OffsetAnimationSpec) { slideInFromRightOffset }
+        PaneMotion.EnterFromRightDelayed ->
+            slideInHorizontally(PaneMotionDefaults.DelayedOffsetAnimationSpec) {
+                slideInFromRightOffset
+            }
+        PaneMotion.EnterWithExpand -> {
+            expandHorizontally(PaneMotionDefaults.SizeAnimationSpec, Alignment.CenterHorizontally) +
+                slideInHorizontally(PaneMotionDefaults.OffsetAnimationSpec) {
+                    getHiddenPaneCurrentLeft(role) - this[role].targetLeft
+                }
+        }
+        else -> EnterTransition.None
+    }
+
+/**
+ * Calculates the default [ExitTransition] of the pane associated to the given role when it's
+ * hiding. The [PaneMotion] and pane measurement data provided by [PaneScaffoldMotionDataProvider]
+ * will be used to decide the transition type and relevant values like sliding offsets.
+ *
+ * @param role the role of the pane that is supposed to perform the [ExitTransition] when hiding.
+ */
+@ExperimentalMaterial3AdaptiveApi
+fun <Role> PaneScaffoldMotionDataProvider<Role>.calculateDefaultExitTransition(role: Role) =
+    when (this[role].motion) {
+        PaneMotion.ExitToLeft ->
+            slideOutHorizontally(PaneMotionDefaults.OffsetAnimationSpec) { slideOutToLeftOffset }
+        PaneMotion.ExitToRight ->
+            slideOutHorizontally(PaneMotionDefaults.OffsetAnimationSpec) { slideOutToRightOffset }
+        PaneMotion.ExitWithShrink -> {
+            shrinkHorizontally(PaneMotionDefaults.SizeAnimationSpec, Alignment.CenterHorizontally) +
+                slideOutHorizontally(PaneMotionDefaults.OffsetAnimationSpec) {
+                    getHidingPaneTargetLeft(role) - this[role].currentLeft
+                }
+        }
+        else -> ExitTransition.None
+    }
+
 /** Interface to specify a custom pane enter/exit motion when a pane's visibility changes. */
 @ExperimentalMaterial3AdaptiveApi
-interface PaneMotion {
-    /** The [EnterTransition] of a pane under the given [PaneScaffoldMotionDataProvider]. */
-    val PaneScaffoldMotionDataProvider<*>.enterTransition: EnterTransition
-
-    /** The [ExitTransition] of a pane under the given [PaneScaffoldMotionDataProvider]. */
-    val PaneScaffoldMotionDataProvider<*>.exitTransition: ExitTransition
-
+@Stable
+sealed interface PaneMotion {
     /** The type of the motion, like exiting, entering, etc. See [Type]. */
     val type: Type
 
@@ -405,138 +493,73 @@
         }
     }
 
-    private abstract class DefaultImpl(val name: String, override val type: Type) : PaneMotion {
-        override val PaneScaffoldMotionDataProvider<*>.enterTransition
-            get() = EnterTransition.None
-
-        override val PaneScaffoldMotionDataProvider<*>.exitTransition
-            get() = ExitTransition.None
-
+    @Immutable
+    private class DefaultImpl(val name: String, override val type: Type) : PaneMotion {
         override fun toString() = name
     }
 
     companion object {
         /** The default pane motion that no animation will be performed. */
-        val NoMotion: PaneMotion = object : DefaultImpl("NoMotion", Type.Hidden) {}
+        val NoMotion: PaneMotion = DefaultImpl("NoMotion", Type.Hidden)
 
         /**
          * The default pane motion that will animate panes bounds with the given animation specs
          * during motion. Note that this should only be used when the associated pane is keeping
          * showing during the motion.
          */
-        val AnimateBounds: PaneMotion = object : DefaultImpl("AnimateBounds", Type.Shown) {}
+        val AnimateBounds: PaneMotion = DefaultImpl("AnimateBounds", Type.Shown)
 
         /**
          * The default pane motion that will slide panes in from left. Note that this should only be
          * used when the associated pane is entering - i.e. becoming visible from a hidden state.
          */
-        val EnterFromLeft: PaneMotion =
-            object : DefaultImpl("EnterFromLeft", Type.Entering) {
-                override val PaneScaffoldMotionDataProvider<*>.enterTransition
-                    get() =
-                        slideInHorizontally(PaneMotionDefaults.OffsetAnimationSpec) {
-                            slideInFromLeftOffset
-                        }
-            }
+        val EnterFromLeft: PaneMotion = DefaultImpl("EnterFromLeft", Type.Entering)
 
         /**
          * The default pane motion that will slide panes in from right. Note that this should only
          * be used when the associated pane is entering - i.e. becoming visible from a hidden state.
          */
-        val EnterFromRight: PaneMotion =
-            object : DefaultImpl("EnterFromRight", Type.Entering) {
-                override val PaneScaffoldMotionDataProvider<*>.enterTransition
-                    get() =
-                        slideInHorizontally(PaneMotionDefaults.OffsetAnimationSpec) {
-                            slideInFromRightOffset
-                        }
-            }
+        val EnterFromRight: PaneMotion = DefaultImpl("EnterFromRight", Type.Entering)
 
         /**
          * The default pane motion that will slide panes in from left with a delay, usually to avoid
          * the interference of other exiting panes. Note that this should only be used when the
          * associated pane is entering - i.e. becoming visible from a hidden state.
          */
-        val EnterFromLeftDelayed: PaneMotion =
-            object : DefaultImpl("EnterFromLeftDelayed", Type.Entering) {
-                override val PaneScaffoldMotionDataProvider<*>.enterTransition
-                    get() =
-                        slideInHorizontally(PaneMotionDefaults.DelayedOffsetAnimationSpec) {
-                            slideInFromLeftOffset
-                        }
-            }
+        val EnterFromLeftDelayed: PaneMotion = DefaultImpl("EnterFromLeftDelayed", Type.Entering)
 
         /**
          * The default pane motion that will slide panes in from right with a delay, usually to
          * avoid the interference of other exiting panes. Note that this should only be used when
          * the associated pane is entering - i.e. becoming visible from a hidden state.
          */
-        val EnterFromRightDelayed: PaneMotion =
-            object : DefaultImpl("EnterFromRightDelayed", Type.Entering) {
-                override val PaneScaffoldMotionDataProvider<*>.enterTransition
-                    get() =
-                        slideInHorizontally(PaneMotionDefaults.DelayedOffsetAnimationSpec) {
-                            slideInFromRightOffset
-                        }
-            }
+        val EnterFromRightDelayed: PaneMotion = DefaultImpl("EnterFromRightDelayed", Type.Entering)
 
         /**
          * The default pane motion that will slide panes out to left. Note that this should only be
          * used when the associated pane is exiting - i.e. becoming hidden from a visible state.
          */
-        val ExitToLeft: PaneMotion =
-            object : DefaultImpl("ExitToLeft", Type.Exiting) {
-                override val PaneScaffoldMotionDataProvider<*>.exitTransition
-                    get() =
-                        slideOutHorizontally(PaneMotionDefaults.OffsetAnimationSpec) {
-                            slideOutToLeftOffset
-                        }
-            }
+        val ExitToLeft: PaneMotion = DefaultImpl("ExitToLeft", Type.Exiting)
 
         /**
          * The default pane motion that will slide panes out to right. Note that this should only be
          * used when the associated pane is exiting - i.e. becoming hidden from a visible state.
          */
-        val ExitToRight: PaneMotion =
-            object : DefaultImpl("ExitToRight", Type.Exiting) {
-                override val PaneScaffoldMotionDataProvider<*>.exitTransition
-                    get() =
-                        slideOutHorizontally(PaneMotionDefaults.OffsetAnimationSpec) {
-                            slideOutToRightOffset
-                        }
-            }
+        val ExitToRight: PaneMotion = DefaultImpl("ExitToRight", Type.Exiting)
 
         /**
          * The default pane motion that will expand panes from a zero size. Note that this should
          * only be used when the associated pane is entering - i.e. becoming visible from a hidden
          * state.
          */
-        val EnterWithExpand: PaneMotion =
-            object : DefaultImpl("EnterWithExpand", Type.Entering) {
-                // TODO(conradchen): Expand with position change
-                override val PaneScaffoldMotionDataProvider<*>.enterTransition
-                    get() =
-                        expandHorizontally(
-                            PaneMotionDefaults.SizeAnimationSpec,
-                            Alignment.CenterHorizontally
-                        )
-            }
+        val EnterWithExpand: PaneMotion = DefaultImpl("EnterWithExpand", Type.Entering)
 
         /**
          * The default pane motion that will shrink panes until it's gone. Note that this should
          * only be used when the associated pane is exiting - i.e. becoming hidden from a visible
          * state.
          */
-        val ExitWithShrink: PaneMotion =
-            object : DefaultImpl("ExitWithShrink", Type.Exiting) {
-                // TODO(conradchen): Shrink with position change
-                override val PaneScaffoldMotionDataProvider<*>.exitTransition
-                    get() =
-                        shrinkHorizontally(
-                            PaneMotionDefaults.SizeAnimationSpec,
-                            Alignment.CenterHorizontally
-                        )
-            }
+        val ExitWithShrink: PaneMotion = DefaultImpl("ExitWithShrink", Type.Exiting)
     }
 }
 
diff --git a/compose/material3/adaptive/adaptive-layout/src/commonMain/kotlin/androidx/compose/material3/adaptive/layout/PaneScaffold.kt b/compose/material3/adaptive/adaptive-layout/src/commonMain/kotlin/androidx/compose/material3/adaptive/layout/PaneScaffold.kt
index df9e946..0607f9f 100644
--- a/compose/material3/adaptive/adaptive-layout/src/commonMain/kotlin/androidx/compose/material3/adaptive/layout/PaneScaffold.kt
+++ b/compose/material3/adaptive/adaptive-layout/src/commonMain/kotlin/androidx/compose/material3/adaptive/layout/PaneScaffold.kt
@@ -17,7 +17,6 @@
 package androidx.compose.material3.adaptive.layout
 
 import androidx.annotation.FloatRange
-import androidx.compose.animation.EnterTransition
 import androidx.compose.animation.core.Transition
 import androidx.compose.foundation.interaction.MutableInteractionSource
 import androidx.compose.material3.adaptive.ExperimentalMaterial3AdaptiveApi
@@ -32,7 +31,7 @@
 import androidx.compose.ui.unit.Density
 import androidx.compose.ui.unit.Dp
 import androidx.compose.ui.unit.dp
-import androidx.compose.ui.util.fastMaxOfOrNull
+import androidx.compose.ui.unit.isSpecified
 
 /**
  * Extended scope for the panes of pane scaffolds. All pane scaffolds will implement this interface
@@ -125,24 +124,6 @@
      * behavior.
      */
     val motionDataProvider: PaneScaffoldMotionDataProvider<Role>
-
-    /**
-     * A convenient function to get the given [PaneMotion]'s [EnterTransition] under the context of
-     * the current [PaneScaffoldTransitionScope].
-     *
-     * @see [PaneMotion.enterTransition]
-     */
-    val PaneMotion.enterTransition
-        get() = with(this) { motionDataProvider.enterTransition }
-
-    /**
-     * A convenient function to get the given [PaneMotion]'s [EnterTransition] under the context of
-     * the current [PaneScaffoldTransitionScope].
-     *
-     * @see [PaneMotion.exitTransition]
-     */
-    val PaneMotion.exitTransition
-        get() = with(this) { motionDataProvider.exitTransition }
 }
 
 /**
@@ -240,17 +221,11 @@
 }
 
 @OptIn(ExperimentalMaterial3AdaptiveApi::class)
-internal val List<Measurable>.minTouchTargetSize: Dp
-    get() =
-        fastMaxOfOrNull {
-            val size =
-                (it.parentData as? PaneScaffoldParentData)?.minTouchTargetSize ?: Dp.Unspecified
-            if (size == Dp.Unspecified) {
-                0.dp
-            } else {
-                size
-            }
-        } ?: 0.dp
+internal val Measurable.minTouchTargetSize: Dp
+    get() {
+        val size = (parentData as? PaneScaffoldParentData)?.minTouchTargetSize ?: Dp.Unspecified
+        return if (size.isSpecified) size else 0.dp
+    }
 
 /**
  * The parent data passed to pane scaffolds by their contents like panes and drag handles.
diff --git a/compose/material3/adaptive/adaptive-layout/src/commonMain/kotlin/androidx/compose/material3/adaptive/layout/PaneScaffoldDirective.kt b/compose/material3/adaptive/adaptive-layout/src/commonMain/kotlin/androidx/compose/material3/adaptive/layout/PaneScaffoldDirective.kt
index a2a06c7..8c32cd7 100644
--- a/compose/material3/adaptive/adaptive-layout/src/commonMain/kotlin/androidx/compose/material3/adaptive/layout/PaneScaffoldDirective.kt
+++ b/compose/material3/adaptive/adaptive-layout/src/commonMain/kotlin/androidx/compose/material3/adaptive/layout/PaneScaffoldDirective.kt
@@ -18,7 +18,6 @@
 
 package androidx.compose.material3.adaptive.layout
 
-import androidx.compose.material3.adaptive.ExperimentalMaterial3AdaptiveApi
 import androidx.compose.material3.adaptive.Posture
 import androidx.compose.material3.adaptive.WindowAdaptiveInfo
 import androidx.compose.material3.adaptive.allVerticalHingeBounds
@@ -44,7 +43,6 @@
  *   vertical hinges.
  * @return an [PaneScaffoldDirective] to be used to decide adaptive layout states.
  */
-@ExperimentalMaterial3AdaptiveApi
 @Suppress("DEPRECATION") // WindowWidthSizeClass is deprecated
 fun calculatePaneScaffoldDirective(
     windowAdaptiveInfo: WindowAdaptiveInfo,
@@ -69,7 +67,6 @@
     val maxVerticalPartitions: Int
     val verticalPartitionSpacerSize: Dp
 
-    // TODO(conradchen): Confirm the table top mode settings
     if (windowAdaptiveInfo.windowPosture.isTabletop) {
         maxVerticalPartitions = 2
         verticalPartitionSpacerSize = 24.dp
@@ -109,7 +106,6 @@
  *   vertical hinges.
  * @return an [PaneScaffoldDirective] to be used to decide adaptive layout states.
  */
-@ExperimentalMaterial3AdaptiveApi
 @Suppress("DEPRECATION") // WindowWidthSizeClass is deprecated
 fun calculatePaneScaffoldDirectiveWithTwoPanesOnMediumWidth(
     windowAdaptiveInfo: WindowAdaptiveInfo,
diff --git a/compose/material3/adaptive/adaptive-layout/src/commonMain/kotlin/androidx/compose/material3/adaptive/layout/Strings.kt b/compose/material3/adaptive/adaptive-layout/src/commonMain/kotlin/androidx/compose/material3/adaptive/layout/Strings.kt
index 4ff2966..e11af66 100644
--- a/compose/material3/adaptive/adaptive-layout/src/commonMain/kotlin/androidx/compose/material3/adaptive/layout/Strings.kt
+++ b/compose/material3/adaptive/adaptive-layout/src/commonMain/kotlin/androidx/compose/material3/adaptive/layout/Strings.kt
@@ -27,7 +27,8 @@
         val defaultPaneExpansionDragHandleContentDescription: Strings
         val defaultPaneExpansionDragHandleActionDescription: Strings
         val defaultPaneExpansionProportionAnchorDescription: Strings
-        val defaultPaneExpansionOffsetAnchorDescription: Strings
+        val defaultPaneExpansionStartOffsetAnchorDescription: Strings
+        val defaultPaneExpansionEndOffsetAnchorDescription: Strings
     }
 }
 
diff --git a/compose/material3/adaptive/adaptive-layout/src/commonMain/kotlin/androidx/compose/material3/adaptive/layout/SupportingPaneScaffold.kt b/compose/material3/adaptive/adaptive-layout/src/commonMain/kotlin/androidx/compose/material3/adaptive/layout/SupportingPaneScaffold.kt
index 1fae8c8..2764c13 100644
--- a/compose/material3/adaptive/adaptive-layout/src/commonMain/kotlin/androidx/compose/material3/adaptive/layout/SupportingPaneScaffold.kt
+++ b/compose/material3/adaptive/adaptive-layout/src/commonMain/kotlin/androidx/compose/material3/adaptive/layout/SupportingPaneScaffold.kt
@@ -177,7 +177,6 @@
  * three pane scaffolds. We suggest you to use the values defined here instead of the raw
  * [ThreePaneScaffoldRole] under the context of [SupportingPaneScaffold] for better code clarity.
  */
-@ExperimentalMaterial3AdaptiveApi
 object SupportingPaneScaffoldRole {
     /**
      * The main pane of [SupportingPaneScaffold], which is supposed to hold the major content of an
diff --git a/compose/material3/adaptive/adaptive-layout/src/commonMain/kotlin/androidx/compose/material3/adaptive/layout/ThreePaneScaffold.kt b/compose/material3/adaptive/adaptive-layout/src/commonMain/kotlin/androidx/compose/material3/adaptive/layout/ThreePaneScaffold.kt
index e3477c7..1355351 100644
--- a/compose/material3/adaptive/adaptive-layout/src/commonMain/kotlin/androidx/compose/material3/adaptive/layout/ThreePaneScaffold.kt
+++ b/compose/material3/adaptive/adaptive-layout/src/commonMain/kotlin/androidx/compose/material3/adaptive/layout/ThreePaneScaffold.kt
@@ -52,7 +52,6 @@
 import androidx.compose.ui.unit.roundToIntRect
 import androidx.compose.ui.util.fastForEach
 import androidx.compose.ui.util.fastForEachIndexed
-import androidx.compose.ui.util.fastMap
 import kotlin.math.max
 import kotlin.math.min
 
@@ -307,10 +306,10 @@
         measurables: List<List<Measurable>>,
         constraints: Constraints
     ): MeasureResult {
-        val primaryMeasurables = measurables[0]
-        val secondaryMeasurables = measurables[1]
-        val tertiaryMeasurables = measurables[2]
-        val dragHandleMeasurables = measurables[3]
+        val primaryMeasurable = measurables[0].firstOrNull()
+        val secondaryMeasurable = measurables[1].firstOrNull()
+        val tertiaryMeasurable = measurables[2].firstOrNull()
+        val dragHandleMeasurable = measurables[3].firstOrNull()
         return layout(constraints.maxWidth, constraints.maxHeight) {
             if (coordinates == null) {
                 return@layout
@@ -319,10 +318,10 @@
             val visiblePanes =
                 getPanesMeasurables(
                     paneOrder = paneOrder,
-                    primaryMeasurables = primaryMeasurables,
+                    primaryMeasurable = primaryMeasurable,
                     scaffoldValue = scaffoldValue,
-                    secondaryMeasurables = secondaryMeasurables,
-                    tertiaryMeasurables = tertiaryMeasurables
+                    secondaryMeasurable = secondaryMeasurable,
+                    tertiaryMeasurable = tertiaryMeasurable
                 ) {
                     it != PaneAdaptedValue.Hidden
                 }
@@ -330,10 +329,10 @@
             val hiddenPanes =
                 getPanesMeasurables(
                     paneOrder = paneOrder,
-                    primaryMeasurables = primaryMeasurables,
+                    primaryMeasurable = primaryMeasurable,
                     scaffoldValue = scaffoldValue,
-                    secondaryMeasurables = secondaryMeasurables,
-                    tertiaryMeasurables = tertiaryMeasurables
+                    secondaryMeasurable = secondaryMeasurable,
+                    tertiaryMeasurable = tertiaryMeasurable
                 ) {
                     it == PaneAdaptedValue.Hidden
                 }
@@ -529,7 +528,7 @@
                 )
             }
 
-            if (visiblePanes.size == 2 && dragHandleMeasurables.isNotEmpty()) {
+            if (visiblePanes.size == 2 && dragHandleMeasurable != null) {
                 val handleOffsetX =
                     if (
                         !paneExpansionState.isDraggingOrSettling ||
@@ -546,11 +545,11 @@
                         paneExpansionState.currentDraggingOffset
                     }
                 measureAndPlaceDragHandleIfNeeded(
-                    measurables = dragHandleMeasurables,
+                    measurable = dragHandleMeasurable,
                     constraints = constraints,
                     contentBounds = outerBounds,
                     minHorizontalMargin = verticalSpacerSize / 2,
-                    minTouchTargetSize = dragHandleMeasurables.minTouchTargetSize.roundToPx(),
+                    minTouchTargetSize = dragHandleMeasurable.minTouchTargetSize.roundToPx(),
                     offsetX = handleOffsetX
                 )
             } else if (!isLookingAhead) {
@@ -568,10 +567,10 @@
     @OptIn(ExperimentalMaterial3AdaptiveApi::class)
     private fun MeasureScope.getPanesMeasurables(
         paneOrder: ThreePaneScaffoldHorizontalOrder,
-        primaryMeasurables: List<Measurable>,
+        primaryMeasurable: Measurable?,
         scaffoldValue: ThreePaneScaffoldValue,
-        secondaryMeasurables: List<Measurable>,
-        tertiaryMeasurables: List<Measurable>,
+        secondaryMeasurable: Measurable?,
+        tertiaryMeasurable: Measurable?,
         predicate: (PaneAdaptedValue) -> Boolean
     ): List<PaneMeasurable> {
         return buildList {
@@ -580,7 +579,7 @@
                     when (role) {
                         ThreePaneScaffoldRole.Primary -> {
                             createPaneMeasurableIfNeeded(
-                                primaryMeasurables,
+                                primaryMeasurable,
                                 ThreePaneScaffoldDefaults.PrimaryPanePriority,
                                 role,
                                 scaffoldDirective.defaultPanePreferredWidth.roundToPx(),
@@ -589,7 +588,7 @@
                         }
                         ThreePaneScaffoldRole.Secondary -> {
                             createPaneMeasurableIfNeeded(
-                                secondaryMeasurables,
+                                secondaryMeasurable,
                                 ThreePaneScaffoldDefaults.SecondaryPanePriority,
                                 role,
                                 scaffoldDirective.defaultPanePreferredWidth.roundToPx(),
@@ -598,7 +597,7 @@
                         }
                         ThreePaneScaffoldRole.Tertiary -> {
                             createPaneMeasurableIfNeeded(
-                                tertiaryMeasurables,
+                                tertiaryMeasurable,
                                 ThreePaneScaffoldDefaults.TertiaryPanePriority,
                                 role,
                                 scaffoldDirective.defaultPanePreferredWidth.roundToPx(),
@@ -612,14 +611,14 @@
     }
 
     private fun MutableList<PaneMeasurable>.createPaneMeasurableIfNeeded(
-        measurables: List<Measurable>,
+        measurable: Measurable?,
         priority: Int,
         role: ThreePaneScaffoldRole,
         defaultPreferredWidth: Int,
         density: Density
     ) {
-        if (measurables.isNotEmpty()) {
-            add(PaneMeasurable(measurables[0], priority, role, defaultPreferredWidth, density))
+        if (measurable != null) {
+            add(PaneMeasurable(measurable, priority, role, defaultPreferredWidth, density))
         }
     }
 
@@ -747,7 +746,7 @@
     }
 
     private fun Placeable.PlacementScope.measureAndPlaceDragHandleIfNeeded(
-        measurables: List<Measurable>,
+        measurable: Measurable,
         constraints: Constraints,
         contentBounds: IntRect,
         minHorizontalMargin: Int,
@@ -778,15 +777,14 @@
             } else {
                 minTouchTargetSize
             }
-        val placeables =
-            measurables.fastMap {
-                it.measure(
-                    Constraints(minWidth = minDragHandleWidth, maxHeight = contentBounds.height)
-                )
-            }
-        placeables.fastForEach {
-            it.place(clampedOffsetX - it.width / 2, (constraints.maxHeight - it.height) / 2)
-        }
+        val placeable =
+            measurable.measure(
+                Constraints(minWidth = minDragHandleWidth, maxHeight = contentBounds.height)
+            )
+        placeable.place(
+            x = clampedOffsetX - placeable.width / 2,
+            y = (constraints.maxHeight - placeable.height) / 2
+        )
     }
 
     private fun getSpacerMiddleOffsetX(paneLeft: PaneMeasurable, paneRight: PaneMeasurable): Int {
diff --git a/compose/material3/adaptive/adaptive-layout/src/commonMain/kotlin/androidx/compose/material3/adaptive/layout/ThreePaneScaffoldDestinationItem.kt b/compose/material3/adaptive/adaptive-layout/src/commonMain/kotlin/androidx/compose/material3/adaptive/layout/ThreePaneScaffoldDestinationItem.kt
index 8ebafe4..fc1dfd9 100644
--- a/compose/material3/adaptive/adaptive-layout/src/commonMain/kotlin/androidx/compose/material3/adaptive/layout/ThreePaneScaffoldDestinationItem.kt
+++ b/compose/material3/adaptive/adaptive-layout/src/commonMain/kotlin/androidx/compose/material3/adaptive/layout/ThreePaneScaffoldDestinationItem.kt
@@ -16,8 +16,6 @@
 
 package androidx.compose.material3.adaptive.layout
 
-import androidx.compose.material3.adaptive.ExperimentalMaterial3AdaptiveApi
-
 /**
  * An item representing a navigation destination in a [ThreePaneScaffold].
  *
@@ -25,7 +23,6 @@
  * @param contentKey the optional key or id representing the content of the destination. The type
  *   [T] must be storable in a Bundle.
  */
-@ExperimentalMaterial3AdaptiveApi
 class ThreePaneScaffoldDestinationItem<out T>(
     val pane: ThreePaneScaffoldRole,
     val contentKey: T? = null,
diff --git a/compose/material3/adaptive/adaptive-layout/src/commonMain/kotlin/androidx/compose/material3/adaptive/layout/ThreePaneScaffoldValue.kt b/compose/material3/adaptive/adaptive-layout/src/commonMain/kotlin/androidx/compose/material3/adaptive/layout/ThreePaneScaffoldValue.kt
index d119518..71c42c2 100644
--- a/compose/material3/adaptive/adaptive-layout/src/commonMain/kotlin/androidx/compose/material3/adaptive/layout/ThreePaneScaffoldValue.kt
+++ b/compose/material3/adaptive/adaptive-layout/src/commonMain/kotlin/androidx/compose/material3/adaptive/layout/ThreePaneScaffoldValue.kt
@@ -22,7 +22,6 @@
 import androidx.compose.runtime.saveable.listSaver
 import androidx.compose.ui.util.fastForEachReversed
 
-@ExperimentalMaterial3AdaptiveApi
 private inline fun buildThreePaneScaffoldValue(
     buildAction: (ThreePaneScaffoldRole) -> PaneAdaptedValue
 ): ThreePaneScaffoldValue {
@@ -168,7 +167,7 @@
  * @param tertiary [PaneAdaptedValue] of the tertiary pane of [ThreePaneScaffold]
  * @constructor create an instance of [ThreePaneScaffoldValue]
  */
-@ExperimentalMaterial3AdaptiveApi
+@OptIn(ExperimentalMaterial3AdaptiveApi::class)
 @Immutable
 class ThreePaneScaffoldValue(
     val primary: PaneAdaptedValue,
diff --git a/compose/material3/adaptive/adaptive-layout/src/jvmStubsMain/kotlin/androidx/compose/material3/adaptive/layout/Strings.jvmStubs.kt b/compose/material3/adaptive/adaptive-layout/src/jvmStubsMain/kotlin/androidx/compose/material3/adaptive/layout/Strings.jvmStubs.kt
index a419136..11184b6 100644
--- a/compose/material3/adaptive/adaptive-layout/src/jvmStubsMain/kotlin/androidx/compose/material3/adaptive/layout/Strings.jvmStubs.kt
+++ b/compose/material3/adaptive/adaptive-layout/src/jvmStubsMain/kotlin/androidx/compose/material3/adaptive/layout/Strings.jvmStubs.kt
@@ -39,7 +39,9 @@
             implementedInJetBrainsFork()
         actual val defaultPaneExpansionProportionAnchorDescription: Strings =
             implementedInJetBrainsFork()
-        actual val defaultPaneExpansionOffsetAnchorDescription: Strings =
+        actual val defaultPaneExpansionStartOffsetAnchorDescription: Strings =
+            implementedInJetBrainsFork()
+        actual val defaultPaneExpansionEndOffsetAnchorDescription: Strings =
             implementedInJetBrainsFork()
     }
 }
diff --git a/compose/material3/adaptive/adaptive-navigation/api/current.txt b/compose/material3/adaptive/adaptive-navigation/api/current.txt
index 0e485ac..ba0712b 100644
--- a/compose/material3/adaptive/adaptive-navigation/api/current.txt
+++ b/compose/material3/adaptive/adaptive-navigation/api/current.txt
@@ -6,7 +6,7 @@
     method @SuppressCompatibility @androidx.compose.material3.adaptive.ExperimentalMaterial3AdaptiveApi @androidx.compose.runtime.Composable public static <T> void NavigableSupportingPaneScaffold(androidx.compose.material3.adaptive.navigation.ThreePaneScaffoldNavigator<T> navigator, kotlin.jvm.functions.Function1<? super androidx.compose.material3.adaptive.layout.ThreePaneScaffoldPaneScope,kotlin.Unit> mainPane, kotlin.jvm.functions.Function1<? super androidx.compose.material3.adaptive.layout.ThreePaneScaffoldPaneScope,kotlin.Unit> supportingPane, optional androidx.compose.ui.Modifier modifier, optional kotlin.jvm.functions.Function1<? super androidx.compose.material3.adaptive.layout.ThreePaneScaffoldPaneScope,kotlin.Unit>? extraPane, optional String defaultBackBehavior, optional kotlin.jvm.functions.Function2<? super androidx.compose.material3.adaptive.layout.ThreePaneScaffoldScope,? super androidx.compose.material3.adaptive.layout.PaneExpansionState,kotlin.Unit>? paneExpansionDragHandle, optional androidx.compose.material3.adaptive.layout.PaneExpansionState? paneExpansionState);
   }
 
-  @SuppressCompatibility @androidx.compose.material3.adaptive.ExperimentalMaterial3AdaptiveApi @kotlin.jvm.JvmInline public final value class BackNavigationBehavior {
+  @kotlin.jvm.JvmInline public final value class BackNavigationBehavior {
     field public static final androidx.compose.material3.adaptive.navigation.BackNavigationBehavior.Companion Companion;
   }
 
diff --git a/compose/material3/adaptive/adaptive-navigation/api/restricted_current.txt b/compose/material3/adaptive/adaptive-navigation/api/restricted_current.txt
index 0e485ac..ba0712b 100644
--- a/compose/material3/adaptive/adaptive-navigation/api/restricted_current.txt
+++ b/compose/material3/adaptive/adaptive-navigation/api/restricted_current.txt
@@ -6,7 +6,7 @@
     method @SuppressCompatibility @androidx.compose.material3.adaptive.ExperimentalMaterial3AdaptiveApi @androidx.compose.runtime.Composable public static <T> void NavigableSupportingPaneScaffold(androidx.compose.material3.adaptive.navigation.ThreePaneScaffoldNavigator<T> navigator, kotlin.jvm.functions.Function1<? super androidx.compose.material3.adaptive.layout.ThreePaneScaffoldPaneScope,kotlin.Unit> mainPane, kotlin.jvm.functions.Function1<? super androidx.compose.material3.adaptive.layout.ThreePaneScaffoldPaneScope,kotlin.Unit> supportingPane, optional androidx.compose.ui.Modifier modifier, optional kotlin.jvm.functions.Function1<? super androidx.compose.material3.adaptive.layout.ThreePaneScaffoldPaneScope,kotlin.Unit>? extraPane, optional String defaultBackBehavior, optional kotlin.jvm.functions.Function2<? super androidx.compose.material3.adaptive.layout.ThreePaneScaffoldScope,? super androidx.compose.material3.adaptive.layout.PaneExpansionState,kotlin.Unit>? paneExpansionDragHandle, optional androidx.compose.material3.adaptive.layout.PaneExpansionState? paneExpansionState);
   }
 
-  @SuppressCompatibility @androidx.compose.material3.adaptive.ExperimentalMaterial3AdaptiveApi @kotlin.jvm.JvmInline public final value class BackNavigationBehavior {
+  @kotlin.jvm.JvmInline public final value class BackNavigationBehavior {
     field public static final androidx.compose.material3.adaptive.navigation.BackNavigationBehavior.Companion Companion;
   }
 
diff --git a/compose/material3/adaptive/adaptive-navigation/src/commonMain/kotlin/androidx/compose/material3/adaptive/navigation/BackNavigationBehavior.kt b/compose/material3/adaptive/adaptive-navigation/src/commonMain/kotlin/androidx/compose/material3/adaptive/navigation/BackNavigationBehavior.kt
index 66f554d7..37c8d7f 100644
--- a/compose/material3/adaptive/adaptive-navigation/src/commonMain/kotlin/androidx/compose/material3/adaptive/navigation/BackNavigationBehavior.kt
+++ b/compose/material3/adaptive/adaptive-navigation/src/commonMain/kotlin/androidx/compose/material3/adaptive/navigation/BackNavigationBehavior.kt
@@ -16,13 +16,11 @@
 
 package androidx.compose.material3.adaptive.navigation
 
-import androidx.compose.material3.adaptive.ExperimentalMaterial3AdaptiveApi
 import androidx.compose.material3.adaptive.layout.PaneAdaptedValue
 import androidx.compose.material3.adaptive.layout.ThreePaneScaffoldDestinationItem
 import androidx.compose.material3.adaptive.layout.ThreePaneScaffoldRole
 
 /** A class to control how back navigation should behave in a [ThreePaneScaffoldNavigator]. */
-@ExperimentalMaterial3AdaptiveApi
 @JvmInline
 value class BackNavigationBehavior private constructor(private val description: String) {
     override fun toString(): String = this.description
diff --git a/compose/material3/adaptive/adaptive/api/current.txt b/compose/material3/adaptive/adaptive/api/current.txt
index 7dc7be8..a93216b 100644
--- a/compose/material3/adaptive/adaptive/api/current.txt
+++ b/compose/material3/adaptive/adaptive/api/current.txt
@@ -2,7 +2,7 @@
 package androidx.compose.material3.adaptive {
 
   public final class AndroidPosture_androidKt {
-    method @SuppressCompatibility @androidx.compose.material3.adaptive.ExperimentalMaterial3AdaptiveApi public static androidx.compose.material3.adaptive.Posture calculatePosture(java.util.List<? extends androidx.window.layout.FoldingFeature> foldingFeatures);
+    method public static androidx.compose.material3.adaptive.Posture calculatePosture(java.util.List<? extends androidx.window.layout.FoldingFeature> foldingFeatures);
   }
 
   public final class AndroidWindowAdaptiveInfo_androidKt {
diff --git a/compose/material3/adaptive/adaptive/api/restricted_current.txt b/compose/material3/adaptive/adaptive/api/restricted_current.txt
index 7dc7be8..a93216b 100644
--- a/compose/material3/adaptive/adaptive/api/restricted_current.txt
+++ b/compose/material3/adaptive/adaptive/api/restricted_current.txt
@@ -2,7 +2,7 @@
 package androidx.compose.material3.adaptive {
 
   public final class AndroidPosture_androidKt {
-    method @SuppressCompatibility @androidx.compose.material3.adaptive.ExperimentalMaterial3AdaptiveApi public static androidx.compose.material3.adaptive.Posture calculatePosture(java.util.List<? extends androidx.window.layout.FoldingFeature> foldingFeatures);
+    method public static androidx.compose.material3.adaptive.Posture calculatePosture(java.util.List<? extends androidx.window.layout.FoldingFeature> foldingFeatures);
   }
 
   public final class AndroidWindowAdaptiveInfo_androidKt {
diff --git a/compose/material3/adaptive/adaptive/src/androidMain/kotlin/androidx/compose/material3/adaptive/AndroidPosture.android.kt b/compose/material3/adaptive/adaptive/src/androidMain/kotlin/androidx/compose/material3/adaptive/AndroidPosture.android.kt
index 60b16e60..1ace339 100644
--- a/compose/material3/adaptive/adaptive/src/androidMain/kotlin/androidx/compose/material3/adaptive/AndroidPosture.android.kt
+++ b/compose/material3/adaptive/adaptive/src/androidMain/kotlin/androidx/compose/material3/adaptive/AndroidPosture.android.kt
@@ -23,7 +23,6 @@
  * Calculates the [Posture] for a given list of [FoldingFeature]s. This methods converts framework
  * folding info into the Material-opinionated posture info.
  */
-@ExperimentalMaterial3AdaptiveApi
 fun calculatePosture(foldingFeatures: List<FoldingFeature>): Posture {
     var isTableTop = false
     val hingeList = mutableListOf<HingeInfo>()
diff --git a/compose/material3/adaptive/samples/src/main/java/androidx/compose/material3/adaptive/samples/ThreePaneScaffoldSample.kt b/compose/material3/adaptive/samples/src/main/java/androidx/compose/material3/adaptive/samples/ThreePaneScaffoldSample.kt
index 798e57e..5181bf1 100644
--- a/compose/material3/adaptive/samples/src/main/java/androidx/compose/material3/adaptive/samples/ThreePaneScaffoldSample.kt
+++ b/compose/material3/adaptive/samples/src/main/java/androidx/compose/material3/adaptive/samples/ThreePaneScaffoldSample.kt
@@ -438,8 +438,8 @@
 private val PaneExpansionAnchors =
     listOf(
         PaneExpansionAnchor.Proportion(0f),
-        PaneExpansionAnchor.Proportion(0.25f),
+        PaneExpansionAnchor.Offset.fromStart(360.dp),
         PaneExpansionAnchor.Proportion(0.5f),
-        PaneExpansionAnchor.Proportion(0.75f),
+        PaneExpansionAnchor.Offset.fromEnd(360.dp),
         PaneExpansionAnchor.Proportion(1f),
     )
diff --git a/compose/material3/material3/api/current.txt b/compose/material3/material3/api/current.txt
index a3501ba..273f29f 100644
--- a/compose/material3/material3/api/current.txt
+++ b/compose/material3/material3/api/current.txt
@@ -211,6 +211,7 @@
     method public float getMinWidth();
     method @Deprecated @androidx.compose.runtime.Composable public androidx.compose.foundation.BorderStroke getOutlinedButtonBorder();
     method @androidx.compose.runtime.Composable public androidx.compose.ui.graphics.Shape getOutlinedShape();
+    method @SuppressCompatibility @androidx.compose.material3.ExperimentalMaterial3ExpressiveApi @androidx.compose.runtime.Composable public androidx.compose.ui.graphics.Shape getPressedShape();
     method @androidx.compose.runtime.Composable public androidx.compose.ui.graphics.Shape getShape();
     method public androidx.compose.foundation.layout.PaddingValues getSmallButtonContentPadding();
     method @SuppressCompatibility @androidx.compose.material3.ExperimentalMaterial3ExpressiveApi @androidx.compose.runtime.Composable public androidx.compose.ui.graphics.Shape getSquareShape();
@@ -228,6 +229,7 @@
     method @androidx.compose.runtime.Composable public androidx.compose.foundation.BorderStroke outlinedButtonBorder(optional boolean enabled);
     method @androidx.compose.runtime.Composable public androidx.compose.material3.ButtonColors outlinedButtonColors();
     method @androidx.compose.runtime.Composable public androidx.compose.material3.ButtonColors outlinedButtonColors(optional long containerColor, optional long contentColor, optional long disabledContainerColor, optional long disabledContentColor);
+    method @SuppressCompatibility @androidx.compose.material3.ExperimentalMaterial3ExpressiveApi @androidx.compose.runtime.Composable public androidx.compose.material3.ButtonShapes shapes();
     method @androidx.compose.runtime.Composable public androidx.compose.material3.ButtonColors textButtonColors();
     method @androidx.compose.runtime.Composable public androidx.compose.material3.ButtonColors textButtonColors(optional long containerColor, optional long contentColor, optional long disabledContainerColor, optional long disabledContentColor);
     property public final androidx.compose.foundation.layout.PaddingValues ButtonWithIconContentPadding;
@@ -259,6 +261,7 @@
     property @androidx.compose.runtime.Composable public final androidx.compose.ui.graphics.Shape filledTonalShape;
     property @Deprecated @androidx.compose.runtime.Composable public final androidx.compose.foundation.BorderStroke outlinedButtonBorder;
     property @androidx.compose.runtime.Composable public final androidx.compose.ui.graphics.Shape outlinedShape;
+    property @SuppressCompatibility @androidx.compose.material3.ExperimentalMaterial3ExpressiveApi @androidx.compose.runtime.Composable public final androidx.compose.ui.graphics.Shape pressedShape;
     property @androidx.compose.runtime.Composable public final androidx.compose.ui.graphics.Shape shape;
     property @SuppressCompatibility @androidx.compose.material3.ExperimentalMaterial3ExpressiveApi @androidx.compose.runtime.Composable public final androidx.compose.ui.graphics.Shape squareShape;
     property @androidx.compose.runtime.Composable public final androidx.compose.ui.graphics.Shape textShape;
@@ -269,25 +272,25 @@
   }
 
   @SuppressCompatibility @androidx.compose.material3.ExperimentalMaterial3ExpressiveApi public final class ButtonGroupDefaults {
-    method public float getAnimateFraction();
-    method public androidx.compose.ui.graphics.Shape getConnectedLeadingButtonPressShape();
-    method public androidx.compose.ui.graphics.Shape getConnectedLeadingButtonShape();
+    method @androidx.compose.runtime.Composable public androidx.compose.ui.graphics.Shape getConnectedLeadingButtonPressShape();
+    method @androidx.compose.runtime.Composable public androidx.compose.ui.graphics.Shape getConnectedLeadingButtonShape();
     method public float getConnectedSpaceBetween();
-    method public androidx.compose.ui.graphics.Shape getConnectedTrailingButtonPressShape();
-    method public androidx.compose.ui.graphics.Shape getConnectedTrailingButtonShape();
-    method public float getSpaceBetween();
-    property public final float animateFraction;
-    property public final androidx.compose.ui.graphics.Shape connectedLeadingButtonPressShape;
-    property public final androidx.compose.ui.graphics.Shape connectedLeadingButtonShape;
-    property public final float connectedSpaceBetween;
-    property public final androidx.compose.ui.graphics.Shape connectedTrailingButtonPressShape;
-    property public final androidx.compose.ui.graphics.Shape connectedTrailingButtonShape;
-    property public final float spaceBetween;
+    method @androidx.compose.runtime.Composable public androidx.compose.ui.graphics.Shape getConnectedTrailingButtonPressShape();
+    method @androidx.compose.runtime.Composable public androidx.compose.ui.graphics.Shape getConnectedTrailingButtonShape();
+    method public float getExpandedRatio();
+    method public androidx.compose.foundation.layout.Arrangement.Horizontal getHorizontalArrangement();
+    property public final float ConnectedSpaceBetween;
+    property public final float ExpandedRatio;
+    property public final androidx.compose.foundation.layout.Arrangement.Horizontal HorizontalArrangement;
+    property @androidx.compose.runtime.Composable public final androidx.compose.ui.graphics.Shape connectedLeadingButtonPressShape;
+    property @androidx.compose.runtime.Composable public final androidx.compose.ui.graphics.Shape connectedLeadingButtonShape;
+    property @androidx.compose.runtime.Composable public final androidx.compose.ui.graphics.Shape connectedTrailingButtonPressShape;
+    property @androidx.compose.runtime.Composable public final androidx.compose.ui.graphics.Shape connectedTrailingButtonShape;
     field public static final androidx.compose.material3.ButtonGroupDefaults INSTANCE;
   }
 
   public final class ButtonGroupKt {
-    method @SuppressCompatibility @androidx.compose.material3.ExperimentalMaterial3ExpressiveApi @androidx.compose.runtime.Composable public static void ButtonGroup(optional androidx.compose.ui.Modifier modifier, optional @FloatRange(from=0.0) float animateFraction, optional androidx.compose.foundation.layout.Arrangement.Horizontal horizontalArrangement, kotlin.jvm.functions.Function1<? super androidx.compose.material3.ButtonGroupScope,kotlin.Unit> content);
+    method @SuppressCompatibility @androidx.compose.material3.ExperimentalMaterial3ExpressiveApi @androidx.compose.runtime.Composable public static void ButtonGroup(optional androidx.compose.ui.Modifier modifier, optional @FloatRange(from=0.0) float expandedRatio, optional androidx.compose.foundation.layout.Arrangement.Horizontal horizontalArrangement, kotlin.jvm.functions.Function1<? super androidx.compose.material3.ButtonGroupScope,kotlin.Unit> content);
   }
 
   @SuppressCompatibility @androidx.compose.material3.ExperimentalMaterial3ExpressiveApi public interface ButtonGroupScope {
@@ -295,20 +298,23 @@
   }
 
   public final class ButtonKt {
+    method @SuppressCompatibility @androidx.compose.material3.ExperimentalMaterial3ExpressiveApi @androidx.compose.runtime.Composable public static void Button(kotlin.jvm.functions.Function0<kotlin.Unit> onClick, androidx.compose.material3.ButtonShapes shapes, optional androidx.compose.ui.Modifier modifier, optional boolean enabled, optional androidx.compose.material3.ButtonColors colors, optional androidx.compose.material3.ButtonElevation? elevation, optional androidx.compose.foundation.BorderStroke? border, optional androidx.compose.foundation.layout.PaddingValues contentPadding, optional androidx.compose.foundation.interaction.MutableInteractionSource? interactionSource, kotlin.jvm.functions.Function1<? super androidx.compose.foundation.layout.RowScope,kotlin.Unit> content);
     method @androidx.compose.runtime.Composable public static void Button(kotlin.jvm.functions.Function0<kotlin.Unit> onClick, optional androidx.compose.ui.Modifier modifier, optional boolean enabled, optional androidx.compose.ui.graphics.Shape shape, optional androidx.compose.material3.ButtonColors colors, optional androidx.compose.material3.ButtonElevation? elevation, optional androidx.compose.foundation.BorderStroke? border, optional androidx.compose.foundation.layout.PaddingValues contentPadding, optional androidx.compose.foundation.interaction.MutableInteractionSource? interactionSource, kotlin.jvm.functions.Function1<? super androidx.compose.foundation.layout.RowScope,kotlin.Unit> content);
+    method @SuppressCompatibility @androidx.compose.material3.ExperimentalMaterial3ExpressiveApi @androidx.compose.runtime.Composable public static void ElevatedButton(kotlin.jvm.functions.Function0<kotlin.Unit> onClick, androidx.compose.material3.ButtonShapes shapes, optional androidx.compose.ui.Modifier modifier, optional boolean enabled, optional androidx.compose.material3.ButtonColors colors, optional androidx.compose.material3.ButtonElevation? elevation, optional androidx.compose.foundation.BorderStroke? border, optional androidx.compose.foundation.layout.PaddingValues contentPadding, optional androidx.compose.foundation.interaction.MutableInteractionSource? interactionSource, kotlin.jvm.functions.Function1<? super androidx.compose.foundation.layout.RowScope,kotlin.Unit> content);
     method @androidx.compose.runtime.Composable public static void ElevatedButton(kotlin.jvm.functions.Function0<kotlin.Unit> onClick, optional androidx.compose.ui.Modifier modifier, optional boolean enabled, optional androidx.compose.ui.graphics.Shape shape, optional androidx.compose.material3.ButtonColors colors, optional androidx.compose.material3.ButtonElevation? elevation, optional androidx.compose.foundation.BorderStroke? border, optional androidx.compose.foundation.layout.PaddingValues contentPadding, optional androidx.compose.foundation.interaction.MutableInteractionSource? interactionSource, kotlin.jvm.functions.Function1<? super androidx.compose.foundation.layout.RowScope,kotlin.Unit> content);
+    method @SuppressCompatibility @androidx.compose.material3.ExperimentalMaterial3ExpressiveApi @androidx.compose.runtime.Composable public static void FilledTonalButton(kotlin.jvm.functions.Function0<kotlin.Unit> onClick, androidx.compose.material3.ButtonShapes shapes, optional androidx.compose.ui.Modifier modifier, optional boolean enabled, optional androidx.compose.material3.ButtonColors colors, optional androidx.compose.material3.ButtonElevation? elevation, optional androidx.compose.foundation.BorderStroke? border, optional androidx.compose.foundation.layout.PaddingValues contentPadding, optional androidx.compose.foundation.interaction.MutableInteractionSource? interactionSource, kotlin.jvm.functions.Function1<? super androidx.compose.foundation.layout.RowScope,kotlin.Unit> content);
     method @androidx.compose.runtime.Composable public static void FilledTonalButton(kotlin.jvm.functions.Function0<kotlin.Unit> onClick, optional androidx.compose.ui.Modifier modifier, optional boolean enabled, optional androidx.compose.ui.graphics.Shape shape, optional androidx.compose.material3.ButtonColors colors, optional androidx.compose.material3.ButtonElevation? elevation, optional androidx.compose.foundation.BorderStroke? border, optional androidx.compose.foundation.layout.PaddingValues contentPadding, optional androidx.compose.foundation.interaction.MutableInteractionSource? interactionSource, kotlin.jvm.functions.Function1<? super androidx.compose.foundation.layout.RowScope,kotlin.Unit> content);
+    method @SuppressCompatibility @androidx.compose.material3.ExperimentalMaterial3ExpressiveApi @androidx.compose.runtime.Composable public static void OutlinedButton(kotlin.jvm.functions.Function0<kotlin.Unit> onClick, androidx.compose.material3.ButtonShapes shapes, optional androidx.compose.ui.Modifier modifier, optional boolean enabled, optional androidx.compose.material3.ButtonColors colors, optional androidx.compose.material3.ButtonElevation? elevation, optional androidx.compose.foundation.BorderStroke? border, optional androidx.compose.foundation.layout.PaddingValues contentPadding, optional androidx.compose.foundation.interaction.MutableInteractionSource? interactionSource, kotlin.jvm.functions.Function1<? super androidx.compose.foundation.layout.RowScope,kotlin.Unit> content);
     method @androidx.compose.runtime.Composable public static void OutlinedButton(kotlin.jvm.functions.Function0<kotlin.Unit> onClick, optional androidx.compose.ui.Modifier modifier, optional boolean enabled, optional androidx.compose.ui.graphics.Shape shape, optional androidx.compose.material3.ButtonColors colors, optional androidx.compose.material3.ButtonElevation? elevation, optional androidx.compose.foundation.BorderStroke? border, optional androidx.compose.foundation.layout.PaddingValues contentPadding, optional androidx.compose.foundation.interaction.MutableInteractionSource? interactionSource, kotlin.jvm.functions.Function1<? super androidx.compose.foundation.layout.RowScope,kotlin.Unit> content);
+    method @SuppressCompatibility @androidx.compose.material3.ExperimentalMaterial3ExpressiveApi @androidx.compose.runtime.Composable public static void TextButton(kotlin.jvm.functions.Function0<kotlin.Unit> onClick, androidx.compose.material3.ButtonShapes shapes, optional androidx.compose.ui.Modifier modifier, optional boolean enabled, optional androidx.compose.material3.ButtonColors colors, optional androidx.compose.material3.ButtonElevation? elevation, optional androidx.compose.foundation.BorderStroke? border, optional androidx.compose.foundation.layout.PaddingValues contentPadding, optional androidx.compose.foundation.interaction.MutableInteractionSource? interactionSource, kotlin.jvm.functions.Function1<? super androidx.compose.foundation.layout.RowScope,kotlin.Unit> content);
     method @androidx.compose.runtime.Composable public static void TextButton(kotlin.jvm.functions.Function0<kotlin.Unit> onClick, optional androidx.compose.ui.Modifier modifier, optional boolean enabled, optional androidx.compose.ui.graphics.Shape shape, optional androidx.compose.material3.ButtonColors colors, optional androidx.compose.material3.ButtonElevation? elevation, optional androidx.compose.foundation.BorderStroke? border, optional androidx.compose.foundation.layout.PaddingValues contentPadding, optional androidx.compose.foundation.interaction.MutableInteractionSource? interactionSource, kotlin.jvm.functions.Function1<? super androidx.compose.foundation.layout.RowScope,kotlin.Unit> content);
   }
 
-  public final class ButtonShapes {
-    ctor public ButtonShapes(androidx.compose.ui.graphics.Shape shape, androidx.compose.ui.graphics.Shape pressedShape, androidx.compose.ui.graphics.Shape checkedShape);
-    method public androidx.compose.material3.ButtonShapes copy(optional androidx.compose.ui.graphics.Shape? shape, optional androidx.compose.ui.graphics.Shape? pressedShape, optional androidx.compose.ui.graphics.Shape? checkedShape);
-    method public androidx.compose.ui.graphics.Shape getCheckedShape();
+  @SuppressCompatibility @androidx.compose.material3.ExperimentalMaterial3ExpressiveApi @androidx.compose.runtime.Immutable public final class ButtonShapes {
+    ctor public ButtonShapes(androidx.compose.ui.graphics.Shape shape, androidx.compose.ui.graphics.Shape pressedShape);
+    method public androidx.compose.material3.ButtonShapes copy(optional androidx.compose.ui.graphics.Shape? shape, optional androidx.compose.ui.graphics.Shape? pressedShape);
     method public androidx.compose.ui.graphics.Shape getPressedShape();
     method public androidx.compose.ui.graphics.Shape getShape();
-    property public final androidx.compose.ui.graphics.Shape checkedShape;
     property public final androidx.compose.ui.graphics.Shape pressedShape;
     property public final androidx.compose.ui.graphics.Shape shape;
   }
@@ -2206,10 +2212,12 @@
     method public int getSteps();
     method public float getValue();
     method public kotlin.ranges.ClosedFloatingPointRange<java.lang.Float> getValueRange();
+    method public boolean isDragging();
     method public void setOnValueChange(kotlin.jvm.functions.Function1<? super java.lang.Float,kotlin.Unit>?);
     method public void setOnValueChangeFinished(kotlin.jvm.functions.Function0<kotlin.Unit>?);
     method public void setValue(float);
     property public final float coercedValueAsFraction;
+    property public final boolean isDragging;
     property public final kotlin.jvm.functions.Function1<java.lang.Float,kotlin.Unit>? onValueChange;
     property public final kotlin.jvm.functions.Function0<kotlin.Unit>? onValueChangeFinished;
     property @IntRange(from=0L) public final int steps;
@@ -2787,8 +2795,8 @@
     method @androidx.compose.runtime.Composable public androidx.compose.ui.graphics.Shape getXSmallSquareShape();
     method @androidx.compose.runtime.Composable public androidx.compose.material3.ToggleButtonColors outlinedToggleButtonColors();
     method @androidx.compose.runtime.Composable public androidx.compose.material3.ToggleButtonColors outlinedToggleButtonColors(optional long containerColor, optional long contentColor, optional long disabledContainerColor, optional long disabledContentColor, optional long checkedContainerColor, optional long checkedContentColor);
-    method @androidx.compose.runtime.Composable public androidx.compose.material3.ButtonShapes shapes();
-    method @androidx.compose.runtime.Composable public androidx.compose.material3.ButtonShapes shapes(optional androidx.compose.ui.graphics.Shape? shape, optional androidx.compose.ui.graphics.Shape? pressedShape, optional androidx.compose.ui.graphics.Shape? checkedShape);
+    method @androidx.compose.runtime.Composable public androidx.compose.material3.ToggleButtonShapes shapes();
+    method @androidx.compose.runtime.Composable public androidx.compose.material3.ToggleButtonShapes shapes(optional androidx.compose.ui.graphics.Shape? shape, optional androidx.compose.ui.graphics.Shape? pressedShape, optional androidx.compose.ui.graphics.Shape? checkedShape);
     method @androidx.compose.runtime.Composable public androidx.compose.material3.ToggleButtonColors toggleButtonColors();
     method @androidx.compose.runtime.Composable public androidx.compose.material3.ToggleButtonColors toggleButtonColors(optional long containerColor, optional long contentColor, optional long disabledContainerColor, optional long disabledContentColor, optional long checkedContainerColor, optional long checkedContentColor);
     method @androidx.compose.runtime.Composable public androidx.compose.material3.ToggleButtonColors tonalToggleButtonColors();
@@ -2818,10 +2826,21 @@
   }
 
   public final class ToggleButtonKt {
-    method @SuppressCompatibility @androidx.compose.material3.ExperimentalMaterial3ExpressiveApi @androidx.compose.runtime.Composable public static void ElevatedToggleButton(boolean checked, kotlin.jvm.functions.Function1<? super java.lang.Boolean,kotlin.Unit> onCheckedChange, optional androidx.compose.ui.Modifier modifier, optional boolean enabled, optional androidx.compose.material3.ButtonShapes shapes, optional androidx.compose.material3.ToggleButtonColors colors, optional androidx.compose.material3.ButtonElevation? elevation, optional androidx.compose.foundation.BorderStroke? border, optional androidx.compose.foundation.layout.PaddingValues contentPadding, optional androidx.compose.foundation.interaction.MutableInteractionSource? interactionSource, kotlin.jvm.functions.Function1<? super androidx.compose.foundation.layout.RowScope,kotlin.Unit> content);
-    method @SuppressCompatibility @androidx.compose.material3.ExperimentalMaterial3ExpressiveApi @androidx.compose.runtime.Composable public static void OutlinedToggleButton(boolean checked, kotlin.jvm.functions.Function1<? super java.lang.Boolean,kotlin.Unit> onCheckedChange, optional androidx.compose.ui.Modifier modifier, optional boolean enabled, optional androidx.compose.material3.ButtonShapes shapes, optional androidx.compose.material3.ToggleButtonColors colors, optional androidx.compose.material3.ButtonElevation? elevation, optional androidx.compose.foundation.BorderStroke? border, optional androidx.compose.foundation.layout.PaddingValues contentPadding, optional androidx.compose.foundation.interaction.MutableInteractionSource? interactionSource, kotlin.jvm.functions.Function1<? super androidx.compose.foundation.layout.RowScope,kotlin.Unit> content);
-    method @SuppressCompatibility @androidx.compose.material3.ExperimentalMaterial3ExpressiveApi @androidx.compose.runtime.Composable public static void ToggleButton(boolean checked, kotlin.jvm.functions.Function1<? super java.lang.Boolean,kotlin.Unit> onCheckedChange, optional androidx.compose.ui.Modifier modifier, optional boolean enabled, optional androidx.compose.material3.ButtonShapes shapes, optional androidx.compose.material3.ToggleButtonColors colors, optional androidx.compose.material3.ButtonElevation? elevation, optional androidx.compose.foundation.BorderStroke? border, optional androidx.compose.foundation.layout.PaddingValues contentPadding, optional androidx.compose.foundation.interaction.MutableInteractionSource? interactionSource, kotlin.jvm.functions.Function1<? super androidx.compose.foundation.layout.RowScope,kotlin.Unit> content);
-    method @SuppressCompatibility @androidx.compose.material3.ExperimentalMaterial3ExpressiveApi @androidx.compose.runtime.Composable public static void TonalToggleButton(boolean checked, kotlin.jvm.functions.Function1<? super java.lang.Boolean,kotlin.Unit> onCheckedChange, optional androidx.compose.ui.Modifier modifier, optional boolean enabled, optional androidx.compose.material3.ButtonShapes shapes, optional androidx.compose.material3.ToggleButtonColors colors, optional androidx.compose.material3.ButtonElevation? elevation, optional androidx.compose.foundation.BorderStroke? border, optional androidx.compose.foundation.layout.PaddingValues contentPadding, optional androidx.compose.foundation.interaction.MutableInteractionSource? interactionSource, kotlin.jvm.functions.Function1<? super androidx.compose.foundation.layout.RowScope,kotlin.Unit> content);
+    method @SuppressCompatibility @androidx.compose.material3.ExperimentalMaterial3ExpressiveApi @androidx.compose.runtime.Composable public static void ElevatedToggleButton(boolean checked, kotlin.jvm.functions.Function1<? super java.lang.Boolean,kotlin.Unit> onCheckedChange, optional androidx.compose.ui.Modifier modifier, optional boolean enabled, optional androidx.compose.material3.ToggleButtonShapes shapes, optional androidx.compose.material3.ToggleButtonColors colors, optional androidx.compose.material3.ButtonElevation? elevation, optional androidx.compose.foundation.BorderStroke? border, optional androidx.compose.foundation.layout.PaddingValues contentPadding, optional androidx.compose.foundation.interaction.MutableInteractionSource? interactionSource, kotlin.jvm.functions.Function1<? super androidx.compose.foundation.layout.RowScope,kotlin.Unit> content);
+    method @SuppressCompatibility @androidx.compose.material3.ExperimentalMaterial3ExpressiveApi @androidx.compose.runtime.Composable public static void OutlinedToggleButton(boolean checked, kotlin.jvm.functions.Function1<? super java.lang.Boolean,kotlin.Unit> onCheckedChange, optional androidx.compose.ui.Modifier modifier, optional boolean enabled, optional androidx.compose.material3.ToggleButtonShapes shapes, optional androidx.compose.material3.ToggleButtonColors colors, optional androidx.compose.material3.ButtonElevation? elevation, optional androidx.compose.foundation.BorderStroke? border, optional androidx.compose.foundation.layout.PaddingValues contentPadding, optional androidx.compose.foundation.interaction.MutableInteractionSource? interactionSource, kotlin.jvm.functions.Function1<? super androidx.compose.foundation.layout.RowScope,kotlin.Unit> content);
+    method @SuppressCompatibility @androidx.compose.material3.ExperimentalMaterial3ExpressiveApi @androidx.compose.runtime.Composable public static void ToggleButton(boolean checked, kotlin.jvm.functions.Function1<? super java.lang.Boolean,kotlin.Unit> onCheckedChange, optional androidx.compose.ui.Modifier modifier, optional boolean enabled, optional androidx.compose.material3.ToggleButtonShapes shapes, optional androidx.compose.material3.ToggleButtonColors colors, optional androidx.compose.material3.ButtonElevation? elevation, optional androidx.compose.foundation.BorderStroke? border, optional androidx.compose.foundation.layout.PaddingValues contentPadding, optional androidx.compose.foundation.interaction.MutableInteractionSource? interactionSource, kotlin.jvm.functions.Function1<? super androidx.compose.foundation.layout.RowScope,kotlin.Unit> content);
+    method @SuppressCompatibility @androidx.compose.material3.ExperimentalMaterial3ExpressiveApi @androidx.compose.runtime.Composable public static void TonalToggleButton(boolean checked, kotlin.jvm.functions.Function1<? super java.lang.Boolean,kotlin.Unit> onCheckedChange, optional androidx.compose.ui.Modifier modifier, optional boolean enabled, optional androidx.compose.material3.ToggleButtonShapes shapes, optional androidx.compose.material3.ToggleButtonColors colors, optional androidx.compose.material3.ButtonElevation? elevation, optional androidx.compose.foundation.BorderStroke? border, optional androidx.compose.foundation.layout.PaddingValues contentPadding, optional androidx.compose.foundation.interaction.MutableInteractionSource? interactionSource, kotlin.jvm.functions.Function1<? super androidx.compose.foundation.layout.RowScope,kotlin.Unit> content);
+  }
+
+  @SuppressCompatibility @androidx.compose.material3.ExperimentalMaterial3ExpressiveApi @androidx.compose.runtime.Immutable public final class ToggleButtonShapes {
+    ctor public ToggleButtonShapes(androidx.compose.ui.graphics.Shape shape, androidx.compose.ui.graphics.Shape pressedShape, androidx.compose.ui.graphics.Shape checkedShape);
+    method public androidx.compose.material3.ToggleButtonShapes copy(optional androidx.compose.ui.graphics.Shape? shape, optional androidx.compose.ui.graphics.Shape? pressedShape, optional androidx.compose.ui.graphics.Shape? checkedShape);
+    method public androidx.compose.ui.graphics.Shape getCheckedShape();
+    method public androidx.compose.ui.graphics.Shape getPressedShape();
+    method public androidx.compose.ui.graphics.Shape getShape();
+    property public final androidx.compose.ui.graphics.Shape checkedShape;
+    property public final androidx.compose.ui.graphics.Shape pressedShape;
+    property public final androidx.compose.ui.graphics.Shape shape;
   }
 
   @SuppressCompatibility @androidx.compose.material3.ExperimentalMaterial3ExpressiveApi public final class ToggleFloatingActionButtonDefaults {
diff --git a/compose/material3/material3/api/restricted_current.txt b/compose/material3/material3/api/restricted_current.txt
index a3501ba..273f29f 100644
--- a/compose/material3/material3/api/restricted_current.txt
+++ b/compose/material3/material3/api/restricted_current.txt
@@ -211,6 +211,7 @@
     method public float getMinWidth();
     method @Deprecated @androidx.compose.runtime.Composable public androidx.compose.foundation.BorderStroke getOutlinedButtonBorder();
     method @androidx.compose.runtime.Composable public androidx.compose.ui.graphics.Shape getOutlinedShape();
+    method @SuppressCompatibility @androidx.compose.material3.ExperimentalMaterial3ExpressiveApi @androidx.compose.runtime.Composable public androidx.compose.ui.graphics.Shape getPressedShape();
     method @androidx.compose.runtime.Composable public androidx.compose.ui.graphics.Shape getShape();
     method public androidx.compose.foundation.layout.PaddingValues getSmallButtonContentPadding();
     method @SuppressCompatibility @androidx.compose.material3.ExperimentalMaterial3ExpressiveApi @androidx.compose.runtime.Composable public androidx.compose.ui.graphics.Shape getSquareShape();
@@ -228,6 +229,7 @@
     method @androidx.compose.runtime.Composable public androidx.compose.foundation.BorderStroke outlinedButtonBorder(optional boolean enabled);
     method @androidx.compose.runtime.Composable public androidx.compose.material3.ButtonColors outlinedButtonColors();
     method @androidx.compose.runtime.Composable public androidx.compose.material3.ButtonColors outlinedButtonColors(optional long containerColor, optional long contentColor, optional long disabledContainerColor, optional long disabledContentColor);
+    method @SuppressCompatibility @androidx.compose.material3.ExperimentalMaterial3ExpressiveApi @androidx.compose.runtime.Composable public androidx.compose.material3.ButtonShapes shapes();
     method @androidx.compose.runtime.Composable public androidx.compose.material3.ButtonColors textButtonColors();
     method @androidx.compose.runtime.Composable public androidx.compose.material3.ButtonColors textButtonColors(optional long containerColor, optional long contentColor, optional long disabledContainerColor, optional long disabledContentColor);
     property public final androidx.compose.foundation.layout.PaddingValues ButtonWithIconContentPadding;
@@ -259,6 +261,7 @@
     property @androidx.compose.runtime.Composable public final androidx.compose.ui.graphics.Shape filledTonalShape;
     property @Deprecated @androidx.compose.runtime.Composable public final androidx.compose.foundation.BorderStroke outlinedButtonBorder;
     property @androidx.compose.runtime.Composable public final androidx.compose.ui.graphics.Shape outlinedShape;
+    property @SuppressCompatibility @androidx.compose.material3.ExperimentalMaterial3ExpressiveApi @androidx.compose.runtime.Composable public final androidx.compose.ui.graphics.Shape pressedShape;
     property @androidx.compose.runtime.Composable public final androidx.compose.ui.graphics.Shape shape;
     property @SuppressCompatibility @androidx.compose.material3.ExperimentalMaterial3ExpressiveApi @androidx.compose.runtime.Composable public final androidx.compose.ui.graphics.Shape squareShape;
     property @androidx.compose.runtime.Composable public final androidx.compose.ui.graphics.Shape textShape;
@@ -269,25 +272,25 @@
   }
 
   @SuppressCompatibility @androidx.compose.material3.ExperimentalMaterial3ExpressiveApi public final class ButtonGroupDefaults {
-    method public float getAnimateFraction();
-    method public androidx.compose.ui.graphics.Shape getConnectedLeadingButtonPressShape();
-    method public androidx.compose.ui.graphics.Shape getConnectedLeadingButtonShape();
+    method @androidx.compose.runtime.Composable public androidx.compose.ui.graphics.Shape getConnectedLeadingButtonPressShape();
+    method @androidx.compose.runtime.Composable public androidx.compose.ui.graphics.Shape getConnectedLeadingButtonShape();
     method public float getConnectedSpaceBetween();
-    method public androidx.compose.ui.graphics.Shape getConnectedTrailingButtonPressShape();
-    method public androidx.compose.ui.graphics.Shape getConnectedTrailingButtonShape();
-    method public float getSpaceBetween();
-    property public final float animateFraction;
-    property public final androidx.compose.ui.graphics.Shape connectedLeadingButtonPressShape;
-    property public final androidx.compose.ui.graphics.Shape connectedLeadingButtonShape;
-    property public final float connectedSpaceBetween;
-    property public final androidx.compose.ui.graphics.Shape connectedTrailingButtonPressShape;
-    property public final androidx.compose.ui.graphics.Shape connectedTrailingButtonShape;
-    property public final float spaceBetween;
+    method @androidx.compose.runtime.Composable public androidx.compose.ui.graphics.Shape getConnectedTrailingButtonPressShape();
+    method @androidx.compose.runtime.Composable public androidx.compose.ui.graphics.Shape getConnectedTrailingButtonShape();
+    method public float getExpandedRatio();
+    method public androidx.compose.foundation.layout.Arrangement.Horizontal getHorizontalArrangement();
+    property public final float ConnectedSpaceBetween;
+    property public final float ExpandedRatio;
+    property public final androidx.compose.foundation.layout.Arrangement.Horizontal HorizontalArrangement;
+    property @androidx.compose.runtime.Composable public final androidx.compose.ui.graphics.Shape connectedLeadingButtonPressShape;
+    property @androidx.compose.runtime.Composable public final androidx.compose.ui.graphics.Shape connectedLeadingButtonShape;
+    property @androidx.compose.runtime.Composable public final androidx.compose.ui.graphics.Shape connectedTrailingButtonPressShape;
+    property @androidx.compose.runtime.Composable public final androidx.compose.ui.graphics.Shape connectedTrailingButtonShape;
     field public static final androidx.compose.material3.ButtonGroupDefaults INSTANCE;
   }
 
   public final class ButtonGroupKt {
-    method @SuppressCompatibility @androidx.compose.material3.ExperimentalMaterial3ExpressiveApi @androidx.compose.runtime.Composable public static void ButtonGroup(optional androidx.compose.ui.Modifier modifier, optional @FloatRange(from=0.0) float animateFraction, optional androidx.compose.foundation.layout.Arrangement.Horizontal horizontalArrangement, kotlin.jvm.functions.Function1<? super androidx.compose.material3.ButtonGroupScope,kotlin.Unit> content);
+    method @SuppressCompatibility @androidx.compose.material3.ExperimentalMaterial3ExpressiveApi @androidx.compose.runtime.Composable public static void ButtonGroup(optional androidx.compose.ui.Modifier modifier, optional @FloatRange(from=0.0) float expandedRatio, optional androidx.compose.foundation.layout.Arrangement.Horizontal horizontalArrangement, kotlin.jvm.functions.Function1<? super androidx.compose.material3.ButtonGroupScope,kotlin.Unit> content);
   }
 
   @SuppressCompatibility @androidx.compose.material3.ExperimentalMaterial3ExpressiveApi public interface ButtonGroupScope {
@@ -295,20 +298,23 @@
   }
 
   public final class ButtonKt {
+    method @SuppressCompatibility @androidx.compose.material3.ExperimentalMaterial3ExpressiveApi @androidx.compose.runtime.Composable public static void Button(kotlin.jvm.functions.Function0<kotlin.Unit> onClick, androidx.compose.material3.ButtonShapes shapes, optional androidx.compose.ui.Modifier modifier, optional boolean enabled, optional androidx.compose.material3.ButtonColors colors, optional androidx.compose.material3.ButtonElevation? elevation, optional androidx.compose.foundation.BorderStroke? border, optional androidx.compose.foundation.layout.PaddingValues contentPadding, optional androidx.compose.foundation.interaction.MutableInteractionSource? interactionSource, kotlin.jvm.functions.Function1<? super androidx.compose.foundation.layout.RowScope,kotlin.Unit> content);
     method @androidx.compose.runtime.Composable public static void Button(kotlin.jvm.functions.Function0<kotlin.Unit> onClick, optional androidx.compose.ui.Modifier modifier, optional boolean enabled, optional androidx.compose.ui.graphics.Shape shape, optional androidx.compose.material3.ButtonColors colors, optional androidx.compose.material3.ButtonElevation? elevation, optional androidx.compose.foundation.BorderStroke? border, optional androidx.compose.foundation.layout.PaddingValues contentPadding, optional androidx.compose.foundation.interaction.MutableInteractionSource? interactionSource, kotlin.jvm.functions.Function1<? super androidx.compose.foundation.layout.RowScope,kotlin.Unit> content);
+    method @SuppressCompatibility @androidx.compose.material3.ExperimentalMaterial3ExpressiveApi @androidx.compose.runtime.Composable public static void ElevatedButton(kotlin.jvm.functions.Function0<kotlin.Unit> onClick, androidx.compose.material3.ButtonShapes shapes, optional androidx.compose.ui.Modifier modifier, optional boolean enabled, optional androidx.compose.material3.ButtonColors colors, optional androidx.compose.material3.ButtonElevation? elevation, optional androidx.compose.foundation.BorderStroke? border, optional androidx.compose.foundation.layout.PaddingValues contentPadding, optional androidx.compose.foundation.interaction.MutableInteractionSource? interactionSource, kotlin.jvm.functions.Function1<? super androidx.compose.foundation.layout.RowScope,kotlin.Unit> content);
     method @androidx.compose.runtime.Composable public static void ElevatedButton(kotlin.jvm.functions.Function0<kotlin.Unit> onClick, optional androidx.compose.ui.Modifier modifier, optional boolean enabled, optional androidx.compose.ui.graphics.Shape shape, optional androidx.compose.material3.ButtonColors colors, optional androidx.compose.material3.ButtonElevation? elevation, optional androidx.compose.foundation.BorderStroke? border, optional androidx.compose.foundation.layout.PaddingValues contentPadding, optional androidx.compose.foundation.interaction.MutableInteractionSource? interactionSource, kotlin.jvm.functions.Function1<? super androidx.compose.foundation.layout.RowScope,kotlin.Unit> content);
+    method @SuppressCompatibility @androidx.compose.material3.ExperimentalMaterial3ExpressiveApi @androidx.compose.runtime.Composable public static void FilledTonalButton(kotlin.jvm.functions.Function0<kotlin.Unit> onClick, androidx.compose.material3.ButtonShapes shapes, optional androidx.compose.ui.Modifier modifier, optional boolean enabled, optional androidx.compose.material3.ButtonColors colors, optional androidx.compose.material3.ButtonElevation? elevation, optional androidx.compose.foundation.BorderStroke? border, optional androidx.compose.foundation.layout.PaddingValues contentPadding, optional androidx.compose.foundation.interaction.MutableInteractionSource? interactionSource, kotlin.jvm.functions.Function1<? super androidx.compose.foundation.layout.RowScope,kotlin.Unit> content);
     method @androidx.compose.runtime.Composable public static void FilledTonalButton(kotlin.jvm.functions.Function0<kotlin.Unit> onClick, optional androidx.compose.ui.Modifier modifier, optional boolean enabled, optional androidx.compose.ui.graphics.Shape shape, optional androidx.compose.material3.ButtonColors colors, optional androidx.compose.material3.ButtonElevation? elevation, optional androidx.compose.foundation.BorderStroke? border, optional androidx.compose.foundation.layout.PaddingValues contentPadding, optional androidx.compose.foundation.interaction.MutableInteractionSource? interactionSource, kotlin.jvm.functions.Function1<? super androidx.compose.foundation.layout.RowScope,kotlin.Unit> content);
+    method @SuppressCompatibility @androidx.compose.material3.ExperimentalMaterial3ExpressiveApi @androidx.compose.runtime.Composable public static void OutlinedButton(kotlin.jvm.functions.Function0<kotlin.Unit> onClick, androidx.compose.material3.ButtonShapes shapes, optional androidx.compose.ui.Modifier modifier, optional boolean enabled, optional androidx.compose.material3.ButtonColors colors, optional androidx.compose.material3.ButtonElevation? elevation, optional androidx.compose.foundation.BorderStroke? border, optional androidx.compose.foundation.layout.PaddingValues contentPadding, optional androidx.compose.foundation.interaction.MutableInteractionSource? interactionSource, kotlin.jvm.functions.Function1<? super androidx.compose.foundation.layout.RowScope,kotlin.Unit> content);
     method @androidx.compose.runtime.Composable public static void OutlinedButton(kotlin.jvm.functions.Function0<kotlin.Unit> onClick, optional androidx.compose.ui.Modifier modifier, optional boolean enabled, optional androidx.compose.ui.graphics.Shape shape, optional androidx.compose.material3.ButtonColors colors, optional androidx.compose.material3.ButtonElevation? elevation, optional androidx.compose.foundation.BorderStroke? border, optional androidx.compose.foundation.layout.PaddingValues contentPadding, optional androidx.compose.foundation.interaction.MutableInteractionSource? interactionSource, kotlin.jvm.functions.Function1<? super androidx.compose.foundation.layout.RowScope,kotlin.Unit> content);
+    method @SuppressCompatibility @androidx.compose.material3.ExperimentalMaterial3ExpressiveApi @androidx.compose.runtime.Composable public static void TextButton(kotlin.jvm.functions.Function0<kotlin.Unit> onClick, androidx.compose.material3.ButtonShapes shapes, optional androidx.compose.ui.Modifier modifier, optional boolean enabled, optional androidx.compose.material3.ButtonColors colors, optional androidx.compose.material3.ButtonElevation? elevation, optional androidx.compose.foundation.BorderStroke? border, optional androidx.compose.foundation.layout.PaddingValues contentPadding, optional androidx.compose.foundation.interaction.MutableInteractionSource? interactionSource, kotlin.jvm.functions.Function1<? super androidx.compose.foundation.layout.RowScope,kotlin.Unit> content);
     method @androidx.compose.runtime.Composable public static void TextButton(kotlin.jvm.functions.Function0<kotlin.Unit> onClick, optional androidx.compose.ui.Modifier modifier, optional boolean enabled, optional androidx.compose.ui.graphics.Shape shape, optional androidx.compose.material3.ButtonColors colors, optional androidx.compose.material3.ButtonElevation? elevation, optional androidx.compose.foundation.BorderStroke? border, optional androidx.compose.foundation.layout.PaddingValues contentPadding, optional androidx.compose.foundation.interaction.MutableInteractionSource? interactionSource, kotlin.jvm.functions.Function1<? super androidx.compose.foundation.layout.RowScope,kotlin.Unit> content);
   }
 
-  public final class ButtonShapes {
-    ctor public ButtonShapes(androidx.compose.ui.graphics.Shape shape, androidx.compose.ui.graphics.Shape pressedShape, androidx.compose.ui.graphics.Shape checkedShape);
-    method public androidx.compose.material3.ButtonShapes copy(optional androidx.compose.ui.graphics.Shape? shape, optional androidx.compose.ui.graphics.Shape? pressedShape, optional androidx.compose.ui.graphics.Shape? checkedShape);
-    method public androidx.compose.ui.graphics.Shape getCheckedShape();
+  @SuppressCompatibility @androidx.compose.material3.ExperimentalMaterial3ExpressiveApi @androidx.compose.runtime.Immutable public final class ButtonShapes {
+    ctor public ButtonShapes(androidx.compose.ui.graphics.Shape shape, androidx.compose.ui.graphics.Shape pressedShape);
+    method public androidx.compose.material3.ButtonShapes copy(optional androidx.compose.ui.graphics.Shape? shape, optional androidx.compose.ui.graphics.Shape? pressedShape);
     method public androidx.compose.ui.graphics.Shape getPressedShape();
     method public androidx.compose.ui.graphics.Shape getShape();
-    property public final androidx.compose.ui.graphics.Shape checkedShape;
     property public final androidx.compose.ui.graphics.Shape pressedShape;
     property public final androidx.compose.ui.graphics.Shape shape;
   }
@@ -2206,10 +2212,12 @@
     method public int getSteps();
     method public float getValue();
     method public kotlin.ranges.ClosedFloatingPointRange<java.lang.Float> getValueRange();
+    method public boolean isDragging();
     method public void setOnValueChange(kotlin.jvm.functions.Function1<? super java.lang.Float,kotlin.Unit>?);
     method public void setOnValueChangeFinished(kotlin.jvm.functions.Function0<kotlin.Unit>?);
     method public void setValue(float);
     property public final float coercedValueAsFraction;
+    property public final boolean isDragging;
     property public final kotlin.jvm.functions.Function1<java.lang.Float,kotlin.Unit>? onValueChange;
     property public final kotlin.jvm.functions.Function0<kotlin.Unit>? onValueChangeFinished;
     property @IntRange(from=0L) public final int steps;
@@ -2787,8 +2795,8 @@
     method @androidx.compose.runtime.Composable public androidx.compose.ui.graphics.Shape getXSmallSquareShape();
     method @androidx.compose.runtime.Composable public androidx.compose.material3.ToggleButtonColors outlinedToggleButtonColors();
     method @androidx.compose.runtime.Composable public androidx.compose.material3.ToggleButtonColors outlinedToggleButtonColors(optional long containerColor, optional long contentColor, optional long disabledContainerColor, optional long disabledContentColor, optional long checkedContainerColor, optional long checkedContentColor);
-    method @androidx.compose.runtime.Composable public androidx.compose.material3.ButtonShapes shapes();
-    method @androidx.compose.runtime.Composable public androidx.compose.material3.ButtonShapes shapes(optional androidx.compose.ui.graphics.Shape? shape, optional androidx.compose.ui.graphics.Shape? pressedShape, optional androidx.compose.ui.graphics.Shape? checkedShape);
+    method @androidx.compose.runtime.Composable public androidx.compose.material3.ToggleButtonShapes shapes();
+    method @androidx.compose.runtime.Composable public androidx.compose.material3.ToggleButtonShapes shapes(optional androidx.compose.ui.graphics.Shape? shape, optional androidx.compose.ui.graphics.Shape? pressedShape, optional androidx.compose.ui.graphics.Shape? checkedShape);
     method @androidx.compose.runtime.Composable public androidx.compose.material3.ToggleButtonColors toggleButtonColors();
     method @androidx.compose.runtime.Composable public androidx.compose.material3.ToggleButtonColors toggleButtonColors(optional long containerColor, optional long contentColor, optional long disabledContainerColor, optional long disabledContentColor, optional long checkedContainerColor, optional long checkedContentColor);
     method @androidx.compose.runtime.Composable public androidx.compose.material3.ToggleButtonColors tonalToggleButtonColors();
@@ -2818,10 +2826,21 @@
   }
 
   public final class ToggleButtonKt {
-    method @SuppressCompatibility @androidx.compose.material3.ExperimentalMaterial3ExpressiveApi @androidx.compose.runtime.Composable public static void ElevatedToggleButton(boolean checked, kotlin.jvm.functions.Function1<? super java.lang.Boolean,kotlin.Unit> onCheckedChange, optional androidx.compose.ui.Modifier modifier, optional boolean enabled, optional androidx.compose.material3.ButtonShapes shapes, optional androidx.compose.material3.ToggleButtonColors colors, optional androidx.compose.material3.ButtonElevation? elevation, optional androidx.compose.foundation.BorderStroke? border, optional androidx.compose.foundation.layout.PaddingValues contentPadding, optional androidx.compose.foundation.interaction.MutableInteractionSource? interactionSource, kotlin.jvm.functions.Function1<? super androidx.compose.foundation.layout.RowScope,kotlin.Unit> content);
-    method @SuppressCompatibility @androidx.compose.material3.ExperimentalMaterial3ExpressiveApi @androidx.compose.runtime.Composable public static void OutlinedToggleButton(boolean checked, kotlin.jvm.functions.Function1<? super java.lang.Boolean,kotlin.Unit> onCheckedChange, optional androidx.compose.ui.Modifier modifier, optional boolean enabled, optional androidx.compose.material3.ButtonShapes shapes, optional androidx.compose.material3.ToggleButtonColors colors, optional androidx.compose.material3.ButtonElevation? elevation, optional androidx.compose.foundation.BorderStroke? border, optional androidx.compose.foundation.layout.PaddingValues contentPadding, optional androidx.compose.foundation.interaction.MutableInteractionSource? interactionSource, kotlin.jvm.functions.Function1<? super androidx.compose.foundation.layout.RowScope,kotlin.Unit> content);
-    method @SuppressCompatibility @androidx.compose.material3.ExperimentalMaterial3ExpressiveApi @androidx.compose.runtime.Composable public static void ToggleButton(boolean checked, kotlin.jvm.functions.Function1<? super java.lang.Boolean,kotlin.Unit> onCheckedChange, optional androidx.compose.ui.Modifier modifier, optional boolean enabled, optional androidx.compose.material3.ButtonShapes shapes, optional androidx.compose.material3.ToggleButtonColors colors, optional androidx.compose.material3.ButtonElevation? elevation, optional androidx.compose.foundation.BorderStroke? border, optional androidx.compose.foundation.layout.PaddingValues contentPadding, optional androidx.compose.foundation.interaction.MutableInteractionSource? interactionSource, kotlin.jvm.functions.Function1<? super androidx.compose.foundation.layout.RowScope,kotlin.Unit> content);
-    method @SuppressCompatibility @androidx.compose.material3.ExperimentalMaterial3ExpressiveApi @androidx.compose.runtime.Composable public static void TonalToggleButton(boolean checked, kotlin.jvm.functions.Function1<? super java.lang.Boolean,kotlin.Unit> onCheckedChange, optional androidx.compose.ui.Modifier modifier, optional boolean enabled, optional androidx.compose.material3.ButtonShapes shapes, optional androidx.compose.material3.ToggleButtonColors colors, optional androidx.compose.material3.ButtonElevation? elevation, optional androidx.compose.foundation.BorderStroke? border, optional androidx.compose.foundation.layout.PaddingValues contentPadding, optional androidx.compose.foundation.interaction.MutableInteractionSource? interactionSource, kotlin.jvm.functions.Function1<? super androidx.compose.foundation.layout.RowScope,kotlin.Unit> content);
+    method @SuppressCompatibility @androidx.compose.material3.ExperimentalMaterial3ExpressiveApi @androidx.compose.runtime.Composable public static void ElevatedToggleButton(boolean checked, kotlin.jvm.functions.Function1<? super java.lang.Boolean,kotlin.Unit> onCheckedChange, optional androidx.compose.ui.Modifier modifier, optional boolean enabled, optional androidx.compose.material3.ToggleButtonShapes shapes, optional androidx.compose.material3.ToggleButtonColors colors, optional androidx.compose.material3.ButtonElevation? elevation, optional androidx.compose.foundation.BorderStroke? border, optional androidx.compose.foundation.layout.PaddingValues contentPadding, optional androidx.compose.foundation.interaction.MutableInteractionSource? interactionSource, kotlin.jvm.functions.Function1<? super androidx.compose.foundation.layout.RowScope,kotlin.Unit> content);
+    method @SuppressCompatibility @androidx.compose.material3.ExperimentalMaterial3ExpressiveApi @androidx.compose.runtime.Composable public static void OutlinedToggleButton(boolean checked, kotlin.jvm.functions.Function1<? super java.lang.Boolean,kotlin.Unit> onCheckedChange, optional androidx.compose.ui.Modifier modifier, optional boolean enabled, optional androidx.compose.material3.ToggleButtonShapes shapes, optional androidx.compose.material3.ToggleButtonColors colors, optional androidx.compose.material3.ButtonElevation? elevation, optional androidx.compose.foundation.BorderStroke? border, optional androidx.compose.foundation.layout.PaddingValues contentPadding, optional androidx.compose.foundation.interaction.MutableInteractionSource? interactionSource, kotlin.jvm.functions.Function1<? super androidx.compose.foundation.layout.RowScope,kotlin.Unit> content);
+    method @SuppressCompatibility @androidx.compose.material3.ExperimentalMaterial3ExpressiveApi @androidx.compose.runtime.Composable public static void ToggleButton(boolean checked, kotlin.jvm.functions.Function1<? super java.lang.Boolean,kotlin.Unit> onCheckedChange, optional androidx.compose.ui.Modifier modifier, optional boolean enabled, optional androidx.compose.material3.ToggleButtonShapes shapes, optional androidx.compose.material3.ToggleButtonColors colors, optional androidx.compose.material3.ButtonElevation? elevation, optional androidx.compose.foundation.BorderStroke? border, optional androidx.compose.foundation.layout.PaddingValues contentPadding, optional androidx.compose.foundation.interaction.MutableInteractionSource? interactionSource, kotlin.jvm.functions.Function1<? super androidx.compose.foundation.layout.RowScope,kotlin.Unit> content);
+    method @SuppressCompatibility @androidx.compose.material3.ExperimentalMaterial3ExpressiveApi @androidx.compose.runtime.Composable public static void TonalToggleButton(boolean checked, kotlin.jvm.functions.Function1<? super java.lang.Boolean,kotlin.Unit> onCheckedChange, optional androidx.compose.ui.Modifier modifier, optional boolean enabled, optional androidx.compose.material3.ToggleButtonShapes shapes, optional androidx.compose.material3.ToggleButtonColors colors, optional androidx.compose.material3.ButtonElevation? elevation, optional androidx.compose.foundation.BorderStroke? border, optional androidx.compose.foundation.layout.PaddingValues contentPadding, optional androidx.compose.foundation.interaction.MutableInteractionSource? interactionSource, kotlin.jvm.functions.Function1<? super androidx.compose.foundation.layout.RowScope,kotlin.Unit> content);
+  }
+
+  @SuppressCompatibility @androidx.compose.material3.ExperimentalMaterial3ExpressiveApi @androidx.compose.runtime.Immutable public final class ToggleButtonShapes {
+    ctor public ToggleButtonShapes(androidx.compose.ui.graphics.Shape shape, androidx.compose.ui.graphics.Shape pressedShape, androidx.compose.ui.graphics.Shape checkedShape);
+    method public androidx.compose.material3.ToggleButtonShapes copy(optional androidx.compose.ui.graphics.Shape? shape, optional androidx.compose.ui.graphics.Shape? pressedShape, optional androidx.compose.ui.graphics.Shape? checkedShape);
+    method public androidx.compose.ui.graphics.Shape getCheckedShape();
+    method public androidx.compose.ui.graphics.Shape getPressedShape();
+    method public androidx.compose.ui.graphics.Shape getShape();
+    property public final androidx.compose.ui.graphics.Shape checkedShape;
+    property public final androidx.compose.ui.graphics.Shape pressedShape;
+    property public final androidx.compose.ui.graphics.Shape shape;
   }
 
   @SuppressCompatibility @androidx.compose.material3.ExperimentalMaterial3ExpressiveApi public final class ToggleFloatingActionButtonDefaults {
diff --git a/compose/material3/material3/integration-tests/material3-catalog/src/main/java/androidx/compose/material3/catalog/library/model/Examples.kt b/compose/material3/material3/integration-tests/material3-catalog/src/main/java/androidx/compose/material3/catalog/library/model/Examples.kt
index 6d3b4e5..6ab1a76 100644
--- a/compose/material3/material3/integration-tests/material3-catalog/src/main/java/androidx/compose/material3/catalog/library/model/Examples.kt
+++ b/compose/material3/material3/integration-tests/material3-catalog/src/main/java/androidx/compose/material3/catalog/library/model/Examples.kt
@@ -38,6 +38,7 @@
 import androidx.compose.material3.samples.BottomSheetScaffoldNestedScrollSample
 import androidx.compose.material3.samples.ButtonGroupSample
 import androidx.compose.material3.samples.ButtonSample
+import androidx.compose.material3.samples.ButtonWithAnimatedShapeSample
 import androidx.compose.material3.samples.ButtonWithIconSample
 import androidx.compose.material3.samples.CardSample
 import androidx.compose.material3.samples.CenteredHorizontalFloatingToolbarWithFabSample
@@ -67,6 +68,7 @@
 import androidx.compose.material3.samples.EditableExposedDropdownMenuSample
 import androidx.compose.material3.samples.ElevatedAssistChipSample
 import androidx.compose.material3.samples.ElevatedButtonSample
+import androidx.compose.material3.samples.ElevatedButtonWithAnimatedShapeSample
 import androidx.compose.material3.samples.ElevatedCardSample
 import androidx.compose.material3.samples.ElevatedFilterChipSample
 import androidx.compose.material3.samples.ElevatedSplitButtonSample
@@ -96,6 +98,7 @@
 import androidx.compose.material3.samples.FilledIconToggleButtonSample
 import androidx.compose.material3.samples.FilledSplitButtonSample
 import androidx.compose.material3.samples.FilledTonalButtonSample
+import androidx.compose.material3.samples.FilledTonalButtonWithAnimatedShapeSample
 import androidx.compose.material3.samples.FilledTonalIconButtonSample
 import androidx.compose.material3.samples.FilledTonalIconToggleButtonSample
 import androidx.compose.material3.samples.FilterChipSample
@@ -148,6 +151,7 @@
 import androidx.compose.material3.samples.NavigationRailWithOnlySelectedLabelsSample
 import androidx.compose.material3.samples.OneLineListItem
 import androidx.compose.material3.samples.OutlinedButtonSample
+import androidx.compose.material3.samples.OutlinedButtonWithAnimatedShapeSample
 import androidx.compose.material3.samples.OutlinedCardSample
 import androidx.compose.material3.samples.OutlinedIconButtonSample
 import androidx.compose.material3.samples.OutlinedIconToggleButtonSample
@@ -225,6 +229,7 @@
 import androidx.compose.material3.samples.TextAndIconTabs
 import androidx.compose.material3.samples.TextArea
 import androidx.compose.material3.samples.TextButtonSample
+import androidx.compose.material3.samples.TextButtonWithAnimatedShapeSample
 import androidx.compose.material3.samples.TextFieldWithErrorState
 import androidx.compose.material3.samples.TextFieldWithHideKeyboardOnImeAction
 import androidx.compose.material3.samples.TextFieldWithIcons
@@ -346,6 +351,13 @@
             ButtonSample()
         },
         Example(
+            name = "ButtonWithAnimatedShapeSample",
+            description = ButtonsExampleDescription,
+            sourceUrl = ButtonsExampleSourceUrl,
+        ) {
+            ButtonWithAnimatedShapeSample()
+        },
+        Example(
             name = "SquareButtonSample",
             description = ButtonsExampleDescription,
             sourceUrl = ButtonsExampleSourceUrl,
@@ -367,6 +379,13 @@
             ElevatedButtonSample()
         },
         Example(
+            name = "ElevatedButtonWithAnimatedShapeSample",
+            description = ButtonsExampleDescription,
+            sourceUrl = ButtonsExampleSourceUrl,
+        ) {
+            ElevatedButtonWithAnimatedShapeSample()
+        },
+        Example(
             name = "FilledTonalButtonSample",
             description = ButtonsExampleDescription,
             sourceUrl = ButtonsExampleSourceUrl,
@@ -374,6 +393,13 @@
             FilledTonalButtonSample()
         },
         Example(
+            name = "FilledTonalButtonWithAnimatedShapeSample",
+            description = ButtonsExampleDescription,
+            sourceUrl = ButtonsExampleSourceUrl,
+        ) {
+            FilledTonalButtonWithAnimatedShapeSample()
+        },
+        Example(
             name = "OutlinedButtonSample",
             description = ButtonsExampleDescription,
             sourceUrl = ButtonsExampleSourceUrl,
@@ -381,6 +407,13 @@
             OutlinedButtonSample()
         },
         Example(
+            name = "OutlinedButtonWithAnimatedShapeSample",
+            description = ButtonsExampleDescription,
+            sourceUrl = ButtonsExampleSourceUrl,
+        ) {
+            OutlinedButtonWithAnimatedShapeSample()
+        },
+        Example(
             name = "TextButtonSample",
             description = ButtonsExampleDescription,
             sourceUrl = ButtonsExampleSourceUrl,
@@ -388,6 +421,13 @@
             TextButtonSample()
         },
         Example(
+            name = "TextButtonWithAnimatedShapeSample",
+            description = ButtonsExampleDescription,
+            sourceUrl = ButtonsExampleSourceUrl,
+        ) {
+            TextButtonWithAnimatedShapeSample()
+        },
+        Example(
             name = "ButtonWithIconSample",
             description = ButtonsExampleDescription,
             sourceUrl = ButtonsExampleSourceUrl,
diff --git a/compose/material3/material3/lint-baseline.xml b/compose/material3/material3/lint-baseline.xml
index 36d385f..2c56cb3 100644
--- a/compose/material3/material3/lint-baseline.xml
+++ b/compose/material3/material3/lint-baseline.xml
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<issues format="6" by="lint 8.7.0-alpha02" type="baseline" client="gradle" dependencies="false" name="AGP (8.7.0-alpha02)" variant="all" version="8.7.0-alpha02">
+<issues format="6" by="lint 8.9.0-alpha06" type="baseline" client="gradle" dependencies="false" name="AGP (8.9.0-alpha06)" variant="all" version="8.9.0-alpha06">
 
     <issue
         id="BanThreadSleep"
@@ -52,6 +52,96 @@
         errorLine1="        Thread.sleep(300)"
         errorLine2="               ~~~~~">
         <location
+            file="src/androidInstrumentedTest/kotlin/androidx/compose/material3/ButtonScreenshotTest.kt"/>
+    </issue>
+
+    <issue
+        id="BanThreadSleep"
+        message="Uses Thread.sleep()"
+        errorLine1="        Thread.sleep(300)"
+        errorLine2="               ~~~~~">
+        <location
+            file="src/androidInstrumentedTest/kotlin/androidx/compose/material3/ButtonScreenshotTest.kt"/>
+    </issue>
+
+    <issue
+        id="BanThreadSleep"
+        message="Uses Thread.sleep()"
+        errorLine1="        Thread.sleep(300)"
+        errorLine2="               ~~~~~">
+        <location
+            file="src/androidInstrumentedTest/kotlin/androidx/compose/material3/ButtonScreenshotTest.kt"/>
+    </issue>
+
+    <issue
+        id="BanThreadSleep"
+        message="Uses Thread.sleep()"
+        errorLine1="        Thread.sleep(300)"
+        errorLine2="               ~~~~~">
+        <location
+            file="src/androidInstrumentedTest/kotlin/androidx/compose/material3/ButtonScreenshotTest.kt"/>
+    </issue>
+
+    <issue
+        id="BanThreadSleep"
+        message="Uses Thread.sleep()"
+        errorLine1="        Thread.sleep(300)"
+        errorLine2="               ~~~~~">
+        <location
+            file="src/androidInstrumentedTest/kotlin/androidx/compose/material3/ButtonScreenshotTest.kt"/>
+    </issue>
+
+    <issue
+        id="BanThreadSleep"
+        message="Uses Thread.sleep()"
+        errorLine1="        Thread.sleep(300)"
+        errorLine2="               ~~~~~">
+        <location
+            file="src/androidInstrumentedTest/kotlin/androidx/compose/material3/ButtonScreenshotTest.kt"/>
+    </issue>
+
+    <issue
+        id="BanThreadSleep"
+        message="Uses Thread.sleep()"
+        errorLine1="        Thread.sleep(300)"
+        errorLine2="               ~~~~~">
+        <location
+            file="src/androidInstrumentedTest/kotlin/androidx/compose/material3/ButtonScreenshotTest.kt"/>
+    </issue>
+
+    <issue
+        id="BanThreadSleep"
+        message="Uses Thread.sleep()"
+        errorLine1="        Thread.sleep(300)"
+        errorLine2="               ~~~~~">
+        <location
+            file="src/androidInstrumentedTest/kotlin/androidx/compose/material3/ButtonScreenshotTest.kt"/>
+    </issue>
+
+    <issue
+        id="BanThreadSleep"
+        message="Uses Thread.sleep()"
+        errorLine1="        Thread.sleep(300)"
+        errorLine2="               ~~~~~">
+        <location
+            file="src/androidInstrumentedTest/kotlin/androidx/compose/material3/ButtonScreenshotTest.kt"/>
+    </issue>
+
+    <issue
+        id="BanThreadSleep"
+        message="Uses Thread.sleep()"
+        errorLine1="        Thread.sleep(300)"
+        errorLine2="               ~~~~~">
+        <location
+            file="src/androidInstrumentedTest/kotlin/androidx/compose/material3/ButtonScreenshotTest.kt"/>
+    </issue>
+
+    <issue
+        id="BanThreadSleep"
+        message="Uses Thread.sleep()"
+        errorLine1="        Thread.sleep(300)"
+        errorLine2="               ~~~~~">
+        <location
             file="src/androidInstrumentedTest/kotlin/androidx/compose/material3/CardScreenshotTest.kt"/>
     </issue>
 
diff --git a/compose/material3/material3/samples/src/main/java/androidx/compose/material3/samples/ButtonGroupSamples.kt b/compose/material3/material3/samples/src/main/java/androidx/compose/material3/samples/ButtonGroupSamples.kt
index d9aa02d..aedab65 100644
--- a/compose/material3/material3/samples/src/main/java/androidx/compose/material3/samples/ButtonGroupSamples.kt
+++ b/compose/material3/material3/samples/src/main/java/androidx/compose/material3/samples/ButtonGroupSamples.kt
@@ -31,13 +31,13 @@
 import androidx.compose.material.icons.outlined.Work
 import androidx.compose.material3.ButtonGroup
 import androidx.compose.material3.ButtonGroupDefaults
-import androidx.compose.material3.ButtonShapes
 import androidx.compose.material3.ExperimentalMaterial3ExpressiveApi
 import androidx.compose.material3.Icon
 import androidx.compose.material3.ShapeDefaults
 import androidx.compose.material3.Text
 import androidx.compose.material3.ToggleButton
 import androidx.compose.material3.ToggleButtonDefaults
+import androidx.compose.material3.ToggleButtonShapes
 import androidx.compose.runtime.Composable
 import androidx.compose.runtime.getValue
 import androidx.compose.runtime.mutableIntStateOf
@@ -81,19 +81,19 @@
 @Composable
 fun SingleSelectConnectedButtonGroupSample() {
     val startButtonShapes =
-        ButtonShapes(
+        ToggleButtonShapes(
             shape = ButtonGroupDefaults.connectedLeadingButtonShape,
             pressedShape = ButtonGroupDefaults.connectedLeadingButtonPressShape,
             checkedShape = ToggleButtonDefaults.checkedShape
         )
     val middleButtonShapes =
-        ButtonShapes(
+        ToggleButtonShapes(
             shape = ShapeDefaults.Small,
             pressedShape = ToggleButtonDefaults.pressedShape,
             checkedShape = ToggleButtonDefaults.checkedShape
         )
     val endButtonShapes =
-        ButtonShapes(
+        ToggleButtonShapes(
             shape = ButtonGroupDefaults.connectedTrailingButtonShape,
             pressedShape = ButtonGroupDefaults.connectedTrailingButtonPressShape,
             checkedShape = ToggleButtonDefaults.checkedShape
@@ -107,8 +107,8 @@
 
     ButtonGroup(
         modifier = Modifier.padding(horizontal = 8.dp),
-        horizontalArrangement = Arrangement.spacedBy(ButtonGroupDefaults.connectedSpaceBetween),
-        animateFraction = 0f
+        horizontalArrangement = Arrangement.spacedBy(ButtonGroupDefaults.ConnectedSpaceBetween),
+        expandedRatio = 0f
     ) {
         options.forEachIndexed { index, label ->
             ToggleButton(
@@ -132,19 +132,19 @@
 @Composable
 fun MultiSelectConnectedButtonGroupSample() {
     val startButtonShapes =
-        ButtonShapes(
+        ToggleButtonShapes(
             shape = ButtonGroupDefaults.connectedLeadingButtonShape,
             pressedShape = ButtonGroupDefaults.connectedLeadingButtonPressShape,
             checkedShape = ToggleButtonDefaults.checkedShape
         )
     val middleButtonShapes =
-        ButtonShapes(
+        ToggleButtonShapes(
             shape = ShapeDefaults.Small,
             pressedShape = ToggleButtonDefaults.pressedShape,
             checkedShape = ToggleButtonDefaults.checkedShape
         )
     val endButtonShapes =
-        ButtonShapes(
+        ToggleButtonShapes(
             shape = ButtonGroupDefaults.connectedTrailingButtonShape,
             pressedShape = ButtonGroupDefaults.connectedTrailingButtonPressShape,
             checkedShape = ToggleButtonDefaults.checkedShape
@@ -158,8 +158,8 @@
 
     ButtonGroup(
         modifier = Modifier.padding(horizontal = 8.dp),
-        horizontalArrangement = Arrangement.spacedBy(ButtonGroupDefaults.connectedSpaceBetween),
-        animateFraction = 0f
+        horizontalArrangement = Arrangement.spacedBy(ButtonGroupDefaults.ConnectedSpaceBetween),
+        expandedRatio = 0f
     ) {
         options.forEachIndexed { index, label ->
             ToggleButton(
diff --git a/compose/material3/material3/samples/src/main/java/androidx/compose/material3/samples/ButtonSamples.kt b/compose/material3/material3/samples/src/main/java/androidx/compose/material3/samples/ButtonSamples.kt
index 3b04b270..3f92b08 100644
--- a/compose/material3/material3/samples/src/main/java/androidx/compose/material3/samples/ButtonSamples.kt
+++ b/compose/material3/material3/samples/src/main/java/androidx/compose/material3/samples/ButtonSamples.kt
@@ -41,7 +41,15 @@
 @Sampled
 @Composable
 fun ButtonSample() {
-    Button(onClick = { /* Do something! */ }) { Text("Button") }
+    Button(onClick = {}) { Text("Button") }
+}
+
+@OptIn(ExperimentalMaterial3ExpressiveApi::class)
+@Preview
+@Sampled
+@Composable
+fun ButtonWithAnimatedShapeSample() {
+    Button(onClick = {}, shapes = ButtonDefaults.shapes()) { Text("Button") }
 }
 
 @OptIn(ExperimentalMaterial3ExpressiveApi::class)
@@ -72,6 +80,14 @@
     ElevatedButton(onClick = { /* Do something! */ }) { Text("Elevated Button") }
 }
 
+@OptIn(ExperimentalMaterial3ExpressiveApi::class)
+@Preview
+@Sampled
+@Composable
+fun ElevatedButtonWithAnimatedShapeSample() {
+    ElevatedButton(onClick = {}, shapes = ButtonDefaults.shapes()) { Text("Elevated Button") }
+}
+
 @Preview
 @Sampled
 @Composable
@@ -79,6 +95,16 @@
     FilledTonalButton(onClick = { /* Do something! */ }) { Text("Filled Tonal Button") }
 }
 
+@OptIn(ExperimentalMaterial3ExpressiveApi::class)
+@Preview
+@Sampled
+@Composable
+fun FilledTonalButtonWithAnimatedShapeSample() {
+    FilledTonalButton(onClick = {}, shapes = ButtonDefaults.shapes()) {
+        Text("Filled Tonal Button")
+    }
+}
+
 @Preview
 @Sampled
 @Composable
@@ -86,6 +112,14 @@
     OutlinedButton(onClick = { /* Do something! */ }) { Text("Outlined Button") }
 }
 
+@OptIn(ExperimentalMaterial3ExpressiveApi::class)
+@Preview
+@Sampled
+@Composable
+fun OutlinedButtonWithAnimatedShapeSample() {
+    OutlinedButton(onClick = {}, shapes = ButtonDefaults.shapes()) { Text("Outlined Button") }
+}
+
 @Preview
 @Sampled
 @Composable
@@ -93,6 +127,14 @@
     TextButton(onClick = { /* Do something! */ }) { Text("Text Button") }
 }
 
+@OptIn(ExperimentalMaterial3ExpressiveApi::class)
+@Preview
+@Sampled
+@Composable
+fun TextButtonWithAnimatedShapeSample() {
+    TextButton(onClick = {}, shapes = ButtonDefaults.shapes()) { Text("Text Button") }
+}
+
 @Preview
 @Sampled
 @Composable
diff --git a/compose/material3/material3/samples/src/main/java/androidx/compose/material3/samples/SliderSamples.kt b/compose/material3/material3/samples/src/main/java/androidx/compose/material3/samples/SliderSamples.kt
index 5a8230df..a71addb 100644
--- a/compose/material3/material3/samples/src/main/java/androidx/compose/material3/samples/SliderSamples.kt
+++ b/compose/material3/material3/samples/src/main/java/androidx/compose/material3/samples/SliderSamples.kt
@@ -17,6 +17,7 @@
 package androidx.compose.material3.samples
 
 import androidx.annotation.Sampled
+import androidx.compose.animation.core.animate
 import androidx.compose.foundation.indication
 import androidx.compose.foundation.interaction.MutableInteractionSource
 import androidx.compose.foundation.layout.Column
@@ -39,6 +40,7 @@
 import androidx.compose.material3.ExperimentalMaterial3ExpressiveApi
 import androidx.compose.material3.Icon
 import androidx.compose.material3.Label
+import androidx.compose.material3.MaterialTheme
 import androidx.compose.material3.PlainTooltip
 import androidx.compose.material3.RangeSlider
 import androidx.compose.material3.RangeSliderState
@@ -50,8 +52,10 @@
 import androidx.compose.material3.ripple
 import androidx.compose.runtime.Composable
 import androidx.compose.runtime.getValue
+import androidx.compose.runtime.mutableFloatStateOf
 import androidx.compose.runtime.mutableStateOf
 import androidx.compose.runtime.remember
+import androidx.compose.runtime.rememberCoroutineScope
 import androidx.compose.runtime.setValue
 import androidx.compose.ui.Alignment
 import androidx.compose.ui.Modifier
@@ -69,6 +73,8 @@
 import androidx.compose.ui.unit.DpSize
 import androidx.compose.ui.unit.dp
 import kotlin.math.roundToInt
+import kotlinx.coroutines.Job
+import kotlinx.coroutines.launch
 
 @Preview
 @Sampled
@@ -308,6 +314,7 @@
 @Sampled
 @Composable
 fun VerticalSliderSample() {
+    val coroutineScope = rememberCoroutineScope()
     val sliderState = remember {
         SliderState(
             valueRange = 0f..100f,
@@ -317,6 +324,29 @@
             }
         )
     }
+    val snapAnimationSpec = MaterialTheme.motionScheme.fastEffectsSpec<Float>()
+    var currentValue by remember { mutableFloatStateOf(sliderState.value) }
+    var animateJob: Job? by remember { mutableStateOf(null) }
+    sliderState.onValueChange = { newValue ->
+        currentValue = newValue
+        // only update the sliderState instantly if dragging
+        if (sliderState.isDragging) {
+            animateJob?.cancel()
+            sliderState.value = newValue
+        }
+    }
+    sliderState.onValueChangeFinished = {
+        animateJob =
+            coroutineScope.launch {
+                animate(
+                    initialValue = sliderState.value,
+                    targetValue = currentValue,
+                    animationSpec = snapAnimationSpec
+                ) { value, _ ->
+                    sliderState.value = value
+                }
+            }
+    }
     val interactionSource = remember { MutableInteractionSource() }
     Column(modifier = Modifier.padding(horizontal = 16.dp)) {
         Text(
diff --git a/compose/material3/material3/samples/src/main/java/androidx/compose/material3/samples/TimePickerSamples.kt b/compose/material3/material3/samples/src/main/java/androidx/compose/material3/samples/TimePickerSamples.kt
index 98b620c..b051fcd 100644
--- a/compose/material3/material3/samples/src/main/java/androidx/compose/material3/samples/TimePickerSamples.kt
+++ b/compose/material3/material3/samples/src/main/java/androidx/compose/material3/samples/TimePickerSamples.kt
@@ -222,7 +222,6 @@
             tonalElevation = 6.dp,
             modifier =
                 Modifier.width(IntrinsicSize.Min)
-                    .height(IntrinsicSize.Min)
                     .background(
                         shape = MaterialTheme.shapes.extraLarge,
                         color = MaterialTheme.colorScheme.surface
diff --git a/compose/material3/material3/samples/src/main/java/androidx/compose/material3/samples/ToggleButtonSamples.kt b/compose/material3/material3/samples/src/main/java/androidx/compose/material3/samples/ToggleButtonSamples.kt
index 5006587..49b797d 100644
--- a/compose/material3/material3/samples/src/main/java/androidx/compose/material3/samples/ToggleButtonSamples.kt
+++ b/compose/material3/material3/samples/src/main/java/androidx/compose/material3/samples/ToggleButtonSamples.kt
@@ -24,7 +24,6 @@
 import androidx.compose.material.icons.filled.Edit
 import androidx.compose.material.icons.outlined.Edit
 import androidx.compose.material3.ButtonDefaults
-import androidx.compose.material3.ButtonShapes
 import androidx.compose.material3.ElevatedToggleButton
 import androidx.compose.material3.ExperimentalMaterial3ExpressiveApi
 import androidx.compose.material3.Icon
@@ -33,6 +32,7 @@
 import androidx.compose.material3.Text
 import androidx.compose.material3.ToggleButton
 import androidx.compose.material3.ToggleButtonDefaults
+import androidx.compose.material3.ToggleButtonShapes
 import androidx.compose.material3.TonalToggleButton
 import androidx.compose.runtime.Composable
 import androidx.compose.runtime.getValue
@@ -58,7 +58,7 @@
 fun SquareToggleButtonSample() {
     var checked by remember { mutableStateOf(false) }
     val shapes =
-        ButtonShapes(
+        ToggleButtonShapes(
             shape = ToggleButtonDefaults.squareShape,
             pressedShape = ToggleButtonDefaults.pressedShape,
             checkedShape = ToggleButtonDefaults.roundShape
diff --git a/compose/material3/material3/src/androidInstrumentedTest/kotlin/androidx/compose/material3/ButtonGroupTest.kt b/compose/material3/material3/src/androidInstrumentedTest/kotlin/androidx/compose/material3/ButtonGroupTest.kt
index fb0b3e3..156c847 100644
--- a/compose/material3/material3/src/androidInstrumentedTest/kotlin/androidx/compose/material3/ButtonGroupTest.kt
+++ b/compose/material3/material3/src/androidInstrumentedTest/kotlin/androidx/compose/material3/ButtonGroupTest.kt
@@ -101,9 +101,9 @@
     @Test
     fun default_firstPressed_buttonSizing() {
         val width = 75.dp
-        val animateFraction = 0.15f
-        val expectedExpandWidth = width + (width * animateFraction)
-        val expectedCompressWidth = width - (width * animateFraction)
+        val expandedWeight = 0.15f
+        val expectedExpandWidth = width + (width * expandedWeight)
+        val expectedCompressWidth = width - (width * expandedWeight)
 
         rule.setMaterialContent(lightColorScheme()) {
             Box(Modifier.testTag(wrapperTestTag)) {
@@ -147,9 +147,9 @@
     @Test
     fun default_secondPressed_buttonSizing() {
         val width = 75.dp
-        val animateFraction = 0.15f
-        val expectedExpandWidth = width + (width * animateFraction)
-        val expectedCompressWidth = width - (width * (animateFraction / 2f))
+        val expandedWeight = 0.15f
+        val expectedExpandWidth = width + (width * expandedWeight)
+        val expectedCompressWidth = width - (width * (expandedWeight / 2f))
 
         rule.setMaterialContent(lightColorScheme()) {
             Box(Modifier.testTag(wrapperTestTag)) {
@@ -193,9 +193,9 @@
     @Test
     fun default_thirdPressed_buttonSizing() {
         val width = 75.dp
-        val animateFraction = 0.15f
-        val expectedExpandWidth = width + (width * animateFraction)
-        val expectedCompressWidth = width - (width * (animateFraction / 2f))
+        val expandedWeight = 0.15f
+        val expectedExpandWidth = width + (width * expandedWeight)
+        val expectedCompressWidth = width - (width * (expandedWeight / 2f))
 
         rule.setMaterialContent(lightColorScheme()) {
             Box(Modifier.testTag(wrapperTestTag)) {
@@ -239,9 +239,9 @@
     @Test
     fun default_fourthPressed_buttonSizing() {
         val width = 75.dp
-        val animateFraction = 0.15f
-        val expectedExpandWidth = width + (width * animateFraction)
-        val expectedCompressWidth = width - (width * animateFraction)
+        val expandedWeight = 0.15f
+        val expectedExpandWidth = width + (width * expandedWeight)
+        val expectedCompressWidth = width - (width * expandedWeight)
 
         rule.setMaterialContent(lightColorScheme()) {
             Box(Modifier.testTag(wrapperTestTag)) {
@@ -285,13 +285,13 @@
     @Test
     fun customAnimateFraction_firstPressed_buttonSizing() {
         val width = 75.dp
-        val animateFraction = 0.3f
-        val expectedExpandWidth = width + (width * animateFraction)
-        val expectedCompressWidth = width - (width * animateFraction)
+        val expandedWeight = 0.3f
+        val expectedExpandWidth = width + (width * expandedWeight)
+        val expectedCompressWidth = width - (width * expandedWeight)
 
         rule.setMaterialContent(lightColorScheme()) {
             Box(Modifier.testTag(wrapperTestTag)) {
-                ButtonGroup(animateFraction = animateFraction) {
+                ButtonGroup(expandedRatio = expandedWeight) {
                     Button(modifier = Modifier.width(width).testTag(aButton), onClick = {}) {
                         Text("A")
                     }
@@ -331,13 +331,13 @@
     @Test
     fun customAnimateFraction_secondPressed_buttonSizing() {
         val width = 75.dp
-        val animateFraction = 0.3f
-        val expectedExpandWidth = width + (width * animateFraction)
-        val expectedCompressWidth = width - (width * animateFraction / 2f)
+        val expandedWeight = 0.3f
+        val expectedExpandWidth = width + (width * expandedWeight)
+        val expectedCompressWidth = width - (width * expandedWeight / 2f)
 
         rule.setMaterialContent(lightColorScheme()) {
             Box(Modifier.testTag(wrapperTestTag)) {
-                ButtonGroup(animateFraction = animateFraction) {
+                ButtonGroup(expandedRatio = expandedWeight) {
                     Button(modifier = Modifier.width(width).testTag(aButton), onClick = {}) {
                         Text("A")
                     }
@@ -377,13 +377,13 @@
     @Test
     fun customAnimateFraction_thirdPressed_buttonSizing() {
         val width = 75.dp
-        val animateFraction = 0.3f
-        val expectedExpandWidth = width + (width * animateFraction)
-        val expectedCompressWidth = width - (width * animateFraction / 2f)
+        val expandedWeight = 0.3f
+        val expectedExpandWidth = width + (width * expandedWeight)
+        val expectedCompressWidth = width - (width * expandedWeight / 2f)
 
         rule.setMaterialContent(lightColorScheme()) {
             Box(Modifier.testTag(wrapperTestTag)) {
-                ButtonGroup(animateFraction = animateFraction) {
+                ButtonGroup(expandedRatio = expandedWeight) {
                     Button(modifier = Modifier.width(width).testTag(aButton), onClick = {}) {
                         Text("A")
                     }
@@ -423,13 +423,13 @@
     @Test
     fun customAnimateFraction_fourthPressed_buttonSizing() {
         val width = 75.dp
-        val animateFraction = 0.3f
-        val expectedExpandWidth = width + (width * animateFraction)
-        val expectedCompressWidth = width - (width * animateFraction)
+        val expandedWeight = 0.3f
+        val expectedExpandWidth = width + (width * expandedWeight)
+        val expectedCompressWidth = width - (width * expandedWeight)
 
         rule.setMaterialContent(lightColorScheme()) {
             Box(Modifier.testTag(wrapperTestTag)) {
-                ButtonGroup(animateFraction = animateFraction) {
+                ButtonGroup(expandedRatio = expandedWeight) {
                     Button(modifier = Modifier.width(width).testTag(aButton), onClick = {}) {
                         Text("A")
                     }
diff --git a/compose/material3/material3/src/androidInstrumentedTest/kotlin/androidx/compose/material3/ButtonScreenshotTest.kt b/compose/material3/material3/src/androidInstrumentedTest/kotlin/androidx/compose/material3/ButtonScreenshotTest.kt
index c192fc5..4f2f782 100644
--- a/compose/material3/material3/src/androidInstrumentedTest/kotlin/androidx/compose/material3/ButtonScreenshotTest.kt
+++ b/compose/material3/material3/src/androidInstrumentedTest/kotlin/androidx/compose/material3/ButtonScreenshotTest.kt
@@ -31,6 +31,7 @@
 import androidx.compose.ui.test.junit4.createComposeRule
 import androidx.compose.ui.test.onNodeWithTag
 import androidx.compose.ui.test.onNodeWithText
+import androidx.compose.ui.test.performTouchInput
 import androidx.compose.ui.unit.dp
 import androidx.test.ext.junit.runners.AndroidJUnit4
 import androidx.test.filters.MediumTest
@@ -49,6 +50,8 @@
 
     @get:Rule val screenshotRule = AndroidXScreenshotTestRule(GOLDEN_MATERIAL3)
 
+    private val buttonTestTag = "button"
+
     @Test
     fun default_button_light_theme() {
         rule.setMaterialContent(lightColorScheme()) { Button(onClick = {}) { Text("Button") } }
@@ -143,14 +146,14 @@
             FilledTonalButton(
                 onClick = {},
                 enabled = false,
-                modifier = Modifier.testTag("button")
+                modifier = Modifier.testTag(buttonTestTag)
             ) {
                 Text("Filled tonal Button")
             }
         }
 
         rule
-            .onNodeWithTag("button")
+            .onNodeWithTag(buttonTestTag)
             .captureToImage()
             .assertAgainstGolden(screenshotRule, "filled_tonal_button_disabled_light_theme")
     }
@@ -170,13 +173,17 @@
     @Test
     fun disabled_outlined_button_lightTheme() {
         rule.setMaterialContent(lightColorScheme()) {
-            OutlinedButton(onClick = {}, enabled = false, modifier = Modifier.testTag("button")) {
+            OutlinedButton(
+                onClick = {},
+                enabled = false,
+                modifier = Modifier.testTag(buttonTestTag)
+            ) {
                 Text("Outlined Button")
             }
         }
 
         rule
-            .onNodeWithTag("button")
+            .onNodeWithTag(buttonTestTag)
             .captureToImage()
             .assertAgainstGolden(screenshotRule, "outlined_button_disabled_light_theme")
     }
@@ -196,13 +203,13 @@
     @Test
     fun disabled_text_button_lightTheme() {
         rule.setMaterialContent(lightColorScheme()) {
-            TextButton(onClick = {}, enabled = false, modifier = Modifier.testTag("button")) {
+            TextButton(onClick = {}, enabled = false, modifier = Modifier.testTag(buttonTestTag)) {
                 Text("Text Button")
             }
         }
 
         rule
-            .onNodeWithTag("button")
+            .onNodeWithTag(buttonTestTag)
             .captureToImage()
             .assertAgainstGolden(screenshotRule, "text_button_disabled_light_theme")
     }
@@ -237,7 +244,7 @@
                 onClick = { /* Do something! */ },
                 contentPadding = ButtonDefaults.ButtonWithIconContentPadding,
                 enabled = false,
-                modifier = Modifier.testTag("button")
+                modifier = Modifier.testTag(buttonTestTag)
             ) {
                 Icon(
                     Icons.Filled.Favorite,
@@ -250,7 +257,7 @@
         }
 
         rule
-            .onNodeWithTag("button")
+            .onNodeWithTag(buttonTestTag)
             .captureToImage()
             .assertAgainstGolden(screenshotRule, "button_withIcon_disabled_lightTheme")
     }
@@ -285,7 +292,7 @@
                 onClick = { /* Do something! */ },
                 contentPadding = ButtonDefaults.ButtonWithIconContentPadding,
                 enabled = false,
-                modifier = Modifier.testTag("button")
+                modifier = Modifier.testTag(buttonTestTag)
             ) {
                 Icon(
                     Icons.Filled.Favorite,
@@ -298,8 +305,534 @@
         }
 
         rule
-            .onNodeWithTag("button")
+            .onNodeWithTag(buttonTestTag)
             .captureToImage()
             .assertAgainstGolden(screenshotRule, "button_withIcon_disabled_darkTheme")
     }
+
+    @OptIn(ExperimentalMaterial3ExpressiveApi::class)
+    @Test
+    fun button_withAnimatedShape_default_lightTheme() {
+        rule.setMaterialContent(lightColorScheme()) {
+            Button(
+                onClick = {},
+                shapes = ButtonDefaults.shapes(),
+                modifier = Modifier.testTag(buttonTestTag)
+            ) {
+                Text("Button")
+            }
+        }
+
+        rule
+            .onNodeWithTag(buttonTestTag)
+            .captureToImage()
+            .assertAgainstGolden(screenshotRule, "button_withAnimatedShape_default_lightTheme")
+    }
+
+    @OptIn(ExperimentalMaterial3ExpressiveApi::class)
+    @Test
+    fun button_withAnimatedShape_default_darkTheme() {
+        rule.setMaterialContent(darkColorScheme()) {
+            Button(
+                onClick = {},
+                shapes = ButtonDefaults.shapes(),
+                modifier = Modifier.testTag(buttonTestTag)
+            ) {
+                Text("Button")
+            }
+        }
+
+        rule
+            .onNodeWithTag(buttonTestTag)
+            .captureToImage()
+            .assertAgainstGolden(screenshotRule, "button_withAnimatedShape_default_darkTheme")
+    }
+
+    @OptIn(ExperimentalMaterial3ExpressiveApi::class)
+    @Test
+    fun elevatedButton_withAnimatedShape_default_lightTheme() {
+        rule.setMaterialContent(lightColorScheme()) {
+            ElevatedButton(
+                onClick = {},
+                shapes = ButtonDefaults.shapes(),
+                modifier = Modifier.testTag(buttonTestTag)
+            ) {
+                Text("Button")
+            }
+        }
+
+        rule
+            .onNodeWithTag(buttonTestTag)
+            .captureToImage()
+            .assertAgainstGolden(
+                screenshotRule,
+                "elevatedButton_withAnimatedShape_default_lightTheme"
+            )
+    }
+
+    @OptIn(ExperimentalMaterial3ExpressiveApi::class)
+    @Test
+    fun elevatedButton_withAnimatedShape_default_darkTheme() {
+        rule.setMaterialContent(darkColorScheme()) {
+            ElevatedButton(
+                onClick = {},
+                shapes = ButtonDefaults.shapes(),
+                modifier = Modifier.testTag(buttonTestTag)
+            ) {
+                Text("Button")
+            }
+        }
+
+        rule
+            .onNodeWithTag(buttonTestTag)
+            .captureToImage()
+            .assertAgainstGolden(
+                screenshotRule,
+                "elevatedButton_withAnimatedShape_default_darkTheme"
+            )
+    }
+
+    @OptIn(ExperimentalMaterial3ExpressiveApi::class)
+    @Test
+    fun filledTonalButton_withAnimatedShape_default_lightTheme() {
+        rule.setMaterialContent(lightColorScheme()) {
+            FilledTonalButton(
+                onClick = {},
+                shapes = ButtonDefaults.shapes(),
+                modifier = Modifier.testTag(buttonTestTag)
+            ) {
+                Text("Button")
+            }
+        }
+
+        rule
+            .onNodeWithTag(buttonTestTag)
+            .captureToImage()
+            .assertAgainstGolden(
+                screenshotRule,
+                "filledTonalButton_withAnimatedShape_default_lightTheme"
+            )
+    }
+
+    @OptIn(ExperimentalMaterial3ExpressiveApi::class)
+    @Test
+    fun filledTonalButton_withAnimatedShape_default_darkTheme() {
+        rule.setMaterialContent(darkColorScheme()) {
+            Button(
+                onClick = {},
+                shapes = ButtonDefaults.shapes(),
+                modifier = Modifier.testTag(buttonTestTag)
+            ) {
+                Text("Button")
+            }
+        }
+
+        rule
+            .onNodeWithTag(buttonTestTag)
+            .captureToImage()
+            .assertAgainstGolden(
+                screenshotRule,
+                "filledTonalButton_withAnimatedShape_default_darkTheme"
+            )
+    }
+
+    @OptIn(ExperimentalMaterial3ExpressiveApi::class)
+    @Test
+    fun outlinedButton_withAnimatedShape_default_lightTheme() {
+        rule.setMaterialContent(lightColorScheme()) {
+            OutlinedButton(
+                onClick = {},
+                shapes = ButtonDefaults.shapes(),
+                modifier = Modifier.testTag(buttonTestTag)
+            ) {
+                Text("Button")
+            }
+        }
+
+        rule
+            .onNodeWithTag(buttonTestTag)
+            .captureToImage()
+            .assertAgainstGolden(
+                screenshotRule,
+                "outlinedButton_withAnimatedShape_default_lightTheme"
+            )
+    }
+
+    @OptIn(ExperimentalMaterial3ExpressiveApi::class)
+    @Test
+    fun outlinedButton_withAnimatedShape_default_darkTheme() {
+        rule.setMaterialContent(darkColorScheme()) {
+            OutlinedButton(
+                onClick = {},
+                shapes = ButtonDefaults.shapes(),
+                modifier = Modifier.testTag(buttonTestTag)
+            ) {
+                Text("Button")
+            }
+        }
+
+        rule
+            .onNodeWithTag(buttonTestTag)
+            .captureToImage()
+            .assertAgainstGolden(
+                screenshotRule,
+                "outlinedButton_withAnimatedShape_default_darkTheme"
+            )
+    }
+
+    @OptIn(ExperimentalMaterial3ExpressiveApi::class)
+    @Test
+    fun textButton_withAnimatedShape_default_lightTheme() {
+        rule.setMaterialContent(lightColorScheme()) {
+            TextButton(
+                onClick = {},
+                shapes = ButtonDefaults.shapes(),
+                modifier = Modifier.testTag(buttonTestTag)
+            ) {
+                Text("Button")
+            }
+        }
+
+        rule
+            .onNodeWithTag(buttonTestTag)
+            .captureToImage()
+            .assertAgainstGolden(screenshotRule, "textButton_withAnimatedShape_default_lightTheme")
+    }
+
+    @OptIn(ExperimentalMaterial3ExpressiveApi::class)
+    @Test
+    fun textButton_withAnimatedShape_default_darkTheme() {
+        rule.setMaterialContent(darkColorScheme()) {
+            TextButton(
+                onClick = {},
+                shapes = ButtonDefaults.shapes(),
+                modifier = Modifier.testTag(buttonTestTag)
+            ) {
+                Text("Button")
+            }
+        }
+
+        rule
+            .onNodeWithTag(buttonTestTag)
+            .captureToImage()
+            .assertAgainstGolden(screenshotRule, "textButton_withAnimatedShape_default_darkTheme")
+    }
+
+    @OptIn(ExperimentalMaterial3ExpressiveApi::class)
+    @Test
+    fun button_withAnimatedShape_pressed_lightTheme() {
+        rule.setMaterialContent(lightColorScheme()) {
+            Button(
+                onClick = {},
+                shapes = ButtonDefaults.shapes(),
+                modifier = Modifier.testTag(buttonTestTag)
+            ) {
+                Text("Button")
+            }
+        }
+
+        rule.mainClock.autoAdvance = false
+        rule.onNodeWithTag(buttonTestTag).performTouchInput { down(center) }
+
+        rule.mainClock.advanceTimeByFrame()
+        rule.waitForIdle() // Wait for measure
+        rule.mainClock.advanceTimeBy(milliseconds = 200)
+
+        // Ripples are drawn on the RenderThread, not the main (UI) thread, so we can't wait for
+        // synchronization. Instead just wait until after the ripples are finished animating.
+        Thread.sleep(300)
+
+        rule
+            .onNodeWithTag(buttonTestTag)
+            .captureToImage()
+            .assertAgainstGolden(screenshotRule, "button_withAnimatedShape_pressed_lightTheme")
+    }
+
+    @OptIn(ExperimentalMaterial3ExpressiveApi::class)
+    @Test
+    fun button_withAnimatedShape_pressed_darkTheme() {
+        rule.setMaterialContent(darkColorScheme()) {
+            Button(
+                onClick = {},
+                shapes = ButtonDefaults.shapes(),
+                modifier = Modifier.testTag(buttonTestTag)
+            ) {
+                Text("Button")
+            }
+        }
+
+        rule.mainClock.autoAdvance = false
+        rule.onNodeWithTag(buttonTestTag).performTouchInput { down(center) }
+
+        rule.mainClock.advanceTimeByFrame()
+        rule.waitForIdle() // Wait for measure
+        rule.mainClock.advanceTimeBy(milliseconds = 200)
+
+        // Ripples are drawn on the RenderThread, not the main (UI) thread, so we can't wait for
+        // synchronization. Instead just wait until after the ripples are finished animating.
+        Thread.sleep(300)
+
+        rule
+            .onNodeWithTag(buttonTestTag)
+            .captureToImage()
+            .assertAgainstGolden(screenshotRule, "button_withAnimatedShape_pressed_darkTheme")
+    }
+
+    @OptIn(ExperimentalMaterial3ExpressiveApi::class)
+    @Test
+    fun elevatedButton_withAnimatedShape_pressed_lightTheme() {
+        rule.setMaterialContent(lightColorScheme()) {
+            ElevatedButton(
+                onClick = {},
+                shapes = ButtonDefaults.shapes(),
+                modifier = Modifier.testTag(buttonTestTag)
+            ) {
+                Text("Button")
+            }
+        }
+
+        rule.mainClock.autoAdvance = false
+        rule.onNodeWithTag(buttonTestTag).performTouchInput { down(center) }
+
+        rule.mainClock.advanceTimeByFrame()
+        rule.waitForIdle() // Wait for measure
+        rule.mainClock.advanceTimeBy(milliseconds = 200)
+
+        // Ripples are drawn on the RenderThread, not the main (UI) thread, so we can't wait for
+        // synchronization. Instead just wait until after the ripples are finished animating.
+        Thread.sleep(300)
+
+        rule
+            .onNodeWithTag(buttonTestTag)
+            .captureToImage()
+            .assertAgainstGolden(
+                screenshotRule,
+                "elevatedButton_withAnimatedShape_pressed_lightTheme"
+            )
+    }
+
+    @OptIn(ExperimentalMaterial3ExpressiveApi::class)
+    @Test
+    fun elevatedButton_withAnimatedShape_pressed_darkTheme() {
+        rule.setMaterialContent(darkColorScheme()) {
+            ElevatedButton(
+                onClick = {},
+                shapes = ButtonDefaults.shapes(),
+                modifier = Modifier.testTag(buttonTestTag)
+            ) {
+                Text("Button")
+            }
+        }
+
+        rule.mainClock.autoAdvance = false
+        rule.onNodeWithTag(buttonTestTag).performTouchInput { down(center) }
+
+        rule.mainClock.advanceTimeByFrame()
+        rule.waitForIdle() // Wait for measure
+        rule.mainClock.advanceTimeBy(milliseconds = 200)
+
+        // Ripples are drawn on the RenderThread, not the main (UI) thread, so we can't wait for
+        // synchronization. Instead just wait until after the ripples are finished animating.
+        Thread.sleep(300)
+
+        rule
+            .onNodeWithTag(buttonTestTag)
+            .captureToImage()
+            .assertAgainstGolden(
+                screenshotRule,
+                "elevatedButton_withAnimatedShape_pressed_darkTheme"
+            )
+    }
+
+    @OptIn(ExperimentalMaterial3ExpressiveApi::class)
+    @Test
+    fun filledTonalButton_withAnimatedShape_pressed_lightTheme() {
+        rule.setMaterialContent(lightColorScheme()) {
+            FilledTonalButton(
+                onClick = {},
+                shapes = ButtonDefaults.shapes(),
+                modifier = Modifier.testTag(buttonTestTag)
+            ) {
+                Text("Button")
+            }
+        }
+
+        rule.mainClock.autoAdvance = false
+        rule.onNodeWithTag(buttonTestTag).performTouchInput { down(center) }
+
+        rule.mainClock.advanceTimeByFrame()
+        rule.waitForIdle() // Wait for measure
+        rule.mainClock.advanceTimeBy(milliseconds = 200)
+
+        // Ripples are drawn on the RenderThread, not the main (UI) thread, so we can't wait for
+        // synchronization. Instead just wait until after the ripples are finished animating.
+        Thread.sleep(300)
+
+        rule
+            .onNodeWithTag(buttonTestTag)
+            .captureToImage()
+            .assertAgainstGolden(
+                screenshotRule,
+                "filledTonalButton_withAnimatedShape_pressed_lightTheme"
+            )
+    }
+
+    @OptIn(ExperimentalMaterial3ExpressiveApi::class)
+    @Test
+    fun filledTonalButton_withAnimatedShape_pressed_darkTheme() {
+        rule.setMaterialContent(darkColorScheme()) {
+            Button(
+                onClick = {},
+                shapes = ButtonDefaults.shapes(),
+                modifier = Modifier.testTag(buttonTestTag)
+            ) {
+                Text("Button")
+            }
+        }
+
+        rule.mainClock.autoAdvance = false
+        rule.onNodeWithTag(buttonTestTag).performTouchInput { down(center) }
+
+        rule.mainClock.advanceTimeByFrame()
+        rule.waitForIdle() // Wait for measure
+        rule.mainClock.advanceTimeBy(milliseconds = 200)
+
+        // Ripples are drawn on the RenderThread, not the main (UI) thread, so we can't wait for
+        // synchronization. Instead just wait until after the ripples are finished animating.
+        Thread.sleep(300)
+
+        rule
+            .onNodeWithTag(buttonTestTag)
+            .captureToImage()
+            .assertAgainstGolden(
+                screenshotRule,
+                "filledTonalButton_withAnimatedShape_pressed_darkTheme"
+            )
+    }
+
+    @OptIn(ExperimentalMaterial3ExpressiveApi::class)
+    @Test
+    fun outlinedButton_withAnimatedShape_pressed_lightTheme() {
+        rule.setMaterialContent(lightColorScheme()) {
+            OutlinedButton(
+                onClick = {},
+                shapes = ButtonDefaults.shapes(),
+                modifier = Modifier.testTag(buttonTestTag)
+            ) {
+                Text("Button")
+            }
+        }
+
+        rule.mainClock.autoAdvance = false
+        rule.onNodeWithTag(buttonTestTag).performTouchInput { down(center) }
+
+        rule.mainClock.advanceTimeByFrame()
+        rule.waitForIdle() // Wait for measure
+        rule.mainClock.advanceTimeBy(milliseconds = 200)
+
+        // Ripples are drawn on the RenderThread, not the main (UI) thread, so we can't wait for
+        // synchronization. Instead just wait until after the ripples are finished animating.
+        Thread.sleep(300)
+
+        rule
+            .onNodeWithTag(buttonTestTag)
+            .captureToImage()
+            .assertAgainstGolden(
+                screenshotRule,
+                "outlinedButton_withAnimatedShape_pressed_lightTheme"
+            )
+    }
+
+    @OptIn(ExperimentalMaterial3ExpressiveApi::class)
+    @Test
+    fun outlinedButton_withAnimatedShape_pressed_darkTheme() {
+        rule.setMaterialContent(darkColorScheme()) {
+            OutlinedButton(
+                onClick = {},
+                shapes = ButtonDefaults.shapes(),
+                modifier = Modifier.testTag(buttonTestTag)
+            ) {
+                Text("Button")
+            }
+        }
+
+        rule.mainClock.autoAdvance = false
+        rule.onNodeWithTag(buttonTestTag).performTouchInput { down(center) }
+
+        rule.mainClock.advanceTimeByFrame()
+        rule.waitForIdle() // Wait for measure
+        rule.mainClock.advanceTimeBy(milliseconds = 200)
+
+        // Ripples are drawn on the RenderThread, not the main (UI) thread, so we can't wait for
+        // synchronization. Instead just wait until after the ripples are finished animating.
+        Thread.sleep(300)
+
+        rule
+            .onNodeWithTag(buttonTestTag)
+            .captureToImage()
+            .assertAgainstGolden(
+                screenshotRule,
+                "outlinedButton_withAnimatedShape_pressed_darkTheme"
+            )
+    }
+
+    @OptIn(ExperimentalMaterial3ExpressiveApi::class)
+    @Test
+    fun textButton_withAnimatedShape_pressed_lightTheme() {
+        rule.setMaterialContent(lightColorScheme()) {
+            TextButton(
+                onClick = {},
+                shapes = ButtonDefaults.shapes(),
+                modifier = Modifier.testTag(buttonTestTag)
+            ) {
+                Text("Button")
+            }
+        }
+
+        rule.mainClock.autoAdvance = false
+        rule.onNodeWithTag(buttonTestTag).performTouchInput { down(center) }
+
+        rule.mainClock.advanceTimeByFrame()
+        rule.waitForIdle() // Wait for measure
+        rule.mainClock.advanceTimeBy(milliseconds = 200)
+
+        // Ripples are drawn on the RenderThread, not the main (UI) thread, so we can't wait for
+        // synchronization. Instead just wait until after the ripples are finished animating.
+        Thread.sleep(300)
+
+        rule
+            .onNodeWithTag(buttonTestTag)
+            .captureToImage()
+            .assertAgainstGolden(screenshotRule, "textButton_withAnimatedShape_pressed_lightTheme")
+    }
+
+    @OptIn(ExperimentalMaterial3ExpressiveApi::class)
+    @Test
+    fun textButton_withAnimatedShape_pressed_darkTheme() {
+        rule.setMaterialContent(darkColorScheme()) {
+            TextButton(
+                onClick = {},
+                shapes = ButtonDefaults.shapes(),
+                modifier = Modifier.testTag(buttonTestTag)
+            ) {
+                Text("Button")
+            }
+        }
+
+        rule.mainClock.autoAdvance = false
+        rule.onNodeWithTag(buttonTestTag).performTouchInput { down(center) }
+
+        rule.mainClock.advanceTimeByFrame()
+        rule.waitForIdle() // Wait for measure
+        rule.mainClock.advanceTimeBy(milliseconds = 200)
+
+        // Ripples are drawn on the RenderThread, not the main (UI) thread, so we can't wait for
+        // synchronization. Instead just wait until after the ripples are finished animating.
+        Thread.sleep(300)
+
+        rule
+            .onNodeWithTag(buttonTestTag)
+            .captureToImage()
+            .assertAgainstGolden(screenshotRule, "textButton_withAnimatedShape_pressed_darkTheme")
+    }
 }
diff --git a/compose/material3/material3/src/androidInstrumentedTest/kotlin/androidx/compose/material3/ButtonTest.kt b/compose/material3/material3/src/androidInstrumentedTest/kotlin/androidx/compose/material3/ButtonTest.kt
index 1cac542..acca58b 100644
--- a/compose/material3/material3/src/androidInstrumentedTest/kotlin/androidx/compose/material3/ButtonTest.kt
+++ b/compose/material3/material3/src/androidInstrumentedTest/kotlin/androidx/compose/material3/ButtonTest.kt
@@ -15,6 +15,7 @@
  */
 package androidx.compose.material3
 
+import android.os.Build
 import androidx.compose.foundation.layout.Box
 import androidx.compose.foundation.layout.Column
 import androidx.compose.foundation.layout.Spacer
@@ -25,7 +26,6 @@
 import androidx.compose.material.icons.Icons
 import androidx.compose.material.icons.filled.Edit
 import androidx.compose.material.icons.filled.Favorite
-import androidx.compose.material.icons.outlined.Edit
 import androidx.compose.material3.tokens.ElevatedButtonTokens
 import androidx.compose.material3.tokens.FilledButtonTokens
 import androidx.compose.material3.tokens.FilledTonalButtonTokens
@@ -35,8 +35,10 @@
 import androidx.compose.runtime.mutableStateOf
 import androidx.compose.runtime.remember
 import androidx.compose.runtime.setValue
+import androidx.compose.testutils.assertShape
 import androidx.compose.ui.Modifier
 import androidx.compose.ui.graphics.Color
+import androidx.compose.ui.graphics.Shape
 import androidx.compose.ui.platform.LocalLayoutDirection
 import androidx.compose.ui.platform.testTag
 import androidx.compose.ui.semantics.Role
@@ -48,15 +50,18 @@
 import androidx.compose.ui.test.assertIsEnabled
 import androidx.compose.ui.test.assertIsEqualTo
 import androidx.compose.ui.test.assertIsNotEnabled
+import androidx.compose.ui.test.captureToImage
 import androidx.compose.ui.test.getUnclippedBoundsInRoot
 import androidx.compose.ui.test.junit4.createComposeRule
 import androidx.compose.ui.test.onNodeWithTag
 import androidx.compose.ui.test.performClick
+import androidx.compose.ui.test.performTouchInput
 import androidx.compose.ui.unit.Dp
 import androidx.compose.ui.unit.dp
 import androidx.compose.ui.unit.height
 import androidx.test.ext.junit.runners.AndroidJUnit4
 import androidx.test.filters.MediumTest
+import androidx.test.filters.SdkSuppress
 import com.google.common.truth.Truth.assertThat
 import org.junit.Rule
 import org.junit.Test
@@ -669,6 +674,80 @@
             "height of button"
         )
     }
+
+    @SdkSuppress(minSdkVersion = Build.VERSION_CODES.O)
+    @OptIn(ExperimentalMaterial3ExpressiveApi::class)
+    @Test
+    fun button_withAnimatedShape_defaultShape() {
+        lateinit var shape: Shape
+        val backgroundColor = Color.Yellow
+        val shapeColor = Color.Blue
+        rule.setMaterialContent(lightColorScheme()) {
+            shape = ButtonDefaults.shape
+            Surface(color = backgroundColor) {
+                Button(
+                    onClick = {},
+                    shapes = ButtonDefaults.shapes(),
+                    modifier = Modifier.testTag(ButtonTestTag),
+                    colors =
+                        ButtonDefaults.buttonColors(
+                            containerColor = shapeColor,
+                            contentColor = shapeColor
+                        )
+                ) {
+                    Text("Button")
+                }
+            }
+        }
+
+        rule
+            .onNodeWithTag(ButtonTestTag)
+            .captureToImage()
+            .assertShape(
+                density = rule.density,
+                shapeColor = shapeColor,
+                backgroundColor = backgroundColor,
+                shape = shape
+            )
+    }
+
+    @SdkSuppress(minSdkVersion = Build.VERSION_CODES.O)
+    @OptIn(ExperimentalMaterial3ExpressiveApi::class)
+    @Test
+    fun button_withAnimatedShape_pressedShape() {
+        lateinit var shape: Shape
+        val backgroundColor = Color.Yellow
+        val shapeColor = Color.Blue
+        rule.setMaterialContent(lightColorScheme()) {
+            shape = ButtonDefaults.pressedShape
+            Surface(color = backgroundColor) {
+                Button(
+                    onClick = {},
+                    shapes = ButtonDefaults.shapes(),
+                    modifier = Modifier.testTag(ButtonTestTag),
+                    colors =
+                        ButtonDefaults.buttonColors(
+                            containerColor = shapeColor,
+                            contentColor = shapeColor
+                        )
+                ) {
+                    Text("Button")
+                }
+            }
+        }
+
+        rule.onNodeWithTag(ButtonTestTag).performTouchInput { down(center) }
+
+        rule
+            .onNodeWithTag(ButtonTestTag)
+            .captureToImage()
+            .assertShape(
+                density = rule.density,
+                shapeColor = shapeColor,
+                backgroundColor = backgroundColor,
+                shape = shape
+            )
+    }
 }
 
 private const val ButtonTestTag = "button"
diff --git a/compose/material3/material3/src/androidInstrumentedTest/kotlin/androidx/compose/material3/SearchBarScreenshotTest.kt b/compose/material3/material3/src/androidInstrumentedTest/kotlin/androidx/compose/material3/SearchBarScreenshotTest.kt
index cfe85b6..dd20fdc 100644
--- a/compose/material3/material3/src/androidInstrumentedTest/kotlin/androidx/compose/material3/SearchBarScreenshotTest.kt
+++ b/compose/material3/material3/src/androidInstrumentedTest/kotlin/androidx/compose/material3/SearchBarScreenshotTest.kt
@@ -442,6 +442,227 @@
         assertAgainstGolden("dockedSearchBar_shadow_active")
     }
 
+    @Test
+    fun newSearchBar_collapsed() {
+        rule.setMaterialContent(scheme.colorScheme) {
+            val state = rememberSearchBarState()
+            SearchBar(
+                modifier = Modifier.testTag(testTag),
+                state = state,
+                inputField = {
+                    SearchBarDefaults.InputField(
+                        searchBarState = state,
+                        textFieldState = rememberTextFieldState(),
+                        onSearch = {},
+                        placeholder = { Text("Hint") },
+                    )
+                },
+            )
+        }
+        assertAgainstGolden("searchBar_collapsed_${scheme.name}")
+    }
+
+    @Test
+    fun newSearchBar_collapsed_shadow() {
+        rule.setMaterialContent(lightColorScheme()) {
+            val state = rememberSearchBarState()
+            SearchBar(
+                modifier = Modifier.testTag(testTag),
+                state = state,
+                inputField = {
+                    SearchBarDefaults.InputField(
+                        searchBarState = state,
+                        textFieldState = rememberTextFieldState(),
+                        onSearch = {},
+                        placeholder = { Text("Hint") },
+                    )
+                },
+                shadowElevation = 6.dp,
+            )
+        }
+        assertAgainstGolden("searchBar_collapsed_shadow")
+    }
+
+    @Test
+    fun newSearchBar_collapsed_disabled() {
+        rule.setMaterialContent(scheme.colorScheme) {
+            val state = rememberSearchBarState()
+            SearchBar(
+                modifier = Modifier.testTag(testTag),
+                state = state,
+                inputField = {
+                    SearchBarDefaults.InputField(
+                        searchBarState = state,
+                        textFieldState = rememberTextFieldState(),
+                        onSearch = {},
+                        enabled = false,
+                        placeholder = { Text("Hint") },
+                    )
+                },
+            )
+        }
+        assertAgainstGolden("searchBar_collapsed_disabled_${scheme.name}")
+    }
+
+    @Test
+    fun newSearchBar_fullScreen_expanded() {
+        rule.setMaterialContent(scheme.colorScheme) {
+            val state = rememberSearchBarState(initialExpanded = true)
+            ExpandedFullScreenSearchBar(
+                modifier = Modifier.testTag(testTag),
+                state = state,
+                inputField = {
+                    SearchBarDefaults.InputField(
+                        searchBarState = state,
+                        textFieldState = rememberTextFieldState("Query"),
+                        onSearch = {},
+                    )
+                },
+                content = { Text("Content") },
+            )
+        }
+        assertAgainstGolden("searchBar_fullScreen_${scheme.name}")
+    }
+
+    @Test
+    fun newSearchBar_fullScreen_expanded_withIcons() {
+        rule.setMaterialContent(scheme.colorScheme) {
+            val state = rememberSearchBarState(initialExpanded = true)
+            ExpandedFullScreenSearchBar(
+                modifier = Modifier.testTag(testTag),
+                state = state,
+                inputField = {
+                    SearchBarDefaults.InputField(
+                        searchBarState = state,
+                        textFieldState = rememberTextFieldState("Query"),
+                        onSearch = {},
+                        leadingIcon = { Icon(Icons.Default.Search, contentDescription = null) },
+                        trailingIcon = { Icon(Icons.Default.MoreVert, contentDescription = null) },
+                    )
+                },
+                content = { Text("Content") },
+            )
+        }
+        assertAgainstGolden("searchBar_fullScreen_withIcons_${scheme.name}")
+    }
+
+    @Test
+    fun newSearchBar_fullScreen_expanded_customColors() {
+        rule.setMaterialContent(lightColorScheme()) {
+            val state = rememberSearchBarState(initialExpanded = true)
+            val colors =
+                SearchBarDefaults.colors(
+                    containerColor = Color.Yellow,
+                    dividerColor = Color.Green,
+                )
+            ExpandedFullScreenSearchBar(
+                modifier = Modifier.testTag(testTag),
+                state = state,
+                inputField = {
+                    SearchBarDefaults.InputField(
+                        searchBarState = state,
+                        textFieldState = rememberTextFieldState("Query"),
+                        onSearch = {},
+                        colors = colors.inputFieldColors,
+                    )
+                },
+                colors = colors,
+                content = { Text("Content") },
+            )
+        }
+        assertAgainstGolden("searchBar_fullScreen_customColors")
+    }
+
+    @Test
+    fun newSearchBar_docked_expanded() {
+        rule.setMaterialContent(scheme.colorScheme) {
+            val state = rememberSearchBarState(initialExpanded = true)
+            ExpandedDockedSearchBar(
+                modifier = Modifier.testTag(testTag),
+                state = state,
+                inputField = {
+                    SearchBarDefaults.InputField(
+                        searchBarState = state,
+                        textFieldState = rememberTextFieldState("Query"),
+                        onSearch = {},
+                    )
+                },
+                content = { Text("Content") },
+            )
+        }
+        assertAgainstGolden("searchBar_docked_${scheme.name}")
+    }
+
+    @Test
+    fun newSearchBar_docked_expanded_withIcons() {
+        rule.setMaterialContent(scheme.colorScheme) {
+            val state = rememberSearchBarState(initialExpanded = true)
+            ExpandedDockedSearchBar(
+                modifier = Modifier.testTag(testTag),
+                state = state,
+                inputField = {
+                    SearchBarDefaults.InputField(
+                        searchBarState = state,
+                        textFieldState = rememberTextFieldState("Query"),
+                        onSearch = {},
+                        leadingIcon = { Icon(Icons.Default.Search, contentDescription = null) },
+                        trailingIcon = { Icon(Icons.Default.MoreVert, contentDescription = null) },
+                    )
+                },
+                content = { Text("Content") },
+            )
+        }
+        assertAgainstGolden("searchBar_docked_withIcons_${scheme.name}")
+    }
+
+    @Test
+    fun newSearchBar_docked_expanded_customShape() {
+        rule.setMaterialContent(lightColorScheme()) {
+            val state = rememberSearchBarState(initialExpanded = true)
+            ExpandedDockedSearchBar(
+                modifier = Modifier.testTag(testTag),
+                state = state,
+                inputField = {
+                    SearchBarDefaults.InputField(
+                        searchBarState = state,
+                        textFieldState = rememberTextFieldState("Query"),
+                        onSearch = {},
+                    )
+                },
+                shape = CutCornerShape(24.dp),
+                content = { Text("Content") },
+            )
+        }
+        assertAgainstGolden("searchBar_docked_customShape")
+    }
+
+    @Test
+    fun newSearchBar_docked_expanded_customColors() {
+        rule.setMaterialContent(lightColorScheme()) {
+            val state = rememberSearchBarState(initialExpanded = true)
+            val colors =
+                SearchBarDefaults.colors(
+                    containerColor = Color.Yellow,
+                    dividerColor = Color.Green,
+                )
+            ExpandedDockedSearchBar(
+                modifier = Modifier.testTag(testTag),
+                state = state,
+                inputField = {
+                    SearchBarDefaults.InputField(
+                        searchBarState = state,
+                        textFieldState = rememberTextFieldState("Query"),
+                        onSearch = {},
+                        colors = colors.inputFieldColors,
+                    )
+                },
+                colors = colors,
+                content = { Text("Content") },
+            )
+        }
+        assertAgainstGolden("searchBar_docked_customColors")
+    }
+
     private fun assertAgainstGolden(goldenName: String) {
         rule.onNodeWithTag(testTag).captureToImage().assertAgainstGolden(screenshotRule, goldenName)
     }
diff --git a/compose/material3/material3/src/androidInstrumentedTest/kotlin/androidx/compose/material3/TimePickerScreenshotTest.kt b/compose/material3/material3/src/androidInstrumentedTest/kotlin/androidx/compose/material3/TimePickerScreenshotTest.kt
index e273437..9964472 100644
--- a/compose/material3/material3/src/androidInstrumentedTest/kotlin/androidx/compose/material3/TimePickerScreenshotTest.kt
+++ b/compose/material3/material3/src/androidInstrumentedTest/kotlin/androidx/compose/material3/TimePickerScreenshotTest.kt
@@ -18,8 +18,10 @@
 
 import android.os.Build
 import androidx.compose.foundation.layout.Box
+import androidx.compose.foundation.layout.size
 import androidx.compose.runtime.CompositionLocalProvider
 import androidx.compose.testutils.assertAgainstGolden
+import androidx.compose.ui.Alignment
 import androidx.compose.ui.Modifier
 import androidx.compose.ui.platform.LocalLayoutDirection
 import androidx.compose.ui.platform.testTag
@@ -28,6 +30,7 @@
 import androidx.compose.ui.test.junit4.createComposeRule
 import androidx.compose.ui.test.onNodeWithTag
 import androidx.compose.ui.unit.LayoutDirection
+import androidx.compose.ui.unit.dp
 import androidx.test.filters.LargeTest
 import androidx.test.filters.SdkSuppress
 import androidx.test.screenshot.AndroidXScreenshotTestRule
@@ -122,6 +125,52 @@
         rule.assertAgainstGolden("timePicker_24h_rtl_${scheme.name}")
     }
 
+    @Test
+    fun clockFace_24h_mid() {
+        val state =
+            AnalogTimePickerState(
+                TimePickerState(initialHour = 0, initialMinute = 0, is24Hour = true)
+            )
+        rule.setMaterialContent(scheme.colorScheme) {
+            Box(
+                modifier = Modifier.testTag(TestTag).size(340.dp),
+                contentAlignment = Alignment.Center
+            ) {
+                ClockFace(
+                    modifier = Modifier.then(ClockFaceSizeModifier()),
+                    state = state,
+                    colors = TimePickerDefaults.colors(),
+                    autoSwitchToMinute = true
+                )
+            }
+        }
+
+        rule.assertAgainstGolden("timePicker_24h_mid${scheme.name}")
+    }
+
+    @Test
+    fun clockFace_24h_min() {
+        val state =
+            AnalogTimePickerState(
+                TimePickerState(initialHour = 0, initialMinute = 0, is24Hour = true)
+            )
+        rule.setMaterialContent(scheme.colorScheme) {
+            Box(
+                modifier = Modifier.testTag(TestTag).size(300.dp),
+                contentAlignment = Alignment.Center
+            ) {
+                ClockFace(
+                    modifier = Modifier.then(ClockFaceSizeModifier()),
+                    state = state,
+                    colors = TimePickerDefaults.colors(),
+                    autoSwitchToMinute = true
+                )
+            }
+        }
+
+        rule.assertAgainstGolden("timePicker_24h_min${scheme.name}")
+    }
+
     private fun ComposeContentTestRule.assertAgainstGolden(goldenName: String) {
         this.onNodeWithTag(TestTag).captureToImage().assertAgainstGolden(screenshotRule, goldenName)
     }
diff --git a/compose/material3/material3/src/androidInstrumentedTest/kotlin/androidx/compose/material3/TimePickerSizeTest.kt b/compose/material3/material3/src/androidInstrumentedTest/kotlin/androidx/compose/material3/TimePickerSizeTest.kt
new file mode 100644
index 0000000..7e4cbcc
--- /dev/null
+++ b/compose/material3/material3/src/androidInstrumentedTest/kotlin/androidx/compose/material3/TimePickerSizeTest.kt
@@ -0,0 +1,109 @@
+/*
+ * Copyright 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 androidx.compose.material3
+
+import androidx.compose.foundation.layout.Box
+import androidx.compose.foundation.layout.size
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.test.assertIsSelected
+import androidx.compose.ui.test.junit4.createComposeRule
+import androidx.compose.ui.test.performClick
+import androidx.compose.ui.unit.Dp
+import androidx.compose.ui.unit.DpSize
+import androidx.compose.ui.unit.dp
+import androidx.test.filters.MediumTest
+import com.google.common.truth.Truth.assertThat
+import org.junit.Rule
+import org.junit.Test
+import org.junit.runner.RunWith
+import org.junit.runners.Parameterized
+
+@MediumTest
+@RunWith(Parameterized::class)
+@OptIn(ExperimentalMaterial3Api::class)
+class TimePickerSizeTest(val config: Config) {
+
+    @get:Rule val rule = createComposeRule()
+
+    @Test
+    fun clockFace_size_resizesCorrectly() {
+        val state =
+            AnalogTimePickerState(
+                TimePickerState(initialHour = 10, initialMinute = 23, is24Hour = false)
+            )
+        rule
+            .setMaterialContentForSizeAssertions(
+                parentMaxWidth = config.size.width,
+                parentMaxHeight = config.size.height
+            ) {
+                ClockFace(
+                    modifier = Modifier.then(ClockFaceSizeModifier()),
+                    state = state,
+                    colors = TimePickerDefaults.colors(),
+                    autoSwitchToMinute = true
+                )
+            }
+            .assertIsSquareWithSize(config.expected)
+    }
+
+    @Test
+    fun clockFace_24Hour_everyValue() {
+        val state =
+            AnalogTimePickerState(
+                TimePickerState(initialHour = 10, initialMinute = 23, is24Hour = true)
+            )
+
+        rule.setMaterialContent(lightColorScheme()) {
+            Box(Modifier.size(config.size)) {
+                ClockFace(
+                    modifier = Modifier,
+                    state = state,
+                    colors = TimePickerDefaults.colors(),
+                    autoSwitchToMinute = true
+                )
+            }
+        }
+
+        repeat(24) { number ->
+            rule
+                .onNodeWithTimeValue(number, TimePickerSelectionMode.Hour, is24Hour = true)
+                .performClick()
+
+            rule.runOnIdle {
+                state.selection = TimePickerSelectionMode.Hour
+                assertThat(state.hour).isEqualTo(number)
+            }
+
+            rule
+                .onNodeWithTimeValue(number, TimePickerSelectionMode.Hour, is24Hour = true)
+                .assertIsSelected()
+        }
+    }
+
+    internal companion object {
+        @Parameterized.Parameters(name = "{0}")
+        @JvmStatic
+        fun parameters() =
+            arrayOf(
+                Config(DpSize(384.dp, 384.dp), 256.dp),
+                Config(DpSize(350.dp, 350.dp), 238.dp),
+                Config(DpSize(300.dp, 300.dp), 200.dp)
+            )
+    }
+
+    data class Config(val size: DpSize, val expected: Dp)
+}
diff --git a/compose/material3/material3/src/androidInstrumentedTest/kotlin/androidx/compose/material3/TimePickerTest.kt b/compose/material3/material3/src/androidInstrumentedTest/kotlin/androidx/compose/material3/TimePickerTest.kt
index 4fffa57..16b4f65 100644
--- a/compose/material3/material3/src/androidInstrumentedTest/kotlin/androidx/compose/material3/TimePickerTest.kt
+++ b/compose/material3/material3/src/androidInstrumentedTest/kotlin/androidx/compose/material3/TimePickerTest.kt
@@ -24,6 +24,7 @@
 import androidx.compose.material3.internal.Strings
 import androidx.compose.material3.internal.getString
 import androidx.compose.runtime.CompositionLocalProvider
+import androidx.compose.ui.Modifier
 import androidx.compose.ui.input.key.Key
 import androidx.compose.ui.platform.LocalConfiguration
 import androidx.compose.ui.platform.LocalContext
@@ -664,7 +665,12 @@
             )
 
         rule.setMaterialContent(lightColorScheme()) {
-            ClockFace(state, TimePickerDefaults.colors(), autoSwitchToMinute = true)
+            ClockFace(
+                modifier = Modifier,
+                state = state,
+                colors = TimePickerDefaults.colors(),
+                autoSwitchToMinute = true
+            )
         }
 
         repeat(24) { number ->
@@ -691,7 +697,12 @@
             )
 
         rule.setMaterialContent(lightColorScheme()) {
-            ClockFace(state, TimePickerDefaults.colors(), autoSwitchToMinute = true)
+            ClockFace(
+                modifier = Modifier,
+                state = state,
+                colors = TimePickerDefaults.colors(),
+                autoSwitchToMinute = true
+            )
         }
 
         repeat(12) { number ->
@@ -721,7 +732,12 @@
             )
 
         rule.setMaterialContent(lightColorScheme()) {
-            ClockFace(state, TimePickerDefaults.colors(), autoSwitchToMinute = true)
+            ClockFace(
+                modifier = Modifier,
+                state = state,
+                colors = TimePickerDefaults.colors(),
+                autoSwitchToMinute = true
+            )
         }
 
         repeat(12) { number ->
@@ -763,7 +779,12 @@
             )
         state.selection = TimePickerSelectionMode.Minute
         rule.setMaterialContent(lightColorScheme()) {
-            ClockFace(state, TimePickerDefaults.colors(), autoSwitchToMinute = true)
+            ClockFace(
+                modifier = Modifier,
+                state = state,
+                colors = TimePickerDefaults.colors(),
+                autoSwitchToMinute = true
+            )
         }
 
         repeat(11) { number ->
@@ -782,7 +803,12 @@
             )
         state.selection = TimePickerSelectionMode.Minute
         rule.setMaterialContent(lightColorScheme()) {
-            ClockFace(state, TimePickerDefaults.colors(), autoSwitchToMinute = true)
+            ClockFace(
+                modifier = Modifier,
+                state = state,
+                colors = TimePickerDefaults.colors(),
+                autoSwitchToMinute = true
+            )
         }
 
         repeat(11) { number ->
@@ -790,38 +816,40 @@
             rule.runOnIdle { assertThat(state.minute).isEqualTo(number * 5) }
         }
     }
+}
 
-    private fun contentDescriptionForValue(
-        resources: Resources,
-        selection: TimePickerSelectionMode,
-        is24Hour: Boolean,
-        number: Int
-    ): String {
-
-        val id =
-            if (selection == TimePickerSelectionMode.Minute) {
-                R.string.m3c_time_picker_minute_suffix
-            } else if (is24Hour) {
-                R.string.m3c_time_picker_hour_24h_suffix
-            } else {
-                R.string.m3c_time_picker_hour_suffix
-            }
-
-        return resources.getString(id, number)
-    }
-
-    private fun SemanticsNodeInteractionsProvider.onNodeWithTimeValue(
-        number: Int,
-        selection: TimePickerSelectionMode,
-        is24Hour: Boolean = false,
-    ): SemanticsNodeInteraction =
-        onAllNodesWithContentDescription(
-                contentDescriptionForValue(
-                    InstrumentationRegistry.getInstrumentation().context.resources,
-                    selection,
-                    is24Hour,
-                    number
-                )
+@OptIn(ExperimentalMaterial3Api::class)
+internal fun SemanticsNodeInteractionsProvider.onNodeWithTimeValue(
+    number: Int,
+    selection: TimePickerSelectionMode,
+    is24Hour: Boolean = false,
+): SemanticsNodeInteraction =
+    onAllNodesWithContentDescription(
+            contentDescriptionForValue(
+                InstrumentationRegistry.getInstrumentation().context.resources,
+                selection,
+                is24Hour,
+                number
             )
-            .onFirst()
+        )
+        .onFirst()
+
+@OptIn(ExperimentalMaterial3Api::class)
+internal fun contentDescriptionForValue(
+    resources: Resources,
+    selection: TimePickerSelectionMode,
+    is24Hour: Boolean,
+    number: Int
+): String {
+
+    val id =
+        if (selection == TimePickerSelectionMode.Minute) {
+            R.string.m3c_time_picker_minute_suffix
+        } else if (is24Hour) {
+            R.string.m3c_time_picker_hour_24h_suffix
+        } else {
+            R.string.m3c_time_picker_hour_suffix
+        }
+
+    return resources.getString(id, number)
 }
diff --git a/compose/material3/material3/src/androidInstrumentedTest/kotlin/androidx/compose/material3/ToggleButtonTest.kt b/compose/material3/material3/src/androidInstrumentedTest/kotlin/androidx/compose/material3/ToggleButtonTest.kt
index 8257ca35..c4f2f68 100644
--- a/compose/material3/material3/src/androidInstrumentedTest/kotlin/androidx/compose/material3/ToggleButtonTest.kt
+++ b/compose/material3/material3/src/androidInstrumentedTest/kotlin/androidx/compose/material3/ToggleButtonTest.kt
@@ -310,7 +310,7 @@
     @Test
     fun buttonShapes_AllRounded_hasRoundedShapesIsTrue() {
         assertThat(
-                ButtonShapes(
+                ToggleButtonShapes(
                         shape = RoundedCornerShape(10.dp),
                         pressedShape = RoundedCornerShape(10.dp),
                         checkedShape = RoundedCornerShape(4.dp),
@@ -323,7 +323,7 @@
     @Test
     fun buttonShapes_mixedShapes_hasRoundedShapesIsFalse() {
         assertThat(
-                ButtonShapes(
+                ToggleButtonShapes(
                         shape = RectangleShape,
                         pressedShape = RoundedCornerShape(10.dp),
                         checkedShape = RoundedCornerShape(4.dp),
diff --git a/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/Button.kt b/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/Button.kt
index 6600a99..f24ae75 100644
--- a/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/Button.kt
+++ b/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/Button.kt
@@ -17,6 +17,7 @@
 package androidx.compose.material3
 
 import androidx.compose.animation.core.Animatable
+import androidx.compose.animation.core.FiniteAnimationSpec
 import androidx.compose.animation.core.VectorConverter
 import androidx.compose.foundation.BorderStroke
 import androidx.compose.foundation.interaction.FocusInteraction
@@ -25,14 +26,20 @@
 import androidx.compose.foundation.interaction.InteractionSource
 import androidx.compose.foundation.interaction.MutableInteractionSource
 import androidx.compose.foundation.interaction.PressInteraction
+import androidx.compose.foundation.interaction.collectIsPressedAsState
 import androidx.compose.foundation.layout.Arrangement
 import androidx.compose.foundation.layout.PaddingValues
 import androidx.compose.foundation.layout.Row
 import androidx.compose.foundation.layout.RowScope
+import androidx.compose.foundation.layout.calculateEndPadding
+import androidx.compose.foundation.layout.calculateStartPadding
 import androidx.compose.foundation.layout.defaultMinSize
 import androidx.compose.foundation.layout.padding
+import androidx.compose.foundation.shape.CornerBasedShape
+import androidx.compose.foundation.shape.RoundedCornerShape
 import androidx.compose.material3.internal.ProvideContentColorTextStyle
 import androidx.compose.material3.internal.animateElevation
+import androidx.compose.material3.internal.rememberAnimatedShape
 import androidx.compose.material3.tokens.BaselineButtonTokens
 import androidx.compose.material3.tokens.ButtonLargeTokens
 import androidx.compose.material3.tokens.ButtonMediumTokens
@@ -43,6 +50,7 @@
 import androidx.compose.material3.tokens.ElevatedButtonTokens
 import androidx.compose.material3.tokens.FilledButtonTokens
 import androidx.compose.material3.tokens.FilledTonalButtonTokens
+import androidx.compose.material3.tokens.MotionSchemeKeyTokens
 import androidx.compose.material3.tokens.OutlinedButtonTokens
 import androidx.compose.material3.tokens.TextButtonTokens
 import androidx.compose.runtime.Composable
@@ -50,6 +58,8 @@
 import androidx.compose.runtime.LaunchedEffect
 import androidx.compose.runtime.Stable
 import androidx.compose.runtime.State
+import androidx.compose.runtime.getValue
+import androidx.compose.runtime.key
 import androidx.compose.runtime.mutableStateListOf
 import androidx.compose.runtime.remember
 import androidx.compose.ui.Alignment
@@ -58,6 +68,7 @@
 import androidx.compose.ui.graphics.Color
 import androidx.compose.ui.graphics.Shape
 import androidx.compose.ui.graphics.takeOrElse
+import androidx.compose.ui.platform.LocalLayoutDirection
 import androidx.compose.ui.semantics.Role
 import androidx.compose.ui.semantics.role
 import androidx.compose.ui.semantics.semantics
@@ -174,6 +185,137 @@
     }
 }
 
+// TODO add link to image of pressed button
+/**
+ * <a href="https://m3.material.io/components/buttons/overview" class="external"
+ * target="_blank">Material Design button</a>.
+ *
+ * Buttons help people initiate actions, from sending an email, to sharing a document, to liking a
+ * post. It also morphs between the shapes provided in [shapes] depending on the state of the
+ * interaction with the button as long as the shapes provided our [CornerBasedShape]s. If a shape in
+ * [shapes] isn't a [CornerBasedShape], then button will change between the [ButtonShapes] according
+ * to user interaction.
+ *
+ * ![Filled button
+ * image](https://developer.android.com/images/reference/androidx/compose/material3/filled-button.png)
+ *
+ * Filled buttons are high-emphasis buttons. Filled buttons have the most visual impact after the
+ * [FloatingActionButton], and should be used for important, final actions that complete a flow,
+ * like "Save", "Join now", or "Confirm".
+ *
+ * @sample androidx.compose.material3.samples.ButtonWithAnimatedShapeSample
+ *
+ * Choose the best button for an action based on the amount of emphasis it needs. The more important
+ * an action is, the higher emphasis its button should be.
+ * - See [OutlinedButton] for a medium-emphasis button with a border.
+ * - See [ElevatedButton] for an [FilledTonalButton] with a shadow.
+ * - See [TextButton] for a low-emphasis button with no border.
+ * - See [FilledTonalButton] for a middle ground between [OutlinedButton] and [Button].
+ *
+ * The default text style for internal [Text] components will be set to [Typography.labelLarge].
+ *
+ * @param onClick called when this button is clicked
+ * @param shapes the [ButtonShapes] that this button with morph between depending on the user's
+ *   interaction with the button.
+ * @param modifier the [Modifier] to be applied to this button
+ * @param enabled controls the enabled state of this button. When `false`, this component will not
+ *   respond to user input, and it will appear visually disabled and disabled to accessibility
+ *   services.
+ * @param colors [ButtonColors] that will be used to resolve the colors for this button in different
+ *   states. See [ButtonDefaults.buttonColors].
+ * @param elevation [ButtonElevation] used to resolve the elevation for this button in different
+ *   states. This controls the size of the shadow below the button. See
+ *   [ButtonElevation.shadowElevation].
+ * @param border the border to draw around the container of this button
+ * @param contentPadding the spacing values to apply internally between the container and the
+ *   content
+ * @param interactionSource an optional hoisted [MutableInteractionSource] for observing and
+ *   emitting [Interaction]s for this button. You can use this to change the button's appearance or
+ *   preview the button in different states. Note that if `null` is provided, interactions will
+ *   still happen internally.
+ * @param content The content displayed on the button, expected to be text, icon or image.
+ */
+@Composable
+@ExperimentalMaterial3ExpressiveApi
+fun Button(
+    onClick: () -> Unit,
+    shapes: ButtonShapes,
+    modifier: Modifier = Modifier,
+    enabled: Boolean = true,
+    colors: ButtonColors = ButtonDefaults.buttonColors(),
+    elevation: ButtonElevation? = ButtonDefaults.buttonElevation(),
+    border: BorderStroke? = null,
+    contentPadding: PaddingValues = ButtonDefaults.ContentPadding,
+    interactionSource: MutableInteractionSource? = null,
+    content: @Composable RowScope.() -> Unit
+) {
+    @Suppress("NAME_SHADOWING")
+    val interactionSource = interactionSource ?: remember { MutableInteractionSource() }
+    // TODO Load the motionScheme tokens from the component tokens file
+    // MotionSchemeKeyTokens.DefaultEffects is intentional here to prevent
+    // any bounce in this component.
+    val defaultAnimationSpec = MotionSchemeKeyTokens.DefaultEffects.value<Float>()
+    val pressed by interactionSource.collectIsPressedAsState()
+    val containerColor = colors.containerColor(enabled)
+    val contentColor = colors.contentColor(enabled)
+    val shadowElevation = elevation?.shadowElevation(enabled, interactionSource)?.value ?: 0.dp
+    val layoutDirection = LocalLayoutDirection.current
+    val buttonShape = shapeByInteraction(shapes, pressed, defaultAnimationSpec)
+
+    Surface(
+        onClick = onClick,
+        modifier = modifier.semantics { role = Role.Button },
+        enabled = enabled,
+        shape = buttonShape,
+        color = containerColor,
+        contentColor = contentColor,
+        shadowElevation = shadowElevation,
+        border = border,
+        interactionSource = interactionSource
+    ) {
+        ProvideContentColorTextStyle(
+            contentColor = contentColor,
+            textStyle = MaterialTheme.typography.labelLarge
+        ) {
+            Row(
+                Modifier.defaultMinSize(
+                        minWidth = ButtonDefaults.MinWidth,
+                        minHeight = ButtonDefaults.MinHeight
+                    )
+                    .then(
+                        when (buttonShape) {
+                            is ShapeWithHorizontalCenterOptically -> {
+                                Modifier.horizontalCenterOptically(
+                                    shape = buttonShape,
+                                    maxStartOffset =
+                                        contentPadding.calculateStartPadding(layoutDirection),
+                                    maxEndOffset =
+                                        contentPadding.calculateEndPadding(layoutDirection)
+                                )
+                            }
+                            is CornerBasedShape -> {
+                                Modifier.horizontalCenterOptically(
+                                    shape = buttonShape,
+                                    maxStartOffset =
+                                        contentPadding.calculateStartPadding(layoutDirection),
+                                    maxEndOffset =
+                                        contentPadding.calculateEndPadding(layoutDirection)
+                                )
+                            }
+                            else -> {
+                                Modifier
+                            }
+                        }
+                    )
+                    .padding(contentPadding),
+                horizontalArrangement = Arrangement.Center,
+                verticalAlignment = Alignment.CenterVertically,
+                content = content
+            )
+        }
+    }
+}
+
 /**
  * <a href="https://m3.material.io/components/buttons/overview" class="external"
  * target="_blank">Material Design elevated button</a>.
@@ -247,6 +389,84 @@
         content = content
     )
 
+// TODO add link to image of pressed elevated button
+/**
+ * <a href="https://m3.material.io/components/buttons/overview" class="external"
+ * target="_blank">Material Design elevated button</a>.
+ *
+ * Buttons help people initiate actions, from sending an email, to sharing a document, to liking a
+ * post. It also morphs between the shapes provided in [shapes] depending on the state of the
+ * interaction with the button as long as the shapes provided our [CornerBasedShape]s. If a shape in
+ * [shapes] isn't a [CornerBasedShape], then button will change between the [ButtonShapes] according
+ * to user interaction.
+ *
+ * ![Elevated button
+ * image](https://developer.android.com/images/reference/androidx/compose/material3/elevated-button.png)
+ *
+ * Elevated buttons are high-emphasis buttons that are essentially [FilledTonalButton]s with a
+ * shadow. To prevent shadow creep, only use them when absolutely necessary, such as when the button
+ * requires visual separation from patterned container.
+ *
+ * @sample androidx.compose.material3.samples.ElevatedButtonWithAnimatedShapeSample
+ *
+ * Choose the best button for an action based on the amount of emphasis it needs. The more important
+ * an action is, the higher emphasis its button should be.
+ * - See [Button] for a high-emphasis button without a shadow, also known as a filled button.
+ * - See [FilledTonalButton] for a middle ground between [OutlinedButton] and [Button].
+ * - See [OutlinedButton] for a medium-emphasis button with a border.
+ * - See [TextButton] for a low-emphasis button with no border.
+ *
+ * The default text style for internal [Text] components will be set to [Typography.labelLarge].
+ *
+ * @param onClick called when this button is clicked
+ * @param shapes the [ButtonShapes] that this button with morph between depending on the user's
+ *   interaction with the button.
+ * @param modifier the [Modifier] to be applied to this button
+ * @param enabled controls the enabled state of this button. When `false`, this component will not
+ *   respond to user input, and it will appear visually disabled and disabled to accessibility
+ *   services.
+ * @param colors [ButtonColors] that will be used to resolve the colors for this button in different
+ *   states. See [ButtonDefaults.elevatedButtonColors].
+ * @param elevation [ButtonElevation] used to resolve the elevation for this button in different
+ *   states. This controls the size of the shadow below the button. Additionally, when the container
+ *   color is [ColorScheme.surface], this controls the amount of primary color applied as an
+ *   overlay. See [ButtonDefaults.elevatedButtonElevation].
+ * @param border the border to draw around the container of this button
+ * @param contentPadding the spacing values to apply internally between the container and the
+ *   content
+ * @param interactionSource an optional hoisted [MutableInteractionSource] for observing and
+ *   emitting [Interaction]s for this button. You can use this to change the button's appearance or
+ *   preview the button in different states. Note that if `null` is provided, interactions will
+ *   still happen internally.
+ * @param content The content displayed on the button, expected to be text, icon or image.
+ */
+@Composable
+@ExperimentalMaterial3ExpressiveApi
+fun ElevatedButton(
+    onClick: () -> Unit,
+    shapes: ButtonShapes,
+    modifier: Modifier = Modifier,
+    enabled: Boolean = true,
+    colors: ButtonColors = ButtonDefaults.elevatedButtonColors(),
+    elevation: ButtonElevation? = ButtonDefaults.elevatedButtonElevation(),
+    border: BorderStroke? = null,
+    contentPadding: PaddingValues = ButtonDefaults.ContentPadding,
+    interactionSource: MutableInteractionSource? = null,
+    content: @Composable RowScope.() -> Unit
+) =
+    Button(
+        onClick = onClick,
+        shapes = shapes,
+        modifier = modifier,
+        enabled = enabled,
+        colors = colors,
+        elevation = elevation,
+        border = border,
+        contentPadding = contentPadding,
+        interactionSource = interactionSource,
+        content = content
+    )
+
 /**
  * <a href="https://m3.material.io/components/buttons/overview" class="external"
  * target="_blank">Material Design filled tonal button</a>.
@@ -321,6 +541,85 @@
         content = content
     )
 
+// TODO add link to image of pressed filled tonal button
+/**
+ * <a href="https://m3.material.io/components/buttons/overview" class="external"
+ * target="_blank">Material Design filled tonal button</a>.
+ *
+ * Buttons help people initiate actions, from sending an email, to sharing a document, to liking a
+ * post. It also morphs between the shapes provided in [shapes] depending on the state of the
+ * interaction with the button as long as the shapes provided our [CornerBasedShape]s. If a shape in
+ * [shapes] isn't a [CornerBasedShape], then button will change between the [ButtonShapes] according
+ * to user interaction.
+ *
+ * ![Filled tonal button
+ * image](https://developer.android.com/images/reference/androidx/compose/material3/filled-tonal-button.png)
+ *
+ * Filled tonal buttons are medium-emphasis buttons that is an alternative middle ground between
+ * default [Button]s (filled) and [OutlinedButton]s. They can be used in contexts where
+ * lower-priority button requires slightly more emphasis than an outline would give, such as "Next"
+ * in an onboarding flow. Tonal buttons use the secondary color mapping.
+ *
+ * @sample androidx.compose.material3.samples.FilledTonalButtonWithAnimatedShapeSample
+ *
+ * Choose the best button for an action based on the amount of emphasis it needs. The more important
+ * an action is, the higher emphasis its button should be.
+ * - See [Button] for a high-emphasis button without a shadow, also known as a filled button.
+ * - See [ElevatedButton] for a [FilledTonalButton] with a shadow.
+ * - See [OutlinedButton] for a medium-emphasis button with a border.
+ * - See [TextButton] for a low-emphasis button with no border.
+ *
+ * The default text style for internal [Text] components will be set to [Typography.labelLarge].
+ *
+ * @param onClick called when this button is clicked
+ * @param shapes the [ButtonShapes] that this button with morph between depending on the user's
+ *   interaction with the button.
+ * @param modifier the [Modifier] to be applied to this button
+ * @param enabled controls the enabled state of this button. When `false`, this component will not
+ *   respond to user input, and it will appear visually disabled and disabled to accessibility
+ *   services.
+ * @param colors [ButtonColors] that will be used to resolve the colors for this button in different
+ *   states. See [ButtonDefaults.filledTonalButtonColors].
+ * @param elevation [ButtonElevation] used to resolve the elevation for this button in different
+ *   states. This controls the size of the shadow below the button. Additionally, when the container
+ *   color is [ColorScheme.surface], this controls the amount of primary color applied as an
+ *   overlay.
+ * @param border the border to draw around the container of this button
+ * @param contentPadding the spacing values to apply internally between the container and the
+ *   content
+ * @param interactionSource an optional hoisted [MutableInteractionSource] for observing and
+ *   emitting [Interaction]s for this button. You can use this to change the button's appearance or
+ *   preview the button in different states. Note that if `null` is provided, interactions will
+ *   still happen internally.
+ * @param content The content displayed on the button, expected to be text, icon or image.
+ */
+@Composable
+@ExperimentalMaterial3ExpressiveApi
+fun FilledTonalButton(
+    onClick: () -> Unit,
+    shapes: ButtonShapes,
+    modifier: Modifier = Modifier,
+    enabled: Boolean = true,
+    colors: ButtonColors = ButtonDefaults.filledTonalButtonColors(),
+    elevation: ButtonElevation? = ButtonDefaults.filledTonalButtonElevation(),
+    border: BorderStroke? = null,
+    contentPadding: PaddingValues = ButtonDefaults.ContentPadding,
+    interactionSource: MutableInteractionSource? = null,
+    content: @Composable RowScope.() -> Unit
+) =
+    Button(
+        onClick = onClick,
+        shapes = shapes,
+        modifier = modifier,
+        enabled = enabled,
+        colors = colors,
+        elevation = elevation,
+        border = border,
+        contentPadding = contentPadding,
+        interactionSource = interactionSource,
+        content = content
+    )
+
 /**
  * <a href="https://m3.material.io/components/buttons/overview" class="external"
  * target="_blank">Material Design outlined button</a>.
@@ -394,6 +693,84 @@
         content = content
     )
 
+// TODO add link to image of pressed outlined button
+/**
+ * <a href="https://m3.material.io/components/buttons/overview" class="external"
+ * target="_blank">Material Design outlined button</a>.
+ *
+ * Buttons help people initiate actions, from sending an email, to sharing a document, to liking a
+ * post. It also morphs between the shapes provided in [shapes] depending on the state of the
+ * interaction with the button as long as the shapes provided our [CornerBasedShape]s. If a shape in
+ * [shapes] isn't a [CornerBasedShape], then button will change between the [ButtonShapes] according
+ * to user interaction.
+ *
+ * ![Outlined button
+ * image](https://developer.android.com/images/reference/androidx/compose/material3/outlined-button.png)
+ *
+ * Outlined buttons are medium-emphasis buttons. They contain actions that are important, but are
+ * not the primary action in an app. Outlined buttons pair well with [Button]s to indicate an
+ * alternative, secondary action.
+ *
+ * @sample androidx.compose.material3.samples.OutlinedButtonWithAnimatedShapeSample
+ *
+ * Choose the best button for an action based on the amount of emphasis it needs. The more important
+ * an action is, the higher emphasis its button should be.
+ * - See [Button] for a high-emphasis button without a shadow, also known as a filled button.
+ * - See [FilledTonalButton] for a middle ground between [OutlinedButton] and [Button].
+ * - See [OutlinedButton] for a medium-emphasis button with a border.
+ * - See [TextButton] for a low-emphasis button with no border.
+ *
+ * The default text style for internal [Text] components will be set to [Typography.labelLarge].
+ *
+ * @param onClick called when this button is clicked
+ * @param shapes the [ButtonShapes] that this button with morph between depending on the user's
+ *   interaction with the button.
+ * @param modifier the [Modifier] to be applied to this button
+ * @param enabled controls the enabled state of this button. When `false`, this component will not
+ *   respond to user input, and it will appear visually disabled and disabled to accessibility
+ *   services.
+ * @param colors [ButtonColors] that will be used to resolve the colors for this button in different
+ *   states. See [ButtonDefaults.outlinedButtonColors].
+ * @param elevation [ButtonElevation] used to resolve the elevation for this button in different
+ *   states. This controls the size of the shadow below the button. Additionally, when the container
+ *   color is [ColorScheme.surface], this controls the amount of primary color applied as an
+ *   overlay.
+ * @param border the border to draw around the container of this button. Pass `null` for no border.
+ * @param contentPadding the spacing values to apply internally between the container and the
+ *   content
+ * @param interactionSource an optional hoisted [MutableInteractionSource] for observing and
+ *   emitting [Interaction]s for this button. You can use this to change the button's appearance or
+ *   preview the button in different states. Note that if `null` is provided, interactions will
+ *   still happen internally.
+ * @param content The content displayed on the button, expected to be text, icon or image.
+ */
+@Composable
+@ExperimentalMaterial3ExpressiveApi
+fun OutlinedButton(
+    onClick: () -> Unit,
+    shapes: ButtonShapes,
+    modifier: Modifier = Modifier,
+    enabled: Boolean = true,
+    colors: ButtonColors = ButtonDefaults.outlinedButtonColors(),
+    elevation: ButtonElevation? = null,
+    border: BorderStroke? = ButtonDefaults.outlinedButtonBorder(enabled),
+    contentPadding: PaddingValues = ButtonDefaults.ContentPadding,
+    interactionSource: MutableInteractionSource? = null,
+    content: @Composable RowScope.() -> Unit
+) =
+    Button(
+        onClick = onClick,
+        shapes = shapes,
+        modifier = modifier,
+        enabled = enabled,
+        colors = colors,
+        elevation = elevation,
+        border = border,
+        contentPadding = contentPadding,
+        interactionSource = interactionSource,
+        content = content
+    )
+
 /**
  * <a href="https://m3.material.io/components/buttons/overview" class="external"
  * target="_blank">Material Design text button</a>.
@@ -408,7 +785,7 @@
  * and cards. In cards, text buttons help maintain an emphasis on card content. Text buttons are
  * used for the lowest priority actions, especially when presenting multiple options.
  *
- * @sample androidx.compose.material3.samples.TextButtonSample
+ * @sample androidx.compose.material3.samples.TextButtonWithAnimatedShapeSample
  *
  * Choose the best button for an action based on the amount of emphasis it needs. The more important
  * an action is, the higher emphasis its button should be.
@@ -468,6 +845,85 @@
         content = content
     )
 
+// TODO add link to image of pressed text button
+/**
+ * <a href="https://m3.material.io/components/buttons/overview" class="external"
+ * target="_blank">Material Design text button</a>.
+ *
+ * Buttons help people initiate actions, from sending an email, to sharing a document, to liking a
+ * post. It also morphs between the shapes provided in [shapes] depending on the state of the
+ * interaction with the button as long as the shapes provided our [CornerBasedShape]s. If a shape in
+ * [shapes] isn't a [CornerBasedShape], then button will change between the [ButtonShapes] according
+ * to user interaction.
+ *
+ * ![Text button
+ * image](https://developer.android.com/images/reference/androidx/compose/material3/text-button.png)
+ *
+ * Text buttons are typically used for less-pronounced actions, including those located in dialogs
+ * and cards. In cards, text buttons help maintain an emphasis on card content. Text buttons are
+ * used for the lowest priority actions, especially when presenting multiple options.
+ *
+ * @sample androidx.compose.material3.samples.TextButtonSample
+ *
+ * Choose the best button for an action based on the amount of emphasis it needs. The more important
+ * an action is, the higher emphasis its button should be.
+ * - See [Button] for a high-emphasis button without a shadow, also known as a filled button.
+ * - See [ElevatedButton] for a [FilledTonalButton] with a shadow.
+ * - See [FilledTonalButton] for a middle ground between [OutlinedButton] and [Button].
+ * - See [OutlinedButton] for a medium-emphasis button with a border.
+ *
+ * The default text style for internal [Text] components will be set to [Typography.labelLarge].
+ *
+ * @param onClick called when this button is clicked
+ * @param shapes the [ButtonShapes] that this button with morph between depending on the user's
+ *   interaction with the button.
+ * @param modifier the [Modifier] to be applied to this button
+ * @param enabled controls the enabled state of this button. When `false`, this component will not
+ *   respond to user input, and it will appear visually disabled and disabled to accessibility
+ *   services.
+ * @param colors [ButtonColors] that will be used to resolve the colors for this button in different
+ *   states. See [ButtonDefaults.textButtonColors].
+ * @param elevation [ButtonElevation] used to resolve the elevation for this button in different
+ *   states. This controls the size of the shadow below the button. Additionally, when the container
+ *   color is [ColorScheme.surface], this controls the amount of primary color applied as an
+ *   overlay. A TextButton typically has no elevation, and the default value is `null`. See
+ *   [ElevatedButton] for a button with elevation.
+ * @param border the border to draw around the container of this button
+ * @param contentPadding the spacing values to apply internally between the container and the
+ *   content
+ * @param interactionSource an optional hoisted [MutableInteractionSource] for observing and
+ *   emitting [Interaction]s for this button. You can use this to change the button's appearance or
+ *   preview the button in different states. Note that if `null` is provided, interactions will
+ *   still happen internally.
+ * @param content The content displayed on the button, expected to be text.
+ */
+@ExperimentalMaterial3ExpressiveApi
+@Composable
+fun TextButton(
+    onClick: () -> Unit,
+    shapes: ButtonShapes,
+    modifier: Modifier = Modifier,
+    enabled: Boolean = true,
+    colors: ButtonColors = ButtonDefaults.textButtonColors(),
+    elevation: ButtonElevation? = null,
+    border: BorderStroke? = null,
+    contentPadding: PaddingValues = ButtonDefaults.TextButtonContentPadding,
+    interactionSource: MutableInteractionSource? = null,
+    content: @Composable RowScope.() -> Unit
+) =
+    Button(
+        onClick = onClick,
+        shapes = shapes,
+        modifier = modifier,
+        enabled = enabled,
+        colors = colors,
+        elevation = elevation,
+        border = border,
+        contentPadding = contentPadding,
+        interactionSource = interactionSource,
+        content = content
+    )
+
 // TODO(b/201341237): Use token values for 0 elevation?
 // TODO(b/201341237): Use token values for null border?
 // TODO(b/201341237): Use token values for no color (transparent)?
@@ -702,13 +1158,20 @@
     @ExperimentalMaterial3ExpressiveApi
     val XLargeIconSpacing = ButtonXLargeTokens.IconLabelSpace
 
-    /** Square shape for any button. */
+    /** Square shape for default buttons. */
     @Suppress("OPT_IN_MARKER_ON_WRONG_TARGET")
     @get:ExperimentalMaterial3ExpressiveApi
     @ExperimentalMaterial3ExpressiveApi
     val squareShape: Shape
         @Composable get() = ButtonSmallTokens.ContainerShapeSquare.value
 
+    /** Pressed shape for default buttons. */
+    @Suppress("OPT_IN_MARKER_ON_WRONG_TARGET")
+    @get:ExperimentalMaterial3ExpressiveApi
+    @ExperimentalMaterial3ExpressiveApi
+    val pressedShape: Shape
+        @Composable get() = ButtonSmallTokens.PressedContainerShape.value
+
     /** Default shape for a button. */
     val shape: Shape
         @Composable get() = ButtonSmallTokens.ContainerShapeRound.value
@@ -730,6 +1193,24 @@
         @Composable get() = ButtonSmallTokens.ContainerShapeRound.value
 
     /**
+     * Creates a [ButtonShapes] that represents the default shape and pressed shape used in a
+     * button.
+     */
+    @ExperimentalMaterial3ExpressiveApi
+    @Composable
+    fun shapes() = MaterialTheme.shapes.defaultButtonShapes
+
+    @OptIn(ExperimentalMaterial3ExpressiveApi::class)
+    internal val Shapes.defaultButtonShapes: ButtonShapes
+        @Composable
+        get() {
+            return defaultButtonShapesCached
+                ?: ButtonShapes(shape = shape, pressedShape = pressedShape).also {
+                    defaultButtonShapesCached = it
+                }
+        }
+
+    /**
      * Creates a [ButtonColors] that represents the default container and content colors used in a
      * [Button].
      */
@@ -1277,3 +1758,72 @@
         return result
     }
 }
+
+/**
+ * The shapes that will be used in buttons. Button will morph between these shapes depending on the
+ * interaction of the button, assuming all of the shapes are [CornerBasedShape]s.
+ *
+ * @property shape is the active shape.
+ * @property pressedShape is the pressed shape.
+ */
+@ExperimentalMaterial3ExpressiveApi
+@Immutable
+class ButtonShapes(val shape: Shape, val pressedShape: Shape) {
+    /** Returns a copy of this ButtonShapes, optionally overriding some of the values. */
+    fun copy(
+        shape: Shape? = this.shape,
+        pressedShape: Shape? = this.pressedShape,
+    ) =
+        ButtonShapes(
+            shape = shape.takeOrElse { this.shape },
+            pressedShape = pressedShape.takeOrElse { this.pressedShape }
+        )
+
+    internal fun Shape?.takeOrElse(block: () -> Shape): Shape = this ?: block()
+
+    override fun equals(other: Any?): Boolean {
+        if (this === other) return true
+        if (other == null || other !is ButtonShapes) return false
+
+        if (shape != other.shape) return false
+        if (pressedShape != other.pressedShape) return false
+
+        return true
+    }
+
+    override fun hashCode(): Int {
+        var result = shape.hashCode()
+        result = 31 * result + pressedShape.hashCode()
+
+        return result
+    }
+}
+
+@OptIn(ExperimentalMaterial3ExpressiveApi::class)
+internal val ButtonShapes.hasRoundedCornerShapes: Boolean
+    get() = shape is RoundedCornerShape && pressedShape is RoundedCornerShape
+
+@OptIn(ExperimentalMaterial3ExpressiveApi::class)
+@Composable
+private fun shapeByInteraction(
+    shapes: ButtonShapes,
+    pressed: Boolean,
+    animationSpec: FiniteAnimationSpec<Float>
+): Shape {
+    val shape =
+        if (pressed) {
+            shapes.pressedShape
+        } else {
+            shapes.shape
+        }
+
+    if (shapes.hasRoundedCornerShapes)
+        return key(shapes) {
+            rememberAnimatedShape(
+                shape as RoundedCornerShape,
+                animationSpec,
+            )
+        }
+
+    return shape
+}
diff --git a/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/ButtonGroup.kt b/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/ButtonGroup.kt
index ace32d4..b555741 100644
--- a/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/ButtonGroup.kt
+++ b/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/ButtonGroup.kt
@@ -47,6 +47,7 @@
 import androidx.compose.ui.platform.InspectorInfo
 import androidx.compose.ui.unit.Constraints
 import androidx.compose.ui.unit.Density
+import androidx.compose.ui.unit.Dp
 import androidx.compose.ui.unit.dp
 import androidx.compose.ui.util.fastForEach
 import androidx.compose.ui.util.fastForEachIndexed
@@ -80,9 +81,13 @@
  * @sample androidx.compose.material3.samples.MultiSelectConnectedButtonGroupSample
  * @sample androidx.compose.material3.samples.SingleSelectConnectedButtonGroupSample
  * @param modifier the [Modifier] to be applied to the button group.
- * @param animateFraction the percentage, represented by a float, of the width of the interacted
- *   child element that will be used to expand the interacted child element as well as compress the
- *   neighboring children.
+ * @param expandedRatio the percentage, represented by a float, of the width of the interacted child
+ *   element that will be used to expand the interacted child element as well as compress the
+ *   neighboring children. By Default, standard button group will expand the interacted child
+ *   element by [ButtonGroupDefaults.ExpandedRatio] of its width and this will be propagated to its
+ *   neighbors. If 0f is passed into this slot, then the interacted child element will not expand at
+ *   all and the neighboring elements will not compress. If 1f is passed into this slot, then the
+ *   interacted child element will expand to 200% of its default width when pressed.
  * @param horizontalArrangement The horizontal arrangement of the button group's children.
  * @param content the content displayed in the button group, expected to use a Material3 component
  *   or a composable that is tagged with [Modifier.interactionSourceData].
@@ -91,9 +96,8 @@
 @ExperimentalMaterial3ExpressiveApi
 fun ButtonGroup(
     modifier: Modifier = Modifier,
-    @FloatRange(0.0) animateFraction: Float = ButtonGroupDefaults.animateFraction,
-    horizontalArrangement: Arrangement.Horizontal =
-        Arrangement.spacedBy(ButtonGroupDefaults.spaceBetween),
+    @FloatRange(0.0) expandedRatio: Float = ButtonGroupDefaults.ExpandedRatio,
+    horizontalArrangement: Arrangement.Horizontal = ButtonGroupDefaults.HorizontalArrangement,
     content: @Composable ButtonGroupScope.() -> Unit
 ) {
     // TODO Load the motionScheme tokens from the component tokens file
@@ -132,7 +136,7 @@
                                 pressedIndex = index
                                 coroutineScope.launch {
                                     anim.animateTo(
-                                        targetValue = animateFraction,
+                                        targetValue = expandedRatio,
                                         animationSpec = defaultAnimationSpec
                                     )
                                 }
@@ -181,56 +185,66 @@
     /**
      * The default percentage, represented as a float, of the width of the interacted child element
      * that will be used to expand the interacted child element as well as compress the neighboring
-     * children.
+     * children. By Default, standard button group will expand the interacted child element by 15%
+     * of its width and this will be propagated to its neighbors.
      */
-    val animateFraction = 0.15f
+    val ExpandedRatio = 0.15f
 
-    /** The default spacing used between children. */
-    val spaceBetween = ButtonGroupSmallTokens.BetweenSpace
+    /** The default Arrangement used between children. */
+    val HorizontalArrangement: Arrangement.Horizontal =
+        Arrangement.spacedBy(ButtonGroupSmallTokens.BetweenSpace)
 
     /** The default spacing used between children for connected button group */
     // TODO replace with token value
-    val connectedSpaceBetween = 2.dp
+    val ConnectedSpaceBetween: Dp = 2.dp
 
     /** Default shape for the leading button in a connected button group */
-    val connectedLeadingButtonShape: Shape =
-        // TODO replace with token value
-        RoundedCornerShape(
-            topStart = ShapeDefaults.CornerFull,
-            bottomStart = ShapeDefaults.CornerFull,
-            topEnd = ShapeDefaults.CornerSmall,
-            bottomEnd = ShapeDefaults.CornerSmall
-        )
+    val connectedLeadingButtonShape: Shape
+        @Composable
+        get() =
+            // TODO replace with token value
+            RoundedCornerShape(
+                topStart = ShapeDefaults.CornerFull,
+                bottomStart = ShapeDefaults.CornerFull,
+                topEnd = ShapeDefaults.CornerSmall,
+                bottomEnd = ShapeDefaults.CornerSmall
+            )
 
     /** Default shape for the pressed state for the leading button in a connected button group. */
-    val connectedLeadingButtonPressShape: Shape =
-        // TODO replace with token value
-        RoundedCornerShape(
-            topStart = ShapeDefaults.CornerFull,
-            bottomStart = ShapeDefaults.CornerFull,
-            topEnd = ShapeDefaults.CornerExtraSmall,
-            bottomEnd = ShapeDefaults.CornerExtraSmall
-        )
+    val connectedLeadingButtonPressShape: Shape
+        @Composable
+        get() =
+            // TODO replace with token value
+            RoundedCornerShape(
+                topStart = ShapeDefaults.CornerFull,
+                bottomStart = ShapeDefaults.CornerFull,
+                topEnd = ShapeDefaults.CornerExtraSmall,
+                bottomEnd = ShapeDefaults.CornerExtraSmall
+            )
 
     /** Default shape for the trailing button in a connected button group */
-    val connectedTrailingButtonShape: Shape =
-        // TODO replace with token value
-        RoundedCornerShape(
-            topEnd = ShapeDefaults.CornerFull,
-            bottomEnd = ShapeDefaults.CornerFull,
-            topStart = ShapeDefaults.CornerSmall,
-            bottomStart = ShapeDefaults.CornerSmall
-        )
+    val connectedTrailingButtonShape: Shape
+        @Composable
+        get() =
+            // TODO replace with token value
+            RoundedCornerShape(
+                topEnd = ShapeDefaults.CornerFull,
+                bottomEnd = ShapeDefaults.CornerFull,
+                topStart = ShapeDefaults.CornerSmall,
+                bottomStart = ShapeDefaults.CornerSmall
+            )
 
     /** Default shape for the pressed state for the trailing button in a connected button group. */
-    val connectedTrailingButtonPressShape: Shape =
-        // TODO replace with token value
-        RoundedCornerShape(
-            topEnd = ShapeDefaults.CornerFull,
-            bottomEnd = ShapeDefaults.CornerFull,
-            topStart = ShapeDefaults.CornerExtraSmall,
-            bottomStart = ShapeDefaults.CornerExtraSmall
-        )
+    val connectedTrailingButtonPressShape: Shape
+        @Composable
+        get() =
+            // TODO replace with token value
+            RoundedCornerShape(
+                topEnd = ShapeDefaults.CornerFull,
+                bottomEnd = ShapeDefaults.CornerFull,
+                topStart = ShapeDefaults.CornerExtraSmall,
+                bottomStart = ShapeDefaults.CornerExtraSmall
+            )
 }
 
 private class ButtonGroupMeasurePolicy(
diff --git a/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/SearchBar.kt b/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/SearchBar.kt
index 860584f..a620105 100644
--- a/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/SearchBar.kt
+++ b/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/SearchBar.kt
@@ -55,6 +55,7 @@
 import androidx.compose.foundation.layout.exclude
 import androidx.compose.foundation.layout.fillMaxWidth
 import androidx.compose.foundation.layout.heightIn
+import androidx.compose.foundation.layout.imePadding
 import androidx.compose.foundation.layout.offset
 import androidx.compose.foundation.layout.onConsumedWindowInsetsChanged
 import androidx.compose.foundation.layout.only
@@ -139,14 +140,13 @@
 import androidx.compose.ui.layout.layoutId
 import androidx.compose.ui.layout.onGloballyPositioned
 import androidx.compose.ui.layout.onSizeChanged
-import androidx.compose.ui.layout.positionOnScreen
+import androidx.compose.ui.layout.positionInWindow
 import androidx.compose.ui.platform.InterceptPlatformTextInput
 import androidx.compose.ui.platform.LocalDensity
 import androidx.compose.ui.platform.LocalFocusManager
 import androidx.compose.ui.platform.LocalSoftwareKeyboardController
 import androidx.compose.ui.platform.SoftwareKeyboardController
 import androidx.compose.ui.semantics.contentDescription
-import androidx.compose.ui.semantics.onClick
 import androidx.compose.ui.semantics.semantics
 import androidx.compose.ui.semantics.stateDescription
 import androidx.compose.ui.text.TextStyle
@@ -154,18 +154,28 @@
 import androidx.compose.ui.text.input.VisualTransformation
 import androidx.compose.ui.unit.Constraints
 import androidx.compose.ui.unit.Dp
+import androidx.compose.ui.unit.IntOffset
 import androidx.compose.ui.unit.IntRect
 import androidx.compose.ui.unit.IntSize
 import androidx.compose.ui.unit.LayoutDirection
 import androidx.compose.ui.unit.Velocity
+import androidx.compose.ui.unit.constrain
 import androidx.compose.ui.unit.constrainHeight
 import androidx.compose.ui.unit.constrainWidth
 import androidx.compose.ui.unit.dp
+import androidx.compose.ui.unit.lerp
+import androidx.compose.ui.unit.offset
 import androidx.compose.ui.unit.round
 import androidx.compose.ui.util.fastFirst
 import androidx.compose.ui.util.fastFirstOrNull
+import androidx.compose.ui.util.fastForEach
+import androidx.compose.ui.util.fastMap
+import androidx.compose.ui.util.fastMaxOfOrNull
 import androidx.compose.ui.util.lerp
 import androidx.compose.ui.window.DialogProperties
+import androidx.compose.ui.window.Popup
+import androidx.compose.ui.window.PopupPositionProvider
+import androidx.compose.ui.window.PopupProperties
 import androidx.compose.ui.zIndex
 import kotlin.coroutines.cancellation.CancellationException
 import kotlin.math.abs
@@ -188,7 +198,8 @@
  * image](https://developer.android.com/images/reference/androidx/compose/material3/search-bar.png)
  *
  * The [SearchBar] component represents a search bar in the collapsed state. It should be used in
- * conjunction with an [ExpandedFullScreenSearchBar] to display search results when expanded.
+ * conjunction with an [ExpandedFullScreenSearchBar] or [ExpandedDockedSearchBar] to display search
+ * results when expanded.
  *
  * @param state the state of the search bar. This state should also be passed to the [inputField]
  *   and the expanded search bar.
@@ -243,8 +254,8 @@
  * A [TopSearchBar] is a [SearchBar] with additional handling for top app bar behavior, such as
  * window insets and scrolling. Using a [TopSearchBar] as the top bar of a [Scaffold] ensures that
  * the search bar remains at the top of the screen. Like with [SearchBar], [TopSearchBar] should be
- * used in conjunction with an [ExpandedFullScreenSearchBar] to display search results when
- * expanded.
+ * used in conjunction with an [ExpandedFullScreenSearchBar] or [ExpandedDockedSearchBar] to display
+ * search results when expanded.
  *
  * @param state the state of the search bar. This state should also be passed to the [inputField]
  *   and the expanded search bar.
@@ -301,6 +312,8 @@
 /**
  * [ExpandedFullScreenSearchBar] represents a search bar that is currently expanding or in the
  * expanded state, showing search results. This component is displayed in a new full-screen dialog.
+ * If this expansion behavior is undesirable, for example on medium or large screens such as
+ * tablets, [ExpandedDockedSearchBar] can be used instead.
  *
  * @param state the state of the search bar. This state should also be passed to the [inputField]
  *   and the collapsed search bar.
@@ -369,7 +382,91 @@
 
         // Focus the input field on the first expansion,
         // but no need to re-focus if the focus gets cleared.
-        LaunchedEffect(state.isExpanded) { focusRequester.requestFocus() }
+        LaunchedEffect(Unit) { focusRequester.requestFocus() }
+    }
+}
+
+/**
+ * [ExpandedDockedSearchBar] represents a search bar that is currently expanding or in the expanded
+ * state, showing search results. This component is displayed in a popup over the collapsed search
+ * bar. It is recommended to use [ExpandedDockedSearchBar] on medium and large screens such as
+ * tablets, and to instead use [ExpandedFullScreenSearchBar] on compact screen such as phones.
+ *
+ * @param state the state of the search bar. This state should also be passed to the [inputField]
+ *   and the collapsed search bar.
+ * @param inputField the input field of this search bar that allows entering a query, typically a
+ *   [SearchBarDefaults.InputField].
+ * @param modifier the [Modifier] to be applied to this expanded search bar.
+ * @param shape the shape of this search bar.
+ * @param colors [SearchBarColors] that will be used to resolve the colors used for this search bar
+ *   in different states. See [SearchBarDefaults.colors].
+ * @param tonalElevation when [SearchBarColors.containerColor] is [ColorScheme.surface], a
+ *   translucent primary color overlay is applied on top of the container. A higher tonal elevation
+ *   value will result in a darker color in light theme and lighter color in dark theme. See also:
+ *   [Surface].
+ * @param shadowElevation the elevation for the shadow below this search bar.
+ * @param properties the platform-specific properties to configure the dialog's behavior. Any
+ *   properties which limit the dialog's size (e.g. [DialogProperties.usePlatformDefaultWidth]) are
+ *   ignored.
+ * @param content the content of this search bar to display search results below the [inputField].
+ */
+@ExperimentalMaterial3Api
+@Composable
+internal fun ExpandedDockedSearchBar(
+    state: SearchBarState,
+    inputField: @Composable () -> Unit,
+    modifier: Modifier = Modifier,
+    shape: Shape = SearchBarDefaults.dockedShape,
+    colors: SearchBarColors = SearchBarDefaults.colors(),
+    tonalElevation: Dp = SearchBarDefaults.TonalElevation,
+    shadowElevation: Dp = SearchBarDefaults.ShadowElevation,
+    properties: PopupProperties = PopupProperties(focusable = true, clippingEnabled = false),
+    content: @Composable ColumnScope.() -> Unit,
+) {
+    if (!state.isExpanded) return
+
+    val positionProvider =
+        remember(state) {
+            object : PopupPositionProvider {
+                override fun calculatePosition(
+                    anchorBounds: IntRect,
+                    windowSize: IntSize,
+                    layoutDirection: LayoutDirection,
+                    popupContentSize: IntSize
+                ): IntOffset = state.collapsedBounds.topLeft
+            }
+        }
+
+    val scope = rememberCoroutineScope()
+
+    Popup(
+        popupPositionProvider = positionProvider,
+        onDismissRequest = { scope.launch { state.animateToCollapsed() } },
+        properties = properties,
+    ) {
+        val focusRequester = remember { FocusRequester() }
+
+        DockedSearchBarLayout(
+            state = state,
+            inputField = {
+                Box(
+                    modifier = Modifier.focusRequester(focusRequester),
+                    propagateMinConstraints = true,
+                ) {
+                    inputField()
+                }
+            },
+            modifier = modifier,
+            shape = shape,
+            colors = colors,
+            tonalElevation = tonalElevation,
+            shadowElevation = shadowElevation,
+            content = content,
+        )
+
+        // Focus the input field on the first expansion,
+        // but no need to re-focus if the focus gets cleared.
+        LaunchedEffect(Unit) { focusRequester.requestFocus() }
     }
 }
 
@@ -1201,10 +1298,6 @@
                         if (searchBarState.isExpanded) {
                             stateDescription = suggestionsAvailableSemantics
                         }
-                        onClick {
-                            focusRequester.requestFocus()
-                            true
-                        }
                     },
             enabled = enabled,
             readOnly = readOnly,
@@ -1360,10 +1453,6 @@
                         if (expanded) {
                             stateDescription = suggestionsAvailableSemantics
                         }
-                        onClick {
-                            focusRequester.requestFocus()
-                            true
-                        }
                     },
             enabled = enabled,
             readOnly = readOnly,
@@ -1499,10 +1588,6 @@
                         if (expanded) {
                             stateDescription = suggestionsAvailableSemantics
                         }
-                        onClick {
-                            focusRequester.requestFocus()
-                            true
-                        }
                     },
             enabled = enabled,
             singleLine = true,
@@ -2125,6 +2210,83 @@
 
 @OptIn(ExperimentalMaterial3Api::class)
 @Composable
+private fun DockedSearchBarLayout(
+    state: SearchBarState,
+    inputField: @Composable () -> Unit,
+    modifier: Modifier,
+    shape: Shape,
+    colors: SearchBarColors,
+    tonalElevation: Dp,
+    shadowElevation: Dp,
+    content: @Composable ColumnScope.() -> Unit,
+) {
+    val scope = rememberCoroutineScope()
+    BackHandler(enabled = state.isExpanded) { scope.launch { state.animateToCollapsed() } }
+
+    Surface(
+        shape = shape,
+        color = colors.containerColor,
+        contentColor = contentColorFor(colors.containerColor),
+        tonalElevation = tonalElevation,
+        shadowElevation = shadowElevation,
+        modifier = modifier.imePadding(),
+    ) {
+        val windowContainerHeight = getWindowContainerHeight()
+        val maxHeight = windowContainerHeight * DockedExpandedTableMaxHeightScreenRatio
+        val minHeight = DockedExpandedTableMinHeight.coerceAtMost(maxHeight)
+
+        Layout(
+            contents =
+                listOf(
+                    inputField,
+                    {
+                        Column {
+                            HorizontalDivider(color = colors.dividerColor)
+                            content()
+                        }
+                    },
+                )
+        ) { measurables, baseConstraints ->
+            val (inputFieldMeasurables, contentMeasurables) = measurables
+            val constraintMaxHeight =
+                lerp(state.collapsedBounds.height, maxHeight.roundToPx(), state.progress)
+            val constraints =
+                baseConstraints.constrain(
+                    Constraints(
+                        minHeight = minHeight.roundToPx().coerceAtMost(constraintMaxHeight),
+                        maxHeight = constraintMaxHeight,
+                    )
+                )
+            val looseConstraints = constraints.copy(minWidth = 0, minHeight = 0)
+
+            val inputFieldPlaceables =
+                inputFieldMeasurables.fastMap { it.measure(looseConstraints) }
+            val inputFieldWidth = inputFieldPlaceables.fastMaxOfOrNull { it.width } ?: 0
+            val inputFieldHeight = inputFieldPlaceables.fastMaxOfOrNull { it.height } ?: 0
+
+            val contentConstraints =
+                looseConstraints
+                    .offset(vertical = -inputFieldHeight)
+                    .copy(maxWidth = inputFieldWidth)
+            val contentPlaceables = contentMeasurables.fastMap { it.measure(contentConstraints) }
+
+            val height = inputFieldHeight + (contentPlaceables.fastMaxOfOrNull { it.height } ?: 0)
+            val width =
+                max(
+                    inputFieldWidth,
+                    contentPlaceables.fastMaxOfOrNull { it.width } ?: 0,
+                )
+
+            layout(constraints.constrainWidth(width), constraints.constrainHeight(height)) {
+                inputFieldPlaceables.fastForEach { it.place(0, 0) }
+                contentPlaceables.fastForEach { it.place(0, inputFieldHeight) }
+            }
+        }
+    }
+}
+
+@OptIn(ExperimentalMaterial3Api::class)
+@Composable
 private fun FullScreenSearchBarLayout(
     state: SearchBarState,
     predictiveBackState: PredictiveBackState,
@@ -2224,30 +2386,30 @@
         },
     ) { measurables, constraints ->
         val predictiveBackProgress = lastInProgressValue.value.transform()
+        val collapsedWidth =
+            state.collapsedBounds.width.takeIf { it != 0 } ?: SearchBarMinWidth.roundToPx()
+        val collapsedHeight =
+            state.collapsedBounds.height.takeIf { it != 0 } ?: InputFieldHeight.roundToPx()
 
         val predictiveBackEndWidth =
             (constraints.maxWidth * SearchBarPredictiveBackMinScale)
                 .roundToInt()
-                .coerceAtLeast(state.collapsedBounds.width)
+                .coerceAtLeast(collapsedWidth)
         val predictiveBackEndHeight =
             (constraints.maxHeight * SearchBarPredictiveBackMinScale)
                 .roundToInt()
-                .coerceAtLeast(state.collapsedBounds.height)
+                .coerceAtLeast(collapsedHeight)
         val endWidth = lerp(constraints.maxWidth, predictiveBackEndWidth, predictiveBackProgress)
         val endHeight = lerp(constraints.maxHeight, predictiveBackEndHeight, predictiveBackProgress)
-        val width =
-            constraints.constrainWidth(lerp(state.collapsedBounds.width, endWidth, state.progress))
-        val height =
-            constraints.constrainHeight(
-                lerp(state.collapsedBounds.height, endHeight, state.progress)
-            )
+        val width = constraints.constrainWidth(lerp(collapsedWidth, endWidth, state.progress))
+        val height = constraints.constrainHeight(lerp(collapsedHeight, endHeight, state.progress))
 
         val surfaceMeasurable = measurables.fastFirst { it.layoutId == LayoutIdSurface }
         val surfacePlaceable = surfaceMeasurable.measure(Constraints.fixed(width, height))
 
         val inputFieldMeasurable = measurables.fastFirst { it.layoutId == LayoutIdInputField }
         val inputFieldPlaceable =
-            inputFieldMeasurable.measure(Constraints.fixed(width, state.collapsedBounds.height))
+            inputFieldMeasurable.measure(Constraints.fixed(width, collapsedHeight))
 
         val topPadding = unconsumedInsets.getTop(this@Layout) + SearchBarVerticalPadding.roundToPx()
         val bottomPadding = SearchBarVerticalPadding.roundToPx()
@@ -2343,7 +2505,7 @@
 @OptIn(ExperimentalMaterial3Api::class)
 private val SearchBarState.collapsedBounds: IntRect
     get() =
-        collapsedCoords?.let { IntRect(offset = it.positionOnScreen().round(), size = it.size) }
+        collapsedCoords?.let { IntRect(offset = it.positionInWindow().round(), size = it.size) }
             ?: IntRect.Zero
 
 private fun calculatePredictiveBackMultiplier(
diff --git a/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/Shapes.kt b/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/Shapes.kt
index badfc12..4c8d388 100644
--- a/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/Shapes.kt
+++ b/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/Shapes.kt
@@ -259,7 +259,10 @@
     }
 
     /** Cached shapes used in components */
-    internal var defaultToggleButtonShapesCached: ButtonShapes? = null
+    @OptIn(ExperimentalMaterial3ExpressiveApi::class)
+    internal var defaultButtonShapesCached: ButtonShapes? = null
+    @OptIn(ExperimentalMaterial3ExpressiveApi::class)
+    internal var defaultToggleButtonShapesCached: ToggleButtonShapes? = null
     internal var defaultVerticalDragHandleShapesCached: DragHandleShapes? = null
 }
 
diff --git a/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/Slider.kt b/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/Slider.kt
index 7705df8..94234e8 100644
--- a/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/Slider.kt
+++ b/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/Slider.kt
@@ -289,8 +289,6 @@
 ) {
     val state =
         remember(steps, valueRange) { SliderState(value, steps, onValueChangeFinished, valueRange) }
-
-    state.onValueChangeFinished = onValueChangeFinished
     state.onValueChange = onValueChange
     state.value = value
 
@@ -2399,23 +2397,23 @@
 
     private var valueState by mutableFloatStateOf(value)
 
-    /**
-     * [Float] that indicates the current value that the thumb currently is in respect to the track.
-     */
+    /** [Float] that indicates the value that the thumb currently is in respect to the track. */
     var value: Float
         set(newVal) {
-            val coercedValue = newVal.coerceIn(valueRange.start, valueRange.endInclusive)
-            val snappedValue =
-                snapValueToTick(
-                    coercedValue,
-                    tickFractions,
-                    valueRange.start,
-                    valueRange.endInclusive
-                )
-            valueState = snappedValue
+            valueState = calculateSnappedValue(newVal)
         }
         get() = valueState
 
+    private fun calculateSnappedValue(newVal: Float): Float {
+        val coercedValue = newVal.coerceIn(valueRange.start, valueRange.endInclusive)
+        return snapValueToTick(
+            coercedValue,
+            tickFractions,
+            valueRange.start,
+            valueRange.endInclusive
+        )
+    }
+
     override suspend fun drag(
         dragPriority: MutatePriority,
         block: suspend DragScope.() -> Unit
@@ -2448,7 +2446,7 @@
         }
     }
 
-    /** callback in which value should be updated */
+    /** Callback in which value should be updated. */
     var onValueChange: ((Float) -> Unit)? = null
 
     internal val tickFractions = stepsToTickFractions(steps)
@@ -2471,7 +2469,7 @@
                 value.coerceIn(valueRange.start, valueRange.endInclusive)
             )
 
-    internal var isDragging by mutableStateOf(false)
+    var isDragging by mutableStateOf(false)
         private set
 
     internal fun updateDimensions(
diff --git a/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/TimePicker.kt b/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/TimePicker.kt
index f11dc72..4dc22d5 100644
--- a/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/TimePicker.kt
+++ b/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/TimePicker.kt
@@ -17,6 +17,7 @@
 
 package androidx.compose.material3
 
+import androidx.annotation.FloatRange
 import androidx.annotation.IntRange
 import androidx.collection.IntList
 import androidx.collection.MutableIntList
@@ -165,7 +166,6 @@
 import androidx.compose.ui.text.style.TextAlign
 import androidx.compose.ui.unit.Constraints
 import androidx.compose.ui.unit.Density
-import androidx.compose.ui.unit.Dp
 import androidx.compose.ui.unit.DpOffset
 import androidx.compose.ui.unit.IntOffset
 import androidx.compose.ui.unit.IntSize
@@ -720,6 +720,8 @@
 
 internal class AnalogTimePickerState(val state: TimePickerState) : TimePickerState by state {
 
+    var currentDiameter by mutableStateOf(0.dp)
+
     val currentAngle: Float
         get() = anim.value
 
@@ -915,18 +917,20 @@
 
 internal val AnalogTimePickerState.selectorPos: DpOffset
     get() {
-        val handleRadiusPx = ClockDialSelectorHandleContainerSize / 2
+        val scale: Float = currentDiameter / ClockDialContainerSize
+        val handleRadiusDp = (ClockDialSelectorHandleContainerSize / 2f) * scale
         val selectorLength =
             if (is24hour && this.isPm && selection == TimePickerSelectionMode.Hour) {
-                    InnerCircleRadius
+                    currentDiameter * InnerCircleToSizeRatio
                 } else {
-                    OuterCircleSizeRadius
+                    currentDiameter * OuterCircleToSizeRatio
                 }
-                .minus(handleRadiusPx)
+                .minus(handleRadiusDp)
+                .coerceAtLeast(0.dp)
 
-        val length = selectorLength + handleRadiusPx
-        val offsetX = length * cos(currentAngle) + ClockDialContainerSize / 2
-        val offsetY = length * sin(currentAngle) + ClockDialContainerSize / 2
+        val length = selectorLength + handleRadiusDp
+        val offsetX = length * cos(currentAngle) + currentDiameter / 2
+        val offsetY = length * sin(currentAngle) + currentDiameter / 2
 
         return DpOffset(offsetX, offsetY)
     }
@@ -943,9 +947,14 @@
         modifier = modifier.semantics { isTraversalGroup = true },
         horizontalAlignment = Alignment.CenterHorizontally
     ) {
-        VerticalClockDisplay(state, colors)
+        VerticalClockDisplay(state = state, colors = colors)
         Spacer(modifier = Modifier.height(ClockDisplayBottomMargin))
-        ClockFace(state, colors, autoSwitchToMinute)
+        ClockFace(
+            modifier = Modifier.size(ClockDialContainerSize),
+            state = state,
+            colors = colors,
+            autoSwitchToMinute = autoSwitchToMinute
+        )
         Spacer(modifier = Modifier.height(ClockFaceBottomMargin))
     }
 }
@@ -964,7 +973,12 @@
     ) {
         HorizontalClockDisplay(state, colors)
         Spacer(modifier = Modifier.width(ClockDisplayBottomMargin))
-        ClockFace(state, colors, autoSwitchToMinute)
+        ClockFace(
+            modifier = Modifier.then(ClockFaceSizeModifier()),
+            state,
+            colors,
+            autoSwitchToMinute
+        )
     }
 }
 
@@ -1453,9 +1467,13 @@
 
     private var offsetX = 0f
     private var offsetY = 0f
-    private var center: IntOffset = IntOffset.Zero
+    private var center: IntOffset by mutableStateOf(IntOffset.Zero)
     private val maxDist
-        get() = with(requireDensity()) { MaxDistance.toPx() }
+        get() =
+            with(requireDensity()) {
+                MaxDistance.toPx() * state.currentDiameter.roundToPx() /
+                    ClockDialContainerSize.roundToPx()
+            }
 
     private val pointerInputTapNode =
         delegate(
@@ -1498,14 +1516,20 @@
                         offsetX += dragAmount.x
                         offsetY += dragAmount.y
                         state.rotateTo(atan(offsetY - center.y, offsetX - center.x), animationSpec)
+                        state.moveSelector(
+                            x = offsetX,
+                            y = offsetY,
+                            maxDist = maxDist,
+                            center = center
+                        )
                     }
-                    state.moveSelector(offsetX, offsetY, maxDist, center)
                 }
             }
         )
 
     override fun onRemeasured(size: IntSize) {
         center = size.center
+        state.currentDiameter = with(requireDensity()) { size.width.toDp() }
     }
 
     override fun onPointerEvent(
@@ -1540,6 +1564,7 @@
 
 @Composable
 internal fun ClockFace(
+    modifier: Modifier,
     state: AnalogTimePickerState,
     colors: TimePickerColors,
     autoSwitchToMinute: Boolean
@@ -1547,7 +1572,8 @@
     // TODO Load the motionScheme tokens from the component tokens file
     Crossfade(
         modifier =
-            Modifier.background(shape = CircleShape, color = colors.clockDialColor)
+            modifier
+                .background(shape = CircleShape, color = colors.clockDialColor)
                 .then(
                     ClockDialModifier(
                         state,
@@ -1556,14 +1582,13 @@
                         MotionSchemeKeyTokens.DefaultSpatial.value()
                     )
                 )
-                .size(ClockDialContainerSize)
                 .drawSelector(state, colors),
         targetState = state.clockFaceValues,
         animationSpec = MotionSchemeKeyTokens.DefaultEffects.value()
     ) { screen ->
         CircularLayout(
             modifier = Modifier.size(ClockDialContainerSize).semantics { selectableGroup() },
-            radius = OuterCircleSizeRadius,
+            radiusToSizeRatio = OuterCircleToSizeRatio,
         ) {
             CompositionLocalProvider(
                 LocalContentColor provides colors.clockDialContentColor(false)
@@ -1589,7 +1614,7 @@
                             Modifier.layoutId(LayoutId.InnerCircle)
                                 .size(ClockDialContainerSize)
                                 .background(shape = CircleShape, color = Color.Transparent),
-                        radius = InnerCircleRadius
+                        radiusToSizeRatio = InnerCircleToSizeRatio
                     ) {
                         repeat(ExtraHours.size) { index ->
                             val innerValue = ExtraHours[index]
@@ -1615,7 +1640,9 @@
     this.drawWithContent {
         val selectorOffsetPx = Offset(state.selectorPos.x.toPx(), state.selectorPos.y.toPx())
 
-        val selectorRadius = ClockDialSelectorHandleContainerSize.toPx() / 2
+        val selectorRadius =
+            ClockDialSelectorHandleContainerSize.toPx() / 2f * state.currentDiameter.roundToPx() /
+                ClockDialContainerSize.roundToPx()
         val selectorColor = colors.selectorColor
 
         // clear out the selector section
@@ -1910,15 +1937,18 @@
     }
 }
 
-/** Distribute elements evenly on a circle of [radius] */
+/**
+ * Distribute children evenly on a circle of radius equal to the height of this layout times
+ * [radiusToSizeRatio].
+ */
 @Composable
 private fun CircularLayout(
     modifier: Modifier = Modifier,
-    radius: Dp,
+    @FloatRange(from = 0.0, to = 1.0) radiusToSizeRatio: Float,
     content: @Composable () -> Unit,
 ) {
     Layout(modifier = modifier, content = content) { measurables, constraints ->
-        val radiusPx = radius.toPx()
+        val radiusPx = constraints.maxHeight * radiusToSizeRatio
         val itemConstraints = constraints.copy(minWidth = 0, minHeight = 0)
         val placeables =
             measurables
@@ -2006,8 +2036,8 @@
 private const val RadiansPerHour: Float = FullCircle / 12f
 private const val SeparatorZIndex = 2f
 
-private val OuterCircleSizeRadius = 101.dp
-private val InnerCircleRadius = 69.dp
+private val OuterCircleToSizeRatio: Float = 101.dp / ClockDialContainerSize
+private val InnerCircleToSizeRatio: Float = 69.dp / ClockDialContainerSize
 private val ClockDisplayBottomMargin = 36.dp
 private val ClockFaceBottomMargin = 24.dp
 private val DisplaySeparatorWidth = 24.dp
@@ -2022,6 +2052,11 @@
     MutableIntList(Hours.size).apply { Hours.forEach { add((it % 12 + 12)) } }
 private val PeriodToggleMargin = 12.dp
 
+private val TimePickerMaxHeight = 384.dp
+private val TimePickerMidHeight = 330.dp
+private val ClockDialMidContainerSize = 238.dp
+private val ClockDialMinContainerSize = 200.dp
+
 /**
  * Measure the composable with 0,0 so that it stays on the screen. Necessary to correctly handle
  * focus
@@ -2060,3 +2095,22 @@
         return visible == otherModifier.visible
     }
 }
+
+internal class ClockFaceSizeModifier : LayoutModifier {
+
+    override fun MeasureScope.measure(
+        measurable: Measurable,
+        constraints: Constraints
+    ): MeasureResult {
+        var max = constraints.maxHeight.toDp()
+        val size =
+            when {
+                max >= TimePickerMaxHeight -> ClockDialContainerSize
+                max >= TimePickerMidHeight -> ClockDialMidContainerSize
+                else -> ClockDialMinContainerSize
+            }.roundToPx()
+
+        val placeable = measurable.measure(Constraints.fixed(size, size))
+        return layout(placeable.width, placeable.height) { placeable.place(0, 0) }
+    }
+}
diff --git a/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/ToggleButton.kt b/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/ToggleButton.kt
index 2f4b4f4..3052150 100644
--- a/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/ToggleButton.kt
+++ b/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/ToggleButton.kt
@@ -67,7 +67,7 @@
  * [checked]'s value. It also morphs between the three shapes provided in [shapes] depending on the
  * state of the interaction with the toggle button as long as the three shapes provided our
  * [CornerBasedShape]s. If a shape in [shapes] isn't a [CornerBasedShape], then toggle button will
- * toggle between the [ButtonShapes] according to user interaction.
+ * toggle between the [ToggleButtonShapes] according to user interaction.
  *
  * TODO link to an image when available
  *
@@ -93,7 +93,7 @@
  * @param enabled controls the enabled state of this toggle button. When `false`, this component
  *   will not respond to user input, and it will appear visually disabled and disabled to
  *   accessibility services.
- * @param shapes the [ButtonShapes] that the toggle button will morph between depending on the
+ * @param shapes the [ToggleButtonShapes] that the toggle button will morph between depending on the
  *   user's interaction with the toggle button.
  * @param colors [ToggleButtonColors] that will be used to resolve the colors used for this toggle
  *   button in different states. See [ToggleButtonDefaults.toggleButtonColors].
@@ -117,7 +117,7 @@
     onCheckedChange: (Boolean) -> Unit,
     modifier: Modifier = Modifier,
     enabled: Boolean = true,
-    shapes: ButtonShapes = ToggleButtonDefaults.shapes(),
+    shapes: ToggleButtonShapes = ToggleButtonDefaults.shapes(),
     colors: ToggleButtonColors = ToggleButtonDefaults.toggleButtonColors(),
     elevation: ButtonElevation? = ButtonDefaults.buttonElevation(),
     border: BorderStroke? = null,
@@ -197,7 +197,7 @@
  * [checked]'s value. It also morphs between the three shapes provided in [shapes] depending on the
  * state of the interaction with the toggle button as long as the three shapes provided our
  * [CornerBasedShape]s. If a shape in [shapes] isn't a [CornerBasedShape], then toggle button will
- * toggle between the [ButtonShapes] according to user interaction.
+ * toggle between the [ToggleButtonShapes] according to user interaction.
  *
  * TODO link to an image when available
  *
@@ -214,7 +214,7 @@
  * @param enabled controls the enabled state of this toggle button. When `false`, this component
  *   will not respond to user input, and it will appear visually disabled and disabled to
  *   accessibility services.
- * @param shapes the [ButtonShapes] that the toggle button will morph between depending on the
+ * @param shapes the [ToggleButtonShapes] that the toggle button will morph between depending on the
  *   user's interaction with the toggle button.
  * @param colors [ToggleButtonColors] that will be used to resolve the colors used for this toggle
  *   button in different states. See [ToggleButtonDefaults.elevatedToggleButtonColors].
@@ -238,7 +238,7 @@
     onCheckedChange: (Boolean) -> Unit,
     modifier: Modifier = Modifier,
     enabled: Boolean = true,
-    shapes: ButtonShapes = ToggleButtonDefaults.shapes(),
+    shapes: ToggleButtonShapes = ToggleButtonDefaults.shapes(),
     colors: ToggleButtonColors = ToggleButtonDefaults.elevatedToggleButtonColors(),
     elevation: ButtonElevation? = ButtonDefaults.elevatedButtonElevation(),
     border: BorderStroke? = null,
@@ -267,7 +267,7 @@
  * [checked]'s value. It also morphs between the three shapes provided in [shapes] depending on the
  * state of the interaction with the toggle button as long as the three shapes provided our
  * [CornerBasedShape]s. If a shape in [shapes] isn't a [CornerBasedShape], then toggle button will
- * toggle between the [ButtonShapes] according to user interaction.
+ * toggle between the [ToggleButtonShapes] according to user interaction.
  *
  * TODO link to an image when available
  *
@@ -287,7 +287,7 @@
  * @param enabled controls the enabled state of this toggle button. When `false`, this component
  *   will not respond to user input, and it will appear visually disabled and disabled to
  *   accessibility services.
- * @param shapes the [ButtonShapes] that the toggle button will morph between depending on the
+ * @param shapes the [ToggleButtonShapes] that the toggle button will morph between depending on the
  *   user's interaction with the toggle button.
  * @param colors [ToggleButtonColors] that will be used to resolve the colors used for this toggle
  *   button in different states. See [ToggleButtonDefaults.tonalToggleButtonColors].
@@ -311,7 +311,7 @@
     onCheckedChange: (Boolean) -> Unit,
     modifier: Modifier = Modifier,
     enabled: Boolean = true,
-    shapes: ButtonShapes = ToggleButtonDefaults.shapes(),
+    shapes: ToggleButtonShapes = ToggleButtonDefaults.shapes(),
     colors: ToggleButtonColors = ToggleButtonDefaults.tonalToggleButtonColors(),
     elevation: ButtonElevation? = ButtonDefaults.filledTonalButtonElevation(),
     border: BorderStroke? = null,
@@ -340,7 +340,7 @@
  * [checked]'s value. It also morphs between the three shapes provided in [shapes] depending on the
  * state of the interaction with the toggle button as long as the three shapes provided our
  * [CornerBasedShape]s. If a shape in [shapes] isn't a [CornerBasedShape], then toggle button will
- * toggle between the [ButtonShapes] according to user interaction.
+ * toggle between the [ToggleButtonShapes] according to user interaction.
  *
  * TODO link to an image when available
  *
@@ -358,7 +358,7 @@
  * @param enabled controls the enabled state of this toggle button. When `false`, this component
  *   will not respond to user input, and it will appear visually disabled and disabled to
  *   accessibility services.
- * @param shapes the [ButtonShapes] that the toggle button will morph between depending on the
+ * @param shapes the [ToggleButtonShapes] that the toggle button will morph between depending on the
  *   user's interaction with the toggle button.
  * @param colors [ToggleButtonColors] that will be used to resolve the colors used for this toggle
  *   button in different states. See [ToggleButtonDefaults.outlinedToggleButtonColors].
@@ -382,7 +382,7 @@
     onCheckedChange: (Boolean) -> Unit,
     modifier: Modifier = Modifier,
     enabled: Boolean = true,
-    shapes: ButtonShapes = ToggleButtonDefaults.shapes(),
+    shapes: ToggleButtonShapes = ToggleButtonDefaults.shapes(),
     colors: ToggleButtonColors = ToggleButtonDefaults.outlinedToggleButtonColors(),
     elevation: ButtonElevation? = null,
     border: BorderStroke? = if (!checked) ButtonDefaults.outlinedButtonBorder(enabled) else null,
@@ -439,36 +439,36 @@
         )
 
     /**
-     * Creates a [ButtonShapes] that represents the default shape, pressedShape, and checkedShape
-     * used in a [ToggleButton].
+     * Creates a [ToggleButtonShapes] that represents the default shape, pressedShape, and
+     * checkedShape used in a [ToggleButton].
      */
-    @Composable fun shapes() = MaterialTheme.shapes.defaultShapes
+    @Composable fun shapes() = MaterialTheme.shapes.defaultToggleButtonShapes
 
     /**
-     * Creates a [ButtonShapes] that represents the default shape, pressedShape, and checkedShape
-     * used in a [ToggleButton] and its variants.
+     * Creates a [ToggleButtonShapes] that represents the default shape, pressedShape, and
+     * checkedShape used in a [ToggleButton] and its variants.
      *
-     * @param shape the unchecked shape for [ButtonShapes]
-     * @param pressedShape the unchecked shape for [ButtonShapes]
-     * @param checkedShape the unchecked shape for [ButtonShapes]
+     * @param shape the unchecked shape for [ToggleButtonShapes]
+     * @param pressedShape the unchecked shape for [ToggleButtonShapes]
+     * @param checkedShape the unchecked shape for [ToggleButtonShapes]
      */
     @Composable
     fun shapes(
         shape: Shape? = null,
         pressedShape: Shape? = null,
         checkedShape: Shape? = null
-    ): ButtonShapes =
-        MaterialTheme.shapes.defaultShapes.copy(
+    ): ToggleButtonShapes =
+        MaterialTheme.shapes.defaultToggleButtonShapes.copy(
             shape = shape,
             pressedShape = pressedShape,
             checkedShape = checkedShape
         )
 
-    internal val Shapes.defaultShapes: ButtonShapes
+    internal val Shapes.defaultToggleButtonShapes: ToggleButtonShapes
         @Composable
         get() {
             return defaultToggleButtonShapesCached
-                ?: ButtonShapes(
+                ?: ToggleButtonShapes(
                         shape = shape,
                         pressedShape = pressedShape,
                         checkedShape = checkedShape
@@ -885,14 +885,16 @@
  * @property pressedShape is the pressed shape.
  * @property checkedShape is the checked shape.
  */
-class ButtonShapes(val shape: Shape, val pressedShape: Shape, val checkedShape: Shape) {
-    /** Returns a copy of this ButtonShapes, optionally overriding some of the values. */
+@ExperimentalMaterial3ExpressiveApi
+@Immutable
+class ToggleButtonShapes(val shape: Shape, val pressedShape: Shape, val checkedShape: Shape) {
+    /** Returns a copy of this ToggleButtonShapes, optionally overriding some of the values. */
     fun copy(
         shape: Shape? = this.shape,
         pressedShape: Shape? = this.pressedShape,
         checkedShape: Shape? = this.checkedShape
     ) =
-        ButtonShapes(
+        ToggleButtonShapes(
             shape = shape.takeOrElse { this.shape },
             pressedShape = pressedShape.takeOrElse { this.pressedShape },
             checkedShape = checkedShape.takeOrElse { this.checkedShape }
@@ -902,7 +904,7 @@
 
     override fun equals(other: Any?): Boolean {
         if (this === other) return true
-        if (other == null || other !is ButtonShapes) return false
+        if (other == null || other !is ToggleButtonShapes) return false
 
         if (shape != other.shape) return false
         if (pressedShape != other.pressedShape) return false
@@ -920,15 +922,17 @@
     }
 }
 
-internal val ButtonShapes.hasRoundedCornerShapes: Boolean
+@OptIn(ExperimentalMaterial3ExpressiveApi::class)
+internal val ToggleButtonShapes.hasRoundedCornerShapes: Boolean
     get() =
         shape is RoundedCornerShape &&
             pressedShape is RoundedCornerShape &&
             checkedShape is RoundedCornerShape
 
+@OptIn(ExperimentalMaterial3ExpressiveApi::class)
 @Composable
 private fun shapeByInteraction(
-    shapes: ButtonShapes,
+    shapes: ToggleButtonShapes,
     pressed: Boolean,
     checked: Boolean,
     animationSpec: FiniteAnimationSpec<Float>
@@ -938,7 +942,9 @@
             shapes.pressedShape
         } else if (checked) {
             shapes.checkedShape
-        } else shapes.shape
+        } else {
+            shapes.shape
+        }
 
     if (shapes.hasRoundedCornerShapes)
         return key(shapes) {
diff --git a/compose/runtime/runtime/build.gradle b/compose/runtime/runtime/build.gradle
index df41707..d1c6939 100644
--- a/compose/runtime/runtime/build.gradle
+++ b/compose/runtime/runtime/build.gradle
@@ -46,7 +46,6 @@
                 implementation(libs.kotlinStdlibCommon)
                 api(libs.kotlinCoroutinesCore)
                 implementation(project(":collection:collection"))
-                implementation(project(":performance:performance-annotation"))
             }
         }
 
diff --git a/compose/runtime/runtime/compose-runtime-benchmark/src/androidTest/java/androidx/compose/runtime/benchmark/ComposeBenchmarkBase.kt b/compose/runtime/runtime/compose-runtime-benchmark/src/androidTest/java/androidx/compose/runtime/benchmark/ComposeBenchmarkBase.kt
index 243417a..5998d77 100644
--- a/compose/runtime/runtime/compose-runtime-benchmark/src/androidTest/java/androidx/compose/runtime/benchmark/ComposeBenchmarkBase.kt
+++ b/compose/runtime/runtime/compose-runtime-benchmark/src/androidTest/java/androidx/compose/runtime/benchmark/ComposeBenchmarkBase.kt
@@ -242,18 +242,6 @@
         withContext(TestMonotonicFrameClock(this)) { testBody() }
     }
 
-inline fun BenchmarkRule.measureRepeatedSuspendable(block: BenchmarkRule.Scope.() -> Unit) {
-    // Note: this is an extension function to discourage calling from Java.
-
-    // Extract members to locals, to ensure we check #applied, and we don't hit accessors
-    val localState = getState()
-    val localScope = scope
-
-    while (localState.keepRunningInline()) {
-        block(localScope)
-    }
-}
-
 fun ControlledComposition.performRecompose(
     readObserver: (Any) -> Unit,
     writeObserver: (Any) -> Unit
diff --git a/compose/runtime/runtime/proguard-rules.pro b/compose/runtime/runtime/proguard-rules.pro
index 400440d..6e78193 100644
--- a/compose/runtime/runtime/proguard-rules.pro
+++ b/compose/runtime/runtime/proguard-rules.pro
@@ -17,7 +17,7 @@
 # Keep all the functions created to throw an exception. We don't want these functions to be
 # inlined in any way, which R8 will do by default. The whole point of these functions is to
 # reduce the amount of code generated at the call site.
--keepclassmembers,allowshrinking,allowobfuscation class androidx.compose.runtime.** {
+-keep,allowshrinking,allowobfuscation class androidx.compose.runtime.** {
     # java.lang.Void == methods that return Nothing
     static void throw*Exception(...);
     static void throw*ExceptionForNullCheck(...);
@@ -31,7 +31,3 @@
     static void compose*RuntimeError(...);
     static java.lang.Void compose*RuntimeError(...);
 }
-
--keepclassmembers class * {
-    @dalvik.annotation.optimization.NeverInline *;
-}
diff --git a/compose/runtime/runtime/src/androidMain/kotlin/androidx/compose/runtime/collection/ArrayUtils.android.kt b/compose/runtime/runtime/src/androidMain/kotlin/androidx/compose/runtime/collection/ArrayUtils.android.kt
deleted file mode 100644
index c487bdc..0000000
--- a/compose/runtime/runtime/src/androidMain/kotlin/androidx/compose/runtime/collection/ArrayUtils.android.kt
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Copyright 2024 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-@file:Suppress("NOTHING_TO_INLINE", "KotlinRedundantDiagnosticSuppress")
-
-package androidx.compose.runtime.collection
-
-internal actual inline fun <T> Array<out T>.fastCopyInto(
-    destination: Array<T>,
-    destinationOffset: Int,
-    startIndex: Int,
-    endIndex: Int
-): Array<T> {
-    System.arraycopy(this, startIndex, destination, destinationOffset, endIndex - startIndex)
-    return destination
-}
diff --git a/compose/runtime/runtime/src/commonMain/kotlin/androidx/compose/runtime/SlotTable.kt b/compose/runtime/runtime/src/commonMain/kotlin/androidx/compose/runtime/SlotTable.kt
index afd4db85..a295937 100644
--- a/compose/runtime/runtime/src/commonMain/kotlin/androidx/compose/runtime/SlotTable.kt
+++ b/compose/runtime/runtime/src/commonMain/kotlin/androidx/compose/runtime/SlotTable.kt
@@ -23,7 +23,6 @@
 import androidx.collection.MutableIntSet
 import androidx.collection.MutableObjectList
 import androidx.collection.mutableIntListOf
-import androidx.compose.runtime.collection.fastCopyInto
 import androidx.compose.runtime.platform.makeSynchronizedObject
 import androidx.compose.runtime.platform.synchronized
 import androidx.compose.runtime.snapshots.fastAny
@@ -2123,7 +2122,7 @@
         //  4) copy the slots to their new location
         if (moveDataLen > 0) {
             val slots = slots
-            slots.fastCopyInto(
+            slots.copyInto(
                 destination = slots,
                 destinationOffset = destinationSlot,
                 startIndex = dataIndexToDataAddress(dataStart + moveDataLen),
@@ -2207,7 +2206,7 @@
             )
             val slots = toWriter.slots
             val currentSlot = toWriter.currentSlot
-            fromWriter.slots.fastCopyInto(
+            fromWriter.slots.copyInto(
                 destination = slots,
                 destinationOffset = currentSlot,
                 startIndex = sourceSlotsStart,
@@ -2677,7 +2676,7 @@
             val slots = slots
             if (index < gapStart) {
                 // move the gap down to index by shifting the data up.
-                slots.fastCopyInto(
+                slots.copyInto(
                     destination = slots,
                     destinationOffset = index + gapLen,
                     startIndex = index,
@@ -2685,7 +2684,7 @@
                 )
             } else {
                 // Shift the data down, leaving the gap at index
-                slots.fastCopyInto(
+                slots.copyInto(
                     destination = slots,
                     destinationOffset = gapStart,
                     startIndex = gapStart + gapLen,
@@ -2831,13 +2830,13 @@
                 val newGapEndAddress = gapStart + newGapLen
 
                 // Copy the old arrays into the new arrays
-                slots.fastCopyInto(
+                slots.copyInto(
                     destination = newData,
                     destinationOffset = 0,
                     startIndex = 0,
                     endIndex = gapStart
                 )
-                slots.fastCopyInto(
+                slots.copyInto(
                     destination = newData,
                     destinationOffset = newGapEndAddress,
                     startIndex = oldGapEndAddress,
diff --git a/compose/runtime/runtime/src/commonMain/kotlin/androidx/compose/runtime/Stack.kt b/compose/runtime/runtime/src/commonMain/kotlin/androidx/compose/runtime/Stack.kt
index c2e25cd..03989dd 100644
--- a/compose/runtime/runtime/src/commonMain/kotlin/androidx/compose/runtime/Stack.kt
+++ b/compose/runtime/runtime/src/commonMain/kotlin/androidx/compose/runtime/Stack.kt
@@ -14,13 +14,9 @@
  * limitations under the License.
  */
 
-@file:Suppress("NOTHING_TO_INLINE", "KotlinRedundantDiagnosticSuppress")
-
 package androidx.compose.runtime
 
-import kotlin.jvm.JvmField
 import kotlin.jvm.JvmInline
-import kotlin.math.min
 
 @JvmInline
 internal value class Stack<T>(private val backing: ArrayList<T> = ArrayList()) {
@@ -46,33 +42,22 @@
 }
 
 internal class IntStack {
-    @JvmField internal var slots = IntArray(10)
-    @JvmField internal var tos = 0
+    private var slots = IntArray(10)
+    private var tos = 0
 
-    inline val size: Int
+    val size: Int
         get() = tos
 
-    @dalvik.annotation.optimization.NeverInline
-    private fun resize(): IntArray {
-        val copy = slots.copyOf(slots.size * 2)
-        slots = copy
-        return copy
-    }
-
     fun push(value: Int) {
-        var slots = slots
         if (tos >= slots.size) {
-            slots = resize()
+            slots = slots.copyOf(slots.size * 2)
         }
         slots[tos++] = value
     }
 
     fun pop(): Int = slots[--tos]
 
-    fun peekOr(default: Int): Int {
-        val index = tos - 1
-        return if (index >= 0) slots[index] else default
-    }
+    fun peekOr(default: Int): Int = if (tos > 0) peek() else default
 
     fun peek() = slots[tos - 1]
 
@@ -80,20 +65,16 @@
 
     fun peek(index: Int) = slots[index]
 
-    inline fun isEmpty() = tos == 0
+    fun isEmpty() = tos == 0
 
-    inline fun isNotEmpty() = tos != 0
+    fun isNotEmpty() = tos != 0
 
     fun clear() {
         tos = 0
     }
 
     fun indexOf(value: Int): Int {
-        val slots = slots
-        val end = min(slots.size, tos)
-        for (i in 0 until end) {
-            if (slots[i] == value) return i
-        }
+        for (i in 0 until tos) if (slots[i] == value) return i
         return -1
     }
 }
diff --git a/compose/runtime/runtime/src/commonMain/kotlin/androidx/compose/runtime/changelist/Operations.kt b/compose/runtime/runtime/src/commonMain/kotlin/androidx/compose/runtime/changelist/Operations.kt
index 6a1339b..f250bc8 100644
--- a/compose/runtime/runtime/src/commonMain/kotlin/androidx/compose/runtime/changelist/Operations.kt
+++ b/compose/runtime/runtime/src/commonMain/kotlin/androidx/compose/runtime/changelist/Operations.kt
@@ -24,10 +24,8 @@
 import androidx.compose.runtime.RememberManager
 import androidx.compose.runtime.SlotWriter
 import androidx.compose.runtime.changelist.Operation.ObjectParameter
-import androidx.compose.runtime.collection.fastCopyInto
 import androidx.compose.runtime.debugRuntimeCheck
 import androidx.compose.runtime.requirePrecondition
-import dalvik.annotation.optimization.NeverInline
 import kotlin.contracts.ExperimentalContracts
 import kotlin.contracts.InvocationKind.EXACTLY_ONCE
 import kotlin.contracts.contract
@@ -135,12 +133,11 @@
         return (currentSize + resizeAmount).coerceAtLeast(requiredSize)
     }
 
-    @NeverInline
     private fun resizeOpCodes() {
         val resizeAmount = opCodesSize.coerceAtMost(OperationsMaxResizeAmount)
         @Suppress("UNCHECKED_CAST")
         val newOpCodes = arrayOfNulls<Operation>(opCodesSize + resizeAmount) as Array<Operation>
-        opCodes = opCodes.fastCopyInto(newOpCodes, 0, 0, opCodesSize)
+        opCodes = opCodes.copyInto(newOpCodes, 0, 0, opCodesSize)
     }
 
     private inline fun ensureIntArgsSizeAtLeast(requiredSize: Int) {
@@ -150,7 +147,6 @@
         }
     }
 
-    @NeverInline
     private fun resizeIntArgs(currentSize: Int, requiredSize: Int) {
         val newIntArgs = IntArray(determineNewSize(currentSize, requiredSize))
         intArgs.copyInto(newIntArgs, 0, 0, currentSize)
@@ -164,10 +160,9 @@
         }
     }
 
-    @NeverInline
     private fun resizeObjectArgs(currentSize: Int, requiredSize: Int) {
         val newObjectArgs = arrayOfNulls<Any>(determineNewSize(currentSize, requiredSize))
-        objectArgs.fastCopyInto(newObjectArgs, 0, 0, currentSize)
+        objectArgs.copyInto(newObjectArgs, 0, 0, currentSize)
         objectArgs = newObjectArgs
     }
 
@@ -296,7 +291,7 @@
         other.pushOp(op)
 
         // Move the objects then null out our contents
-        objectArgs.fastCopyInto(
+        objectArgs.copyInto(
             destination = other.objectArgs,
             destinationOffset = other.objectArgsSize - op.objects,
             startIndex = objectArgsSize - op.objects,
diff --git a/compose/runtime/runtime/src/commonMain/kotlin/androidx/compose/runtime/collection/ArrayUtils.kt b/compose/runtime/runtime/src/commonMain/kotlin/androidx/compose/runtime/collection/ArrayUtils.kt
deleted file mode 100644
index 03c2546..0000000
--- a/compose/runtime/runtime/src/commonMain/kotlin/androidx/compose/runtime/collection/ArrayUtils.kt
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Copyright 2024 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package androidx.compose.runtime.collection
-
-/**
- * Equivalent of Array.copyInto() with an implementation designed to avoid unnecessary null checks
- * and exception throws on Android after inlining.
- */
-internal expect fun <T> Array<out T>.fastCopyInto(
-    destination: Array<T>,
-    destinationOffset: Int,
-    startIndex: Int,
-    endIndex: Int
-): Array<T>
diff --git a/compose/runtime/runtime/src/commonMain/kotlin/androidx/compose/runtime/collection/MutableVector.kt b/compose/runtime/runtime/src/commonMain/kotlin/androidx/compose/runtime/collection/MutableVector.kt
index 8144a7b..1315b32 100644
--- a/compose/runtime/runtime/src/commonMain/kotlin/androidx/compose/runtime/collection/MutableVector.kt
+++ b/compose/runtime/runtime/src/commonMain/kotlin/androidx/compose/runtime/collection/MutableVector.kt
@@ -18,7 +18,6 @@
 
 package androidx.compose.runtime.collection
 
-import dalvik.annotation.optimization.NeverInline
 import kotlin.contracts.ExperimentalContracts
 import kotlin.contracts.contract
 import kotlin.jvm.JvmField
@@ -67,7 +66,7 @@
         ensureCapacity(size + 1)
         val content = content
         if (index != size) {
-            content.fastCopyInto(
+            content.copyInto(
                 destination = content,
                 destinationOffset = index + 1,
                 startIndex = index,
@@ -84,13 +83,12 @@
      */
     fun addAll(index: Int, elements: List<T>): Boolean {
         if (elements.isEmpty()) return false
-        val elementsSize = elements.size
-        ensureCapacity(size + elementsSize)
+        ensureCapacity(size + elements.size)
         val content = content
         if (index != size) {
-            content.fastCopyInto(
+            content.copyInto(
                 destination = content,
-                destinationOffset = index + elementsSize,
+                destinationOffset = index + elements.size,
                 startIndex = index,
                 endIndex = size
             )
@@ -98,7 +96,7 @@
         for (i in elements.indices) {
             content[index + i] = elements[i]
         }
-        size += elementsSize
+        size += elements.size
         return true
     }
 
@@ -107,25 +105,24 @@
      * that are in the way.
      */
     fun addAll(index: Int, elements: MutableVector<T>): Boolean {
-        val elementsSize = elements.size
-        if (elementsSize == 0) return false
-        ensureCapacity(size + elementsSize)
+        if (elements.isEmpty()) return false
+        ensureCapacity(size + elements.size)
         val content = content
         if (index != size) {
-            content.fastCopyInto(
+            content.copyInto(
                 destination = content,
-                destinationOffset = index + elementsSize,
+                destinationOffset = index + elements.size,
                 startIndex = index,
                 endIndex = size
             )
         }
-        elements.content.fastCopyInto(
+        elements.content.copyInto(
             destination = content,
             destinationOffset = index,
             startIndex = 0,
-            endIndex = elementsSize
+            endIndex = elements.size
         )
-        size += elementsSize
+        size += elements.size
         return true
     }
 
@@ -150,13 +147,12 @@
      * [MutableVector] was changed.
      */
     fun addAll(@Suppress("ArrayReturn") elements: Array<T>): Boolean {
-        val elementsSize = elements.size
-        if (elementsSize == 0) {
+        if (elements.isEmpty()) {
             return false
         }
-        ensureCapacity(size + elementsSize)
-        elements.fastCopyInto(destination = content, destinationOffset = size, 0, elementsSize)
-        size += elementsSize
+        ensureCapacity(size + elements.size)
+        elements.copyInto(destination = content, destinationOffset = size)
+        size += elements.size
         return true
     }
 
@@ -166,19 +162,18 @@
      */
     fun addAll(index: Int, elements: Collection<T>): Boolean {
         if (elements.isEmpty()) return false
-        val elementsSize = elements.size
-        ensureCapacity(size + elementsSize)
+        ensureCapacity(size + elements.size)
         val content = content
         if (index != size) {
-            content.fastCopyInto(
+            content.copyInto(
                 destination = content,
-                destinationOffset = index + elementsSize,
+                destinationOffset = index + elements.size,
                 startIndex = index,
                 endIndex = size
             )
         }
         elements.forEachIndexed { i, item -> content[index + i] = item }
-        size += elementsSize
+        size += elements.size
         return true
     }
 
@@ -292,14 +287,13 @@
         }
     }
 
-    @NeverInline
     @PublishedApi
     internal fun resizeStorage(capacity: Int) {
         val oldContent = content
         val oldSize = oldContent.size
         val newSize = max(capacity, oldSize * 2)
         val newContent = arrayOfNulls<Any?>(newSize) as Array<T?>
-        oldContent.fastCopyInto(newContent, 0, 0, oldSize)
+        oldContent.copyInto(newContent, 0, 0, oldSize)
         content = newContent
     }
 
@@ -700,7 +694,7 @@
         val content = content
         val item = content[index] as T
         if (index != lastIndex) {
-            content.fastCopyInto(
+            content.copyInto(
                 destination = content,
                 destinationOffset = index,
                 startIndex = index + 1,
@@ -716,7 +710,7 @@
     fun removeRange(start: Int, end: Int) {
         if (end > start) {
             if (end < size) {
-                content.fastCopyInto(
+                content.copyInto(
                     destination = content,
                     destinationOffset = start,
                     startIndex = end,
diff --git a/compose/runtime/runtime/src/commonMain/kotlin/androidx/compose/runtime/snapshots/SnapshotWeakSet.kt b/compose/runtime/runtime/src/commonMain/kotlin/androidx/compose/runtime/snapshots/SnapshotWeakSet.kt
index e70d6fd..66075f0a 100644
--- a/compose/runtime/runtime/src/commonMain/kotlin/androidx/compose/runtime/snapshots/SnapshotWeakSet.kt
+++ b/compose/runtime/runtime/src/commonMain/kotlin/androidx/compose/runtime/snapshots/SnapshotWeakSet.kt
@@ -17,7 +17,6 @@
 package androidx.compose.runtime.snapshots
 
 import androidx.compose.runtime.TestOnly
-import androidx.compose.runtime.collection.fastCopyInto
 import androidx.compose.runtime.internal.WeakReference
 import androidx.compose.runtime.internal.identityHashCode
 
@@ -71,18 +70,13 @@
             val newCapacity = capacity * 2
             val newValues = arrayOfNulls<WeakReference<T>?>(newCapacity)
             val newHashes = IntArray(newCapacity)
-            values.fastCopyInto(
+            values.copyInto(
                 destination = newValues,
                 destinationOffset = insertIndex + 1,
                 startIndex = insertIndex,
                 endIndex = size
             )
-            values.fastCopyInto(
-                destination = newValues,
-                destinationOffset = 0,
-                startIndex = 0,
-                endIndex = insertIndex
-            )
+            values.copyInto(destination = newValues, endIndex = insertIndex)
             hashes.copyInto(
                 destination = newHashes,
                 destinationOffset = insertIndex + 1,
@@ -93,7 +87,7 @@
             values = newValues
             hashes = newHashes
         } else {
-            values.fastCopyInto(
+            values.copyInto(
                 destination = values,
                 destinationOffset = insertIndex + 1,
                 startIndex = insertIndex,
diff --git a/compose/ui/ui-graphics/proguard-rules.pro b/compose/ui/ui-graphics/proguard-rules.pro
index 72f4a6c..67d118b 100644
--- a/compose/ui/ui-graphics/proguard-rules.pro
+++ b/compose/ui/ui-graphics/proguard-rules.pro
@@ -15,7 +15,7 @@
 # Keep all the functions created to throw an exception. We don't want these functions to be
 # inlined in any way, which R8 will do by default. The whole point of these functions is to
 # reduce the amount of code generated at the call site.
--keepclassmembers,allowshrinking,allowobfuscation class androidx.compose.**.* {
+-keep,allowshrinking,allowobfuscation class androidx.compose.**.* {
     static void throw*Exception(...);
     static void throw*ExceptionForNullCheck(...);
     # For methods returning Nothing
diff --git a/compose/ui/ui-graphics/src/commonMain/kotlin/androidx/compose/ui/graphics/IntervalTree.kt b/compose/ui/ui-graphics/src/commonMain/kotlin/androidx/compose/ui/graphics/IntervalTree.kt
index 8a2ff33..1d3b503 100644
--- a/compose/ui/ui-graphics/src/commonMain/kotlin/androidx/compose/ui/graphics/IntervalTree.kt
+++ b/compose/ui/ui-graphics/src/commonMain/kotlin/androidx/compose/ui/graphics/IntervalTree.kt
@@ -82,7 +82,8 @@
     // structure beyond what can be found in various descriptions of binary search
     // trees and red/black trees
 
-    @JvmField internal val terminator = Node(Float.MAX_VALUE, Float.MIN_VALUE, null, TreeColorBlack)
+    @JvmField
+    internal val terminator = Node(Float.MAX_VALUE, Float.MIN_VALUE, null, TreeColor.Black)
     @JvmField internal var root = terminator
     @JvmField internal val stack = ArrayList<Node>()
 
@@ -202,7 +203,7 @@
      * @param data Data to associate with the interval
      */
     fun addInterval(start: Float, end: Float, data: T?) {
-        val node = Node(start, end, data, TreeColorRed)
+        val node = Node(start, end, data, TreeColor.Red)
 
         // Update the tree without doing any balancing
         var current = root
@@ -238,44 +239,44 @@
     private fun rebalance(target: Node) {
         var node = target
 
-        while (node !== root && node.parent.color == TreeColorRed) {
+        while (node !== root && node.parent.color == TreeColor.Red) {
             val ancestor = node.parent.parent
             if (node.parent === ancestor.left) {
                 val right = ancestor.right
-                if (right.color == TreeColorRed) {
-                    right.color = TreeColorBlack
-                    node.parent.color = TreeColorBlack
-                    ancestor.color = TreeColorRed
+                if (right.color == TreeColor.Red) {
+                    right.color = TreeColor.Black
+                    node.parent.color = TreeColor.Black
+                    ancestor.color = TreeColor.Red
                     node = ancestor
                 } else {
                     if (node === node.parent.right) {
                         node = node.parent
                         rotateLeft(node)
                     }
-                    node.parent.color = TreeColorBlack
-                    ancestor.color = TreeColorRed
+                    node.parent.color = TreeColor.Black
+                    ancestor.color = TreeColor.Red
                     rotateRight(ancestor)
                 }
             } else {
                 val left = ancestor.left
-                if (left.color == TreeColorRed) {
-                    left.color = TreeColorBlack
-                    node.parent.color = TreeColorBlack
-                    ancestor.color = TreeColorRed
+                if (left.color == TreeColor.Red) {
+                    left.color = TreeColor.Black
+                    node.parent.color = TreeColor.Black
+                    ancestor.color = TreeColor.Red
                     node = ancestor
                 } else {
                     if (node === node.parent.left) {
                         node = node.parent
                         rotateRight(node)
                     }
-                    node.parent.color = TreeColorBlack
-                    ancestor.color = TreeColorRed
+                    node.parent.color = TreeColor.Black
+                    ancestor.color = TreeColor.Red
                     rotateLeft(ancestor)
                 }
             }
         }
 
-        root.color = TreeColorBlack
+        root.color = TreeColor.Black
     }
 
     private fun rotateLeft(node: Node) {
@@ -339,6 +340,11 @@
         }
     }
 
+    internal enum class TreeColor {
+        Red,
+        Black
+    }
+
     internal inner class Node(start: Float, end: Float, data: T?, var color: TreeColor) :
         Interval<T>(start, end, data) {
         var min: Float = start
@@ -372,8 +378,3 @@
         }
     }
 }
-
-private typealias TreeColor = Int
-
-private const val TreeColorRed = 0
-private const val TreeColorBlack = 1
diff --git a/compose/ui/ui-graphics/src/commonMain/kotlin/androidx/compose/ui/graphics/PathGeometry.kt b/compose/ui/ui-graphics/src/commonMain/kotlin/androidx/compose/ui/graphics/PathGeometry.kt
index 4c96e1e..53b0d54 100644
--- a/compose/ui/ui-graphics/src/commonMain/kotlin/androidx/compose/ui/graphics/PathGeometry.kt
+++ b/compose/ui/ui-graphics/src/commonMain/kotlin/androidx/compose/ui/graphics/PathGeometry.kt
@@ -58,7 +58,7 @@
     // segments.
     var type = iterator.next(points)
     while (type != PathSegment.Type.Done) {
-        @Suppress("KotlinConstantConditions", "RedundantSuppression")
+        @Suppress("KotlinConstantConditions")
         when (type) {
             PathSegment.Type.Move -> {
                 if (!first) {
@@ -175,7 +175,7 @@
 
     var type = iterator.next(points)
     while (type != PathSegment.Type.Done) {
-        @Suppress("KotlinConstantConditions", "RedundantSuppression")
+        @Suppress("KotlinConstantConditions")
         when (type) {
             PathSegment.Type.Move -> {
                 if (!first && !isEmpty) {
diff --git a/compose/ui/ui-graphics/src/commonMain/kotlin/androidx/compose/ui/graphics/colorspace/ColorSpace.kt b/compose/ui/ui-graphics/src/commonMain/kotlin/androidx/compose/ui/graphics/colorspace/ColorSpace.kt
index ec0cc69..3905cff 100644
--- a/compose/ui/ui-graphics/src/commonMain/kotlin/androidx/compose/ui/graphics/colorspace/ColorSpace.kt
+++ b/compose/ui/ui-graphics/src/commonMain/kotlin/androidx/compose/ui/graphics/colorspace/ColorSpace.kt
@@ -633,7 +633,7 @@
  * @param r2: The third element of the vector
  * @return The first element of the resulting multiplication.
  */
-@Suppress("NOTHING_TO_INLINE", "KotlinRedundantDiagnosticSuppress")
+@Suppress("NOTHING_TO_INLINE")
 internal inline fun mul3x3Float3_0(lhs: FloatArray, r0: Float, r1: Float, r2: Float): Float {
     return lhs[0] * r0 + lhs[3] * r1 + lhs[6] * r2
 }
@@ -648,7 +648,7 @@
  * @param r2: The third element of the vector
  * @return The second element of the resulting multiplication.
  */
-@Suppress("NOTHING_TO_INLINE", "KotlinRedundantDiagnosticSuppress")
+@Suppress("NOTHING_TO_INLINE")
 internal inline fun mul3x3Float3_1(lhs: FloatArray, r0: Float, r1: Float, r2: Float): Float {
     return lhs[1] * r0 + lhs[4] * r1 + lhs[7] * r2
 }
@@ -663,7 +663,7 @@
  * @param r2: The third element of the vector
  * @return The third element of the resulting multiplication.
  */
-@Suppress("NOTHING_TO_INLINE", "KotlinRedundantDiagnosticSuppress")
+@Suppress("NOTHING_TO_INLINE")
 internal inline fun mul3x3Float3_2(lhs: FloatArray, r0: Float, r1: Float, r2: Float): Float {
     return lhs[2] * r0 + lhs[5] * r1 + lhs[8] * r2
 }
diff --git a/compose/ui/ui-graphics/src/commonMain/kotlin/androidx/compose/ui/graphics/colorspace/Connector.kt b/compose/ui/ui-graphics/src/commonMain/kotlin/androidx/compose/ui/graphics/colorspace/Connector.kt
index 2a81bac..7a47484 100644
--- a/compose/ui/ui-graphics/src/commonMain/kotlin/androidx/compose/ui/graphics/colorspace/Connector.kt
+++ b/compose/ui/ui-graphics/src/commonMain/kotlin/androidx/compose/ui/graphics/colorspace/Connector.kt
@@ -230,7 +230,7 @@
                         chromaticAdaptation(
                             Adaptation.Bradford.transform,
                             srcXYZ,
-                            Illuminant.newD50Xyz()
+                            Illuminant.D50Xyz.copyOf()
                         )
                     transform = mul3x3(srcAdaptation, source.transform)
                 }
@@ -240,7 +240,7 @@
                         chromaticAdaptation(
                             Adaptation.Bradford.transform,
                             dstXYZ,
-                            Illuminant.newD50Xyz()
+                            Illuminant.D50Xyz.copyOf()
                         )
                     inverseTransform = inverse3x3(mul3x3(dstAdaptation, destination.transform))
                 }
diff --git a/compose/ui/ui-graphics/src/commonMain/kotlin/androidx/compose/ui/graphics/colorspace/Illuminant.kt b/compose/ui/ui-graphics/src/commonMain/kotlin/androidx/compose/ui/graphics/colorspace/Illuminant.kt
index 0bf3461..b3598c3 100644
--- a/compose/ui/ui-graphics/src/commonMain/kotlin/androidx/compose/ui/graphics/colorspace/Illuminant.kt
+++ b/compose/ui/ui-graphics/src/commonMain/kotlin/androidx/compose/ui/graphics/colorspace/Illuminant.kt
@@ -73,6 +73,4 @@
     val E = WhitePoint(0.33333f, 0.33333f)
 
     internal val D50Xyz = floatArrayOf(0.964212f, 1.0f, 0.825188f)
-
-    internal fun newD50Xyz() = floatArrayOf(0.964212f, 1.0f, 0.825188f)
 }
diff --git a/compose/ui/ui-graphics/src/commonMain/kotlin/androidx/compose/ui/graphics/colorspace/Rgb.kt b/compose/ui/ui-graphics/src/commonMain/kotlin/androidx/compose/ui/graphics/colorspace/Rgb.kt
index e9d3032..06f2891 100644
--- a/compose/ui/ui-graphics/src/commonMain/kotlin/androidx/compose/ui/graphics/colorspace/Rgb.kt
+++ b/compose/ui/ui-graphics/src/commonMain/kotlin/androidx/compose/ui/graphics/colorspace/Rgb.kt
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-@file:Suppress("NOTHING_TO_INLINE", "KotlinRedundantDiagnosticSuppress")
+@file:Suppress("NOTHING_TO_INLINE")
 
 package androidx.compose.ui.graphics.colorspace
 
@@ -853,9 +853,10 @@
         var result = super.hashCode()
         result = 31 * result + whitePoint.hashCode()
         result = 31 * result + primaries.contentHashCode()
-        result = 31 * result + (if (min != 0.0f) min.toBits() else 0)
-        result = 31 * result + (if (max != 0.0f) max.toBits() else 0)
-        result = (31 * result + (transferParameters?.hashCode() ?: 0))
+        result = 31 * result + (if (min != +0.0f) min.toBits() else 0)
+        result = 31 * result + (if (max != +0.0f) max.toBits() else 0)
+        result =
+            (31 * result + if (transferParameters != null) transferParameters.hashCode() else 0)
         if (transferParameters == null) {
             result = 31 * result + oetfOrig.hashCode()
             result = 31 * result + eotfOrig.hashCode()
diff --git a/compose/ui/ui-text/proguard-rules.pro b/compose/ui/ui-text/proguard-rules.pro
index 72f4a6c..67d118b 100644
--- a/compose/ui/ui-text/proguard-rules.pro
+++ b/compose/ui/ui-text/proguard-rules.pro
@@ -15,7 +15,7 @@
 # Keep all the functions created to throw an exception. We don't want these functions to be
 # inlined in any way, which R8 will do by default. The whole point of these functions is to
 # reduce the amount of code generated at the call site.
--keepclassmembers,allowshrinking,allowobfuscation class androidx.compose.**.* {
+-keep,allowshrinking,allowobfuscation class androidx.compose.**.* {
     static void throw*Exception(...);
     static void throw*ExceptionForNullCheck(...);
     # For methods returning Nothing
diff --git a/compose/ui/ui-unit/proguard-rules.pro b/compose/ui/ui-unit/proguard-rules.pro
index 72f4a6c..67d118b 100644
--- a/compose/ui/ui-unit/proguard-rules.pro
+++ b/compose/ui/ui-unit/proguard-rules.pro
@@ -15,7 +15,7 @@
 # Keep all the functions created to throw an exception. We don't want these functions to be
 # inlined in any way, which R8 will do by default. The whole point of these functions is to
 # reduce the amount of code generated at the call site.
--keepclassmembers,allowshrinking,allowobfuscation class androidx.compose.**.* {
+-keep,allowshrinking,allowobfuscation class androidx.compose.**.* {
     static void throw*Exception(...);
     static void throw*ExceptionForNullCheck(...);
     # For methods returning Nothing
diff --git a/compose/ui/ui-unit/src/commonMain/kotlin/androidx/compose/ui/unit/Constraints.kt b/compose/ui/ui-unit/src/commonMain/kotlin/androidx/compose/ui/unit/Constraints.kt
index 80e1938..79ba2da 100644
--- a/compose/ui/ui-unit/src/commonMain/kotlin/androidx/compose/ui/unit/Constraints.kt
+++ b/compose/ui/ui-unit/src/commonMain/kotlin/androidx/compose/ui/unit/Constraints.kt
@@ -368,16 +368,10 @@
 private const val MinFocusBits = 16
 private const val MaxAllowedForMinFocusBits = (1 shl (31 - MinFocusBits)) - 2
 
-/** The mask to use for the focused dimension when there is minimal focus. */
-private const val MinFocusMask = 0xFFFF // 64K (16 bits)
-
 /** The number of bits used for the non-focused dimension when there is minimal focus. */
 private const val MinNonFocusBits = 15
 private const val MaxAllowedForMinNonFocusBits = (1 shl (31 - MinNonFocusBits)) - 2
 
-/** The mask to use for the non-focused dimension when there is minimal focus. */
-private const val MinNonFocusMask = 0x7FFF // 32K (15 bits)
-
 /** The number of bits to use for the focused dimension when there is maximal focus. */
 private const val MaxFocusBits = 18
 private const val MaxAllowedForMaxFocusBits = (1 shl (31 - MaxFocusBits)) - 2
@@ -389,9 +383,6 @@
 private const val MaxNonFocusBits = 13
 private const val MaxAllowedForMaxNonFocusBits = (1 shl (31 - MaxNonFocusBits)) - 2
 
-/** The mask to use for the non-focused dimension when there is maximal focus. */
-private const val MaxNonFocusMask = 0x1FFF // 8K (13 bits)
-
 // 0xFFFFFFFE_00000003UL.toLong(), written as a signed value to declare it const
 @PublishedApi internal const val MaxDimensionsAndFocusMask = -0x00000001_FFFFFFFDL
 
@@ -452,22 +443,35 @@
 }
 
 internal fun bitsNeedForSizeUnchecked(size: Int): Int {
+    // We could look at the value of size itself, for instance by doing:
+    // when {
+    //     size < MaxNonFocusMask -> MaxNonFocusBits
+    //     ...
+    // }
+    // but the following solution saves a few instructions by avoiding
+    // multiple moves to load large constants
+    val bits = (size + 1).countLeadingZeroBits()
     return when {
-        size < MaxNonFocusMask -> MaxNonFocusBits
-        size < MinNonFocusMask -> MinNonFocusBits
-        size < MinFocusMask -> MinFocusBits
-        size < MaxFocusMask -> MaxFocusBits
+        bits >= 32 - MaxNonFocusBits -> MaxNonFocusBits
+        bits >= 32 - MinNonFocusBits -> MinNonFocusBits
+        bits >= 32 - MinFocusBits -> MinFocusBits
+        bits >= 32 - MaxFocusBits -> MaxFocusBits
         else -> 255
     }
 }
 
 private inline fun maxAllowedForSize(size: Int): Int {
+    // See comment in bitsNeedForSizeUnchecked()
+    // Note: the return value in every case is `1 shl (31 - bits) - 2`
+    // However, computing the value instead of using constants uses more
+    // instructions, so not worth it
+    val bits = (size + 1).countLeadingZeroBits()
+    if (bits <= 13) throwInvalidConstraintsSizeException(size)
     return when {
-        size < MaxNonFocusMask -> MaxAllowedForMaxNonFocusBits
-        size < MinNonFocusMask -> MaxAllowedForMinNonFocusBits
-        size < MinFocusMask -> MaxAllowedForMinFocusBits
-        size < MaxFocusMask -> MaxAllowedForMaxFocusBits
-        else -> throwInvalidConstraintsSizeException(size)
+        bits >= 32 - MaxNonFocusBits -> MaxAllowedForMaxNonFocusBits
+        bits >= 32 - MinNonFocusBits -> MaxAllowedForMinNonFocusBits
+        bits >= 32 - MinFocusBits -> MaxAllowedForMinFocusBits
+        else -> MaxAllowedForMaxFocusBits
     }
 }
 
diff --git a/compose/ui/ui-unit/src/commonMain/kotlin/androidx/compose/ui/unit/Density.kt b/compose/ui/ui-unit/src/commonMain/kotlin/androidx/compose/ui/unit/Density.kt
index cbefe8a..5b3e3c5 100644
--- a/compose/ui/ui-unit/src/commonMain/kotlin/androidx/compose/ui/unit/Density.kt
+++ b/compose/ui/ui-unit/src/commonMain/kotlin/androidx/compose/ui/unit/Density.kt
@@ -65,7 +65,7 @@
      */
     @Stable
     fun TextUnit.toPx(): Float {
-        checkPrecondition(type == TextUnitType.Sp) { "Only Sp can convert to Px" }
+        check(type == TextUnitType.Sp) { "Only Sp can convert to Px" }
         return toDp().toPx()
     }
 
diff --git a/compose/ui/ui-unit/src/commonMain/kotlin/androidx/compose/ui/unit/Dp.kt b/compose/ui/ui-unit/src/commonMain/kotlin/androidx/compose/ui/unit/Dp.kt
index e5cac56..a88b3c0 100644
--- a/compose/ui/ui-unit/src/commonMain/kotlin/androidx/compose/ui/unit/Dp.kt
+++ b/compose/ui/ui-unit/src/commonMain/kotlin/androidx/compose/ui/unit/Dp.kt
@@ -83,10 +83,7 @@
         /** Infinite dp dimension. */
         @Stable val Infinity = Dp(Float.POSITIVE_INFINITY)
 
-        /**
-         * Constant that means unspecified Dp. Instead of comparing a [Dp] value to this constant,
-         * consider using [isSpecified] and [isUnspecified] instead.
-         */
+        /** Constant that means unspecified Dp */
         @Stable val Unspecified = Dp(Float.NaN)
     }
 }
diff --git a/compose/ui/ui-util/proguard-rules.pro b/compose/ui/ui-util/proguard-rules.pro
index 72f4a6c..67d118b 100644
--- a/compose/ui/ui-util/proguard-rules.pro
+++ b/compose/ui/ui-util/proguard-rules.pro
@@ -15,7 +15,7 @@
 # Keep all the functions created to throw an exception. We don't want these functions to be
 # inlined in any way, which R8 will do by default. The whole point of these functions is to
 # reduce the amount of code generated at the call site.
--keepclassmembers,allowshrinking,allowobfuscation class androidx.compose.**.* {
+-keep,allowshrinking,allowobfuscation class androidx.compose.**.* {
     static void throw*Exception(...);
     static void throw*ExceptionForNullCheck(...);
     # For methods returning Nothing
diff --git a/compose/ui/ui/api/current.txt b/compose/ui/ui/api/current.txt
index 5a884ad..2b88ca8 100644
--- a/compose/ui/ui/api/current.txt
+++ b/compose/ui/ui/api/current.txt
@@ -228,7 +228,6 @@
   public abstract class AutofillManager {
     method public abstract void cancel();
     method public abstract void commit();
-    method public abstract void requestAutofillForActiveElement();
   }
 
   public final class AutofillNode {
@@ -2860,6 +2859,7 @@
 
   public final class DelegatableNodeKt {
     method public static void invalidateSubtree(androidx.compose.ui.node.DelegatableNode);
+    method public static void requestAutofill(androidx.compose.ui.node.DelegatableNode);
     method public static androidx.compose.ui.unit.Density requireDensity(androidx.compose.ui.node.DelegatableNode);
     method public static androidx.compose.ui.graphics.GraphicsContext requireGraphicsContext(androidx.compose.ui.node.DelegatableNode);
     method public static androidx.compose.ui.layout.LayoutCoordinates requireLayoutCoordinates(androidx.compose.ui.node.DelegatableNode);
diff --git a/compose/ui/ui/api/restricted_current.txt b/compose/ui/ui/api/restricted_current.txt
index 2c0d712..8b114f0 100644
--- a/compose/ui/ui/api/restricted_current.txt
+++ b/compose/ui/ui/api/restricted_current.txt
@@ -228,7 +228,6 @@
   public abstract class AutofillManager {
     method public abstract void cancel();
     method public abstract void commit();
-    method public abstract void requestAutofillForActiveElement();
   }
 
   public final class AutofillNode {
@@ -2914,6 +2913,7 @@
 
   public final class DelegatableNodeKt {
     method public static void invalidateSubtree(androidx.compose.ui.node.DelegatableNode);
+    method public static void requestAutofill(androidx.compose.ui.node.DelegatableNode);
     method public static androidx.compose.ui.unit.Density requireDensity(androidx.compose.ui.node.DelegatableNode);
     method public static androidx.compose.ui.graphics.GraphicsContext requireGraphicsContext(androidx.compose.ui.node.DelegatableNode);
     method public static androidx.compose.ui.layout.LayoutCoordinates requireLayoutCoordinates(androidx.compose.ui.node.DelegatableNode);
diff --git a/compose/ui/ui/build.gradle b/compose/ui/ui/build.gradle
index 3a1ada1..73d3551 100644
--- a/compose/ui/ui/build.gradle
+++ b/compose/ui/ui/build.gradle
@@ -24,6 +24,7 @@
 
 import androidx.build.KotlinTarget
 import androidx.build.LibraryType
+import androidx.build.KmpPlatformsKt
 import androidx.build.PlatformIdentifier
 
 import static androidx.inspection.gradle.InspectionPluginKt.packageInspector
@@ -59,8 +60,6 @@
                 api(project(":compose:ui:ui-util"))
 
                 api("androidx.lifecycle:lifecycle-runtime-compose:2.8.7")
-
-                implementation(project(":performance:performance-annotation"))
             }
         }
 
diff --git a/compose/ui/ui/proguard-rules.pro b/compose/ui/ui/proguard-rules.pro
index 1f592ff3..fa5b4c3 100644
--- a/compose/ui/ui/proguard-rules.pro
+++ b/compose/ui/ui/proguard-rules.pro
@@ -35,7 +35,7 @@
 # Keep all the functions created to throw an exception. We don't want these functions to be
 # inlined in any way, which R8 will do by default. The whole point of these functions is to
 # reduce the amount of code generated at the call site.
--keepclassmembers,allowshrinking,allowobfuscation class androidx.compose.**.* {
+-keep,allowshrinking,allowobfuscation class androidx.compose.**.* {
     static void throw*Exception(...);
     static void throw*ExceptionForNullCheck(...);
     # For methods returning Nothing
@@ -52,7 +52,3 @@
 -keepnames class androidx.compose.ui.input.pointer.PointerInputEventHandler {
     *;
 }
-
--keepclassmembers class * {
-    @dalvik.annotation.optimization.NeverInline *;
-}
diff --git a/compose/ui/ui/src/androidInstrumentedTest/kotlin/androidx/compose/ui/autofill/AndroidAutofillManagerTest.kt b/compose/ui/ui/src/androidInstrumentedTest/kotlin/androidx/compose/ui/autofill/AndroidAutofillManagerTest.kt
index d6ce34a..25dcd50 100644
--- a/compose/ui/ui/src/androidInstrumentedTest/kotlin/androidx/compose/ui/autofill/AndroidAutofillManagerTest.kt
+++ b/compose/ui/ui/src/androidInstrumentedTest/kotlin/androidx/compose/ui/autofill/AndroidAutofillManagerTest.kt
@@ -42,11 +42,14 @@
 import androidx.compose.ui.Modifier
 import androidx.compose.ui.draw.alpha
 import androidx.compose.ui.focus.FocusManager
-import androidx.compose.ui.focus.focusProperties
+import androidx.compose.ui.node.SemanticsModifierNode
+import androidx.compose.ui.node.elementOf
+import androidx.compose.ui.node.requestAutofill
 import androidx.compose.ui.platform.LocalAutofillManager
 import androidx.compose.ui.platform.LocalDensity
 import androidx.compose.ui.platform.LocalFocusManager
 import androidx.compose.ui.platform.testTag
+import androidx.compose.ui.semantics.SemanticsPropertyReceiver
 import androidx.compose.ui.semantics.contentDataType
 import androidx.compose.ui.semantics.contentDescription
 import androidx.compose.ui.semantics.contentType
@@ -713,68 +716,6 @@
 
     @Test
     @SmallTest
-    @SdkSuppress(minSdkVersion = 26)
-    fun autofillManager_requestAutofillAfterFocus() {
-        val am: PlatformAutofillManager = mock()
-        val contextMenuTag = "menu_tag"
-        var autofillManager: AutofillManager?
-
-        rule.setContent {
-            autofillManager = LocalAutofillManager.current
-            (autofillManager as AndroidAutofillManager).platformAutofillManager = am
-            Box(
-                modifier =
-                    Modifier.semantics {
-                            testTag = contextMenuTag
-                            onAutofillText { true }
-                        }
-                        .focusProperties { canFocus = true }
-                        .clickable { autofillManager?.requestAutofillForActiveElement() }
-                        .size(height, width)
-            )
-        }
-
-        // `requestAutofill` is always called after an element is focused
-        rule.onNodeWithTag(contextMenuTag).requestFocus()
-        rule.runOnIdle { verify(am).notifyViewEntered(any(), any(), any()) }
-
-        // then `requestAutofill` is called on that same previously focused element
-        rule.onNodeWithTag(contextMenuTag).performClick()
-        rule.runOnIdle { verify(am).requestAutofill(any(), any(), any()) }
-    }
-
-    @Test
-    @SmallTest
-    @SdkSuppress(minSdkVersion = 26)
-    fun autofillManager_notAutofillable_doesNotrequestAutofillAfterFocus() {
-        val am: PlatformAutofillManager = mock()
-        val contextMenuTag = "menu_tag"
-        var autofillManager: AutofillManager?
-
-        rule.setContent {
-            autofillManager = LocalAutofillManager.current
-            (autofillManager as AndroidAutofillManager).platformAutofillManager = am
-            Box(
-                modifier =
-                    Modifier.semantics { testTag = contextMenuTag }
-                        .focusProperties { canFocus = true }
-                        .clickable { autofillManager?.requestAutofillForActiveElement() }
-                        .size(height, width)
-            )
-        }
-        clearInvocations(am)
-
-        // `requestAutofill` is always called after an element is focused
-        rule.onNodeWithTag(contextMenuTag).requestFocus()
-        rule.runOnIdle { verifyZeroInteractions(am) }
-
-        // then `requestAutofill` is called on that same previously focused element
-        rule.onNodeWithTag(contextMenuTag).performClick()
-        rule.runOnIdle { verifyNoMoreInteractions(am) }
-    }
-
-    @Test
-    @SmallTest
     fun autofillManager_lazyColumnScroll_callsCommit() {
         lateinit var state: LazyListState
         lateinit var coroutineScope: CoroutineScope
@@ -866,4 +807,35 @@
         // A column disappearing will call commit
         rule.runOnIdle { verify(am).commit() }
     }
+
+    @Test
+    @SmallTest
+    @SdkSuppress(minSdkVersion = 26)
+    fun autofillManager_requestAutofill() {
+        val am: PlatformAutofillManager = mock()
+        val semanticsModifier = TestSemanticsModifier { testTag = "TestTag" }
+        var autofillManager: AutofillManager?
+
+        rule.setContent {
+            autofillManager = LocalAutofillManager.current
+            (autofillManager as AndroidAutofillManager).platformAutofillManager = am
+            Box(Modifier.elementOf(semanticsModifier))
+        }
+
+        // Act
+        rule.runOnIdle { semanticsModifier.requestAutofill() }
+
+        // Assert
+        rule.runOnIdle { verify(am).requestAutofill(any(), any(), any()) }
+    }
+
+    private class TestSemanticsModifier(
+        private val onApplySemantics: SemanticsPropertyReceiver.() -> Unit
+    ) : SemanticsModifierNode, Modifier.Node() {
+
+        override fun SemanticsPropertyReceiver.applySemantics() {
+            contentType = ContentType.Username
+            onApplySemantics.invoke(this)
+        }
+    }
 }
diff --git a/compose/ui/ui/src/androidInstrumentedTest/kotlin/androidx/compose/ui/input/pointer/HitPathTrackerTest.kt b/compose/ui/ui/src/androidInstrumentedTest/kotlin/androidx/compose/ui/input/pointer/HitPathTrackerTest.kt
index 84314e3e..1d90f0b 100644
--- a/compose/ui/ui/src/androidInstrumentedTest/kotlin/androidx/compose/ui/input/pointer/HitPathTrackerTest.kt
+++ b/compose/ui/ui/src/androidInstrumentedTest/kotlin/androidx/compose/ui/input/pointer/HitPathTrackerTest.kt
@@ -3510,6 +3510,10 @@
 
     override fun requestFocus(): Boolean = false
 
+    override fun requestAutofill(node: LayoutNode) {
+        TODO("Not yet implemented")
+    }
+
     override fun measureAndLayout(sendPointerUpdate: Boolean) {}
 
     override fun measureAndLayout(layoutNode: LayoutNode, constraints: Constraints) {}
diff --git a/compose/ui/ui/src/androidInstrumentedTest/kotlin/androidx/compose/ui/input/pointer/PointerInputEventProcessorTest.kt b/compose/ui/ui/src/androidInstrumentedTest/kotlin/androidx/compose/ui/input/pointer/PointerInputEventProcessorTest.kt
index 3f9150a..ffb3fec 100644
--- a/compose/ui/ui/src/androidInstrumentedTest/kotlin/androidx/compose/ui/input/pointer/PointerInputEventProcessorTest.kt
+++ b/compose/ui/ui/src/androidInstrumentedTest/kotlin/androidx/compose/ui/input/pointer/PointerInputEventProcessorTest.kt
@@ -2846,6 +2846,10 @@
 
     override fun requestFocus(): Boolean = false
 
+    override fun requestAutofill(node: LayoutNode) {
+        TODO("Not yet implemented")
+    }
+
     override val rootForTest: RootForTest
         get() = TODO("Not yet implemented")
 
diff --git a/compose/ui/ui/src/androidInstrumentedTest/kotlin/androidx/compose/ui/layout/Helpers.kt b/compose/ui/ui/src/androidInstrumentedTest/kotlin/androidx/compose/ui/layout/Helpers.kt
index 76aa7ce..4322a1c 100644
--- a/compose/ui/ui/src/androidInstrumentedTest/kotlin/androidx/compose/ui/layout/Helpers.kt
+++ b/compose/ui/ui/src/androidInstrumentedTest/kotlin/androidx/compose/ui/layout/Helpers.kt
@@ -281,6 +281,10 @@
 
     override fun requestFocus() = TODO("Not yet implemented")
 
+    override fun requestAutofill(node: LayoutNode) {
+        TODO("Not yet implemented")
+    }
+
     override fun onSemanticsChange() {}
 
     override fun getFocusDirection(keyEvent: KeyEvent) = TODO("Not yet implemented")
diff --git a/compose/ui/ui/src/androidInstrumentedTest/kotlin/androidx/compose/ui/node/NodeChainTester.kt b/compose/ui/ui/src/androidInstrumentedTest/kotlin/androidx/compose/ui/node/NodeChainTester.kt
index a36713d..5d5e649 100644
--- a/compose/ui/ui/src/androidInstrumentedTest/kotlin/androidx/compose/ui/node/NodeChainTester.kt
+++ b/compose/ui/ui/src/androidInstrumentedTest/kotlin/androidx/compose/ui/node/NodeChainTester.kt
@@ -521,6 +521,10 @@
 
     override fun requestFocus(): Boolean = false
 
+    override fun requestAutofill(node: LayoutNode) {
+        TODO("Not yet implemented")
+    }
+
     override fun measureAndLayout(sendPointerUpdate: Boolean) {}
 
     override fun measureAndLayout(layoutNode: LayoutNode, constraints: Constraints) {}
diff --git a/compose/ui/ui/src/androidInstrumentedTest/kotlin/androidx/compose/ui/semantics/SemanticsModifierNodeTest.kt b/compose/ui/ui/src/androidInstrumentedTest/kotlin/androidx/compose/ui/semantics/SemanticsModifierNodeTest.kt
index 7cfa2d4c..c49374e 100644
--- a/compose/ui/ui/src/androidInstrumentedTest/kotlin/androidx/compose/ui/semantics/SemanticsModifierNodeTest.kt
+++ b/compose/ui/ui/src/androidInstrumentedTest/kotlin/androidx/compose/ui/semantics/SemanticsModifierNodeTest.kt
@@ -77,9 +77,7 @@
         // Assert.
         rule.runOnIdle {
             if (precomputedSemantics) {
-                // One invocation when the modifier node calls autoInvalidateNodeSelf and another
-                // when the Layout node is attached.
-                assertThat(semanticsModifier.applySemanticsInvocations).isEqualTo(2)
+                assertThat(semanticsModifier.applySemanticsInvocations).isEqualTo(1)
             } else {
                 assertThat(semanticsModifier.applySemanticsInvocations).isEqualTo(0)
             }
@@ -194,7 +192,7 @@
         // Assert.
         rule.runOnIdle {
             assertThat(semanticsModifier.applySemanticsInvocations)
-                .isEqualTo(if (precomputedSemantics) 8 else 2)
+                .isEqualTo(if (precomputedSemantics) 7 else 2)
         }
     }
 
diff --git a/compose/ui/ui/src/androidInstrumentedTest/kotlin/androidx/compose/ui/semantics/SemanticsTests.kt b/compose/ui/ui/src/androidInstrumentedTest/kotlin/androidx/compose/ui/semantics/SemanticsTests.kt
index 8e4a41b..4c213f7 100644
--- a/compose/ui/ui/src/androidInstrumentedTest/kotlin/androidx/compose/ui/semantics/SemanticsTests.kt
+++ b/compose/ui/ui/src/androidInstrumentedTest/kotlin/androidx/compose/ui/semantics/SemanticsTests.kt
@@ -26,12 +26,16 @@
 import androidx.compose.material.Surface
 import androidx.compose.material.Text
 import androidx.compose.runtime.Composable
+import androidx.compose.runtime.RecomposeScope
 import androidx.compose.runtime.ReusableContent
 import androidx.compose.runtime.Stable
+import androidx.compose.runtime.currentRecomposeScope
 import androidx.compose.runtime.getValue
 import androidx.compose.runtime.mutableStateOf
 import androidx.compose.runtime.remember
 import androidx.compose.runtime.setValue
+import androidx.compose.ui.ComposeUiFlags
+import androidx.compose.ui.ExperimentalComposeUiApi
 import androidx.compose.ui.Modifier
 import androidx.compose.ui.autofill.ContentDataType
 import androidx.compose.ui.autofill.ContentType
@@ -134,6 +138,40 @@
             .assert(SemanticsMatcher.expectValue(SemanticsProperties.PaneTitle, paneTitleString))
     }
 
+    @OptIn(ExperimentalComposeUiApi::class)
+    @Test
+    fun testSemanticsCalculatedOncePerComposition() {
+        var recomposeScope: RecomposeScope? = null
+        var count = 0
+        fun Modifier.count() = semantics { count++ }
+        rule.setContent {
+            recomposeScope = currentRecomposeScope
+            Box(
+                modifier = Modifier.count().count().count(),
+            )
+        }
+        rule.runOnIdle {
+            if (ComposeUiFlags.isSemanticAutofillEnabled) {
+                // with autofill on, semantics is eagerly evaluated
+                assertThat(count).isEqualTo(3)
+            } else {
+                // before autofill, semantics was lazily evaluated
+                assertThat(count).isEqualTo(0)
+            }
+            count = 0
+            recomposeScope!!.invalidate()
+        }
+        rule.runOnIdle {
+            if (ComposeUiFlags.isSemanticAutofillEnabled) {
+                // with autofill on, semantics is eagerly evaluated
+                assertThat(count).isEqualTo(3)
+            } else {
+                // before autofill, semantics was lazily evaluated
+                assertThat(count).isEqualTo(0)
+            }
+        }
+    }
+
     @Test
     @Suppress("DEPRECATION")
     fun isContainerProperty_unmergedConfig() {
diff --git a/compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/autofill/AndroidAutofillManager.android.kt b/compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/autofill/AndroidAutofillManager.android.kt
index 69f31cc..4d49938 100644
--- a/compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/autofill/AndroidAutofillManager.android.kt
+++ b/compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/autofill/AndroidAutofillManager.android.kt
@@ -77,19 +77,6 @@
         platformAutofillManager.cancel()
     }
 
-    // This will be used to request autofill when
-    // `AutofillManager.requestAutofillForActiveElement()` is called (e.g. from the text toolbar).
-    private var previouslyFocusedId = -1
-
-    override fun requestAutofillForActiveElement() {
-        if (previouslyFocusedId <= 0) return
-
-        rectManager.rects.withRect(previouslyFocusedId) { left, top, right, bottom ->
-            reusableRect.set(left, top, right, bottom)
-            platformAutofillManager.requestAutofill(view, previouslyFocusedId, reusableRect)
-        }
-    }
-
     override fun onFocusChanged(
         previous: FocusTargetModifierNode?,
         current: FocusTargetModifierNode?
@@ -105,7 +92,6 @@
                 rectManager.rects.withRect(semanticsId) { l, t, r, b ->
                     platformAutofillManager.notifyViewEntered(view, semanticsId, Rect(l, t, r, b))
                 }
-                previouslyFocusedId = semanticsId
             }
         }
     }
@@ -138,7 +124,6 @@
             val previousFocus = prevConfig?.getOrNull(SemanticsProperties.Focused)
             val currFocus = config?.getOrNull(SemanticsProperties.Focused)
             if (previousFocus != true && currFocus == true && config.isAutofillable()) {
-                previouslyFocusedId = semanticsId
                 rectManager.rects.withRect(semanticsId) { l, t, r, b ->
                     platformAutofillManager.notifyViewEntered(view, semanticsId, Rect(l, t, r, b))
                 }
@@ -236,6 +221,13 @@
     private var currentlyDisplayedIDs = MutableIntSet()
     private var pendingChangesToDisplayedIds = false
 
+    internal fun requestAutofill(semanticsInfo: SemanticsInfo) {
+        rectManager.rects.withRect(semanticsInfo.semanticsId) { left, top, right, bottom ->
+            reusableRect.set(left, top, right, bottom)
+            platformAutofillManager.requestAutofill(view, semanticsInfo.semanticsId, reusableRect)
+        }
+    }
+
     internal fun onPostAttach(semanticsInfo: SemanticsInfo) {
         if (semanticsInfo.semanticsConfiguration?.isRelatedToAutoCommit() == true) {
             currentlyDisplayedIDs.add(semanticsInfo.semanticsId)
diff --git a/compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/platform/AndroidComposeView.android.kt b/compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/platform/AndroidComposeView.android.kt
index c059f5d..7da948c 100644
--- a/compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/platform/AndroidComposeView.android.kt
+++ b/compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/platform/AndroidComposeView.android.kt
@@ -1247,6 +1247,13 @@
         }
     }
 
+    override fun requestAutofill(node: LayoutNode) {
+        @OptIn(ExperimentalComposeUiApi::class)
+        if (autofillSupported() && ComposeUiFlags.isSemanticAutofillEnabled) {
+            _autofillManager?.requestAutofill(node)
+        }
+    }
+
     fun requestClearInvalidObservations() {
         observationClearRequested = true
     }
diff --git a/compose/ui/ui/src/androidUnitTest/kotlin/androidx/compose/ui/node/DelegatingNodeTest.kt b/compose/ui/ui/src/androidUnitTest/kotlin/androidx/compose/ui/node/DelegatingNodeTest.kt
index 0328f65..25e747f 100644
--- a/compose/ui/ui/src/androidUnitTest/kotlin/androidx/compose/ui/node/DelegatingNodeTest.kt
+++ b/compose/ui/ui/src/androidUnitTest/kotlin/androidx/compose/ui/node/DelegatingNodeTest.kt
@@ -776,7 +776,8 @@
     check(owner is MockOwner)
     owner.onRequestMeasureParams.clear()
     owner.invalidatedLayers.clear()
-    owner.semanticsChanged = false
+    layoutNode.isSemanticsInvalidated = false
+    //    owner.semanticsChanged = false
 }
 
 private fun NodeChain.layoutInvalidated(): Boolean {
@@ -792,9 +793,7 @@
 }
 
 private fun NodeChain.semanticsInvalidated(): Boolean {
-    val owner = layoutNode.owner
-    check(owner is MockOwner)
-    return owner.semanticsChanged
+    return layoutNode.isSemanticsInvalidated
 }
 
 internal fun layout(
diff --git a/compose/ui/ui/src/androidUnitTest/kotlin/androidx/compose/ui/node/LayoutNodeTest.kt b/compose/ui/ui/src/androidUnitTest/kotlin/androidx/compose/ui/node/LayoutNodeTest.kt
index f13b1f1..faa645f 100644
--- a/compose/ui/ui/src/androidUnitTest/kotlin/androidx/compose/ui/node/LayoutNodeTest.kt
+++ b/compose/ui/ui/src/androidUnitTest/kotlin/androidx/compose/ui/node/LayoutNodeTest.kt
@@ -2448,6 +2448,10 @@
 
     override fun requestFocus(): Boolean = false
 
+    override fun requestAutofill(node: LayoutNode) {
+        TODO("Not yet implemented")
+    }
+
     override fun measureAndLayout(sendPointerUpdate: Boolean) {}
 
     override fun measureAndLayout(layoutNode: LayoutNode, constraints: Constraints) {}
@@ -2538,11 +2542,7 @@
         }
     }
 
-    var semanticsChanged: Boolean = false
-
-    override fun onSemanticsChange() {
-        semanticsChanged = true
-    }
+    override fun onSemanticsChange() {}
 
     override fun onLayoutChange(layoutNode: LayoutNode) {
         layoutChangeCount++
diff --git a/compose/ui/ui/src/androidUnitTest/kotlin/androidx/compose/ui/node/ModifierLocalConsumerEntityTest.kt b/compose/ui/ui/src/androidUnitTest/kotlin/androidx/compose/ui/node/ModifierLocalConsumerEntityTest.kt
index 4fdd4ea..de1b8d6 100644
--- a/compose/ui/ui/src/androidUnitTest/kotlin/androidx/compose/ui/node/ModifierLocalConsumerEntityTest.kt
+++ b/compose/ui/ui/src/androidUnitTest/kotlin/androidx/compose/ui/node/ModifierLocalConsumerEntityTest.kt
@@ -446,6 +446,10 @@
 
         override fun requestFocus() = TODO("Not yet implemented")
 
+        override fun requestAutofill(node: LayoutNode) {
+            TODO("Not yet implemented")
+        }
+
         override fun measureAndLayout(sendPointerUpdate: Boolean) = TODO("Not yet implemented")
 
         override fun measureAndLayout(layoutNode: LayoutNode, constraints: Constraints) {
diff --git a/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/autofill/AutofillManager.kt b/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/autofill/AutofillManager.kt
index 2a6163b..f5ebdc7 100644
--- a/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/autofill/AutofillManager.kt
+++ b/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/autofill/AutofillManager.kt
@@ -42,14 +42,4 @@
      * without processing any information entered in the autofillable field.
      */
     abstract fun cancel()
-
-    /**
-     * Request autofill for previously focused element.
-     *
-     * This may have no effect, and it is not required that any autofill service will be notified.
-     *
-     * Any component that can be autofilled may call this when it is active to request an autofill
-     * services response.
-     */
-    abstract fun requestAutofillForActiveElement()
 }
diff --git a/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/input/key/KeyInputModifier.kt b/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/input/key/KeyInputModifier.kt
index cba5ff1..d60c1b5 100644
--- a/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/input/key/KeyInputModifier.kt
+++ b/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/input/key/KeyInputModifier.kt
@@ -46,7 +46,7 @@
 fun Modifier.onPreviewKeyEvent(onPreviewKeyEvent: (KeyEvent) -> Boolean): Modifier =
     this then KeyInputElement(onKeyEvent = null, onPreKeyEvent = onPreviewKeyEvent)
 
-private data class KeyInputElement(
+private class KeyInputElement(
     val onKeyEvent: ((KeyEvent) -> Boolean)?,
     val onPreKeyEvent: ((KeyEvent) -> Boolean)?
 ) : ModifierNodeElement<KeyInputNode>() {
@@ -67,6 +67,21 @@
             properties["onPreviewKeyEvent"] = it
         }
     }
+
+    override fun equals(other: Any?): Boolean {
+        if (this === other) return true
+        if (other !is KeyInputElement) return false
+
+        if (onKeyEvent !== other.onKeyEvent) return false
+        if (onPreKeyEvent !== other.onPreKeyEvent) return false
+        return true
+    }
+
+    override fun hashCode(): Int {
+        var result = onKeyEvent?.hashCode() ?: 0
+        result = 31 * result + (onPreKeyEvent?.hashCode() ?: 0)
+        return result
+    }
 }
 
 private class KeyInputNode(
diff --git a/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/input/pointer/util/PointerIdArray.kt b/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/input/pointer/util/PointerIdArray.kt
index f295af3..d96d294 100644
--- a/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/input/pointer/util/PointerIdArray.kt
+++ b/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/input/pointer/util/PointerIdArray.kt
@@ -19,7 +19,6 @@
 package androidx.compose.ui.input.pointer.util
 
 import androidx.compose.ui.input.pointer.PointerId
-import dalvik.annotation.optimization.NeverInline
 
 /**
  * This collection is specifically for dealing with [PointerId] values. We know that they contain
@@ -145,7 +144,6 @@
         if (index >= size) size = index + 1
     }
 
-    @NeverInline
     private fun resizeStorage(minSize: Int): LongArray {
         return internalArray.copyOf(maxOf(minSize, internalArray.size * 2)).apply {
             internalArray = this
diff --git a/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/node/DelegatableNode.kt b/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/node/DelegatableNode.kt
index 08505aa..8b45c3f 100644
--- a/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/node/DelegatableNode.kt
+++ b/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/node/DelegatableNode.kt
@@ -332,6 +332,13 @@
     checkPreconditionNotNull(requireLayoutNode().owner) { "This node does not have an owner." }
 
 /**
+ * Requests autofill for the LayoutNode that this [DelegatableNode] is attached to. If the node does
+ * not have any autofill semantic properties set, then the request still may be sent to the Autofill
+ * service, but no response is expected.
+ */
+fun DelegatableNode.requestAutofill() = requireLayoutNode().requestAutofill()
+
+/**
  * Returns the current [Density] of the LayoutNode that this [DelegatableNode] is attached to. If
  * the node is not attached, this function will throw an [IllegalStateException].
  */
diff --git a/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/node/LayoutNode.kt b/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/node/LayoutNode.kt
index 5f60779..ef5efb6 100644
--- a/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/node/LayoutNode.kt
+++ b/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/node/LayoutNode.kt
@@ -400,7 +400,15 @@
 
     override fun isTransparent(): Boolean = outerCoordinator.isTransparent()
 
-    private var isSemanticsInvalidated = false
+    internal var isSemanticsInvalidated = false
+
+    internal fun requestAutofill() {
+        // Ignore calls while semantics are being applied (b/378114177).
+        if (isCurrentlyCalculatingSemanticsConfiguration) return
+
+        val owner = requireOwner()
+        owner.requestAutofill(this)
+    }
 
     internal fun invalidateSemantics() {
         // Ignore calls to invalidate Semantics while semantics are being applied (b/378114177).
@@ -923,6 +931,9 @@
             requirePrecondition(!isDeactivated) { "modifier is updated when deactivated" }
             if (isAttached) {
                 applyModifier(value)
+                if (isSemanticsInvalidated) {
+                    invalidateSemantics()
+                }
             } else {
                 pendingModifier = value
             }
@@ -935,19 +946,6 @@
         if (lookaheadRoot == null && nodes.has(Nodes.ApproachMeasure)) {
             lookaheadRoot = this
         }
-        // Notify semantics listeners if semantics was invalidated.
-        @OptIn(ExperimentalComposeUiApi::class)
-        if (ComposeUiFlags.isSemanticAutofillEnabled && isSemanticsInvalidated) {
-            val prev = _semanticsConfiguration
-            _semanticsConfiguration = calculateSemanticsConfiguration()
-            isSemanticsInvalidated = false
-            val owner = requireOwner()
-            owner.semanticsOwner.notifySemanticsChange(this, prev)
-
-            // This is needed for Accessibility and ContentCapture. Remove after these systems
-            // are migrated to use SemanticsInfo and SemanticListeners.
-            owner.onSemanticsChange()
-        }
     }
 
     private fun resetModifierState() {
diff --git a/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/node/MyersDiff.kt b/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/node/MyersDiff.kt
index 1d84d69..acc7620 100644
--- a/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/node/MyersDiff.kt
+++ b/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/node/MyersDiff.kt
@@ -18,7 +18,6 @@
 package androidx.compose.ui.node
 
 import androidx.compose.ui.internal.checkPrecondition
-import dalvik.annotation.optimization.NeverInline
 import kotlin.jvm.JvmInline
 import kotlin.math.abs
 import kotlin.math.min
@@ -418,7 +417,6 @@
     val size: Int
         get() = lastIndex
 
-    @NeverInline
     private fun resizeStack(stack: IntArray): IntArray {
         val copy = stack.copyOf(stack.size * 2)
         this.stack = copy
diff --git a/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/node/NodeKind.kt b/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/node/NodeKind.kt
index a4f5fe6..eb27c9a 100644
--- a/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/node/NodeKind.kt
+++ b/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/node/NodeKind.kt
@@ -331,7 +331,7 @@
         node.invalidateDraw()
     }
     if (Nodes.Semantics in selfKindSet && node is SemanticsModifierNode) {
-        node.invalidateSemantics()
+        node.requireLayoutNode().isSemanticsInvalidated = true
     }
     if (Nodes.ParentData in selfKindSet && node is ParentDataModifierNode) {
         node.invalidateParentData()
diff --git a/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/node/Owner.kt b/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/node/Owner.kt
index a75bf87..ee7342a 100644
--- a/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/node/Owner.kt
+++ b/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/node/Owner.kt
@@ -245,6 +245,9 @@
      */
     fun requestFocus(): Boolean
 
+    /** Ask the system to request autofill values to this owner. */
+    fun requestAutofill(node: LayoutNode)
+
     /**
      * Iterates through all LayoutNodes that have requested layout and measures and lays them out.
      * If [sendPointerUpdate] is `true` then a simulated PointerEvent may be sent to update pointer
diff --git a/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/spatial/RectList.kt b/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/spatial/RectList.kt
index ab2eb07..259ae65 100644
--- a/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/spatial/RectList.kt
+++ b/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/spatial/RectList.kt
@@ -14,11 +14,10 @@
  * limitations under the License.
  */
 
-@file:Suppress("NOTHING_TO_INLINE", "KotlinRedundantDiagnosticSuppress")
+@file:Suppress("NOTHING_TO_INLINE")
 
 package androidx.compose.ui.spatial
 
-import dalvik.annotation.optimization.NeverInline
 import kotlin.jvm.JvmField
 import kotlin.math.max
 import kotlin.math.min
@@ -99,24 +98,19 @@
      * keep this in mind if you call this method and have cached any of those values in a local
      * variable, you may need to refresh them.
      */
-    private inline fun allocateItemsIndex(): Int {
+    internal fun allocateItemsIndex(): Int {
         val currentItems = items
         val currentSize = itemsSize
         itemsSize = currentSize + LongsPerItem
         val actualSize = currentItems.size
         if (actualSize <= currentSize + LongsPerItem) {
-            resizeStorage(actualSize, currentSize, currentItems)
+            val newSize = max(actualSize * 2, currentSize + LongsPerItem)
+            items = currentItems.copyOf(newSize)
+            stack = stack.copyOf(newSize)
         }
         return currentSize
     }
 
-    @NeverInline
-    private fun resizeStorage(actualSize: Int, currentSize: Int, currentItems: LongArray) {
-        val newSize = max(actualSize * 2, currentSize + LongsPerItem)
-        items = currentItems.copyOf(newSize)
-        stack = stack.copyOf(newSize)
-    }
-
     /**
      * Insert a value and corresponding bounding rectangle into the RectList. This method does not
      * check to see that [value] doesn't already exist somewhere in the list.
diff --git a/constraintlayout/constraintlayout-compose/api/current.ignore b/constraintlayout/constraintlayout-compose/api/current.ignore
new file mode 100644
index 0000000..dfb0518a
--- /dev/null
+++ b/constraintlayout/constraintlayout-compose/api/current.ignore
@@ -0,0 +1,9 @@
+// Baseline format: 1.0
+RemovedMethod: androidx.constraintlayout.compose.DebugFlags#getShowBounds():
+    Removed method androidx.constraintlayout.compose.DebugFlags.getShowBounds()
+RemovedMethod: androidx.constraintlayout.compose.DebugFlags#getShowKeyPositions():
+    Removed method androidx.constraintlayout.compose.DebugFlags.getShowKeyPositions()
+RemovedMethod: androidx.constraintlayout.compose.DebugFlags#getShowPaths():
+    Removed method androidx.constraintlayout.compose.DebugFlags.getShowPaths()
+RemovedMethod: androidx.constraintlayout.compose.GridFlag#isPlaceLayoutsOnSpansFirst():
+    Removed method androidx.constraintlayout.compose.GridFlag.isPlaceLayoutsOnSpansFirst()
diff --git a/constraintlayout/constraintlayout-compose/api/restricted_current.ignore b/constraintlayout/constraintlayout-compose/api/restricted_current.ignore
new file mode 100644
index 0000000..dfb0518a
--- /dev/null
+++ b/constraintlayout/constraintlayout-compose/api/restricted_current.ignore
@@ -0,0 +1,9 @@
+// Baseline format: 1.0
+RemovedMethod: androidx.constraintlayout.compose.DebugFlags#getShowBounds():
+    Removed method androidx.constraintlayout.compose.DebugFlags.getShowBounds()
+RemovedMethod: androidx.constraintlayout.compose.DebugFlags#getShowKeyPositions():
+    Removed method androidx.constraintlayout.compose.DebugFlags.getShowKeyPositions()
+RemovedMethod: androidx.constraintlayout.compose.DebugFlags#getShowPaths():
+    Removed method androidx.constraintlayout.compose.DebugFlags.getShowPaths()
+RemovedMethod: androidx.constraintlayout.compose.GridFlag#isPlaceLayoutsOnSpansFirst():
+    Removed method androidx.constraintlayout.compose.GridFlag.isPlaceLayoutsOnSpansFirst()
diff --git a/constraintlayout/constraintlayout-compose/api/restricted_current.txt b/constraintlayout/constraintlayout-compose/api/restricted_current.txt
index 467bc76..339b479 100644
--- a/constraintlayout/constraintlayout-compose/api/restricted_current.txt
+++ b/constraintlayout/constraintlayout-compose/api/restricted_current.txt
@@ -679,8 +679,7 @@
     method public final void drawDebugBounds(androidx.compose.ui.graphics.drawscope.DrawScope, float forcedScaleFactor);
     method public String getDesignInfo(int startX, int startY, String args);
     method public final float getForcedScaleFactor();
-    method @Deprecated protected final java.util.Map<androidx.compose.ui.layout.Measurable,androidx.constraintlayout.core.state.WidgetFrame> getFrameCache();
-    method protected final java.util.Map<java.lang.String,androidx.constraintlayout.core.state.WidgetFrame> getFrameCache2();
+    method protected final java.util.Map<androidx.compose.ui.layout.Measurable,androidx.constraintlayout.core.state.WidgetFrame> getFrameCache();
     method public final int getLayoutCurrentHeight();
     method public final int getLayoutCurrentWidth();
     method protected final androidx.constraintlayout.compose.LayoutInformationReceiver? getLayoutInformationReceiver();
@@ -689,16 +688,12 @@
     method protected final androidx.constraintlayout.compose.State getState();
     method public void measure(androidx.constraintlayout.core.widgets.ConstraintWidget constraintWidget, androidx.constraintlayout.core.widgets.analyzer.BasicMeasure.Measure measure);
     method public final void parseDesignElements(androidx.constraintlayout.compose.ConstraintSet constraintSet);
-    method @Deprecated public final void performLayout(androidx.compose.ui.layout.Placeable.PlacementScope, java.util.List<? extends androidx.compose.ui.layout.Measurable> measurables);
-    method public final void performLayout(androidx.compose.ui.layout.Placeable.PlacementScope, java.util.List<? extends androidx.compose.ui.layout.Measurable> measurables, java.util.Map<androidx.compose.ui.layout.Measurable,androidx.compose.ui.layout.Placeable> placeableMap);
-    method @Deprecated public final long performMeasure(long constraints, androidx.compose.ui.unit.LayoutDirection layoutDirection, androidx.constraintlayout.compose.ConstraintSet constraintSet, java.util.List<? extends androidx.compose.ui.layout.Measurable> measurables, int optimizationLevel);
-    method public final long performMeasure(long constraints, androidx.compose.ui.unit.LayoutDirection layoutDirection, androidx.constraintlayout.compose.ConstraintSet constraintSet, java.util.List<? extends androidx.compose.ui.layout.Measurable> measurables, java.util.Map<androidx.compose.ui.layout.Measurable,androidx.compose.ui.layout.Placeable> placeableMap, int optimizationLevel);
+    method public final void performLayout(androidx.compose.ui.layout.Placeable.PlacementScope, java.util.List<? extends androidx.compose.ui.layout.Measurable> measurables);
+    method public final long performMeasure(long constraints, androidx.compose.ui.unit.LayoutDirection layoutDirection, androidx.constraintlayout.compose.ConstraintSet constraintSet, java.util.List<? extends androidx.compose.ui.layout.Measurable> measurables, int optimizationLevel);
     method public final void setForcedScaleFactor(float);
     method protected final void setLayoutInformationReceiver(androidx.constraintlayout.compose.LayoutInformationReceiver?);
-    method protected final void setPlaceables(java.util.Map<androidx.compose.ui.layout.Measurable,androidx.compose.ui.layout.Placeable>);
     property public final float forcedScaleFactor;
-    property @Deprecated protected final java.util.Map<androidx.compose.ui.layout.Measurable,androidx.constraintlayout.core.state.WidgetFrame> frameCache;
-    property protected final java.util.Map<java.lang.String,androidx.constraintlayout.core.state.WidgetFrame> frameCache2;
+    property protected final java.util.Map<androidx.compose.ui.layout.Measurable,androidx.constraintlayout.core.state.WidgetFrame> frameCache;
     property public final int layoutCurrentHeight;
     property public final int layoutCurrentWidth;
     property protected final androidx.constraintlayout.compose.LayoutInformationReceiver? layoutInformationReceiver;
diff --git a/constraintlayout/constraintlayout-compose/src/androidInstrumentedTest/kotlin/androidx/constraintlayout/compose/ConstraintLayoutTest.kt b/constraintlayout/constraintlayout-compose/src/androidInstrumentedTest/kotlin/androidx/constraintlayout/compose/ConstraintLayoutTest.kt
index c6ccca1..e7f7289 100644
--- a/constraintlayout/constraintlayout-compose/src/androidInstrumentedTest/kotlin/androidx/constraintlayout/compose/ConstraintLayoutTest.kt
+++ b/constraintlayout/constraintlayout-compose/src/androidInstrumentedTest/kotlin/androidx/constraintlayout/compose/ConstraintLayoutTest.kt
@@ -44,7 +44,6 @@
 import androidx.compose.ui.graphics.asAndroidBitmap
 import androidx.compose.ui.graphics.toArgb
 import androidx.compose.ui.layout.FirstBaseline
-import androidx.compose.ui.layout.LookaheadScope
 import androidx.compose.ui.layout.boundsInParent
 import androidx.compose.ui.layout.layout
 import androidx.compose.ui.layout.layoutId
@@ -2455,138 +2454,6 @@
             assertEquals(IntSize(rootSizePx.fastRoundToInt(), 0), layoutSize)
         }
 
-    @Test
-    fun testToggleVisibilityWithFillConstraintsWidth() =
-        with(rule.density) {
-            val rootSizePx = 100f
-
-            var toggleVisibility by mutableStateOf(false)
-
-            rule.setContent {
-                // Regression test, modify only dimensions if necessary
-                ConstraintLayout(modifier = Modifier.size(rootSizePx.toDp())) {
-                    val (titleRef, detailRef) = createRefs()
-                    Box(
-                        modifier =
-                            Modifier.background(Color.Cyan).testTag("box1").constrainAs(detailRef) {
-                                centerHorizontallyTo(parent)
-
-                                width = Dimension.fillToConstraints
-                                height = rootSizePx.toDp().asDimension()
-
-                                visibility =
-                                    if (!toggleVisibility) Visibility.Gone else Visibility.Visible
-                            }
-                    )
-                    Box(
-                        modifier =
-                            Modifier.background(Color.Red).testTag("box2").constrainAs(titleRef) {
-                                centerHorizontallyTo(parent)
-
-                                width = Dimension.fillToConstraints
-                                height = rootSizePx.toDp().asDimension()
-
-                                visibility =
-                                    if (toggleVisibility) Visibility.Gone else Visibility.Visible
-                            }
-                    )
-                }
-            }
-            rule.waitForIdle()
-
-            rule.onNodeWithTag("box1").apply {
-                assertWidthIsEqualTo(Dp.Unspecified)
-                assertHeightIsEqualTo(Dp.Unspecified)
-            }
-            rule.onNodeWithTag("box2").apply {
-                assertWidthIsEqualTo(rootSizePx.toDp())
-                assertHeightIsEqualTo(rootSizePx.toDp())
-            }
-
-            toggleVisibility = !toggleVisibility
-            rule.waitForIdle()
-
-            rule.onNodeWithTag("box1").apply {
-                assertWidthIsEqualTo(rootSizePx.toDp())
-                assertHeightIsEqualTo(rootSizePx.toDp())
-            }
-            rule.onNodeWithTag("box2").apply {
-                assertWidthIsEqualTo(Dp.Unspecified)
-                assertHeightIsEqualTo(Dp.Unspecified)
-            }
-            Unit // Test expects to return Unit
-        }
-
-    @Test
-    fun testToggleVisibilityWithFillConstraintsWidth_underLookahead() =
-        with(rule.density) {
-            val rootSizePx = 100f
-
-            var toggleVisibility by mutableStateOf(false)
-
-            rule.setContent {
-                LookaheadScope {
-                    // Regression test, modify only dimensions if necessary
-                    ConstraintLayout(modifier = Modifier.size(rootSizePx.toDp())) {
-                        val (titleRef, detailRef) = createRefs()
-                        Box(
-                            modifier =
-                                Modifier.background(Color.Cyan).testTag("box1").constrainAs(
-                                    detailRef
-                                ) {
-                                    centerHorizontallyTo(parent)
-
-                                    width = Dimension.fillToConstraints
-                                    height = rootSizePx.toDp().asDimension()
-
-                                    visibility =
-                                        if (!toggleVisibility) Visibility.Gone
-                                        else Visibility.Visible
-                                }
-                        )
-                        Box(
-                            modifier =
-                                Modifier.background(Color.Red).testTag("box2").constrainAs(
-                                    titleRef
-                                ) {
-                                    centerHorizontallyTo(parent)
-
-                                    width = Dimension.fillToConstraints
-                                    height = rootSizePx.toDp().asDimension()
-
-                                    visibility =
-                                        if (toggleVisibility) Visibility.Gone
-                                        else Visibility.Visible
-                                }
-                        )
-                    }
-                }
-            }
-            rule.waitForIdle()
-
-            rule.onNodeWithTag("box1").apply {
-                assertWidthIsEqualTo(Dp.Unspecified)
-                assertHeightIsEqualTo(Dp.Unspecified)
-            }
-            rule.onNodeWithTag("box2").apply {
-                assertWidthIsEqualTo(rootSizePx.toDp())
-                assertHeightIsEqualTo(rootSizePx.toDp())
-            }
-
-            toggleVisibility = !toggleVisibility
-            rule.waitForIdle()
-
-            rule.onNodeWithTag("box1").apply {
-                assertWidthIsEqualTo(rootSizePx.toDp())
-                assertHeightIsEqualTo(rootSizePx.toDp())
-            }
-            rule.onNodeWithTag("box2").apply {
-                assertWidthIsEqualTo(Dp.Unspecified)
-                assertHeightIsEqualTo(Dp.Unspecified)
-            }
-            Unit // Test expects to return Unit
-        }
-
     /**
      * Provides a list constraints combination for horizontal anchors: `start`, `end`,
      * `absoluteLeft`, `absoluteRight`.
diff --git a/constraintlayout/constraintlayout-compose/src/androidMain/kotlin/androidx/constraintlayout/compose/ConstraintLayout.kt b/constraintlayout/constraintlayout-compose/src/androidMain/kotlin/androidx/constraintlayout/compose/ConstraintLayout.kt
index da91f65..04acd28 100644
--- a/constraintlayout/constraintlayout-compose/src/androidMain/kotlin/androidx/constraintlayout/compose/ConstraintLayout.kt
+++ b/constraintlayout/constraintlayout-compose/src/androidMain/kotlin/androidx/constraintlayout/compose/ConstraintLayout.kt
@@ -420,27 +420,21 @@
     val contentTracker = remember { mutableStateOf(Unit, neverEqualPolicy()) }
 
     val measurePolicy = MeasurePolicy { measurables, constraints ->
-        // Map to properly capture Placeables across Measure and Layout passes
-        val placeableMap = mutableMapOf<Measurable, Placeable>()
-
-        // Call to invalidate measure on content recomposition
         contentTracker.value
-
         val layoutSize =
             measurer.performMeasure(
-                constraints = constraints,
-                layoutDirection = layoutDirection,
-                constraintSet = constraintSet,
-                measurables = measurables,
-                placeableMap = placeableMap,
-                optimizationLevel = optimizationLevel
+                constraints,
+                layoutDirection,
+                constraintSet,
+                measurables,
+                optimizationLevel
             )
         // We read the remeasurement requester state, to request remeasure when the value
         // changes. This will happen when the scope helpers are changing at recomposition.
         remeasureRequesterState.value
 
         layout(layoutSize.width, layoutSize.height) {
-            with(measurer) { performLayout(measurables = measurables, placeableMap = placeableMap) }
+            with(measurer) { performLayout(measurables) }
         }
     }
 
@@ -811,25 +805,17 @@
             true
         }
         val measurePolicy = MeasurePolicy { measurables, constraints ->
-            // Map to properly capture Placeables across Measure and Layout passes
-            val placeableMap = mutableMapOf<Measurable, Placeable>()
-
-            // Call to invalidate measure on content recomposition
             contentTracker.value
-
             val layoutSize =
                 measurer.performMeasure(
-                    constraints = constraints,
-                    layoutDirection = layoutDirection,
-                    constraintSet = constraintSet,
-                    measurables = measurables,
-                    placeableMap = placeableMap,
-                    optimizationLevel = optimizationLevel
+                    constraints,
+                    layoutDirection,
+                    constraintSet,
+                    measurables,
+                    optimizationLevel
                 )
             layout(layoutSize.width, layoutSize.height) {
-                with(measurer) {
-                    performLayout(measurables = measurables, placeableMap = placeableMap)
-                }
+                with(measurer) { performLayout(measurables) }
             }
         }
         if (constraintSet is EditableJSONLayout) {
@@ -1625,22 +1611,9 @@
     private var computedLayoutResult: String = ""
     protected var layoutInformationReceiver: LayoutInformationReceiver? = null
     protected val root = ConstraintWidgetContainer(0, 0).also { it.measurer = this }
-
-    /**
-     * Due to Lookahead measure pass, the object used to measure and place should not be
-     * instantiated internally, instead, should be instantiated within the MeasurePolicy call, and
-     * then passed to update this variable, at each the measure and layout passes.
-     */
-    protected var placeables = mutableMapOf<Measurable, Placeable>()
+    protected val placeables = mutableMapOf<Measurable, Placeable>()
     private val lastMeasures = mutableMapOf<String, Array<Int>>()
-
-    @Suppress("unused") // Exists for compatibility.
-    @Deprecated(
-        message = "Should not reference a Measurable.",
-        replaceWith = ReplaceWith("frameCache2")
-    )
-    protected val frameCache = emptyMap<Measurable, WidgetFrame>()
-    protected val frameCache2 = mutableMapOf<String, WidgetFrame>()
+    protected val frameCache = mutableMapOf<Measurable, WidgetFrame>()
 
     protected val state = State(density)
 
@@ -1817,7 +1790,7 @@
                 val id = measurable.layoutId ?: measurable.constraintLayoutId
                 child.stringId = id?.toString()
             }
-            val frame = frameCache2[measurable.anyOrNullId]?.widget?.frame
+            val frame = frameCache[measurable]?.widget?.frame
             if (frame == null) {
                 continue
             }
@@ -1894,33 +1867,13 @@
         this[2] = measure.measuredBaseline
     }
 
-    @Suppress("DeprecatedCallableAddReplaceWith") // Requires manual replacement
-    @Deprecated("Should receive placeable Map from caller.")
     fun performMeasure(
         constraints: Constraints,
         layoutDirection: LayoutDirection,
         constraintSet: ConstraintSet,
         measurables: List<Measurable>,
         optimizationLevel: Int
-    ): IntSize =
-        performMeasure(
-            constraints = constraints,
-            layoutDirection = layoutDirection,
-            constraintSet = constraintSet,
-            measurables = measurables,
-            placeableMap = placeables,
-            optimizationLevel = optimizationLevel
-        )
-
-    fun performMeasure(
-        constraints: Constraints,
-        layoutDirection: LayoutDirection,
-        constraintSet: ConstraintSet,
-        measurables: List<Measurable>,
-        placeableMap: MutableMap<Measurable, Placeable>,
-        optimizationLevel: Int
     ): IntSize {
-        this.placeables = placeableMap
         if (measurables.isEmpty()) {
             // TODO(b/335524398): Behavior with zero children is unexpected. It's also inconsistent
             //      with ViewGroup, so this is a workaround to handle those cases the way it seems
@@ -1985,7 +1938,7 @@
     internal fun resetMeasureState() {
         placeables.clear()
         lastMeasures.clear()
-        frameCache2.clear()
+        frameCache.clear()
     }
 
     protected fun applyRootSize(constraints: Constraints) {
@@ -2024,30 +1977,37 @@
         }
     }
 
-    @Suppress("DeprecatedCallableAddReplaceWith") // Requires manual replacement
-    @Deprecated("Should receive placeable Map from caller.")
     fun Placeable.PlacementScope.performLayout(measurables: List<Measurable>) {
-        performLayout(measurables, placeables)
-    }
-
-    fun Placeable.PlacementScope.performLayout(
-        measurables: List<Measurable>,
-        placeableMap: MutableMap<Measurable, Placeable>,
-    ) {
-        if (frameCache2.isEmpty()) {
+        if (frameCache.isEmpty()) {
             root.children.fastForEach { child ->
                 val measurable = child.companionWidget
                 if (measurable !is Measurable) return@fastForEach
                 val frame = WidgetFrame(child.frame.update())
-                frameCache2[measurable.anyOrNullId] = frame
+                frameCache[measurable] = frame
             }
         }
         measurables.fastForEach { measurable ->
-            val frame = frameCache2[measurable.anyOrNullId] ?: return@fastForEach
-            // Don't use `placeables` map from Measurer, is not guaranteed to correspond to this
-            // Layout pass
-            val placeable = placeableMap[measurable] ?: return@fastForEach
-            placeWithFrameTransform(placeable, frame)
+            val matchedMeasurable: Measurable =
+                if (!frameCache.containsKey(measurable)) {
+                    // TODO: Workaround for lookaheadLayout, the measurable is a different instance
+                    frameCache.keys.firstOrNull {
+                        it.layoutId != null && it.layoutId == measurable.layoutId
+                    } ?: return@fastForEach
+                } else {
+                    measurable
+                }
+            val frame = frameCache[matchedMeasurable] ?: return
+            val placeable = placeables[matchedMeasurable] ?: return
+            if (!frameCache.containsKey(measurable)) {
+                // TODO: Workaround for lookaheadLayout, the measurable is a different instance and
+                //   the placeable should be a result of the given measurable
+                placeWithFrameTransform(
+                    measurable.measure(Constraints.fixed(placeable.width, placeable.height)),
+                    frame
+                )
+            } else {
+                placeWithFrameTransform(placeable, frame)
+            }
         }
         if (layoutInformationReceiver?.getLayoutInformationMode() == LayoutInfoFlags.BOUNDS) {
             computeLayoutResult()
@@ -2096,8 +2056,7 @@
                 IntIntPair(constraintWidget.measuredWidth, constraintWidget.measuredHeight)
             }
             measurable is Measurable -> {
-                val result = measurable.measure(constraints)
-                placeables[measurable] = result
+                val result = measurable.measure(constraints).also { placeables[measurable] = it }
                 IntIntPair(result.width, result.height)
             }
             else -> {
@@ -2316,10 +2275,6 @@
     }
 }
 
-/** Returns either [LayoutIdParentData] or [ConstraintLayoutParentData] id. Otherwise "null". */
-internal val Measurable.anyOrNullId: String
-    get() = (this.layoutId ?: this.constraintLayoutId)?.toString() ?: "null"
-
 internal typealias SolverDimension = androidx.constraintlayout.core.state.Dimension
 
 internal typealias SolverState = androidx.constraintlayout.core.state.State
diff --git a/constraintlayout/constraintlayout-compose/src/androidMain/kotlin/androidx/constraintlayout/compose/LateMotionLayout.kt b/constraintlayout/constraintlayout-compose/src/androidMain/kotlin/androidx/constraintlayout/compose/LateMotionLayout.kt
index 46b7f27..8287e20 100644
--- a/constraintlayout/constraintlayout-compose/src/androidMain/kotlin/androidx/constraintlayout/compose/LateMotionLayout.kt
+++ b/constraintlayout/constraintlayout-compose/src/androidMain/kotlin/androidx/constraintlayout/compose/LateMotionLayout.kt
@@ -25,10 +25,8 @@
 import androidx.compose.runtime.mutableIntStateOf
 import androidx.compose.runtime.remember
 import androidx.compose.ui.Modifier
-import androidx.compose.ui.layout.Measurable
 import androidx.compose.ui.layout.MeasurePolicy
 import androidx.compose.ui.layout.MultiMeasureLayout
-import androidx.compose.ui.layout.Placeable
 import androidx.compose.ui.node.Ref
 import androidx.compose.ui.platform.LocalDensity
 import androidx.compose.ui.semantics.semantics
@@ -119,9 +117,6 @@
     measurer: MotionMeasurer,
     optimizationLevel: Int,
 ): MeasurePolicy = MeasurePolicy { measurables, constraints ->
-    // Map to properly capture Placeables across Measure and Layout passes
-    val placeableMap = mutableMapOf<Measurable, Placeable>()
-
     // Do a state read, to guarantee that we control measure when the content recomposes without
     // notifying our Composable caller
     contentTracker.value
@@ -134,7 +129,6 @@
             constraintSetEnd = endProvider(),
             transition = TransitionImpl.EMPTY,
             measurables = measurables,
-            placeableMap = placeableMap,
             optimizationLevel = optimizationLevel,
             progress = motionProgress.value,
             compositionSource = compositionSource.value ?: CompositionSource.Unknown,
@@ -142,7 +136,5 @@
         )
     compositionSource.value = CompositionSource.Unknown // Reset after measuring
 
-    layout(layoutSize.width, layoutSize.height) {
-        with(measurer) { performLayout(measurables = measurables, placeableMap = placeableMap) }
-    }
+    layout(layoutSize.width, layoutSize.height) { with(measurer) { performLayout(measurables) } }
 }
diff --git a/constraintlayout/constraintlayout-compose/src/androidMain/kotlin/androidx/constraintlayout/compose/MotionCarousel.kt b/constraintlayout/constraintlayout-compose/src/androidMain/kotlin/androidx/constraintlayout/compose/MotionCarousel.kt
index 43db9f6..d8d5f55 100644
--- a/constraintlayout/constraintlayout-compose/src/androidMain/kotlin/androidx/constraintlayout/compose/MotionCarousel.kt
+++ b/constraintlayout/constraintlayout-compose/src/androidMain/kotlin/androidx/constraintlayout/compose/MotionCarousel.kt
@@ -125,6 +125,7 @@
  * index than startIndex, and at the end of the Carousel, we will not populate the slots that have a
  * higher index than startIndex.
  *
+ * @param motionScene the MotionScene which holds slots and can be used to customize the carousel
  * @param initialSlotIndex the slot index that holds the current element
  * @param numSlots the number of slots in the scene
  * @param backwardTransition the name of the previous transition (default "previous")
@@ -137,7 +138,7 @@
 @Composable
 @Suppress("UnavailableSymbol")
 fun MotionCarousel(
-    @Suppress("HiddenTypeParameter") motionScene: MotionScene,
+    motionScene: MotionScene,
     initialSlotIndex: Int,
     numSlots: Int,
     backwardTransition: String = "backward",
diff --git a/constraintlayout/constraintlayout-compose/src/androidMain/kotlin/androidx/constraintlayout/compose/MotionLayout.kt b/constraintlayout/constraintlayout-compose/src/androidMain/kotlin/androidx/constraintlayout/compose/MotionLayout.kt
index 8b0e892..280dca8 100644
--- a/constraintlayout/constraintlayout-compose/src/androidMain/kotlin/androidx/constraintlayout/compose/MotionLayout.kt
+++ b/constraintlayout/constraintlayout-compose/src/androidMain/kotlin/androidx/constraintlayout/compose/MotionLayout.kt
@@ -42,10 +42,8 @@
 import androidx.compose.ui.draw.scale
 import androidx.compose.ui.geometry.Rect
 import androidx.compose.ui.graphics.Color
-import androidx.compose.ui.layout.Measurable
 import androidx.compose.ui.layout.MeasurePolicy
 import androidx.compose.ui.layout.MultiMeasureLayout
-import androidx.compose.ui.layout.Placeable
 import androidx.compose.ui.layout.onGloballyPositioned
 import androidx.compose.ui.layout.onPlaced
 import androidx.compose.ui.node.Ref
@@ -980,9 +978,6 @@
     optimizationLevel: Int,
     invalidationStrategy: InvalidationStrategy
 ): MeasurePolicy = MeasurePolicy { measurables, constraints ->
-    // Map to properly capture Placeables across Measure and Layout passes
-    val placeableMap = mutableMapOf<Measurable, Placeable>()
-
     // Do a state read, to guarantee that we control measure when the content recomposes without
     // notifying our Composable caller
     contentTracker.value
@@ -995,7 +990,6 @@
             constraintSetEnd = constraintSetEnd,
             transition = transition,
             measurables = measurables,
-            placeableMap = placeableMap,
             optimizationLevel = optimizationLevel,
             progress = motionProgress.floatValue,
             compositionSource = compositionSource.value ?: CompositionSource.Unknown,
@@ -1003,9 +997,7 @@
         )
     compositionSource.value = CompositionSource.Unknown // Reset after measuring
 
-    layout(layoutSize.width, layoutSize.height) {
-        with(measurer) { performLayout(measurables = measurables, placeableMap = placeableMap) }
-    }
+    layout(layoutSize.width, layoutSize.height) { with(measurer) { performLayout(measurables) } }
 }
 
 /**
diff --git a/constraintlayout/constraintlayout-compose/src/androidMain/kotlin/androidx/constraintlayout/compose/MotionMeasurer.kt b/constraintlayout/constraintlayout-compose/src/androidMain/kotlin/androidx/constraintlayout/compose/MotionMeasurer.kt
index b077a37..ecd807c 100644
--- a/constraintlayout/constraintlayout-compose/src/androidMain/kotlin/androidx/constraintlayout/compose/MotionMeasurer.kt
+++ b/constraintlayout/constraintlayout-compose/src/androidMain/kotlin/androidx/constraintlayout/compose/MotionMeasurer.kt
@@ -27,7 +27,6 @@
 import androidx.compose.ui.graphics.drawscope.translate
 import androidx.compose.ui.graphics.nativeCanvas
 import androidx.compose.ui.layout.Measurable
-import androidx.compose.ui.layout.Placeable
 import androidx.compose.ui.layout.layoutId
 import androidx.compose.ui.unit.Constraints
 import androidx.compose.ui.unit.Density
@@ -85,13 +84,11 @@
         constraintSetEnd: ConstraintSet,
         @SuppressWarnings("HiddenTypeParameter") transition: TransitionImpl,
         measurables: List<Measurable>,
-        placeableMap: MutableMap<Measurable, Placeable>,
         optimizationLevel: Int,
         progress: Float,
         compositionSource: CompositionSource,
         invalidateOnConstraintsCallback: ShouldInvalidateCallback?
     ): IntSize {
-        placeables = placeableMap
         val needsRemeasure =
             needsRemeasure(
                 constraints = constraints,
@@ -142,7 +139,7 @@
         source: CompositionSource,
         invalidateOnConstraintsCallback: ShouldInvalidateCallback?
     ): Boolean {
-        if (this.transition.isEmpty || frameCache2.isEmpty()) {
+        if (this.transition.isEmpty || frameCache.isEmpty()) {
             // Nothing measured (by MotionMeasurer)
             return true
         }
@@ -229,7 +226,7 @@
                 measurable.measure(
                     Constraints.fixed(interpolatedFrame.width(), interpolatedFrame.height())
                 )
-            frameCache2[measurable.anyOrNullId] = interpolatedFrame
+            frameCache[measurable] = interpolatedFrame
         }
 
         if (layoutInformationReceiver?.getLayoutInformationMode() == LayoutInfoFlags.BOUNDS) {
@@ -542,7 +539,7 @@
 
     fun clearConstraintSets() {
         transition.clear()
-        frameCache2.clear()
+        frameCache.clear()
     }
 
     @Suppress("UnavailableSymbol")
diff --git a/constraintlayout/constraintlayout-core/src/main/java/androidx/constraintlayout/core/ArrayLinkedVariables.java b/constraintlayout/constraintlayout-core/src/main/java/androidx/constraintlayout/core/ArrayLinkedVariables.java
index 3575eb4..fef3c9c 100644
--- a/constraintlayout/constraintlayout-core/src/main/java/androidx/constraintlayout/core/ArrayLinkedVariables.java
+++ b/constraintlayout/constraintlayout-core/src/main/java/androidx/constraintlayout/core/ArrayLinkedVariables.java
@@ -230,8 +230,10 @@
      * The code is broadly identical to the put() method, only differing
      * in in-line deletion, and of course doing an add rather than a put
      *
-     * @param variable the variable we want to add
-     * @param value    its value
+     * @param variable             the variable we want to add
+     * @param value                its value
+     * @param removeFromDefinition if a variable's value becomes zero, it is removed. This parameter
+     *                             is whether the removal is deep now or left shallow until cleanup
      */
     @Override
     public void add(SolverVariable variable, float value, boolean removeFromDefinition) {
@@ -355,7 +357,9 @@
     /**
      * Update the current list with a new definition
      *
-     * @param definition the row containing the definition
+     * @param definition           the row containing the definition
+     * @param removeFromDefinition if a variable's value becomes zero, it is removed. This parameter
+     *                             is whether the removal is deep now or left shallow until cleanup
      */
     @Override
     public float use(ArrayRow definition, boolean removeFromDefinition) {
@@ -374,7 +378,9 @@
     /**
      * Remove a variable from the list
      *
-     * @param variable the variable we want to remove
+     * @param variable             the variable we want to remove
+     * @param removeFromDefinition if a variable's value becomes zero, it is removed. This parameter
+     *                             is whether the removal is deep now or left shallow until cleanup
      * @return the value of the removed variable
      */
     @Override
diff --git a/constraintlayout/constraintlayout-core/src/main/java/androidx/constraintlayout/core/LinearSystem.java b/constraintlayout/constraintlayout-core/src/main/java/androidx/constraintlayout/core/LinearSystem.java
index 5706151..e4e1c7af 100644
--- a/constraintlayout/constraintlayout-core/src/main/java/androidx/constraintlayout/core/LinearSystem.java
+++ b/constraintlayout/constraintlayout-core/src/main/java/androidx/constraintlayout/core/LinearSystem.java
@@ -1509,6 +1509,8 @@
      * Add the equations constraining a widget center to another widget center, positioned
      * on a circle, following an angle and radius
      *
+     * @param widget the constrained widget
+     * @param target the constrained-to widget
      * @param angle  from 0 to 360
      * @param radius the distance between the two centers
      */
diff --git a/constraintlayout/constraintlayout-core/src/main/java/androidx/constraintlayout/core/motion/Motion.java b/constraintlayout/constraintlayout-core/src/main/java/androidx/constraintlayout/core/motion/Motion.java
index f2dc0ee..ba98915 100644
--- a/constraintlayout/constraintlayout-core/src/main/java/androidx/constraintlayout/core/motion/Motion.java
+++ b/constraintlayout/constraintlayout-core/src/main/java/androidx/constraintlayout/core/motion/Motion.java
@@ -280,7 +280,8 @@
      * x coordinate of "time" 0.0 mPoints[point.length-1] is filled with the y coordinate of "time"
      * 1.0
      *
-     * @param points array to fill (should be 2x the number of mPoints
+     * @param points     array to fill (should be 2x pointCount)
+     * @param pointCount truncate mPoints to this length. Must be > 1 and <= mPoints.length
      */
     public void buildPath(float[] points, int pointCount) {
         float mils = 1.0f / (pointCount - 1);
@@ -1646,6 +1647,7 @@
      * ...
      * length
      *
+     * @param type if type is -1, skip all keyframes with type != -1
      * @param info is a data structure array of int that holds info on each keyframe
      * @return Number of keyFrames found
      */
diff --git a/constraintlayout/constraintlayout-core/src/main/java/androidx/constraintlayout/core/motion/utils/KeyCycleOscillator.java b/constraintlayout/constraintlayout-core/src/main/java/androidx/constraintlayout/core/motion/utils/KeyCycleOscillator.java
index 943b41d..b3c5443 100644
--- a/constraintlayout/constraintlayout-core/src/main/java/androidx/constraintlayout/core/motion/utils/KeyCycleOscillator.java
+++ b/constraintlayout/constraintlayout-core/src/main/java/androidx/constraintlayout/core/motion/utils/KeyCycleOscillator.java
@@ -139,9 +139,12 @@
      * sets a oscillator wave point
      *
      * @param framePosition the position
+     * @param shape         the wave shape
+     * @param waveString    the wave string
      * @param variesBy      only varies by path supported for now
      * @param period        the period of the wave
      * @param offset        the offset value
+     * @param phase         the phase of the new wavepoint
      * @param value         the adder
      * @param custom        The ConstraintAttribute used to set the value
      */
@@ -167,9 +170,12 @@
      * sets a oscillator wave point
      *
      * @param framePosition the position
+     * @param shape         the wave shape
+     * @param waveString    the wave string
      * @param variesBy      only varies by path supported for now
      * @param period        the period of the wave
      * @param offset        the offset value
+     * @param phase         the phase of the new wavepoint
      * @param value         the adder
      */
     public void setPoint(int framePosition,
diff --git a/constraintlayout/constraintlayout-core/src/main/java/androidx/constraintlayout/core/state/CoreMotionScene.java b/constraintlayout/constraintlayout-core/src/main/java/androidx/constraintlayout/core/state/CoreMotionScene.java
index 5b7d71d..76b5128 100644
--- a/constraintlayout/constraintlayout-core/src/main/java/androidx/constraintlayout/core/state/CoreMotionScene.java
+++ b/constraintlayout/constraintlayout-core/src/main/java/androidx/constraintlayout/core/state/CoreMotionScene.java
@@ -25,6 +25,7 @@
      * set the Transitions string onto the MotionScene
      *
      * @param elementName the name of the element
+     * @param toJSON the json string of the transitioncontent
      */
     void setTransitionContent(String elementName, String toJSON);
 
diff --git a/constraintlayout/constraintlayout-core/src/main/java/androidx/constraintlayout/core/state/Transition.java b/constraintlayout/constraintlayout-core/src/main/java/androidx/constraintlayout/core/state/Transition.java
index 98dbf1f..cf66b93 100644
--- a/constraintlayout/constraintlayout-core/src/main/java/androidx/constraintlayout/core/state/Transition.java
+++ b/constraintlayout/constraintlayout-core/src/main/java/androidx/constraintlayout/core/state/Transition.java
@@ -432,10 +432,11 @@
      * Converts from xy drag to progress
      * This should be used till touch up
      *
-     * @param baseW parent width
-     * @param baseH parent height
-     * @param dx    change in x
-     * @param dy    change in y
+     * @param currentProgress 0...1 progress in
+     * @param baseW           parent width
+     * @param baseH           parent height
+     * @param dx              change in x
+     * @param dy              change in y
      * @return the change in progress
      */
     public float dragToProgress(float currentProgress, int baseW, int baseH, float dx, float dy) {
diff --git a/constraintlayout/constraintlayout-core/src/main/java/androidx/constraintlayout/core/widgets/Chain.java b/constraintlayout/constraintlayout-core/src/main/java/androidx/constraintlayout/core/widgets/Chain.java
index e06973f..a60a9d3 100644
--- a/constraintlayout/constraintlayout-core/src/main/java/androidx/constraintlayout/core/widgets/Chain.java
+++ b/constraintlayout/constraintlayout-core/src/main/java/androidx/constraintlayout/core/widgets/Chain.java
@@ -41,6 +41,8 @@
      *
      * @param constraintWidgetContainer root container
      * @param system                    the linear system we add the equations to
+     * @param widgets                   if this is null or contains any chainheads' widgets,
+     *                                  constrain all chains / the corresponding chains
      * @param orientation               HORIZONTAL or VERTICAL
      */
     public static void applyChainConstraints(
diff --git a/constraintlayout/constraintlayout-core/src/main/java/androidx/constraintlayout/core/widgets/ConstraintWidgetContainer.java b/constraintlayout/constraintlayout-core/src/main/java/androidx/constraintlayout/core/widgets/ConstraintWidgetContainer.java
index 6644ed9d..af42a35 100644
--- a/constraintlayout/constraintlayout-core/src/main/java/androidx/constraintlayout/core/widgets/ConstraintWidgetContainer.java
+++ b/constraintlayout/constraintlayout-core/src/main/java/androidx/constraintlayout/core/widgets/ConstraintWidgetContainer.java
@@ -451,6 +451,7 @@
      * Update the frame of the layout and its children from the solver
      *
      * @param system the solver we get the values from.
+     * @param flags  the flag set associated with this solver
      */
     public boolean updateChildrenFromSolver(LinearSystem system, boolean[] flags) {
         flags[Optimizer.FLAG_RECOMPUTE_BOUNDS] = false;
diff --git a/constraintlayout/constraintlayout/src/main/java/androidx/constraintlayout/motion/widget/DesignTool.java b/constraintlayout/constraintlayout/src/main/java/androidx/constraintlayout/motion/widget/DesignTool.java
index ef67572..8f96e8f 100644
--- a/constraintlayout/constraintlayout/src/main/java/androidx/constraintlayout/motion/widget/DesignTool.java
+++ b/constraintlayout/constraintlayout/src/main/java/androidx/constraintlayout/motion/widget/DesignTool.java
@@ -184,6 +184,7 @@
      *
      * @param view view to getMap the animation of
      * @param path array to be filled (x1,y1,x2,y2...)
+     * @param len  the desired number of point along animation
      * @return -1 if not under and animation 0 if not animated or number of point along animation
      */
     public int getAnimationPath(Object view, float[] path, int len) {
@@ -446,7 +447,8 @@
      * The call is designed to be efficient because it will be called 30x Number of views a second
      *
      * @param view the view to return keyframe positions
-     * @param info
+     * @param type if type is -1, skip all keyframes with type != -1
+     * @param info array to fill with info on each keyframe
      * @return Number of keyFrames found
      */
     public int getKeyFrameInfo(Object view, int type, int[] info) {
diff --git a/constraintlayout/constraintlayout/src/main/java/androidx/constraintlayout/motion/widget/MotionController.java b/constraintlayout/constraintlayout/src/main/java/androidx/constraintlayout/motion/widget/MotionController.java
index 4dc61c2..a1cdd45 100644
--- a/constraintlayout/constraintlayout/src/main/java/androidx/constraintlayout/motion/widget/MotionController.java
+++ b/constraintlayout/constraintlayout/src/main/java/androidx/constraintlayout/motion/widget/MotionController.java
@@ -1675,6 +1675,7 @@
      * ...
      * length
      *
+     * @param type if type is -1, skip all keyframes with type != -1
      * @param info is a data structure array of int that holds info on each keyframe
      * @return Number of keyFrames found
      */
diff --git a/constraintlayout/constraintlayout/src/main/java/androidx/constraintlayout/widget/ConstraintSet.java b/constraintlayout/constraintlayout/src/main/java/androidx/constraintlayout/widget/ConstraintSet.java
index f633da5a..b45ca83 100644
--- a/constraintlayout/constraintlayout/src/main/java/androidx/constraintlayout/widget/ConstraintSet.java
+++ b/constraintlayout/constraintlayout/src/main/java/androidx/constraintlayout/widget/ConstraintSet.java
@@ -3659,7 +3659,8 @@
      * Elevation logic is based on style and animation. By default it is not used because it would
      * lead to unexpected results.
      *
-     * @param apply true if this constraint set applies elevation to this view
+     * @param viewId ID of view to adjust the elevation
+     * @param apply  true if this constraint set applies elevation to this view
      */
     public void setApplyElevation(int viewId, boolean apply) {
         if (Build.VERSION.SDK_INT >= VERSION_CODES.LOLLIPOP) {
@@ -4200,9 +4201,10 @@
     /**
      * Creates a ConstraintLayout Barrier object.
      *
-     * @param id
+     * @param id         the id of the constraint to create or partially overwrite.
      * @param direction  Barrier.{LEFT,RIGHT,TOP,BOTTOM,START,END}
-     * @param referenced
+     * @param margin     the barrierMargin of the Barrier object
+     * @param referenced the referenceIds of the Barrier object
      */
     public void createBarrier(int id, int direction, int margin, int... referenced) {
         Constraint constraint = get(id);
diff --git a/health/connect/connect-client/src/main/java/androidx/health/connect/client/records/BloodPressureRecord.kt b/health/connect/connect-client/src/main/java/androidx/health/connect/client/records/BloodPressureRecord.kt
index 38cb5b4..d2923d4 100644
--- a/health/connect/connect-client/src/main/java/androidx/health/connect/client/records/BloodPressureRecord.kt
+++ b/health/connect/connect-client/src/main/java/androidx/health/connect/client/records/BloodPressureRecord.kt
@@ -15,9 +15,11 @@
  */
 package androidx.health.connect.client.records
 
+import android.os.Build
 import androidx.annotation.IntDef
 import androidx.annotation.RestrictTo
 import androidx.health.connect.client.aggregate.AggregateMetric
+import androidx.health.connect.client.impl.platform.records.toPlatformRecord
 import androidx.health.connect.client.records.BloodPressureRecord.MeasurementLocation
 import androidx.health.connect.client.records.metadata.Metadata
 import androidx.health.connect.client.units.Pressure
@@ -60,11 +62,19 @@
     override val metadata: Metadata = Metadata.EMPTY,
 ) : InstantaneousRecord {
 
+    /*
+     * Android U devices and later use the platform's validation instead of Jetpack validation.
+     * See b/316852544 for more context.
+     */
     init {
-        systolic.requireNotLess(other = MIN_SYSTOLIC, name = "systolic")
-        systolic.requireNotMore(other = MAX_SYSTOLIC, name = "systolic")
-        diastolic.requireNotLess(other = MIN_DIASTOLIC, name = "diastolic")
-        diastolic.requireNotMore(other = MAX_DIASTOLIC, name = "diastolic")
+        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) {
+            this.toPlatformRecord()
+        } else {
+            systolic.requireNotLess(other = MIN_SYSTOLIC, name = "systolic")
+            systolic.requireNotMore(other = MAX_SYSTOLIC, name = "systolic")
+            diastolic.requireNotLess(other = MIN_DIASTOLIC, name = "diastolic")
+            diastolic.requireNotMore(other = MAX_DIASTOLIC, name = "diastolic")
+        }
     }
 
     /*
diff --git a/health/connect/connect-client/src/test/java/androidx/health/connect/client/records/BloodPressureRecordTest.kt b/health/connect/connect-client/src/test/java/androidx/health/connect/client/records/BloodPressureRecordTest.kt
index 4dc9b41..1e1144e 100644
--- a/health/connect/connect-client/src/test/java/androidx/health/connect/client/records/BloodPressureRecordTest.kt
+++ b/health/connect/connect-client/src/test/java/androidx/health/connect/client/records/BloodPressureRecordTest.kt
@@ -18,14 +18,104 @@
 
 import androidx.health.connect.client.records.metadata.Metadata
 import androidx.health.connect.client.units.Pressure
+import androidx.health.connect.client.units.millimetersOfMercury
 import androidx.test.ext.junit.runners.AndroidJUnit4
 import com.google.common.truth.Truth.assertThat
 import java.time.Instant
+import org.junit.Assert.assertThrows
 import org.junit.Test
 import org.junit.runner.RunWith
+import org.robolectric.annotation.Config
 
 @RunWith(AndroidJUnit4::class)
 class BloodPressureRecordTest {
+
+    @Config(minSdk = 34)
+    @Test
+    fun constructor_paramsValidatedUsingPlatformValidation_createsBloodPressureRecord() {
+        assertThat(
+                BloodPressureRecord(
+                    time = Instant.ofEpochMilli(1234L),
+                    zoneOffset = null,
+                    systolic = 120.millimetersOfMercury,
+                    diastolic = 112.millimetersOfMercury,
+                    bodyPosition = BloodPressureRecord.BODY_POSITION_RECLINING,
+                    measurementLocation = BloodPressureRecord.MEASUREMENT_LOCATION_LEFT_WRIST,
+                    metadata = Metadata.EMPTY,
+                )
+            )
+            .isEqualTo(
+                BloodPressureRecord(
+                    time = Instant.ofEpochMilli(1234L),
+                    zoneOffset = null,
+                    systolic = 120.millimetersOfMercury,
+                    diastolic = 112.millimetersOfMercury,
+                    bodyPosition = BloodPressureRecord.BODY_POSITION_RECLINING,
+                    measurementLocation = BloodPressureRecord.MEASUREMENT_LOCATION_LEFT_WRIST,
+                    metadata = Metadata.EMPTY,
+                )
+            )
+    }
+
+    @Config(minSdk = 34)
+    @Test
+    fun constructor_paramsInvalidSystolicAndDiastolicValues_platformValidationFailsWithAnException() {
+        assertThrows(IllegalArgumentException::class.java) {
+            BloodPressureRecord(
+                time = Instant.ofEpochMilli(1234L),
+                zoneOffset = null,
+                systolic = 10.millimetersOfMercury,
+                diastolic = 500.millimetersOfMercury,
+                bodyPosition = BloodPressureRecord.BODY_POSITION_RECLINING,
+                measurementLocation = BloodPressureRecord.MEASUREMENT_LOCATION_LEFT_WRIST,
+                metadata = Metadata.EMPTY,
+            )
+        }
+    }
+
+    @Config(maxSdk = 33)
+    @Test
+    fun constructor_paramsValidatedUsingAPKValidation_createsBloodPressureRecord() {
+        assertThat(
+                BloodPressureRecord(
+                    time = Instant.ofEpochMilli(1234L),
+                    zoneOffset = null,
+                    systolic = 120.millimetersOfMercury,
+                    diastolic = 112.millimetersOfMercury,
+                    bodyPosition = BloodPressureRecord.BODY_POSITION_RECLINING,
+                    measurementLocation = BloodPressureRecord.MEASUREMENT_LOCATION_LEFT_WRIST,
+                    metadata = Metadata.EMPTY,
+                )
+            )
+            .isEqualTo(
+                BloodPressureRecord(
+                    time = Instant.ofEpochMilli(1234L),
+                    zoneOffset = null,
+                    systolic = 120.millimetersOfMercury,
+                    diastolic = 112.millimetersOfMercury,
+                    bodyPosition = BloodPressureRecord.BODY_POSITION_RECLINING,
+                    measurementLocation = BloodPressureRecord.MEASUREMENT_LOCATION_LEFT_WRIST,
+                    metadata = Metadata.EMPTY,
+                )
+            )
+    }
+
+    @Config(maxSdk = 33)
+    @Test
+    fun constructor_paramsInvalidSystolicAndDiastolicValues_apkValidationFailsWithAnException() {
+        assertThrows(IllegalArgumentException::class.java) {
+            BloodPressureRecord(
+                time = Instant.ofEpochMilli(1234L),
+                zoneOffset = null,
+                systolic = 10.millimetersOfMercury,
+                diastolic = 200.millimetersOfMercury,
+                bodyPosition = BloodPressureRecord.BODY_POSITION_RECLINING,
+                measurementLocation = BloodPressureRecord.MEASUREMENT_LOCATION_LEFT_WRIST,
+                metadata = Metadata.EMPTY,
+            )
+        }
+    }
+
     @Test
     fun bodyPositionEnums_existInMapping() {
         val allEnums = getAllIntDefEnums<BloodPressureRecord>("""BODY_POSITION.*(?<!UNKNOWN)$""")
diff --git a/libraryversions.toml b/libraryversions.toml
index 11546e0..59c4949 100644
--- a/libraryversions.toml
+++ b/libraryversions.toml
@@ -19,7 +19,7 @@
 CAMERA_TESTING = "1.0.0-alpha01"
 CAMERA_VIEWFINDER = "1.4.0-alpha12"
 CARDVIEW = "1.1.0-alpha01"
-CAR_APP = "1.7.0-rc01"
+CAR_APP = "1.8.0-alpha01"
 COLLECTION = "1.5.0-beta02"
 COMPOSE = "1.8.0-alpha08"
 COMPOSE_MATERIAL3 = "1.4.0-alpha06"
@@ -64,7 +64,7 @@
 EMOJI = "1.2.0-alpha03"
 EMOJI2 = "1.5.0-rc01"
 ENTERPRISE = "1.1.0-rc01"
-EXIFINTERFACE = "1.4.0-beta01"
+EXIFINTERFACE = "1.4.0-rc01"
 FRAGMENT = "1.9.0-alpha01"
 FUTURES = "1.3.0-alpha01"
 GLANCE = "1.2.0-alpha01"
@@ -168,10 +168,10 @@
 WEAR_INPUT = "1.2.0-alpha03"
 WEAR_INPUT_TESTING = "1.2.0-alpha03"
 WEAR_ONGOING = "1.1.0-alpha02"
-WEAR_PHONE_INTERACTIONS = "1.1.0-alpha05"
-WEAR_PROTOLAYOUT = "1.3.0-alpha06"
+WEAR_PHONE_INTERACTIONS = "1.1.0-beta01"
+WEAR_PROTOLAYOUT = "1.3.0-alpha07"
 WEAR_REMOTE_INTERACTIONS = "1.1.0-rc01"
-WEAR_TILES = "1.5.0-alpha06"
+WEAR_TILES = "1.5.0-alpha07"
 WEAR_TOOLING_PREVIEW = "1.0.0-rc01"
 WEAR_WATCHFACE = "1.3.0-alpha05"
 WEBKIT = "1.13.0-alpha03"
diff --git a/lifecycle/lifecycle-viewmodel-navigation3/api/current.txt b/lifecycle/lifecycle-viewmodel-navigation3/api/current.txt
index b6bdb70..927612c 100644
--- a/lifecycle/lifecycle-viewmodel-navigation3/api/current.txt
+++ b/lifecycle/lifecycle-viewmodel-navigation3/api/current.txt
@@ -1,10 +1,10 @@
 // Signature format: 4.0
 package androidx.lifecycle.viewmodel.navigation3 {
 
-  public final class ViewModelStoreNavContentWrapper implements androidx.navigation3.NavContentWrapper {
-    method @androidx.compose.runtime.Composable public void WrapBackStack(java.util.List<?> backStack);
-    method @androidx.compose.runtime.Composable public <T> void WrapContent(androidx.navigation3.NavRecord<T> record);
-    field public static final androidx.lifecycle.viewmodel.navigation3.ViewModelStoreNavContentWrapper INSTANCE;
+  public final class ViewModelStoreNavLocalProvider implements androidx.navigation3.NavLocalProvider {
+    method @androidx.compose.runtime.Composable public void ProvideToBackStack(java.util.List<?> backStack);
+    method @androidx.compose.runtime.Composable public <T> void ProvideToEntry(androidx.navigation3.NavEntry<T> entry);
+    field public static final androidx.lifecycle.viewmodel.navigation3.ViewModelStoreNavLocalProvider INSTANCE;
   }
 
 }
diff --git a/lifecycle/lifecycle-viewmodel-navigation3/api/restricted_current.txt b/lifecycle/lifecycle-viewmodel-navigation3/api/restricted_current.txt
index b6bdb70..927612c 100644
--- a/lifecycle/lifecycle-viewmodel-navigation3/api/restricted_current.txt
+++ b/lifecycle/lifecycle-viewmodel-navigation3/api/restricted_current.txt
@@ -1,10 +1,10 @@
 // Signature format: 4.0
 package androidx.lifecycle.viewmodel.navigation3 {
 
-  public final class ViewModelStoreNavContentWrapper implements androidx.navigation3.NavContentWrapper {
-    method @androidx.compose.runtime.Composable public void WrapBackStack(java.util.List<?> backStack);
-    method @androidx.compose.runtime.Composable public <T> void WrapContent(androidx.navigation3.NavRecord<T> record);
-    field public static final androidx.lifecycle.viewmodel.navigation3.ViewModelStoreNavContentWrapper INSTANCE;
+  public final class ViewModelStoreNavLocalProvider implements androidx.navigation3.NavLocalProvider {
+    method @androidx.compose.runtime.Composable public void ProvideToBackStack(java.util.List<?> backStack);
+    method @androidx.compose.runtime.Composable public <T> void ProvideToEntry(androidx.navigation3.NavEntry<T> entry);
+    field public static final androidx.lifecycle.viewmodel.navigation3.ViewModelStoreNavLocalProvider INSTANCE;
   }
 
 }
diff --git a/lifecycle/lifecycle-viewmodel-navigation3/src/androidInstrumentedTest/kotlin/androidx/lifecycle/viewmodel/navigation3/ViewModelStoreNavContentWrapperTest.kt b/lifecycle/lifecycle-viewmodel-navigation3/src/androidInstrumentedTest/kotlin/androidx/lifecycle/viewmodel/navigation3/ViewModelStoreNavContentWrapperTest.kt
index f0efd6c..f59f4fa 100644
--- a/lifecycle/lifecycle-viewmodel-navigation3/src/androidInstrumentedTest/kotlin/androidx/lifecycle/viewmodel/navigation3/ViewModelStoreNavContentWrapperTest.kt
+++ b/lifecycle/lifecycle-viewmodel-navigation3/src/androidInstrumentedTest/kotlin/androidx/lifecycle/viewmodel/navigation3/ViewModelStoreNavContentWrapperTest.kt
@@ -26,9 +26,8 @@
 import androidx.lifecycle.createSavedStateHandle
 import androidx.lifecycle.viewmodel.compose.viewModel
 import androidx.navigation3.NavDisplay
-import androidx.navigation3.NavRecord
-import androidx.navigation3.SavedStateNavContentWrapper
-import androidx.navigation3.rememberNavWrapperManager
+import androidx.navigation3.NavEntry
+import androidx.navigation3.SavedStateNavLocalProvider
 import androidx.test.ext.junit.runners.AndroidJUnit4
 import androidx.test.filters.LargeTest
 import kotlin.test.Test
@@ -37,65 +36,65 @@
 
 @LargeTest
 @RunWith(AndroidJUnit4::class)
-class ViewModelStoreNavContentWrapperTest {
+class ViewModelStoreNavLocalProviderTest {
     @get:Rule val composeTestRule = createComposeRule()
 
     @Test
     fun testViewModelProvided() {
-        val savedStateWrapper = SavedStateNavContentWrapper
-        val viewModelWrapper = ViewModelStoreNavContentWrapper
+        val savedStateWrapper = SavedStateNavLocalProvider
+        val viewModelWrapper = ViewModelStoreNavLocalProvider
         lateinit var viewModel1: MyViewModel
         lateinit var viewModel2: MyViewModel
-        val record1Arg = "record1 Arg"
-        val record2Arg = "record2 Arg"
-        val record1 =
-            NavRecord("key1") {
+        val entry1Arg = "entry1 Arg"
+        val entry2Arg = "entry2 Arg"
+        val entry1 =
+            NavEntry("key1") {
                 viewModel1 = viewModel<MyViewModel>()
-                viewModel1.myArg = record1Arg
+                viewModel1.myArg = entry1Arg
             }
-        val record2 =
-            NavRecord("key2") {
+        val entry2 =
+            NavEntry("key2") {
                 viewModel2 = viewModel<MyViewModel>()
-                viewModel2.myArg = record2Arg
+                viewModel2.myArg = entry2Arg
             }
         composeTestRule.setContent {
-            savedStateWrapper.WrapContent(
-                NavRecord(record1.key) { viewModelWrapper.WrapContent(record1) }
+            savedStateWrapper.ProvideToEntry(
+                NavEntry(entry1.key) { viewModelWrapper.ProvideToEntry(entry1) }
             )
-            savedStateWrapper.WrapContent(
-                NavRecord(record2.key) { viewModelWrapper.WrapContent(record2) }
+            savedStateWrapper.ProvideToEntry(
+                NavEntry(entry2.key) { viewModelWrapper.ProvideToEntry(entry2) }
             )
         }
 
         composeTestRule.runOnIdle {
-            assertWithMessage("Incorrect arg for record 1")
+            assertWithMessage("Incorrect arg for entry 1")
                 .that(viewModel1.myArg)
-                .isEqualTo(record1Arg)
-            assertWithMessage("Incorrect arg for record 2")
+                .isEqualTo(entry1Arg)
+            assertWithMessage("Incorrect arg for entry 2")
                 .that(viewModel2.myArg)
-                .isEqualTo(record2Arg)
+                .isEqualTo(entry2Arg)
         }
     }
 
     @Test
-    fun testViewModelNoSavedStateNavContentWrapper() {
-        val viewModelWrapper = ViewModelStoreNavContentWrapper
+    fun testViewModelNoSavedStateNavLocalProvider() {
+        val viewModelWrapper = ViewModelStoreNavLocalProvider
         lateinit var viewModel1: MyViewModel
-        val record1Arg = "record1 Arg"
-        val record1 =
-            NavRecord("key1") {
+        val entry1Arg = "entry1 Arg"
+        val entry1 =
+            NavEntry("key1") {
                 viewModel1 = viewModel<MyViewModel>()
-                viewModel1.myArg = record1Arg
+                viewModel1.myArg = entry1Arg
             }
         try {
-            composeTestRule.setContent { viewModelWrapper.WrapContent(record1) }
+            composeTestRule.setContent { viewModelWrapper.ProvideToEntry(entry1) }
         } catch (e: Exception) {
             assertThat(e)
                 .hasMessageThat()
                 .isEqualTo(
                     "The Lifecycle state is already beyond INITIALIZED. The " +
-                        "ViewModelStoreNavContentWrapper requires adding the " +
-                        "SavedStateNavContentWrapper to ensure support for " +
+                        "ViewModelStoreNavLocalProvider requires adding the " +
+                        "SavedStateNavLocalProvider to ensure support for " +
                         "SavedStateHandles."
                 )
         }
@@ -106,21 +105,17 @@
         lateinit var backStack: MutableList<Any>
         composeTestRule.setContent {
             backStack = remember { mutableStateListOf("Home") }
-            val manager =
-                rememberNavWrapperManager(
-                    listOf(SavedStateNavContentWrapper, ViewModelStoreNavContentWrapper)
-                )
             NavDisplay(
                 backstack = backStack,
-                wrapperManager = manager,
+                localProviders = listOf(SavedStateNavLocalProvider, ViewModelStoreNavLocalProvider),
                 onBack = { backStack.removeAt(backStack.lastIndex) },
             ) { key ->
                 when (key) {
                     "Home" -> {
-                        NavRecord(key) { viewModel<HomeViewModel>() }
+                        NavEntry(key) { viewModel<HomeViewModel>() }
                     }
                     "AnotherScreen" -> {
-                        NavRecord(key) { viewModel<HomeViewModel>() }
+                        NavEntry(key) { viewModel<HomeViewModel>() }
                     }
                     else -> error("Unknown key: $key")
                 }
@@ -160,18 +155,14 @@
         lateinit var viewModel: SavedStateViewModel
         composeTestRule.setContent {
             backStack = remember { mutableStateListOf("Home") }
-            val manager =
-                rememberNavWrapperManager(
-                    listOf(SavedStateNavContentWrapper, ViewModelStoreNavContentWrapper)
-                )
             NavDisplay(
                 backstack = backStack,
-                wrapperManager = manager,
+                localProviders = listOf(SavedStateNavLocalProvider, ViewModelStoreNavLocalProvider),
                 onBack = { backStack.removeAt(backStack.lastIndex) },
             ) { key ->
                 when (key) {
                     "Home" -> {
-                        NavRecord(key) {
+                        NavEntry(key) {
                             viewModel =
                                 viewModel<SavedStateViewModel> {
                                     val handle = createSavedStateHandle()
diff --git a/lifecycle/lifecycle-viewmodel-navigation3/src/androidMain/kotlin/androidx/lifecycle/viewmodel/navigation3/ViewModelStoreNavContentWrapper.android.kt b/lifecycle/lifecycle-viewmodel-navigation3/src/androidMain/kotlin/androidx/lifecycle/viewmodel/navigation3/ViewModelStoreNavContentWrapper.android.kt
index 79402711..37b32ac 100644
--- a/lifecycle/lifecycle-viewmodel-navigation3/src/androidMain/kotlin/androidx/lifecycle/viewmodel/navigation3/ViewModelStoreNavContentWrapper.android.kt
+++ b/lifecycle/lifecycle-viewmodel-navigation3/src/androidMain/kotlin/androidx/lifecycle/viewmodel/navigation3/ViewModelStoreNavContentWrapper.android.kt
@@ -35,44 +35,44 @@
 import androidx.lifecycle.viewmodel.MutableCreationExtras
 import androidx.lifecycle.viewmodel.compose.LocalViewModelStoreOwner
 import androidx.lifecycle.viewmodel.compose.viewModel
-import androidx.navigation3.NavContentWrapper
-import androidx.navigation3.NavRecord
+import androidx.navigation3.NavEntry
+import androidx.navigation3.NavLocalProvider
 import androidx.savedstate.SavedStateRegistryOwner
 import androidx.savedstate.compose.LocalSavedStateRegistryOwner
 
 /**
- * Provides the content of a [NavRecord] with a [ViewModelStoreOwner] and provides that
+ * Provides the content of a [NavEntry] with a [ViewModelStoreOwner] and provides that
  * [ViewModelStoreOwner] as a [LocalViewModelStoreOwner] so that it is available within the content.
  *
- * This requires that usage of the [SavedStateNavContentWrapper] to ensure that the [NavRecord]
- * scoped [ViewModel]s can properly provide access to [SavedStateHandle]s
+ * This requires that usage of the [SavedStateNavLocalProvider] to ensure that the [NavEntry] scoped
+ * [ViewModel]s can properly provide access to [SavedStateHandle]s
  */
-public object ViewModelStoreNavContentWrapper : NavContentWrapper {
+public object ViewModelStoreNavLocalProvider : NavLocalProvider {
 
     @Composable
-    override fun WrapBackStack(backStack: List<Any>) {
-        val recordViewModelStoreProvider = viewModel { RecordViewModel() }
-        recordViewModelStoreProvider.ownerInBackStack.clear()
-        recordViewModelStoreProvider.ownerInBackStack.addAll(backStack)
+    override fun ProvideToBackStack(backStack: List<Any>) {
+        val entryViewModelStoreProvider = viewModel { EntryViewModel() }
+        entryViewModelStoreProvider.ownerInBackStack.clear()
+        entryViewModelStoreProvider.ownerInBackStack.addAll(backStack)
     }
 
     @Composable
-    override fun <T : Any> WrapContent(record: NavRecord<T>) {
-        val key = record.key
-        val recordViewModelStoreProvider = viewModel { RecordViewModel() }
-        val viewModelStore = recordViewModelStoreProvider.viewModelStoreForKey(key)
+    override fun <T : Any> ProvideToEntry(entry: NavEntry<T>) {
+        val key = entry.key
+        val entryViewModelStoreProvider = viewModel { EntryViewModel() }
+        val viewModelStore = entryViewModelStoreProvider.viewModelStoreForKey(key)
         // This ensures we always keep viewModels on config changes.
         val activity = LocalActivity.current
         remember(key, viewModelStore) {
             object : RememberObserver {
                 override fun onAbandoned() {
-                    if (!recordViewModelStoreProvider.ownerInBackStack.contains(key)) {
+                    if (!entryViewModelStoreProvider.ownerInBackStack.contains(key)) {
                         disposeIfNotChangingConfiguration()
                     }
                 }
 
                 override fun onForgotten() {
-                    if (!recordViewModelStoreProvider.ownerInBackStack.contains(key)) {
+                    if (!entryViewModelStoreProvider.ownerInBackStack.contains(key)) {
                         disposeIfNotChangingConfiguration()
                     }
                 }
@@ -81,7 +81,7 @@
 
                 fun disposeIfNotChangingConfiguration() {
                     if (activity?.isChangingConfigurations != true) {
-                        recordViewModelStoreProvider.removeViewModelStoreOwnerForKey(key)?.clear()
+                        entryViewModelStoreProvider.removeViewModelStoreOwnerForKey(key)?.clear()
                     }
                 }
             }
@@ -110,20 +110,20 @@
                     init {
                         require(this.lifecycle.currentState == Lifecycle.State.INITIALIZED) {
                             "The Lifecycle state is already beyond INITIALIZED. The " +
-                                "ViewModelStoreNavContentWrapper requires adding the " +
-                                "SavedStateNavContentWrapper to ensure support for " +
+                                "ViewModelStoreNavLocalProvider requires adding the " +
+                                "SavedStateNavLocalProvider to ensure support for " +
                                 "SavedStateHandles."
                         }
                         enableSavedStateHandles()
                     }
                 }
         ) {
-            record.content.invoke(key)
+            entry.content.invoke(key)
         }
     }
 }
 
-private class RecordViewModel : ViewModel() {
+private class EntryViewModel : ViewModel() {
     private val owners = mutableMapOf<Any, ViewModelStore>()
     val ownerInBackStack = mutableListOf<Any>()
 
diff --git a/mediarouter/mediarouter/api/current.txt b/mediarouter/mediarouter/api/current.txt
index 8b9f3d9..644df6d 100644
--- a/mediarouter/mediarouter/api/current.txt
+++ b/mediarouter/mediarouter/api/current.txt
@@ -406,7 +406,7 @@
     field public static final int CALLBACK_FLAG_PERFORM_ACTIVE_SCAN = 1; // 0x1
     field public static final int CALLBACK_FLAG_REQUEST_DISCOVERY = 4; // 0x4
     field public static final int CALLBACK_FLAG_UNFILTERED_EVENTS = 2; // 0x2
-    field public static final int REASON_DISCONNECTED = 1; // 0x1
+    field public static final int REASON_DISCONNECT_CALLED = 1; // 0x1
     field public static final int REASON_FAILED_TO_CREATE_DYNAMIC_GROUP_ROUTE_CONTROLLER = 6; // 0x6
     field public static final int REASON_REJECTED_FOR_SELECTED_ROUTE = 4; // 0x4
     field public static final int REASON_ROUTE_CONNECTION_TIMEOUT = 7; // 0x7
diff --git a/mediarouter/mediarouter/api/restricted_current.txt b/mediarouter/mediarouter/api/restricted_current.txt
index 8b9f3d9..644df6d 100644
--- a/mediarouter/mediarouter/api/restricted_current.txt
+++ b/mediarouter/mediarouter/api/restricted_current.txt
@@ -406,7 +406,7 @@
     field public static final int CALLBACK_FLAG_PERFORM_ACTIVE_SCAN = 1; // 0x1
     field public static final int CALLBACK_FLAG_REQUEST_DISCOVERY = 4; // 0x4
     field public static final int CALLBACK_FLAG_UNFILTERED_EVENTS = 2; // 0x2
-    field public static final int REASON_DISCONNECTED = 1; // 0x1
+    field public static final int REASON_DISCONNECT_CALLED = 1; // 0x1
     field public static final int REASON_FAILED_TO_CREATE_DYNAMIC_GROUP_ROUTE_CONTROLLER = 6; // 0x6
     field public static final int REASON_REJECTED_FOR_SELECTED_ROUTE = 4; // 0x4
     field public static final int REASON_ROUTE_CONNECTION_TIMEOUT = 7; // 0x7
diff --git a/mediarouter/mediarouter/src/androidTest/java/androidx/mediarouter/media/MediaRouterDynamicProviderTest.java b/mediarouter/mediarouter/src/androidTest/java/androidx/mediarouter/media/MediaRouterDynamicProviderTest.java
index 5722db5..141a97b 100644
--- a/mediarouter/mediarouter/src/androidTest/java/androidx/mediarouter/media/MediaRouterDynamicProviderTest.java
+++ b/mediarouter/mediarouter/src/androidTest/java/androidx/mediarouter/media/MediaRouterDynamicProviderTest.java
@@ -196,7 +196,7 @@
         assertNotNull(mRequestedRoute);
         assertEquals(ROUTE_ID_2, mRequestedRoute.getDescriptorId());
         assertEquals(RouteConnectionState.STATE_DISCONNECTED, mRouteConnectionState);
-        assertEquals(MediaRouter.REASON_DISCONNECTED, mRouteDisconnectedReason);
+        assertEquals(MediaRouter.REASON_DISCONNECT_CALLED, mRouteDisconnectedReason);
     }
 
     @Test()
diff --git a/mediarouter/mediarouter/src/main/java/androidx/mediarouter/media/GlobalMediaRouter.java b/mediarouter/mediarouter/src/main/java/androidx/mediarouter/media/GlobalMediaRouter.java
index c7ea94e..e2e0825 100644
--- a/mediarouter/mediarouter/src/main/java/androidx/mediarouter/media/GlobalMediaRouter.java
+++ b/mediarouter/mediarouter/src/main/java/androidx/mediarouter/media/GlobalMediaRouter.java
@@ -1686,7 +1686,7 @@
         /* package */ void disconnect() {
             mController.onUnselect(UNSELECT_REASON_DISCONNECTED);
             mController.onRelease();
-            notifyRouteDisconnected(MediaRouter.REASON_DISCONNECTED);
+            notifyRouteDisconnected(MediaRouter.REASON_DISCONNECT_CALLED);
         }
 
         @Override
diff --git a/mediarouter/mediarouter/src/main/java/androidx/mediarouter/media/MediaRouter.java b/mediarouter/mediarouter/src/main/java/androidx/mediarouter/media/MediaRouter.java
index af4bd6d..0b481f2 100644
--- a/mediarouter/mediarouter/src/main/java/androidx/mediarouter/media/MediaRouter.java
+++ b/mediarouter/mediarouter/src/main/java/androidx/mediarouter/media/MediaRouter.java
@@ -130,7 +130,7 @@
     public static final int UNSELECT_REASON_ROUTE_CHANGED = 3;
 
     @IntDef({
-        REASON_DISCONNECTED,
+        REASON_DISCONNECT_CALLED,
         REASON_ROUTE_NOT_AVAILABLE,
         REASON_ROUTE_NOT_ENABLED,
         REASON_REJECTED_FOR_SELECTED_ROUTE,
@@ -146,7 +146,7 @@
      *
      * @see Callback#onRouteDisconnected(MediaRouter, RouteInfo, RouteInfo, int)
      */
-    public static final int REASON_DISCONNECTED = 1;
+    public static final int REASON_DISCONNECT_CALLED = 1;
 
     /**
      * The route connection has failed because the requested route is no longer available.
@@ -165,6 +165,9 @@
     /**
      * The route connection has failed because the requested route is a selected route.
      *
+     * <p>If a route is already selected, then calling {@link RouteInfo#connect()} on the selected
+     * route will be rejected and do nothing.
+     *
      * @see Callback#onRouteDisconnected(MediaRouter, RouteInfo, RouteInfo, int)
      */
     public static final int REASON_REJECTED_FOR_SELECTED_ROUTE = 4;
@@ -1615,15 +1618,19 @@
         /**
          * Returns true if this route is currently selected.
          *
+         * <p>Only one representative route can return true. For instance:
+         *
+         * <ul>
+         *   <li>If this route is a selected (non-group) route, it returns true.
+         *   <li>If this route is a selected group route, it returns true.
+         *   <li>If this route is a selected member route of a group, it returns false.
+         * </ul>
+         *
          * <p>Must be called on the main thread.
          *
          * @return True if this route is currently selected.
          * @see MediaRouter#getSelectedRoute
          */
-        // Note: Only one representative route can return true. For instance:
-        //   - If this route is a selected (non-group) route, it returns true.
-        //   - If this route is a selected group route, it returns true.
-        //   - If this route is a selected member route of a group, it returns false.
         @MainThread
         public boolean isSelected() {
             checkCallingThread();
@@ -2062,7 +2069,10 @@
         /**
          * Connects this route without selecting it.
          *
-         * <p>If the route is already selected, connecting this route will do nothing.
+         * <p>Apps can select a route by calling {@link #select()}. If apps want to keep the
+         * selected route unchanged and connect to additional routes, then they can use this method
+         * to connect additional routes. If the route is already selected, connecting this route
+         * will do nothing.
          *
          * <p>Must be called on the main thread.
          */
@@ -2849,7 +2859,8 @@
          * routes while connecting to other routes.
          *
          * <p>The connected route could be different from the route requested by {@link
-         * RouteInfo#connect()}.
+         * RouteInfo#connect()}. This can happen when the {@link MediaTransferReceiver media
+         * transfer feature} is enabled.
          *
          * @param router the media router reporting the event.
          * @param connectedRoute the route that has been connected.
diff --git a/navigation3/navigation3/api/current.txt b/navigation3/navigation3/api/current.txt
index ec7e433..d8d07e0 100644
--- a/navigation3/navigation3/api/current.txt
+++ b/navigation3/navigation3/api/current.txt
@@ -1,9 +1,48 @@
 // Signature format: 4.0
 package androidx.navigation3 {
 
-  public interface NavContentWrapper {
-    method @androidx.compose.runtime.Composable public default void WrapBackStack(java.util.List<?> backStack);
-    method @androidx.compose.runtime.Composable public <T> void WrapContent(androidx.navigation3.NavRecord<T> record);
+  public final class EntryClassProvider<T> {
+    ctor public EntryClassProvider(kotlin.reflect.KClass<T> clazz, java.util.Map<java.lang.String,?> featureMap, kotlin.jvm.functions.Function1<? super T,kotlin.Unit> content);
+    method public kotlin.reflect.KClass<T> component1();
+    method public java.util.Map<java.lang.String,java.lang.Object> component2();
+    method public kotlin.jvm.functions.Function1<T,kotlin.Unit> component3();
+    method public androidx.navigation3.EntryClassProvider<T> copy(kotlin.reflect.KClass<T> clazz, java.util.Map<java.lang.String,?> featureMap, kotlin.jvm.functions.Function1<? super T,kotlin.Unit> content);
+    method public kotlin.reflect.KClass<T> getClazz();
+    method public kotlin.jvm.functions.Function1<T,kotlin.Unit> getContent();
+    method public java.util.Map<java.lang.String,java.lang.Object> getFeatureMap();
+    property public final kotlin.reflect.KClass<T> clazz;
+    property public final kotlin.jvm.functions.Function1<T,kotlin.Unit> content;
+    property public final java.util.Map<java.lang.String,java.lang.Object> featureMap;
+  }
+
+  @kotlin.DslMarker public @interface EntryDsl {
+  }
+
+  public final class EntryProvider<T> {
+    ctor public EntryProvider(T key, java.util.Map<java.lang.String,?> featureMap, kotlin.jvm.functions.Function1<? super T,kotlin.Unit> content);
+    method public T component1();
+    method public java.util.Map<java.lang.String,java.lang.Object> component2();
+    method public kotlin.jvm.functions.Function1<T,kotlin.Unit> component3();
+    method public androidx.navigation3.EntryProvider<T> copy(T key, java.util.Map<java.lang.String,?> featureMap, kotlin.jvm.functions.Function1<? super T,kotlin.Unit> content);
+    method public kotlin.jvm.functions.Function1<T,kotlin.Unit> getContent();
+    method public java.util.Map<java.lang.String,java.lang.Object> getFeatureMap();
+    method public T getKey();
+    property public final kotlin.jvm.functions.Function1<T,kotlin.Unit> content;
+    property public final java.util.Map<java.lang.String,java.lang.Object> featureMap;
+    property public final T key;
+  }
+
+  @androidx.navigation3.EntryDsl public final class EntryProviderBuilder {
+    ctor public EntryProviderBuilder(kotlin.jvm.functions.Function1<java.lang.Object,? extends androidx.navigation3.NavEntry<? extends java.lang.Object?>> fallback);
+    method public <T> void addEntryProvider(kotlin.reflect.KClass<T> clazz, optional java.util.Map<java.lang.String,?> featureMap, kotlin.jvm.functions.Function1<? super T,kotlin.Unit> content);
+    method public <T> void addEntryProvider(T key, optional java.util.Map<java.lang.String,?> featureMap, kotlin.jvm.functions.Function1<? super T,kotlin.Unit> content);
+    method public kotlin.jvm.functions.Function1<java.lang.Object,androidx.navigation3.NavEntry<? extends java.lang.Object?>> build();
+  }
+
+  public final class EntryProviderKt {
+    method public static inline <reified T> void entry(androidx.navigation3.EntryProviderBuilder, optional java.util.Map<java.lang.String,?> featureMap, kotlin.jvm.functions.Function1<? super T,kotlin.Unit> content);
+    method public static <T> void entry(androidx.navigation3.EntryProviderBuilder, T key, optional java.util.Map<java.lang.String,?> featureMap, kotlin.jvm.functions.Function1<? super T,kotlin.Unit> content);
+    method public static inline kotlin.jvm.functions.Function1<java.lang.Object,androidx.navigation3.NavEntry<? extends java.lang.Object?>> entryProvider(optional kotlin.jvm.functions.Function1<java.lang.Object,? extends androidx.navigation3.NavEntry<? extends java.lang.Object?>> fallback, kotlin.jvm.functions.Function1<? super androidx.navigation3.EntryProviderBuilder,kotlin.Unit> builder);
   }
 
   public final class NavDisplay {
@@ -13,11 +52,11 @@
   }
 
   public final class NavDisplay_androidKt {
-    method @androidx.compose.runtime.Composable public static <T> void NavDisplay(java.util.List<? extends T> backstack, optional androidx.compose.ui.Modifier modifier, optional androidx.navigation3.NavWrapperManager wrapperManager, optional androidx.compose.ui.Alignment contentAlignment, optional androidx.compose.animation.SizeTransform? sizeTransform, optional androidx.compose.animation.EnterTransition enterTransition, optional androidx.compose.animation.ExitTransition exitTransition, optional kotlin.jvm.functions.Function0<kotlin.Unit> onBack, kotlin.jvm.functions.Function1<? super T,? extends androidx.navigation3.NavRecord<? extends T>> recordProvider);
+    method @androidx.compose.runtime.Composable public static <T> void NavDisplay(java.util.List<? extends T> backstack, optional androidx.compose.ui.Modifier modifier, optional java.util.List<? extends androidx.navigation3.NavLocalProvider> localProviders, optional androidx.compose.ui.Alignment contentAlignment, optional androidx.compose.animation.SizeTransform? sizeTransform, optional androidx.compose.animation.EnterTransition enterTransition, optional androidx.compose.animation.ExitTransition exitTransition, optional kotlin.jvm.functions.Function0<kotlin.Unit> onBack, kotlin.jvm.functions.Function1<? super T,? extends androidx.navigation3.NavEntry<? extends T>> entryProvider);
   }
 
-  public final class NavRecord<T> {
-    ctor public NavRecord(T key, optional java.util.Map<java.lang.String,?> featureMap, kotlin.jvm.functions.Function1<? super T,kotlin.Unit> content);
+  public final class NavEntry<T> {
+    ctor public NavEntry(T key, optional java.util.Map<java.lang.String,?> featureMap, kotlin.jvm.functions.Function1<? super T,kotlin.Unit> content);
     method public kotlin.jvm.functions.Function1<T,kotlin.Unit> getContent();
     method public java.util.Map<java.lang.String,java.lang.Object> getFeatureMap();
     method public T getKey();
@@ -26,69 +65,30 @@
     property public final T key;
   }
 
+  public interface NavLocalProvider {
+    method @androidx.compose.runtime.Composable public default void ProvideToBackStack(java.util.List<?> backStack);
+    method @androidx.compose.runtime.Composable public <T> void ProvideToEntry(androidx.navigation3.NavEntry<T> entry);
+  }
+
   public final class NavWrapperManager {
     ctor public NavWrapperManager();
-    ctor public NavWrapperManager(optional java.util.List<? extends androidx.navigation3.NavContentWrapper> navContentWrappers);
-    method @androidx.compose.runtime.Composable public <T> void ContentForRecord(androidx.navigation3.NavRecord<T> record);
+    ctor public NavWrapperManager(optional java.util.List<? extends androidx.navigation3.NavLocalProvider> navLocalProviders);
+    method @androidx.compose.runtime.Composable public <T> void ContentForEntry(androidx.navigation3.NavEntry<T> entry);
     method @androidx.compose.runtime.Composable public void PrepareBackStack(java.util.List<?> backStack);
   }
 
   public final class NavWrapperManagerKt {
-    method @androidx.compose.runtime.Composable public static androidx.navigation3.NavWrapperManager rememberNavWrapperManager(java.util.List<? extends androidx.navigation3.NavContentWrapper> navContentWrappers);
+    method @androidx.compose.runtime.Composable public static androidx.navigation3.NavWrapperManager rememberNavWrapperManager(java.util.List<? extends androidx.navigation3.NavLocalProvider> navLocalProviders);
   }
 
-  public final class RecordClassProvider<T> {
-    ctor public RecordClassProvider(kotlin.reflect.KClass<T> clazz, java.util.Map<java.lang.String,?> featureMap, kotlin.jvm.functions.Function1<? super T,kotlin.Unit> content);
-    method public kotlin.reflect.KClass<T> component1();
-    method public java.util.Map<java.lang.String,java.lang.Object> component2();
-    method public kotlin.jvm.functions.Function1<T,kotlin.Unit> component3();
-    method public androidx.navigation3.RecordClassProvider<T> copy(kotlin.reflect.KClass<T> clazz, java.util.Map<java.lang.String,?> featureMap, kotlin.jvm.functions.Function1<? super T,kotlin.Unit> content);
-    method public kotlin.reflect.KClass<T> getClazz();
-    method public kotlin.jvm.functions.Function1<T,kotlin.Unit> getContent();
-    method public java.util.Map<java.lang.String,java.lang.Object> getFeatureMap();
-    property public final kotlin.reflect.KClass<T> clazz;
-    property public final kotlin.jvm.functions.Function1<T,kotlin.Unit> content;
-    property public final java.util.Map<java.lang.String,java.lang.Object> featureMap;
+  public final class SaveableStateNavLocalProvider implements androidx.navigation3.NavLocalProvider {
+    ctor public SaveableStateNavLocalProvider();
+    method @androidx.compose.runtime.Composable public <T> void ProvideToEntry(androidx.navigation3.NavEntry<T> entry);
   }
 
-  @kotlin.DslMarker public @interface RecordDsl {
-  }
-
-  public final class RecordProvider<T> {
-    ctor public RecordProvider(T key, java.util.Map<java.lang.String,?> featureMap, kotlin.jvm.functions.Function1<? super T,kotlin.Unit> content);
-    method public T component1();
-    method public java.util.Map<java.lang.String,java.lang.Object> component2();
-    method public kotlin.jvm.functions.Function1<T,kotlin.Unit> component3();
-    method public androidx.navigation3.RecordProvider<T> copy(T key, java.util.Map<java.lang.String,?> featureMap, kotlin.jvm.functions.Function1<? super T,kotlin.Unit> content);
-    method public kotlin.jvm.functions.Function1<T,kotlin.Unit> getContent();
-    method public java.util.Map<java.lang.String,java.lang.Object> getFeatureMap();
-    method public T getKey();
-    property public final kotlin.jvm.functions.Function1<T,kotlin.Unit> content;
-    property public final java.util.Map<java.lang.String,java.lang.Object> featureMap;
-    property public final T key;
-  }
-
-  @androidx.navigation3.RecordDsl public final class RecordProviderBuilder {
-    ctor public RecordProviderBuilder(kotlin.jvm.functions.Function1<java.lang.Object,? extends androidx.navigation3.NavRecord<? extends java.lang.Object?>> fallback);
-    method public <T> void addRecordProvider(kotlin.reflect.KClass<T> clazz, optional java.util.Map<java.lang.String,?> featureMap, kotlin.jvm.functions.Function1<? super T,kotlin.Unit> content);
-    method public <T> void addRecordProvider(T key, optional java.util.Map<java.lang.String,?> featureMap, kotlin.jvm.functions.Function1<? super T,kotlin.Unit> content);
-    method public kotlin.jvm.functions.Function1<java.lang.Object,androidx.navigation3.NavRecord<? extends java.lang.Object?>> build();
-  }
-
-  public final class RecordProviderKt {
-    method public static inline <reified T> void record(androidx.navigation3.RecordProviderBuilder, optional java.util.Map<java.lang.String,?> featureMap, kotlin.jvm.functions.Function1<? super T,kotlin.Unit> content);
-    method public static <T> void record(androidx.navigation3.RecordProviderBuilder, T key, optional java.util.Map<java.lang.String,?> featureMap, kotlin.jvm.functions.Function1<? super T,kotlin.Unit> content);
-    method public static inline kotlin.jvm.functions.Function1<java.lang.Object,androidx.navigation3.NavRecord<? extends java.lang.Object?>> recordProvider(optional kotlin.jvm.functions.Function1<java.lang.Object,? extends androidx.navigation3.NavRecord<? extends java.lang.Object?>> fallback, kotlin.jvm.functions.Function1<? super androidx.navigation3.RecordProviderBuilder,kotlin.Unit> builder);
-  }
-
-  public final class SaveableStateNavContentWrapper implements androidx.navigation3.NavContentWrapper {
-    ctor public SaveableStateNavContentWrapper();
-    method @androidx.compose.runtime.Composable public <T> void WrapContent(androidx.navigation3.NavRecord<T> record);
-  }
-
-  public final class SavedStateNavContentWrapper implements androidx.navigation3.NavContentWrapper {
-    method @androidx.compose.runtime.Composable public <T> void WrapContent(androidx.navigation3.NavRecord<T> record);
-    field public static final androidx.navigation3.SavedStateNavContentWrapper INSTANCE;
+  public final class SavedStateNavLocalProvider implements androidx.navigation3.NavLocalProvider {
+    method @androidx.compose.runtime.Composable public <T> void ProvideToEntry(androidx.navigation3.NavEntry<T> entry);
+    field public static final androidx.navigation3.SavedStateNavLocalProvider INSTANCE;
   }
 
 }
diff --git a/navigation3/navigation3/api/restricted_current.txt b/navigation3/navigation3/api/restricted_current.txt
index ec7e433..d8d07e0 100644
--- a/navigation3/navigation3/api/restricted_current.txt
+++ b/navigation3/navigation3/api/restricted_current.txt
@@ -1,9 +1,48 @@
 // Signature format: 4.0
 package androidx.navigation3 {
 
-  public interface NavContentWrapper {
-    method @androidx.compose.runtime.Composable public default void WrapBackStack(java.util.List<?> backStack);
-    method @androidx.compose.runtime.Composable public <T> void WrapContent(androidx.navigation3.NavRecord<T> record);
+  public final class EntryClassProvider<T> {
+    ctor public EntryClassProvider(kotlin.reflect.KClass<T> clazz, java.util.Map<java.lang.String,?> featureMap, kotlin.jvm.functions.Function1<? super T,kotlin.Unit> content);
+    method public kotlin.reflect.KClass<T> component1();
+    method public java.util.Map<java.lang.String,java.lang.Object> component2();
+    method public kotlin.jvm.functions.Function1<T,kotlin.Unit> component3();
+    method public androidx.navigation3.EntryClassProvider<T> copy(kotlin.reflect.KClass<T> clazz, java.util.Map<java.lang.String,?> featureMap, kotlin.jvm.functions.Function1<? super T,kotlin.Unit> content);
+    method public kotlin.reflect.KClass<T> getClazz();
+    method public kotlin.jvm.functions.Function1<T,kotlin.Unit> getContent();
+    method public java.util.Map<java.lang.String,java.lang.Object> getFeatureMap();
+    property public final kotlin.reflect.KClass<T> clazz;
+    property public final kotlin.jvm.functions.Function1<T,kotlin.Unit> content;
+    property public final java.util.Map<java.lang.String,java.lang.Object> featureMap;
+  }
+
+  @kotlin.DslMarker public @interface EntryDsl {
+  }
+
+  public final class EntryProvider<T> {
+    ctor public EntryProvider(T key, java.util.Map<java.lang.String,?> featureMap, kotlin.jvm.functions.Function1<? super T,kotlin.Unit> content);
+    method public T component1();
+    method public java.util.Map<java.lang.String,java.lang.Object> component2();
+    method public kotlin.jvm.functions.Function1<T,kotlin.Unit> component3();
+    method public androidx.navigation3.EntryProvider<T> copy(T key, java.util.Map<java.lang.String,?> featureMap, kotlin.jvm.functions.Function1<? super T,kotlin.Unit> content);
+    method public kotlin.jvm.functions.Function1<T,kotlin.Unit> getContent();
+    method public java.util.Map<java.lang.String,java.lang.Object> getFeatureMap();
+    method public T getKey();
+    property public final kotlin.jvm.functions.Function1<T,kotlin.Unit> content;
+    property public final java.util.Map<java.lang.String,java.lang.Object> featureMap;
+    property public final T key;
+  }
+
+  @androidx.navigation3.EntryDsl public final class EntryProviderBuilder {
+    ctor public EntryProviderBuilder(kotlin.jvm.functions.Function1<java.lang.Object,? extends androidx.navigation3.NavEntry<? extends java.lang.Object?>> fallback);
+    method public <T> void addEntryProvider(kotlin.reflect.KClass<T> clazz, optional java.util.Map<java.lang.String,?> featureMap, kotlin.jvm.functions.Function1<? super T,kotlin.Unit> content);
+    method public <T> void addEntryProvider(T key, optional java.util.Map<java.lang.String,?> featureMap, kotlin.jvm.functions.Function1<? super T,kotlin.Unit> content);
+    method public kotlin.jvm.functions.Function1<java.lang.Object,androidx.navigation3.NavEntry<? extends java.lang.Object?>> build();
+  }
+
+  public final class EntryProviderKt {
+    method public static inline <reified T> void entry(androidx.navigation3.EntryProviderBuilder, optional java.util.Map<java.lang.String,?> featureMap, kotlin.jvm.functions.Function1<? super T,kotlin.Unit> content);
+    method public static <T> void entry(androidx.navigation3.EntryProviderBuilder, T key, optional java.util.Map<java.lang.String,?> featureMap, kotlin.jvm.functions.Function1<? super T,kotlin.Unit> content);
+    method public static inline kotlin.jvm.functions.Function1<java.lang.Object,androidx.navigation3.NavEntry<? extends java.lang.Object?>> entryProvider(optional kotlin.jvm.functions.Function1<java.lang.Object,? extends androidx.navigation3.NavEntry<? extends java.lang.Object?>> fallback, kotlin.jvm.functions.Function1<? super androidx.navigation3.EntryProviderBuilder,kotlin.Unit> builder);
   }
 
   public final class NavDisplay {
@@ -13,11 +52,11 @@
   }
 
   public final class NavDisplay_androidKt {
-    method @androidx.compose.runtime.Composable public static <T> void NavDisplay(java.util.List<? extends T> backstack, optional androidx.compose.ui.Modifier modifier, optional androidx.navigation3.NavWrapperManager wrapperManager, optional androidx.compose.ui.Alignment contentAlignment, optional androidx.compose.animation.SizeTransform? sizeTransform, optional androidx.compose.animation.EnterTransition enterTransition, optional androidx.compose.animation.ExitTransition exitTransition, optional kotlin.jvm.functions.Function0<kotlin.Unit> onBack, kotlin.jvm.functions.Function1<? super T,? extends androidx.navigation3.NavRecord<? extends T>> recordProvider);
+    method @androidx.compose.runtime.Composable public static <T> void NavDisplay(java.util.List<? extends T> backstack, optional androidx.compose.ui.Modifier modifier, optional java.util.List<? extends androidx.navigation3.NavLocalProvider> localProviders, optional androidx.compose.ui.Alignment contentAlignment, optional androidx.compose.animation.SizeTransform? sizeTransform, optional androidx.compose.animation.EnterTransition enterTransition, optional androidx.compose.animation.ExitTransition exitTransition, optional kotlin.jvm.functions.Function0<kotlin.Unit> onBack, kotlin.jvm.functions.Function1<? super T,? extends androidx.navigation3.NavEntry<? extends T>> entryProvider);
   }
 
-  public final class NavRecord<T> {
-    ctor public NavRecord(T key, optional java.util.Map<java.lang.String,?> featureMap, kotlin.jvm.functions.Function1<? super T,kotlin.Unit> content);
+  public final class NavEntry<T> {
+    ctor public NavEntry(T key, optional java.util.Map<java.lang.String,?> featureMap, kotlin.jvm.functions.Function1<? super T,kotlin.Unit> content);
     method public kotlin.jvm.functions.Function1<T,kotlin.Unit> getContent();
     method public java.util.Map<java.lang.String,java.lang.Object> getFeatureMap();
     method public T getKey();
@@ -26,69 +65,30 @@
     property public final T key;
   }
 
+  public interface NavLocalProvider {
+    method @androidx.compose.runtime.Composable public default void ProvideToBackStack(java.util.List<?> backStack);
+    method @androidx.compose.runtime.Composable public <T> void ProvideToEntry(androidx.navigation3.NavEntry<T> entry);
+  }
+
   public final class NavWrapperManager {
     ctor public NavWrapperManager();
-    ctor public NavWrapperManager(optional java.util.List<? extends androidx.navigation3.NavContentWrapper> navContentWrappers);
-    method @androidx.compose.runtime.Composable public <T> void ContentForRecord(androidx.navigation3.NavRecord<T> record);
+    ctor public NavWrapperManager(optional java.util.List<? extends androidx.navigation3.NavLocalProvider> navLocalProviders);
+    method @androidx.compose.runtime.Composable public <T> void ContentForEntry(androidx.navigation3.NavEntry<T> entry);
     method @androidx.compose.runtime.Composable public void PrepareBackStack(java.util.List<?> backStack);
   }
 
   public final class NavWrapperManagerKt {
-    method @androidx.compose.runtime.Composable public static androidx.navigation3.NavWrapperManager rememberNavWrapperManager(java.util.List<? extends androidx.navigation3.NavContentWrapper> navContentWrappers);
+    method @androidx.compose.runtime.Composable public static androidx.navigation3.NavWrapperManager rememberNavWrapperManager(java.util.List<? extends androidx.navigation3.NavLocalProvider> navLocalProviders);
   }
 
-  public final class RecordClassProvider<T> {
-    ctor public RecordClassProvider(kotlin.reflect.KClass<T> clazz, java.util.Map<java.lang.String,?> featureMap, kotlin.jvm.functions.Function1<? super T,kotlin.Unit> content);
-    method public kotlin.reflect.KClass<T> component1();
-    method public java.util.Map<java.lang.String,java.lang.Object> component2();
-    method public kotlin.jvm.functions.Function1<T,kotlin.Unit> component3();
-    method public androidx.navigation3.RecordClassProvider<T> copy(kotlin.reflect.KClass<T> clazz, java.util.Map<java.lang.String,?> featureMap, kotlin.jvm.functions.Function1<? super T,kotlin.Unit> content);
-    method public kotlin.reflect.KClass<T> getClazz();
-    method public kotlin.jvm.functions.Function1<T,kotlin.Unit> getContent();
-    method public java.util.Map<java.lang.String,java.lang.Object> getFeatureMap();
-    property public final kotlin.reflect.KClass<T> clazz;
-    property public final kotlin.jvm.functions.Function1<T,kotlin.Unit> content;
-    property public final java.util.Map<java.lang.String,java.lang.Object> featureMap;
+  public final class SaveableStateNavLocalProvider implements androidx.navigation3.NavLocalProvider {
+    ctor public SaveableStateNavLocalProvider();
+    method @androidx.compose.runtime.Composable public <T> void ProvideToEntry(androidx.navigation3.NavEntry<T> entry);
   }
 
-  @kotlin.DslMarker public @interface RecordDsl {
-  }
-
-  public final class RecordProvider<T> {
-    ctor public RecordProvider(T key, java.util.Map<java.lang.String,?> featureMap, kotlin.jvm.functions.Function1<? super T,kotlin.Unit> content);
-    method public T component1();
-    method public java.util.Map<java.lang.String,java.lang.Object> component2();
-    method public kotlin.jvm.functions.Function1<T,kotlin.Unit> component3();
-    method public androidx.navigation3.RecordProvider<T> copy(T key, java.util.Map<java.lang.String,?> featureMap, kotlin.jvm.functions.Function1<? super T,kotlin.Unit> content);
-    method public kotlin.jvm.functions.Function1<T,kotlin.Unit> getContent();
-    method public java.util.Map<java.lang.String,java.lang.Object> getFeatureMap();
-    method public T getKey();
-    property public final kotlin.jvm.functions.Function1<T,kotlin.Unit> content;
-    property public final java.util.Map<java.lang.String,java.lang.Object> featureMap;
-    property public final T key;
-  }
-
-  @androidx.navigation3.RecordDsl public final class RecordProviderBuilder {
-    ctor public RecordProviderBuilder(kotlin.jvm.functions.Function1<java.lang.Object,? extends androidx.navigation3.NavRecord<? extends java.lang.Object?>> fallback);
-    method public <T> void addRecordProvider(kotlin.reflect.KClass<T> clazz, optional java.util.Map<java.lang.String,?> featureMap, kotlin.jvm.functions.Function1<? super T,kotlin.Unit> content);
-    method public <T> void addRecordProvider(T key, optional java.util.Map<java.lang.String,?> featureMap, kotlin.jvm.functions.Function1<? super T,kotlin.Unit> content);
-    method public kotlin.jvm.functions.Function1<java.lang.Object,androidx.navigation3.NavRecord<? extends java.lang.Object?>> build();
-  }
-
-  public final class RecordProviderKt {
-    method public static inline <reified T> void record(androidx.navigation3.RecordProviderBuilder, optional java.util.Map<java.lang.String,?> featureMap, kotlin.jvm.functions.Function1<? super T,kotlin.Unit> content);
-    method public static <T> void record(androidx.navigation3.RecordProviderBuilder, T key, optional java.util.Map<java.lang.String,?> featureMap, kotlin.jvm.functions.Function1<? super T,kotlin.Unit> content);
-    method public static inline kotlin.jvm.functions.Function1<java.lang.Object,androidx.navigation3.NavRecord<? extends java.lang.Object?>> recordProvider(optional kotlin.jvm.functions.Function1<java.lang.Object,? extends androidx.navigation3.NavRecord<? extends java.lang.Object?>> fallback, kotlin.jvm.functions.Function1<? super androidx.navigation3.RecordProviderBuilder,kotlin.Unit> builder);
-  }
-
-  public final class SaveableStateNavContentWrapper implements androidx.navigation3.NavContentWrapper {
-    ctor public SaveableStateNavContentWrapper();
-    method @androidx.compose.runtime.Composable public <T> void WrapContent(androidx.navigation3.NavRecord<T> record);
-  }
-
-  public final class SavedStateNavContentWrapper implements androidx.navigation3.NavContentWrapper {
-    method @androidx.compose.runtime.Composable public <T> void WrapContent(androidx.navigation3.NavRecord<T> record);
-    field public static final androidx.navigation3.SavedStateNavContentWrapper INSTANCE;
+  public final class SavedStateNavLocalProvider implements androidx.navigation3.NavLocalProvider {
+    method @androidx.compose.runtime.Composable public <T> void ProvideToEntry(androidx.navigation3.NavEntry<T> entry);
+    field public static final androidx.navigation3.SavedStateNavLocalProvider INSTANCE;
   }
 
 }
diff --git a/navigation3/navigation3/samples/src/main/kotlin/androidx/navigation3/samples/NavDisplaySamples.kt b/navigation3/navigation3/samples/src/main/kotlin/androidx/navigation3/samples/NavDisplaySamples.kt
index fa6ff47..d4728e8 100644
--- a/navigation3/navigation3/samples/src/main/kotlin/androidx/navigation3/samples/NavDisplaySamples.kt
+++ b/navigation3/navigation3/samples/src/main/kotlin/androidx/navigation3/samples/NavDisplaySamples.kt
@@ -23,13 +23,12 @@
 import androidx.compose.runtime.Composable
 import androidx.lifecycle.ViewModel
 import androidx.lifecycle.viewmodel.compose.viewModel
-import androidx.lifecycle.viewmodel.navigation3.ViewModelStoreNavContentWrapper
+import androidx.lifecycle.viewmodel.navigation3.ViewModelStoreNavLocalProvider
 import androidx.navigation3.NavDisplay
-import androidx.navigation3.NavRecord
-import androidx.navigation3.SavedStateNavContentWrapper
-import androidx.navigation3.record
-import androidx.navigation3.recordProvider
-import androidx.navigation3.rememberNavWrapperManager
+import androidx.navigation3.NavEntry
+import androidx.navigation3.SavedStateNavLocalProvider
+import androidx.navigation3.entry
+import androidx.navigation3.entryProvider
 
 class ProfileViewModel : ViewModel() {
     val name = "no user"
@@ -39,31 +38,27 @@
 @Composable
 fun BaseNav() {
     val backStack = rememberMutableStateListOf(Profile)
-    val manager =
-        rememberNavWrapperManager(
-            listOf(SavedStateNavContentWrapper, ViewModelStoreNavContentWrapper)
-        )
     NavDisplay(
         backstack = backStack,
-        wrapperManager = manager,
+        localProviders = listOf(SavedStateNavLocalProvider, ViewModelStoreNavLocalProvider),
         onBack = { backStack.removeLast() },
-        recordProvider =
-            recordProvider({ NavRecord(Unit) { Text(text = "Invalid Key") } }) {
-                record<Profile>(
+        entryProvider =
+            entryProvider({ NavEntry(Unit) { Text(text = "Invalid Key") } }) {
+                entry<Profile>(
                     NavDisplay.transition(slideInHorizontally { it }, slideOutHorizontally { it })
                 ) {
                     val viewModel = viewModel<ProfileViewModel>()
                     Profile(viewModel, { backStack.add(it) }) { backStack.removeLast() }
                 }
-                record<Scrollable>(
+                entry<Scrollable>(
                     NavDisplay.transition(slideInHorizontally { it }, slideOutHorizontally { it })
                 ) {
                     Scrollable({ backStack.add(it) }) { backStack.removeLast() }
                 }
-                record<Dialog>(featureMap = NavDisplay.isDialog(true)) {
+                entry<Dialog>(featureMap = NavDisplay.isDialog(true)) {
                     DialogContent { backStack.removeLast() }
                 }
-                record<Dashboard>(
+                entry<Dashboard>(
                     NavDisplay.transition(slideInHorizontally { it }, slideOutHorizontally { it })
                 ) { dashboardArgs ->
                     val userId = dashboardArgs.userId
diff --git a/navigation3/navigation3/src/androidInstrumentedTest/kotlin/androidx/navigation3/AnimatedTest.kt b/navigation3/navigation3/src/androidInstrumentedTest/kotlin/androidx/navigation3/AnimatedTest.kt
index d7da926..6fb5955 100644
--- a/navigation3/navigation3/src/androidInstrumentedTest/kotlin/androidx/navigation3/AnimatedTest.kt
+++ b/navigation3/navigation3/src/androidInstrumentedTest/kotlin/androidx/navigation3/AnimatedTest.kt
@@ -49,8 +49,8 @@
             backstack = remember { mutableStateListOf(first) }
             NavDisplay(backstack) {
                 when (it) {
-                    first -> NavRecord(first) { Text(first) }
-                    second -> NavRecord(second) { Text(second) }
+                    first -> NavEntry(first) { Text(first) }
+                    second -> NavEntry(second) { Text(second) }
                     else -> error("Invalid key passed")
                 }
             }
@@ -93,13 +93,13 @@
             NavDisplay(backstack) {
                 when (it) {
                     first ->
-                        NavRecord(
+                        NavEntry(
                             first,
                         ) {
                             Text(first)
                         }
                     second ->
-                        NavRecord(
+                        NavEntry(
                             second,
                             featureMap =
                                 NavDisplay.transition(
diff --git a/navigation3/navigation3/src/androidInstrumentedTest/kotlin/androidx/navigation3/NavDisplayTest.kt b/navigation3/navigation3/src/androidInstrumentedTest/kotlin/androidx/navigation3/NavDisplayTest.kt
index fd5749a..614eb88 100644
--- a/navigation3/navigation3/src/androidInstrumentedTest/kotlin/androidx/navigation3/NavDisplayTest.kt
+++ b/navigation3/navigation3/src/androidInstrumentedTest/kotlin/androidx/navigation3/NavDisplayTest.kt
@@ -34,6 +34,7 @@
 import androidx.test.filters.LargeTest
 import com.google.common.truth.Truth.assertWithMessage
 import kotlin.test.Test
+import kotlin.test.assertFailsWith
 import org.junit.Rule
 import org.junit.runner.RunWith
 
@@ -45,7 +46,7 @@
     @Test
     fun testContentShown() {
         composeTestRule.setContent {
-            NavDisplay(backstack = mutableStateListOf(first)) { NavRecord(first) { Text(first) } }
+            NavDisplay(backstack = mutableStateListOf(first)) { NavEntry(first) { Text(first) } }
         }
 
         assertThat(composeTestRule.onNodeWithText(first).isDisplayed()).isTrue()
@@ -58,8 +59,8 @@
             backstack = remember { mutableStateListOf(first) }
             NavDisplay(backstack = backstack) {
                 when (it) {
-                    first -> NavRecord(first) { Text(first) }
-                    second -> NavRecord(second) { Text(second) }
+                    first -> NavEntry(first) { Text(first) }
+                    second -> NavEntry(second) { Text(second) }
                     else -> error("Invalid key passed")
                 }
             }
@@ -80,8 +81,8 @@
             backstack = remember { mutableStateListOf(first) }
             NavDisplay(backstack = backstack) {
                 when (it) {
-                    first -> NavRecord(first) { Text(first) }
-                    second -> NavRecord(second, NavDisplay.isDialog(true)) { Text(second) }
+                    first -> NavEntry(first) { Text(first) }
+                    second -> NavEntry(second, NavDisplay.isDialog(true)) { Text(second) }
                     else -> error("Invalid key passed")
                 }
             }
@@ -105,8 +106,8 @@
             backstack = remember { mutableStateListOf(first) }
             NavDisplay(backstack = backstack) {
                 when (it) {
-                    first -> NavRecord(first) { Text(first) }
-                    second -> NavRecord(second) { Text(second) }
+                    first -> NavEntry(first) { Text(first) }
+                    second -> NavEntry(second) { Text(second) }
                     else -> error("Invalid key passed")
                 }
             }
@@ -132,8 +133,8 @@
             backstack = remember { mutableStateListOf(first) }
             NavDisplay(backstack = backstack) {
                 when (it) {
-                    first -> NavRecord(first) { numberOnScreen1 = rememberSaveable { increment++ } }
-                    second -> NavRecord(second) {}
+                    first -> NavEntry(first) { numberOnScreen1 = rememberSaveable { increment++ } }
+                    second -> NavEntry(second) {}
                     else -> error("Invalid key passed")
                 }
             }
@@ -142,14 +143,11 @@
         composeTestRule.runOnIdle {
             assertWithMessage("Initial number should be 0").that(numberOnScreen1).isEqualTo(0)
             numberOnScreen1 = -1
+            assertWithMessage("The number should be -1").that(numberOnScreen1).isEqualTo(-1)
             backstack.add(second)
         }
 
-        composeTestRule.runOnIdle {
-            assertWithMessage("The number should be -1").that(numberOnScreen1).isEqualTo(-1)
-            // removeLast requires API 35
-            backstack.removeAt(backstack.size - 1)
-        }
+        composeTestRule.runOnIdle { backstack.removeAt(backstack.size - 1) }
 
         composeTestRule.runOnIdle {
             assertWithMessage("The number should be restored").that(numberOnScreen1).isEqualTo(0)
@@ -165,15 +163,14 @@
         composeTestRule.setContent {
             mainRegistry = LocalSavedStateRegistryOwner.current.savedStateRegistry
             backstack = remember { mutableStateListOf(first) }
-            val manager = rememberNavWrapperManager(listOf(SavedStateNavContentWrapper))
-            NavDisplay(backstack = backstack, wrapperManager = manager) {
+            NavDisplay(backstack = backstack, localProviders = listOf(SavedStateNavLocalProvider)) {
                 when (it) {
                     first ->
-                        NavRecord(first) {
+                        NavEntry(first) {
                             registry1 = LocalSavedStateRegistryOwner.current.savedStateRegistry
                         }
                     second ->
-                        NavRecord(second) {
+                        NavEntry(second) {
                             registry2 = LocalSavedStateRegistryOwner.current.savedStateRegistry
                         }
                     else -> error("Invalid key passed")
@@ -212,12 +209,12 @@
                         2 -> backStack2
                         else -> backStack3
                     },
-                recordProvider =
-                    recordProvider {
-                        record(first) { Text(first) }
-                        record(second) { Text(second) }
-                        record(third) { Text(third) }
-                        record(forth) { Text(forth) }
+                entryProvider =
+                    entryProvider {
+                        entry(first) { Text(first) }
+                        entry(second) { Text(second) }
+                        entry(third) { Text(third) }
+                        entry(forth) { Text(forth) }
                     }
             )
         }
@@ -238,6 +235,43 @@
         assertThat(backStack3).containsExactly(third, forth)
         assertThat(composeTestRule.onNodeWithText(forth).isDisplayed()).isTrue()
     }
+
+    @Test
+    fun testInitEmptyBackstackThrows() {
+        lateinit var backstack: MutableList<Any>
+        val fail =
+            assertFailsWith<IllegalArgumentException> {
+                composeTestRule.setContent {
+                    backstack = remember { mutableStateListOf() }
+                    NavDisplay(backstack = backstack) { NavEntry(first) {} }
+                }
+            }
+        assertThat(fail.message).isEqualTo("NavDisplay backstack cannot be empty")
+    }
+
+    @Test
+    fun testPopToEmptyBackstackThrows() {
+        lateinit var backstack: MutableList<Any>
+        composeTestRule.setContent {
+            backstack = remember { mutableStateListOf(first) }
+            NavDisplay(backstack = backstack) {
+                when (it) {
+                    first -> NavEntry(first) { Text(first) }
+                    second -> NavEntry(second) { Text(second) }
+                    else -> error("Invalid key passed")
+                }
+            }
+        }
+
+        assertThat(composeTestRule.onNodeWithText(first).isDisplayed()).isTrue()
+
+        val fail =
+            assertFailsWith<IllegalArgumentException> {
+                composeTestRule.runOnIdle { backstack.clear() }
+                composeTestRule.waitForIdle()
+            }
+        assertThat(fail.message).isEqualTo("NavDisplay backstack cannot be empty")
+    }
 }
 
 private const val first = "first"
diff --git a/navigation3/navigation3/src/androidInstrumentedTest/kotlin/androidx/navigation3/NavWrapperManagerTest.kt b/navigation3/navigation3/src/androidInstrumentedTest/kotlin/androidx/navigation3/NavWrapperManagerTest.kt
index be41543..646df38 100644
--- a/navigation3/navigation3/src/androidInstrumentedTest/kotlin/androidx/navigation3/NavWrapperManagerTest.kt
+++ b/navigation3/navigation3/src/androidInstrumentedTest/kotlin/androidx/navigation3/NavWrapperManagerTest.kt
@@ -35,14 +35,14 @@
         var calledWrapBackStack = false
         var calledWrapContent = false
         val wrapper =
-            object : NavContentWrapper {
+            object : NavLocalProvider {
                 @Composable
-                override fun WrapBackStack(backStack: List<Any>) {
+                override fun ProvideToBackStack(backStack: List<Any>) {
                     calledWrapBackStack = true
                 }
 
                 @Composable
-                override fun <T : Any> WrapContent(record: NavRecord<T>) {
+                override fun <T : Any> ProvideToEntry(entry: NavEntry<T>) {
                     calledWrapContent = true
                 }
             }
@@ -51,7 +51,7 @@
 
         composeTestRule.setContent {
             manager.PrepareBackStack(listOf("something"))
-            manager.ContentForRecord(NavRecord("myKey") {})
+            manager.ContentForEntry(NavEntry("myKey") {})
         }
 
         assertThat(calledWrapBackStack).isTrue()
@@ -63,14 +63,14 @@
         var calledWrapBackStackCount = 0
         var calledWrapContentCount = 0
         val wrapper =
-            object : NavContentWrapper {
+            object : NavLocalProvider {
                 @Composable
-                override fun WrapBackStack(backStack: List<Any>) {
+                override fun ProvideToBackStack(backStack: List<Any>) {
                     calledWrapBackStackCount++
                 }
 
                 @Composable
-                override fun <T : Any> WrapContent(record: NavRecord<T>) {
+                override fun <T : Any> ProvideToEntry(entry: NavEntry<T>) {
                     calledWrapContentCount++
                 }
             }
@@ -79,7 +79,7 @@
 
         composeTestRule.setContent {
             manager.PrepareBackStack(listOf("something"))
-            manager.ContentForRecord(NavRecord("myKey") {})
+            manager.ContentForEntry(NavEntry("myKey") {})
         }
 
         assertThat(calledWrapBackStackCount).isEqualTo(1)
diff --git a/navigation3/navigation3/src/androidMain/kotlin/androidx/navigation3/NavDisplay.android.kt b/navigation3/navigation3/src/androidMain/kotlin/androidx/navigation3/NavDisplay.android.kt
index cdcff77..fdc1e24 100644
--- a/navigation3/navigation3/src/androidMain/kotlin/androidx/navigation3/NavDisplay.android.kt
+++ b/navigation3/navigation3/src/androidMain/kotlin/androidx/navigation3/NavDisplay.android.kt
@@ -34,7 +34,7 @@
 /** Object that indicates the features that can be handled by the [NavDisplay] */
 public object NavDisplay {
     /**
-     * Function to be called on the [NavRecord.featureMap] to notify the [NavDisplay] that the
+     * Function to be called on the [NavEntry.featureMap] to notify the [NavDisplay] that the
      * content should be animated using the provided transitions.
      */
     public fun transition(enter: EnterTransition?, exit: ExitTransition?): Map<String, Any> =
@@ -42,7 +42,7 @@
         else mapOf(ENTER_TRANSITION_KEY to enter, EXIT_TRANSITION_KEY to exit)
 
     /**
-     * Function to be called on the [NavRecord.featureMap] to notify the [NavDisplay] that the
+     * Function to be called on the [NavEntry.featureMap] to notify the [NavDisplay] that the
      * content should be displayed inside of a [Dialog]
      */
     public fun isDialog(boolean: Boolean): Map<String, Any> =
@@ -60,29 +60,28 @@
  *
  * The NavDisplay displays the content associated with the last key on the back stack in most
  * circumstances. If that content wants to be displayed as a dialog, as communicated by adding
- * [NavDisplay.isDialog] to a [NavRecord.featureMap], then the last key's content is a dialog and
- * the second to last key is a displayed in the background.
+ * [NavDisplay.isDialog] to a [NavEntry.featureMap], then the last key's content is a dialog and the
+ * second to last key is a displayed in the background.
  *
  * @param backstack the collection of keys that represents the state that needs to be handled
- * @param wrapperManager the manager that combines all of the [NavContentWrapper]s
+ * @param localProviders list of [NavLocalProvider] to add information to the provided entriess
  * @param modifier the modifier to be applied to the layout.
  * @param contentAlignment The [Alignment] of the [AnimatedContent]
- *     * @param enterTransition Default [EnterTransition] for all [NavRecord]s. Can be overridden
- *     * individually for each [NavRecord] by passing in the record's transitions through
- *     * [NavRecord.featureMap].
- *     * @param exitTransition Default [ExitTransition] for all [NavRecord]s. Can be overridden
- *     * individually for each [NavRecord] by passing in the record's transitions through
- *     * [NavRecord.featureMap].
- *
+ * @param enterTransition Default [EnterTransition] for all [NavEntry]s. Can be overridden
+ *   individually for each [NavEntry] by passing in the entry's transitions through
+ *   [NavEntry.featureMap].
+ * @param exitTransition Default [ExitTransition] for all [NavEntry]s. Can be overridden
+ *   individually for each [NavEntry] by passing in the entry's transitions through
+ *   [NavEntry.featureMap].
  * @param onBack a callback for handling system back presses
- * @param recordProvider lambda used to construct each possible [NavRecord]
+ * @param entryProvider lambda used to construct each possible [NavEntry]
  * @sample androidx.navigation3.samples.BaseNav
  */
 @Composable
 public fun <T : Any> NavDisplay(
     backstack: List<T>,
     modifier: Modifier = Modifier,
-    wrapperManager: NavWrapperManager = rememberNavWrapperManager(emptyList()),
+    localProviders: List<NavLocalProvider> = emptyList(),
     contentAlignment: Alignment = Alignment.TopStart,
     sizeTransform: SizeTransform? = null,
     enterTransition: EnterTransition =
@@ -100,33 +99,36 @@
                 )
         ),
     onBack: () -> Unit = { if (backstack is MutableList) backstack.removeAt(backstack.size - 1) },
-    recordProvider: (key: T) -> NavRecord<out T>
+    entryProvider: (key: T) -> NavEntry<out T>
 ) {
+    require(backstack.isNotEmpty()) { "NavDisplay backstack cannot be empty" }
+
+    val wrapperManager: NavWrapperManager = rememberNavWrapperManager(localProviders)
     BackHandler(backstack.size > 1, onBack)
     wrapperManager.PrepareBackStack(backStack = backstack)
     val key = backstack.last()
-    val record = recordProvider.invoke(key)
+    val entry = entryProvider.invoke(key)
 
-    // Incoming record defines transitions, otherwise it uses default transitions from NavDisplay
+    // Incoming entry defines transitions, otherwise it uses default transitions from NavDisplay
     val finalEnterTransition =
-        record.featureMap[NavDisplay.ENTER_TRANSITION_KEY] as? EnterTransition ?: enterTransition
+        entry.featureMap[NavDisplay.ENTER_TRANSITION_KEY] as? EnterTransition ?: enterTransition
     val finalExitTransition =
-        record.featureMap[NavDisplay.EXIT_TRANSITION_KEY] as? ExitTransition ?: exitTransition
+        entry.featureMap[NavDisplay.EXIT_TRANSITION_KEY] as? ExitTransition ?: exitTransition
 
-    val isDialog = record.featureMap[NavDisplay.DIALOG_KEY] == true
+    val isDialog = entry.featureMap[NavDisplay.DIALOG_KEY] == true
 
     // if there is a dialog, we should create a transition with the next to last entry instead.
     val transition =
         if (isDialog) {
             if (backstack.size > 1) {
                 val previousKey = backstack[backstack.size - 2]
-                val previousRecord = recordProvider.invoke(previousKey)
-                updateTransition(targetState = previousRecord, label = previousKey.toString())
+                val previousEntry = entryProvider.invoke(previousKey)
+                updateTransition(targetState = previousEntry, label = previousKey.toString())
             } else {
                 null
             }
         } else {
-            updateTransition(targetState = record, label = key.toString())
+            updateTransition(targetState = entry, label = key.toString())
         }
 
     transition?.AnimatedContent(
@@ -140,11 +142,11 @@
         },
         contentAlignment = contentAlignment,
         contentKey = { it.key }
-    ) { innerRecord ->
-        wrapperManager.ContentForRecord(innerRecord)
+    ) { innerEntry ->
+        wrapperManager.ContentForEntry(innerEntry)
     }
 
     if (isDialog) {
-        Dialog(onBack) { wrapperManager.ContentForRecord(record) }
+        Dialog(onBack) { wrapperManager.ContentForEntry(entry) }
     }
 }
diff --git a/navigation3/navigation3/src/commonMain/kotlin/androidx/navigation3/EntryProvider.kt b/navigation3/navigation3/src/commonMain/kotlin/androidx/navigation3/EntryProvider.kt
new file mode 100644
index 0000000..47471e4
--- /dev/null
+++ b/navigation3/navigation3/src/commonMain/kotlin/androidx/navigation3/EntryProvider.kt
@@ -0,0 +1,107 @@
+/*
+ * Copyright 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package androidx.navigation3
+
+import androidx.compose.runtime.Composable
+import kotlin.reflect.KClass
+
+@DslMarker public annotation class EntryDsl
+
+/** Creates an [EntryProviderBuilder] with the entry providers provided in the builder. */
+public inline fun entryProvider(
+    noinline fallback: (unknownScreen: Any) -> NavEntry<*> = {
+        throw IllegalStateException("Unknown screen $it")
+    },
+    builder: EntryProviderBuilder.() -> Unit
+): (Any) -> NavEntry<*> = EntryProviderBuilder(fallback).apply(builder).build()
+
+/** DSL for constructing a new [NavEntry] */
+@Suppress("TopLevelBuilder")
+@EntryDsl
+public class EntryProviderBuilder(private val fallback: (unknownScreen: Any) -> NavEntry<*>) {
+    private val clazzProviders = mutableMapOf<KClass<*>, EntryClassProvider<*>>()
+    private val providers = mutableMapOf<Any, EntryProvider<*>>()
+
+    /** Builds a [NavEntry] for the given [key] that displays [content]. */
+    @Suppress("SetterReturnsThis", "MissingGetterMatchingBuilder")
+    public fun <T : Any> addEntryProvider(
+        key: T,
+        featureMap: Map<String, Any> = emptyMap(),
+        content: @Composable (T) -> Unit,
+    ) {
+        require(key !in providers) {
+            "An `entry` with the key `key` has already been added: ${key}."
+        }
+        providers[key] = EntryProvider(key, featureMap, content)
+    }
+
+    /** Builds a [NavEntry] for the given [clazz] that displays [content]. */
+    @Suppress("SetterReturnsThis", "MissingGetterMatchingBuilder")
+    public fun <T : Any> addEntryProvider(
+        clazz: KClass<T>,
+        featureMap: Map<String, Any> = emptyMap(),
+        content: @Composable (T) -> Unit,
+    ) {
+        require(clazz !in clazzProviders) {
+            "An `entry` with the same `clazz` has already been added: ${clazz.simpleName}."
+        }
+        clazzProviders[clazz] = EntryClassProvider(clazz, featureMap, content)
+    }
+
+    /**
+     * Returns an instance of entryProvider created from the entry providers set on this builder.
+     */
+    @Suppress("UNCHECKED_CAST")
+    public fun build(): (Any) -> NavEntry<*> = { key ->
+        val entryClassProvider = clazzProviders[key::class] as? EntryClassProvider<Any>
+        val entryProvider = providers[key] as? EntryProvider<Any>
+        entryClassProvider?.run { NavEntry(key, featureMap, content) }
+            ?: entryProvider?.run { NavEntry(key, featureMap, content) }
+            ?: fallback.invoke(key)
+    }
+}
+
+/** Add an entry provider to the [EntryProviderBuilder] */
+public fun <T : Any> EntryProviderBuilder.entry(
+    key: T,
+    featureMap: Map<String, Any> = emptyMap(),
+    content: @Composable (T) -> Unit,
+) {
+    addEntryProvider(key, featureMap, content)
+}
+
+/** Add an entry provider to the [EntryProviderBuilder] */
+public inline fun <reified T : Any> EntryProviderBuilder.entry(
+    featureMap: Map<String, Any> = emptyMap(),
+    noinline content: @Composable (T) -> Unit,
+) {
+    addEntryProvider(T::class, featureMap, content)
+}
+
+/** Holds a Entry class, featureMap, and content for that class */
+public data class EntryClassProvider<T : Any>(
+    val clazz: KClass<T>,
+    val featureMap: Map<String, Any>,
+    val content: @Composable (T) -> Unit,
+)
+
+/** Holds a Entry class, featureMap, and content for that key */
+public data class EntryProvider<T : Any>(
+    val key: T,
+    val featureMap: Map<String, Any>,
+    val content: @Composable (T) -> Unit,
+)
diff --git a/navigation3/navigation3/src/commonMain/kotlin/androidx/navigation3/NavRecord.kt b/navigation3/navigation3/src/commonMain/kotlin/androidx/navigation3/NavEntry.kt
similarity index 72%
rename from navigation3/navigation3/src/commonMain/kotlin/androidx/navigation3/NavRecord.kt
rename to navigation3/navigation3/src/commonMain/kotlin/androidx/navigation3/NavEntry.kt
index 71cd4e0..e5d19d9 100644
--- a/navigation3/navigation3/src/commonMain/kotlin/androidx/navigation3/NavRecord.kt
+++ b/navigation3/navigation3/src/commonMain/kotlin/androidx/navigation3/NavEntry.kt
@@ -19,14 +19,14 @@
 import androidx.compose.runtime.Composable
 
 /**
- * Record maintains the store the key and the content represented by that key. Records should be
- * created as part of a [NavDisplay.recordProvider](reference/androidx/navigation/NavDisplay).
+ * Entry maintains and stores the key and the content represented by that key. Entries should be
+ * created as part of a [NavDisplay.entryProvider](reference/androidx/navigation/NavDisplay).
  *
- * @param key key for this record
+ * @param key key for this entry
  * @param featureMap map of the available features from a display
- * @param content content for this record to be displayed when this record is active
+ * @param content content for this entry to be displayed when this entry is active
  */
-public class NavRecord<T : Any>(
+public class NavEntry<T : Any>(
     public val key: T,
     public val featureMap: Map<String, Any> = emptyMap(),
     public val content: @Composable (T) -> Unit,
diff --git a/navigation3/navigation3/src/commonMain/kotlin/androidx/navigation3/NavContentWrapper.kt b/navigation3/navigation3/src/commonMain/kotlin/androidx/navigation3/NavLocalProvider.kt
similarity index 73%
rename from navigation3/navigation3/src/commonMain/kotlin/androidx/navigation3/NavContentWrapper.kt
rename to navigation3/navigation3/src/commonMain/kotlin/androidx/navigation3/NavLocalProvider.kt
index 42d1652..b3fbeb2 100644
--- a/navigation3/navigation3/src/commonMain/kotlin/androidx/navigation3/NavContentWrapper.kt
+++ b/navigation3/navigation3/src/commonMain/kotlin/androidx/navigation3/NavLocalProvider.kt
@@ -22,23 +22,23 @@
  * Interface that offers the ability to provide information to some Composable content that is
  * integrated with a [NavDisplay](reference/androidx/navigation/NavDisplay).
  *
- * Information can be provided to the entire back stack via [NavContentWrapper.WrapBackStack] or to
- * a single record via [NavContentWrapper.WrapContent].
+ * Information can be provided to the entire back stack via [NavLocalProvider.ProvideToBackStack] or
+ * to a single entry via [NavLocalProvider.ProvideToEntry].
  */
-public interface NavContentWrapper {
+public interface NavLocalProvider {
 
     /**
-     * Allows a [NavContentWrapper] to execute on the entire backstack.
+     * Allows a [NavLocalProvider] to provide to the entire backstack.
      *
      * This function is called by the [NavWrapperManager] and should not be called directly.
      */
-    @Composable public fun WrapBackStack(backStack: List<Any>): Unit = Unit
+    @Composable public fun ProvideToBackStack(backStack: List<Any>): Unit = Unit
 
     /**
-     * Allows a [NavContentWrapper] to provide information to the content of a single record.
+     * Allows a [NavLocalProvider] to provide information to a single entry.
      *
      * This function is called by the [NavDisplay](reference/androidx/navigation/NavDisplay) and
      * should not be called directly.
      */
-    @Composable public fun <T : Any> WrapContent(record: NavRecord<T>)
+    @Composable public fun <T : Any> ProvideToEntry(entry: NavEntry<T>)
 }
diff --git a/navigation3/navigation3/src/commonMain/kotlin/androidx/navigation3/NavWrapperManager.kt b/navigation3/navigation3/src/commonMain/kotlin/androidx/navigation3/NavWrapperManager.kt
index 4a137df..a994b16 100644
--- a/navigation3/navigation3/src/commonMain/kotlin/androidx/navigation3/NavWrapperManager.kt
+++ b/navigation3/navigation3/src/commonMain/kotlin/androidx/navigation3/NavWrapperManager.kt
@@ -19,56 +19,54 @@
 import androidx.compose.runtime.Composable
 import androidx.compose.runtime.remember
 
-/** Creates a [NavContentWrapper]. */
+/** Creates a [NavLocalProvider]. */
 @Composable
-public fun rememberNavWrapperManager(
-    navContentWrappers: List<NavContentWrapper>
-): NavWrapperManager {
-    return remember { NavWrapperManager(navContentWrappers) }
+public fun rememberNavWrapperManager(navLocalProviders: List<NavLocalProvider>): NavWrapperManager {
+    return remember { NavWrapperManager(navLocalProviders) }
 }
 
 /**
- * Class that manages all of the provided [NavContentWrapper]. It is responsible for executing the
- * functions provided by each [NavContentWrapper] appropriately.
+ * Class that manages all of the provided [NavLocalProvider]. It is responsible for executing the
+ * functions provided by each [NavLocalProvider] appropriately.
  *
- * Note: the order in which the [NavContentWrapper]s are added to the list determines their scope,
- * i.e. a [NavContentWrapper] added earlier in a list has its data available to those added later.
+ * Note: the order in which the [NavLocalProvider]s are added to the list determines their scope,
+ * i.e. a [NavLocalProvider] added earlier in a list has its data available to those added later.
  *
- * @param navContentWrappers the [NavContentWrapper]s that are providing data to the content
+ * @param navLocalProviders the [NavLocalProvider]s that are providing data to the content
  */
-public class NavWrapperManager(navContentWrappers: List<NavContentWrapper> = emptyList()) {
+public class NavWrapperManager(navLocalProviders: List<NavLocalProvider> = emptyList()) {
     /**
-     * Final list of wrappers. This always adds a [SaveableStateNavContentWrapper] by default, as it
+     * Final list of wrappers. This always adds a [SaveableStateNavLocalProvider] by default, as it
      * is required. It then filters out any duplicates to ensure there is always one instance of any
      * wrapper at a given time.
      */
     private val finalWrappers =
-        (navContentWrappers + listOf(SaveableStateNavContentWrapper())).distinct()
+        (navLocalProviders + listOf(SaveableStateNavLocalProvider())).distinct()
 
     /**
-     * Calls the [NavContentWrapper.WrapBackStack] functions on each wrapper
+     * Calls the [NavLocalProvider.ProvideToBackStack] functions on each wrapper
      *
      * This function is called by the [NavDisplay](reference/androidx/navigation/NavDisplay) and
      * should not be called directly.
      */
     @Composable
     public fun PrepareBackStack(backStack: List<Any>) {
-        finalWrappers.distinct().forEach { it.WrapBackStack(backStack = backStack) }
+        finalWrappers.distinct().forEach { it.ProvideToBackStack(backStack = backStack) }
     }
 
     /**
-     * Calls the [NavContentWrapper.WrapContent] functions on each wrapper.
+     * Calls the [NavLocalProvider.ProvideToEntry] functions on each wrapper.
      *
      * This function is called by the [NavDisplay](reference/androidx/navigation/NavDisplay) and
      * should not be called directly.
      */
     @Composable
-    public fun <T : Any> ContentForRecord(record: NavRecord<T>) {
-        val key = record.key
+    public fun <T : Any> ContentForEntry(entry: NavEntry<T>) {
+        val key = entry.key
         finalWrappers
             .distinct()
-            .foldRight(record.content) { wrapper, contentLambda ->
-                { wrapper.WrapContent(NavRecord(key, record.featureMap, content = contentLambda)) }
+            .foldRight(entry.content) { wrapper, contentLambda ->
+                { wrapper.ProvideToEntry(NavEntry(key, entry.featureMap, content = contentLambda)) }
             }
             .invoke(key)
     }
diff --git a/navigation3/navigation3/src/commonMain/kotlin/androidx/navigation3/RecordProvider.kt b/navigation3/navigation3/src/commonMain/kotlin/androidx/navigation3/RecordProvider.kt
deleted file mode 100644
index 7f6dd14..0000000
--- a/navigation3/navigation3/src/commonMain/kotlin/androidx/navigation3/RecordProvider.kt
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * Copyright 2024 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package androidx.navigation3
-
-import androidx.compose.runtime.Composable
-import kotlin.reflect.KClass
-
-@DslMarker public annotation class RecordDsl
-
-/** Creates an [RecordProviderBuilder] with the record providers provided in the builder. */
-public inline fun recordProvider(
-    noinline fallback: (unknownScreen: Any) -> NavRecord<*> = {
-        throw IllegalStateException("Unknown screen $it")
-    },
-    builder: RecordProviderBuilder.() -> Unit
-): (Any) -> NavRecord<*> = RecordProviderBuilder(fallback).apply(builder).build()
-
-/** DSL for constructing a new [NavRecord] */
-@Suppress("TopLevelBuilder")
-@RecordDsl
-public class RecordProviderBuilder(private val fallback: (unknownScreen: Any) -> NavRecord<*>) {
-    private val clazzProviders = mutableMapOf<KClass<*>, RecordClassProvider<*>>()
-    private val providers = mutableMapOf<Any, RecordProvider<*>>()
-
-    /** Builds a [NavRecord] for the given [key] that displays [content]. */
-    @Suppress("SetterReturnsThis", "MissingGetterMatchingBuilder")
-    public fun <T : Any> addRecordProvider(
-        key: T,
-        featureMap: Map<String, Any> = emptyMap(),
-        content: @Composable (T) -> Unit,
-    ) {
-        require(key !in providers) {
-            "A `record` with the key `key` has already been added: ${key}."
-        }
-        providers[key] = RecordProvider(key, featureMap, content)
-    }
-
-    /** Builds a [NavRecord] for the given [clazz] that displays [content]. */
-    @Suppress("SetterReturnsThis", "MissingGetterMatchingBuilder")
-    public fun <T : Any> addRecordProvider(
-        clazz: KClass<T>,
-        featureMap: Map<String, Any> = emptyMap(),
-        content: @Composable (T) -> Unit,
-    ) {
-        require(clazz !in clazzProviders) {
-            "A `record` with the same `clazz` has already been added: ${clazz.simpleName}."
-        }
-        clazzProviders[clazz] = RecordClassProvider(clazz, featureMap, content)
-    }
-
-    /**
-     * Returns an instance of recordProvider created from the record providers set on this builder.
-     */
-    @Suppress("UNCHECKED_CAST")
-    public fun build(): (Any) -> NavRecord<*> = { key ->
-        val recordClassProvider = clazzProviders[key::class] as? RecordClassProvider<Any>
-        val recordProvider = providers[key] as? RecordProvider<Any>
-        recordClassProvider?.run { NavRecord(key, featureMap, content) }
-            ?: recordProvider?.run { NavRecord(key, featureMap, content) }
-            ?: fallback.invoke(key)
-    }
-}
-
-/** Add an record provider to the [RecordProviderBuilder] */
-public fun <T : Any> RecordProviderBuilder.record(
-    key: T,
-    featureMap: Map<String, Any> = emptyMap(),
-    content: @Composable (T) -> Unit,
-) {
-    addRecordProvider(key, featureMap, content)
-}
-
-/** Add an record provider to the [RecordProviderBuilder] */
-public inline fun <reified T : Any> RecordProviderBuilder.record(
-    featureMap: Map<String, Any> = emptyMap(),
-    noinline content: @Composable (T) -> Unit,
-) {
-    addRecordProvider(T::class, featureMap, content)
-}
-
-/** Holds a Record class, featureMap, and content for that class */
-public data class RecordClassProvider<T : Any>(
-    val clazz: KClass<T>,
-    val featureMap: Map<String, Any>,
-    val content: @Composable (T) -> Unit,
-)
-
-/** Holds a Record class, featureMap, and content for that key */
-public data class RecordProvider<T : Any>(
-    val key: T,
-    val featureMap: Map<String, Any>,
-    val content: @Composable (T) -> Unit,
-)
diff --git a/navigation3/navigation3/src/commonMain/kotlin/androidx/navigation3/SaveableStateNavContentWrapper.kt b/navigation3/navigation3/src/commonMain/kotlin/androidx/navigation3/SaveableStateNavLocalProvider.kt
similarity index 85%
rename from navigation3/navigation3/src/commonMain/kotlin/androidx/navigation3/SaveableStateNavContentWrapper.kt
rename to navigation3/navigation3/src/commonMain/kotlin/androidx/navigation3/SaveableStateNavLocalProvider.kt
index 9c6443f..69451da 100644
--- a/navigation3/navigation3/src/commonMain/kotlin/androidx/navigation3/SaveableStateNavContentWrapper.kt
+++ b/navigation3/navigation3/src/commonMain/kotlin/androidx/navigation3/SaveableStateNavLocalProvider.kt
@@ -24,19 +24,19 @@
 import androidx.compose.runtime.saveable.rememberSaveableStateHolder
 
 /**
- * Wraps the content of a [NavRecord] with a [SaveableStateHolder.SaveableStateProvider] to ensure
+ * Wraps the content of a [NavEntry] with a [SaveableStateHolder.SaveableStateProvider] to ensure
  * that calls to [rememberSaveable] within the content work properly and that state can be saved.
  *
- * This [NavContentWrapper] is the only one that is **required** as saving state is considered a
+ * This [NavLocalProvider] is the only one that is **required** as saving state is considered a
  * non-optional feature.
  */
-public class SaveableStateNavContentWrapper : NavContentWrapper {
+public class SaveableStateNavLocalProvider : NavLocalProvider {
     private var savedStateHolder: SaveableStateHolder? = null
     private val refCount: MutableObjectIntMap<Any> = MutableObjectIntMap()
     private var backstackSize = 0
 
     @Composable
-    override fun WrapBackStack(backStack: List<Any>) {
+    override fun ProvideToBackStack(backStack: List<Any>) {
         DisposableEffect(key1 = backStack) {
             refCount.clear()
             onDispose {}
@@ -56,7 +56,7 @@
                                 .getOrElse(key) {
                                     error(
                                         "Attempting to incorrectly dispose of backstack state in " +
-                                            "SaveableStateNavContentWrapper"
+                                            "SaveableStateNavLocalProvider"
                                     )
                                 }
                                 .minus(1)
@@ -67,8 +67,8 @@
     }
 
     @Composable
-    public override fun <T : Any> WrapContent(record: NavRecord<T>) {
-        val key = record.key
+    public override fun <T : Any> ProvideToEntry(entry: NavEntry<T>) {
+        val key = entry.key
         DisposableEffect(key1 = key) {
             refCount[key] = refCount.getOrDefault(key, 0).plus(1)
             onDispose {
@@ -85,7 +85,7 @@
                             .getOrElse(key) {
                                 error(
                                     "Attempting to incorrectly dispose of state associated with " +
-                                        "key $key in SaveableStateNavContentWrapper"
+                                        "key $key in SaveableStateNavLocalProvider"
                                 )
                             }
                             .minus(1)
@@ -94,6 +94,6 @@
         }
 
         val id: Int = rememberSaveable(key) { key.hashCode() + backstackSize }
-        savedStateHolder?.SaveableStateProvider(id) { record.content.invoke(key) }
+        savedStateHolder?.SaveableStateProvider(id) { entry.content.invoke(key) }
     }
 }
diff --git a/navigation3/navigation3/src/commonMain/kotlin/androidx/navigation3/SavedStateNavContentWrapper.kt b/navigation3/navigation3/src/commonMain/kotlin/androidx/navigation3/SavedStateNavLocalProvider.kt
similarity index 83%
rename from navigation3/navigation3/src/commonMain/kotlin/androidx/navigation3/SavedStateNavContentWrapper.kt
rename to navigation3/navigation3/src/commonMain/kotlin/androidx/navigation3/SavedStateNavLocalProvider.kt
index c651c3d..56febae 100644
--- a/navigation3/navigation3/src/commonMain/kotlin/androidx/navigation3/SavedStateNavContentWrapper.kt
+++ b/navigation3/navigation3/src/commonMain/kotlin/androidx/navigation3/SavedStateNavLocalProvider.kt
@@ -33,29 +33,29 @@
 import androidx.savedstate.savedState
 
 /**
- * Provides the content of a [NavRecord] with a [SavedStateRegistryOwner] and provides that
+ * Provides the content of a [NavEntry] with a [SavedStateRegistryOwner] and provides that
  * [SavedStateRegistryOwner] as a [LocalSavedStateRegistryOwner] so that it is available within the
  * content.
  */
-public object SavedStateNavContentWrapper : NavContentWrapper {
+public object SavedStateNavLocalProvider : NavLocalProvider {
 
     @Composable
-    override fun <T : Any> WrapContent(record: NavRecord<T>) {
-        val key = record.key
+    override fun <T : Any> ProvideToEntry(entry: NavEntry<T>) {
+        val key = entry.key
         val childRegistry by
             rememberSaveable(
                 key,
                 stateSaver =
                     Saver(
                         save = { it.savedState },
-                        restore = { RecordSavedStateRegistry().apply { savedState = it } }
+                        restore = { EntrySavedStateRegistry().apply { savedState = it } }
                     )
             ) {
-                mutableStateOf(RecordSavedStateRegistry())
+                mutableStateOf(EntrySavedStateRegistry())
             }
 
         CompositionLocalProvider(LocalSavedStateRegistryOwner provides childRegistry) {
-            record.content.invoke(key)
+            entry.content.invoke(key)
         }
 
         DisposableEffect(key1 = key) {
@@ -70,7 +70,7 @@
     }
 }
 
-private class RecordSavedStateRegistry : SavedStateRegistryOwner {
+private class EntrySavedStateRegistry : SavedStateRegistryOwner {
     override val lifecycle: LifecycleRegistry = LifecycleRegistry(this)
     val savedStateRegistryController = SavedStateRegistryController.create(this)
     override val savedStateRegistry: SavedStateRegistry =
diff --git a/navigation3/navigation3/src/commonTest/kotlin/androidx/navigation3/RecordProviderTest.kt b/navigation3/navigation3/src/commonTest/kotlin/androidx/navigation3/EntryProviderTest.kt
similarity index 64%
rename from navigation3/navigation3/src/commonTest/kotlin/androidx/navigation3/RecordProviderTest.kt
rename to navigation3/navigation3/src/commonTest/kotlin/androidx/navigation3/EntryProviderTest.kt
index 67bb3e1..64e716e 100644
--- a/navigation3/navigation3/src/commonTest/kotlin/androidx/navigation3/RecordProviderTest.kt
+++ b/navigation3/navigation3/src/commonTest/kotlin/androidx/navigation3/EntryProviderTest.kt
@@ -20,40 +20,40 @@
 import kotlin.test.Test
 import kotlin.test.fail
 
-class RecordProviderTest {
+class EntryProviderTest {
 
     @Test
-    fun recordProvider_withUniqueInitializers_returnsRecords() {
-        val provider = recordProvider {
-            record("first") {}
-            record("second") {}
+    fun entryProvider_withUniqueInitializers_returnsEntries() {
+        val provider = entryProvider {
+            entry("first") {}
+            entry("second") {}
         }
 
-        val record1 = provider.invoke("first")
-        val record2 = provider.invoke("second")
+        val entry1 = provider.invoke("first")
+        val entry2 = provider.invoke("second")
 
-        assertThat(record1.key).isEqualTo("first")
-        assertThat(record2.key).isEqualTo("second")
+        assertThat(entry1.key).isEqualTo("first")
+        assertThat(entry2.key).isEqualTo("second")
     }
 
     @Test
-    fun recordProvider_withDuplicatedInitializers_throwsException() {
+    fun entryProvider_withDuplicatedInitializers_throwsException() {
         try {
-            recordProvider {
-                record("first") {}
-                record("first") {}
+            entryProvider {
+                entry("first") {}
+                entry("first") {}
             }
             fail("Expected `IllegalArgumentException` but no exception has been throw.")
         } catch (e: IllegalArgumentException) {
             assertThat(e)
                 .hasMessageThat()
-                .isEqualTo("A `record` with the key `key` has already been added: first.")
+                .isEqualTo("An `entry` with the key `key` has already been added: first.")
         }
     }
 
     @Test
-    fun recordProvider_noInitializers_getsInvalidRecord() {
-        val provider = recordProvider {}
+    fun entryProvider_noInitializers_getsInvalidEntry() {
+        val provider = entryProvider {}
         try {
             provider.invoke("something")
             fail("Expected `IllegalStateException` but no exception has been throw.")
diff --git a/navigation3/navigation3/src/commonTest/kotlin/androidx/navigation3/RecordTest.kt b/navigation3/navigation3/src/commonTest/kotlin/androidx/navigation3/RecordTest.kt
index b049d3f..863305e 100644
--- a/navigation3/navigation3/src/commonTest/kotlin/androidx/navigation3/RecordTest.kt
+++ b/navigation3/navigation3/src/commonTest/kotlin/androidx/navigation3/RecordTest.kt
@@ -19,24 +19,24 @@
 import androidx.kruth.assertThat
 import kotlin.test.Test
 
-class RecordTest {
+class EntryTest {
 
     @Test
     fun getKey() {
-        val record = NavRecord(key = "myKey", content = {})
-        assertThat(record.key).isEqualTo("myKey")
+        val entry = NavEntry(key = "myKey", content = {})
+        assertThat(entry.key).isEqualTo("myKey")
     }
 
     @Test
     fun getFeatureMap() {
-        val record =
-            NavRecord(
+        val entry =
+            NavEntry(
                 key = "myKey",
                 featureMap = mapOf("feature1" to 1, "feature2" to MyObject),
                 content = {}
             )
-        assertThat(record.featureMap["feature1"]).isEqualTo(1)
-        assertThat(record.featureMap["feature2"]).isEqualTo(MyObject)
+        assertThat(entry.featureMap["feature1"]).isEqualTo(1)
+        assertThat(entry.featureMap["feature2"]).isEqualTo(MyObject)
     }
 
     object MyObject
diff --git a/pdf/pdf-viewer-fragment/src/main/java/androidx/pdf/viewer/fragment/PdfViewerFragment.kt b/pdf/pdf-viewer-fragment/src/main/java/androidx/pdf/viewer/fragment/PdfViewerFragment.kt
index 3d44721..1dc4afe 100644
--- a/pdf/pdf-viewer-fragment/src/main/java/androidx/pdf/viewer/fragment/PdfViewerFragment.kt
+++ b/pdf/pdf-viewer-fragment/src/main/java/androidx/pdf/viewer/fragment/PdfViewerFragment.kt
@@ -853,9 +853,9 @@
     private fun resetViewsAndModels(fileUri: Uri) {
         if (pdfLoader != null) {
             pdfLoaderCallbacks?.uri = fileUri
-            paginatedView?.resetModels()
             destroyContentModel()
         }
+        paginatedView?.resetModels()
         fastScrollView?.resetContents()
         findInFileView?.resetFindInFile()
     }
diff --git a/pdf/pdf-viewer-fragment/src/main/kotlin/androidx/pdf/viewer/fragment/PdfViewerFragmentV2.kt b/pdf/pdf-viewer-fragment/src/main/kotlin/androidx/pdf/viewer/fragment/PdfViewerFragmentV2.kt
index ec8233d..19b75a2 100644
--- a/pdf/pdf-viewer-fragment/src/main/kotlin/androidx/pdf/viewer/fragment/PdfViewerFragmentV2.kt
+++ b/pdf/pdf-viewer-fragment/src/main/kotlin/androidx/pdf/viewer/fragment/PdfViewerFragmentV2.kt
@@ -52,7 +52,6 @@
 import androidx.pdf.viewer.fragment.search.PdfSearchViewManager
 import androidx.pdf.viewer.fragment.util.getCenter
 import androidx.pdf.viewer.fragment.view.PdfViewManager
-import com.google.android.material.color.MaterialColors
 import kotlinx.coroutines.Job
 import kotlinx.coroutines.launch
 
@@ -202,19 +201,9 @@
         pdfViewManager =
             PdfViewManager(
                 pdfView = pdfView,
-                // TODO(b/385684706): Update colors for highlights
                 selectedHighlightColor =
-                    MaterialColors.getColor(
-                        pdfView,
-                        com.google.android.material.R.attr.colorPrimaryFixed,
-                        requireContext().getColor(R.color.selected_highlight_color)
-                    ),
-                highlightColor =
-                    MaterialColors.getColor(
-                        pdfView,
-                        com.google.android.material.R.attr.colorSecondaryFixedDim,
-                        requireContext().getColor(R.color.highlight_color)
-                    )
+                    requireContext().getColor(R.color.selected_highlight_color),
+                highlightColor = requireContext().getColor(R.color.highlight_color)
             )
         pdfSearchViewManager = PdfSearchViewManager(pdfSearchView)
 
diff --git a/performance/performance-annotation/README.md b/performance/performance-annotation/README.md
index b37c607..2ab0c3d 100644
--- a/performance/performance-annotation/README.md
+++ b/performance/performance-annotation/README.md
@@ -1 +1 @@
-The annotation defined in this library only affects Android.
+This library is a **compile-time** only dependency.
diff --git a/performance/performance-annotation/src/androidMain/kotlin/dalvik/annotation/optimization/NeverInline.android.kt b/performance/performance-annotation/src/androidMain/kotlin/dalvik/annotation/optimization/NeverInline.android.kt
index a44f0ff..50e22dc 100644
--- a/performance/performance-annotation/src/androidMain/kotlin/dalvik/annotation/optimization/NeverInline.android.kt
+++ b/performance/performance-annotation/src/androidMain/kotlin/dalvik/annotation/optimization/NeverInline.android.kt
@@ -14,10 +14,8 @@
  * limitations under the License.
  */
 
-@file:Suppress("RedundantVisibilityModifier")
-
 package dalvik.annotation.optimization
 
 @Retention(AnnotationRetention.BINARY)
 @Target(AnnotationTarget.CONSTRUCTOR, AnnotationTarget.FUNCTION)
-public actual annotation class NeverInline
+public actual annotation class NeverInline()
diff --git a/performance/performance-annotation/src/commonMain/kotlin/dalvik/annotation/optimization/NeverInline.kt b/performance/performance-annotation/src/commonMain/kotlin/dalvik/annotation/optimization/NeverInline.kt
index 99f736b..89cbfe3 100644
--- a/performance/performance-annotation/src/commonMain/kotlin/dalvik/annotation/optimization/NeverInline.kt
+++ b/performance/performance-annotation/src/commonMain/kotlin/dalvik/annotation/optimization/NeverInline.kt
@@ -15,7 +15,6 @@
  */
 
 @file:OptIn(ExperimentalMultiplatform::class)
-@file:Suppress("RedundantVisibilityModifier")
 
 package dalvik.annotation.optimization
 
diff --git a/privacysandbox/ui/integration-tests/mediateesdkproviderwrapper/build.gradle b/privacysandbox/ui/integration-tests/mediateesdkproviderwrapper/build.gradle
index 5aed355..88365c64 100644
--- a/privacysandbox/ui/integration-tests/mediateesdkproviderwrapper/build.gradle
+++ b/privacysandbox/ui/integration-tests/mediateesdkproviderwrapper/build.gradle
@@ -28,6 +28,10 @@
     minSdk = 21
     buildToolsVersion = AndroidXConfig.getDefaultAndroidConfig(project).buildToolsVersion
 
+    //TODO(b/389890488): This is added to suppress missing stub classes warning from ui-compose.
+    //Can be removed once linked bug is fixed.
+    optimization.keepRules.files += project.file('proguard-rules.pro')
+
     bundle {
         packageName = "androidx.privacysandbox.ui.integration.mediateesdkproviderwrapper"
 
diff --git a/privacysandbox/ui/integration-tests/mediateesdkproviderwrapper/proguard-rules.pro b/privacysandbox/ui/integration-tests/mediateesdkproviderwrapper/proguard-rules.pro
new file mode 100644
index 0000000..13de6f6
--- /dev/null
+++ b/privacysandbox/ui/integration-tests/mediateesdkproviderwrapper/proguard-rules.pro
@@ -0,0 +1,13 @@
+# Add project specific ProGuard rules here.
+# You can control the set of applied configuration files using the
+# proguardFiles setting in build.gradle.
+#
+# For more details, see
+#   http://developer.android.com/guide/developing/tools/proguard.html
+
+# We supply these as stubs and are able to link to them at runtime
+# because they are hidden public classes in Android. We don't want
+# R8 to complain about them not being there during optimization.
+-dontwarn android.view.RenderNode
+-dontwarn android.view.DisplayListCanvas
+-dontwarn android.view.HardwareCanvas
diff --git a/privacysandbox/ui/integration-tests/testapp/build.gradle b/privacysandbox/ui/integration-tests/testapp/build.gradle
index 7ec0127..a9a297b 100644
--- a/privacysandbox/ui/integration-tests/testapp/build.gradle
+++ b/privacysandbox/ui/integration-tests/testapp/build.gradle
@@ -16,9 +16,9 @@
 
 plugins {
     id("AndroidXPlugin")
+    id("AndroidXComposePlugin")
     id("com.android.application")
     id("org.jetbrains.kotlin.android")
-    id("AndroidXComposePlugin")
 }
 
 android {
@@ -45,6 +45,7 @@
 dependencies {
     implementation(libs.kotlinStdlib)
     api("androidx.annotation:annotation:1.8.1")
+
     implementation("androidx.core:core-ktx:1.8.0")
     implementation("androidx.appcompat:appcompat:1.6.0")
     implementation("com.google.android.material:material:1.6.0")
@@ -52,9 +53,7 @@
     implementation("androidx.drawerlayout:drawerlayout:1.2.0")
     implementation("androidx.constraintlayout:constraintlayout:2.0.1")
     implementation("androidx.recyclerview:recyclerview:1.3.2")
-    implementation("androidx.compose.foundation:foundation-layout:1.7.5")
-    implementation("androidx.compose.material3:material3-android:1.3.1")
-    implementation("androidx.compose.ui:ui-util:1.7.5")
+    implementation("androidx.compose.material3:material3:1.3.1")
     implementation(project(":privacysandbox:activity:activity-core"))
     implementation(project(":privacysandbox:activity:activity-client"))
     implementation(project(":privacysandbox:sdkruntime:sdkruntime-client"))
diff --git a/privacysandbox/ui/integration-tests/testapp/src/main/java/androidx/privacysandbox/ui/integration/testapp/BaseFragment.kt b/privacysandbox/ui/integration-tests/testapp/src/main/java/androidx/privacysandbox/ui/integration/testapp/BaseFragment.kt
index 56e84a8..3559d29 100644
--- a/privacysandbox/ui/integration-tests/testapp/src/main/java/androidx/privacysandbox/ui/integration/testapp/BaseFragment.kt
+++ b/privacysandbox/ui/integration-tests/testapp/src/main/java/androidx/privacysandbox/ui/integration/testapp/BaseFragment.kt
@@ -23,6 +23,9 @@
 import android.view.View
 import android.view.ViewGroup
 import android.widget.TextView
+import androidx.compose.runtime.getValue
+import androidx.compose.runtime.mutableStateOf
+import androidx.compose.runtime.setValue
 import androidx.fragment.app.Fragment
 import androidx.privacysandbox.sdkruntime.client.SdkSandboxManagerCompat
 import androidx.privacysandbox.ui.client.SandboxedUiAdapterFactory
@@ -46,6 +49,7 @@
 
     private lateinit var sdkSandboxManager: SdkSandboxManagerCompat
     private lateinit var activity: Activity
+    protected var providerUiOnTop by mutableStateOf(true)
 
     override fun onCreate(savedInstanceState: Bundle?) {
         super.onCreate(savedInstanceState)
@@ -117,9 +121,8 @@
     }
 
     open fun handleDrawerStateChange(isDrawerOpen: Boolean) {
-        getSandboxedSdkViews().forEach {
-            it.orderProviderUiAboveClientUi(!isDrawerOpen && isZOrderOnTop)
-        }
+        providerUiOnTop = !isDrawerOpen && !isZOrderBelowToggleChecked
+        getSandboxedSdkViews().forEach { it.orderProviderUiAboveClientUi(providerUiOnTop) }
     }
 
     private inner class TestEventListener(val view: SandboxedSdkView) :
@@ -147,7 +150,7 @@
         private const val MEDIATEE_SDK_NAME =
             "androidx.privacysandbox.ui.integration.mediateesdkproviderwrapper"
         const val TAG = "TestSandboxClient"
-        var isZOrderOnTop = true
+        var isZOrderBelowToggleChecked = false
         @AdType var currentAdType = AdType.BASIC_NON_WEBVIEW
         @MediationOption var currentMediationOption = MediationOption.NON_MEDIATED
         var shouldDrawViewabilityLayer = false
diff --git a/privacysandbox/ui/integration-tests/testapp/src/main/java/androidx/privacysandbox/ui/integration/testapp/MainActivity.kt b/privacysandbox/ui/integration-tests/testapp/src/main/java/androidx/privacysandbox/ui/integration/testapp/MainActivity.kt
index 8ba632c..8467ece 100644
--- a/privacysandbox/ui/integration-tests/testapp/src/main/java/androidx/privacysandbox/ui/integration/testapp/MainActivity.kt
+++ b/privacysandbox/ui/integration-tests/testapp/src/main/java/androidx/privacysandbox/ui/integration/testapp/MainActivity.kt
@@ -237,7 +237,7 @@
 
     private fun initializeZOrderToggleButton() {
         zOrderToggleButton.setOnCheckedChangeListener { _, isChecked ->
-            BaseFragment.isZOrderOnTop = !isChecked
+            BaseFragment.isZOrderBelowToggleChecked = isChecked
         }
     }
 
@@ -290,8 +290,24 @@
 
     private fun selectCuj(menuItem: MenuItem) {
         when (menuItem.itemId) {
-            R.id.item_resize -> switchContentFragment(ResizeFragment(), menuItem.title)
-            R.id.item_scroll -> switchContentFragment(ScrollFragment(), menuItem.title)
+            R.id.item_resize ->
+                if (useCompose) {
+                    switchContentFragment(
+                        ResizeComposeFragment(),
+                        "${menuItem.title} ${getString(R.string.compose)}"
+                    )
+                } else {
+                    switchContentFragment(ResizeFragment(), menuItem.title)
+                }
+            R.id.item_scroll ->
+                if (useCompose) {
+                    switchContentFragment(
+                        ScrollComposeFragment(),
+                        "${menuItem.title} ${getString(R.string.compose)}"
+                    )
+                } else {
+                    switchContentFragment(ScrollFragment(), menuItem.title)
+                }
             R.id.item_pooling_container ->
                 switchContentFragment(PoolingContainerFragment(), menuItem.title)
             R.id.item_fullscreen ->
diff --git a/privacysandbox/ui/integration-tests/testapp/src/main/java/androidx/privacysandbox/ui/integration/testapp/PoolingContainerFragment.kt b/privacysandbox/ui/integration-tests/testapp/src/main/java/androidx/privacysandbox/ui/integration/testapp/PoolingContainerFragment.kt
index abdf0d4..fd5d6e9 100644
--- a/privacysandbox/ui/integration-tests/testapp/src/main/java/androidx/privacysandbox/ui/integration/testapp/PoolingContainerFragment.kt
+++ b/privacysandbox/ui/integration-tests/testapp/src/main/java/androidx/privacysandbox/ui/integration/testapp/PoolingContainerFragment.kt
@@ -38,7 +38,7 @@
 
     override fun handleDrawerStateChange(isDrawerOpen: Boolean) {
         super.handleDrawerStateChange(isDrawerOpen)
-        (recyclerView.adapter as CustomAdapter).zOrderOnTop = !isDrawerOpen && isZOrderOnTop
+        (recyclerView.adapter as CustomAdapter).zOrderOnTop = providerUiOnTop
     }
 
     override fun handleLoadAdFromDrawer(
diff --git a/privacysandbox/ui/integration-tests/testapp/src/main/java/androidx/privacysandbox/ui/integration/testapp/ResizeComposeFragment.kt b/privacysandbox/ui/integration-tests/testapp/src/main/java/androidx/privacysandbox/ui/integration/testapp/ResizeComposeFragment.kt
new file mode 100644
index 0000000..c537976
--- /dev/null
+++ b/privacysandbox/ui/integration-tests/testapp/src/main/java/androidx/privacysandbox/ui/integration/testapp/ResizeComposeFragment.kt
@@ -0,0 +1,152 @@
+/*
+ * Copyright 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package androidx.privacysandbox.ui.integration.testapp
+
+import android.os.Bundle
+import android.view.LayoutInflater
+import android.view.View
+import android.view.ViewGroup
+import androidx.compose.foundation.layout.Arrangement
+import androidx.compose.foundation.layout.Column
+import androidx.compose.foundation.layout.fillMaxSize
+import androidx.compose.foundation.layout.fillMaxWidth
+import androidx.compose.foundation.layout.padding
+import androidx.compose.foundation.layout.width
+import androidx.compose.material3.Button
+import androidx.compose.material3.Text
+import androidx.compose.runtime.Composable
+import androidx.compose.runtime.getValue
+import androidx.compose.runtime.mutableStateOf
+import androidx.compose.runtime.setValue
+import androidx.compose.ui.Alignment
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.platform.ComposeView
+import androidx.compose.ui.platform.ViewCompositionStrategy
+import androidx.compose.ui.unit.Dp
+import androidx.compose.ui.unit.dp
+import androidx.privacysandbox.ui.client.SandboxedUiAdapterFactory
+import androidx.privacysandbox.ui.client.view.SandboxedSdkUi
+import androidx.privacysandbox.ui.client.view.SandboxedSdkViewEventListener
+import androidx.privacysandbox.ui.core.SandboxedUiAdapter
+import kotlinx.coroutines.MainScope
+import kotlinx.coroutines.launch
+
+class ResizeComposeFragment : BaseFragment() {
+
+    private var adapter: SandboxedUiAdapter? by mutableStateOf(null)
+    private var adEventText by mutableStateOf("")
+    private var bannerDimension by mutableStateOf(BannerDimension())
+    private val onBannerDimensionChanged: (BannerDimension) -> Unit = { currentDimension ->
+        val displayMetrics = resources.displayMetrics
+        val maxSizePixels = Math.min(displayMetrics.widthPixels, displayMetrics.heightPixels)
+        val newSize = { currentSize: Int, maxSize: Int ->
+            (currentSize + (100..200).random()) % maxSize
+        }
+        val newWidth = newSize(currentDimension.width.value.toInt(), maxSizePixels).dp
+        val newHeight = newSize(currentDimension.height.value.toInt(), maxSizePixels).dp
+        bannerDimension = BannerDimension(newWidth, newHeight)
+    }
+
+    override fun handleLoadAdFromDrawer(
+        adType: Int,
+        mediationOption: Int,
+        drawViewabilityLayer: Boolean
+    ) {
+        currentAdType = adType
+        currentMediationOption = mediationOption
+        shouldDrawViewabilityLayer = drawViewabilityLayer
+        setAdAdapter()
+    }
+
+    override fun onCreateView(
+        inflater: LayoutInflater,
+        container: ViewGroup?,
+        savedInstanceState: Bundle?
+    ): View {
+        setAdAdapter()
+        return ComposeView(requireContext()).apply {
+            // Dispose of the Composition when the view's LifecycleOwner is destroyed
+            setViewCompositionStrategy(ViewCompositionStrategy.DisposeOnViewTreeLifecycleDestroyed)
+            setContent { ResizeableBannerAd(adapter, bannerDimension, onBannerDimensionChanged) }
+        }
+    }
+
+    @Composable
+    fun ResizeableBannerAd(
+        adapter: SandboxedUiAdapter?,
+        bannerDimension: BannerDimension,
+        onResizeClicked: (BannerDimension) -> Unit
+    ) {
+        Column(
+            modifier = Modifier.fillMaxSize().padding(16.dp),
+            verticalArrangement = Arrangement.Top,
+            horizontalAlignment = Alignment.Start
+        ) {
+            val sandboxedSdkUiModifier =
+                if (bannerDimension.height != 0.dp && bannerDimension.width != 0.dp) {
+                    Modifier.width(bannerDimension.width)
+                        .weight(
+                            1f,
+                        )
+                } else {
+                    Modifier.fillMaxWidth().weight(1f)
+                }
+
+            Text("Ad state: $adEventText")
+            if (adapter != null) {
+                SandboxedSdkUi(
+                    adapter,
+                    sandboxedSdkUiModifier,
+                    providerUiOnTop = providerUiOnTop,
+                    sandboxedSdkViewEventListener =
+                        object : SandboxedSdkViewEventListener {
+                            override fun onUiDisplayed() {
+                                adEventText = "Ad is visible"
+                            }
+
+                            override fun onUiError(error: Throwable) {
+                                adEventText = "Error loading ad : ${error.message}"
+                            }
+
+                            override fun onUiClosed() {
+                                adEventText = "Ad session is closed"
+                            }
+                        },
+                )
+            }
+            Button(onClick = { onResizeClicked(bannerDimension) }) { Text("Resize") }
+        }
+    }
+
+    private fun setAdAdapter() {
+        val coroutineScope = MainScope()
+        coroutineScope.launch {
+            adapter =
+                SandboxedUiAdapterFactory.createFromCoreLibInfo(
+                    getSdkApi()
+                        .loadBannerAd(
+                            currentAdType,
+                            currentMediationOption,
+                            false,
+                            shouldDrawViewabilityLayer,
+                        )
+                )
+        }
+    }
+
+    data class BannerDimension(val width: Dp = 0.dp, val height: Dp = 0.dp)
+}
diff --git a/privacysandbox/ui/integration-tests/testapp/src/main/java/androidx/privacysandbox/ui/integration/testapp/ScrollComposeFragment.kt b/privacysandbox/ui/integration-tests/testapp/src/main/java/androidx/privacysandbox/ui/integration/testapp/ScrollComposeFragment.kt
new file mode 100644
index 0000000..6acfb9c
--- /dev/null
+++ b/privacysandbox/ui/integration-tests/testapp/src/main/java/androidx/privacysandbox/ui/integration/testapp/ScrollComposeFragment.kt
@@ -0,0 +1,121 @@
+/*
+ * Copyright 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 androidx.privacysandbox.ui.integration.testapp
+
+import android.os.Bundle
+import android.view.LayoutInflater
+import android.view.View
+import android.view.ViewGroup
+import androidx.compose.foundation.layout.Arrangement
+import androidx.compose.foundation.layout.Column
+import androidx.compose.foundation.layout.fillMaxSize
+import androidx.compose.foundation.layout.fillMaxWidth
+import androidx.compose.foundation.layout.height
+import androidx.compose.foundation.layout.padding
+import androidx.compose.foundation.rememberScrollState
+import androidx.compose.foundation.verticalScroll
+import androidx.compose.material3.Text
+import androidx.compose.runtime.getValue
+import androidx.compose.runtime.mutableStateOf
+import androidx.compose.runtime.setValue
+import androidx.compose.ui.Alignment
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.platform.ComposeView
+import androidx.compose.ui.platform.ViewCompositionStrategy
+import androidx.compose.ui.res.stringResource
+import androidx.compose.ui.unit.dp
+import androidx.privacysandbox.ui.client.SandboxedUiAdapterFactory
+import androidx.privacysandbox.ui.client.view.SandboxedSdkUi
+import androidx.privacysandbox.ui.core.SandboxedUiAdapter
+import kotlinx.coroutines.MainScope
+import kotlinx.coroutines.launch
+
+class ScrollComposeFragment : BaseFragment() {
+
+    private var bottomBannerAdapter: SandboxedUiAdapter? by mutableStateOf(null)
+    private var scrollBannerAdapter: SandboxedUiAdapter? by mutableStateOf(null)
+
+    override fun handleLoadAdFromDrawer(
+        adType: Int,
+        mediationOption: Int,
+        drawViewabilityLayer: Boolean
+    ) {
+        currentAdType = adType
+        currentMediationOption = mediationOption
+        shouldDrawViewabilityLayer = drawViewabilityLayer
+        setAdapter()
+    }
+
+    override fun onCreateView(
+        inflater: LayoutInflater,
+        container: ViewGroup?,
+        savedInstanceState: Bundle?
+    ): View {
+        setAdapter()
+        return ComposeView(requireContext()).apply {
+            // Dispose of the Composition when the view's LifecycleOwner is destroyed
+            setViewCompositionStrategy(ViewCompositionStrategy.DisposeOnViewTreeLifecycleDestroyed)
+            setContent {
+                Column(
+                    modifier = Modifier.fillMaxSize().padding(16.dp),
+                    verticalArrangement = Arrangement.Top,
+                    horizontalAlignment = Alignment.Start
+                ) {
+                    Column(modifier = Modifier.weight(0.8f).verticalScroll(rememberScrollState())) {
+                        scrollBannerAdapter?.let {
+                            SandboxedSdkUi(
+                                it,
+                                Modifier.fillMaxWidth().height(200.dp),
+                                providerUiOnTop = providerUiOnTop
+                            )
+                        }
+                        Text(stringResource(R.string.long_text), Modifier.padding(vertical = 16.dp))
+                    }
+                    bottomBannerAdapter?.let {
+                        SandboxedSdkUi(it, Modifier.weight(0.2f), providerUiOnTop = providerUiOnTop)
+                    }
+                }
+            }
+        }
+    }
+
+    private fun setAdapter() {
+        val coroutineScope = MainScope()
+        coroutineScope.launch {
+            bottomBannerAdapter =
+                SandboxedUiAdapterFactory.createFromCoreLibInfo(
+                    getSdkApi()
+                        .loadBannerAd(
+                            currentAdType,
+                            currentMediationOption,
+                            false,
+                            shouldDrawViewabilityLayer,
+                        )
+                )
+            scrollBannerAdapter =
+                SandboxedUiAdapterFactory.createFromCoreLibInfo(
+                    getSdkApi()
+                        .loadBannerAd(
+                            currentAdType,
+                            currentMediationOption,
+                            false,
+                            shouldDrawViewabilityLayer,
+                        )
+                )
+        }
+    }
+}
diff --git a/privacysandbox/ui/integration-tests/testapp/src/main/res/values/strings.xml b/privacysandbox/ui/integration-tests/testapp/src/main/res/values/strings.xml
index cfdbb065..143c337 100644
--- a/privacysandbox/ui/integration-tests/testapp/src/main/res/values/strings.xml
+++ b/privacysandbox/ui/integration-tests/testapp/src/main/res/values/strings.xml
@@ -16,6 +16,7 @@
 
 <resources>
     <string name="resize_cuj">Resize CUJ</string>
+    <string name="compose">Compose</string>
     <string name="scroll_cuj">Scroll CUJ</string>
     <string name="poolingcontainer_cuj">PoolingContainer CUJ</string>
     <string name="fullscreen_cuj">Fullscreen CUJ</string>
diff --git a/privacysandbox/ui/integration-tests/testsdkproviderwrapper/build.gradle b/privacysandbox/ui/integration-tests/testsdkproviderwrapper/build.gradle
index 96d56fa..0532e9c 100644
--- a/privacysandbox/ui/integration-tests/testsdkproviderwrapper/build.gradle
+++ b/privacysandbox/ui/integration-tests/testsdkproviderwrapper/build.gradle
@@ -28,6 +28,10 @@
     minSdk = 21
     buildToolsVersion = AndroidXConfig.getDefaultAndroidConfig(project).buildToolsVersion
 
+    //TODO(b/389890488): This is added to suppress missing stub classes warning from ui-compose.
+    //Can be removed once linked bug is fixed.
+    optimization.keepRules.files += project.file('proguard-rules.pro')
+
     bundle {
         packageName = "androidx.privacysandbox.ui.integration.testsdkproviderwrapper"
 
diff --git a/privacysandbox/ui/integration-tests/testsdkproviderwrapper/proguard-rules.pro b/privacysandbox/ui/integration-tests/testsdkproviderwrapper/proguard-rules.pro
new file mode 100644
index 0000000..13de6f6
--- /dev/null
+++ b/privacysandbox/ui/integration-tests/testsdkproviderwrapper/proguard-rules.pro
@@ -0,0 +1,13 @@
+# Add project specific ProGuard rules here.
+# You can control the set of applied configuration files using the
+# proguardFiles setting in build.gradle.
+#
+# For more details, see
+#   http://developer.android.com/guide/developing/tools/proguard.html
+
+# We supply these as stubs and are able to link to them at runtime
+# because they are hidden public classes in Android. We don't want
+# R8 to complain about them not being there during optimization.
+-dontwarn android.view.RenderNode
+-dontwarn android.view.DisplayListCanvas
+-dontwarn android.view.HardwareCanvas
diff --git a/privacysandbox/ui/ui-client/api/current.txt b/privacysandbox/ui/ui-client/api/current.txt
index a3d0e4d..94a15f0 100644
--- a/privacysandbox/ui/ui-client/api/current.txt
+++ b/privacysandbox/ui/ui-client/api/current.txt
@@ -10,6 +10,10 @@
 
 package androidx.privacysandbox.ui.client.view {
 
+  public final class SandboxedSdkUiKt {
+    method @androidx.compose.runtime.Composable public static void SandboxedSdkUi(androidx.privacysandbox.ui.core.SandboxedUiAdapter sandboxedUiAdapter, optional androidx.compose.ui.Modifier modifier, optional boolean providerUiOnTop, optional androidx.privacysandbox.ui.client.view.SandboxedSdkViewEventListener? sandboxedSdkViewEventListener);
+  }
+
   public final class SandboxedSdkView extends android.view.ViewGroup {
     ctor public SandboxedSdkView(android.content.Context context);
     ctor public SandboxedSdkView(android.content.Context context, optional android.util.AttributeSet? attrs);
diff --git a/privacysandbox/ui/ui-client/api/restricted_current.txt b/privacysandbox/ui/ui-client/api/restricted_current.txt
index a3d0e4d..94a15f0 100644
--- a/privacysandbox/ui/ui-client/api/restricted_current.txt
+++ b/privacysandbox/ui/ui-client/api/restricted_current.txt
@@ -10,6 +10,10 @@
 
 package androidx.privacysandbox.ui.client.view {
 
+  public final class SandboxedSdkUiKt {
+    method @androidx.compose.runtime.Composable public static void SandboxedSdkUi(androidx.privacysandbox.ui.core.SandboxedUiAdapter sandboxedUiAdapter, optional androidx.compose.ui.Modifier modifier, optional boolean providerUiOnTop, optional androidx.privacysandbox.ui.client.view.SandboxedSdkViewEventListener? sandboxedSdkViewEventListener);
+  }
+
   public final class SandboxedSdkView extends android.view.ViewGroup {
     ctor public SandboxedSdkView(android.content.Context context);
     ctor public SandboxedSdkView(android.content.Context context, optional android.util.AttributeSet? attrs);
diff --git a/privacysandbox/ui/ui-client/build.gradle b/privacysandbox/ui/ui-client/build.gradle
index bec5091..7546329 100644
--- a/privacysandbox/ui/ui-client/build.gradle
+++ b/privacysandbox/ui/ui-client/build.gradle
@@ -27,12 +27,14 @@
     id("AndroidXPlugin")
     id("com.android.library")
     id("org.jetbrains.kotlin.android")
+    id("AndroidXComposePlugin")
 }
 
 dependencies {
     api(libs.kotlinStdlib)
     api("androidx.annotation:annotation:1.8.1")
     api("androidx.core:core:1.12.0")
+    api("androidx.compose.ui:ui:1.7.6")
     api("androidx.lifecycle:lifecycle-common:2.6.2")
     api("androidx.customview:customview-poolingcontainer:1.0.0")
     api(project(":privacysandbox:ui:ui-core"))
@@ -52,6 +54,9 @@
     androidTestImplementation(project(":appcompat:appcompat"))
     androidTestImplementation(project(":privacysandbox:ui:ui-provider"))
     androidTestImplementation(project(":privacysandbox:ui:integration-tests:testingutils"))
+    androidTestImplementation("androidx.compose.ui:ui-test-junit4:1.7.6")
+    androidTestImplementation("androidx.compose.foundation:foundation-layout:1.7.6")
+    debugImplementation("androidx.compose.ui:ui-test-manifest:1.7.6")
 }
 
 android {
diff --git a/privacysandbox/ui/ui-client/src/androidTest/AndroidManifest.xml b/privacysandbox/ui/ui-client/src/androidTest/AndroidManifest.xml
index 1f5dbd3..c245d56 100644
--- a/privacysandbox/ui/ui-client/src/androidTest/AndroidManifest.xml
+++ b/privacysandbox/ui/ui-client/src/androidTest/AndroidManifest.xml
@@ -1,5 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
+<?xml version="1.0" encoding="utf-8"?><!--
   Copyright 2022 The Android Open Source Project
 
   Licensed under the Apache License, Version 2.0 (the "License");
@@ -17,18 +16,24 @@
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:tools="http://schemas.android.com/tools">
     <!-- This override is okay because the associated tests only run on T+ -->
-    <uses-sdk tools:overrideLibrary="android_libs.ub_uiautomator, androidx.test.uiautomator" />
-    <application android:supportsRtl="true"
+    <application
+        android:supportsRtl="true"
         android:theme="@style/Theme.AppCompat">
-    <activity
-        android:name="androidx.privacysandbox.ui.client.test.UiLibActivity"
-        android:configChanges="orientation|screenSize"
-        android:exported="true"/>
-    <activity android:name=".SecondActivity"
-        android:exported="true"/>
+        <activity
+            android:name="androidx.privacysandbox.ui.client.test.UiLibActivity"
+            android:configChanges="orientation|screenSize"
+            android:exported="true" />
+        <activity
+            android:name="androidx.privacysandbox.ui.client.test.SecondActivity"
+            android:exported="true" />
+        <activity
+            android:name="androidx.privacysandbox.ui.client.test.UiLibComposeActivity"
+            android:configChanges="orientation|screenSize"
+            android:exported="true" />
     </application>
-
     <queries>
         <package android:name="androidx.privacysandbox.ui.client.test" />
     </queries>
+
+    <uses-sdk tools:overrideLibrary="android_libs.ub_uiautomator, androidx.test.uiautomator" />
 </manifest>
\ No newline at end of file
diff --git a/privacysandbox/ui/ui-client/src/androidTest/java/androidx/privacysandbox/ui/client/test/FailingTestSandboxedUiAdapter.kt b/privacysandbox/ui/ui-client/src/androidTest/java/androidx/privacysandbox/ui/client/test/FailingTestSandboxedUiAdapter.kt
new file mode 100644
index 0000000..79dd0c8
--- /dev/null
+++ b/privacysandbox/ui/ui-client/src/androidTest/java/androidx/privacysandbox/ui/client/test/FailingTestSandboxedUiAdapter.kt
@@ -0,0 +1,37 @@
+/*
+ * Copyright 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package androidx.privacysandbox.ui.client.test
+
+import android.content.Context
+import android.os.IBinder
+import androidx.privacysandbox.ui.core.SandboxedUiAdapter
+import androidx.privacysandbox.ui.provider.AbstractSandboxedUiAdapter
+import java.util.concurrent.Executor
+
+class FailingTestSandboxedUiAdapter : AbstractSandboxedUiAdapter() {
+    override fun openSession(
+        context: Context,
+        windowInputToken: IBinder,
+        initialWidth: Int,
+        initialHeight: Int,
+        isZOrderOnTop: Boolean,
+        clientExecutor: Executor,
+        client: SandboxedUiAdapter.SessionClient
+    ) {
+        clientExecutor.execute { client.onSessionError(Exception("Error in openSession()")) }
+    }
+}
diff --git a/privacysandbox/ui/ui-client/src/androidTest/java/androidx/privacysandbox/ui/client/test/SandboxedSdkUiTest.kt b/privacysandbox/ui/ui-client/src/androidTest/java/androidx/privacysandbox/ui/client/test/SandboxedSdkUiTest.kt
new file mode 100644
index 0000000..e057517
--- /dev/null
+++ b/privacysandbox/ui/ui-client/src/androidTest/java/androidx/privacysandbox/ui/client/test/SandboxedSdkUiTest.kt
@@ -0,0 +1,558 @@
+/*
+ * Copyright 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package androidx.privacysandbox.ui.client.test
+
+import android.annotation.SuppressLint
+import android.content.Intent
+import android.content.pm.ActivityInfo
+import android.util.DisplayMetrics
+import android.util.TypedValue
+import android.view.ViewGroup
+import android.view.ViewGroup.LayoutParams.WRAP_CONTENT
+import androidx.compose.foundation.layout.Box
+import androidx.compose.foundation.layout.fillMaxSize
+import androidx.compose.foundation.layout.offset
+import androidx.compose.foundation.layout.padding
+import androidx.compose.foundation.layout.requiredSize
+import androidx.compose.foundation.layout.size
+import androidx.compose.runtime.getValue
+import androidx.compose.runtime.mutableStateOf
+import androidx.compose.runtime.setValue
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.layout.onGloballyPositioned
+import androidx.compose.ui.platform.LocalDensity
+import androidx.compose.ui.test.junit4.createAndroidComposeRule
+import androidx.compose.ui.unit.Dp
+import androidx.compose.ui.unit.dp
+import androidx.lifecycle.Lifecycle
+import androidx.privacysandbox.ui.client.test.SandboxedSdkViewTest.Companion.SHORTEST_TIME_BETWEEN_SIGNALS_MS
+import androidx.privacysandbox.ui.client.test.SandboxedSdkViewTest.Companion.TIMEOUT
+import androidx.privacysandbox.ui.client.test.SandboxedSdkViewTest.Companion.UI_INTENSIVE_TIMEOUT
+import androidx.privacysandbox.ui.client.view.SandboxedSdkUi
+import androidx.privacysandbox.ui.client.view.SandboxedSdkView
+import androidx.privacysandbox.ui.integration.testingutils.TestEventListener
+import androidx.test.espresso.Espresso
+import androidx.test.espresso.assertion.ViewAssertions.matches
+import androidx.test.espresso.matcher.ViewMatchers.hasChildCount
+import androidx.test.espresso.matcher.ViewMatchers.isDisplayed
+import androidx.test.ext.junit.runners.AndroidJUnit4
+import androidx.test.filters.LargeTest
+import androidx.test.platform.app.InstrumentationRegistry
+import androidx.test.uiautomator.UiDevice
+import androidx.test.uiautomator.Until
+import androidx.testutils.withActivity
+import com.google.common.truth.Truth.assertThat
+import java.util.concurrent.CountDownLatch
+import java.util.concurrent.TimeUnit
+import kotlin.math.roundToInt
+import org.hamcrest.Matchers.instanceOf
+import org.junit.Before
+import org.junit.Rule
+import org.junit.Test
+import org.junit.runner.RunWith
+
+// TODO(b/374919355): Create a common test framework for testing Compose and View UI lib constructs
+@RunWith(AndroidJUnit4::class)
+@LargeTest
+class SandboxedSdkUiTest {
+    @get:Rule val composeTestRule = createAndroidComposeRule<UiLibComposeActivity>()
+    private var testSandboxedUiAdapter by mutableStateOf(TestSandboxedUiAdapter())
+    private var eventListener by mutableStateOf(TestEventListener())
+    private var providerUiOnTop by mutableStateOf(true)
+    private var size by mutableStateOf(20.dp)
+    private lateinit var uiDevice: UiDevice
+
+    @Before
+    fun setup() {
+        testSandboxedUiAdapter = TestSandboxedUiAdapter()
+        eventListener = TestEventListener()
+        providerUiOnTop = true
+        uiDevice = UiDevice.getInstance(InstrumentationRegistry.getInstrumentation())
+    }
+
+    @Test
+    fun eventListenerErrorTest() {
+        composeTestRule.setContent {
+            SandboxedSdkUi(
+                sandboxedUiAdapter = FailingTestSandboxedUiAdapter(),
+                modifier = Modifier,
+                providerUiOnTop = providerUiOnTop,
+                sandboxedSdkViewEventListener = eventListener
+            )
+        }
+        assertThat(eventListener.errorLatch.await(TIMEOUT, TimeUnit.MILLISECONDS)).isTrue()
+        assertThat(eventListener.error?.message).isEqualTo("Error in openSession()")
+    }
+
+    @Test
+    fun addEventListenerTest() {
+        // Initially no events are received when the session is not open.
+        assertThat(eventListener.uiDisplayedLatch.await(TIMEOUT, TimeUnit.MILLISECONDS)).isFalse()
+        // When session is open, the events are received
+        addNodeToLayout()
+        assertThat(eventListener.uiDisplayedLatch.await(TIMEOUT, TimeUnit.MILLISECONDS)).isTrue()
+    }
+
+    @Test
+    fun sessionNotOpenedWhenWindowIsNotVisibleTest() {
+        // the window is not visible when the activity is in the CREATED state.
+        composeTestRule.activityRule.scenario.moveToState(Lifecycle.State.CREATED)
+        addNodeToLayout()
+        testSandboxedUiAdapter.assertSessionNotOpened()
+        // the window becomes visible when the activity is in the STARTED state.
+        composeTestRule.activityRule.scenario.moveToState(Lifecycle.State.STARTED)
+        testSandboxedUiAdapter.assertSessionOpened()
+    }
+
+    @Test
+    fun onAttachedToWindowTest() {
+        addNodeToLayout()
+        testSandboxedUiAdapter.assertSessionOpened()
+        Espresso.onView(instanceOf(SandboxedSdkView::class.java))
+            .check(matches(isDisplayed()))
+            .check(matches(hasChildCount(1)))
+            .check { view, exception ->
+                if (
+                    view.layoutParams.width != WRAP_CONTENT ||
+                        view.layoutParams.height != WRAP_CONTENT
+                ) {
+                    throw exception
+                }
+            }
+    }
+
+    @Test
+    fun childViewRemovedOnErrorTest() {
+        addNodeToLayout()
+        testSandboxedUiAdapter.assertSessionOpened()
+        Espresso.onView(instanceOf(SandboxedSdkView::class.java)).check(matches(hasChildCount(1)))
+        composeTestRule.activityRule.withActivity {
+            testSandboxedUiAdapter.internalClient!!.onSessionError(Exception())
+        }
+        Espresso.onView(instanceOf(SandboxedSdkView::class.java)).check(matches(hasChildCount(0)))
+    }
+
+    @Test
+    fun onZOrderChangedTest() {
+        addNodeToLayout()
+        // When session is opened, the provider should not receive a Z-order notification.
+        testSandboxedUiAdapter.assertSessionOpened()
+        val session = testSandboxedUiAdapter.testSession
+        assertThat(session?.zOrderChangedLatch?.await(TIMEOUT, TimeUnit.MILLISECONDS)).isFalse()
+        assertThat(testSandboxedUiAdapter.isZOrderOnTop).isTrue()
+        // When state changes to false, the provider should be notified.
+        providerUiOnTop = false
+        composeTestRule.waitForIdle()
+        assertThat(session?.zOrderChangedLatch?.await(TIMEOUT, TimeUnit.MILLISECONDS)).isTrue()
+        assertThat(testSandboxedUiAdapter.isZOrderOnTop).isFalse()
+        // When state changes back to true, the provider should be notified.
+        session?.zOrderChangedLatch = CountDownLatch(1)
+        providerUiOnTop = true
+        composeTestRule.waitForIdle()
+        assertThat(session?.zOrderChangedLatch?.await(TIMEOUT, TimeUnit.MILLISECONDS)).isTrue()
+        assertThat(testSandboxedUiAdapter.isZOrderOnTop).isTrue()
+    }
+
+    @Test
+    fun setZOrderNotOnTopBeforeOpeningSessionTest() {
+        providerUiOnTop = false
+        addNodeToLayout()
+        testSandboxedUiAdapter.assertSessionOpened()
+        val session = testSandboxedUiAdapter.testSession
+        // The initial Z-order state is passed to the session, but notifyZOrderChanged is not called
+        assertThat(session?.zOrderChangedLatch?.await(TIMEOUT, TimeUnit.MILLISECONDS)).isFalse()
+        assertThat(testSandboxedUiAdapter.isZOrderOnTop).isFalse()
+    }
+
+    @Test
+    fun setZOrderNotOnTopWhileSessionLoadingTest() {
+        testSandboxedUiAdapter.delayOpenSessionCallback = true
+        addNodeToLayout()
+        testSandboxedUiAdapter.assertSessionOpened()
+        providerUiOnTop = false
+        composeTestRule.waitForIdle()
+        val session = testSandboxedUiAdapter.testSession!!
+        assertThat(session.zOrderChangedLatch.await(TIMEOUT, TimeUnit.MILLISECONDS)).isFalse()
+        composeTestRule.activityRule.withActivity { testSandboxedUiAdapter.sendOnSessionOpened() }
+        // After session has opened, the pending Z order changed made while loading is notified
+        // to the session.
+        assertThat(session.zOrderChangedLatch.await(TIMEOUT, TimeUnit.MILLISECONDS)).isTrue()
+        assertThat(testSandboxedUiAdapter.isZOrderOnTop).isFalse()
+    }
+
+    @Test
+    fun onConfigurationChangedSessionRemainsOpened() {
+        addNodeToLayout()
+        testSandboxedUiAdapter.assertSessionOpened()
+        // newWindow() will be triggered by a window state change, even if the activity handles
+        // orientation changes without recreating the activity.
+        uiDevice.performActionAndWait(
+            { uiDevice.setOrientationLeft() },
+            Until.newWindow(),
+            UI_INTENSIVE_TIMEOUT
+        )
+        testSandboxedUiAdapter.assertSessionNotClosed()
+        uiDevice.performActionAndWait(
+            { uiDevice.setOrientationNatural() },
+            Until.newWindow(),
+            UI_INTENSIVE_TIMEOUT
+        )
+        testSandboxedUiAdapter.assertSessionNotClosed()
+    }
+
+    @Test
+    fun onConfigurationChangedTestSameConfigurationTest() {
+        addNodeToLayout()
+        testSandboxedUiAdapter.assertSessionOpened()
+        composeTestRule.activityRule.withActivity {
+            requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_PORTRAIT
+        }
+        assertThat(testSandboxedUiAdapter.wasOnConfigChangedCalled()).isFalse()
+    }
+
+    @Test
+    fun onPaddingSetTest() {
+        var padding by mutableStateOf(0.dp)
+        composeTestRule.setContent {
+            SandboxedSdkUi(
+                sandboxedUiAdapter = testSandboxedUiAdapter,
+                modifier = Modifier.padding(all = padding),
+                providerUiOnTop = providerUiOnTop,
+                sandboxedSdkViewEventListener = eventListener
+            )
+        }
+        testSandboxedUiAdapter.assertSessionOpened()
+        padding = 10.dp
+        composeTestRule.waitForIdle()
+        assertThat(testSandboxedUiAdapter.wasNotifyResizedCalled()).isTrue()
+    }
+
+    @Test
+    fun signalsSentWhenPaddingApplied() {
+        var padding by mutableStateOf(0.dp)
+        composeTestRule.setContent {
+            SandboxedSdkUi(
+                sandboxedUiAdapter = testSandboxedUiAdapter,
+                modifier = Modifier.padding(all = padding),
+                providerUiOnTop = providerUiOnTop,
+                sandboxedSdkViewEventListener = eventListener
+            )
+        }
+        testSandboxedUiAdapter.assertSessionOpened()
+        val session = testSandboxedUiAdapter.testSession
+        session?.runAndRetrieveNextUiChange {
+            padding = 10.dp
+            composeTestRule.waitForIdle()
+        }
+        assertThat(session?.shortestGapBetweenUiChangeEvents)
+            .isAtLeast(SHORTEST_TIME_BETWEEN_SIGNALS_MS)
+    }
+
+    @Test
+    fun onLayoutTestWithSizeChangeTest() {
+        addNodeToLayout()
+        testSandboxedUiAdapter.assertSessionOpened()
+        Espresso.onView(instanceOf(SandboxedSdkView::class.java))
+            .check(matches(isDisplayed()))
+            .check(matches(hasChildCount(1)))
+            .check { view, exception ->
+                val expectedSize = size.toPx(view.context.resources.displayMetrics)
+                if (view.width != expectedSize || view.height != expectedSize) {
+                    throw exception
+                }
+            }
+        size = 30.dp
+        composeTestRule.waitForIdle()
+        Espresso.onView(instanceOf(SandboxedSdkView::class.java))
+            .check(matches(isDisplayed()))
+            .check(matches(hasChildCount(1)))
+            .check { view, exception ->
+                val expectedSize = size.toPx(view.context.resources.displayMetrics)
+                if (view.width != expectedSize || view.height != expectedSize) {
+                    throw exception
+                }
+            }
+        assertThat(testSandboxedUiAdapter.wasNotifyResizedCalled()).isTrue()
+    }
+
+    @Test
+    fun onLayoutTestNoSizeChangeTest() {
+        size = 20.dp
+        addNodeToLayout()
+        testSandboxedUiAdapter.assertSessionOpened()
+        size = 20.dp
+        composeTestRule.waitForIdle()
+        assertThat(testSandboxedUiAdapter.wasNotifyResizedCalled()).isFalse()
+    }
+
+    @Test
+    fun onLayoutTestViewShiftWithoutSizeChangeTest() {
+        var offset by mutableStateOf(0.dp)
+        composeTestRule.setContent {
+            SandboxedSdkUi(
+                sandboxedUiAdapter = testSandboxedUiAdapter,
+                modifier = Modifier.offset(offset),
+                providerUiOnTop = providerUiOnTop,
+                sandboxedSdkViewEventListener = eventListener
+            )
+        }
+        testSandboxedUiAdapter.assertSessionOpened()
+        offset = 10.dp
+        composeTestRule.waitForIdle()
+        assertThat(testSandboxedUiAdapter.wasNotifyResizedCalled()).isFalse()
+    }
+
+    @Test
+    fun onSdkRequestsResizeTest() {
+        val boxSize = 300.dp
+        composeTestRule.setContent {
+            Box(modifier = Modifier.requiredSize(boxSize)) {
+                SandboxedSdkUi(
+                    sandboxedUiAdapter = testSandboxedUiAdapter,
+                    modifier = Modifier,
+                    providerUiOnTop = providerUiOnTop,
+                    sandboxedSdkViewEventListener = eventListener
+                )
+            }
+        }
+        testSandboxedUiAdapter.assertSessionOpened()
+        Espresso.onView(instanceOf(SandboxedSdkView::class.java)).check { view, _ ->
+            assertThat(view.width).isEqualTo(boxSize.toPx(view.context.resources.displayMetrics))
+            assertThat(view.height).isEqualTo(boxSize.toPx(view.context.resources.displayMetrics))
+        }
+        composeTestRule.activityRule.withActivity {
+            testSandboxedUiAdapter.testSession?.requestResize(200, 200) as Any
+        }
+        composeTestRule.waitForIdle()
+        Espresso.onView(instanceOf(SandboxedSdkView::class.java)).check { view, _ ->
+            assertThat(view.width).isEqualTo(200)
+            assertThat(view.height).isEqualTo(200)
+        }
+    }
+
+    @Test
+    fun requestResizeWithMeasureSpecAtMostExceedsParentBoundsTest() {
+        val boxSize = 300.dp
+        composeTestRule.setContent {
+            Box(modifier = Modifier.requiredSize(boxSize)) {
+                SandboxedSdkUi(
+                    sandboxedUiAdapter = testSandboxedUiAdapter,
+                    modifier = Modifier,
+                    providerUiOnTop = providerUiOnTop,
+                    sandboxedSdkViewEventListener = eventListener
+                )
+            }
+        }
+        testSandboxedUiAdapter.assertSessionOpened()
+        Espresso.onView(instanceOf(SandboxedSdkView::class.java)).check { view, _ ->
+            assertThat(view.width).isEqualTo(boxSize.toPx(view.context.resources.displayMetrics))
+            assertThat(view.height).isEqualTo(boxSize.toPx(view.context.resources.displayMetrics))
+        }
+        composeTestRule.activityRule.withActivity {
+            val newSize = (boxSize + 10.dp).toPx(resources.displayMetrics)
+            testSandboxedUiAdapter.testSession?.requestResize(newSize, newSize) as Any
+        }
+        composeTestRule.waitForIdle()
+        // the resize is constrained by the parent's size
+        Espresso.onView(instanceOf(SandboxedSdkView::class.java)).check { view, _ ->
+            assertThat(view.width).isEqualTo(boxSize.toPx(view.context.resources.displayMetrics))
+            assertThat(view.height).isEqualTo(boxSize.toPx(view.context.resources.displayMetrics))
+        }
+    }
+
+    @Test
+    fun requestResizeWithMeasureSpecExactlyTest() {
+        var boxWidth = 0.dp
+        var boxHeight = 0.dp
+        composeTestRule.setContent {
+            // Get local density from composable
+            val localDensity = LocalDensity.current
+            Box(
+                modifier =
+                    Modifier.fillMaxSize().onGloballyPositioned { coordinates ->
+                        boxWidth = with(localDensity) { coordinates.size.width.toDp() }
+                        boxHeight = with(localDensity) { coordinates.size.height.toDp() }
+                    }
+            ) {
+                SandboxedSdkUi(
+                    sandboxedUiAdapter = testSandboxedUiAdapter,
+                    modifier = Modifier.fillMaxSize(),
+                    providerUiOnTop = providerUiOnTop,
+                    sandboxedSdkViewEventListener = eventListener
+                )
+            }
+        }
+        testSandboxedUiAdapter.assertSessionOpened()
+        Espresso.onView(instanceOf(SandboxedSdkView::class.java)).check { view, _ ->
+            assertThat(view.width).isEqualTo(boxWidth.toPx(view.context.resources.displayMetrics))
+            assertThat(view.height).isEqualTo(boxHeight.toPx(view.context.resources.displayMetrics))
+        }
+        composeTestRule.activityRule.withActivity {
+            val newBoxWidth = (boxWidth - 10.dp).toPx(resources.displayMetrics)
+            val newBoxHeight = (boxHeight - 10.dp).toPx(resources.displayMetrics)
+            testSandboxedUiAdapter.testSession?.requestResize(newBoxWidth, newBoxHeight) as Any
+        }
+        composeTestRule.waitForIdle()
+        // the request is a no-op when the MeasureSpec is EXACTLY
+        Espresso.onView(instanceOf(SandboxedSdkView::class.java)).check { view, _ ->
+            assertThat(view.width).isEqualTo((boxWidth).toPx(view.context.resources.displayMetrics))
+            assertThat(view.height)
+                .isEqualTo((boxHeight).toPx(view.context.resources.displayMetrics))
+        }
+    }
+
+    @Test
+    fun sandboxedSdkViewIsTransitionGroupTest() {
+        addNodeToLayout()
+        Espresso.onView(instanceOf(SandboxedSdkView::class.java)).check { view, exception ->
+            if (!(view as ViewGroup).isTransitionGroup) {
+                throw exception
+            }
+        }
+    }
+
+    @Test
+    fun signalsNotSentWhenViewUnchangedTest() {
+        addNodeToLayout()
+        val session = testSandboxedUiAdapter.testSession
+        session?.runAndRetrieveNextUiChange {}
+        session?.assertNoSubsequentUiChanges()
+    }
+
+    /**
+     * Shifts the view partially off screen and verifies that the reported onScreenGeometry is
+     * cropped accordingly.
+     */
+    @Test
+    fun correctSignalsSentForOnScreenGeometryWhenViewOffScreenTest() {
+        var xOffset by mutableStateOf(0.dp)
+        var yOffset by mutableStateOf(0.dp)
+        val clippedWidth = 300.dp
+        val clippedHeight = 400.dp
+        composeTestRule.setContent {
+            Box(modifier = Modifier.size(width = clippedWidth, height = clippedHeight)) {
+                SandboxedSdkUi(
+                    sandboxedUiAdapter = testSandboxedUiAdapter,
+                    modifier = Modifier.offset(x = xOffset, y = yOffset),
+                    providerUiOnTop = providerUiOnTop,
+                    sandboxedSdkViewEventListener = eventListener
+                )
+            }
+        }
+        var initialHeight = 0
+        var initialWidth = 0
+        Espresso.onView(instanceOf(SandboxedSdkView::class.java)).check { view, _ ->
+            initialHeight = view.height
+            initialWidth = view.width
+        }
+        val session = testSandboxedUiAdapter.testSession
+        val sandboxedSdkViewUiInfo =
+            session?.runAndRetrieveNextUiChange {
+                xOffset = 100.dp
+                yOffset = 200.dp
+                composeTestRule.waitForIdle()
+            }
+        Espresso.onView(instanceOf(SandboxedSdkView::class.java)).check { view, _ ->
+            assertThat(sandboxedSdkViewUiInfo?.uiContainerWidth)
+                .isEqualTo(clippedWidth.toPx(view.context.resources.displayMetrics))
+            assertThat(sandboxedSdkViewUiInfo?.uiContainerHeight)
+                .isEqualTo(clippedHeight.toPx(view.context.resources.displayMetrics))
+            assertThat(sandboxedSdkViewUiInfo?.onScreenGeometry?.height()?.toFloat())
+                .isEqualTo(initialHeight - yOffset.toPx(view.context.resources.displayMetrics))
+            assertThat(sandboxedSdkViewUiInfo?.onScreenGeometry?.width()?.toFloat())
+                .isEqualTo(initialWidth - xOffset.toPx(view.context.resources.displayMetrics))
+        }
+    }
+
+    @Test
+    fun signalsSentWhenPositionChangesTest() {
+        var offset by mutableStateOf(0.dp)
+        composeTestRule.setContent {
+            SandboxedSdkUi(
+                sandboxedUiAdapter = testSandboxedUiAdapter,
+                modifier = Modifier.offset(x = offset),
+                providerUiOnTop = providerUiOnTop,
+                sandboxedSdkViewEventListener = eventListener
+            )
+        }
+        val session = testSandboxedUiAdapter.testSession
+        val sandboxedSdkViewUiInfo =
+            session?.runAndRetrieveNextUiChange {
+                offset = 10.dp
+                composeTestRule.waitForIdle()
+            }
+        val containerWidth = sandboxedSdkViewUiInfo?.uiContainerWidth ?: 0
+        val onScreenWidth = sandboxedSdkViewUiInfo?.onScreenGeometry?.width()?.toFloat()
+        Espresso.onView(instanceOf(SandboxedSdkView::class.java)).check { view, exception ->
+            val expectedWidth =
+                (containerWidth - offset.toPx(view.context.resources.displayMetrics)).toFloat()
+            if (expectedWidth != onScreenWidth) {
+                throw exception
+            }
+        }
+    }
+
+    /**
+     * Creates many UI changes and ensures that these changes are not sent more frequently than
+     * expected.
+     */
+    @Test
+    @SuppressLint("BanThreadSleep") // Deliberate delay for testing
+    fun signalsNotSentMoreFrequentlyThanLimitTest() {
+        addNodeToLayout()
+        val session = testSandboxedUiAdapter.testSession!!
+        for (i in 1..10) {
+            size += (i * 10).dp
+            composeTestRule.waitForIdle()
+            Thread.sleep(100)
+        }
+        assertThat(session.shortestGapBetweenUiChangeEvents)
+            .isAtLeast(SHORTEST_TIME_BETWEEN_SIGNALS_MS)
+    }
+
+    @Test
+    fun signalsSentWhenHostActivityStateChangesTest() {
+        addNodeToLayout()
+        val session = testSandboxedUiAdapter.testSession
+        session?.runAndRetrieveNextUiChange {}
+        // Replace the first activity with a new activity. The onScreenGeometry should now be empty.
+        var sandboxedSdkViewUiInfo =
+            session?.runAndRetrieveNextUiChange {
+                composeTestRule.activityRule.scenario.onActivity {
+                    val intent = Intent(it, SecondActivity::class.java)
+                    it.startActivity(intent)
+                }
+            }
+        assertThat(sandboxedSdkViewUiInfo?.onScreenGeometry?.isEmpty).isTrue()
+        // Return to the first activity. The onScreenGeometry should now be non-empty.
+        sandboxedSdkViewUiInfo = session?.runAndRetrieveNextUiChange { uiDevice.pressBack() }
+        assertThat(sandboxedSdkViewUiInfo?.onScreenGeometry?.isEmpty).isFalse()
+    }
+
+    private fun addNodeToLayout() {
+        composeTestRule.setContent {
+            SandboxedSdkUi(
+                sandboxedUiAdapter = testSandboxedUiAdapter,
+                modifier = Modifier.requiredSize(size),
+                providerUiOnTop = providerUiOnTop,
+                sandboxedSdkViewEventListener = eventListener
+            )
+        }
+    }
+
+    private fun Dp.toPx(displayMetrics: DisplayMetrics) =
+        TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, value, displayMetrics).roundToInt()
+}
diff --git a/privacysandbox/ui/ui-client/src/androidTest/java/androidx/privacysandbox/ui/client/test/SandboxedSdkViewTest.kt b/privacysandbox/ui/ui-client/src/androidTest/java/androidx/privacysandbox/ui/client/test/SandboxedSdkViewTest.kt
index 84015cb..9002a19 100644
--- a/privacysandbox/ui/ui-client/src/androidTest/java/androidx/privacysandbox/ui/client/test/SandboxedSdkViewTest.kt
+++ b/privacysandbox/ui/ui-client/src/androidTest/java/androidx/privacysandbox/ui/client/test/SandboxedSdkViewTest.kt
@@ -13,7 +13,6 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
 package androidx.privacysandbox.ui.client.test
 
 import android.annotation.SuppressLint
@@ -55,19 +54,10 @@
 import org.junit.Test
 import org.junit.runner.RunWith
 
+// TODO(b/374919355): Create a common test for View and Compose
 @RunWith(AndroidJUnit4::class)
 @LargeTest
 class SandboxedSdkViewTest {
-
-    companion object {
-        const val TIMEOUT = 1000.toLong()
-
-        // Longer timeout used for expensive operations like device rotation.
-        const val UI_INTENSIVE_TIMEOUT = 2000.toLong()
-
-        const val SHORTEST_TIME_BETWEEN_SIGNALS_MS = 200
-    }
-
     private lateinit var uiDevice: UiDevice
     private lateinit var context: Context
     private lateinit var view: SandboxedSdkView
@@ -77,23 +67,8 @@
     private lateinit var linearLayout: LinearLayout
     private var mainLayoutWidth = -1
     private var mainLayoutHeight = -1
-
     @get:Rule var activityScenarioRule = ActivityScenarioRule(UiLibActivity::class.java)
 
-    class FailingTestSandboxedUiAdapter : AbstractSandboxedUiAdapter() {
-        override fun openSession(
-            context: Context,
-            windowInputToken: IBinder,
-            initialWidth: Int,
-            initialHeight: Int,
-            isZOrderOnTop: Boolean,
-            clientExecutor: Executor,
-            client: SandboxedUiAdapter.SessionClient
-        ) {
-            clientExecutor.execute { client.onSessionError(Exception("Error in openSession()")) }
-        }
-    }
-
     @Before
     fun setup() {
         context = InstrumentationRegistry.getInstrumentation().targetContext
@@ -125,20 +100,15 @@
     fun addAndRemoveEventListenerTest() {
         // Initially no events are received when the session is not open.
         assertThat(eventListener.uiDisplayedLatch.await(TIMEOUT, TimeUnit.MILLISECONDS)).isFalse()
-
         // When session is open, the events are received
         addViewToLayout()
         assertThat(eventListener.uiDisplayedLatch.await(TIMEOUT, TimeUnit.MILLISECONDS)).isTrue()
-
         // Remove the view from layout to close the session.
         removeAllViewsFromLayout()
         assertThat(eventListener.sessionClosedLatch.await(TIMEOUT, TimeUnit.MILLISECONDS)).isTrue()
-
         eventListener.uiDisplayedLatch = CountDownLatch(1)
-
         // Remove the listener from the view.
         view.setEventListener(null)
-
         // Add view to layout again to start the session. The latches will not count down this time.
         addViewToLayout()
         assertThat(eventListener.uiDisplayedLatch.await(TIMEOUT, TimeUnit.MILLISECONDS)).isFalse()
@@ -150,16 +120,13 @@
         val eventListener2 = TestEventListener()
         view.setEventListener(eventListener1)
         view.setEventListener(eventListener2)
-
         activityScenarioRule.withActivity { view.setAdapter(FailingTestSandboxedUiAdapter()) }
         addViewToLayout()
         assertThat(eventListener1.errorLatch.await(TIMEOUT, TimeUnit.MILLISECONDS)).isFalse()
         assertThat(eventListener2.errorLatch.await(TIMEOUT, TimeUnit.MILLISECONDS)).isTrue()
-
         activityScenarioRule.withActivity { view.setAdapter(testSandboxedUiAdapter) }
         assertThat(eventListener1.uiDisplayedLatch.await(TIMEOUT, TimeUnit.MILLISECONDS)).isFalse()
         assertThat(eventListener2.uiDisplayedLatch.await(TIMEOUT, TimeUnit.MILLISECONDS)).isTrue()
-
         removeAllViewsFromLayout()
         assertThat(eventListener1.sessionClosedLatch.await(TIMEOUT, TimeUnit.MILLISECONDS))
             .isFalse()
@@ -189,11 +156,9 @@
     fun childViewRemovedOnErrorTest() {
         assertTrue(view.childCount == 0)
         addViewToLayout()
-
         testSandboxedUiAdapter.assertSessionOpened()
         assertTrue(view.childCount == 1)
         assertTrue(view.layoutParams == layoutParams)
-
         activityScenarioRule.withActivity {
             testSandboxedUiAdapter.internalClient!!.onSessionError(Exception())
             assertTrue(view.childCount == 0)
@@ -203,19 +168,16 @@
     @Test
     fun onZOrderChangedTest() {
         addViewToLayout()
-
         // When session is opened, the provider should not receive a Z-order notification.
         testSandboxedUiAdapter.assertSessionOpened()
         val session = testSandboxedUiAdapter.testSession!!
         val adapter = testSandboxedUiAdapter
         assertThat(session.zOrderChangedLatch.await(TIMEOUT, TimeUnit.MILLISECONDS)).isFalse()
         assertThat(adapter.isZOrderOnTop).isTrue()
-
         // When state changes to false, the provider should be notified.
         view.orderProviderUiAboveClientUi(false)
         assertThat(session.zOrderChangedLatch.await(TIMEOUT, TimeUnit.MILLISECONDS)).isTrue()
         assertThat(adapter.isZOrderOnTop).isFalse()
-
         // When state changes back to true, the provider should be notified.
         session.zOrderChangedLatch = CountDownLatch(1)
         view.orderProviderUiAboveClientUi(true)
@@ -226,13 +188,11 @@
     @Test
     fun onZOrderUnchangedTest() {
         addViewToLayout()
-
         // When session is opened, the provider should not receive a Z-order notification.
         testSandboxedUiAdapter.assertSessionOpened()
         val session = testSandboxedUiAdapter.testSession!!
         val adapter = testSandboxedUiAdapter
         assertThat(adapter.isZOrderOnTop).isTrue()
-
         // When Z-order state is unchanged, the provider should not be notified.
         session.zOrderChangedLatch = CountDownLatch(1)
         view.orderProviderUiAboveClientUi(true)
@@ -246,7 +206,6 @@
         addViewToLayout()
         testSandboxedUiAdapter.assertSessionOpened()
         val session = testSandboxedUiAdapter.testSession!!
-
         // The initial Z-order state is passed to the session, but notifyZOrderChanged is not called
         assertThat(session.zOrderChangedLatch.await(TIMEOUT, TimeUnit.MILLISECONDS)).isFalse()
         assertThat(testSandboxedUiAdapter.isZOrderOnTop).isFalse()
@@ -261,7 +220,6 @@
         val session = testSandboxedUiAdapter.testSession!!
         assertThat(session.zOrderChangedLatch.await(TIMEOUT, TimeUnit.MILLISECONDS)).isFalse()
         activityScenarioRule.withActivity { testSandboxedUiAdapter.sendOnSessionOpened() }
-
         // After session has opened, the pending Z order changed made while loading is notified
         // th the session.
         assertThat(session.zOrderChangedLatch.await(TIMEOUT, TimeUnit.MILLISECONDS)).isTrue()
@@ -279,12 +237,13 @@
             Until.newWindow(),
             UI_INTENSIVE_TIMEOUT
         )
-        testSandboxedUiAdapter.assertSessionOpened()
+        testSandboxedUiAdapter.assertSessionNotClosed()
         uiDevice.performActionAndWait(
             { uiDevice.setOrientationNatural() },
             Until.newWindow(),
             UI_INTENSIVE_TIMEOUT
         )
+        testSandboxedUiAdapter.assertSessionNotClosed()
     }
 
     @Test
@@ -301,7 +260,6 @@
     fun overrideProviderViewLayoutParams() {
         val providerViewWidth = (0..1000).random()
         val providerViewHeight = (0..1000).random()
-
         class CustomSession : AbstractSandboxedUiAdapter.AbstractSession() {
             override val view = View(context)
 
@@ -309,7 +267,6 @@
                 view.layoutParams = LinearLayout.LayoutParams(providerViewWidth, providerViewHeight)
             }
         }
-
         class CustomUiAdapter : AbstractSandboxedUiAdapter() {
             override fun openSession(
                 context: Context,
@@ -323,11 +280,9 @@
                 clientExecutor.execute { client.onSessionOpened(CustomSession()) }
             }
         }
-
         view.setAdapter(CustomUiAdapter())
         addViewToLayout(waitToBeActive = true)
         val contentView = view.getChildAt(0)
-
         assertThat(contentView.layoutParams.width).isNotEqualTo(providerViewWidth)
         assertThat(contentView.layoutParams.height).isNotEqualTo(providerViewHeight)
         assertThat(contentView.layoutParams.width).isEqualTo(LinearLayout.LayoutParams.WRAP_CONTENT)
@@ -341,7 +296,6 @@
         val initialWidth = 100
         val initialHeight = 100
         view.layoutParams = LinearLayout.LayoutParams(initialWidth, initialHeight)
-
         class CustomSession : AbstractSandboxedUiAdapter.AbstractSession() {
             override val view = TextView(context)
 
@@ -349,9 +303,7 @@
                 view.text = "Test View"
             }
         }
-
         val customSession = CustomSession()
-
         class CustomUiAdapter : AbstractSandboxedUiAdapter() {
             override fun openSession(
                 context: Context,
@@ -365,12 +317,9 @@
                 clientExecutor.execute { client.onSessionOpened(customSession) }
             }
         }
-
         view.setAdapter(CustomUiAdapter())
         addViewToLayout(waitToBeActive = true)
-
         customSession.view.layout(0, 0, initialWidth * 2, initialHeight * 2)
-
         assertThat(customSession.view.width).isEqualTo(initialWidth * 2)
         assertThat(customSession.view.height).isEqualTo(initialHeight * 2)
         assertThat(view.width).isEqualTo(initialWidth)
@@ -495,11 +444,9 @@
     fun inputTokenIsCorrect() {
         // Input token is only needed when provider can be located on a separate process.
         assumeTrue(BackwardCompatUtil.canProviderBeRemote())
-
         lateinit var layout: LinearLayout
         val surfaceView = SurfaceView(context)
         val surfaceViewLatch = CountDownLatch(1)
-
         var token: IBinder? = null
         surfaceView.addOnAttachStateChangeListener(
             object : View.OnAttachStateChangeListener {
@@ -512,18 +459,15 @@
                 override fun onViewDetachedFromWindow(p0: View) {}
             }
         )
-
         // Attach SurfaceView
         activityScenarioRule.withActivity {
             layout = findViewById(R.id.mainlayout)
             layout.addView(surfaceView)
             layout.removeView(surfaceView)
         }
-
         // Verify SurfaceView has a non-null token when attached.
         assertThat(surfaceViewLatch.await(TIMEOUT, TimeUnit.MILLISECONDS)).isTrue()
         assertThat(token).isNotNull()
-
         // Verify that the UI adapter receives the same host token object when opening a session.
         addViewToLayout()
         testSandboxedUiAdapter.assertSessionOpened()
@@ -752,7 +696,6 @@
                 Runnable { view.removeAllViewsInLayout() },
                 Runnable { view.removeViewsInLayout(0, 0) }
             )
-
         removeChildRunnableArray.forEach { removeChildRunnable ->
             val exception =
                 assertThrows(UnsupportedOperationException::class.java) {
@@ -807,4 +750,11 @@
         assertThat(width).isEqualTo(expectedWidth)
         assertThat(height).isEqualTo(expectedHeight)
     }
+
+    companion object {
+        const val TIMEOUT = 1000.toLong()
+        // Longer timeout used for expensive operations like device rotation.
+        const val UI_INTENSIVE_TIMEOUT = 2000.toLong()
+        const val SHORTEST_TIME_BETWEEN_SIGNALS_MS = 200
+    }
 }
diff --git a/privacysandbox/ui/ui-client/src/androidTest/java/androidx/privacysandbox/ui/client/test/TestSandboxedUiAdapter.kt b/privacysandbox/ui/ui-client/src/androidTest/java/androidx/privacysandbox/ui/client/test/TestSandboxedUiAdapter.kt
index 5bfe8df..f9ebe61 100644
--- a/privacysandbox/ui/ui-client/src/androidTest/java/androidx/privacysandbox/ui/client/test/TestSandboxedUiAdapter.kt
+++ b/privacysandbox/ui/ui-client/src/androidTest/java/androidx/privacysandbox/ui/client/test/TestSandboxedUiAdapter.kt
@@ -13,7 +13,6 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
 package androidx.privacysandbox.ui.client.test
 
 import android.content.Context
@@ -32,20 +31,18 @@
 
 class TestSandboxedUiAdapter(private val signalOptions: Set<String> = setOf("option")) :
     AbstractSandboxedUiAdapter() {
-
     var isSessionOpened = false
     var internalClient: SandboxedUiAdapter.SessionClient? = null
     var testSession: TestSession? = null
     var isZOrderOnTop = true
     var inputToken: IBinder? = null
-
     // When set to true, the onSessionOpened callback will only be invoked when specified
     // by the test. This is to test race conditions when the session is being loaded.
     var delayOpenSessionCallback = false
-
     private val openSessionLatch = CountDownLatch(1)
     private val resizeLatch = CountDownLatch(1)
     private val configChangedLatch = CountDownLatch(1)
+    private val sessionClosedLatch = CountDownLatch(1)
 
     override fun openSession(
         context: Context,
@@ -98,16 +95,21 @@
         )
     }
 
+    internal fun assertSessionNotClosed() {
+        Truth.assertThat(
+                sessionClosedLatch.await(SandboxedSdkViewTest.TIMEOUT, TimeUnit.MILLISECONDS)
+            )
+            .isFalse()
+    }
+
     inner class TestSession(context: Context, override val signalOptions: Set<String>) :
         SandboxedUiAdapter.Session {
-
         var zOrderChangedLatch: CountDownLatch = CountDownLatch(1)
         var shortestGapBetweenUiChangeEvents = Long.MAX_VALUE
         private var notifyUiChangedLatch: CountDownLatch = CountDownLatch(1)
         private var latestUiChange: Bundle = Bundle()
         private var hasReceivedFirstUiChange = false
         private var timeReceivedLastUiChange = SystemClock.elapsedRealtime()
-
         override val view: View = View(context)
 
         fun requestResize(width: Int, height: Int) {
@@ -127,7 +129,9 @@
             configChangedLatch.countDown()
         }
 
-        override fun close() {}
+        override fun close() {
+            sessionClosedLatch.countDown()
+        }
 
         override fun notifyUiChanged(uiContainerInfo: Bundle) {
             if (hasReceivedFirstUiChange) {
diff --git a/compose/runtime/runtime/src/nonAndroidMain/kotlin/androidx/compose/runtime/collection/ArrayUtils.nonAndroid.kt b/privacysandbox/ui/ui-client/src/androidTest/java/androidx/privacysandbox/ui/client/test/UiLibComposeActivity.kt
similarity index 63%
rename from compose/runtime/runtime/src/nonAndroidMain/kotlin/androidx/compose/runtime/collection/ArrayUtils.nonAndroid.kt
rename to privacysandbox/ui/ui-client/src/androidTest/java/androidx/privacysandbox/ui/client/test/UiLibComposeActivity.kt
index 2e2c834..27b1299 100644
--- a/compose/runtime/runtime/src/nonAndroidMain/kotlin/androidx/compose/runtime/collection/ArrayUtils.nonAndroid.kt
+++ b/privacysandbox/ui/ui-client/src/androidTest/java/androidx/privacysandbox/ui/client/test/UiLibComposeActivity.kt
@@ -13,14 +13,8 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+package androidx.privacysandbox.ui.client.test
 
-@file:Suppress("NOTHING_TO_INLINE", "KotlinRedundantDiagnosticSuppress")
+import androidx.activity.ComponentActivity
 
-package androidx.compose.runtime.collection
-
-internal actual inline fun <T> Array<out T>.fastCopyInto(
-    destination: Array<T>,
-    destinationOffset: Int,
-    startIndex: Int,
-    endIndex: Int
-): Array<T> = this.copyInto(destination, destinationOffset, startIndex, endIndex)
+class UiLibComposeActivity : ComponentActivity() {}
diff --git a/privacysandbox/ui/ui-client/src/main/java/androidx/privacysandbox/ui/client/ClientDelegatingAdapter.kt b/privacysandbox/ui/ui-client/src/main/java/androidx/privacysandbox/ui/client/ClientDelegatingAdapter.kt
index 2901fe9..404139d 100644
--- a/privacysandbox/ui/ui-client/src/main/java/androidx/privacysandbox/ui/client/ClientDelegatingAdapter.kt
+++ b/privacysandbox/ui/ui-client/src/main/java/androidx/privacysandbox/ui/client/ClientDelegatingAdapter.kt
@@ -21,13 +21,13 @@
 import android.os.IBinder
 import androidx.annotation.GuardedBy
 import androidx.core.util.Consumer
-import androidx.privacysandbox.ui.client.RemoteCallManager.tryToCallRemoteObject
 import androidx.privacysandbox.ui.client.SandboxedUiAdapterFactory.createFromCoreLibInfo
 import androidx.privacysandbox.ui.client.view.RefreshableSessionClient
 import androidx.privacysandbox.ui.core.IDelegateChangeListener
 import androidx.privacysandbox.ui.core.IDelegatingSandboxedUiAdapter
 import androidx.privacysandbox.ui.core.IDelegatorCallback
 import androidx.privacysandbox.ui.core.ISessionRefreshCallback
+import androidx.privacysandbox.ui.core.RemoteCallManager.tryToCallRemoteObject
 import androidx.privacysandbox.ui.core.SandboxedUiAdapter
 import java.util.concurrent.Executor
 import kotlin.coroutines.resume
diff --git a/privacysandbox/ui/ui-client/src/main/java/androidx/privacysandbox/ui/client/SandboxedUiAdapterFactory.kt b/privacysandbox/ui/ui-client/src/main/java/androidx/privacysandbox/ui/client/SandboxedUiAdapterFactory.kt
index e4a4f5f..e80268a 100644
--- a/privacysandbox/ui/ui-client/src/main/java/androidx/privacysandbox/ui/client/SandboxedUiAdapterFactory.kt
+++ b/privacysandbox/ui/ui-client/src/main/java/androidx/privacysandbox/ui/client/SandboxedUiAdapterFactory.kt
@@ -30,14 +30,14 @@
 import android.view.View
 import android.window.SurfaceSyncGroup
 import androidx.annotation.RequiresApi
-import androidx.privacysandbox.ui.client.RemoteCallManager.addBinderDeathListener
-import androidx.privacysandbox.ui.client.RemoteCallManager.closeRemoteSession
-import androidx.privacysandbox.ui.client.RemoteCallManager.tryToCallRemoteObject
 import androidx.privacysandbox.ui.core.IDelegatingSandboxedUiAdapter
 import androidx.privacysandbox.ui.core.IRemoteSessionClient
 import androidx.privacysandbox.ui.core.IRemoteSessionController
 import androidx.privacysandbox.ui.core.ISandboxedUiAdapter
 import androidx.privacysandbox.ui.core.ProtocolConstants
+import androidx.privacysandbox.ui.core.RemoteCallManager.addBinderDeathListener
+import androidx.privacysandbox.ui.core.RemoteCallManager.closeRemoteSession
+import androidx.privacysandbox.ui.core.RemoteCallManager.tryToCallRemoteObject
 import androidx.privacysandbox.ui.core.SandboxedUiAdapter
 import java.lang.reflect.InvocationHandler
 import java.lang.reflect.Method
diff --git a/privacysandbox/ui/ui-client/src/main/java/androidx/privacysandbox/ui/client/view/SandboxedSdkUi.kt b/privacysandbox/ui/ui-client/src/main/java/androidx/privacysandbox/ui/client/view/SandboxedSdkUi.kt
new file mode 100644
index 0000000..29f873a
--- /dev/null
+++ b/privacysandbox/ui/ui-client/src/main/java/androidx/privacysandbox/ui/client/view/SandboxedSdkUi.kt
@@ -0,0 +1,73 @@
+/*
+ * Copyright 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package androidx.privacysandbox.ui.client.view
+
+import androidx.compose.runtime.Composable
+import androidx.compose.runtime.getValue
+import androidx.compose.runtime.mutableStateOf
+import androidx.compose.runtime.remember
+import androidx.compose.runtime.setValue
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.viewinterop.AndroidView
+import androidx.privacysandbox.ui.core.SandboxedUiAdapter
+
+/**
+ * Composable that can be used to remotely render UI from a SandboxedSdk to host app window.
+ *
+ * @param sandboxedUiAdapter an adapter that provides content from a SandboxedSdk to be displayed as
+ *   part of a host app's window.
+ * @param modifier the [Modifier] to be applied to this SandboxedSdkUi.
+ * @param providerUiOnTop sets the Z-ordering of the SandboxedSdkUi surface, relative to its window.
+ * @param sandboxedSdkViewEventListener an event listener to the UI presentation.
+ */
+@Composable
+@Suppress("MissingJvmstatic")
+fun SandboxedSdkUi(
+    sandboxedUiAdapter: SandboxedUiAdapter,
+    modifier: Modifier = Modifier,
+    providerUiOnTop: Boolean = true,
+    sandboxedSdkViewEventListener: SandboxedSdkViewEventListener? = null
+) {
+    val delegatedListener =
+        remember {
+                object : SandboxedSdkViewEventListener {
+                    var delegate by mutableStateOf(sandboxedSdkViewEventListener)
+
+                    override fun onUiDisplayed() {
+                        delegate?.onUiDisplayed()
+                    }
+
+                    override fun onUiError(error: Throwable) {
+                        delegate?.onUiError(error)
+                    }
+
+                    override fun onUiClosed() {
+                        delegate?.onUiClosed()
+                    }
+                }
+            }
+            .apply { delegate = sandboxedSdkViewEventListener }
+    AndroidView(
+        modifier = modifier,
+        factory = { context ->
+            SandboxedSdkView(context).apply { setEventListener(delegatedListener) }
+        },
+        update = { view ->
+            view.setAdapter(sandboxedUiAdapter)
+            view.orderProviderUiAboveClientUi(providerUiOnTop)
+        }
+    )
+}
diff --git a/privacysandbox/ui/ui-client/src/main/java/androidx/privacysandbox/ui/client/RemoteCallManager.kt b/privacysandbox/ui/ui-core/src/main/java/androidx/privacysandbox/ui/core/RemoteCallManager.kt
similarity index 93%
rename from privacysandbox/ui/ui-client/src/main/java/androidx/privacysandbox/ui/client/RemoteCallManager.kt
rename to privacysandbox/ui/ui-core/src/main/java/androidx/privacysandbox/ui/core/RemoteCallManager.kt
index 6570440..3d75a93 100644
--- a/privacysandbox/ui/ui-client/src/main/java/androidx/privacysandbox/ui/client/RemoteCallManager.kt
+++ b/privacysandbox/ui/ui-core/src/main/java/androidx/privacysandbox/ui/core/RemoteCallManager.kt
@@ -14,13 +14,12 @@
  * limitations under the License.
  */
 
-package androidx.privacysandbox.ui.client
+package androidx.privacysandbox.ui.core
 
 import android.os.IBinder
 import android.os.RemoteException
 import android.util.Log
 import androidx.annotation.RestrictTo
-import androidx.privacysandbox.ui.core.IRemoteSessionController
 
 /** Utility class for remote objects called by the UI library adapter factories. */
 @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
diff --git a/privacysandbox/ui/ui-provider/src/main/java/androidx/privacysandbox/ui/provider/BinderAdapterDelegate.kt b/privacysandbox/ui/ui-provider/src/main/java/androidx/privacysandbox/ui/provider/BinderAdapterDelegate.kt
index 3dd9727..697e3c8 100644
--- a/privacysandbox/ui/ui-provider/src/main/java/androidx/privacysandbox/ui/provider/BinderAdapterDelegate.kt
+++ b/privacysandbox/ui/ui-provider/src/main/java/androidx/privacysandbox/ui/provider/BinderAdapterDelegate.kt
@@ -40,6 +40,7 @@
 import androidx.privacysandbox.ui.core.IRemoteSessionController
 import androidx.privacysandbox.ui.core.ISandboxedUiAdapter
 import androidx.privacysandbox.ui.core.ProtocolConstants
+import androidx.privacysandbox.ui.core.RemoteCallManager.tryToCallRemoteObject
 import androidx.privacysandbox.ui.core.SandboxedUiAdapter
 import androidx.privacysandbox.ui.core.SessionObserver
 import androidx.privacysandbox.ui.core.SessionObserverContext
@@ -78,20 +79,22 @@
 
         override suspend fun onDelegateChanged(delegate: Bundle) {
             suspendCancellableCoroutine { continuation ->
-                binder.onDelegateChanged(
-                    delegate,
-                    object : IDelegatorCallback.Stub() {
-                        override fun onDelegateChangeResult(success: Boolean) {
-                            if (success) {
-                                continuation.resume(Unit)
-                            } else {
-                                continuation.resumeWithException(
-                                    IllegalStateException("Client failed to switch")
-                                )
+                tryToCallRemoteObject(binder) {
+                    onDelegateChanged(
+                        delegate,
+                        object : IDelegatorCallback.Stub() {
+                            override fun onDelegateChangeResult(success: Boolean) {
+                                if (success) {
+                                    continuation.resume(Unit)
+                                } else {
+                                    continuation.resumeWithException(
+                                        IllegalStateException("Client failed to switch")
+                                    )
+                                }
                             }
                         }
-                    }
-                )
+                    )
+                }
             }
         }
     }
@@ -154,7 +157,9 @@
         remoteSessionClient: IRemoteSessionClient
     ) {
         if (Build.VERSION.SDK_INT < Build.VERSION_CODES.UPSIDE_DOWN_CAKE) {
-            remoteSessionClient.onRemoteSessionError("openRemoteSession() requires API34+")
+            tryToCallRemoteObject(remoteSessionClient) {
+                onRemoteSessionError("openRemoteSession() requires API34+")
+            }
             return
         }
 
@@ -177,7 +182,11 @@
                             )
                         },
                         clientInit = { it.initialize(initialWidth, initialHeight) },
-                        errorHandler = { remoteSessionClient.onRemoteSessionError(it.message) }
+                        errorHandler = {
+                            tryToCallRemoteObject(remoteSessionClient) {
+                                onRemoteSessionError(it.message)
+                            }
+                        }
                     )
 
                 openSessionInternal(
@@ -192,7 +201,9 @@
 
                 deferredClient.preloadClient()
             } catch (exception: Throwable) {
-                remoteSessionClient.onRemoteSessionError(exception.message)
+                tryToCallRemoteObject(remoteSessionClient) {
+                    onRemoteSessionError(exception.message)
+                }
             }
         }
     }
@@ -280,27 +291,31 @@
         }
 
         override fun onSessionError(throwable: Throwable) {
-            remoteSessionClient.onRemoteSessionError(throwable.message)
+            tryToCallRemoteObject(remoteSessionClient) { onRemoteSessionError(throwable.message) }
         }
 
         override fun onResizeRequested(width: Int, height: Int) {
-            remoteSessionClient.onResizeRequested(width, height)
+            tryToCallRemoteObject(remoteSessionClient) { onResizeRequested(width, height) }
         }
 
         private fun sendRemoteSessionOpened(session: SandboxedUiAdapter.Session) {
             val surfacePackage = surfaceControlViewHost.surfacePackage
             val remoteSessionController = RemoteSessionController(surfaceControlViewHost, session)
-            remoteSessionClient.onRemoteSessionOpened(
-                surfacePackage,
-                remoteSessionController,
-                isZOrderOnTop,
-                session.signalOptions.isNotEmpty()
-            )
+            tryToCallRemoteObject(remoteSessionClient) {
+                onRemoteSessionOpened(
+                    surfacePackage,
+                    remoteSessionController,
+                    isZOrderOnTop,
+                    session.signalOptions.isNotEmpty()
+                )
+            }
         }
 
         private fun sendSurfacePackage() {
             if (surfaceControlViewHost.surfacePackage != null) {
-                remoteSessionClient.onSessionUiFetched(surfaceControlViewHost.surfacePackage)
+                tryToCallRemoteObject(remoteSessionClient) {
+                    onSessionUiFetched(surfaceControlViewHost.surfacePackage)
+                }
             }
         }
 
diff --git a/room/room-paging/build.gradle b/room/room-paging/build.gradle
index e0ab2c1..3805343 100644
--- a/room/room-paging/build.gradle
+++ b/room/room-paging/build.gradle
@@ -41,7 +41,6 @@
                 api(libs.kotlinStdlib)
                 api("androidx.paging:paging-common:3.3.2")
                 api(project(":room:room-runtime"))
-                implementation(libs.atomicFu)
             }
         }
 
@@ -66,6 +65,9 @@
 
         nativeMain {
             dependsOn(jvmNativeMain)
+            dependencies {
+                implementation(libs.atomicFu)
+            }
         }
 
         androidInstrumentedTest {
diff --git a/room/room-paging/src/androidMain/kotlin/androidx/room/paging/LimitOffsetPagingSource.android.kt b/room/room-paging/src/androidMain/kotlin/androidx/room/paging/LimitOffsetPagingSource.android.kt
index 4128526..66cbfa3 100644
--- a/room/room-paging/src/androidMain/kotlin/androidx/room/paging/LimitOffsetPagingSource.android.kt
+++ b/room/room-paging/src/androidMain/kotlin/androidx/room/paging/LimitOffsetPagingSource.android.kt
@@ -61,7 +61,7 @@
     private val implementation = CommonLimitOffsetImpl(tables, this, ::convertRows)
 
     public actual val itemCount: Int
-        get() = implementation.itemCount.value
+        get() = implementation.itemCount.get()
 
     override val jumpingSupported: Boolean
         get() = true
diff --git a/room/room-paging/src/commonMain/kotlin/androidx/room/paging/LimitOffsetPagingSource.kt b/room/room-paging/src/commonMain/kotlin/androidx/room/paging/LimitOffsetPagingSource.kt
index edd5950..9c5783d4 100644
--- a/room/room-paging/src/commonMain/kotlin/androidx/room/paging/LimitOffsetPagingSource.kt
+++ b/room/room-paging/src/commonMain/kotlin/androidx/room/paging/LimitOffsetPagingSource.kt
@@ -24,11 +24,12 @@
 import androidx.room.RoomDatabase
 import androidx.room.RoomRawQuery
 import androidx.room.Transactor.SQLiteTransactionType
+import androidx.room.concurrent.AtomicBoolean
+import androidx.room.concurrent.AtomicInt
 import androidx.room.paging.util.INITIAL_ITEM_COUNT
 import androidx.room.paging.util.queryDatabase
 import androidx.room.paging.util.queryItemCount
 import androidx.room.useReaderConnection
-import kotlinx.atomicfu.atomic
 import kotlinx.coroutines.CancellationException
 import kotlinx.coroutines.Job
 import kotlinx.coroutines.launch
@@ -70,9 +71,9 @@
     private val db = pagingSource.db
     private val sourceQuery = pagingSource.sourceQuery
 
-    internal val itemCount = atomic(INITIAL_ITEM_COUNT)
+    internal val itemCount = AtomicInt(INITIAL_ITEM_COUNT)
 
-    private val invalidationFlowStarted = atomic(false)
+    private val invalidationFlowStarted = AtomicBoolean(false)
     private var invalidationFlowJob: Job? = null
 
     init {
@@ -80,7 +81,7 @@
     }
 
     suspend fun load(params: LoadParams<Int>): LoadResult<Int, Value> {
-        if (invalidationFlowStarted.compareAndSet(expect = false, update = true)) {
+        if (invalidationFlowStarted.compareAndSet(false, true)) {
             invalidationFlowJob =
                 db.getCoroutineScope().launch {
                     db.invalidationTracker.createFlow(*tables, emitInitialState = false).collect {
@@ -92,7 +93,7 @@
                 }
         }
 
-        val tempCount = itemCount.value
+        val tempCount = itemCount.get()
         // if itemCount is < 0, then it is initial load
         return try {
             if (tempCount == INITIAL_ITEM_COUNT) {
@@ -119,7 +120,7 @@
         return db.useReaderConnection { connection ->
             connection.withTransaction(SQLiteTransactionType.DEFERRED) {
                 val tempCount = queryItemCount(sourceQuery, db)
-                itemCount.value = tempCount
+                itemCount.set(tempCount)
                 queryDatabase(
                     params = params,
                     sourceQuery = sourceQuery,
diff --git a/room/room-paging/src/jvmNativeMain/kotlin/androidx/room/paging/LimitOffsetPagingSource.jvmNative.kt b/room/room-paging/src/jvmNativeMain/kotlin/androidx/room/paging/LimitOffsetPagingSource.jvmNative.kt
index 1f4235e..77f4bd2 100644
--- a/room/room-paging/src/jvmNativeMain/kotlin/androidx/room/paging/LimitOffsetPagingSource.jvmNative.kt
+++ b/room/room-paging/src/jvmNativeMain/kotlin/androidx/room/paging/LimitOffsetPagingSource.jvmNative.kt
@@ -41,7 +41,7 @@
     private val implementation = CommonLimitOffsetImpl(tables, this, ::convertRows)
 
     public actual val itemCount: Int
-        get() = implementation.itemCount.value
+        get() = implementation.itemCount.get()
 
     override val jumpingSupported: Boolean
         get() = true
diff --git a/room/room-runtime/bcv/native/current.txt b/room/room-runtime/bcv/native/current.txt
index 984bd87..89d7a96 100644
--- a/room/room-runtime/bcv/native/current.txt
+++ b/room/room-runtime/bcv/native/current.txt
@@ -222,6 +222,24 @@
     final object Companion // androidx.room/EntityUpsertAdapter.Companion|null[0]
 }
 
+final class androidx.room.concurrent/AtomicBoolean { // androidx.room.concurrent/AtomicBoolean|null[0]
+    constructor <init>(kotlin/Boolean) // androidx.room.concurrent/AtomicBoolean.<init>|<init>(kotlin.Boolean){}[0]
+
+    final fun compareAndSet(kotlin/Boolean, kotlin/Boolean): kotlin/Boolean // androidx.room.concurrent/AtomicBoolean.compareAndSet|compareAndSet(kotlin.Boolean;kotlin.Boolean){}[0]
+    final fun get(): kotlin/Boolean // androidx.room.concurrent/AtomicBoolean.get|get(){}[0]
+}
+
+final class androidx.room.concurrent/AtomicInt { // androidx.room.concurrent/AtomicInt|null[0]
+    constructor <init>(kotlin/Int) // androidx.room.concurrent/AtomicInt.<init>|<init>(kotlin.Int){}[0]
+
+    final fun compareAndSet(kotlin/Int, kotlin/Int): kotlin/Boolean // androidx.room.concurrent/AtomicInt.compareAndSet|compareAndSet(kotlin.Int;kotlin.Int){}[0]
+    final fun decrementAndGet(): kotlin/Int // androidx.room.concurrent/AtomicInt.decrementAndGet|decrementAndGet(){}[0]
+    final fun get(): kotlin/Int // androidx.room.concurrent/AtomicInt.get|get(){}[0]
+    final fun getAndIncrement(): kotlin/Int // androidx.room.concurrent/AtomicInt.getAndIncrement|getAndIncrement(){}[0]
+    final fun incrementAndGet(): kotlin/Int // androidx.room.concurrent/AtomicInt.incrementAndGet|incrementAndGet(){}[0]
+    final fun set(kotlin/Int) // androidx.room.concurrent/AtomicInt.set|set(kotlin.Int){}[0]
+}
+
 final class androidx.room.util/ByteArrayWrapper { // androidx.room.util/ByteArrayWrapper|null[0]
     constructor <init>(kotlin/ByteArray) // androidx.room.util/ByteArrayWrapper.<init>|<init>(kotlin.ByteArray){}[0]
 
diff --git a/room/room-runtime/build.gradle b/room/room-runtime/build.gradle
index dc736fd..4fd3768 100644
--- a/room/room-runtime/build.gradle
+++ b/room/room-runtime/build.gradle
@@ -110,7 +110,6 @@
                 api("androidx.collection:collection:1.4.2")
                 api("androidx.annotation:annotation:1.8.1")
                 api(libs.kotlinCoroutinesCore)
-                implementation(libs.atomicFu)
             }
         }
         commonTest {
@@ -180,6 +179,7 @@
             dependsOn(jvmNativeMain)
             dependencies {
                 api(project(":sqlite:sqlite-framework"))
+                implementation(libs.atomicFu)
             }
         }
         nativeTest {
diff --git a/room/room-runtime/src/androidInstrumentedTest/kotlin/androidx/room/coroutines/BundledSQLiteConnectionPoolTest.kt b/room/room-runtime/src/androidInstrumentedTest/kotlin/androidx/room/coroutines/BundledSQLiteConnectionPoolTest.kt
index ab9a93b..f876d37 100644
--- a/room/room-runtime/src/androidInstrumentedTest/kotlin/androidx/room/coroutines/BundledSQLiteConnectionPoolTest.kt
+++ b/room/room-runtime/src/androidInstrumentedTest/kotlin/androidx/room/coroutines/BundledSQLiteConnectionPoolTest.kt
@@ -18,6 +18,7 @@
 
 import androidx.kruth.assertThat
 import androidx.room.Transactor
+import androidx.room.concurrent.AtomicInt
 import androidx.sqlite.SQLiteDriver
 import androidx.sqlite.driver.bundled.BundledSQLiteDriver
 import androidx.test.filters.LargeTest
@@ -27,7 +28,6 @@
 import kotlin.test.AfterTest
 import kotlin.test.BeforeTest
 import kotlin.test.Test
-import kotlinx.atomicfu.atomic
 import kotlinx.coroutines.CoroutineDispatcher
 import kotlinx.coroutines.Dispatchers
 import kotlinx.coroutines.InternalCoroutinesApi
@@ -130,7 +130,7 @@
 
     /** A CoroutineDispatcher that dispatches every block into a new thread */
     private class NewThreadDispatcher : CoroutineDispatcher() {
-        private val idCounter = atomic(0)
+        private val idCounter = AtomicInt(0)
 
         @OptIn(InternalCoroutinesApi::class)
         override fun dispatchYield(context: CoroutineContext, block: Runnable) {
diff --git a/room/room-runtime/src/androidMain/kotlin/androidx/room/InvalidationTracker.android.kt b/room/room-runtime/src/androidMain/kotlin/androidx/room/InvalidationTracker.android.kt
index 04caeb7..9b5e5d8 100644
--- a/room/room-runtime/src/androidMain/kotlin/androidx/room/InvalidationTracker.android.kt
+++ b/room/room-runtime/src/androidMain/kotlin/androidx/room/InvalidationTracker.android.kt
@@ -21,12 +21,12 @@
 import androidx.annotation.WorkerThread
 import androidx.lifecycle.LiveData
 import androidx.room.InvalidationTracker.Observer
+import androidx.room.concurrent.ReentrantLock
+import androidx.room.concurrent.withLock
 import androidx.room.support.AutoCloser
 import androidx.sqlite.SQLiteConnection
 import java.lang.ref.WeakReference
 import java.util.concurrent.Callable
-import kotlinx.atomicfu.locks.reentrantLock
-import kotlinx.atomicfu.locks.withLock
 import kotlinx.coroutines.flow.Flow
 import kotlinx.coroutines.flow.merge
 import kotlinx.coroutines.runBlocking
@@ -65,7 +65,7 @@
         )
 
     private val observerMap = mutableMapOf<Observer, ObserverWrapper>()
-    private val observerMapLock = reentrantLock()
+    private val observerMapLock = ReentrantLock()
 
     private var autoCloser: AutoCloser? = null
 
diff --git a/room/room-runtime/src/androidUnitTest/kotlin/androidx/room/InvalidationTrackerTest.kt b/room/room-runtime/src/androidUnitTest/kotlin/androidx/room/InvalidationTrackerTest.kt
index bbe94dc..c5e76f9 100644
--- a/room/room-runtime/src/androidUnitTest/kotlin/androidx/room/InvalidationTrackerTest.kt
+++ b/room/room-runtime/src/androidUnitTest/kotlin/androidx/room/InvalidationTrackerTest.kt
@@ -19,6 +19,8 @@
 import androidx.annotation.RequiresApi
 import androidx.kruth.assertThat
 import androidx.kruth.assertThrows
+import androidx.room.concurrent.AtomicBoolean
+import androidx.room.concurrent.AtomicInt
 import androidx.sqlite.SQLiteConnection
 import androidx.sqlite.SQLiteDriver
 import androidx.sqlite.SQLiteStatement
@@ -27,7 +29,6 @@
 import java.util.concurrent.CountDownLatch
 import java.util.concurrent.TimeUnit
 import kotlin.collections.removeFirst as removeFirstKt
-import kotlinx.atomicfu.atomic
 import kotlinx.coroutines.Dispatchers
 import kotlinx.coroutines.TimeoutCancellationException
 import kotlinx.coroutines.cancelAndJoin
@@ -346,12 +347,12 @@
     fun refreshAndCloseDbWithSlowObserver() = runTest {
         // Validates that a slow observer will finish notification after database closing
         val invalidatedLatch = CountDownLatch(1)
-        val invalidated = atomic(false)
+        val invalidated = AtomicBoolean(false)
         tracker.addObserver(
             object : InvalidationTracker.Observer("a") {
                 override fun onInvalidated(tables: Set<String>) {
                     invalidatedLatch.countDown()
-                    assertThat(invalidated.compareAndSet(expect = false, update = true)).isTrue()
+                    assertThat(invalidated.compareAndSet(false, true)).isTrue()
                     runBlocking { delay(100) }
                 }
             }
@@ -361,7 +362,7 @@
         testScheduler.advanceUntilIdle()
         invalidatedLatch.await()
         roomDatabase.close()
-        assertThat(invalidated.value).isTrue()
+        assertThat(invalidated.get()).isTrue()
     }
 
     @Test
@@ -473,7 +474,7 @@
 
     @Test
     fun weakObserver() = runTest {
-        val invalidated = atomic(0)
+        val invalidated = AtomicInt(0)
         var observer: InvalidationTracker.Observer? =
             object : InvalidationTracker.Observer("a") {
                 override fun onInvalidated(tables: Set<String>) {
@@ -484,7 +485,7 @@
 
         sqliteDriver.setInvalidatedTables(0)
         tracker.awaitRefreshAsync()
-        assertThat(invalidated.value).isEqualTo(1)
+        assertThat(invalidated.get()).isEqualTo(1)
 
         // Attempt to perform garbage collection in a loop so that weak observer is discarded
         // and it stops receiving invalidation notifications. If GC fails to collect the observer
@@ -511,7 +512,7 @@
 
         sqliteDriver.setInvalidatedTables(0)
         tracker.awaitRefreshAsync()
-        assertThat(invalidated.value).isEqualTo(1)
+        assertThat(invalidated.get()).isEqualTo(1)
     }
 
     @Test
diff --git a/room/room-runtime/src/commonMain/kotlin/androidx/room/InvalidationTracker.kt b/room/room-runtime/src/commonMain/kotlin/androidx/room/InvalidationTracker.kt
index 1997321..5730b60 100644
--- a/room/room-runtime/src/commonMain/kotlin/androidx/room/InvalidationTracker.kt
+++ b/room/room-runtime/src/commonMain/kotlin/androidx/room/InvalidationTracker.kt
@@ -18,16 +18,16 @@
 
 import androidx.annotation.RestrictTo
 import androidx.room.Transactor.SQLiteTransactionType
+import androidx.room.concurrent.AtomicBoolean
+import androidx.room.concurrent.ReentrantLock
 import androidx.room.concurrent.ifNotClosed
+import androidx.room.concurrent.withLock
 import androidx.room.util.getCoroutineContext
 import androidx.sqlite.SQLiteConnection
 import androidx.sqlite.SQLiteException
 import androidx.sqlite.execSQL
 import kotlin.jvm.JvmOverloads
 import kotlin.jvm.JvmSuppressWildcards
-import kotlinx.atomicfu.atomic
-import kotlinx.atomicfu.locks.reentrantLock
-import kotlinx.atomicfu.locks.withLock
 import kotlinx.coroutines.CoroutineName
 import kotlinx.coroutines.flow.Flow
 import kotlinx.coroutines.flow.FlowCollector
@@ -162,7 +162,7 @@
      * queue to be done asynchronously, this flag is used to control excessive scheduling of
      * refreshes.
      */
-    private val pendingRefresh = atomic(false)
+    private val pendingRefresh = AtomicBoolean(false)
 
     /** Callback to allow or disallow [refreshInvalidation] from proceeding. */
     internal var onAllowRefresh: () -> Boolean = { true }
@@ -484,7 +484,7 @@
  */
 internal class ObservedTableStates(size: Int) {
 
-    private val lock = reentrantLock()
+    private val lock = ReentrantLock()
 
     // The number of observers per table
     private val tableObserversCount = LongArray(size)
diff --git a/room/room-runtime/src/commonMain/kotlin/androidx/room/concurrent/Atomics.kt b/room/room-runtime/src/commonMain/kotlin/androidx/room/concurrent/Atomics.kt
new file mode 100644
index 0000000..04abb13
--- /dev/null
+++ b/room/room-runtime/src/commonMain/kotlin/androidx/room/concurrent/Atomics.kt
@@ -0,0 +1,51 @@
+/*
+ * Copyright 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.
+ */
+
+@file:RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
+
+package androidx.room.concurrent
+
+import androidx.annotation.RestrictTo
+
+expect class AtomicInt {
+    constructor(initialValue: Int)
+
+    fun get(): Int
+
+    fun set(value: Int)
+
+    fun compareAndSet(expect: Int, update: Int): Boolean
+
+    fun incrementAndGet(): Int
+
+    fun getAndIncrement(): Int
+
+    fun decrementAndGet(): Int
+}
+
+internal inline fun AtomicInt.loop(action: (Int) -> Unit): Nothing {
+    while (true) {
+        action(get())
+    }
+}
+
+expect class AtomicBoolean {
+    constructor(initialValue: Boolean)
+
+    fun get(): Boolean
+
+    fun compareAndSet(expect: Boolean, update: Boolean): Boolean
+}
diff --git a/room/room-runtime/src/commonMain/kotlin/androidx/room/concurrent/CloseBarrier.kt b/room/room-runtime/src/commonMain/kotlin/androidx/room/concurrent/CloseBarrier.kt
index 8bf4a24..e499315 100644
--- a/room/room-runtime/src/commonMain/kotlin/androidx/room/concurrent/CloseBarrier.kt
+++ b/room/room-runtime/src/commonMain/kotlin/androidx/room/concurrent/CloseBarrier.kt
@@ -16,11 +16,6 @@
 
 package androidx.room.concurrent
 
-import kotlinx.atomicfu.atomic
-import kotlinx.atomicfu.locks.SynchronizedObject
-import kotlinx.atomicfu.locks.synchronized
-import kotlinx.atomicfu.loop
-
 /**
  * A barrier that can be used to perform a cleanup action once, waiting for registered parties
  * (blockers) to finish using the protected resource.
@@ -40,9 +35,10 @@
  *   blockers.
  */
 internal class CloseBarrier(private val closeAction: () -> Unit) : SynchronizedObject() {
-    private val blockers = atomic(0)
-    private val closeInitiated = atomic(false)
-    private val isClosed by closeInitiated
+    private val blockers = AtomicInt(0)
+    private val closeInitiated = AtomicBoolean(false)
+    private val isClosed: Boolean
+        get() = closeInitiated.get()
 
     /**
      * Blocks the [closeAction] from occurring.
@@ -72,7 +68,7 @@
     internal fun unblock(): Unit =
         synchronized(this) {
             blockers.decrementAndGet()
-            check(blockers.value >= 0) { "Unbalanced call to unblock() detected." }
+            check(blockers.get() >= 0) { "Unbalanced call to unblock() detected." }
         }
 
     /**
diff --git a/room/room-runtime/src/commonMain/kotlin/androidx/room/concurrent/ExclusiveLock.kt b/room/room-runtime/src/commonMain/kotlin/androidx/room/concurrent/ExclusiveLock.kt
index de1c2e5..2d34dd7 100644
--- a/room/room-runtime/src/commonMain/kotlin/androidx/room/concurrent/ExclusiveLock.kt
+++ b/room/room-runtime/src/commonMain/kotlin/androidx/room/concurrent/ExclusiveLock.kt
@@ -16,11 +16,6 @@
 
 package androidx.room.concurrent
 
-import kotlinx.atomicfu.locks.ReentrantLock
-import kotlinx.atomicfu.locks.SynchronizedObject
-import kotlinx.atomicfu.locks.reentrantLock
-import kotlinx.atomicfu.locks.synchronized
-
 /**
  * An exclusive lock for in-process and multi-process synchronization.
  *
@@ -59,7 +54,7 @@
 
         private fun getThreadLock(key: String): ReentrantLock =
             synchronized(this) {
-                return threadLocksMap.getOrPut(key) { reentrantLock() }
+                return threadLocksMap.getOrPut(key) { ReentrantLock() }
             }
 
         private fun getFileLock(key: String) = FileLock(key)
diff --git a/room/room-runtime/src/commonMain/kotlin/androidx/room/concurrent/ReentrantLock.kt b/room/room-runtime/src/commonMain/kotlin/androidx/room/concurrent/ReentrantLock.kt
new file mode 100644
index 0000000..444ef7c
--- /dev/null
+++ b/room/room-runtime/src/commonMain/kotlin/androidx/room/concurrent/ReentrantLock.kt
@@ -0,0 +1,34 @@
+/*
+ * Copyright 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 androidx.room.concurrent
+
+internal expect class ReentrantLock() {
+    fun lock(): Unit
+
+    fun tryLock(): Boolean
+
+    fun unlock(): Unit
+}
+
+internal inline fun <T> ReentrantLock.withLock(block: () -> T): T {
+    lock()
+    try {
+        return block()
+    } finally {
+        unlock()
+    }
+}
diff --git a/room/room-runtime/src/commonMain/kotlin/androidx/room/concurrent/Synchronized.kt b/room/room-runtime/src/commonMain/kotlin/androidx/room/concurrent/Synchronized.kt
new file mode 100644
index 0000000..1515bdf
--- /dev/null
+++ b/room/room-runtime/src/commonMain/kotlin/androidx/room/concurrent/Synchronized.kt
@@ -0,0 +1,21 @@
+/*
+ * Copyright 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 androidx.room.concurrent
+
+internal expect open class SynchronizedObject()
+
+internal expect inline fun <T> synchronized(lock: SynchronizedObject, block: () -> T): T
diff --git a/room/room-runtime/src/commonMain/kotlin/androidx/room/coroutines/ConnectionPoolImpl.kt b/room/room-runtime/src/commonMain/kotlin/androidx/room/coroutines/ConnectionPoolImpl.kt
index 185e412..ae49a2e 100644
--- a/room/room-runtime/src/commonMain/kotlin/androidx/room/coroutines/ConnectionPoolImpl.kt
+++ b/room/room-runtime/src/commonMain/kotlin/androidx/room/coroutines/ConnectionPoolImpl.kt
@@ -19,6 +19,8 @@
 import androidx.room.TransactionScope
 import androidx.room.Transactor
 import androidx.room.Transactor.SQLiteTransactionType
+import androidx.room.concurrent.AtomicBoolean
+import androidx.room.concurrent.AtomicInt
 import androidx.room.concurrent.ThreadLocal
 import androidx.room.concurrent.asContextElement
 import androidx.room.concurrent.currentThreadId
@@ -35,7 +37,6 @@
 import kotlin.coroutines.CoroutineContext
 import kotlin.coroutines.coroutineContext
 import kotlin.time.Duration.Companion.seconds
-import kotlinx.atomicfu.atomic
 import kotlinx.coroutines.TimeoutCancellationException
 import kotlinx.coroutines.channels.Channel
 import kotlinx.coroutines.sync.Mutex
@@ -50,8 +51,9 @@
 
     private val threadLocal = ThreadLocal<PooledConnectionImpl>()
 
-    private val _isClosed = atomic(false)
-    private val isClosed by _isClosed
+    private val _isClosed = AtomicBoolean(false)
+    private val isClosed: Boolean
+        get() = _isClosed.get()
 
     // Amount of time to wait to acquire a connection before throwing, Android uses 30 seconds in
     // its pool, so we do too here, but IDK if that is a good number. This timeout is unrelated to
@@ -195,7 +197,7 @@
 }
 
 private class Pool(val capacity: Int, val connectionFactory: () -> SQLiteConnection) {
-    private val size = atomic(0)
+    private val size = AtomicInt(0)
     private val connections = arrayOfNulls<ConnectionWithLock>(capacity)
     private val channel =
         Channel<ConnectionWithLock>(capacity = capacity, onUndeliveredElement = { recycle(it) })
@@ -211,7 +213,7 @@
     }
 
     private fun tryOpenNewConnection() {
-        val currentSize = size.value
+        val currentSize = size.get()
         if (currentSize >= capacity) {
             // Capacity reached
             return
@@ -322,8 +324,9 @@
 ) : Transactor, RawConnectionAccessor {
     private val transactionStack = ArrayDeque<TransactionItem>()
 
-    private val _isRecycled = atomic(false)
-    private val isRecycled by _isRecycled
+    private val _isRecycled = AtomicBoolean(false)
+    private val isRecycled: Boolean
+        get() = _isRecycled.get()
 
     override val rawConnection: SQLiteConnection
         get() = delegate
diff --git a/room/room-runtime/src/commonTest/kotlin/androidx/room/concurrent/CloseBarrierTest.kt b/room/room-runtime/src/commonTest/kotlin/androidx/room/concurrent/CloseBarrierTest.kt
index 75f64d1..3133b3a 100644
--- a/room/room-runtime/src/commonTest/kotlin/androidx/room/concurrent/CloseBarrierTest.kt
+++ b/room/room-runtime/src/commonTest/kotlin/androidx/room/concurrent/CloseBarrierTest.kt
@@ -19,7 +19,6 @@
 import androidx.kruth.assertThat
 import androidx.kruth.assertThrows
 import kotlin.test.Test
-import kotlinx.atomicfu.atomic
 import kotlinx.coroutines.DelicateCoroutinesApi
 import kotlinx.coroutines.ExperimentalCoroutinesApi
 import kotlinx.coroutines.launch
@@ -34,9 +33,9 @@
     @Test
     @OptIn(ExperimentalCoroutinesApi::class, DelicateCoroutinesApi::class)
     fun oneBlocker() = runTest {
-        val actionPerformed = atomic(false)
+        val actionPerformed = AtomicBoolean(false)
         val closeBarrier = CloseBarrier {
-            assertThat(actionPerformed.compareAndSet(expect = false, update = true)).isTrue()
+            assertThat(actionPerformed.compareAndSet(false, true)).isTrue()
         }
         val jobLaunched = Mutex(locked = true)
 
@@ -52,14 +51,14 @@
 
         // yield for launch and verify the close action has not been performed
         yield()
-        jobLaunched.withLock { assertThat(actionPerformed.value).isFalse() }
+        jobLaunched.withLock { assertThat(actionPerformed.get()).isFalse() }
 
         // unblock the barrier, close job should complete
         closeBarrier.unblock()
         closeJob.join()
 
         // verify action was performed
-        assertThat(actionPerformed.value).isTrue()
+        assertThat(actionPerformed.get()).isTrue()
 
         // verify a new block is not granted since the barrier is already close
         assertThat(closeBarrier.block()).isFalse()
@@ -67,15 +66,15 @@
 
     @Test
     fun noBlockers() = runTest {
-        val actionPerformed = atomic(false)
+        val actionPerformed = AtomicBoolean(false)
         val closeBarrier = CloseBarrier {
-            assertThat(actionPerformed.compareAndSet(expect = false, update = true)).isTrue()
+            assertThat(actionPerformed.compareAndSet(false, true)).isTrue()
         }
 
         // Validate close action is performed immediately if there are no blockers
         closeBarrier.close()
 
-        assertThat(actionPerformed.value).isTrue()
+        assertThat(actionPerformed.get()).isTrue()
     }
 
     @Test
@@ -89,9 +88,9 @@
     @Test
     @OptIn(ExperimentalCoroutinesApi::class, DelicateCoroutinesApi::class)
     fun noStarvation() = runTest {
-        val actionPerformed = atomic(false)
+        val actionPerformed = AtomicBoolean(false)
         val closeBarrier = CloseBarrier {
-            assertThat(actionPerformed.compareAndSet(expect = false, update = true)).isTrue()
+            assertThat(actionPerformed.compareAndSet(false, true)).isTrue()
         }
         val jobLaunched = Mutex(locked = true)
 
@@ -111,12 +110,12 @@
         // yield for launch and verify the close action has not been performed in an attempt to
         // get the block / unblock loop going
         yield()
-        jobLaunched.withLock { assertThat(actionPerformed.value).isFalse() }
+        jobLaunched.withLock { assertThat(actionPerformed.get()).isFalse() }
 
         // initiate the close action, test should not deadlock (or timeout) meaning the barrier
         // will not cause the caller to starve
         closeBarrier.close()
         blockerJob.join()
-        assertThat(actionPerformed.value).isTrue()
+        assertThat(actionPerformed.get()).isTrue()
     }
 }
diff --git a/room/room-runtime/src/commonTest/kotlin/androidx/room/coroutines/BaseConnectionPoolTest.kt b/room/room-runtime/src/commonTest/kotlin/androidx/room/coroutines/BaseConnectionPoolTest.kt
index cff6dbd..f86b7b6 100644
--- a/room/room-runtime/src/commonTest/kotlin/androidx/room/coroutines/BaseConnectionPoolTest.kt
+++ b/room/room-runtime/src/commonTest/kotlin/androidx/room/coroutines/BaseConnectionPoolTest.kt
@@ -19,6 +19,7 @@
 import androidx.kruth.assertThat
 import androidx.room.PooledConnection
 import androidx.room.Transactor
+import androidx.room.concurrent.AtomicInt
 import androidx.room.deferredTransaction
 import androidx.room.exclusiveTransaction
 import androidx.room.execSQL
@@ -34,7 +35,6 @@
 import kotlin.test.Test
 import kotlin.test.assertFailsWith
 import kotlin.test.fail
-import kotlinx.atomicfu.atomic
 import kotlinx.coroutines.DelicateCoroutinesApi
 import kotlinx.coroutines.Dispatchers
 import kotlinx.coroutines.ExperimentalCoroutinesApi
@@ -463,7 +463,7 @@
     @Test
     fun singleConnectionPool() = runTest {
         val multiThreadContext = newFixedThreadPoolContext(2, "Test-Threads")
-        val connectionsOpened = atomic(0)
+        val connectionsOpened = AtomicInt(0)
         val actualDriver = setupDriver()
         val driver =
             object : SQLiteDriver by actualDriver {
@@ -487,12 +487,12 @@
         jobs.joinAll()
         pool.close()
         multiThreadContext.close()
-        assertThat(connectionsOpened.value).isEqualTo(1)
+        assertThat(connectionsOpened.get()).isEqualTo(1)
     }
 
     @Test
     fun openOneConnectionWhenUsedSerially() = runTest {
-        val connectionsOpened = atomic(0)
+        val connectionsOpened = AtomicInt(0)
         val actualDriver = setupDriver()
         val driver =
             object : SQLiteDriver by actualDriver {
@@ -518,7 +518,7 @@
             }
         }
         pool.close()
-        assertThat(connectionsOpened.value).isEqualTo(1)
+        assertThat(connectionsOpened.get()).isEqualTo(1)
     }
 
     @Test
@@ -689,7 +689,7 @@
                 actual.close()
             }
         }
-        val connectionArrCount = atomic(0)
+        val connectionArrCount = AtomicInt(0)
         val connectionsArr = arrayOfNulls<CloseAwareConnection>(4)
         val actualDriver = setupDriver()
         val driver =
@@ -714,7 +714,7 @@
                 launch(multiThreadContext) { pool.useReaderConnection { barrier.withLock {} } }
             jobs.add(job)
         }
-        while (connectionArrCount.value < 4) {
+        while (connectionArrCount.get() < 4) {
             delay(100)
         }
         barrier.unlock()
diff --git a/room/room-runtime/src/jvmAndroidMain/kotlin/androidx/room/concurrent/Atomics.jvmAndroid.kt b/room/room-runtime/src/jvmAndroidMain/kotlin/androidx/room/concurrent/Atomics.jvmAndroid.kt
new file mode 100644
index 0000000..00255dc
--- /dev/null
+++ b/room/room-runtime/src/jvmAndroidMain/kotlin/androidx/room/concurrent/Atomics.jvmAndroid.kt
@@ -0,0 +1,25 @@
+/*
+ * Copyright 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.
+ */
+
+@file:RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
+
+package androidx.room.concurrent
+
+import androidx.annotation.RestrictTo
+
+actual typealias AtomicInt = java.util.concurrent.atomic.AtomicInteger
+
+actual typealias AtomicBoolean = java.util.concurrent.atomic.AtomicBoolean
diff --git a/room/room-runtime/src/jvmAndroidMain/kotlin/androidx/room/concurrent/ReentrantLock.jvmAndroid.kt b/room/room-runtime/src/jvmAndroidMain/kotlin/androidx/room/concurrent/ReentrantLock.jvmAndroid.kt
new file mode 100644
index 0000000..dc8fdab
--- /dev/null
+++ b/room/room-runtime/src/jvmAndroidMain/kotlin/androidx/room/concurrent/ReentrantLock.jvmAndroid.kt
@@ -0,0 +1,19 @@
+/*
+ * Copyright 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 androidx.room.concurrent
+
+internal actual typealias ReentrantLock = java.util.concurrent.locks.ReentrantLock
diff --git a/room/room-runtime/src/jvmAndroidMain/kotlin/androidx/room/concurrent/Synchronized.jvmAndroid.kt b/room/room-runtime/src/jvmAndroidMain/kotlin/androidx/room/concurrent/Synchronized.jvmAndroid.kt
new file mode 100644
index 0000000..fae30d5
--- /dev/null
+++ b/room/room-runtime/src/jvmAndroidMain/kotlin/androidx/room/concurrent/Synchronized.jvmAndroid.kt
@@ -0,0 +1,22 @@
+/*
+ * Copyright 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 androidx.room.concurrent
+
+internal actual typealias SynchronizedObject = Any
+
+internal actual inline fun <T> synchronized(lock: SynchronizedObject, block: () -> T): T =
+    kotlin.synchronized(lock, block)
diff --git a/room/room-runtime/src/nativeMain/kotlin/androidx/room/concurrent/Atomics.native.kt b/room/room-runtime/src/nativeMain/kotlin/androidx/room/concurrent/Atomics.native.kt
new file mode 100644
index 0000000..46b4012
--- /dev/null
+++ b/room/room-runtime/src/nativeMain/kotlin/androidx/room/concurrent/Atomics.native.kt
@@ -0,0 +1,52 @@
+/*
+ * Copyright 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.
+ */
+
+@file:RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
+
+package androidx.room.concurrent
+
+import androidx.annotation.RestrictTo
+import kotlin.concurrent.AtomicInt as KotlinAtomicInt
+
+actual class AtomicInt actual constructor(initialValue: Int) {
+    private val delegate: KotlinAtomicInt = KotlinAtomicInt(initialValue)
+
+    actual fun get(): Int = delegate.value
+
+    actual fun set(value: Int) {
+        delegate.value = value
+    }
+
+    actual fun compareAndSet(expect: Int, update: Int): Boolean =
+        delegate.compareAndSet(expect, update)
+
+    actual fun incrementAndGet(): Int = delegate.incrementAndGet()
+
+    actual fun getAndIncrement(): Int = delegate.getAndIncrement()
+
+    actual fun decrementAndGet(): Int = delegate.decrementAndGet()
+}
+
+actual class AtomicBoolean actual constructor(initialValue: Boolean) {
+    private val delegate: KotlinAtomicInt = KotlinAtomicInt(toInt(initialValue))
+
+    actual fun get(): Boolean = delegate.value == 1
+
+    actual fun compareAndSet(expect: Boolean, update: Boolean): Boolean =
+        delegate.compareAndSet(toInt(expect), toInt(update))
+
+    private fun toInt(value: Boolean) = if (value) 1 else 0
+}
diff --git a/room/room-runtime/src/nativeMain/kotlin/androidx/room/concurrent/ReentrantLock.native.kt b/room/room-runtime/src/nativeMain/kotlin/androidx/room/concurrent/ReentrantLock.native.kt
new file mode 100644
index 0000000..544fa01
--- /dev/null
+++ b/room/room-runtime/src/nativeMain/kotlin/androidx/room/concurrent/ReentrantLock.native.kt
@@ -0,0 +1,19 @@
+/*
+ * Copyright 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 androidx.room.concurrent
+
+internal actual typealias ReentrantLock = kotlinx.atomicfu.locks.SynchronizedObject
diff --git a/room/room-runtime/src/nativeMain/kotlin/androidx/room/concurrent/Synchronized.native.kt b/room/room-runtime/src/nativeMain/kotlin/androidx/room/concurrent/Synchronized.native.kt
new file mode 100644
index 0000000..7691045
--- /dev/null
+++ b/room/room-runtime/src/nativeMain/kotlin/androidx/room/concurrent/Synchronized.native.kt
@@ -0,0 +1,22 @@
+/*
+ * Copyright 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 androidx.room.concurrent
+
+internal actual typealias SynchronizedObject = kotlinx.atomicfu.locks.SynchronizedObject
+
+internal actual inline fun <T> synchronized(lock: SynchronizedObject, block: () -> T): T =
+    kotlinx.atomicfu.locks.synchronized(lock, block)
diff --git a/savedstate/savedstate-samples/src/main/java/androidx/savedstate/SavedStateCodecSamples.kt b/savedstate/savedstate-samples/src/main/java/androidx/savedstate/SavedStateCodecSamples.kt
index 8fd4b86..616baa6 100644
--- a/savedstate/savedstate-samples/src/main/java/androidx/savedstate/SavedStateCodecSamples.kt
+++ b/savedstate/savedstate-samples/src/main/java/androidx/savedstate/SavedStateCodecSamples.kt
@@ -18,6 +18,8 @@
 
 package androidx.savedstate
 
+import android.os.Parcel
+import android.os.Parcelable
 import androidx.annotation.Sampled
 import androidx.savedstate.serialization.decodeFromSavedState
 import androidx.savedstate.serialization.encodeToSavedState
@@ -96,7 +98,6 @@
     val uuid = decodeFromSavedState(UUIDSerializer(), uuidSavedState)
 }
 
-@Suppress("SERIALIZER_TYPE_INCOMPATIBLE") // The lint warning does not show up for external users.
 @Sampled
 fun savedStateSerializer() {
     @Serializable
@@ -125,20 +126,36 @@
     )
 }
 
+private class MyJavaSerializable : java.io.Serializable
+
+private class MyJavaSerializableSerializer : JavaSerializableSerializer<MyJavaSerializable>()
+
 @Sampled
 fun serializableSerializer() {
     @Serializable
     data class MyModel(
-        @Serializable(with = JavaSerializableSerializer::class)
-        val serializable: java.io.Serializable
+        @Serializable(with = MyJavaSerializableSerializer::class)
+        val serializable: MyJavaSerializable
     )
 }
 
+private class MyParcelable : Parcelable {
+    override fun describeContents(): Int {
+        TODO("Not yet implemented")
+    }
+
+    override fun writeToParcel(dest: Parcel, flags: Int) {
+        TODO("Not yet implemented")
+    }
+}
+
+private class MyParcelableSerializer : ParcelableSerializer<MyParcelable>()
+
 @Sampled
 fun parcelableSerializer() {
     @Serializable
     data class MyModel(
-        @Serializable(with = ParcelableSerializer::class) val parcelable: android.os.Parcelable
+        @Serializable(with = MyParcelableSerializer::class) val parcelable: MyParcelable
     )
 }
 
@@ -172,13 +189,11 @@
 fun charSequenceListSerializer() {
     @Serializable
     class MyModel(
-        @Suppress("SERIALIZER_TYPE_INCOMPATIBLE")
         @Serializable(with = CharSequenceListSerializer::class)
         val charSequenceList: List<CharSequence>
     )
 }
 
-@Suppress("SERIALIZER_TYPE_INCOMPATIBLE")
 @Sampled
 fun parcelableListSerializer() {
     @Serializable
diff --git a/savedstate/savedstate/api/current.txt b/savedstate/savedstate/api/current.txt
index a3e7083..8a63bfe 100644
--- a/savedstate/savedstate/api/current.txt
+++ b/savedstate/savedstate/api/current.txt
@@ -195,12 +195,12 @@
     property public kotlinx.serialization.descriptors.SerialDescriptor descriptor;
   }
 
-  public class CharSequenceSerializer<T extends java.lang.CharSequence> implements kotlinx.serialization.KSerializer<T> {
+  public final class CharSequenceSerializer implements kotlinx.serialization.KSerializer<java.lang.CharSequence> {
     ctor public CharSequenceSerializer();
-    method public final T deserialize(kotlinx.serialization.encoding.Decoder decoder);
-    method public final kotlinx.serialization.descriptors.SerialDescriptor getDescriptor();
-    method public final void serialize(kotlinx.serialization.encoding.Encoder encoder, T value);
-    property public final kotlinx.serialization.descriptors.SerialDescriptor descriptor;
+    method public CharSequence deserialize(kotlinx.serialization.encoding.Decoder decoder);
+    method public kotlinx.serialization.descriptors.SerialDescriptor getDescriptor();
+    method public void serialize(kotlinx.serialization.encoding.Encoder encoder, CharSequence value);
+    property public kotlinx.serialization.descriptors.SerialDescriptor descriptor;
   }
 
   public final class IBinderSerializer implements kotlinx.serialization.KSerializer<android.os.IBinder> {
@@ -211,7 +211,7 @@
     property public kotlinx.serialization.descriptors.SerialDescriptor descriptor;
   }
 
-  public class JavaSerializableSerializer<T extends java.io.Serializable> implements kotlinx.serialization.KSerializer<T> {
+  public abstract class JavaSerializableSerializer<T extends java.io.Serializable> implements kotlinx.serialization.KSerializer<T> {
     ctor public JavaSerializableSerializer();
     method public final T deserialize(kotlinx.serialization.encoding.Decoder decoder);
     method public final kotlinx.serialization.descriptors.SerialDescriptor getDescriptor();
@@ -235,7 +235,7 @@
     property public kotlinx.serialization.descriptors.SerialDescriptor descriptor;
   }
 
-  public class ParcelableSerializer<T extends android.os.Parcelable> implements kotlinx.serialization.KSerializer<T> {
+  public abstract class ParcelableSerializer<T extends android.os.Parcelable> implements kotlinx.serialization.KSerializer<T> {
     ctor public ParcelableSerializer();
     method public final T deserialize(kotlinx.serialization.encoding.Decoder decoder);
     method public final kotlinx.serialization.descriptors.SerialDescriptor getDescriptor();
diff --git a/savedstate/savedstate/api/restricted_current.txt b/savedstate/savedstate/api/restricted_current.txt
index eb7a636..0f65840 100644
--- a/savedstate/savedstate/api/restricted_current.txt
+++ b/savedstate/savedstate/api/restricted_current.txt
@@ -220,12 +220,12 @@
     property public kotlinx.serialization.descriptors.SerialDescriptor descriptor;
   }
 
-  public class CharSequenceSerializer<T extends java.lang.CharSequence> implements kotlinx.serialization.KSerializer<T> {
+  public final class CharSequenceSerializer implements kotlinx.serialization.KSerializer<java.lang.CharSequence> {
     ctor public CharSequenceSerializer();
-    method public final T deserialize(kotlinx.serialization.encoding.Decoder decoder);
-    method public final kotlinx.serialization.descriptors.SerialDescriptor getDescriptor();
-    method public final void serialize(kotlinx.serialization.encoding.Encoder encoder, T value);
-    property public final kotlinx.serialization.descriptors.SerialDescriptor descriptor;
+    method public CharSequence deserialize(kotlinx.serialization.encoding.Decoder decoder);
+    method public kotlinx.serialization.descriptors.SerialDescriptor getDescriptor();
+    method public void serialize(kotlinx.serialization.encoding.Encoder encoder, CharSequence value);
+    property public kotlinx.serialization.descriptors.SerialDescriptor descriptor;
   }
 
   public final class IBinderSerializer implements kotlinx.serialization.KSerializer<android.os.IBinder> {
@@ -236,7 +236,7 @@
     property public kotlinx.serialization.descriptors.SerialDescriptor descriptor;
   }
 
-  public class JavaSerializableSerializer<T extends java.io.Serializable> implements kotlinx.serialization.KSerializer<T> {
+  public abstract class JavaSerializableSerializer<T extends java.io.Serializable> implements kotlinx.serialization.KSerializer<T> {
     ctor public JavaSerializableSerializer();
     method public final T deserialize(kotlinx.serialization.encoding.Decoder decoder);
     method public final kotlinx.serialization.descriptors.SerialDescriptor getDescriptor();
@@ -260,7 +260,7 @@
     property public kotlinx.serialization.descriptors.SerialDescriptor descriptor;
   }
 
-  public class ParcelableSerializer<T extends android.os.Parcelable> implements kotlinx.serialization.KSerializer<T> {
+  public abstract class ParcelableSerializer<T extends android.os.Parcelable> implements kotlinx.serialization.KSerializer<T> {
     ctor public ParcelableSerializer();
     method public final T deserialize(kotlinx.serialization.encoding.Decoder decoder);
     method public final kotlinx.serialization.descriptors.SerialDescriptor getDescriptor();
diff --git a/savedstate/savedstate/src/androidInstrumentedTest/kotlin/androidx/savedstate/SavedStateCodecTestUtils.android.kt b/savedstate/savedstate/src/androidInstrumentedTest/kotlin/androidx/savedstate/SavedStateCodecTestUtils.android.kt
new file mode 100644
index 0000000..edf79cc
--- /dev/null
+++ b/savedstate/savedstate/src/androidInstrumentedTest/kotlin/androidx/savedstate/SavedStateCodecTestUtils.android.kt
@@ -0,0 +1,28 @@
+/*
+ * Copyright 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 androidx.savedstate
+
+import android.os.Parcel
+
+actual fun platformEncodeDecode(savedState: SavedState): SavedState {
+    val parcel =
+        Parcel.obtain().apply {
+            savedState.writeToParcel(this, 0)
+            setDataPosition(0)
+        }
+    return SavedState.CREATOR.createFromParcel(parcel)
+}
diff --git a/savedstate/savedstate/src/androidMain/kotlin/androidx/savedstate/serialization/serializers/BuiltInSerializer.android.kt b/savedstate/savedstate/src/androidMain/kotlin/androidx/savedstate/serialization/serializers/BuiltInSerializer.android.kt
index f0dacc5..071f4c1 100644
--- a/savedstate/savedstate/src/androidMain/kotlin/androidx/savedstate/serialization/serializers/BuiltInSerializer.android.kt
+++ b/savedstate/savedstate/src/androidMain/kotlin/androidx/savedstate/serialization/serializers/BuiltInSerializer.android.kt
@@ -107,10 +107,10 @@
  * @see androidx.savedstate.serialization.decodeFromSavedState
  */
 @OptIn(ExperimentalSerializationApi::class)
-public open class CharSequenceSerializer<T : CharSequence> : KSerializer<T> {
-    final override val descriptor: SerialDescriptor = buildClassSerialDescriptor("CharSequence")
+public class CharSequenceSerializer : KSerializer<CharSequence> {
+    override val descriptor: SerialDescriptor = buildClassSerialDescriptor("CharSequence")
 
-    final override fun serialize(encoder: Encoder, value: T) {
+    override fun serialize(encoder: Encoder, value: CharSequence) {
         require(encoder is SavedStateEncoder) {
             encoderErrorMessage(descriptor.serialName, encoder)
         }
@@ -118,17 +118,18 @@
     }
 
     @Suppress("UNCHECKED_CAST")
-    final override fun deserialize(decoder: Decoder): T {
+    override fun deserialize(decoder: Decoder): CharSequence {
         require(decoder is SavedStateDecoder) {
             decoderErrorMessage(descriptor.serialName, decoder)
         }
-        return decoder.run { savedState.read { getCharSequence(key) as T } }
+        return decoder.run { savedState.read { getCharSequence(key) } }
     }
 }
 
 /**
  * A serializer for [java.io.Serializable]. This serializer uses [SavedState]'s API directly to
- * save/load a [java.io.Serializable].
+ * save/load a [java.io.Serializable]. You must extend this serializer for each of your
+ * [java.io.Serializable] subclasses.
  *
  * Note that this serializer should be used with [SavedStateEncoder] or [SavedStateDecoder] only.
  * Using it with other Encoders/Decoders may throw [IllegalArgumentException].
@@ -138,7 +139,7 @@
  * @see androidx.savedstate.serialization.decodeFromSavedState
  */
 @OptIn(ExperimentalSerializationApi::class)
-public open class JavaSerializableSerializer<T : JavaSerializable> : KSerializer<T> {
+public abstract class JavaSerializableSerializer<T : JavaSerializable> : KSerializer<T> {
     final override val descriptor: SerialDescriptor = buildClassSerialDescriptor("JavaSerializable")
 
     final override fun serialize(encoder: Encoder, value: T) {
@@ -159,7 +160,7 @@
 
 /**
  * A serializer for [Parcelable]. This serializer uses [SavedState]'s API directly to save/load a
- * [Parcelable].
+ * [Parcelable]. You must extend this serializer for each of your [Parcelable] subclasses.
  *
  * Note that this serializer should be used with [SavedStateEncoder] or [SavedStateDecoder] only.
  * Using it with other Encoders/Decoders may throw [IllegalArgumentException].
@@ -169,7 +170,7 @@
  * @see androidx.savedstate.serialization.decodeFromSavedState
  */
 @OptIn(ExperimentalSerializationApi::class)
-public open class ParcelableSerializer<T : Parcelable> : KSerializer<T> {
+public abstract class ParcelableSerializer<T : Parcelable> : KSerializer<T> {
     final override val descriptor: SerialDescriptor = buildClassSerialDescriptor("Parcelable")
 
     final override fun serialize(encoder: Encoder, value: T) {
diff --git a/savedstate/savedstate/src/androidUnitTest/kotlin/androidx/savedstate/SavedStateCodecAndroidTest.android.kt b/savedstate/savedstate/src/androidUnitTest/kotlin/androidx/savedstate/SavedStateCodecAndroidTest.android.kt
index 2c34ddb..743c3e4 100644
--- a/savedstate/savedstate/src/androidUnitTest/kotlin/androidx/savedstate/SavedStateCodecAndroidTest.android.kt
+++ b/savedstate/savedstate/src/androidUnitTest/kotlin/androidx/savedstate/SavedStateCodecAndroidTest.android.kt
@@ -26,7 +26,6 @@
 import android.util.SizeF
 import android.util.SparseArray
 import androidx.core.os.bundleOf
-import androidx.core.util.forEach
 import androidx.kruth.assertThat
 import androidx.kruth.assertThrows
 import androidx.savedstate.SavedStateCodecTestUtils.encodeDecode
@@ -59,7 +58,6 @@
 import kotlinx.serialization.encoding.Encoder
 import kotlinx.serialization.encoding.decodeStructure
 import kotlinx.serialization.encoding.encodeStructure
-import kotlinx.serialization.serializer
 
 @ExperimentalSerializationApi
 internal class SavedStateCodecAndroidTest : RobolectricTest() {
@@ -100,18 +98,7 @@
             "SERIALIZER_TYPE_INCOMPATIBLE"
         ) // The lint warning does not show up for external users.
         @Serializable
-        class MyClass(@Serializable(with = SavedStateSerializer::class) val s: Bundle) {
-            override fun equals(other: Any?): Boolean {
-                if (this === other) return true
-                if (javaClass != other?.javaClass) return false
-                other as MyClass
-                return s.read { contentDeepEquals(other.s) }
-            }
-
-            override fun hashCode(): Int {
-                return s.read { contentDeepHashCode() }
-            }
-        }
+        class MyClass(@Serializable(with = SavedStateSerializer::class) val s: Bundle)
         MyClass(
                 bundleOf(
                     "i" to 1,
@@ -120,19 +107,24 @@
                     "ss" to bundleOf("s" to "bar")
                 )
             )
-            .encodeDecode {
-                assertThat(size()).isEqualTo(1)
-                getSavedState("s").read {
-                    assertThat(size()).isEqualTo(4)
-                    assertThat(getInt("i")).isEqualTo(1)
-                    assertThat(getString("s")).isEqualTo("foo")
-                    assertThat(getIntArray("a")).isEqualTo(intArrayOf(1, 3, 5))
-                    getSavedState("ss").read {
-                        assertThat(size()).isEqualTo(1)
-                        assertThat(getString("s")).isEqualTo("bar")
+            .encodeDecode(
+                checkDecoded = { decoded, original ->
+                    assertThat(decoded.s.read { contentDeepEquals(original.s) }).isTrue()
+                },
+                checkEncoded = {
+                    assertThat(size()).isEqualTo(1)
+                    getSavedState("s").read {
+                        assertThat(size()).isEqualTo(4)
+                        assertThat(getInt("i")).isEqualTo(1)
+                        assertThat(getString("s")).isEqualTo("foo")
+                        assertThat(getIntArray("a")).isEqualTo(intArrayOf(1, 3, 5))
+                        getSavedState("ss").read {
+                            assertThat(size()).isEqualTo(1)
+                            assertThat(getString("s")).isEqualTo("bar")
+                        }
                     }
                 }
-            }
+            )
 
         // Bundle at root.
         val origin = bundleOf("i" to 3, "s" to "foo", "d" to 3.14)
@@ -180,7 +172,8 @@
 
         @Serializable
         data class SerializableContainer(
-            @Serializable(with = JavaSerializableSerializer::class) val value: java.io.Serializable
+            @Serializable(with = CustomJavaSerializableSerializer::class)
+            val value: java.io.Serializable
         )
         val myJavaSerializable = MyJavaSerializable(3, "foo", 3.14)
         SerializableContainer(myJavaSerializable).encodeDecode {
@@ -191,7 +184,7 @@
 
         @Serializable
         data class ParcelableContainer(
-            @Serializable(with = ParcelableSerializer::class) val value: Parcelable
+            @Serializable(with = CustomParcelableSerializer::class) val value: Parcelable
         )
         val myParcelable = MyParcelable(3, "foo", 3.14)
         ParcelableContainer(myParcelable).encodeDecode {
@@ -257,19 +250,9 @@
             error("VERSION.SDK_INT < Q")
         }
 
+        @Suppress("ArrayInDataClass")
         @Serializable
-        data class CharSequenceArrayContainer(val value: Array<out CharSequence>) {
-            override fun equals(other: Any?): Boolean {
-                if (this === other) return true
-                if (javaClass != other?.javaClass) return false
-                other as CharSequenceArrayContainer
-                return value.contentEquals(other.value)
-            }
-
-            override fun hashCode(): Int {
-                return value.contentHashCode()
-            }
-        }
+        data class CharSequenceArrayContainer(val value: Array<out CharSequence>)
         assertThrows<SerializationException> {
                 CharSequenceArrayContainer(arrayOf("foo", "bar")).encodeDecode {}
             }
@@ -281,20 +264,10 @@
 
     @Test
     fun concreteTypesInsteadOfInterfaceTypes() {
-        @Suppress("SERIALIZER_TYPE_INCOMPATIBLE")
-        @Serializable
-        data class CharSequenceContainer(
-            @Serializable(with = CharSequenceSerializer::class) val value: String
-        )
-        CharSequenceContainer("foo").encodeDecode {
-            assertThat(size()).isEqualTo(1)
-            assertThat(getCharSequence("value")).isEqualTo("foo")
-        }
-
-        @Suppress("SERIALIZER_TYPE_INCOMPATIBLE")
         @Serializable
         data class SerializableContainer(
-            @Serializable(with = JavaSerializableSerializer::class) val value: MyJavaSerializable
+            @Serializable(with = MyJavaSerializableAsJavaSerializableSerializer::class)
+            val value: MyJavaSerializable
         )
         val myJavaSerializable = MyJavaSerializable(3, "foo", 3.14)
         SerializableContainer(myJavaSerializable).encodeDecode {
@@ -303,10 +276,9 @@
                 .isEqualTo(myJavaSerializable)
         }
 
-        @Suppress("SERIALIZER_TYPE_INCOMPATIBLE")
         @Serializable
         data class ParcelableContainer(
-            @Serializable(with = ParcelableSerializer::class) val value: MyParcelable
+            @Serializable(with = MyParcelableAsParcelableSerializer::class) val value: MyParcelable
         )
         val myParcelable = MyParcelable(3, "foo", 3.14)
         ParcelableContainer(myParcelable).encodeDecode {
@@ -315,10 +287,11 @@
         }
 
         if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
-            @Suppress("SERIALIZER_TYPE_INCOMPATIBLE")
             @Serializable
             data class IBinderContainer(
-                @Serializable(with = IBinderSerializer::class) val value: Binder
+                @Suppress("SERIALIZER_TYPE_INCOMPATIBLE")
+                @Serializable(with = IBinderSerializer::class)
+                val value: Binder
             )
             val binder = Binder("foo")
             IBinderContainer(binder).encodeDecode {
@@ -333,47 +306,36 @@
     @Test
     fun collectionTypes() {
         @Serializable
+        @Suppress("ArrayInDataClass")
         data class CharSequenceArrayContainer(
             @Serializable(with = CharSequenceArraySerializer::class)
             val value: Array<out CharSequence>
-        ) {
-            override fun equals(other: Any?): Boolean {
-                if (this === other) return true
-                if (javaClass != other?.javaClass) return false
-                other as CharSequenceArrayContainer
-                return value.contentEquals(other.value)
-            }
-
-            override fun hashCode(): Int {
-                return value.contentHashCode()
-            }
-        }
-        val myCharSequenceArray = arrayOf("foo", "bar")
-        CharSequenceArrayContainer(myCharSequenceArray).encodeDecode {
-            assertThat(size()).isEqualTo(1)
-            assertThat(getCharSequenceArray("value")).isEqualTo(myCharSequenceArray)
-        }
+        )
+        val myCharSequenceArray = arrayOf(StringBuilder("foo"), StringBuilder("bar"))
+        CharSequenceArrayContainer(myCharSequenceArray)
+            .encodeDecode(
+                checkDecoded = { decoded, original -> decoded.value.contentEquals(original.value) },
+                checkEncoded = {
+                    assertThat(size()).isEqualTo(1)
+                    assertThat(getCharSequenceArray("value")).isEqualTo(myCharSequenceArray)
+                }
+            )
 
         @Serializable
+        @Suppress("ArrayInDataClass")
         data class ParcelableArrayContainer(
             @Serializable(with = ParcelableArraySerializer::class) val value: Array<out Parcelable>
-        ) {
-            override fun equals(other: Any?): Boolean {
-                if (this === other) return true
-                if (javaClass != other?.javaClass) return false
-                other as ParcelableArrayContainer
-                return value.contentEquals(other.value)
-            }
-
-            override fun hashCode(): Int {
-                return value.contentHashCode()
-            }
-        }
+        )
         val myParcelableArray = arrayOf(MyParcelable(3, "foo", 3.14), MyParcelable(4, "bar", 1.73))
-        ParcelableArrayContainer(myParcelableArray).encodeDecode {
-            assertThat(size()).isEqualTo(1)
-            assertThat(getParcelableArray<MyParcelable>("value")).isEqualTo(myParcelableArray)
-        }
+        ParcelableArrayContainer(myParcelableArray)
+            .encodeDecode(
+                checkDecoded = { decoded, original -> decoded.value.contentEquals(original.value) },
+                checkEncoded = {
+                    assertThat(size()).isEqualTo(1)
+                    assertThat(getParcelableArray<MyParcelable>("value"))
+                        .isEqualTo(myParcelableArray)
+                }
+            )
 
         @Serializable
         data class CharSequenceListContainer(
@@ -406,76 +368,96 @@
                 append(1, MyParcelable(3, "foo", 3.14))
                 append(3, MyParcelable(4, "bar", 1.73))
             }
-        SparseParcelableArrayContainer(mySparseParcelableArray).encodeDecode {
-            assertThat(size()).isEqualTo(1)
-            assertThat(getSparseParcelableArray<Parcelable>("value"))
-                .isEqualTo(mySparseParcelableArray)
-        }
+        SparseParcelableArrayContainer(mySparseParcelableArray)
+            .encodeDecode(
+                checkDecoded = { decoded, original ->
+                    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
+                        decoded.value.contentEquals(original.value)
+                    } else {
+                        error("VERSION.SDK_INT < S")
+                    }
+                },
+                checkEncoded = {
+                    assertThat(size()).isEqualTo(1)
+                    assertThat(getSparseParcelableArray<Parcelable>("value"))
+                        .isEqualTo(mySparseParcelableArray)
+                }
+            )
     }
 
     @Test
     fun collectionTypesWithConcreteElement() {
+        @Suppress("ArrayInDataClass")
         @Serializable
         data class CharSequenceArrayContainer(
-            @Serializable(with = CharSequenceArraySerializer::class) val value: Array<String>
-        ) {
-            override fun equals(other: Any?): Boolean {
-                if (this === other) return true
-                if (javaClass != other?.javaClass) return false
-                other as CharSequenceArrayContainer
-                return value.contentEquals(other.value)
-            }
-
-            override fun hashCode(): Int {
-                return value.contentHashCode()
+            @Suppress("SERIALIZER_TYPE_INCOMPATIBLE")
+            @Serializable(with = CharSequenceArraySerializer::class)
+            val value: Array<@Serializable(with = CharSequenceSerializer::class) StringBuilder>
+        )
+        val myCharSequenceArray = arrayOf<StringBuilder>(StringBuilder("foo"), StringBuilder("bar"))
+        // `Bundle.getCharSequenceArray()` returns a `CharSequence[]` and the actual element type
+        // is not being retained after parcel/unparcel so the plugin-generated serializer will
+        // get `ClassCastException` when trying to cast it back to `Array<StringBuilder>`.
+        assertThrows(ClassCastException::class) {
+            CharSequenceArrayContainer(myCharSequenceArray).encodeDecode {
+                assertThat(size()).isEqualTo(1)
+                assertThat(getCharSequenceArray("value")).isEqualTo(myCharSequenceArray)
             }
         }
-        val myCharSequenceArray = arrayOf("foo", "bar")
-        CharSequenceArrayContainer(myCharSequenceArray).encodeDecode {
-            assertThat(size()).isEqualTo(1)
-            assertThat(getCharSequenceArray("value")).isEqualTo(myCharSequenceArray)
-        }
 
-        @Suppress("SERIALIZER_TYPE_INCOMPATIBLE")
+        @Suppress("ArrayInDataClass")
         @Serializable
         data class ParcelableArrayContainer(
             @Serializable(with = ParcelableArraySerializer::class)
             // Here the serializer for the element is actually not used, but leaving it out leads
             // to SERIALIZER_NOT_FOUND compile error.
-            val value: Array<@Serializable(with = ParcelableSerializer::class) MyParcelable>
-        ) {
-            override fun equals(other: Any?): Boolean {
-                if (this === other) return true
-                if (javaClass != other?.javaClass) return false
-                other as ParcelableArrayContainer
-                return value.contentEquals(other.value)
-            }
-
-            override fun hashCode(): Int {
-                return value.contentHashCode()
-            }
-        }
+            val value:
+                Array<@Serializable(with = MyParcelableAsParcelableSerializer::class) MyParcelable>
+        )
         val myParcelableArray = arrayOf(MyParcelable(3, "foo", 3.14), MyParcelable(4, "bar", 1.73))
-        ParcelableArrayContainer(myParcelableArray).encodeDecode {
-            assertThat(size()).isEqualTo(1)
-            assertThat(getParcelableArray<MyParcelable>("value")).isEqualTo(myParcelableArray)
+        // Even though `Bundle` does retain the actual `Parcelable` type there's no way for us to
+        // specify this `Parcelable` element type for the array, so the restored array is still of
+        // type `Array<Parcelable>` and the plugin-generated serializer will get
+        // `ClassCastException` when trying to cast it back to `Array<MyParcelable>`.
+        assertThrows(ClassCastException::class) {
+            ParcelableArrayContainer(myParcelableArray).encodeDecode {
+                assertThat(size()).isEqualTo(1)
+                assertThat(getParcelableArray<MyParcelable>("value")).isEqualTo(myParcelableArray)
+            }
         }
 
         @Serializable
         data class CharSequenceListContainer(
-            @Serializable(with = CharSequenceListSerializer::class) val value: List<String>
+            @Serializable(with = CharSequenceListSerializer::class)
+            @Suppress("SERIALIZER_TYPE_INCOMPATIBLE")
+            val value: List<@Serializable(with = CharSequenceSerializer::class) StringBuilder>
         )
-        val myCharSequenceList = arrayListOf("foo", "bar")
-        CharSequenceListContainer(myCharSequenceList).encodeDecode {
-            assertThat(size()).isEqualTo(1)
-            assertThat(getCharSequenceList("value")).isEqualTo(myCharSequenceList)
-        }
+        val myCharSequenceList = arrayListOf(StringBuilder("foo"), StringBuilder("bar"))
 
-        @Suppress("SERIALIZER_TYPE_INCOMPATIBLE")
+        CharSequenceListContainer(myCharSequenceList)
+            .encodeDecode(
+                checkDecoded = { decoded, original ->
+                    assertThat(original.value[0]::class).isEqualTo(StringBuilder::class)
+                    // This is similar to the `CharSequenceArray` case where the element type of the
+                    // restored List after parcel/unparcel is of `String` instead of
+                    // `StringBuilder`. However, since the element type of Lists is erased no
+                    // `CastCastException` is thrown when the plugin-generated serializer tried to
+                    // assign the restored list back to `List<StringBuilder>`.
+                    assertThat(decoded.value[0]::class).isEqualTo(String::class)
+                },
+                checkEncoded = {
+                    assertThat(size()).isEqualTo(1)
+                    assertThat(getCharSequenceList("value")).isEqualTo(myCharSequenceList)
+                }
+            )
+
         @Serializable
         data class ParcelableListContainer(
+            // Unlike arrays this works as `List`s can be down-casted, e.g.
+            // a `List<Parcelable>` can be casted to `List<MyParcelable>`.
             @Serializable(with = ParcelableListSerializer::class)
-            val value: List<@Serializable(with = ParcelableSerializer::class) MyParcelable>
+            val value:
+                List<@Serializable(with = MyParcelableAsParcelableSerializer::class) MyParcelable>
         )
         val myParcelableList =
             arrayListOf(MyParcelable(3, "foo", 3.14), MyParcelable(4, "bar", 1.73))
@@ -484,57 +466,37 @@
             assertThat(getParcelableList<MyParcelable>("value")).isEqualTo(myParcelableList)
         }
 
-        @Suppress("SERIALIZER_TYPE_INCOMPATIBLE")
         @Serializable
         data class SparseParcelableArrayContainer(
+            // Unlike arrays this works as `SparseArray`s can be down-casted, e.g.
+            // a `SparseArray<Parcelable>` can be casted to `SparseArray<MyParcelable>`.
             @Serializable(with = SparseParcelableArraySerializer::class)
-            val value: SparseArray<@Serializable(with = ParcelableSerializer::class) MyParcelable>
+            val value:
+                SparseArray<
+                    @Serializable(with = MyParcelableAsParcelableSerializer::class)
+                    MyParcelable
+                >
         )
         val mySparseParcelableArray =
             SparseArray<MyParcelable>().apply {
                 append(1, MyParcelable(3, "foo", 3.14))
                 append(3, MyParcelable(4, "bar", 1.73))
             }
-        SparseParcelableArrayContainer(mySparseParcelableArray).encodeDecode {
-            assertThat(size()).isEqualTo(1)
-            assertThat(getSparseParcelableArray<Parcelable>("value"))
-                .isEqualTo(mySparseParcelableArray)
-        }
-    }
-
-    @Test
-    fun concreteTypeSerializers() {
-        // No need to suppress SERIALIZER_TYPE_INCOMPATIBLE with these serializers.
-        @Serializable
-        data class CharSequenceContainer(
-            @Serializable(with = StringAsCharSequenceSerializer::class) val value: String
-        )
-        CharSequenceContainer("foo").encodeDecode {
-            assertThat(size()).isEqualTo(1)
-            assertThat(getCharSequence("value")).isEqualTo("foo")
-        }
-
-        @Serializable
-        data class SerializableContainer(
-            @Serializable(with = MyJavaSerializableAsJavaSerializableSerializer::class)
-            val value: MyJavaSerializable
-        )
-        val myJavaSerializable = MyJavaSerializable(3, "foo", 3.14)
-        SerializableContainer(myJavaSerializable).encodeDecode {
-            assertThat(size()).isEqualTo(1)
-            assertThat(getJavaSerializable<MyJavaSerializable>("value"))
-                .isEqualTo(myJavaSerializable)
-        }
-
-        @Serializable
-        data class ParcelableContainer(
-            @Serializable(with = MyParcelableAsParcelableSerializer::class) val value: MyParcelable
-        )
-        val myParcelable = MyParcelable(3, "foo", 3.14)
-        ParcelableContainer(myParcelable).encodeDecode {
-            assertThat(size()).isEqualTo(1)
-            assertThat(getParcelable<MyParcelable>("value")).isEqualTo(myParcelable)
-        }
+        SparseParcelableArrayContainer(mySparseParcelableArray)
+            .encodeDecode(
+                checkDecoded = { decoded, original ->
+                    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
+                        assertThat(decoded.value.contentEquals(original.value))
+                    } else {
+                        error("VERSION.SDK_INT < S")
+                    }
+                },
+                checkEncoded = {
+                    assertThat(size()).isEqualTo(1)
+                    assertThat(getSparseParcelableArray<Parcelable>("value"))
+                        .isEqualTo(mySparseParcelableArray)
+                }
+            )
     }
 }
 
@@ -610,45 +572,11 @@
     }
 }
 
-private object CharArrayAsStringSerializer : KSerializer<Array<Char>> {
-    private val delegateSerializer = serializer<String>()
-    override val descriptor: SerialDescriptor =
-        PrimitiveSerialDescriptor("Array<Char>", PrimitiveKind.STRING)
-
-    override fun deserialize(decoder: Decoder): Array<Char> {
-        val s = decoder.decodeSerializableValue(delegateSerializer)
-        val result = Array(s.length) { s[it] }
-        return result
-    }
-
-    override fun serialize(encoder: Encoder, value: Array<Char>) {
-        val charArray = CharArray(value.size)
-        value.forEachIndexed { index, c -> charArray[index] = c }
-        encoder.encodeSerializableValue(delegateSerializer, String(charArray))
-    }
-}
-
-@OptIn(ExperimentalSerializationApi::class)
-private object SparseStringArrayAsMapSerializer : KSerializer<SparseArray<String>> {
-    private val delegateSerializer = serializer<Map<Int, String>>()
-    override val descriptor = SerialDescriptor("SparseArray<String>", delegateSerializer.descriptor)
-
-    override fun deserialize(decoder: Decoder): SparseArray<String> {
-        val m = decoder.decodeSerializableValue(delegateSerializer)
-        val result = SparseArray<String>()
-        m.forEach { (k, v) -> result.append(k, v) }
-        return result
-    }
-
-    override fun serialize(encoder: Encoder, value: SparseArray<String>) {
-        val map = buildMap { value.forEach { k, v -> put(k, v) } }
-        encoder.encodeSerializableValue(delegateSerializer, map)
-    }
-}
-
-private class StringAsCharSequenceSerializer : CharSequenceSerializer<String>()
-
 private class MyJavaSerializableAsJavaSerializableSerializer :
     JavaSerializableSerializer<MyJavaSerializable>()
 
 private class MyParcelableAsParcelableSerializer : ParcelableSerializer<MyParcelable>()
+
+private class CustomJavaSerializableSerializer : JavaSerializableSerializer<java.io.Serializable>()
+
+private class CustomParcelableSerializer : ParcelableSerializer<Parcelable>()
diff --git a/savedstate/savedstate/src/androidUnitTest/kotlin/androidx/savedstate/SavedStateCodecTestUtils.android.kt b/savedstate/savedstate/src/androidUnitTest/kotlin/androidx/savedstate/SavedStateCodecTestUtils.android.kt
new file mode 100644
index 0000000..edf79cc
--- /dev/null
+++ b/savedstate/savedstate/src/androidUnitTest/kotlin/androidx/savedstate/SavedStateCodecTestUtils.android.kt
@@ -0,0 +1,28 @@
+/*
+ * Copyright 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 androidx.savedstate
+
+import android.os.Parcel
+
+actual fun platformEncodeDecode(savedState: SavedState): SavedState {
+    val parcel =
+        Parcel.obtain().apply {
+            savedState.writeToParcel(this, 0)
+            setDataPosition(0)
+        }
+    return SavedState.CREATOR.createFromParcel(parcel)
+}
diff --git a/savedstate/savedstate/src/commonMain/kotlin/androidx/savedstate/serialization/SavedStateDecoder.kt b/savedstate/savedstate/src/commonMain/kotlin/androidx/savedstate/serialization/SavedStateDecoder.kt
index 65ccd1f..3f06dff 100644
--- a/savedstate/savedstate/src/commonMain/kotlin/androidx/savedstate/serialization/SavedStateDecoder.kt
+++ b/savedstate/savedstate/src/commonMain/kotlin/androidx/savedstate/serialization/SavedStateDecoder.kt
@@ -22,6 +22,7 @@
 import kotlinx.serialization.ExperimentalSerializationApi
 import kotlinx.serialization.SerializationException
 import kotlinx.serialization.descriptors.SerialDescriptor
+import kotlinx.serialization.descriptors.StructureKind
 import kotlinx.serialization.encoding.AbstractDecoder
 import kotlinx.serialization.encoding.CompositeDecoder
 import kotlinx.serialization.modules.EmptySerializersModule
@@ -73,9 +74,31 @@
     private var index = 0
 
     override fun decodeElementIndex(descriptor: SerialDescriptor): Int {
-        if (index == savedState.read { size() }) return CompositeDecoder.DECODE_DONE
-        key = descriptor.getElementName(index)
-        return index++
+        val size =
+            if (descriptor.kind == StructureKind.LIST || descriptor.kind == StructureKind.MAP) {
+                // Use the number of elements encoded for collections.
+                savedState.read { size() }
+            } else {
+                // We may skip elements when encoding so if we used `size()`
+                // here we may miss some fields.
+                descriptor.elementsCount
+            }
+        fun hasDefaultValueDefined(index: Int) = descriptor.isElementOptional(index)
+        fun presentInEncoding(index: Int) =
+            savedState.read {
+                val key = descriptor.getElementName(index)
+                contains(key)
+            }
+        // Skip elements omitted from encoding (those assigned with its default values).
+        while (index < size && hasDefaultValueDefined(index) && !presentInEncoding(index)) {
+            index++
+        }
+        if (index < size) {
+            key = descriptor.getElementName(index)
+            return index++
+        } else {
+            return CompositeDecoder.DECODE_DONE
+        }
     }
 
     override fun decodeBoolean(): Boolean = savedState.read { getBoolean(key) }
diff --git a/savedstate/savedstate/src/commonTest/kotlin/androidx/savedstate/SavedStateCodecTest.kt b/savedstate/savedstate/src/commonTest/kotlin/androidx/savedstate/SavedStateCodecTest.kt
index 86adf0b..88c33e4 100644
--- a/savedstate/savedstate/src/commonTest/kotlin/androidx/savedstate/SavedStateCodecTest.kt
+++ b/savedstate/savedstate/src/commonTest/kotlin/androidx/savedstate/SavedStateCodecTest.kt
@@ -401,15 +401,19 @@
 
     @Test
     fun sealedClasses() {
-        Node.Add(Node.Operand(3), Node.Operand(5)).encodeDecode {
+        // Should use base type for encoding/decoding.
+        Node.Add(Node.Operand(3), Node.Operand(5)).encodeDecode<Node> {
             assertThat(size()).isEqualTo(2)
-            getSavedState("lhs").read {
-                assertThat(size()).isEqualTo(1)
-                assertThat(getInt("value")).isEqualTo(3)
-            }
-            getSavedState("rhs").read {
-                assertThat(size()).isEqualTo(1)
-                assertThat(getInt("value")).isEqualTo(5)
+            assertThat(getString("type")).isEqualTo("androidx.savedstate.Node.Add")
+            getSavedState("value").read {
+                getSavedState("lhs").read {
+                    assertThat(size()).isEqualTo(1)
+                    assertThat(getInt("value")).isEqualTo(3)
+                }
+                getSavedState("rhs").read {
+                    assertThat(size()).isEqualTo(1)
+                    assertThat(getInt("value")).isEqualTo(5)
+                }
             }
         }
     }
@@ -425,12 +429,24 @@
         }
 
         // Nullable with default value.
-        @Serializable data class B(val s: String? = "foo")
-        B().encodeDecode()
-        B(s = "bar").encodeDecode {
+        @Serializable data class B(val s: String? = "foo", val i: Int)
+        B(i = 3).encodeDecode {
             assertThat(size()).isEqualTo(1)
+            assertThat(getInt("i")).isEqualTo(3)
+        }
+        B(s = null, i = 3).encodeDecode {
+            assertThat(size()).isEqualTo(2)
+            assertThat(isNull("s")).isTrue()
+        }
+        B(s = "bar", i = 3).encodeDecode {
+            assertThat(size()).isEqualTo(2)
             assertThat(getString("s")).isEqualTo("bar")
         }
+        // The value of `s` is the same as its default value so it's omitted from encoding.
+        B(s = "foo", i = 3).encodeDecode {
+            assertThat(size()).isEqualTo(1)
+            assertThat(getInt("i")).isEqualTo(3)
+        }
 
         // Nullable without default value
         @Serializable data class C(val s: String?)
@@ -450,6 +466,22 @@
             assertThat(getInt("i")).isEqualTo(5)
             assertThat(getString("s")).isEqualTo("foo")
         }
+
+        // Nullable with null as default value.
+        @Serializable data class E(val s: String? = null)
+        // Even though we encode `null`s in general as we don't encode default values
+        // nothing is encoded.
+        E().encodeDecode()
+
+        // Nullable in parent
+        G(i = 3).encodeDecode<F> {
+            assertThat(size()).isEqualTo(2)
+            assertThat(getString("type")).isEqualTo("androidx.savedstate.G")
+            getSavedState("value").read {
+                assertThat(size()).isEqualTo(1)
+                assertThat(getInt("i")).isEqualTo(3)
+            }
+        }
     }
 
     @Test
@@ -464,19 +496,24 @@
                     putSavedState("ss", savedState { putString("s", "bar") })
                 }
             )
-            .encodeDecode {
-                assertThat(size()).isEqualTo(1)
-                getSavedState("s").read {
-                    assertThat(size()).isEqualTo(4)
-                    assertThat(getInt("i")).isEqualTo(1)
-                    assertThat(getString("s")).isEqualTo("foo")
-                    assertThat(getIntArray("a")).isEqualTo(intArrayOf(1, 3, 5))
-                    getSavedState("ss").read {
-                        assertThat(size()).isEqualTo(1)
-                        assertThat(getString("s")).isEqualTo("bar")
+            .encodeDecode(
+                checkDecoded = { decoded, original ->
+                    assertThat(decoded.s.read { contentDeepEquals(original.s) })
+                },
+                checkEncoded = {
+                    assertThat(size()).isEqualTo(1)
+                    getSavedState("s").read {
+                        assertThat(size()).isEqualTo(4)
+                        assertThat(getInt("i")).isEqualTo(1)
+                        assertThat(getString("s")).isEqualTo("foo")
+                        assertThat(getIntArray("a")).isEqualTo(intArrayOf(1, 3, 5))
+                        getSavedState("ss").read {
+                            assertThat(size()).isEqualTo(1)
+                            assertThat(getString("s")).isEqualTo("bar")
+                        }
                     }
                 }
-            }
+            )
 
         val origin = savedState {
             putInt("i", 1)
@@ -563,6 +600,7 @@
 
 private typealias MyNestedTypeAlias = MyTypeAliasToInt
 
+@Serializable
 private sealed class Node {
     @Serializable data class Add(val lhs: Operand, val rhs: Operand) : Node()
 
@@ -605,3 +643,10 @@
         return MyColor(array[0], array[1], array[2])
     }
 }
+
+@Serializable
+private sealed class F {
+    val s: String? = null
+}
+
+@Serializable private data class G(val i: Int) : F()
diff --git a/savedstate/savedstate/src/commonTest/kotlin/androidx/savedstate/SavedStateCodecTestUtils.kt b/savedstate/savedstate/src/commonTest/kotlin/androidx/savedstate/SavedStateCodecTestUtils.kt
index e9ac161..67930cd 100644
--- a/savedstate/savedstate/src/commonTest/kotlin/androidx/savedstate/SavedStateCodecTestUtils.kt
+++ b/savedstate/savedstate/src/commonTest/kotlin/androidx/savedstate/SavedStateCodecTestUtils.kt
@@ -23,16 +23,30 @@
 import kotlinx.serialization.serializer
 
 internal object SavedStateCodecTestUtils {
+    /* Test the following steps: 1. encode `T` to a `SavedState`, 2. parcelize it to a `Parcel`,
+     * 3. un-parcelize it back to a `SavedState`, and 4. decode it back to a `T`. Step 2 and 3
+     * are only performed on Android. Here's the whole process:
+     *
+     * (A)Serializable -1-> (B)SavedState -2-> (C)Parcel -3-> (D)SavedState -4-> (E)Serializable
+     *
+     * `checkEncoded` can be used to check the content of "B", and `checkDecoded` can be
+     *  used to compare the instances of "E" and "A".
+     */
     inline fun <reified T : Any> T.encodeDecode(
         serializer: KSerializer<T> = serializer<T>(),
-        checkContent: SavedStateReader.() -> Unit = { assertThat(size()).isEqualTo(0) }
+        checkDecoded: (T, T) -> Unit = { decoded, original ->
+            assertThat(decoded).isEqualTo(original)
+        },
+        checkEncoded: SavedStateReader.() -> Unit = { assertThat(size()).isEqualTo(0) }
     ) {
-        assertThat(
-                decodeFromSavedState(
-                    serializer,
-                    encodeToSavedState(serializer, this).apply { read { checkContent() } }
-                )
-            )
-            .isEqualTo(this)
+        val encoded = encodeToSavedState(serializer, this)
+        encoded.read { checkEncoded() }
+
+        val restored = platformEncodeDecode(encoded)
+
+        val decoded = decodeFromSavedState(serializer, restored)
+        checkDecoded(decoded, this)
     }
 }
+
+expect fun platformEncodeDecode(savedState: SavedState): SavedState
diff --git a/savedstate/savedstate/src/nonAndroidTest/kotlin/androidx/savedstate/SavedStateCodecTestUtils.nonAndroid.kt b/savedstate/savedstate/src/nonAndroidTest/kotlin/androidx/savedstate/SavedStateCodecTestUtils.nonAndroid.kt
new file mode 100644
index 0000000..023701a8
--- /dev/null
+++ b/savedstate/savedstate/src/nonAndroidTest/kotlin/androidx/savedstate/SavedStateCodecTestUtils.nonAndroid.kt
@@ -0,0 +1,20 @@
+/*
+ * Copyright 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 androidx.savedstate
+
+// No parceling in non-Android platforms.
+actual fun platformEncodeDecode(savedState: SavedState): SavedState = savedState
diff --git a/test/uiautomator/uiautomator/api/current.txt b/test/uiautomator/uiautomator/api/current.txt
index 718c737..6b48582 100644
--- a/test/uiautomator/uiautomator/api/current.txt
+++ b/test/uiautomator/uiautomator/api/current.txt
@@ -99,6 +99,7 @@
 
   public final class Configurator {
     method public long getActionAcknowledgmentTimeout();
+    method public int getDefaultDisplayId();
     method public static androidx.test.uiautomator.Configurator getInstance();
     method @Deprecated public long getKeyInjectionDelay();
     method public long getScrollAcknowledgmentTimeout();
@@ -106,7 +107,9 @@
     method public int getUiAutomationFlags();
     method public long getWaitForIdleTimeout();
     method public long getWaitForSelectorTimeout();
+    method public androidx.test.uiautomator.Configurator resetDefaultDisplayId();
     method public androidx.test.uiautomator.Configurator setActionAcknowledgmentTimeout(long);
+    method public androidx.test.uiautomator.Configurator setDefaultDisplayId(int);
     method @Deprecated public androidx.test.uiautomator.Configurator setKeyInjectionDelay(long);
     method public androidx.test.uiautomator.Configurator setScrollAcknowledgmentTimeout(long);
     method public androidx.test.uiautomator.Configurator setToolType(int);
diff --git a/test/uiautomator/uiautomator/api/restricted_current.txt b/test/uiautomator/uiautomator/api/restricted_current.txt
index 718c737..6b48582 100644
--- a/test/uiautomator/uiautomator/api/restricted_current.txt
+++ b/test/uiautomator/uiautomator/api/restricted_current.txt
@@ -99,6 +99,7 @@
 
   public final class Configurator {
     method public long getActionAcknowledgmentTimeout();
+    method public int getDefaultDisplayId();
     method public static androidx.test.uiautomator.Configurator getInstance();
     method @Deprecated public long getKeyInjectionDelay();
     method public long getScrollAcknowledgmentTimeout();
@@ -106,7 +107,9 @@
     method public int getUiAutomationFlags();
     method public long getWaitForIdleTimeout();
     method public long getWaitForSelectorTimeout();
+    method public androidx.test.uiautomator.Configurator resetDefaultDisplayId();
     method public androidx.test.uiautomator.Configurator setActionAcknowledgmentTimeout(long);
+    method public androidx.test.uiautomator.Configurator setDefaultDisplayId(int);
     method @Deprecated public androidx.test.uiautomator.Configurator setKeyInjectionDelay(long);
     method public androidx.test.uiautomator.Configurator setScrollAcknowledgmentTimeout(long);
     method public androidx.test.uiautomator.Configurator setToolType(int);
diff --git a/test/uiautomator/uiautomator/src/main/java/androidx/test/uiautomator/BySelector.java b/test/uiautomator/uiautomator/src/main/java/androidx/test/uiautomator/BySelector.java
index 04055d4..9fa089f 100644
--- a/test/uiautomator/uiautomator/src/main/java/androidx/test/uiautomator/BySelector.java
+++ b/test/uiautomator/uiautomator/src/main/java/androidx/test/uiautomator/BySelector.java
@@ -16,6 +16,8 @@
 
 package androidx.test.uiautomator;
 
+import static android.view.Display.INVALID_DISPLAY;
+
 import static java.util.Objects.requireNonNull;
 
 import androidx.annotation.IntRange;
@@ -69,7 +71,10 @@
 
 
     /** Clients should not instanciate this class directly. Use the {@link By} factory class instead. */
-    BySelector() { }
+    BySelector() {
+        final int defaultDisplayId = Configurator.getInstance().getDefaultDisplayId();
+        mDisplayId = defaultDisplayId == INVALID_DISPLAY ? null : defaultDisplayId;
+    }
 
     /**
      * Constructs a new {@link BySelector} and copies the criteria from {@code original}.
diff --git a/test/uiautomator/uiautomator/src/main/java/androidx/test/uiautomator/Configurator.java b/test/uiautomator/uiautomator/src/main/java/androidx/test/uiautomator/Configurator.java
index c8fd7e9..a2e2aec 100644
--- a/test/uiautomator/uiautomator/src/main/java/androidx/test/uiautomator/Configurator.java
+++ b/test/uiautomator/uiautomator/src/main/java/androidx/test/uiautomator/Configurator.java
@@ -16,6 +16,8 @@
 
 package androidx.test.uiautomator;
 
+import static android.view.Display.INVALID_DISPLAY;
+
 import android.view.MotionEvent;
 
 import org.jspecify.annotations.NonNull;
@@ -48,6 +50,9 @@
     static final int DEFAULT_UIAUTOMATION_FLAGS = 0;
     private int mUiAutomationFlags = DEFAULT_UIAUTOMATION_FLAGS;
 
+    // Default display ID when obtaining a BySelector instance
+    private int mDefaultDisplayId = INVALID_DISPLAY;
+
     // Singleton instance.
     private static Configurator sConfigurator;
 
@@ -242,4 +247,39 @@
     public int getUiAutomationFlags() {
         return mUiAutomationFlags;
     }
+
+    /**
+     * Sets the default display ID to use when obtaining a
+     * {@link androidx.test.uiautomator.BySelector} instance. To avoid interfering with other tests,
+     * the caller must call {@link #resetDefaultDisplayId} when the test is finished.
+     *
+     * @param defaultDisplayId the default display ID to use
+     * @return self
+     */
+    public @NonNull Configurator setDefaultDisplayId(int defaultDisplayId) {
+        mDefaultDisplayId = defaultDisplayId;
+        return this;
+    }
+
+    /**
+     * Resets the default display ID to use when obtaining a
+     * {@link androidx.test.uiautomator.BySelector} instance.
+     *
+     * @return self
+     */
+    public @NonNull Configurator resetDefaultDisplayId() {
+        mDefaultDisplayId = INVALID_DISPLAY;
+        return this;
+    }
+
+    /**
+     * Gets the default display ID to use when obtaining a
+     * {@link androidx.test.uiautomator.BySelector} instance, or returns
+     * {@link android.view.Display#INVALID_DISPLAY} if the default display ID is not set yet.
+     *
+     * @return the default display ID
+     */
+    public int getDefaultDisplayId() {
+        return mDefaultDisplayId;
+    }
 }
diff --git a/wear/compose/compose-material3/api/current.txt b/wear/compose/compose-material3/api/current.txt
index 4e9ba65..df002aa 100644
--- a/wear/compose/compose-material3/api/current.txt
+++ b/wear/compose/compose-material3/api/current.txt
@@ -166,9 +166,10 @@
     method @androidx.compose.runtime.Composable public static void ButtonGroup(optional androidx.compose.ui.Modifier modifier, optional float spacing, optional float expansionWidth, optional androidx.compose.foundation.layout.PaddingValues contentPadding, optional androidx.compose.ui.Alignment.Vertical verticalAlignment, kotlin.jvm.functions.Function1<? super androidx.wear.compose.material3.ButtonGroupScope,kotlin.Unit> content);
   }
 
-  public final class ButtonGroupScope {
-    ctor public ButtonGroupScope();
-    method public boolean buttonGroupItem(androidx.compose.foundation.interaction.InteractionSource interactionSource, optional float minWidth, optional float weight, kotlin.jvm.functions.Function0<kotlin.Unit> content);
+  public interface ButtonGroupScope {
+    method public androidx.compose.ui.Modifier enlargeOnPress(androidx.compose.ui.Modifier, androidx.compose.foundation.interaction.MutableInteractionSource interactionSource);
+    method public androidx.compose.ui.Modifier minWidth(androidx.compose.ui.Modifier, optional float minWidth);
+    method public androidx.compose.ui.Modifier weight(androidx.compose.ui.Modifier, @FloatRange(from=0.0, fromInclusive=false) float weight);
   }
 
   public final class ButtonKt {
@@ -477,7 +478,7 @@
   }
 
   public final class DatePickerKt {
-    method @androidx.compose.runtime.Composable public static void DatePicker(java.time.LocalDate initialDate, kotlin.jvm.functions.Function1<? super java.time.LocalDate,kotlin.Unit> onDatePicked, optional androidx.compose.ui.Modifier modifier, optional java.time.LocalDate? minValidDate, optional java.time.LocalDate? maxValidDate, optional int datePickerType, optional androidx.wear.compose.material3.DatePickerColors colors);
+    method @RequiresApi(android.os.Build.VERSION_CODES.O) @androidx.compose.runtime.Composable public static void DatePicker(java.time.LocalDate initialDate, kotlin.jvm.functions.Function1<? super java.time.LocalDate,kotlin.Unit> onDatePicked, optional androidx.compose.ui.Modifier modifier, optional java.time.LocalDate? minValidDate, optional java.time.LocalDate? maxValidDate, optional int datePickerType, optional androidx.wear.compose.material3.DatePickerColors colors);
   }
 
   @androidx.compose.runtime.Immutable @kotlin.jvm.JvmInline public final value class DatePickerType {
@@ -1626,7 +1627,7 @@
   }
 
   public final class TimePickerKt {
-    method @androidx.compose.runtime.Composable public static void TimePicker(java.time.LocalTime initialTime, kotlin.jvm.functions.Function1<? super java.time.LocalTime,kotlin.Unit> onTimePicked, optional androidx.compose.ui.Modifier modifier, optional int timePickerType, optional androidx.wear.compose.material3.TimePickerColors colors);
+    method @RequiresApi(android.os.Build.VERSION_CODES.O) @androidx.compose.runtime.Composable public static void TimePicker(java.time.LocalTime initialTime, kotlin.jvm.functions.Function1<? super java.time.LocalTime,kotlin.Unit> onTimePicked, optional androidx.compose.ui.Modifier modifier, optional int timePickerType, optional androidx.wear.compose.material3.TimePickerColors colors);
   }
 
   @androidx.compose.runtime.Immutable @kotlin.jvm.JvmInline public final value class TimePickerType {
diff --git a/wear/compose/compose-material3/api/restricted_current.txt b/wear/compose/compose-material3/api/restricted_current.txt
index 4e9ba65..df002aa 100644
--- a/wear/compose/compose-material3/api/restricted_current.txt
+++ b/wear/compose/compose-material3/api/restricted_current.txt
@@ -166,9 +166,10 @@
     method @androidx.compose.runtime.Composable public static void ButtonGroup(optional androidx.compose.ui.Modifier modifier, optional float spacing, optional float expansionWidth, optional androidx.compose.foundation.layout.PaddingValues contentPadding, optional androidx.compose.ui.Alignment.Vertical verticalAlignment, kotlin.jvm.functions.Function1<? super androidx.wear.compose.material3.ButtonGroupScope,kotlin.Unit> content);
   }
 
-  public final class ButtonGroupScope {
-    ctor public ButtonGroupScope();
-    method public boolean buttonGroupItem(androidx.compose.foundation.interaction.InteractionSource interactionSource, optional float minWidth, optional float weight, kotlin.jvm.functions.Function0<kotlin.Unit> content);
+  public interface ButtonGroupScope {
+    method public androidx.compose.ui.Modifier enlargeOnPress(androidx.compose.ui.Modifier, androidx.compose.foundation.interaction.MutableInteractionSource interactionSource);
+    method public androidx.compose.ui.Modifier minWidth(androidx.compose.ui.Modifier, optional float minWidth);
+    method public androidx.compose.ui.Modifier weight(androidx.compose.ui.Modifier, @FloatRange(from=0.0, fromInclusive=false) float weight);
   }
 
   public final class ButtonKt {
@@ -477,7 +478,7 @@
   }
 
   public final class DatePickerKt {
-    method @androidx.compose.runtime.Composable public static void DatePicker(java.time.LocalDate initialDate, kotlin.jvm.functions.Function1<? super java.time.LocalDate,kotlin.Unit> onDatePicked, optional androidx.compose.ui.Modifier modifier, optional java.time.LocalDate? minValidDate, optional java.time.LocalDate? maxValidDate, optional int datePickerType, optional androidx.wear.compose.material3.DatePickerColors colors);
+    method @RequiresApi(android.os.Build.VERSION_CODES.O) @androidx.compose.runtime.Composable public static void DatePicker(java.time.LocalDate initialDate, kotlin.jvm.functions.Function1<? super java.time.LocalDate,kotlin.Unit> onDatePicked, optional androidx.compose.ui.Modifier modifier, optional java.time.LocalDate? minValidDate, optional java.time.LocalDate? maxValidDate, optional int datePickerType, optional androidx.wear.compose.material3.DatePickerColors colors);
   }
 
   @androidx.compose.runtime.Immutable @kotlin.jvm.JvmInline public final value class DatePickerType {
@@ -1626,7 +1627,7 @@
   }
 
   public final class TimePickerKt {
-    method @androidx.compose.runtime.Composable public static void TimePicker(java.time.LocalTime initialTime, kotlin.jvm.functions.Function1<? super java.time.LocalTime,kotlin.Unit> onTimePicked, optional androidx.compose.ui.Modifier modifier, optional int timePickerType, optional androidx.wear.compose.material3.TimePickerColors colors);
+    method @RequiresApi(android.os.Build.VERSION_CODES.O) @androidx.compose.runtime.Composable public static void TimePicker(java.time.LocalTime initialTime, kotlin.jvm.functions.Function1<? super java.time.LocalTime,kotlin.Unit> onTimePicked, optional androidx.compose.ui.Modifier modifier, optional int timePickerType, optional androidx.wear.compose.material3.TimePickerColors colors);
   }
 
   @androidx.compose.runtime.Immutable @kotlin.jvm.JvmInline public final value class TimePickerType {
diff --git a/wear/compose/compose-material3/benchmark/build.gradle b/wear/compose/compose-material3/benchmark/build.gradle
index 9a1b2f5..836aa4e 100644
--- a/wear/compose/compose-material3/benchmark/build.gradle
+++ b/wear/compose/compose-material3/benchmark/build.gradle
@@ -35,7 +35,7 @@
     compileSdk = 35
 
     defaultConfig {
-        minSdk = 30
+        minSdk = 25
     }
     buildTypes.configureEach {
         consumerProguardFiles "benchmark-proguard-rules.pro"
diff --git a/wear/compose/compose-material3/benchmark/src/androidTest/java/androidx/wear/compose/material3/benchmark/ScrollIndicatorBenchmark.kt b/wear/compose/compose-material3/benchmark/src/androidTest/java/androidx/wear/compose/material3/benchmark/ScrollIndicatorBenchmark.kt
new file mode 100644
index 0000000..de0e838
--- /dev/null
+++ b/wear/compose/compose-material3/benchmark/src/androidTest/java/androidx/wear/compose/material3/benchmark/ScrollIndicatorBenchmark.kt
@@ -0,0 +1,92 @@
+/*
+ * Copyright 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 androidx.wear.compose.material3.benchmark
+
+import androidx.compose.foundation.rememberScrollState
+import androidx.compose.runtime.Composable
+import androidx.compose.testutils.LayeredComposeTestCase
+import androidx.compose.testutils.benchmark.ComposeBenchmarkRule
+import androidx.compose.testutils.benchmark.benchmarkDrawPerf
+import androidx.compose.testutils.benchmark.benchmarkFirstCompose
+import androidx.compose.testutils.benchmark.benchmarkFirstDraw
+import androidx.compose.testutils.benchmark.benchmarkFirstLayout
+import androidx.compose.testutils.benchmark.benchmarkFirstMeasure
+import androidx.compose.testutils.benchmark.benchmarkLayoutPerf
+import androidx.compose.testutils.benchmark.benchmarkToFirstPixel
+import androidx.test.ext.junit.runners.AndroidJUnit4
+import androidx.test.filters.MediumTest
+import androidx.wear.compose.material3.MaterialTheme
+import androidx.wear.compose.material3.ScrollIndicator
+import org.junit.Rule
+import org.junit.Test
+import org.junit.runner.RunWith
+
+@MediumTest
+@RunWith(AndroidJUnit4::class)
+class ScrollIndicatorBenchmark {
+
+    @get:Rule val benchmarkRule = ComposeBenchmarkRule()
+
+    private val testCaseFactory = { ScrollIndicatorTestCase() }
+
+    @Test
+    fun first_pixel() {
+        benchmarkRule.benchmarkToFirstPixel(testCaseFactory)
+    }
+
+    @Test
+    fun first_compose() {
+        benchmarkRule.benchmarkFirstCompose(testCaseFactory)
+    }
+
+    @Test
+    fun first_measure() {
+        benchmarkRule.benchmarkFirstMeasure(testCaseFactory)
+    }
+
+    @Test
+    fun first_layout() {
+        benchmarkRule.benchmarkFirstLayout(testCaseFactory)
+    }
+
+    @Test
+    fun first_draw() {
+        benchmarkRule.benchmarkFirstDraw(testCaseFactory)
+    }
+
+    @Test
+    fun layout() {
+        benchmarkRule.benchmarkLayoutPerf(testCaseFactory)
+    }
+
+    @Test
+    fun draw() {
+        benchmarkRule.benchmarkDrawPerf(testCaseFactory)
+    }
+}
+
+internal class ScrollIndicatorTestCase : LayeredComposeTestCase() {
+    @Composable
+    override fun MeasuredContent() {
+        ScrollIndicator(state = rememberScrollState())
+    }
+
+    @Composable
+    override fun ContentWrappers(content: @Composable () -> Unit) {
+        MaterialTheme { content() }
+    }
+}
diff --git a/wear/compose/compose-material3/build.gradle b/wear/compose/compose-material3/build.gradle
index df4dcfa..f0c49b7 100644
--- a/wear/compose/compose-material3/build.gradle
+++ b/wear/compose/compose-material3/build.gradle
@@ -72,7 +72,7 @@
     compileSdk = 35
 
     defaultConfig {
-        minSdk = 30
+        minSdk = 25
     }
     // Use Robolectric 4.+
     testOptions.unitTests.includeAndroidResources = true
diff --git a/wear/compose/compose-material3/integration-tests/build.gradle b/wear/compose/compose-material3/integration-tests/build.gradle
index 85e2742..956afb7 100644
--- a/wear/compose/compose-material3/integration-tests/build.gradle
+++ b/wear/compose/compose-material3/integration-tests/build.gradle
@@ -55,7 +55,7 @@
 android {
     compileSdk = 35
     defaultConfig {
-        minSdk = 30
+        minSdk = 25
     }
     namespace = "androidx.wear.compose.material3.demos"
 }
diff --git a/wear/compose/compose-material3/integration-tests/src/main/java/androidx/wear/compose/material3/demos/ButtonGroupDemo.kt b/wear/compose/compose-material3/integration-tests/src/main/java/androidx/wear/compose/material3/demos/ButtonGroupDemo.kt
index a12ca7e..76c8ba5 100644
--- a/wear/compose/compose-material3/integration-tests/src/main/java/androidx/wear/compose/material3/demos/ButtonGroupDemo.kt
+++ b/wear/compose/compose-material3/integration-tests/src/main/java/androidx/wear/compose/material3/demos/ButtonGroupDemo.kt
@@ -18,33 +18,161 @@
 
 import androidx.compose.foundation.interaction.MutableInteractionSource
 import androidx.compose.foundation.layout.Box
+import androidx.compose.foundation.layout.Column
+import androidx.compose.foundation.layout.Spacer
 import androidx.compose.foundation.layout.fillMaxSize
 import androidx.compose.foundation.layout.fillMaxWidth
+import androidx.compose.foundation.layout.height
 import androidx.compose.foundation.layout.size
+import androidx.compose.material.icons.Icons
+import androidx.compose.material.icons.filled.Favorite
 import androidx.compose.runtime.Composable
+import androidx.compose.runtime.getValue
+import androidx.compose.runtime.mutableStateOf
 import androidx.compose.runtime.remember
+import androidx.compose.runtime.setValue
 import androidx.compose.ui.Alignment
 import androidx.compose.ui.Modifier
+import androidx.compose.ui.text.style.TextAlign
 import androidx.compose.ui.unit.dp
 import androidx.wear.compose.material3.Button
 import androidx.wear.compose.material3.ButtonGroup
+import androidx.wear.compose.material3.ButtonGroupScope
+import androidx.wear.compose.material3.FilledIconButton
+import androidx.wear.compose.material3.Icon
+import androidx.wear.compose.material3.IconToggleButton
+import androidx.wear.compose.material3.IconToggleButtonDefaults
+import androidx.wear.compose.material3.IconToggleButtonShapes
 import androidx.wear.compose.material3.Text
+import androidx.wear.compose.material3.TextToggleButton
+import androidx.wear.compose.material3.TextToggleButtonDefaults
+import androidx.wear.compose.material3.TextToggleButtonShapes
+import androidx.wear.compose.material3.samples.icons.WifiOffIcon
+import androidx.wear.compose.material3.samples.icons.WifiOnIcon
 
 @Composable
 fun ButtonGroupDemo() {
-    val interactionSources = remember { Array(3) { MutableInteractionSource() } }
-
+    val interactionSource1 = remember { MutableInteractionSource() }
+    val interactionSource2 = remember { MutableInteractionSource() }
+    val interactionSource3 = remember { MutableInteractionSource() }
     Box(Modifier.size(300.dp), contentAlignment = Alignment.Center) {
         ButtonGroup(Modifier.fillMaxWidth()) {
-            repeat(3) { index ->
-                buttonGroupItem(interactionSource = interactionSources[index]) {
-                    Button(onClick = {}, interactionSource = interactionSources[index]) {
-                        Box(Modifier.fillMaxSize(), contentAlignment = Alignment.Center) {
-                            Text(listOf("A", "B", "C")[index])
-                        }
+            Button(
+                onClick = {},
+                Modifier.enlargeOnPress(interactionSource1),
+                interactionSource = interactionSource1
+            ) {
+                Text("<", modifier = Modifier.fillMaxWidth(), textAlign = TextAlign.Center)
+            }
+            FilledIconButton(
+                onClick = {},
+                Modifier.enlargeOnPress(interactionSource2),
+                interactionSource = interactionSource2
+            ) {
+                Box(Modifier.fillMaxSize(), contentAlignment = Alignment.Center) {
+                    Icon(
+                        imageVector = Icons.Filled.Favorite,
+                        contentDescription = "Favorite icon",
+                        modifier = Modifier.size(32.dp)
+                    )
+                }
+            }
+            Button(
+                onClick = {},
+                Modifier.enlargeOnPress(interactionSource3),
+                interactionSource = interactionSource3
+            ) {
+                Text(">", modifier = Modifier.fillMaxWidth(), textAlign = TextAlign.Center)
+            }
+        }
+    }
+}
+
+@Composable
+fun ButtonGroupToggleButtonsDemo() {
+    val iconSize = 32.dp
+    Box(Modifier.size(300.dp), contentAlignment = Alignment.Center) {
+        Column {
+            ButtonGroup(Modifier.fillMaxWidth()) {
+                MyIconToggleButton(IconToggleButtonDefaults.shapes(), Modifier.weight(1.2f)) {
+                    Icon(
+                        imageVector = Icons.Filled.Favorite,
+                        contentDescription = "Favorite icon",
+                        modifier = Modifier.size(iconSize)
+                    )
+                }
+                MyIconToggleButton(IconToggleButtonDefaults.animatedShapes()) { checked ->
+                    if (checked) {
+                        WifiOnIcon(Modifier.size(iconSize))
+                    } else {
+                        WifiOffIcon(Modifier.size(iconSize))
                     }
                 }
             }
+            Spacer(Modifier.height(8.dp))
+            ButtonGroup(Modifier.fillMaxWidth()) {
+                MyTextToggleButton(TextToggleButtonDefaults.shapes()) { checked ->
+                    Text(
+                        text = if (checked) "On" else "Off",
+                        style = TextToggleButtonDefaults.defaultButtonTextStyle
+                    )
+                }
+                MyTextToggleButton(
+                    TextToggleButtonDefaults.animatedShapes(),
+                    Modifier.weight(1.2f)
+                ) { checked ->
+                    Text(
+                        text = if (checked) "On" else "Off",
+                        style = TextToggleButtonDefaults.defaultButtonTextStyle
+                    )
+                }
+            }
         }
     }
 }
+
+@Composable
+private fun ButtonGroupScope.MyIconToggleButton(
+    shapes: IconToggleButtonShapes,
+    modifier: Modifier = Modifier,
+    content: @Composable (Boolean) -> Unit
+) {
+    val interactionSource = remember { MutableInteractionSource() }
+    var checked by remember { mutableStateOf(false) }
+    IconToggleButton(
+        checked = checked,
+        modifier =
+            modifier
+                .height(IconToggleButtonDefaults.SmallButtonSize)
+                .fillMaxWidth()
+                .enlargeOnPress(interactionSource),
+        onCheckedChange = { checked = !checked },
+        shapes = shapes,
+        interactionSource = interactionSource
+    ) {
+        content(checked)
+    }
+}
+
+@Composable
+private fun ButtonGroupScope.MyTextToggleButton(
+    shapes: TextToggleButtonShapes,
+    modifier: Modifier = Modifier,
+    content: @Composable (Boolean) -> Unit
+) {
+    val interactionSource = remember { MutableInteractionSource() }
+    var checked by remember { mutableStateOf(false) }
+    TextToggleButton(
+        checked = checked,
+        modifier =
+            modifier
+                .height(TextToggleButtonDefaults.DefaultButtonSize)
+                .fillMaxWidth()
+                .enlargeOnPress(interactionSource),
+        onCheckedChange = { checked = !checked },
+        shapes = shapes,
+        interactionSource = interactionSource
+    ) {
+        content(checked)
+    }
+}
diff --git a/wear/compose/compose-material3/integration-tests/src/main/java/androidx/wear/compose/material3/demos/DatePickerDemo.kt b/wear/compose/compose-material3/integration-tests/src/main/java/androidx/wear/compose/material3/demos/DatePickerDemo.kt
index a80f168..2e020d7 100644
--- a/wear/compose/compose-material3/integration-tests/src/main/java/androidx/wear/compose/material3/demos/DatePickerDemo.kt
+++ b/wear/compose/compose-material3/integration-tests/src/main/java/androidx/wear/compose/material3/demos/DatePickerDemo.kt
@@ -16,6 +16,8 @@
 
 package androidx.wear.compose.material3.demos
 
+import android.os.Build
+import androidx.annotation.RequiresApi
 import androidx.compose.foundation.layout.Box
 import androidx.compose.foundation.layout.fillMaxSize
 import androidx.compose.material.icons.Icons
@@ -41,6 +43,7 @@
 import java.time.format.DateTimeFormatter
 import java.time.format.FormatStyle
 
+@RequiresApi(Build.VERSION_CODES.O)
 val DatePickerDemos =
     listOf(
         ComposableDemo("Date Year-Month-Day") { DatePickerYearMonthDaySample() },
@@ -51,6 +54,7 @@
         ComposableDemo("Past only") { DatePickerPastOnlyDemo() },
     )
 
+@RequiresApi(Build.VERSION_CODES.O)
 @Composable
 fun DatePickerDemo(datePickerType: DatePickerType) {
     var showDatePicker by remember { mutableStateOf(true) }
@@ -85,6 +89,7 @@
     }
 }
 
+@RequiresApi(Build.VERSION_CODES.O)
 @Composable
 fun DatePickerPastOnlyDemo() {
     val currentDate = LocalDate.now()
diff --git a/wear/compose/compose-material3/integration-tests/src/main/java/androidx/wear/compose/material3/demos/TimePickerDemo.kt b/wear/compose/compose-material3/integration-tests/src/main/java/androidx/wear/compose/material3/demos/TimePickerDemo.kt
index 7a1f55b..20d4ca7 100644
--- a/wear/compose/compose-material3/integration-tests/src/main/java/androidx/wear/compose/material3/demos/TimePickerDemo.kt
+++ b/wear/compose/compose-material3/integration-tests/src/main/java/androidx/wear/compose/material3/demos/TimePickerDemo.kt
@@ -16,6 +16,8 @@
 
 package androidx.wear.compose.material3.demos
 
+import android.os.Build
+import androidx.annotation.RequiresApi
 import androidx.compose.foundation.layout.Box
 import androidx.compose.foundation.layout.fillMaxSize
 import androidx.compose.material.icons.Icons
@@ -39,6 +41,7 @@
 import java.time.LocalTime
 import java.time.format.DateTimeFormatter
 
+@RequiresApi(Build.VERSION_CODES.O)
 val TimePickerDemos =
     listOf(
         ComposableDemo("Time HH:MM:SS") { TimePickerWithSecondsSample() },
@@ -47,6 +50,7 @@
         ComposableDemo("Time System time format") { TimePickerSample() },
     )
 
+@RequiresApi(Build.VERSION_CODES.O)
 @Composable
 private fun TimePicker24hWithoutSecondsDemo() {
     var showTimePicker by remember { mutableStateOf(true) }
diff --git a/wear/compose/compose-material3/integration-tests/src/main/java/androidx/wear/compose/material3/demos/TransformingLazyColumnDemo.kt b/wear/compose/compose-material3/integration-tests/src/main/java/androidx/wear/compose/material3/demos/TransformingLazyColumnDemo.kt
index 4523210..4b6646b 100644
--- a/wear/compose/compose-material3/integration-tests/src/main/java/androidx/wear/compose/material3/demos/TransformingLazyColumnDemo.kt
+++ b/wear/compose/compose-material3/integration-tests/src/main/java/androidx/wear/compose/material3/demos/TransformingLazyColumnDemo.kt
@@ -154,21 +154,25 @@
         }
         item {
             TransformExclusion {
-                val interactionSourceLeft = remember { MutableInteractionSource() }
-                val interactionSourceRight = remember { MutableInteractionSource() }
+                val interactionSource1 = remember { MutableInteractionSource() }
+                val interactionSource2 = remember { MutableInteractionSource() }
                 ButtonGroup(Modifier.scrollTransform(this@item)) {
-                    buttonGroupItem(interactionSource = interactionSourceLeft) {
-                        Button(onClick = {}, interactionSource = interactionSourceLeft) {
-                            Box(Modifier.fillMaxSize(), contentAlignment = Alignment.Center) {
-                                Text("L")
-                            }
+                    Button(
+                        onClick = {},
+                        Modifier.enlargeOnPress(interactionSource1),
+                        interactionSource = interactionSource1
+                    ) {
+                        Box(Modifier.fillMaxSize(), contentAlignment = Alignment.Center) {
+                            Text("L")
                         }
                     }
-                    buttonGroupItem(interactionSource = interactionSourceRight) {
-                        Button(onClick = {}, interactionSource = interactionSourceRight) {
-                            Box(Modifier.fillMaxSize(), contentAlignment = Alignment.Center) {
-                                Text("R")
-                            }
+                    Button(
+                        onClick = {},
+                        Modifier.enlargeOnPress(interactionSource2),
+                        interactionSource = interactionSource2
+                    ) {
+                        Box(Modifier.fillMaxSize(), contentAlignment = Alignment.Center) {
+                            Text("R")
                         }
                     }
                 }
diff --git a/wear/compose/compose-material3/integration-tests/src/main/java/androidx/wear/compose/material3/demos/WearMaterial3Demos.kt b/wear/compose/compose-material3/integration-tests/src/main/java/androidx/wear/compose/material3/demos/WearMaterial3Demos.kt
index 8a93dff..11844f9 100644
--- a/wear/compose/compose-material3/integration-tests/src/main/java/androidx/wear/compose/material3/demos/WearMaterial3Demos.kt
+++ b/wear/compose/compose-material3/integration-tests/src/main/java/androidx/wear/compose/material3/demos/WearMaterial3Demos.kt
@@ -26,6 +26,7 @@
 import androidx.wear.compose.material3.samples.AnimatedTextSampleButtonResponse
 import androidx.wear.compose.material3.samples.AnimatedTextSampleSharedFontRegistry
 import androidx.wear.compose.material3.samples.ButtonGroupSample
+import androidx.wear.compose.material3.samples.ButtonGroupThreeButtonsSample
 import androidx.wear.compose.material3.samples.EdgeButtonListSample
 import androidx.wear.compose.material3.samples.EdgeButtonSample
 import androidx.wear.compose.material3.samples.EdgeSwipeForSwipeToDismiss
@@ -113,7 +114,9 @@
                     "Button Group",
                     listOf(
                         ComposableDemo("Two buttons") { ButtonGroupSample() },
-                        ComposableDemo("Three buttons") { ButtonGroupDemo() },
+                        ComposableDemo("ABC") { ButtonGroupThreeButtonsSample() },
+                        ComposableDemo("Text And Icon") { ButtonGroupDemo() },
+                        ComposableDemo("ToggleButtons") { ButtonGroupToggleButtonsDemo() },
                     )
                 ),
                 ComposableDemo("List Header") { Centralize { ListHeaderSample() } },
@@ -138,8 +141,13 @@
                 Material3DemoCategory("Stepper", StepperDemos),
                 Material3DemoCategory("Slider", SliderDemos),
                 Material3DemoCategory("Picker", PickerDemos),
-                Material3DemoCategory("TimePicker", TimePickerDemos),
-                Material3DemoCategory("DatePicker", DatePickerDemos),
+                // Requires API level 26 or higher due to java.time dependency.
+                *(if (Build.VERSION.SDK_INT >= 26)
+                    arrayOf(
+                        Material3DemoCategory("TimePicker", TimePickerDemos),
+                        Material3DemoCategory("DatePicker", DatePickerDemos)
+                    )
+                else emptyArray<Material3DemoCategory>()),
                 Material3DemoCategory("Progress Indicator", ProgressIndicatorDemos),
                 Material3DemoCategory("Scroll Indicator", ScrollIndicatorDemos),
                 Material3DemoCategory("Placeholder", PlaceholderDemos),
diff --git a/wear/compose/compose-material3/macrobenchmark-common/build.gradle b/wear/compose/compose-material3/macrobenchmark-common/build.gradle
index 51008d8..92093e3 100644
--- a/wear/compose/compose-material3/macrobenchmark-common/build.gradle
+++ b/wear/compose/compose-material3/macrobenchmark-common/build.gradle
@@ -10,7 +10,7 @@
     compileSdk = 35
 
     defaultConfig {
-        minSdk = 30
+        minSdk = 25
     }
 
     buildTypes.configureEach {
diff --git a/wear/compose/compose-material3/macrobenchmark-common/src/main/java/androidx/wear/compose/material3/macrobenchmark/common/ButtonGroupBenchmark.kt b/wear/compose/compose-material3/macrobenchmark-common/src/main/java/androidx/wear/compose/material3/macrobenchmark/common/ButtonGroupBenchmark.kt
index bfbc1a9..2d5a664 100644
--- a/wear/compose/compose-material3/macrobenchmark-common/src/main/java/androidx/wear/compose/material3/macrobenchmark/common/ButtonGroupBenchmark.kt
+++ b/wear/compose/compose-material3/macrobenchmark-common/src/main/java/androidx/wear/compose/material3/macrobenchmark/common/ButtonGroupBenchmark.kt
@@ -18,14 +18,12 @@
 
 import android.os.SystemClock
 import androidx.benchmark.macro.MacrobenchmarkScope
-import androidx.compose.foundation.interaction.MutableInteractionSource
 import androidx.compose.foundation.layout.Box
 import androidx.compose.foundation.layout.BoxScope
 import androidx.compose.foundation.layout.fillMaxSize
 import androidx.compose.foundation.layout.fillMaxWidth
 import androidx.compose.foundation.layout.size
 import androidx.compose.runtime.Composable
-import androidx.compose.runtime.remember
 import androidx.compose.ui.Alignment
 import androidx.compose.ui.Modifier
 import androidx.compose.ui.semantics.contentDescription
@@ -40,30 +38,22 @@
 object ButtonGroupBenchmark : MacrobenchmarkScreen {
     override val content: @Composable (BoxScope.() -> Unit)
         get() = {
-            val interactionSourceLeft = remember { MutableInteractionSource() }
-            val interactionSourceRight = remember { MutableInteractionSource() }
             Box(Modifier.size(300.dp), contentAlignment = Alignment.Center) {
                 ButtonGroup(Modifier.fillMaxWidth()) {
-                    buttonGroupItem(interactionSource = interactionSourceLeft) {
-                        Button(
-                            modifier = Modifier.semantics { contentDescription = LEFT_BUTTON },
-                            onClick = {},
-                            interactionSource = interactionSourceLeft
-                        ) {
-                            Box(Modifier.fillMaxSize(), contentAlignment = Alignment.Center) {
-                                Text("Left")
-                            }
+                    Button(
+                        modifier = Modifier.semantics { contentDescription = LEFT_BUTTON },
+                        onClick = {},
+                    ) {
+                        Box(Modifier.fillMaxSize(), contentAlignment = Alignment.Center) {
+                            Text("Left")
                         }
                     }
-                    buttonGroupItem(interactionSource = interactionSourceRight) {
-                        Button(
-                            modifier = Modifier.semantics { contentDescription = RIGHT_BUTTON },
-                            onClick = {},
-                            interactionSource = interactionSourceRight
-                        ) {
-                            Box(Modifier.fillMaxSize(), contentAlignment = Alignment.Center) {
-                                Text("Right")
-                            }
+                    Button(
+                        modifier = Modifier.semantics { contentDescription = RIGHT_BUTTON },
+                        onClick = {},
+                    ) {
+                        Box(Modifier.fillMaxSize(), contentAlignment = Alignment.Center) {
+                            Text("Right")
                         }
                     }
                 }
diff --git a/wear/compose/compose-material3/macrobenchmark-common/src/main/java/androidx/wear/compose/material3/macrobenchmark/common/DatePickerBenchmark.kt b/wear/compose/compose-material3/macrobenchmark-common/src/main/java/androidx/wear/compose/material3/macrobenchmark/common/DatePickerBenchmark.kt
index 3177504..51431d0 100644
--- a/wear/compose/compose-material3/macrobenchmark-common/src/main/java/androidx/wear/compose/material3/macrobenchmark/common/DatePickerBenchmark.kt
+++ b/wear/compose/compose-material3/macrobenchmark-common/src/main/java/androidx/wear/compose/material3/macrobenchmark/common/DatePickerBenchmark.kt
@@ -16,7 +16,9 @@
 
 package androidx.wear.compose.material3.macrobenchmark.common
 
+import android.os.Build
 import android.os.SystemClock
+import androidx.annotation.RequiresApi
 import androidx.benchmark.macro.MacrobenchmarkScope
 import androidx.compose.foundation.layout.BoxScope
 import androidx.compose.material.icons.Icons
@@ -41,6 +43,7 @@
 import java.time.format.DateTimeFormatter
 import java.time.format.FormatStyle
 
+@RequiresApi(Build.VERSION_CODES.O)
 object DatePickerBenchmark : MacrobenchmarkScreen {
     override val content: @Composable (BoxScope.() -> Unit)
         get() = {
diff --git a/wear/compose/compose-material3/macrobenchmark-common/src/main/java/androidx/wear/compose/material3/macrobenchmark/common/TimePickerBenchmark.kt b/wear/compose/compose-material3/macrobenchmark-common/src/main/java/androidx/wear/compose/material3/macrobenchmark/common/TimePickerBenchmark.kt
index 1c9103b..7d15ce7 100644
--- a/wear/compose/compose-material3/macrobenchmark-common/src/main/java/androidx/wear/compose/material3/macrobenchmark/common/TimePickerBenchmark.kt
+++ b/wear/compose/compose-material3/macrobenchmark-common/src/main/java/androidx/wear/compose/material3/macrobenchmark/common/TimePickerBenchmark.kt
@@ -16,7 +16,9 @@
 
 package androidx.wear.compose.material3.macrobenchmark.common
 
+import android.os.Build
 import android.os.SystemClock
+import androidx.annotation.RequiresApi
 import androidx.benchmark.macro.MacrobenchmarkScope
 import androidx.compose.foundation.layout.BoxScope
 import androidx.compose.runtime.Composable
@@ -24,6 +26,7 @@
 import androidx.wear.compose.material3.TimePickerType
 import java.time.LocalTime
 
+@RequiresApi(Build.VERSION_CODES.O)
 object TimePickerBenchmark : MacrobenchmarkScreen {
     override val content: @Composable (BoxScope.() -> Unit)
         get() = {
diff --git a/wear/compose/compose-material3/macrobenchmark-common/src/main/java/androidx/wear/compose/material3/macrobenchmark/common/baselineprofile/DatePickerScreen.kt b/wear/compose/compose-material3/macrobenchmark-common/src/main/java/androidx/wear/compose/material3/macrobenchmark/common/baselineprofile/DatePickerScreen.kt
index 8e3685d1..04e9ca75 100644
--- a/wear/compose/compose-material3/macrobenchmark-common/src/main/java/androidx/wear/compose/material3/macrobenchmark/common/baselineprofile/DatePickerScreen.kt
+++ b/wear/compose/compose-material3/macrobenchmark-common/src/main/java/androidx/wear/compose/material3/macrobenchmark/common/baselineprofile/DatePickerScreen.kt
@@ -16,6 +16,7 @@
 
 package androidx.wear.compose.material3.macrobenchmark.common.baselineprofile
 
+import android.os.Build
 import androidx.compose.foundation.layout.BoxScope
 import androidx.compose.runtime.Composable
 import androidx.wear.compose.material3.DatePicker
@@ -27,14 +28,16 @@
     object : MacrobenchmarkScreen {
         override val content: @Composable BoxScope.() -> Unit
             get() = {
-                val minDate = LocalDate.of(2022, 10, 15)
-                val maxDate = LocalDate.of(2025, 2, 4)
-                DatePicker(
-                    initialDate = LocalDate.of(2024, 9, 2),
-                    onDatePicked = {},
-                    minValidDate = minDate,
-                    maxValidDate = maxDate,
-                    datePickerType = DatePickerType.YearMonthDay
-                )
+                if (Build.VERSION.SDK_INT >= 26) {
+                    val minDate = LocalDate.of(2022, 10, 15)
+                    val maxDate = LocalDate.of(2025, 2, 4)
+                    DatePicker(
+                        initialDate = LocalDate.of(2024, 9, 2),
+                        onDatePicked = {},
+                        minValidDate = minDate,
+                        maxValidDate = maxDate,
+                        datePickerType = DatePickerType.YearMonthDay
+                    )
+                }
             }
     }
diff --git a/wear/compose/compose-material3/macrobenchmark-target/build.gradle b/wear/compose/compose-material3/macrobenchmark-target/build.gradle
index eaba1e7..82913ef 100644
--- a/wear/compose/compose-material3/macrobenchmark-target/build.gradle
+++ b/wear/compose/compose-material3/macrobenchmark-target/build.gradle
@@ -46,4 +46,4 @@
     implementation(project(":wear:compose:compose-material3-macrobenchmark-common"))
 }
 
-android.defaultConfig.minSdk = 30
+android.defaultConfig.minSdk = 25
diff --git a/wear/compose/compose-material3/macrobenchmark-target/src/main/AndroidManifest.xml b/wear/compose/compose-material3/macrobenchmark-target/src/main/AndroidManifest.xml
index a68fd42..6ec1884 100644
--- a/wear/compose/compose-material3/macrobenchmark-target/src/main/AndroidManifest.xml
+++ b/wear/compose/compose-material3/macrobenchmark-target/src/main/AndroidManifest.xml
@@ -130,7 +130,8 @@
         <activity
             android:name=".DatePickerActivity"
             android:theme="@style/AppTheme"
-            android:exported="true">
+            android:exported="true"
+            tools:targetApi="o">
             <intent-filter>
                 <action android:name=
                     "androidx.wear.compose.material3.macrobenchmark.target.DATE_PICKER_ACTIVITY" />
@@ -269,7 +270,8 @@
         <activity
             android:name=".TimePickerActivity"
             android:theme="@style/AppTheme"
-            android:exported="true">
+            android:exported="true"
+            tools:targetApi="o">
             <intent-filter>
                 <action android:name=
                     "androidx.wear.compose.material3.macrobenchmark.target.TIME_PICKER_ACTIVITY" />
diff --git a/wear/compose/compose-material3/macrobenchmark-target/src/main/java/androidx/wear/compose/material3/macrobenchmark/target/DatePickerActivity.kt b/wear/compose/compose-material3/macrobenchmark-target/src/main/java/androidx/wear/compose/material3/macrobenchmark/target/DatePickerActivity.kt
index 4256fdc..d18d12d 100644
--- a/wear/compose/compose-material3/macrobenchmark-target/src/main/java/androidx/wear/compose/material3/macrobenchmark/target/DatePickerActivity.kt
+++ b/wear/compose/compose-material3/macrobenchmark-target/src/main/java/androidx/wear/compose/material3/macrobenchmark/target/DatePickerActivity.kt
@@ -16,6 +16,9 @@
 
 package androidx.wear.compose.material3.macrobenchmark.target
 
+import android.os.Build
+import androidx.annotation.RequiresApi
 import androidx.wear.compose.material3.macrobenchmark.common.DatePickerBenchmark
 
+@RequiresApi(Build.VERSION_CODES.O)
 class DatePickerActivity : BenchmarkBaseActivity(DatePickerBenchmark)
diff --git a/wear/compose/compose-material3/macrobenchmark-target/src/main/java/androidx/wear/compose/material3/macrobenchmark/target/TimePickerActivity.kt b/wear/compose/compose-material3/macrobenchmark-target/src/main/java/androidx/wear/compose/material3/macrobenchmark/target/TimePickerActivity.kt
index 6188ab7..e134065 100644
--- a/wear/compose/compose-material3/macrobenchmark-target/src/main/java/androidx/wear/compose/material3/macrobenchmark/target/TimePickerActivity.kt
+++ b/wear/compose/compose-material3/macrobenchmark-target/src/main/java/androidx/wear/compose/material3/macrobenchmark/target/TimePickerActivity.kt
@@ -16,6 +16,9 @@
 
 package androidx.wear.compose.material3.macrobenchmark.target
 
+import android.os.Build
+import androidx.annotation.RequiresApi
 import androidx.wear.compose.material3.macrobenchmark.common.TimePickerBenchmark
 
+@RequiresApi(Build.VERSION_CODES.O)
 class TimePickerActivity : BenchmarkBaseActivity(TimePickerBenchmark)
diff --git a/wear/compose/compose-material3/macrobenchmark/build.gradle b/wear/compose/compose-material3/macrobenchmark/build.gradle
index bcab91e..1940fef 100644
--- a/wear/compose/compose-material3/macrobenchmark/build.gradle
+++ b/wear/compose/compose-material3/macrobenchmark/build.gradle
@@ -23,7 +23,7 @@
 android {
     compileSdk = 35
     defaultConfig {
-        minSdk = 30
+        minSdk = 29
     }
     namespace = "androidx.wear.compose.material3.macrobenchmark"
     targetProjectPath = ":wear:compose:compose-material3-macrobenchmark-target"
diff --git a/wear/compose/compose-material3/macrobenchmark/src/main/java/androidx/wear/compose/material3/macrobenchmark/DatePickerBenchmarkTest.kt b/wear/compose/compose-material3/macrobenchmark/src/main/java/androidx/wear/compose/material3/macrobenchmark/DatePickerBenchmarkTest.kt
index b9abc42..3316732 100644
--- a/wear/compose/compose-material3/macrobenchmark/src/main/java/androidx/wear/compose/material3/macrobenchmark/DatePickerBenchmarkTest.kt
+++ b/wear/compose/compose-material3/macrobenchmark/src/main/java/androidx/wear/compose/material3/macrobenchmark/DatePickerBenchmarkTest.kt
@@ -16,12 +16,15 @@
 
 package androidx.wear.compose.material3.macrobenchmark
 
+import android.os.Build
+import androidx.annotation.RequiresApi
 import androidx.benchmark.macro.CompilationMode
 import androidx.test.filters.LargeTest
 import androidx.wear.compose.material3.macrobenchmark.common.DatePickerBenchmark
 import org.junit.runner.RunWith
 import org.junit.runners.Parameterized
 
+@RequiresApi(Build.VERSION_CODES.O)
 @LargeTest
 @RunWith(Parameterized::class)
 class DatePickerBenchmarkTest(compilationMode: CompilationMode) :
diff --git a/wear/compose/compose-material3/macrobenchmark/src/main/java/androidx/wear/compose/material3/macrobenchmark/TimePickerBenchmarkTest.kt b/wear/compose/compose-material3/macrobenchmark/src/main/java/androidx/wear/compose/material3/macrobenchmark/TimePickerBenchmarkTest.kt
index 1533377..52a5a38 100644
--- a/wear/compose/compose-material3/macrobenchmark/src/main/java/androidx/wear/compose/material3/macrobenchmark/TimePickerBenchmarkTest.kt
+++ b/wear/compose/compose-material3/macrobenchmark/src/main/java/androidx/wear/compose/material3/macrobenchmark/TimePickerBenchmarkTest.kt
@@ -16,12 +16,15 @@
 
 package androidx.wear.compose.material3.macrobenchmark
 
+import android.os.Build
+import androidx.annotation.RequiresApi
 import androidx.benchmark.macro.CompilationMode
 import androidx.test.filters.LargeTest
 import androidx.wear.compose.material3.macrobenchmark.common.TimePickerBenchmark
 import org.junit.runner.RunWith
 import org.junit.runners.Parameterized
 
+@RequiresApi(Build.VERSION_CODES.O)
 @LargeTest
 @RunWith(Parameterized::class)
 class TimePickerBenchmarkTest(compilationMode: CompilationMode) :
diff --git a/wear/compose/compose-material3/samples/build.gradle b/wear/compose/compose-material3/samples/build.gradle
index 814f3e9..02e43d8 100644
--- a/wear/compose/compose-material3/samples/build.gradle
+++ b/wear/compose/compose-material3/samples/build.gradle
@@ -50,7 +50,7 @@
 android {
     compileSdk = 35
     defaultConfig {
-        minSdk = 30
+        minSdk = 25
     }
     namespace = "androidx.wear.compose.material3.samples"
 }
diff --git a/wear/compose/compose-material3/samples/src/main/java/androidx/wear/compose/material3/samples/ButtonGroupSample.kt b/wear/compose/compose-material3/samples/src/main/java/androidx/wear/compose/material3/samples/ButtonGroupSample.kt
index a467fe1..9b6d145 100644
--- a/wear/compose/compose-material3/samples/src/main/java/androidx/wear/compose/material3/samples/ButtonGroupSample.kt
+++ b/wear/compose/compose-material3/samples/src/main/java/androidx/wear/compose/material3/samples/ButtonGroupSample.kt
@@ -34,19 +34,58 @@
 @Sampled
 @Composable
 fun ButtonGroupSample() {
-    val interactionSourceLeft = remember { MutableInteractionSource() }
-    val interactionSourceRight = remember { MutableInteractionSource() }
+    val interactionSource1 = remember { MutableInteractionSource() }
+    val interactionSource2 = remember { MutableInteractionSource() }
+
     Box(Modifier.size(300.dp), contentAlignment = Alignment.Center) {
         ButtonGroup(Modifier.fillMaxWidth()) {
-            buttonGroupItem(interactionSource = interactionSourceLeft) {
-                Button(onClick = {}, interactionSource = interactionSourceLeft) {
-                    Box(Modifier.fillMaxSize(), contentAlignment = Alignment.Center) { Text("L") }
-                }
+            Button(
+                onClick = {},
+                modifier = Modifier.enlargeOnPress(interactionSource1),
+                interactionSource = interactionSource1
+            ) {
+                Box(Modifier.fillMaxSize(), contentAlignment = Alignment.Center) { Text("L") }
             }
-            buttonGroupItem(interactionSource = interactionSourceRight) {
-                Button(onClick = {}, interactionSource = interactionSourceRight) {
-                    Box(Modifier.fillMaxSize(), contentAlignment = Alignment.Center) { Text("R") }
-                }
+            Button(
+                onClick = {},
+                modifier = Modifier.enlargeOnPress(interactionSource2),
+                interactionSource = interactionSource2
+            ) {
+                Box(Modifier.fillMaxSize(), contentAlignment = Alignment.Center) { Text("R") }
+            }
+        }
+    }
+}
+
+@Sampled
+@Composable
+fun ButtonGroupThreeButtonsSample() {
+    val interactionSource1 = remember { MutableInteractionSource() }
+    val interactionSource2 = remember { MutableInteractionSource() }
+    val interactionSource3 = remember { MutableInteractionSource() }
+
+    Box(Modifier.size(300.dp), contentAlignment = Alignment.Center) {
+        ButtonGroup(Modifier.fillMaxWidth()) {
+            Button(
+                onClick = {},
+                modifier = Modifier.enlargeOnPress(interactionSource1),
+                interactionSource = interactionSource1
+            ) {
+                Box(Modifier.fillMaxSize(), contentAlignment = Alignment.Center) { Text("A") }
+            }
+            Button(
+                onClick = {},
+                modifier = Modifier.weight(1.5f).enlargeOnPress(interactionSource2),
+                interactionSource = interactionSource2
+            ) {
+                Box(Modifier.fillMaxSize(), contentAlignment = Alignment.Center) { Text("B") }
+            }
+            Button(
+                onClick = {},
+                modifier = Modifier.enlargeOnPress(interactionSource3),
+                interactionSource = interactionSource3
+            ) {
+                Box(Modifier.fillMaxSize(), contentAlignment = Alignment.Center) { Text("C") }
             }
         }
     }
diff --git a/wear/compose/compose-material3/src/androidTest/kotlin/androidx/wear/compose/material3/ButtonGroupScreenshotTest.kt b/wear/compose/compose-material3/src/androidTest/kotlin/androidx/wear/compose/material3/ButtonGroupScreenshotTest.kt
index bfd690a..0b84d2b 100644
--- a/wear/compose/compose-material3/src/androidTest/kotlin/androidx/wear/compose/material3/ButtonGroupScreenshotTest.kt
+++ b/wear/compose/compose-material3/src/androidTest/kotlin/androidx/wear/compose/material3/ButtonGroupScreenshotTest.kt
@@ -18,8 +18,6 @@
 
 import android.os.Build
 import androidx.compose.foundation.background
-import androidx.compose.foundation.interaction.MutableInteractionSource
-import androidx.compose.runtime.remember
 import androidx.compose.testutils.assertAgainstGolden
 import androidx.compose.ui.Modifier
 import androidx.compose.ui.graphics.Color
@@ -72,25 +70,25 @@
         require(numItems in 1..3)
         rule.setContentWithTheme {
             ScreenConfiguration(SCREEN_SIZE_SMALL) {
-                val interactionSource1 = remember { MutableInteractionSource() }
-                val interactionSource2 = remember { MutableInteractionSource() }
-                val interactionSource3 = remember { MutableInteractionSource() }
                 ButtonGroup(
                     Modifier.testTag(TEST_TAG),
                     spacing = spacing,
                     expansionWidth = expansionWidth
                 ) {
-                    buttonGroupItem(interactionSource1, minWidth1, weight1) {
-                        Text("A", Modifier.background(Color.Gray))
+                    // Modifiers inverted here to check order doesn't matter
+                    Text("A", Modifier.background(Color.Gray).weight(weight1).minWidth(minWidth1))
+                    if (numItems >= 2) {
+                        Text(
+                            "B",
+                            Modifier.background(Color.Gray).minWidth(minWidth2).weight(weight2)
+                        )
                     }
-                    if (numItems >= 2)
-                        buttonGroupItem(interactionSource2, minWidth2, weight2) {
-                            Text("B", Modifier.background(Color.Gray))
-                        }
-                    if (numItems >= 3)
-                        buttonGroupItem(interactionSource3, minWidth3, weight3) {
-                            Text("C", Modifier.background(Color.Gray))
-                        }
+                    if (numItems >= 3) {
+                        Text(
+                            "C",
+                            Modifier.background(Color.Gray).minWidth(minWidth3).weight(weight3)
+                        )
+                    }
                 }
             }
         }
diff --git a/wear/compose/compose-material3/src/androidTest/kotlin/androidx/wear/compose/material3/ButtonGroupTest.kt b/wear/compose/compose-material3/src/androidTest/kotlin/androidx/wear/compose/material3/ButtonGroupTest.kt
index b24182d..e28002d 100644
--- a/wear/compose/compose-material3/src/androidTest/kotlin/androidx/wear/compose/material3/ButtonGroupTest.kt
+++ b/wear/compose/compose-material3/src/androidTest/kotlin/androidx/wear/compose/material3/ButtonGroupTest.kt
@@ -16,12 +16,10 @@
 
 package androidx.wear.compose.material3
 
-import androidx.compose.foundation.interaction.MutableInteractionSource
 import androidx.compose.foundation.layout.Box
 import androidx.compose.foundation.layout.PaddingValues
 import androidx.compose.foundation.layout.fillMaxSize
 import androidx.compose.foundation.layout.size
-import androidx.compose.runtime.remember
 import androidx.compose.ui.Modifier
 import androidx.compose.ui.platform.testTag
 import androidx.compose.ui.test.assertWidthIsEqualTo
@@ -38,13 +36,10 @@
     @Test
     fun supports_testtag() {
         rule.setContentWithTheme {
-            val interactionSource = remember { MutableInteractionSource() }
             ButtonGroup(modifier = Modifier.testTag(TEST_TAG)) {
-                buttonGroupItem(interactionSource) {
-                    Box(
-                        modifier = Modifier.fillMaxSize(),
-                    )
-                }
+                Box(
+                    modifier = Modifier.fillMaxSize(),
+                )
             }
         }
 
@@ -53,76 +48,94 @@
 
     @Test
     fun two_items_equally_sized_by_default() =
-        doTest(
+        verifyWidths(
             2,
             expectedWidths = { availableSpace -> arrayOf(availableSpace / 2, availableSpace / 2) }
         )
 
     @Test
     fun two_items_one_double_size() =
-        doTest(
+        verifyWidths(
             2,
             expectedWidths = { availableSpace ->
                 arrayOf(availableSpace / 3, availableSpace / 3 * 2)
             },
-            minWidthsAndWeights = arrayOf(50.dp to 1f, 50.dp to 2f)
+            minWidthAndWeights = arrayOf(50.dp to 1f, 50.dp to 2f)
         )
 
     @Test
     fun respects_min_width() =
-        doTest(
+        verifyWidths(
             2,
             expectedWidths = { availableSpace -> arrayOf(30.dp, availableSpace - 30.dp) },
             size = 100.dp,
-            minWidthsAndWeights = arrayOf(30.dp to 1f, 30.dp to 10f)
+            minWidthAndWeights = arrayOf(30.dp to 1f, 30.dp to 10f)
         )
 
     @Test
     fun three_equal_buttons() =
-        doTest(3, expectedWidths = { availableSpace -> Array(3) { availableSpace / 3 } })
+        verifyWidths(3, expectedWidths = { availableSpace -> Array(3) { availableSpace / 3 } })
 
     @Test
     fun three_buttons_one_two_one() =
-        doTest(
+        verifyWidths(
             3,
             expectedWidths = { availableSpace ->
                 arrayOf(availableSpace / 4, availableSpace / 2, availableSpace / 4)
             },
-            minWidthsAndWeights = arrayOf(50.dp to 1f, 50.dp to 2f, 50.dp to 1f)
+            minWidthAndWeights = arrayOf(50.dp to 1f, 50.dp to 2f, 50.dp to 1f)
         )
 
-    private fun doTest(
+    @Test
+    fun modifier_order_ignored() {
+        val size = 300.dp
+        rule.setContentWithTheme {
+            ButtonGroup(
+                modifier = Modifier.size(size),
+                contentPadding = PaddingValues(0.dp),
+                spacing = 0.dp
+            ) {
+                Box(Modifier.weight(1f).minWidth(60.dp).testTag("${TEST_TAG}0"))
+                Box(Modifier.minWidth(60.dp).weight(1f).testTag("${TEST_TAG}1"))
+                Box(Modifier.weight(2f).minWidth(60.dp).testTag("${TEST_TAG}2"))
+                Box(Modifier.minWidth(60.dp).weight(2f).testTag("${TEST_TAG}3"))
+            }
+        }
+
+        // Items 0 & 1 should be 60.dp, 2 & 3 should be 90.dp
+        listOf(60.dp, 60.dp, 90.dp, 90.dp).forEachIndexed { index, dp ->
+            rule.onNodeWithTag(TEST_TAG + index.toString()).assertWidthIsEqualTo(dp)
+        }
+    }
+
+    private fun verifyWidths(
         numItems: Int,
         expectedWidths: (Dp) -> Array<Dp>,
         size: Dp = 300.dp,
         spacing: Dp = 10.dp,
-        minWidthsAndWeights: Array<Pair<Dp, Float>> = Array(numItems) { 48.dp to 1f },
+        minWidthAndWeights: Array<Pair<Dp, Float>> = Array(numItems) { 48.dp to 1f },
     ) {
         val horizontalPadding = 10.dp
         val actualExpectedWidths =
             expectedWidths(size - horizontalPadding * 2 - spacing * (numItems - 1))
 
         require(numItems == actualExpectedWidths.size)
-        require(numItems == minWidthsAndWeights.size)
+        require(numItems == minWidthAndWeights.size)
 
         rule.setContentWithTheme {
-            val interactionSources = remember { Array(numItems) { MutableInteractionSource() } }
             ButtonGroup(
                 modifier = Modifier.size(size),
                 contentPadding = PaddingValues(horizontal = horizontalPadding),
                 spacing = spacing
             ) {
                 repeat(numItems) { ix ->
-                    buttonGroupItem(
-                        interactionSources[ix],
-                        minWidth = minWidthsAndWeights[ix].first,
-                        weight = minWidthsAndWeights[ix].second
-                    ) {
-                        Box(
-                            modifier =
-                                Modifier.testTag(TEST_TAG + (ix + 1).toString()).fillMaxSize(),
-                        )
-                    }
+                    Box(
+                        modifier =
+                            Modifier.testTag(TEST_TAG + (ix + 1).toString())
+                                .fillMaxSize()
+                                .weight(minWidthAndWeights[ix].second)
+                                .minWidth(minWidthAndWeights[ix].first)
+                    )
                 }
             }
         }
diff --git a/wear/compose/compose-material3/src/androidTest/kotlin/androidx/wear/compose/material3/ButtonTest.kt b/wear/compose/compose-material3/src/androidTest/kotlin/androidx/wear/compose/material3/ButtonTest.kt
index 722675e..ba35ea0 100644
--- a/wear/compose/compose-material3/src/androidTest/kotlin/androidx/wear/compose/material3/ButtonTest.kt
+++ b/wear/compose/compose-material3/src/androidTest/kotlin/androidx/wear/compose/material3/ButtonTest.kt
@@ -16,16 +16,24 @@
 
 package androidx.wear.compose.material3
 
+import android.os.Build
+import androidx.annotation.RequiresApi
+import androidx.compose.animation.animateContentSize
+import androidx.compose.animation.core.LinearEasing
+import androidx.compose.animation.core.tween
 import androidx.compose.foundation.background
 import androidx.compose.foundation.layout.Box
 import androidx.compose.foundation.layout.fillMaxSize
+import androidx.compose.foundation.layout.fillMaxWidth
 import androidx.compose.foundation.layout.padding
+import androidx.compose.foundation.layout.requiredHeight
 import androidx.compose.foundation.layout.width
 import androidx.compose.foundation.shape.CornerSize
 import androidx.compose.foundation.shape.CutCornerShape
 import androidx.compose.foundation.shape.RoundedCornerShape
 import androidx.compose.runtime.Composable
 import androidx.compose.runtime.CompositionLocalProvider
+import androidx.compose.runtime.mutableStateOf
 import androidx.compose.testutils.assertContainsColor
 import androidx.compose.testutils.assertShape
 import androidx.compose.ui.Modifier
@@ -277,6 +285,7 @@
         assertEquals(expectedSecondaryTextStyle, actualSecondaryLabelTextStyle)
     }
 
+    @RequiresApi(Build.VERSION_CODES.O)
     @Test
     fun default_shape_is_stadium() {
         rule.isShape(
@@ -289,6 +298,7 @@
         }
     }
 
+    @RequiresApi(Build.VERSION_CODES.O)
     @Test
     fun allows_custom_shape_override() {
         val shape = CutCornerShape(4.dp)
@@ -357,6 +367,50 @@
     }
 
     @Test
+    fun button_animate_content_size_animates_height() {
+        val boxHeight = mutableStateOf(60.dp)
+        val frames = 14
+        val animationMillis = frames * 16
+        val buttonPadding = ButtonDefaults.ButtonVerticalPadding
+
+        rule.setContentWithTheme {
+            Button(onClick = {}, modifier = Modifier.testTag(TEST_TAG).fillMaxWidth()) {
+                Box(
+                    modifier =
+                        Modifier.animateContentSize(
+                                animationSpec = tween(animationMillis, easing = LinearEasing)
+                            )
+                            .fillMaxWidth()
+                            .requiredHeight(boxHeight.value)
+                ) {}
+            }
+        }
+        // Verify initial height
+        rule.onNodeWithTag(TEST_TAG).assertHeightIsEqualTo(60.dp + buttonPadding * 2)
+
+        // Set autoAdvance off to test the content size animation
+        rule.mainClock.autoAdvance = false
+        boxHeight.value = 100.dp
+        // Advance to the actual start of the animation
+        rule.mainClock.advanceTimeByFrame()
+        rule.mainClock.advanceTimeByFrame()
+
+        // Advance to middle of animation
+        rule.mainClock.advanceTimeBy(animationMillis / 2L)
+        rule.waitForIdle()
+        // Verify that the animation is halfway finished
+        rule
+            .onNodeWithTag(TEST_TAG)
+            .assertHeightIsEqualTo(80.dp + buttonPadding * 2, tolerance = 2.dp)
+
+        // Set autoAdvance back on to finish the animation
+        rule.mainClock.autoAdvance = true
+        rule.waitForIdle()
+        // Verify end height is correct
+        rule.onNodeWithTag(TEST_TAG).assertHeightIsEqualTo(100.dp + buttonPadding * 2)
+    }
+
+    @Test
     fun has_icon_in_correct_location_for_three_slot_button_and_label_only() {
         val iconTag = "TestIcon"
         rule.setContentWithThemeForSizeAssertions(useUnmergedTree = true) {
@@ -376,6 +430,7 @@
             .assertTopPositionInRootIsEqualTo((itemBounds.height - iconBounds.height) / 2)
     }
 
+    @RequiresApi(Build.VERSION_CODES.O)
     @Test
     fun gives_enabled_base_button_correct_colors() {
         rule.verifyButtonColors(
@@ -385,6 +440,7 @@
         )
     }
 
+    @RequiresApi(Build.VERSION_CODES.O)
     @Test
     fun gives_disabled_base_button_correct_colors() {
         rule.verifyButtonColors(
@@ -398,6 +454,7 @@
         )
     }
 
+    @RequiresApi(Build.VERSION_CODES.O)
     @Test
     fun gives_enabled_filled_tonal_base_button_correct_colors() {
         rule.verifyButtonColors(
@@ -408,6 +465,7 @@
         )
     }
 
+    @RequiresApi(Build.VERSION_CODES.O)
     @Test
     fun gives_disabled_filled_tonal_base_button_correct_colors() {
         rule.verifyButtonColors(
@@ -422,6 +480,7 @@
         )
     }
 
+    @RequiresApi(Build.VERSION_CODES.O)
     @Test
     fun gives_enabled_button_correct_filled_variant_colors() {
         rule.verifyButtonColors(
@@ -432,6 +491,7 @@
         )
     }
 
+    @RequiresApi(Build.VERSION_CODES.O)
     @Test
     fun gives_disabled_button_correct_filled_variant_colors() {
         rule.verifyButtonColors(
@@ -446,6 +506,7 @@
         )
     }
 
+    @RequiresApi(Build.VERSION_CODES.O)
     @Test
     fun gives_enabled_outlined_base_button_correct_colors() {
         rule.verifyButtonColors(
@@ -456,6 +517,7 @@
         )
     }
 
+    @RequiresApi(Build.VERSION_CODES.O)
     @Test
     fun gives_disabled_outlined_base_button_correct_colors() {
         rule.verifyButtonColors(
@@ -468,6 +530,7 @@
         )
     }
 
+    @RequiresApi(Build.VERSION_CODES.O)
     @Test
     fun gives_enabled_child_base_button_correct_colors() {
         rule.verifyButtonColors(
@@ -478,6 +541,7 @@
         )
     }
 
+    @RequiresApi(Build.VERSION_CODES.O)
     @Test
     fun gives_disabled_child_base_button_correct_colors() {
         rule.verifyButtonColors(
@@ -490,6 +554,7 @@
         )
     }
 
+    @RequiresApi(Build.VERSION_CODES.O)
     @Test
     fun gives_enabled_three_slot_button_correct_colors() {
         rule.verifyThreeSlotButtonColors(
@@ -499,6 +564,7 @@
         )
     }
 
+    @RequiresApi(Build.VERSION_CODES.O)
     @Test
     fun gives_disabled_three_slot_button_correct_colors() {
         rule.verifyThreeSlotButtonColors(
@@ -508,6 +574,7 @@
         )
     }
 
+    @RequiresApi(Build.VERSION_CODES.O)
     @Test
     fun gives_enabled_filled_tonal_three_slot_button_correct_colors() {
         rule.verifyThreeSlotButtonColors(
@@ -517,6 +584,7 @@
         )
     }
 
+    @RequiresApi(Build.VERSION_CODES.O)
     @Test
     fun gives_disabled_filled_tonal_three_slot_button_correct_colors() {
         rule.verifyThreeSlotButtonColors(
@@ -526,6 +594,7 @@
         )
     }
 
+    @RequiresApi(Build.VERSION_CODES.O)
     @Test
     fun gives_enabled_outlined_three_slot_button_correct_colors() {
         rule.verifyThreeSlotButtonColors(
@@ -535,6 +604,7 @@
         )
     }
 
+    @RequiresApi(Build.VERSION_CODES.O)
     @Test
     fun gives_disabled_outlined_three_slot_button_correct_colors() {
         rule.verifyThreeSlotButtonColors(
@@ -544,6 +614,7 @@
         )
     }
 
+    @RequiresApi(Build.VERSION_CODES.O)
     @Test
     fun gives_enabled_child_three_slot_button_correct_colors() {
         rule.verifyThreeSlotButtonColors(
@@ -553,6 +624,7 @@
         )
     }
 
+    @RequiresApi(Build.VERSION_CODES.O)
     @Test
     fun gives_disabled_child_three_slot_button_correct_colors() {
         rule.verifyThreeSlotButtonColors(
@@ -562,6 +634,7 @@
         )
     }
 
+    @RequiresApi(Build.VERSION_CODES.O)
     @Test
     fun gives_enabled_outlined_button_correct_border_colors() {
         val status = Status.Enabled
@@ -573,6 +646,7 @@
         )
     }
 
+    @RequiresApi(Build.VERSION_CODES.O)
     @Test
     fun gives_disabled_outlined_button_correct_border_colors() {
         val status = Status.Disabled
@@ -594,6 +668,7 @@
         )
     }
 
+    @RequiresApi(Build.VERSION_CODES.O)
     @Test
     fun overrides_enabled_outlined_button_border_color() {
         val status = Status.Enabled
@@ -615,6 +690,7 @@
         )
     }
 
+    @RequiresApi(Build.VERSION_CODES.O)
     @Test
     fun overrides_disabled_outlined_button_border_color() {
         val status = Status.Disabled
@@ -752,6 +828,7 @@
             )
     }
 
+    @RequiresApi(Build.VERSION_CODES.O)
     @Test
     fun gives_enabled_compact_button_correct_colors() {
         rule.verifyCompactButtonColors(
@@ -760,6 +837,7 @@
         )
     }
 
+    @RequiresApi(Build.VERSION_CODES.O)
     @Test
     fun gives_disabled_compact_button_correct_colors() {
         rule.verifyCompactButtonColors(
@@ -768,6 +846,7 @@
         )
     }
 
+    @RequiresApi(Build.VERSION_CODES.O)
     @Test
     fun gives_enabled_filled_tonal_compact_button_correct_colors() {
         rule.verifyCompactButtonColors(
@@ -776,6 +855,7 @@
         )
     }
 
+    @RequiresApi(Build.VERSION_CODES.O)
     @Test
     fun gives_disabled_filled_tonal_compact_button_correct_colors() {
         rule.verifyCompactButtonColors(
@@ -784,6 +864,7 @@
         )
     }
 
+    @RequiresApi(Build.VERSION_CODES.O)
     @Test
     fun gives_enabled_outlined_compact_button_correct_colors() {
         rule.verifyCompactButtonColors(
@@ -792,6 +873,7 @@
         )
     }
 
+    @RequiresApi(Build.VERSION_CODES.O)
     @Test
     fun gives_disabled_outlined_compact_button_correct_colors() {
         rule.verifyCompactButtonColors(
@@ -800,6 +882,7 @@
         )
     }
 
+    @RequiresApi(Build.VERSION_CODES.O)
     @Test
     fun gives_enabled_child_compact_button_correct_colors() {
         rule.verifyCompactButtonColors(
@@ -808,6 +891,7 @@
         )
     }
 
+    @RequiresApi(Build.VERSION_CODES.O)
     @Test
     fun gives_disabled_child_compact_button_correct_colors() {
         rule.verifyCompactButtonColors(
@@ -1228,6 +1312,7 @@
     }
 }
 
+@RequiresApi(Build.VERSION_CODES.O)
 private fun ComposeContentTestRule.verifyButtonColors(
     status: Status,
     expectedContainerColor: @Composable () -> Color,
@@ -1317,6 +1402,7 @@
     return actualContentColor
 }
 
+@RequiresApi(Build.VERSION_CODES.O)
 private fun ComposeContentTestRule.verifyThreeSlotButtonColors(
     status: Status,
     expectedColor: @Composable () -> ButtonColors,
@@ -1419,6 +1505,7 @@
     return ThreeSlotButtonColors(actualLabelColor, actualSecondaryLabelColor, actualIconColor)
 }
 
+@RequiresApi(Build.VERSION_CODES.O)
 internal fun ComposeContentTestRule.verifyButtonBorderColor(
     expectedBorderColor: @Composable () -> Color,
     content: @Composable (Modifier) -> Unit
@@ -1436,6 +1523,7 @@
     onNodeWithTag(TEST_TAG).captureToImage().assertContainsColor(finalExpectedBorderColor)
 }
 
+@RequiresApi(Build.VERSION_CODES.O)
 private fun ComposeContentTestRule.isShape(
     expectedShape: Shape,
     colors: @Composable () -> ButtonColors,
@@ -1469,6 +1557,7 @@
         )
 }
 
+@RequiresApi(Build.VERSION_CODES.O)
 private fun ComposeContentTestRule.verifyCompactButtonColors(
     status: Status,
     colors: @Composable () -> ButtonColors
diff --git a/wear/compose/compose-material3/src/androidTest/kotlin/androidx/wear/compose/material3/CardTest.kt b/wear/compose/compose-material3/src/androidTest/kotlin/androidx/wear/compose/material3/CardTest.kt
index 62c88b3..98b8213 100644
--- a/wear/compose/compose-material3/src/androidTest/kotlin/androidx/wear/compose/material3/CardTest.kt
+++ b/wear/compose/compose-material3/src/androidTest/kotlin/androidx/wear/compose/material3/CardTest.kt
@@ -16,6 +16,8 @@
 
 package androidx.wear.compose.material3
 
+import android.os.Build
+import androidx.annotation.RequiresApi
 import androidx.compose.foundation.background
 import androidx.compose.foundation.layout.Box
 import androidx.compose.foundation.layout.fillMaxSize
@@ -540,6 +542,7 @@
         assertEquals(expectedTitleColor, actualTitleColor)
     }
 
+    @RequiresApi(Build.VERSION_CODES.O)
     @Test
     fun outlined_card_has_outlined_border_and_transparent() {
         val outlineColor = Color.Red
@@ -563,6 +566,7 @@
             .assertColorInPercentageRange(testBackground, 93f..97f)
     }
 
+    @RequiresApi(Build.VERSION_CODES.O)
     @Test
     fun outlined_titlecard_has_outlined_border_and_transparent() {
         val outlineColor = Color.Red
@@ -588,6 +592,7 @@
             .assertColorInPercentageRange(testBackground, 93f..97f)
     }
 
+    @RequiresApi(Build.VERSION_CODES.O)
     @Test
     fun outlined_appcard_has_outlined_border_and_transparent() {
         val outlineColor = Color.Red
@@ -691,6 +696,7 @@
         assertEquals(expectedContentTextStyle, actuaContentTextStyle)
     }
 
+    @RequiresApi(Build.VERSION_CODES.O)
     @Test
     fun outlined_app_card_gives_correct_text_style_base() {
         var actualAppTextStyle = TextStyle.Default
diff --git a/wear/compose/compose-material3/src/androidTest/kotlin/androidx/wear/compose/material3/CheckboxButtonTest.kt b/wear/compose/compose-material3/src/androidTest/kotlin/androidx/wear/compose/material3/CheckboxButtonTest.kt
index 0c34439..3b4f228 100644
--- a/wear/compose/compose-material3/src/androidTest/kotlin/androidx/wear/compose/material3/CheckboxButtonTest.kt
+++ b/wear/compose/compose-material3/src/androidTest/kotlin/androidx/wear/compose/material3/CheckboxButtonTest.kt
@@ -16,6 +16,8 @@
 
 package androidx.wear.compose.material3
 
+import android.os.Build
+import androidx.annotation.RequiresApi
 import androidx.compose.foundation.background
 import androidx.compose.foundation.layout.Box
 import androidx.compose.foundation.layout.BoxScope
@@ -549,6 +551,7 @@
         Assert.assertEquals(2, secondaryLabelMaxLines)
     }
 
+    @RequiresApi(Build.VERSION_CODES.O)
     @Test
     fun checkbox_button_allows_checked_background_color_override() =
         verifyToggleButtonBackgroundColor(
@@ -557,6 +560,7 @@
             expectedColor = CHECKED_COLOR
         )
 
+    @RequiresApi(Build.VERSION_CODES.O)
     @Test
     fun checkbox_button_allows_unchecked_background_color_override() =
         verifyToggleButtonBackgroundColor(
@@ -565,6 +569,7 @@
             expectedColor = UNCHECKED_COLOR
         )
 
+    @RequiresApi(Build.VERSION_CODES.O)
     @Test
     fun split_checkbox_button_allows_checked_background_color_override() =
         verifySplitToggleButtonBackgroundColor(
@@ -573,6 +578,7 @@
             expectedColor = CHECKED_COLOR
         )
 
+    @RequiresApi(Build.VERSION_CODES.O)
     @Test
     fun split_checkbox_button_allows_unchecked_background_color_override() =
         verifySplitToggleButtonBackgroundColor(
@@ -581,46 +587,55 @@
             expectedColor = UNCHECKED_COLOR
         )
 
+    @RequiresApi(Build.VERSION_CODES.O)
     @Test
     fun verify_checkbox_button_colors_enabled_and_checked() {
         rule.verifyCheckboxButtonColors(checked = true, enabled = true)
     }
 
+    @RequiresApi(Build.VERSION_CODES.O)
     @Test
     fun verify_checkbox_button_colors_enabled_and_unchecked() {
         rule.verifyCheckboxButtonColors(checked = false, enabled = true)
     }
 
+    @RequiresApi(Build.VERSION_CODES.O)
     @Test
     fun verify_checkbox_button_colors_disabled_and_checked() {
         rule.verifyCheckboxButtonColors(checked = true, enabled = false)
     }
 
+    @RequiresApi(Build.VERSION_CODES.O)
     @Test
     fun verify_checkbox_button_colors_disabled_and_unchecked() {
         rule.verifyCheckboxButtonColors(checked = false, enabled = false)
     }
 
+    @RequiresApi(Build.VERSION_CODES.O)
     @Test
     fun verify_split_checkbox_button_colors_enabled_and_checked() {
         rule.verifySplitCheckboxButtonColors(checked = true, enabled = true)
     }
 
+    @RequiresApi(Build.VERSION_CODES.O)
     @Test
     fun verify_split_checkbox_button_colors_enabled_and_unchecked() {
         rule.verifySplitCheckboxButtonColors(checked = false, enabled = true)
     }
 
+    @RequiresApi(Build.VERSION_CODES.O)
     @Test
     fun verify_split_checkbox_button_colors_disabled_and_checked() {
         rule.verifySplitCheckboxButtonColors(checked = true, enabled = false)
     }
 
+    @RequiresApi(Build.VERSION_CODES.O)
     @Test
     fun verify_split_checkbox_button_colors_disabled_and_unchecked() {
         rule.verifySplitCheckboxButtonColors(checked = false, enabled = false)
     }
 
+    @RequiresApi(Build.VERSION_CODES.O)
     @Test
     fun checkbox_checked_colors_are_customisable() {
         val boxColor = Color.Green
@@ -643,6 +658,7 @@
         checkboxImage.assertContainsColor(checkmarkColor)
     }
 
+    @RequiresApi(Build.VERSION_CODES.O)
     @Test
     fun checkbox_unchecked_colors_are_customisable() {
         // NB checkmark is erased during animation, so we don't test uncheckedCheckmarkColor
@@ -664,6 +680,7 @@
         checkboxImage.assertContainsColor(boxColor)
     }
 
+    @RequiresApi(Build.VERSION_CODES.O)
     @Test
     fun disabled_checkbox_checked_colors_are_customisable() {
         val boxColor = Color.Green
@@ -686,6 +703,7 @@
         checkboxImage.assertContainsColor(checkmarkColor)
     }
 
+    @RequiresApi(Build.VERSION_CODES.O)
     @Test
     fun disabled_checkbox_unchecked_colors_are_customisable() {
         // NB checkmark is erased during animation, so we don't test uncheckedCheckmarkColor
@@ -707,6 +725,7 @@
         checkboxImage.assertContainsColor(boxColor)
     }
 
+    @RequiresApi(Build.VERSION_CODES.O)
     private fun verifyToggleButtonBackgroundColor(
         checked: Boolean,
         enabled: Boolean,
@@ -729,6 +748,7 @@
         rule.onNodeWithTag(TEST_TAG).captureToImage().assertContainsColor(expectedColor)
     }
 
+    @RequiresApi(Build.VERSION_CODES.O)
     private fun verifySplitToggleButtonBackgroundColor(
         checked: Boolean,
         enabled: Boolean,
@@ -797,6 +817,7 @@
         toggleContentDescription = "description",
     )
 
+@RequiresApi(Build.VERSION_CODES.O)
 private fun ComposeContentTestRule.verifyCheckboxButtonColors(enabled: Boolean, checked: Boolean) {
     val testBackgroundColor = Color.White
     var expectedContainerColor = Color.Transparent
@@ -836,6 +857,7 @@
         )
 }
 
+@RequiresApi(Build.VERSION_CODES.O)
 private fun ComposeContentTestRule.verifySplitCheckboxButtonColors(
     enabled: Boolean,
     checked: Boolean
diff --git a/wear/compose/compose-material3/src/androidTest/kotlin/androidx/wear/compose/material3/CurvedTextTest.kt b/wear/compose/compose-material3/src/androidTest/kotlin/androidx/wear/compose/material3/CurvedTextTest.kt
index 2d16628..f42a497 100644
--- a/wear/compose/compose-material3/src/androidTest/kotlin/androidx/wear/compose/material3/CurvedTextTest.kt
+++ b/wear/compose/compose-material3/src/androidTest/kotlin/androidx/wear/compose/material3/CurvedTextTest.kt
@@ -16,6 +16,8 @@
 
 package androidx.wear.compose.material3
 
+import android.os.Build
+import androidx.annotation.RequiresApi
 import androidx.compose.runtime.CompositionLocalProvider
 import androidx.compose.testutils.assertContainsColor
 import androidx.compose.testutils.assertDoesNotContainColor
@@ -35,6 +37,7 @@
 
 @SmallTest
 @RunWith(AndroidJUnit4::class)
+@RequiresApi(Build.VERSION_CODES.O)
 class CurvedTextTest {
     @get:Rule val rule = createComposeRule()
 
diff --git a/wear/compose/compose-material3/src/androidTest/kotlin/androidx/wear/compose/material3/DatePickerScreenshotTest.kt b/wear/compose/compose-material3/src/androidTest/kotlin/androidx/wear/compose/material3/DatePickerScreenshotTest.kt
index fba9409..057cf19 100644
--- a/wear/compose/compose-material3/src/androidTest/kotlin/androidx/wear/compose/material3/DatePickerScreenshotTest.kt
+++ b/wear/compose/compose-material3/src/androidTest/kotlin/androidx/wear/compose/material3/DatePickerScreenshotTest.kt
@@ -17,6 +17,7 @@
 package androidx.wear.compose.material3
 
 import android.os.Build
+import androidx.annotation.RequiresApi
 import androidx.compose.runtime.Composable
 import androidx.compose.runtime.CompositionLocalProvider
 import androidx.compose.testutils.assertAgainstGolden
@@ -307,6 +308,7 @@
             )
             .onFirst()
 
+    @RequiresApi(Build.VERSION_CODES.O)
     private fun ComposeContentTestRule.verifyDatePickerScreenshot(
         testName: TestName,
         screenshotRule: AndroidXScreenshotTestRule,
diff --git a/wear/compose/compose-material3/src/androidTest/kotlin/androidx/wear/compose/material3/IconToggleButtonTest.kt b/wear/compose/compose-material3/src/androidTest/kotlin/androidx/wear/compose/material3/IconToggleButtonTest.kt
index 0d321cd..374863e 100644
--- a/wear/compose/compose-material3/src/androidTest/kotlin/androidx/wear/compose/material3/IconToggleButtonTest.kt
+++ b/wear/compose/compose-material3/src/androidTest/kotlin/androidx/wear/compose/material3/IconToggleButtonTest.kt
@@ -16,6 +16,8 @@
 
 package androidx.wear.compose.material3
 
+import android.os.Build
+import androidx.annotation.RequiresApi
 import androidx.compose.foundation.background
 import androidx.compose.foundation.layout.Box
 import androidx.compose.foundation.layout.fillMaxSize
@@ -239,6 +241,7 @@
         rule.onNodeWithTag(TEST_TAG).assertIsOff().performClick().assertIsOff()
     }
 
+    @RequiresApi(Build.VERSION_CODES.O)
     @Test
     fun is_circular_under_ltr() =
         rule.isShape(
@@ -255,6 +258,7 @@
             )
         }
 
+    @RequiresApi(Build.VERSION_CODES.O)
     @Test
     fun is_circular_under_rtl() =
         rule.isShape(
@@ -271,6 +275,7 @@
             )
         }
 
+    @RequiresApi(Build.VERSION_CODES.O)
     @Test
     fun allows_shape_overrides() =
         rule.isShape(
@@ -384,6 +389,7 @@
             )
         }
 
+    @RequiresApi(Build.VERSION_CODES.O)
     @Test
     fun gives_checked_primary_colors() =
         rule.verifyIconToggleButtonColors(
@@ -394,6 +400,7 @@
             contentColor = { MaterialTheme.colorScheme.onPrimary }
         )
 
+    @RequiresApi(Build.VERSION_CODES.O)
     @Test
     fun gives_unchecked_surface_colors() =
         rule.verifyIconToggleButtonColors(
@@ -404,6 +411,7 @@
             contentColor = { MaterialTheme.colorScheme.onSurfaceVariant }
         )
 
+    @RequiresApi(Build.VERSION_CODES.O)
     @Test
     fun gives_disabled_unchecked_surface_colors_with_alpha() =
         rule.verifyIconToggleButtonColors(
@@ -416,6 +424,7 @@
             contentColor = { MaterialTheme.colorScheme.onSurface.toDisabledColor() }
         )
 
+    @RequiresApi(Build.VERSION_CODES.O)
     @Test
     fun gives_disabled_primary_checked_contrasting_content_color() =
         rule.verifyIconToggleButtonColors(
@@ -428,6 +437,7 @@
             contentColor = { MaterialTheme.colorScheme.onSurface.toDisabledColor() },
         )
 
+    @RequiresApi(Build.VERSION_CODES.O)
     @Test
     fun allows_custom_checked_background_override() {
         val overrideColor = Color.Yellow
@@ -445,6 +455,7 @@
         )
     }
 
+    @RequiresApi(Build.VERSION_CODES.O)
     @Test
     fun allows_custom_checked_content_override() {
         val overrideColor = Color.Green
@@ -460,6 +471,7 @@
         )
     }
 
+    @RequiresApi(Build.VERSION_CODES.O)
     @Test
     fun allows_custom_unchecked_background_override() {
         val overrideColor = Color.Red
@@ -477,6 +489,7 @@
         )
     }
 
+    @RequiresApi(Build.VERSION_CODES.O)
     @Test
     fun allows_custom_unchecked_content_override() {
         val overrideColor = Color.Green
@@ -494,6 +507,7 @@
         )
     }
 
+    @RequiresApi(Build.VERSION_CODES.O)
     @Test
     fun allows_custom_checked_disabled_background_override() {
         val overrideColor = Color.Yellow
@@ -512,6 +526,7 @@
         )
     }
 
+    @RequiresApi(Build.VERSION_CODES.O)
     @Test
     fun allows_custom_checked_disabled_content_override() {
         val overrideColor = Color.Green
@@ -532,6 +547,7 @@
         )
     }
 
+    @RequiresApi(Build.VERSION_CODES.O)
     @Test
     fun allows_custom_unchecked_disabled_background_override() {
         val overrideColor = Color.Red
@@ -550,6 +566,7 @@
         )
     }
 
+    @RequiresApi(Build.VERSION_CODES.O)
     @Test
     fun allows_custom_unchecked_disabled_content_override() {
         val overrideColor = Color.Green
@@ -606,6 +623,7 @@
             .assert(SemanticsMatcher.expectValue(SemanticsProperties.Role, overrideRole))
     }
 
+    @RequiresApi(Build.VERSION_CODES.O)
     @Test
     fun animates_corners_to_75_percent_on_click() {
         val uncheckedShape = RoundedCornerShape(20.dp)
@@ -641,6 +659,7 @@
         }
     }
 
+    @RequiresApi(Build.VERSION_CODES.O)
     @Test
     fun changes_unchecked_to_checked_shape_on_click() {
         val uncheckedShape = RoundedCornerShape(20.dp)
@@ -664,6 +683,7 @@
         }
     }
 
+    @RequiresApi(Build.VERSION_CODES.O)
     @Test
     fun changes_checked_to_unchecked_shape_on_click() {
         val uncheckedShape = RoundedCornerShape(10.dp)
@@ -688,6 +708,7 @@
         }
     }
 
+    @RequiresApi(Build.VERSION_CODES.O)
     @Test
     fun changes_to_unchecked_pressed_shape_when_pressed_on_unchecked() {
         val uncheckedShape = RoundedCornerShape(20.dp)
@@ -720,6 +741,7 @@
         }
     }
 
+    @RequiresApi(Build.VERSION_CODES.O)
     @Test
     fun changes_to_checked_pressed_shape_when_pressed_on_checked() {
         val uncheckedShape = RoundedCornerShape(10.dp)
@@ -752,6 +774,7 @@
         }
     }
 
+    @RequiresApi(Build.VERSION_CODES.O)
     private fun ComposeContentTestRule.verifyIconToggleButtonColors(
         status: Status,
         checked: Boolean,
@@ -778,6 +801,7 @@
         )
     }
 
+    @RequiresApi(Build.VERSION_CODES.O)
     @Test
     fun changes_unchecked_to_checked_shape_when_checked_changed() {
         val uncheckedShape = RoundedCornerShape(20.dp)
@@ -802,6 +826,7 @@
         )
     }
 
+    @RequiresApi(Build.VERSION_CODES.O)
     @Test
     fun changes_checked_to_unchecked_shape_when_checked_changed() {
         val uncheckedShape = RoundedCornerShape(20.dp)
@@ -833,6 +858,7 @@
             .value
     }
 
+    @RequiresApi(Build.VERSION_CODES.O)
     private fun ComposeContentTestRule.isShape(
         shape: Shape = CircleShape,
         layoutDirection: LayoutDirection,
@@ -863,6 +889,7 @@
             )
     }
 
+    @RequiresApi(Build.VERSION_CODES.O)
     private fun ComposeContentTestRule.verifyColors(
         expectedContainerColor: @Composable () -> Color,
         expectedContentColor: @Composable () -> Color,
@@ -884,6 +911,7 @@
         onNodeWithTag(TEST_TAG).captureToImage().assertContainsColor(finalExpectedContainerColor)
     }
 
+    @RequiresApi(Build.VERSION_CODES.O)
     private fun ComposeContentTestRule.verifyCheckedStateChange(
         updateState: () -> Unit,
         startShape: Shape,
diff --git a/wear/compose/compose-material3/src/androidTest/kotlin/androidx/wear/compose/material3/LevelIndicatorTest.kt b/wear/compose/compose-material3/src/androidTest/kotlin/androidx/wear/compose/material3/LevelIndicatorTest.kt
index bda423d..4645acf 100644
--- a/wear/compose/compose-material3/src/androidTest/kotlin/androidx/wear/compose/material3/LevelIndicatorTest.kt
+++ b/wear/compose/compose-material3/src/androidTest/kotlin/androidx/wear/compose/material3/LevelIndicatorTest.kt
@@ -16,6 +16,8 @@
 
 package androidx.wear.compose.material3
 
+import android.os.Build
+import androidx.annotation.RequiresApi
 import androidx.compose.foundation.background
 import androidx.compose.foundation.layout.Box
 import androidx.compose.foundation.layout.fillMaxSize
@@ -46,6 +48,7 @@
         rule.onNodeWithTag(TEST_TAG).assertExists()
     }
 
+    @RequiresApi(Build.VERSION_CODES.O)
     @Test
     fun gives_indicator_correct_color() {
         var expectedColor: Color = Color.Unspecified
@@ -58,6 +61,7 @@
         rule.onNodeWithTag(TEST_TAG).captureToImage().assertContainsColor(expectedColor)
     }
 
+    @RequiresApi(Build.VERSION_CODES.O)
     @Test
     fun gives_track_correct_color() {
         var expectedColor: Color = Color.Unspecified
@@ -70,6 +74,7 @@
         rule.onNodeWithTag(TEST_TAG).captureToImage().assertContainsColor(expectedColor)
     }
 
+    @RequiresApi(Build.VERSION_CODES.O)
     @Test
     fun gives_indicator_custom_color() {
         val customColor = Color.Red
@@ -84,6 +89,7 @@
         rule.onNodeWithTag(TEST_TAG).captureToImage().assertContainsColor(customColor)
     }
 
+    @RequiresApi(Build.VERSION_CODES.O)
     @Test
     fun gives_track_custom_color() {
         val customColor = Color.Red
diff --git a/wear/compose/compose-material3/src/androidTest/kotlin/androidx/wear/compose/material3/Material3Test.kt b/wear/compose/compose-material3/src/androidTest/kotlin/androidx/wear/compose/material3/Material3Test.kt
index d990dc1a..5b334ce 100644
--- a/wear/compose/compose-material3/src/androidTest/kotlin/androidx/wear/compose/material3/Material3Test.kt
+++ b/wear/compose/compose-material3/src/androidTest/kotlin/androidx/wear/compose/material3/Material3Test.kt
@@ -17,13 +17,14 @@
 package androidx.wear.compose.material3
 
 import android.content.res.Configuration
+import android.os.Build
+import androidx.annotation.RequiresApi
 import androidx.compose.foundation.Image
 import androidx.compose.foundation.background
 import androidx.compose.foundation.layout.Arrangement
 import androidx.compose.foundation.layout.Box
 import androidx.compose.foundation.layout.BoxScope
 import androidx.compose.foundation.layout.Column
-import androidx.compose.foundation.layout.fillMaxHeight
 import androidx.compose.foundation.layout.fillMaxSize
 import androidx.compose.foundation.layout.size
 import androidx.compose.foundation.layout.sizeIn
@@ -178,9 +179,7 @@
 
 @Composable
 fun CenteredText(text: String) {
-    Column(modifier = Modifier.fillMaxHeight(), verticalArrangement = Arrangement.Center) {
-        Text(text)
-    }
+    Column(verticalArrangement = Arrangement.Center) { Text(text) }
 }
 
 fun ComposeContentTestRule.setContentWithThemeForSizeAssertions(
@@ -242,6 +241,7 @@
     onNodeWithTag(TEST_TAG).assertHeightIsEqualTo(expectedSize).assertWidthIsEqualTo(expectedSize)
 }
 
+@RequiresApi(Build.VERSION_CODES.O)
 internal fun ComposeContentTestRule.verifyColors(
     status: Status,
     expectedContainerColor: @Composable () -> Color,
@@ -376,6 +376,7 @@
     }
 }
 
+@RequiresApi(Build.VERSION_CODES.O)
 internal fun ComposeContentTestRule.verifyScreenshot(
     methodName: String,
     screenshotRule: AndroidXScreenshotTestRule,
@@ -396,6 +397,7 @@
     onNodeWithTag(testTag).captureToImage().assertAgainstGolden(screenshotRule, methodName)
 }
 
+@RequiresApi(Build.VERSION_CODES.O)
 fun ComposeContentTestRule.verifyRoundedButtonTapAnimationEnd(
     baseShape: RoundedCornerShape,
     pressedShape: RoundedCornerShape,
diff --git a/wear/compose/compose-material3/src/androidTest/kotlin/androidx/wear/compose/material3/PageIndicatorTest.kt b/wear/compose/compose-material3/src/androidTest/kotlin/androidx/wear/compose/material3/PageIndicatorTest.kt
index 84d54f5..203c279 100644
--- a/wear/compose/compose-material3/src/androidTest/kotlin/androidx/wear/compose/material3/PageIndicatorTest.kt
+++ b/wear/compose/compose-material3/src/androidTest/kotlin/androidx/wear/compose/material3/PageIndicatorTest.kt
@@ -16,6 +16,8 @@
 
 package androidx.wear.compose.material3
 
+import android.os.Build
+import androidx.annotation.RequiresApi
 import androidx.compose.testutils.assertContainsColor
 import androidx.compose.testutils.assertDoesNotContainColor
 import androidx.compose.ui.Modifier
@@ -33,6 +35,7 @@
 import org.junit.Rule
 import org.junit.Test
 
+@RequiresApi(Build.VERSION_CODES.O)
 class PageIndicatorTest {
     @get:Rule val rule = createComposeRule()
 
diff --git a/wear/compose/compose-material3/src/androidTest/kotlin/androidx/wear/compose/material3/PlaceholderTest.kt b/wear/compose/compose-material3/src/androidTest/kotlin/androidx/wear/compose/material3/PlaceholderTest.kt
index e98e268..3234616 100644
--- a/wear/compose/compose-material3/src/androidTest/kotlin/androidx/wear/compose/material3/PlaceholderTest.kt
+++ b/wear/compose/compose-material3/src/androidTest/kotlin/androidx/wear/compose/material3/PlaceholderTest.kt
@@ -16,6 +16,8 @@
 
 package androidx.wear.compose.material3
 
+import android.os.Build
+import androidx.annotation.RequiresApi
 import androidx.compose.foundation.layout.fillMaxWidth
 import androidx.compose.runtime.Composable
 import androidx.compose.runtime.LaunchedEffect
@@ -41,6 +43,7 @@
 import org.junit.Rule
 import org.junit.Test
 
+@RequiresApi(Build.VERSION_CODES.O)
 class PlaceholderTest {
     @get:Rule val rule = createComposeRule()
 
diff --git a/wear/compose/compose-material3/src/androidTest/kotlin/androidx/wear/compose/material3/RadioButtonTest.kt b/wear/compose/compose-material3/src/androidTest/kotlin/androidx/wear/compose/material3/RadioButtonTest.kt
index 44d9c68..4b6a973 100644
--- a/wear/compose/compose-material3/src/androidTest/kotlin/androidx/wear/compose/material3/RadioButtonTest.kt
+++ b/wear/compose/compose-material3/src/androidTest/kotlin/androidx/wear/compose/material3/RadioButtonTest.kt
@@ -16,6 +16,8 @@
 
 package androidx.wear.compose.material3
 
+import android.os.Build
+import androidx.annotation.RequiresApi
 import androidx.compose.foundation.layout.BoxScope
 import androidx.compose.foundation.layout.Column
 import androidx.compose.foundation.layout.RowScope
@@ -583,6 +585,7 @@
         Assert.assertEquals(2, secondaryLabelMaxLines)
     }
 
+    @RequiresApi(Build.VERSION_CODES.O)
     @Test
     fun radio_button_allows_checked_background_color_override() =
         verifyRadioButtonBackgroundColor(
@@ -591,6 +594,7 @@
             expectedColor = SELECTED_COLOR
         )
 
+    @RequiresApi(Build.VERSION_CODES.O)
     @Test
     fun radio_button_allows_unchecked_background_color_override() =
         verifyRadioButtonBackgroundColor(
@@ -599,6 +603,7 @@
             expectedColor = UNSELECTED_COLOR
         )
 
+    @RequiresApi(Build.VERSION_CODES.O)
     @Test
     fun split_radio_button_allows_checked_background_color_override() =
         verifySplitRadioButtonBackgroundColor(
@@ -607,6 +612,7 @@
             expectedColor = SELECTED_COLOR
         )
 
+    @RequiresApi(Build.VERSION_CODES.O)
     @Test
     fun split_radio_button_allows_unchecked_background_color_override() =
         verifySplitRadioButtonBackgroundColor(
@@ -615,6 +621,7 @@
             expectedColor = UNSELECTED_COLOR
         )
 
+    @RequiresApi(Build.VERSION_CODES.O)
     private fun verifyRadioButtonBackgroundColor(
         selected: Boolean,
         enabled: Boolean,
@@ -637,6 +644,7 @@
         rule.onNodeWithTag(TEST_TAG).captureToImage().assertContainsColor(expectedColor)
     }
 
+    @RequiresApi(Build.VERSION_CODES.O)
     private fun verifySplitRadioButtonBackgroundColor(
         selected: Boolean,
         enabled: Boolean,
diff --git a/wear/compose/compose-material3/src/androidTest/kotlin/androidx/wear/compose/material3/ScrollAwayTest.kt b/wear/compose/compose-material3/src/androidTest/kotlin/androidx/wear/compose/material3/ScrollAwayTest.kt
index 9bcedf1..90674cb 100644
--- a/wear/compose/compose-material3/src/androidTest/kotlin/androidx/wear/compose/material3/ScrollAwayTest.kt
+++ b/wear/compose/compose-material3/src/androidTest/kotlin/androidx/wear/compose/material3/ScrollAwayTest.kt
@@ -16,6 +16,8 @@
 
 package androidx.wear.compose.material3
 
+import android.os.Build
+import androidx.annotation.RequiresApi
 import androidx.compose.foundation.ScrollState
 import androidx.compose.foundation.background
 import androidx.compose.foundation.layout.Box
@@ -59,6 +61,7 @@
 class ScrollAwayTest {
     @get:Rule val rule = createComposeRule()
 
+    @RequiresApi(Build.VERSION_CODES.O)
     @Test
     fun showsTimeTextWithScalingLazyColumnInitially() {
         val timeTextColor = Color.Red
@@ -89,6 +92,7 @@
         rule.onNodeWithTag(TIME_TEXT_TAG).assertIsDisplayed()
     }
 
+    @RequiresApi(Build.VERSION_CODES.O)
     @Test
     fun showsTimeTextWithLazyColumnInitially() {
         val timeTextColor = Color.Red
@@ -101,6 +105,7 @@
         rule.onNodeWithTag(TEST_TAG).captureToImage().assertContainsColor(timeTextColor)
     }
 
+    @RequiresApi(Build.VERSION_CODES.O)
     @Test
     fun showsTimeTextWithColumnInitially() {
         val timeTextColor = Color.Red
@@ -113,6 +118,7 @@
         rule.onNodeWithTag(TEST_TAG).captureToImage().assertContainsColor(timeTextColor)
     }
 
+    @RequiresApi(Build.VERSION_CODES.O)
     @Test
     fun hidesTimeTextAfterScrollingScalingLazyColumn() {
         val timeTextColor = Color.Red
@@ -130,6 +136,7 @@
         rule.onNodeWithTag(TEST_TAG).captureToImage().assertDoesNotContainColor(timeTextColor)
     }
 
+    @RequiresApi(Build.VERSION_CODES.O)
     @Test
     fun hidesTimeTextWithLazyColumn() {
         val timeTextColor = Color.Red
@@ -152,6 +159,7 @@
         rule.onNodeWithTag(TEST_TAG).captureToImage().assertDoesNotContainColor(timeTextColor)
     }
 
+    @RequiresApi(Build.VERSION_CODES.O)
     @Test
     fun hidesTimeTextWithColumn() {
         val timeTextColor = Color.Red
diff --git a/wear/compose/compose-material3/src/androidTest/kotlin/androidx/wear/compose/material3/SwitchButtonTest.kt b/wear/compose/compose-material3/src/androidTest/kotlin/androidx/wear/compose/material3/SwitchButtonTest.kt
index f9dd312..ec60445 100644
--- a/wear/compose/compose-material3/src/androidTest/kotlin/androidx/wear/compose/material3/SwitchButtonTest.kt
+++ b/wear/compose/compose-material3/src/androidTest/kotlin/androidx/wear/compose/material3/SwitchButtonTest.kt
@@ -16,6 +16,8 @@
 
 package androidx.wear.compose.material3
 
+import android.os.Build
+import androidx.annotation.RequiresApi
 import androidx.compose.foundation.background
 import androidx.compose.foundation.layout.Box
 import androidx.compose.foundation.layout.BoxScope
@@ -545,6 +547,7 @@
         Assert.assertEquals(2, secondaryLabelMaxLines)
     }
 
+    @RequiresApi(Build.VERSION_CODES.O)
     @Test
     fun switch_button_allows_checked_background_color_override() =
         verifySwitchButtonBackgroundColor(
@@ -553,6 +556,7 @@
             expectedColor = CHECKED_COLOR
         )
 
+    @RequiresApi(Build.VERSION_CODES.O)
     @Test
     fun switch_button_allows_unchecked_background_color_override() =
         verifySwitchButtonBackgroundColor(
@@ -561,6 +565,7 @@
             expectedColor = UNCHECKED_COLOR
         )
 
+    @RequiresApi(Build.VERSION_CODES.O)
     @Test
     fun split_switch_button_allows_checked_background_color_override() =
         verifySplitSwitchButtonBackgroundColor(
@@ -569,6 +574,7 @@
             expectedColor = CHECKED_COLOR
         )
 
+    @RequiresApi(Build.VERSION_CODES.O)
     @Test
     fun split_switch_button_allows_unchecked_background_color_override() =
         verifySplitSwitchButtonBackgroundColor(
@@ -577,46 +583,55 @@
             expectedColor = UNCHECKED_COLOR
         )
 
+    @RequiresApi(Build.VERSION_CODES.O)
     @Test
     fun verify_switch_button_colors_enabled_and_checked() {
         rule.verifySwitchButtonColors(checked = true, enabled = true)
     }
 
+    @RequiresApi(Build.VERSION_CODES.O)
     @Test
     fun verify_switch_button_colors_enabled_and_unchecked() {
         rule.verifySwitchButtonColors(checked = false, enabled = true)
     }
 
+    @RequiresApi(Build.VERSION_CODES.O)
     @Test
     fun verify_switch_button_colors_disabled_and_checked() {
         rule.verifySwitchButtonColors(checked = true, enabled = false)
     }
 
+    @RequiresApi(Build.VERSION_CODES.O)
     @Test
     fun verify_switch_button_colors_disabled_and_unchecked() {
         rule.verifySwitchButtonColors(checked = false, enabled = false)
     }
 
+    @RequiresApi(Build.VERSION_CODES.O)
     @Test
     fun verify_split_switch_button_colors_enabled_and_checked() {
         rule.verifySplitToggleButtonColors(checked = true, enabled = true)
     }
 
+    @RequiresApi(Build.VERSION_CODES.O)
     @Test
     fun verify_split_switch_button_colors_enabled_and_unchecked() {
         rule.verifySplitToggleButtonColors(checked = false, enabled = true)
     }
 
+    @RequiresApi(Build.VERSION_CODES.O)
     @Test
     fun verify_split_switch_button_colors_disabled_and_checked() {
         rule.verifySplitToggleButtonColors(checked = true, enabled = false)
     }
 
+    @RequiresApi(Build.VERSION_CODES.O)
     @Test
     fun verify_split_toggle_button_colors_disabled_and_unchecked() {
         rule.verifySplitToggleButtonColors(checked = false, enabled = false)
     }
 
+    @RequiresApi(Build.VERSION_CODES.O)
     @Test
     fun switch_checked_colors_are_customisable() {
         val thumbColor = Color.Green
@@ -645,6 +660,7 @@
         image.assertContainsColor(trackBorderColor)
     }
 
+    @RequiresApi(Build.VERSION_CODES.O)
     @Test
     fun switch_unchecked_colors_are_customisable() {
         val thumbColor = Color.Green
@@ -672,6 +688,7 @@
         image.assertContainsColor(trackBorderColor)
     }
 
+    @RequiresApi(Build.VERSION_CODES.O)
     @Test
     fun disabled_switch_checked_colors_are_customisable() {
         val thumbColor = Color.Green
@@ -700,6 +717,7 @@
         image.assertContainsColor(trackBorderColor)
     }
 
+    @RequiresApi(Build.VERSION_CODES.O)
     @Test
     fun disabled_switch_unchecked_colors_are_customisable() {
         val thumbColor = Color.Green
@@ -724,6 +742,7 @@
         image.assertContainsColor(trackBorderColor)
     }
 
+    @RequiresApi(Build.VERSION_CODES.O)
     private fun verifySwitchButtonBackgroundColor(
         checked: Boolean,
         enabled: Boolean,
@@ -746,6 +765,7 @@
         rule.onNodeWithTag(TEST_TAG).captureToImage().assertContainsColor(expectedColor)
     }
 
+    @RequiresApi(Build.VERSION_CODES.O)
     private fun verifySplitSwitchButtonBackgroundColor(
         checked: Boolean,
         enabled: Boolean,
@@ -814,6 +834,7 @@
         toggleContentDescription = "description",
     )
 
+@RequiresApi(Build.VERSION_CODES.O)
 private fun ComposeContentTestRule.verifySwitchButtonColors(enabled: Boolean, checked: Boolean) {
     val testBackgroundColor = Color.White
     var expectedContainerColor = Color.Transparent
@@ -853,6 +874,7 @@
         )
 }
 
+@RequiresApi(Build.VERSION_CODES.O)
 private fun ComposeContentTestRule.verifySplitToggleButtonColors(
     enabled: Boolean,
     checked: Boolean
diff --git a/wear/compose/compose-material3/src/androidTest/kotlin/androidx/wear/compose/material3/TextButtonTest.kt b/wear/compose/compose-material3/src/androidTest/kotlin/androidx/wear/compose/material3/TextButtonTest.kt
index ddfc1b0..884643a 100644
--- a/wear/compose/compose-material3/src/androidTest/kotlin/androidx/wear/compose/material3/TextButtonTest.kt
+++ b/wear/compose/compose-material3/src/androidTest/kotlin/androidx/wear/compose/material3/TextButtonTest.kt
@@ -16,6 +16,8 @@
 
 package androidx.wear.compose.material3
 
+import android.os.Build
+import androidx.annotation.RequiresApi
 import androidx.compose.foundation.background
 import androidx.compose.foundation.layout.Box
 import androidx.compose.foundation.layout.padding
@@ -335,6 +337,7 @@
         }
     }
 
+    @RequiresApi(Build.VERSION_CODES.O)
     @Test
     fun default_shape_is_circular() {
         rule.isShape(
@@ -347,6 +350,7 @@
         }
     }
 
+    @RequiresApi(Build.VERSION_CODES.O)
     @Test
     fun allows_custom_shape_override() {
         val shape = CutCornerShape(4.dp)
@@ -363,6 +367,7 @@
         }
     }
 
+    @RequiresApi(Build.VERSION_CODES.O)
     @Test
     fun gives_enabled_text_button_colors() {
         rule.verifyTextButtonColors(
@@ -373,6 +378,7 @@
         )
     }
 
+    @RequiresApi(Build.VERSION_CODES.O)
     @Test
     fun gives_disabled_text_button_colors() {
         rule.verifyTextButtonColors(
@@ -385,6 +391,7 @@
         )
     }
 
+    @RequiresApi(Build.VERSION_CODES.O)
     @Test
     fun gives_enabled_filled_text_button_colors() {
         rule.verifyTextButtonColors(
@@ -395,6 +402,7 @@
         )
     }
 
+    @RequiresApi(Build.VERSION_CODES.O)
     @Test
     fun gives_disabled_filled_text_button_colors() {
         rule.verifyTextButtonColors(
@@ -409,6 +417,7 @@
         )
     }
 
+    @RequiresApi(Build.VERSION_CODES.O)
     @Test
     fun gives_enabled_filled_variant_text_button_colors() {
         rule.verifyTextButtonColors(
@@ -419,6 +428,7 @@
         )
     }
 
+    @RequiresApi(Build.VERSION_CODES.O)
     @Test
     fun gives_disabled_filled_variant_text_button_colors() {
         rule.verifyTextButtonColors(
@@ -433,6 +443,7 @@
         )
     }
 
+    @RequiresApi(Build.VERSION_CODES.O)
     @Test
     fun gives_enabled_filled_tonal_text_button_colors() {
         rule.verifyTextButtonColors(
@@ -443,6 +454,7 @@
         )
     }
 
+    @RequiresApi(Build.VERSION_CODES.O)
     @Test
     fun gives_disabled_filled_tonal_text_button_colors() {
         rule.verifyTextButtonColors(
@@ -457,6 +469,7 @@
         )
     }
 
+    @RequiresApi(Build.VERSION_CODES.O)
     @Test
     fun gives_enabled_outlined_text_button_colors() {
         rule.verifyTextButtonColors(
@@ -467,6 +480,7 @@
         )
     }
 
+    @RequiresApi(Build.VERSION_CODES.O)
     @Test
     fun gives_disabled_outlined_text_button_colors() {
         rule.verifyTextButtonColors(
@@ -479,6 +493,7 @@
         )
     }
 
+    @RequiresApi(Build.VERSION_CODES.O)
     @Test
     fun gives_enabled_outlined_text_button_correct_border_colors() {
         val status = Status.Enabled
@@ -496,6 +511,7 @@
         )
     }
 
+    @RequiresApi(Build.VERSION_CODES.O)
     @Test
     fun gives_disabled_outlined_text_button_correct_border_colors() {
         val status = Status.Disabled
@@ -515,6 +531,7 @@
         )
     }
 
+    @RequiresApi(Build.VERSION_CODES.O)
     @Test
     fun overrides_outlined_text_button_border_color() {
         val status = Status.Enabled
@@ -536,6 +553,7 @@
         )
     }
 
+    @RequiresApi(Build.VERSION_CODES.O)
     @Test
     fun animates_corners_to_75_percent_on_click() {
         val baseShape = RoundedCornerShape(20.dp)
@@ -557,6 +575,7 @@
         }
     }
 
+    @RequiresApi(Build.VERSION_CODES.O)
     private fun ComposeContentTestRule.verifyTextButtonColors(
         status: Status,
         colors: @Composable () -> TextButtonColors,
@@ -584,6 +603,7 @@
     }
 }
 
+@RequiresApi(Build.VERSION_CODES.O)
 private fun ComposeContentTestRule.isShape(
     expectedShape: Shape,
     colors: @Composable () -> TextButtonColors,
diff --git a/wear/compose/compose-material3/src/androidTest/kotlin/androidx/wear/compose/material3/TextToggleButtonTest.kt b/wear/compose/compose-material3/src/androidTest/kotlin/androidx/wear/compose/material3/TextToggleButtonTest.kt
index 0d1b67e..fae1c050 100644
--- a/wear/compose/compose-material3/src/androidTest/kotlin/androidx/wear/compose/material3/TextToggleButtonTest.kt
+++ b/wear/compose/compose-material3/src/androidTest/kotlin/androidx/wear/compose/material3/TextToggleButtonTest.kt
@@ -16,6 +16,8 @@
 
 package androidx.wear.compose.material3
 
+import android.os.Build
+import androidx.annotation.RequiresApi
 import androidx.compose.foundation.background
 import androidx.compose.foundation.layout.Box
 import androidx.compose.foundation.layout.fillMaxSize
@@ -241,6 +243,7 @@
         rule.onNodeWithTag(TEST_TAG).assertIsOff().performClick().assertIsOff()
     }
 
+    @RequiresApi(Build.VERSION_CODES.O)
     @Test
     fun is_circular_under_ltr() =
         rule.isShape(
@@ -257,6 +260,7 @@
             )
         }
 
+    @RequiresApi(Build.VERSION_CODES.O)
     @Test
     fun is_circular_under_rtl() =
         rule.isShape(
@@ -273,6 +277,7 @@
             )
         }
 
+    @RequiresApi(Build.VERSION_CODES.O)
     @Test
     fun allows_shape_overrides() =
         rule.isShape(
@@ -374,6 +379,7 @@
             )
         }
 
+    @RequiresApi(Build.VERSION_CODES.O)
     @Test
     fun gives_checked_primary_colors() =
         rule.verifyTextToggleButtonColors(
@@ -384,6 +390,7 @@
             contentColor = { MaterialTheme.colorScheme.onPrimary }
         )
 
+    @RequiresApi(Build.VERSION_CODES.O)
     @Test
     fun gives_unchecked_surface_colors() =
         rule.verifyTextToggleButtonColors(
@@ -394,6 +401,7 @@
             contentColor = { MaterialTheme.colorScheme.onSurfaceVariant }
         )
 
+    @RequiresApi(Build.VERSION_CODES.O)
     @Test
     fun gives_disabled_unchecked_surface_colors_with_alpha() =
         rule.verifyTextToggleButtonColors(
@@ -406,6 +414,7 @@
             contentColor = { MaterialTheme.colorScheme.onSurface.toDisabledColor() }
         )
 
+    @RequiresApi(Build.VERSION_CODES.O)
     @Test
     fun gives_disabled_primary_checked_contrasting_content_color() =
         rule.verifyTextToggleButtonColors(
@@ -418,6 +427,7 @@
             contentColor = { MaterialTheme.colorScheme.onSurface.toDisabledColor() },
         )
 
+    @RequiresApi(Build.VERSION_CODES.O)
     @Test
     fun allows_custom_checked_background_override() {
         val override = Color.Yellow
@@ -433,6 +443,7 @@
         )
     }
 
+    @RequiresApi(Build.VERSION_CODES.O)
     @Test
     fun allows_custom_checked_content_override() {
         val override = Color.Green
@@ -448,6 +459,7 @@
         )
     }
 
+    @RequiresApi(Build.VERSION_CODES.O)
     @Test
     fun allows_custom_unchecked_background_override() {
         val override = Color.Red
@@ -463,6 +475,7 @@
         )
     }
 
+    @RequiresApi(Build.VERSION_CODES.O)
     @Test
     fun allows_custom_unchecked_content_override() {
         val override = Color.Green
@@ -478,6 +491,7 @@
         )
     }
 
+    @RequiresApi(Build.VERSION_CODES.O)
     @Test
     fun allows_custom_checked_disabled_background_override() {
         val override = Color.Yellow
@@ -495,6 +509,7 @@
         )
     }
 
+    @RequiresApi(Build.VERSION_CODES.O)
     @Test
     fun allows_custom_checked_disabled_content_override() {
         val override = Color.Green
@@ -515,6 +530,7 @@
         )
     }
 
+    @RequiresApi(Build.VERSION_CODES.O)
     @Test
     fun allows_custom_unchecked_disabled_background_override() {
         val override = Color.Red
@@ -533,6 +549,7 @@
         )
     }
 
+    @RequiresApi(Build.VERSION_CODES.O)
     @Test
     fun allows_custom_unchecked_disabled_content_override() {
         val override = Color.Green
@@ -590,6 +607,7 @@
             .assert(SemanticsMatcher.expectValue(SemanticsProperties.Role, overrideRole))
     }
 
+    @RequiresApi(Build.VERSION_CODES.O)
     @Test
     fun animates_corners_to_75_percent_on_click() {
         val uncheckedShape = RoundedCornerShape(20.dp)
@@ -625,6 +643,7 @@
         }
     }
 
+    @RequiresApi(Build.VERSION_CODES.O)
     @Test
     fun changes_unchecked_to_checked_shape_on_click() {
         val uncheckedShape = RoundedCornerShape(20.dp)
@@ -648,6 +667,7 @@
         }
     }
 
+    @RequiresApi(Build.VERSION_CODES.O)
     @Test
     fun changes_checked_to_unchecked_shape_on_click() {
         val uncheckedShape = RoundedCornerShape(10.dp)
@@ -671,6 +691,7 @@
         }
     }
 
+    @RequiresApi(Build.VERSION_CODES.O)
     @Test
     fun changes_to_unchecked_pressed_shape_when_pressed_on_unchecked() {
         val uncheckedShape = RoundedCornerShape(20.dp)
@@ -703,6 +724,7 @@
         }
     }
 
+    @RequiresApi(Build.VERSION_CODES.O)
     @Test
     fun changes_to_checked_pressed_shape_when_pressed_on_checked() {
         val uncheckedShape = RoundedCornerShape(10.dp)
@@ -735,6 +757,7 @@
         }
     }
 
+    @RequiresApi(Build.VERSION_CODES.O)
     @Test
     fun changes_unchecked_to_checked_shape_when_checked_changed() {
         val uncheckedShape = RoundedCornerShape(20.dp)
@@ -759,6 +782,7 @@
         )
     }
 
+    @RequiresApi(Build.VERSION_CODES.O)
     @Test
     fun changes_checked_to_unchecked_shape_when_checked_changed() {
         val uncheckedShape = RoundedCornerShape(20.dp)
@@ -790,6 +814,7 @@
             .value
     }
 
+    @RequiresApi(Build.VERSION_CODES.O)
     private fun ComposeContentTestRule.verifyTextToggleButtonColors(
         status: Status,
         checked: Boolean,
@@ -816,6 +841,7 @@
         )
     }
 
+    @RequiresApi(Build.VERSION_CODES.O)
     private fun ComposeContentTestRule.isShape(
         shape: Shape = CircleShape,
         layoutDirection: LayoutDirection,
@@ -846,6 +872,7 @@
             )
     }
 
+    @RequiresApi(Build.VERSION_CODES.O)
     private fun ComposeContentTestRule.verifyColors(
         expectedContainerColor: @Composable () -> Color,
         expectedContentColor: @Composable () -> Color,
@@ -879,6 +906,7 @@
             .assertWidthIsEqualTo(expectedSize)
     }
 
+    @RequiresApi(Build.VERSION_CODES.O)
     private fun ComposeContentTestRule.verifyCheckedStateChange(
         updateState: () -> Unit,
         startShape: Shape,
diff --git a/wear/compose/compose-material3/src/androidTest/kotlin/androidx/wear/compose/material3/TimePickerScreenshotTest.kt b/wear/compose/compose-material3/src/androidTest/kotlin/androidx/wear/compose/material3/TimePickerScreenshotTest.kt
index 1e80a24..3511aa3 100644
--- a/wear/compose/compose-material3/src/androidTest/kotlin/androidx/wear/compose/material3/TimePickerScreenshotTest.kt
+++ b/wear/compose/compose-material3/src/androidTest/kotlin/androidx/wear/compose/material3/TimePickerScreenshotTest.kt
@@ -17,6 +17,7 @@
 package androidx.wear.compose.material3
 
 import android.os.Build
+import androidx.annotation.RequiresApi
 import androidx.compose.runtime.Composable
 import androidx.compose.testutils.assertAgainstGolden
 import androidx.compose.ui.Modifier
@@ -138,6 +139,7 @@
             }
         )
 
+    @RequiresApi(Build.VERSION_CODES.O)
     private fun ComposeContentTestRule.verifyTimePickerScreenshot(
         methodName: String,
         screenshotRule: AndroidXScreenshotTestRule,
diff --git a/wear/compose/compose-material3/src/main/java/androidx/wear/compose/material3/Button.kt b/wear/compose/compose-material3/src/main/java/androidx/wear/compose/material3/Button.kt
index b3a9562..dcdb65b 100644
--- a/wear/compose/compose-material3/src/main/java/androidx/wear/compose/material3/Button.kt
+++ b/wear/compose/compose-material3/src/main/java/androidx/wear/compose/material3/Button.kt
@@ -30,7 +30,6 @@
 import androidx.compose.foundation.layout.RowScope
 import androidx.compose.foundation.layout.Spacer
 import androidx.compose.foundation.layout.defaultMinSize
-import androidx.compose.foundation.layout.fillMaxHeight
 import androidx.compose.foundation.layout.fillMaxSize
 import androidx.compose.foundation.layout.height
 import androidx.compose.foundation.layout.padding
@@ -1826,7 +1825,7 @@
 
 @Composable
 private fun Modifier.buttonSizeModifier(): Modifier =
-    this.defaultMinSize(minHeight = ButtonDefaults.Height).height(IntrinsicSize.Min)
+    this.defaultMinSize(minHeight = ButtonDefaults.Height)
 
 @Composable
 private fun Modifier.compactButtonModifier(): Modifier =
@@ -1858,7 +1857,6 @@
         // want them to be able to fit their content
         modifier =
             modifier
-                .fillMaxHeight()
                 .width(intrinsicSize = IntrinsicSize.Max)
                 .container(colors.containerPainter(enabled = enabled), shape, border)
                 .combinedClickable(
diff --git a/wear/compose/compose-material3/src/main/java/androidx/wear/compose/material3/ButtonGroup.kt b/wear/compose/compose-material3/src/main/java/androidx/wear/compose/material3/ButtonGroup.kt
index 56b0729..ebfc393f 100644
--- a/wear/compose/compose-material3/src/main/java/androidx/wear/compose/material3/ButtonGroup.kt
+++ b/wear/compose/compose-material3/src/main/java/androidx/wear/compose/material3/ButtonGroup.kt
@@ -16,67 +16,53 @@
 
 package androidx.wear.compose.material3
 
+import androidx.annotation.FloatRange
 import androidx.annotation.VisibleForTesting
 import androidx.compose.animation.core.Animatable
-import androidx.compose.foundation.interaction.InteractionSource
+import androidx.compose.animation.core.AnimationSpec
+import androidx.compose.animation.core.AnimationVector1D
+import androidx.compose.foundation.interaction.MutableInteractionSource
 import androidx.compose.foundation.interaction.PressInteraction
 import androidx.compose.foundation.layout.PaddingValues
 import androidx.compose.foundation.layout.padding
 import androidx.compose.runtime.Composable
-import androidx.compose.runtime.LaunchedEffect
-import androidx.compose.runtime.mutableStateOf
 import androidx.compose.runtime.remember
-import androidx.compose.runtime.snapshotFlow
 import androidx.compose.ui.Alignment
 import androidx.compose.ui.Modifier
 import androidx.compose.ui.layout.Layout
+import androidx.compose.ui.node.ModifierNodeElement
+import androidx.compose.ui.node.ParentDataModifierNode
+import androidx.compose.ui.platform.InspectorInfo
 import androidx.compose.ui.platform.LocalDensity
+import androidx.compose.ui.unit.Density
 import androidx.compose.ui.unit.Dp
 import androidx.compose.ui.unit.dp
-import androidx.compose.ui.util.fastForEach
+import androidx.compose.ui.unit.takeOrElse
 import androidx.compose.ui.util.fastForEachIndexed
+import androidx.compose.ui.util.fastIsFinite
 import androidx.compose.ui.util.fastMap
 import androidx.compose.ui.util.fastMapIndexed
 import androidx.wear.compose.materialcore.screenHeightDp
 import kotlin.math.abs
 import kotlin.math.roundToInt
+import kotlinx.coroutines.Job
 import kotlinx.coroutines.flow.collectLatest
+import kotlinx.coroutines.flow.distinctUntilChanged
 import kotlinx.coroutines.flow.map
-import kotlinx.coroutines.flow.merge
 import kotlinx.coroutines.launch
 
-/** Scope for the children of a [ButtonGroup] */
-public class ButtonGroupScope {
-    internal val items = mutableListOf<ButtonGroupItem>()
-
-    /**
-     * Adds an item to a [ButtonGroup]
-     *
-     * @param interactionSource the interactionSource used to detect press/release events. Should be
-     *   the same one used in the content in this slot, which is typically a [Button].
-     * @param minWidth the minimum width this item can be. This will only be used if distributing
-     *   the available space results on a item falling below it's minimum width.
-     * @param weight the main way of distributing available space. In most cases, items will have a
-     *   width assigned proportional to their width (and available space). The exception is if that
-     *   will make some item(s) width fall below it's minWidth.
-     * @param content the content to use for this item. Usually, this will be one of the [Button]
-     *   variants.
-     */
-    public fun buttonGroupItem(
-        interactionSource: InteractionSource,
-        minWidth: Dp = minimumInteractiveComponentSize,
-        weight: Float = 1f,
-        content: @Composable () -> Unit
-    ): Boolean = items.add(ButtonGroupItem(interactionSource, minWidth, weight, content))
-}
-
 /**
- * Layout component to implement an expressive group of buttons, that react to touch by growing the
- * touched button, (while the neighbor(s) shrink to accommodate and keep the group width constant).
+ * Layout component to implement an expressive group of buttons in a row, that react to touch by
+ * growing the touched button, (while the neighbor(s) shrink to accommodate and keep the group width
+ * constant).
  *
  * Example of a [ButtonGroup]:
  *
  * @sample androidx.wear.compose.material3.samples.ButtonGroupSample
+ *
+ * Example of 3 buttons, the middle one bigger [ButtonGroup]:
+ *
+ * @sample androidx.wear.compose.material3.samples.ButtonGroupThreeButtonsSample
  * @param modifier Modifier to be applied to the button group
  * @param spacing the amount of spacing between buttons
  * @param expansionWidth how much buttons grow when pressed
@@ -84,7 +70,8 @@
  *   content
  * @param verticalAlignment the vertical alignment of the button group's children.
  * @param content the content and properties of each button. The Ux guidance is to use no more than
- *   3 buttons within a ButtonGroup.
+ *   3 buttons within a ButtonGroup. Note that this content is on the [ButtonGroupScope], to provide
+ *   access to 3 new modifiers to configure the buttons.
  */
 @Composable
 public fun ButtonGroup(
@@ -93,98 +80,77 @@
     expansionWidth: Dp = ButtonGroupDefaults.ExpansionWidth,
     contentPadding: PaddingValues = ButtonGroupDefaults.fullWidthPaddings(),
     verticalAlignment: Alignment.Vertical = Alignment.CenterVertically,
-    content: ButtonGroupScope.() -> Unit
+    content: @Composable ButtonGroupScope.() -> Unit
 ) {
-    val actualContent = ButtonGroupScope().apply(block = content)
-
-    val pressedStates = remember { Array(actualContent.items.size) { mutableStateOf(false) } }
-
-    val animatedSizes = remember { Array(actualContent.items.size) { Animatable(0f) } }
-
     val expandAmountPx = with(LocalDensity.current) { expansionWidth.toPx() }
 
     val downAnimSpec = MaterialTheme.motionScheme.fastSpatialSpec<Float>().faster(100f)
     val upAnimSpec = MaterialTheme.motionScheme.slowSpatialSpec<Float>()
 
-    LaunchedEffect(actualContent.items) {
-        launch {
-            val pressInteractions =
-                Array(actualContent.items.size) { mutableListOf<PressInteraction.Press>() }
-
-            merge(
-                    flows =
-                        Array(actualContent.items.size) { index ->
-                            // Annotate each flow with the item index it is related to.
-                            actualContent.items[index].interactionSource.interactions.map {
-                                interaction ->
-                                index to interaction
-                            }
-                        }
-                )
-                .collect { (index, interaction) ->
-                    when (interaction) {
-                        is PressInteraction.Press -> pressInteractions[index].add(interaction)
-                        is PressInteraction.Release ->
-                            pressInteractions[index].remove(interaction.press)
-                        is PressInteraction.Cancel ->
-                            pressInteractions[index].remove(interaction.press)
-                    }
-                    pressedStates[index].value = pressInteractions[index].isNotEmpty()
+    val scope = remember {
+        object : ButtonGroupScope {
+            override fun Modifier.weight(weight: Float): Modifier {
+                require(weight >= 0.0) {
+                    "invalid weight $weight; must be greater or equal to zero"
                 }
-        }
-
-        actualContent.items.indices.forEach { index ->
-            launch {
-                snapshotFlow { pressedStates[index].value }
-                    .collectLatest { value ->
-                        if (value) {
-                            animatedSizes[index].animateTo(expandAmountPx, downAnimSpec)
-                        } else {
-                            animatedSizes[index].animateTo(0f, upAnimSpec)
-                        }
-                    }
+                return this.then(ButtonGroupElement(weight = weight))
             }
+
+            override fun Modifier.minWidth(minWidth: Dp): Modifier {
+                require(minWidth > 0.dp) { "invalid minWidth $minWidth; must be greater than zero" }
+                return this.then(ButtonGroupElement(minWidth = minWidth))
+            }
+
+            override fun Modifier.enlargeOnPress(interactionSource: MutableInteractionSource) =
+                this.then(
+                    EnlargeOnPressElement(
+                        interactionSource = interactionSource,
+                        downAnimSpec,
+                        upAnimSpec
+                    )
+                )
         }
     }
 
-    Layout(
-        modifier = modifier.padding(contentPadding),
-        content = { actualContent.items.fastForEach { it.content() } }
-    ) { measurables, constraints ->
+    Layout(modifier = modifier.padding(contentPadding), content = { scope.content() }) {
+        measurables,
+        constraints ->
         require(constraints.hasBoundedWidth) { "ButtonGroup width cannot be unbounded." }
-        require(measurables.size == actualContent.items.size) {
-            "ButtonGroup's items have to produce exactly one composable each."
-        }
 
         val width = constraints.maxWidth
         val spacingPx = spacing.roundToPx()
 
+        val configs =
+            Array(measurables.size) {
+                measurables[it].parentData as? ButtonGroupParentData
+                    ?: ButtonGroupParentData.DEFAULT
+            }
+
+        val animatedSizes = Array(measurables.size) { configs[it].pressedState.value }
+
         // TODO: Cache this if it proves to be computationally intensive.
         val widths =
-            computeWidths(
-                actualContent.items.fastMap { it.minWidth.toPx() to it.weight },
-                spacingPx,
-                width
-            )
+            computeWidths(configs.map { it.minWidth.toPx() to it.weight }, spacingPx, width)
 
         // Add animated grow/shrink
-        if (actualContent.items.size > 1) {
-            animatedSizes.forEachIndexed { index, value ->
+        if (measurables.size > 1) {
+            for (index in measurables.indices) {
+                val value = animatedSizes[index] * expandAmountPx
                 // How much we need to grow the pressed item.
                 val growth: Int
-                if (index in 1 until animatedSizes.lastIndex) {
-                    // index is in the middle. Ensure we keep the size of the middle element with
+                if (index in 1 until measurables.lastIndex) {
+                    // index is in the middle. Ensure we keep the size of the middle item with
                     // the same parity, so its content remains in place.
-                    growth = (value.value / 2).roundToInt() * 2
+                    growth = (value / 2).roundToInt() * 2
                     widths[index - 1] -= growth / 2
                     widths[index + 1] -= growth / 2
                 } else {
-                    growth = value.value.roundToInt()
+                    growth = value.roundToInt()
                     if (index == 0) {
                         // index == 0, and we know there are at least 2 items.
                         widths[1] -= growth
                     } else {
-                        // index == animatedSizes.lastIndex, and we know there are at least 2 items.
+                        // index == measurables.lastIndex, and we know there are at least 2 items.
                         widths[index - 1] -= growth
                     }
                 }
@@ -218,6 +184,37 @@
     }
 }
 
+public interface ButtonGroupScope {
+    /**
+     * [ButtonGroup] uses a ratio of all sibling item [weight]s to assign a width to each item. The
+     * horizontal space is distributed using [weight] first, and this will only be changed if any
+     * item would be smaller than its [minWidth]. See also [Modifier.minWidth].
+     *
+     * @param weight The main way of distributing available space. This is a relative measure, and
+     *   items with no weight specified will have a default of 1f.
+     */
+    public fun Modifier.weight(
+        @FloatRange(from = 0.0, fromInclusive = false) weight: Float
+    ): Modifier
+
+    /**
+     * Specifies the minimum width this item can be, in Dp. This will only be used if distributing
+     * the available space results in a item falling below its minimum width. Note that this is only
+     * used before animations, pressing a button may result on neighbor button(s) going below their
+     * minWidth. See also [Modifier.weight]
+     *
+     * @param minWidth the minimum width. If none is specified, minimumInteractiveComponentSize is
+     *   used.
+     */
+    public fun Modifier.minWidth(minWidth: Dp = minimumInteractiveComponentSize): Modifier
+
+    /**
+     * Specifies the interaction source to use with this item. This is used to listen to events and
+     * grow/shrink the buttons in reaction.
+     */
+    public fun Modifier.enlargeOnPress(interactionSource: MutableInteractionSource): Modifier
+}
+
 /** Contains the default values used by [ButtonGroup] */
 public object ButtonGroupDefaults {
     /**
@@ -246,22 +243,160 @@
 /**
  * Data class to configure one item in a [ButtonGroup]
  *
- * @param interactionSource the interactionSource used to detect press/release events. Should be the
- *   same one used in the content in this slot, which is typically a [Button].
- * @param minWidth the minimum width this item can be. This will only be used if distributing the
- *   available space results on a item falling below it's minimum width.
  * @param weight the main way of distributing available space. In most cases, items will have a
- *   width assigned proportional to their width (and available space). The exception is if that will
- *   make some item(s) width fall below it's minWidth.
- * @param content the content to use for this item. Usually, this will be one of the [Button]
- *   variants.
+ *   width assigned proportional to their weight (and available space). The exception is if that
+ *   will make some item(s) width fall below its minWidth.
+ * @param minWidth the minimum width this item can be. This will only be used if distributing the
+ *   available space results on a item falling below its minimum width.
+ * @param pressedState an animated float between 0f and 1f that captures an animated, continuous
+ *   version of the item's interaction source pressed state.
  */
-internal data class ButtonGroupItem(
-    val interactionSource: InteractionSource,
-    val minWidth: Dp = minimumInteractiveComponentSize,
-    val weight: Float = 1f,
-    val content: @Composable () -> Unit
-)
+internal data class ButtonGroupParentData(
+    val weight: Float,
+    val minWidth: Dp,
+    val pressedState: Animatable<Float, AnimationVector1D>,
+) {
+    companion object {
+        val DEFAULT = ButtonGroupParentData(1f, minimumInteractiveComponentSize, Animatable(0f))
+    }
+}
+
+internal class ButtonGroupElement(
+    val weight: Float = Float.NaN,
+    val minWidth: Dp = Dp.Unspecified,
+) : ModifierNodeElement<ButtonGroupNode>() {
+
+    override fun create(): ButtonGroupNode {
+        return ButtonGroupNode(weight, minWidth)
+    }
+
+    override fun update(node: ButtonGroupNode) {
+        node.weight = weight
+        node.minWidth = minWidth
+    }
+
+    override fun InspectorInfo.inspectableProperties() {
+        name = "ButtonGroupElement"
+        properties["weight"] = weight
+        properties["minWidth"] = minWidth
+    }
+
+    override fun hashCode() = weight.hashCode() * 31 + minWidth.hashCode()
+
+    override fun equals(other: Any?): Boolean {
+        if (this === other) return true
+        val otherModifier = other as? ButtonGroupNode ?: return false
+        return weight == otherModifier.weight && minWidth == otherModifier.minWidth
+    }
+}
+
+internal class ButtonGroupNode(var weight: Float, var minWidth: Dp) :
+    ParentDataModifierNode, Modifier.Node() {
+    override fun Density.modifyParentData(parentData: Any?) =
+        (parentData as? ButtonGroupParentData ?: ButtonGroupParentData.DEFAULT).let { prev ->
+            ButtonGroupParentData(
+                if (weight.fastIsFinite()) weight else prev.weight,
+                minWidth.takeOrElse { prev.minWidth },
+                prev.pressedState
+            )
+        }
+}
+
+internal class EnlargeOnPressElement(
+    val interactionSource: MutableInteractionSource,
+    val downAnimSpec: AnimationSpec<Float>,
+    val upAnimSpec: AnimationSpec<Float>,
+) : ModifierNodeElement<EnlargeOnPressNode>() {
+
+    override fun create(): EnlargeOnPressNode {
+        return EnlargeOnPressNode(interactionSource, downAnimSpec, upAnimSpec)
+    }
+
+    override fun update(node: EnlargeOnPressNode) {
+        if (node.interactionSource != interactionSource) {
+            node.interactionSource = interactionSource
+            node.launchCollectionJob()
+        }
+        node.downAnimSpec = downAnimSpec
+        node.upAnimSpec = upAnimSpec
+    }
+
+    override fun InspectorInfo.inspectableProperties() {
+        name = "EnlargeOnPressElement"
+        properties["interactionSource"] = interactionSource
+        properties["downAnimSpec"] = downAnimSpec
+        properties["upAnimSpec"] = upAnimSpec
+    }
+
+    override fun hashCode() =
+        (interactionSource.hashCode() * 31 + downAnimSpec.hashCode()) * 31 + upAnimSpec.hashCode()
+
+    override fun equals(other: Any?): Boolean {
+        if (this === other) return true
+        val otherModifier = other as? EnlargeOnPressNode ?: return false
+        return interactionSource == otherModifier.interactionSource &&
+            downAnimSpec == otherModifier.downAnimSpec &&
+            upAnimSpec == otherModifier.upAnimSpec
+    }
+}
+
+internal class EnlargeOnPressNode(
+    var interactionSource: MutableInteractionSource,
+    var downAnimSpec: AnimationSpec<Float>,
+    var upAnimSpec: AnimationSpec<Float>,
+) : ParentDataModifierNode, Modifier.Node() {
+    private val pressedAnimatable: Animatable<Float, AnimationVector1D> = Animatable(0f)
+
+    private var collectionJob: Job? = null
+
+    override fun onAttach() {
+        super.onAttach()
+
+        launchCollectionJob()
+    }
+
+    override fun onDetach() {
+        super.onDetach()
+        collectionJob = null
+    }
+
+    internal fun launchCollectionJob() {
+        collectionJob?.cancel()
+        collectionJob =
+            coroutineScope.launch {
+                val pressInteractions = mutableListOf<PressInteraction.Press>()
+
+                launch {
+                    // Use collect here to ensure we don't lose any events.
+                    interactionSource.interactions
+                        .map { interaction ->
+                            when (interaction) {
+                                is PressInteraction.Press -> pressInteractions.add(interaction)
+                                is PressInteraction.Release ->
+                                    pressInteractions.remove(interaction.press)
+                                is PressInteraction.Cancel ->
+                                    pressInteractions.remove(interaction.press)
+                            }
+                            pressInteractions.isNotEmpty()
+                        }
+                        .distinctUntilChanged()
+                        .collectLatest { pressed ->
+                            if (pressed) {
+                                launch { pressedAnimatable.animateTo(1f, downAnimSpec) }
+                            } else {
+                                waitUntil { pressedAnimatable.value > 0.75f }
+                                pressedAnimatable.animateTo(0f, upAnimSpec)
+                            }
+                        }
+                }
+            }
+    }
+
+    override fun Density.modifyParentData(parentData: Any?) =
+        (parentData as? ButtonGroupParentData ?: ButtonGroupParentData.DEFAULT).let { prev ->
+            ButtonGroupParentData(prev.weight, prev.minWidth, pressedAnimatable)
+        }
+}
 
 // TODO: Does it make sense to unify these 2 classes?
 private data class ComputeHelper(
@@ -295,8 +430,8 @@
     val totalWeight = helper.map { it.weight }.sum()
 
     val extraSpace = availableWidth - minSpaceNeeded
-    // TODO: should we really handle the totalWeight <= 0 case? If so, we need to leave items at
-    //  their minWidth and center the whole thing?
+    // TODO: should we really handle the totalWeight <= 0 case? If so, we need to leave items
+    // at their minWidth and center the whole thing?
     if (totalWeight > 0) {
         for (ix in helper.indices) {
             // Initial distribution ignores minWidth.
@@ -312,9 +447,11 @@
     // Sort them. We will have:
     // * Items with weight == 0 and less width required (usually 0)
     // * Items with weight > 0 and less width required
-    // * Items with weight > 0, sorted for the order in which they may get below their minimum width
+    // * Items with weight > 0, sorted for the order in which they may get below their
+    // minimum width
     //   as we take away space.
-    // * Items with weight == 0 and enough width (This can only happen if totalWeight == 0)
+    // * Items with weight == 0 and enough width (This can only happen if totalWeight
+    // == 0)
     helper.sortBy {
         if (it.weight == 0f) {
             if (it.width < it.minWidth) Float.MIN_VALUE else Float.MAX_VALUE
diff --git a/wear/compose/compose-material3/src/main/java/androidx/wear/compose/material3/Container.kt b/wear/compose/compose-material3/src/main/java/androidx/wear/compose/material3/Container.kt
index 74c6450..826394a 100644
--- a/wear/compose/compose-material3/src/main/java/androidx/wear/compose/material3/Container.kt
+++ b/wear/compose/compose-material3/src/main/java/androidx/wear/compose/material3/Container.kt
@@ -20,15 +20,25 @@
 import androidx.compose.foundation.background
 import androidx.compose.foundation.border
 import androidx.compose.runtime.Composable
+import androidx.compose.ui.Alignment
 import androidx.compose.ui.Modifier
 import androidx.compose.ui.draw.clip
-import androidx.compose.ui.draw.paint
+import androidx.compose.ui.geometry.Size
 import androidx.compose.ui.graphics.Color
 import androidx.compose.ui.graphics.RectangleShape
 import androidx.compose.ui.graphics.Shape
+import androidx.compose.ui.graphics.drawscope.ContentDrawScope
+import androidx.compose.ui.graphics.drawscope.translate
 import androidx.compose.ui.graphics.painter.ColorPainter
 import androidx.compose.ui.graphics.painter.Painter
 import androidx.compose.ui.layout.ContentScale
+import androidx.compose.ui.layout.times
+import androidx.compose.ui.node.DrawModifierNode
+import androidx.compose.ui.node.ModifierNodeElement
+import androidx.compose.ui.platform.InspectorInfo
+import androidx.compose.ui.unit.IntSize
+import androidx.compose.ui.util.fastIsFinite
+import androidx.compose.ui.util.fastRoundToInt
 import androidx.wear.compose.foundation.LocalReduceMotion
 import androidx.wear.compose.foundation.lazy.LocalTransformingLazyColumnItemScope
 import androidx.wear.compose.material3.lazy.scrollTransform
@@ -65,7 +75,7 @@
     return itemScope?.let { tlcScope -> scrollTransform(tlcScope, shape, painter, border) }
         ?: borderModifier
             .clip(shape = shape)
-            .paint(painter = painter, contentScale = ContentScale.Crop)
+            .paintBackground(painter = painter, contentScale = ContentScale.Crop)
 }
 
 /**
@@ -101,3 +111,97 @@
         scrollTransform(tlcScope, shape, ColorPainter(color), border)
     } ?: borderModifier.clip(shape = shape).background(color = color)
 }
+
+/**
+ * Paint the background using [Painter].
+ *
+ * This modifier simply paints the background, without modifying the size.
+ *
+ * @param painter [Painter] to be drawn by this [Modifier]
+ * @param alignment specifies alignment of the [painter] relative to content
+ * @param contentScale strategy for scaling [painter] if its size does not match the content size
+ */
+internal fun Modifier.paintBackground(
+    painter: Painter,
+    alignment: Alignment = Alignment.Center,
+    contentScale: ContentScale = ContentScale.Inside,
+) = this then PainterElement(painter = painter, alignment = alignment, contentScale = contentScale)
+
+private data class PainterElement(
+    val painter: Painter,
+    val contentScale: ContentScale,
+    var alignment: Alignment = Alignment.Center,
+) : ModifierNodeElement<PainterNode>() {
+    override fun create(): PainterNode {
+        return PainterNode(painter = painter, alignment = alignment, contentScale = contentScale)
+    }
+
+    override fun update(node: PainterNode) {
+        node.painter = painter
+    }
+
+    override fun InspectorInfo.inspectableProperties() {
+        name = "paint"
+        properties["painter"] = painter
+        properties["alignment"] = alignment
+        properties["contentScale"] = contentScale
+    }
+}
+
+private class PainterNode(
+    var painter: Painter,
+    var alignment: Alignment = Alignment.Center,
+    val contentScale: ContentScale,
+) : Modifier.Node(), DrawModifierNode {
+
+    override fun ContentDrawScope.draw() {
+        val intrinsicSize = painter.intrinsicSize
+        val srcWidth =
+            if (intrinsicSize.hasSpecifiedAndFiniteWidth()) {
+                intrinsicSize.width
+            } else {
+                size.width
+            }
+
+        val srcHeight =
+            if (intrinsicSize.hasSpecifiedAndFiniteHeight()) {
+                intrinsicSize.height
+            } else {
+                size.height
+            }
+
+        val srcSize = Size(srcWidth, srcHeight)
+        val scaledSize =
+            if (size.width != 0f && size.height != 0f) {
+                srcSize * contentScale.computeScaleFactor(srcSize, size)
+            } else {
+                Size.Zero
+            }
+
+        val alignedPosition =
+            alignment.align(
+                IntSize(scaledSize.width.fastRoundToInt(), scaledSize.height.fastRoundToInt()),
+                IntSize(size.width.fastRoundToInt(), size.height.fastRoundToInt()),
+                layoutDirection
+            )
+
+        val dx = alignedPosition.x.toFloat()
+        val dy = alignedPosition.y.toFloat()
+
+        translate(dx, dy) { with(painter) { draw(size = scaledSize) } }
+
+        // Maintain the same pattern as Modifier.drawBehind to allow chaining of DrawModifiers
+        drawContent()
+    }
+
+    private fun Size.hasSpecifiedAndFiniteWidth() = this != Size.Unspecified && width.fastIsFinite()
+
+    private fun Size.hasSpecifiedAndFiniteHeight() =
+        this != Size.Unspecified && height.fastIsFinite()
+
+    override fun toString(): String =
+        "PainterModifier(" +
+            "painter=$painter, " +
+            "alignment=$alignment, " +
+            "contentScale=$contentScale)"
+}
diff --git a/wear/compose/compose-material3/src/main/java/androidx/wear/compose/material3/DatePicker.kt b/wear/compose/compose-material3/src/main/java/androidx/wear/compose/material3/DatePicker.kt
index 2879d30..6d981e3 100644
--- a/wear/compose/compose-material3/src/main/java/androidx/wear/compose/material3/DatePicker.kt
+++ b/wear/compose/compose-material3/src/main/java/androidx/wear/compose/material3/DatePicker.kt
@@ -16,7 +16,9 @@
 
 package androidx.wear.compose.material3
 
+import android.os.Build
 import android.text.format.DateFormat
+import androidx.annotation.RequiresApi
 import androidx.compose.animation.core.Animatable
 import androidx.compose.foundation.focusable
 import androidx.compose.foundation.layout.Arrangement
@@ -96,6 +98,7 @@
  * @param datePickerType The different [DatePickerType] supported by this [DatePicker].
  * @param colors [DatePickerColors] to be applied to the DatePicker.
  */
+@RequiresApi(Build.VERSION_CODES.O)
 @Composable
 public fun DatePicker(
     initialDate: LocalDate,
@@ -696,6 +699,7 @@
         else -> arrayOf(DatePickerOption.Day, DatePickerOption.Month, DatePickerOption.Year)
     }
 
+@RequiresApi(Build.VERSION_CODES.O)
 private fun verifyDates(
     date: LocalDate,
     minDate: LocalDate,
@@ -705,6 +709,7 @@
     require(date in minDate..maxDate) { "date should lie between minDate and maxDate" }
 }
 
+@RequiresApi(Build.VERSION_CODES.O)
 private fun getMonthNames(pattern: String): List<String> {
     val monthFormatter = DateTimeFormatter.ofPattern(pattern)
     val months = 1..12
@@ -730,6 +735,7 @@
     }
 }
 
+@RequiresApi(Build.VERSION_CODES.O)
 private class DatePickerState(
     initialDate: LocalDate,
     initialDateMinYear: LocalDate?,
diff --git a/wear/compose/compose-material3/src/main/java/androidx/wear/compose/material3/PickerGroup.kt b/wear/compose/compose-material3/src/main/java/androidx/wear/compose/material3/PickerGroup.kt
index ece1094..78277fc 100644
--- a/wear/compose/compose-material3/src/main/java/androidx/wear/compose/material3/PickerGroup.kt
+++ b/wear/compose/compose-material3/src/main/java/androidx/wear/compose/material3/PickerGroup.kt
@@ -24,6 +24,7 @@
 import androidx.compose.foundation.layout.BoxScope
 import androidx.compose.runtime.Composable
 import androidx.compose.runtime.getValue
+import androidx.compose.ui.Alignment
 import androidx.compose.ui.Modifier
 import androidx.compose.ui.focus.FocusRequester
 import androidx.compose.ui.focus.focusRequester
diff --git a/wear/compose/compose-material3/src/main/java/androidx/wear/compose/material3/RoundButton.kt b/wear/compose/compose-material3/src/main/java/androidx/wear/compose/material3/RoundButton.kt
index 92016f0..13726ac 100644
--- a/wear/compose/compose-material3/src/main/java/androidx/wear/compose/material3/RoundButton.kt
+++ b/wear/compose/compose-material3/src/main/java/androidx/wear/compose/material3/RoundButton.kt
@@ -65,7 +65,6 @@
     content: @Composable BoxScope.() -> Unit,
 ) {
     val borderStroke = border(enabled)
-
     Box(
         contentAlignment = Alignment.Center,
         modifier =
@@ -158,11 +157,10 @@
                 onPressAnimationSpec = onPressAnimationSpec,
                 onReleaseAnimationSpec = onReleaseAnimationSpec
             )
-
-        Pair(finalShape, finalInteractionSource)
+        finalShape to finalInteractionSource
     } else {
         // Fallback to static uncheckedShape if no other shapes, or not animatable
-        Pair(defaultShape, interactionSource)
+        defaultShape to interactionSource
     }
 
 @Composable
@@ -195,22 +193,19 @@
 
         val finalInteractionSource = interactionSource ?: remember { MutableInteractionSource() }
 
-        val finalShape =
-            rememberAnimatedToggleRoundedCornerShape(
-                interactionSource = finalInteractionSource,
-                uncheckedCornerSize = uncheckedShape.topEnd,
-                checkedCornerSize = checkedShape.topEnd,
-                uncheckedPressedCornerSize = uncheckedPressedShape.topEnd,
-                checkedPressedCornerSize = checkedPressedShape.topEnd,
-                checked = checked,
-                onPressAnimationSpec = onPressAnimationSpec,
-                onReleaseAnimationSpec = onReleaseAnimationSpec,
-            )
-
-        Pair(finalShape, finalInteractionSource)
+        rememberAnimatedToggleRoundedCornerShape(
+            interactionSource = finalInteractionSource,
+            uncheckedCornerSize = uncheckedShape.topEnd,
+            checkedCornerSize = checkedShape.topEnd,
+            uncheckedPressedCornerSize = uncheckedPressedShape.topEnd,
+            checkedPressedCornerSize = checkedPressedShape.topEnd,
+            checked = checked,
+            onPressAnimationSpec = onPressAnimationSpec,
+            onReleaseAnimationSpec = onReleaseAnimationSpec,
+        ) to finalInteractionSource
     } else {
         // Fallback to static uncheckedShape if no other shapes, or not animatable
-        Pair(uncheckedShape, interactionSource)
+        uncheckedShape to interactionSource
     }
 }
 
diff --git a/wear/compose/compose-material3/src/main/java/androidx/wear/compose/material3/TextToggleButton.kt b/wear/compose/compose-material3/src/main/java/androidx/wear/compose/material3/TextToggleButton.kt
index 2ae6941..acd3223 100644
--- a/wear/compose/compose-material3/src/main/java/androidx/wear/compose/material3/TextToggleButton.kt
+++ b/wear/compose/compose-material3/src/main/java/androidx/wear/compose/material3/TextToggleButton.kt
@@ -39,6 +39,7 @@
 import androidx.wear.compose.material3.tokens.MotionTokens
 import androidx.wear.compose.material3.tokens.ShapeTokens
 import androidx.wear.compose.material3.tokens.TextToggleButtonTokens
+import androidx.wear.compose.materialcore.ToggleButton
 import androidx.wear.compose.materialcore.animateSelectionColor
 
 /**
@@ -110,7 +111,7 @@
             interactionSource = interactionSource
         )
 
-    androidx.wear.compose.materialcore.ToggleButton(
+    ToggleButton(
         checked = checked,
         onCheckedChange = onCheckedChange,
         modifier = modifier.minimumInteractiveComponentSize(),
diff --git a/wear/compose/compose-material3/src/main/java/androidx/wear/compose/material3/TimePicker.kt b/wear/compose/compose-material3/src/main/java/androidx/wear/compose/material3/TimePicker.kt
index 01b7923..4f2571d 100644
--- a/wear/compose/compose-material3/src/main/java/androidx/wear/compose/material3/TimePicker.kt
+++ b/wear/compose/compose-material3/src/main/java/androidx/wear/compose/material3/TimePicker.kt
@@ -16,6 +16,8 @@
 
 package androidx.wear.compose.material3
 
+import android.os.Build
+import androidx.annotation.RequiresApi
 import androidx.compose.animation.core.Animatable
 import androidx.compose.foundation.focusable
 import androidx.compose.foundation.layout.Arrangement
@@ -95,6 +97,7 @@
  *   whether to show seconds or AM/PM selector as well as hours and minutes.
  * @param colors [TimePickerColors] be applied to the TimePicker.
  */
+@RequiresApi(Build.VERSION_CODES.O)
 @Composable
 public fun TimePicker(
     initialTime: LocalTime,
@@ -593,6 +596,7 @@
 }
 
 /* Returns the picker data for the third column (AM/PM or seconds) based on the time picker type. */
+@RequiresApi(Build.VERSION_CODES.O)
 @Composable
 private fun getOptionalThirdPicker(
     timePickerType: TimePickerType,
diff --git a/wear/compose/integration-tests/demos/build.gradle b/wear/compose/integration-tests/demos/build.gradle
index 3298f37..efb8ff6 100644
--- a/wear/compose/integration-tests/demos/build.gradle
+++ b/wear/compose/integration-tests/demos/build.gradle
@@ -25,9 +25,9 @@
     compileSdk = 35
     defaultConfig {
         applicationId = "androidx.wear.compose.integration.demos"
-        minSdk = 30
-        versionCode = 63
-        versionName = "1.63"
+        minSdk = 25
+        versionCode = 64
+        versionName = "1.64"
     }
 
     buildTypes {
diff --git a/wear/compose/integration-tests/demos/src/main/java/androidx/wear/compose/integration/demos/DemoActivity.kt b/wear/compose/integration-tests/demos/src/main/java/androidx/wear/compose/integration/demos/DemoActivity.kt
index 883f184..938f23f 100644
--- a/wear/compose/integration-tests/demos/src/main/java/androidx/wear/compose/integration/demos/DemoActivity.kt
+++ b/wear/compose/integration-tests/demos/src/main/java/androidx/wear/compose/integration/demos/DemoActivity.kt
@@ -19,11 +19,13 @@
 import android.app.Activity
 import android.content.Context
 import android.content.Intent
+import android.os.Build
 import android.os.Bundle
 import android.view.View
 import androidx.activity.ComponentActivity
 import androidx.activity.OnBackPressedCallback
 import androidx.activity.OnBackPressedDispatcher
+import androidx.annotation.RequiresApi
 import androidx.compose.runtime.Composable
 import androidx.compose.runtime.DisposableEffect
 import androidx.compose.runtime.getValue
@@ -53,6 +55,7 @@
     lateinit var hostView: View
     lateinit var focusManager: FocusManager
 
+    @RequiresApi(Build.VERSION_CODES.O)
     override fun onCreate(savedInstanceState: Bundle?) {
         super.onCreate(savedInstanceState)
 
diff --git a/wear/compose/integration-tests/demos/src/main/java/androidx/wear/compose/integration/demos/MaterialDemos.kt b/wear/compose/integration-tests/demos/src/main/java/androidx/wear/compose/integration/demos/MaterialDemos.kt
index 169ba5bc..1aa5314 100644
--- a/wear/compose/integration-tests/demos/src/main/java/androidx/wear/compose/integration/demos/MaterialDemos.kt
+++ b/wear/compose/integration-tests/demos/src/main/java/androidx/wear/compose/integration/demos/MaterialDemos.kt
@@ -16,6 +16,7 @@
 
 package androidx.wear.compose.integration.demos
 
+import android.os.Build
 import androidx.compose.foundation.layout.padding
 import androidx.compose.runtime.getValue
 import androidx.compose.runtime.mutableStateOf
@@ -146,65 +147,71 @@
             ),
             DemoCategory(
                 "Picker",
-                listOf(
-                    ComposableDemo("Time HH:MM:SS") { params ->
-                        var timePickerTime by remember { mutableStateOf(LocalTime.now()) }
-                        TimePicker(
-                            onTimeConfirm = {
-                                timePickerTime = it
-                                params.navigateBack()
-                            },
-                            time = timePickerTime,
-                        )
-                    },
-                    ComposableDemo("Time 12 Hour") { params ->
-                        var timePickerTime by remember { mutableStateOf(LocalTime.now()) }
-                        TimePickerWith12HourClock(
-                            onTimeConfirm = {
-                                timePickerTime = it
-                                params.navigateBack()
-                            },
-                            time = timePickerTime,
-                        )
-                    },
-                    ComposableDemo("Date Picker") { params ->
-                        var datePickerDate by remember { mutableStateOf(LocalDate.now()) }
-                        DatePicker(
-                            onDateConfirm = {
-                                datePickerDate = it
-                                params.navigateBack()
-                            },
-                            date = datePickerDate
-                        )
-                    },
-                    ComposableDemo("From Date Picker") { params ->
-                        var datePickerDate by remember { mutableStateOf(LocalDate.now()) }
-                        DatePicker(
-                            onDateConfirm = {
-                                datePickerDate = it
-                                params.navigateBack()
-                            },
-                            date = datePickerDate,
-                            fromDate = datePickerDate
-                        )
-                    },
-                    ComposableDemo("To Date Picker") { params ->
-                        var datePickerDate by remember { mutableStateOf(LocalDate.now()) }
-                        DatePicker(
-                            onDateConfirm = {
-                                datePickerDate = it
-                                params.navigateBack()
-                            },
-                            date = datePickerDate,
-                            toDate = datePickerDate
-                        )
-                    },
-                    ComposableDemo("Simple Picker") { SimplePicker() },
-                    ComposableDemo("No gradient") { PickerWithoutGradient() },
-                    ComposableDemo("Animate picker change") { AnimateOptionChangePicker() },
-                    ComposableDemo("Sample Picker Group") { PickerGroup24Hours() },
-                    ComposableDemo("Autocentering Picker Group") { AutoCenteringPickerGroup() }
-                )
+                if (Build.VERSION.SDK_INT > 25) {
+                    listOf(
+                        ComposableDemo("Time HH:MM:SS") { params ->
+                            var timePickerTime by remember { mutableStateOf(LocalTime.now()) }
+                            TimePicker(
+                                onTimeConfirm = {
+                                    timePickerTime = it
+                                    params.navigateBack()
+                                },
+                                time = timePickerTime,
+                            )
+                        },
+                        ComposableDemo("Time 12 Hour") { params ->
+                            var timePickerTime by remember { mutableStateOf(LocalTime.now()) }
+                            TimePickerWith12HourClock(
+                                onTimeConfirm = {
+                                    timePickerTime = it
+                                    params.navigateBack()
+                                },
+                                time = timePickerTime,
+                            )
+                        },
+                        ComposableDemo("Date Picker") { params ->
+                            var datePickerDate by remember { mutableStateOf(LocalDate.now()) }
+                            DatePicker(
+                                onDateConfirm = {
+                                    datePickerDate = it
+                                    params.navigateBack()
+                                },
+                                date = datePickerDate
+                            )
+                        },
+                        ComposableDemo("From Date Picker") { params ->
+                            var datePickerDate by remember { mutableStateOf(LocalDate.now()) }
+                            DatePicker(
+                                onDateConfirm = {
+                                    datePickerDate = it
+                                    params.navigateBack()
+                                },
+                                date = datePickerDate,
+                                fromDate = datePickerDate
+                            )
+                        },
+                        ComposableDemo("To Date Picker") { params ->
+                            var datePickerDate by remember { mutableStateOf(LocalDate.now()) }
+                            DatePicker(
+                                onDateConfirm = {
+                                    datePickerDate = it
+                                    params.navigateBack()
+                                },
+                                date = datePickerDate,
+                                toDate = datePickerDate
+                            )
+                        },
+                        ComposableDemo("Simple Picker") { SimplePicker() },
+                        ComposableDemo("No gradient") { PickerWithoutGradient() },
+                        ComposableDemo("Animate picker change") { AnimateOptionChangePicker() },
+                        ComposableDemo("Sample Picker Group") { PickerGroup24Hours() },
+                        ComposableDemo("Autocentering Picker Group") { AutoCenteringPickerGroup() }
+                    )
+                } else {
+                    listOf(
+                        ComposableDemo("Simple Picker") { SimplePicker() },
+                    )
+                }
             ),
             DemoCategory(
                 "Slider",
diff --git a/wear/compose/integration-tests/demos/src/main/java/androidx/wear/compose/integration/demos/PickerDemo.kt b/wear/compose/integration-tests/demos/src/main/java/androidx/wear/compose/integration/demos/PickerDemo.kt
index 310a4b7..223bcbe 100644
--- a/wear/compose/integration-tests/demos/src/main/java/androidx/wear/compose/integration/demos/PickerDemo.kt
+++ b/wear/compose/integration-tests/demos/src/main/java/androidx/wear/compose/integration/demos/PickerDemo.kt
@@ -17,9 +17,11 @@
 package androidx.wear.compose.integration.demos
 
 import android.content.Context
+import android.os.Build
 import android.view.accessibility.AccessibilityManager
 import android.view.accessibility.AccessibilityManager.AccessibilityStateChangeListener
 import android.view.accessibility.AccessibilityManager.TouchExplorationStateChangeListener
+import androidx.annotation.RequiresApi
 import androidx.compose.animation.core.Animatable
 import androidx.compose.foundation.focusable
 import androidx.compose.foundation.layout.Arrangement
@@ -93,6 +95,7 @@
  * @param modifier the modifiers for the `Box` containing the UI elements.
  * @param time the initial value to seed the picker with.
  */
+@RequiresApi(Build.VERSION_CODES.O)
 @Composable
 public fun TimePicker(
     onTimeConfirm: (LocalTime) -> Unit,
@@ -265,6 +268,7 @@
  * @param modifier the modifiers for the `Column` containing the UI elements.
  * @param time the initial value to seed the picker with.
  */
+@RequiresApi(Build.VERSION_CODES.O)
 @Composable
 public fun TimePickerWith12HourClock(
     onTimeConfirm: (LocalTime) -> Unit,
@@ -464,6 +468,7 @@
  * @param fromDate the minimum date to be selected in picker
  * @param toDate the maximum date to be selected in picker
  */
+@RequiresApi(Build.VERSION_CODES.O)
 @Composable
 public fun DatePicker(
     onDateConfirm: (LocalDate) -> Unit,
@@ -856,17 +861,20 @@
     }
 }
 
+@RequiresApi(Build.VERSION_CODES.O)
 private fun verifyDates(date: LocalDate, fromDate: LocalDate, toDate: LocalDate) {
     require(toDate >= fromDate) { "toDate should be greater than or equal to fromDate" }
     require(date in fromDate..toDate) { "date should lie between fromDate and toDate" }
 }
 
+@RequiresApi(Build.VERSION_CODES.O)
 private fun getMonthNames(pattern: String): List<String> {
     val monthFormatter = DateTimeFormatter.ofPattern(pattern)
     val months = 1..12
     return months.map { LocalDate.of(2022, it, 1).format(monthFormatter) }
 }
 
+@RequiresApi(Build.VERSION_CODES.O)
 internal class DatePickerState
 constructor(
     private val date: LocalDate,
diff --git a/wear/compose/integration-tests/macrobenchmark-target/build.gradle b/wear/compose/integration-tests/macrobenchmark-target/build.gradle
index d10859a..dbbe105 100644
--- a/wear/compose/integration-tests/macrobenchmark-target/build.gradle
+++ b/wear/compose/integration-tests/macrobenchmark-target/build.gradle
@@ -53,4 +53,4 @@
     implementation(project(":tracing:tracing-perfetto-binary"))
 }
 
-android.defaultConfig.minSdk = 30
+android.defaultConfig.minSdk = 25
diff --git a/wear/compose/integration-tests/macrobenchmark/build.gradle b/wear/compose/integration-tests/macrobenchmark/build.gradle
index e124928..6526e1b 100644
--- a/wear/compose/integration-tests/macrobenchmark/build.gradle
+++ b/wear/compose/integration-tests/macrobenchmark/build.gradle
@@ -23,7 +23,7 @@
 android {
     compileSdk = 35
     defaultConfig {
-        minSdk = 30
+        minSdk = 29
     }
     namespace = "androidx.wear.compose.integration.macrobenchmark"
     targetProjectPath = ":wear:compose:integration-tests:macrobenchmark-target"
diff --git a/wear/protolayout/protolayout-material3/api/current.txt b/wear/protolayout/protolayout-material3/api/current.txt
index 8942afc..eae2d58 100644
--- a/wear/protolayout/protolayout-material3/api/current.txt
+++ b/wear/protolayout/protolayout-material3/api/current.txt
@@ -204,17 +204,6 @@
     method public static androidx.wear.protolayout.LayoutElementBuilders.LayoutElement textEdgeButton(androidx.wear.protolayout.material3.MaterialScope, androidx.wear.protolayout.ModifiersBuilders.Clickable onClick, optional androidx.wear.protolayout.modifiers.LayoutModifier modifier, optional androidx.wear.protolayout.material3.ButtonColors colors, kotlin.jvm.functions.Function1<? super androidx.wear.protolayout.material3.MaterialScope,? extends androidx.wear.protolayout.LayoutElementBuilders.LayoutElement> labelContent);
   }
 
-  public final class EdgeButtonStyle {
-    field public static final androidx.wear.protolayout.material3.EdgeButtonStyle.Companion Companion;
-    field public static final androidx.wear.protolayout.material3.EdgeButtonStyle DEFAULT;
-    field public static final androidx.wear.protolayout.material3.EdgeButtonStyle TOP_ALIGN;
-  }
-
-  public static final class EdgeButtonStyle.Companion {
-    property public final androidx.wear.protolayout.material3.EdgeButtonStyle DEFAULT;
-    property public final androidx.wear.protolayout.material3.EdgeButtonStyle TOP_ALIGN;
-  }
-
   public final class GraphicDataCardStyle {
     field public static final androidx.wear.protolayout.material3.GraphicDataCardStyle.Companion Companion;
   }
diff --git a/wear/protolayout/protolayout-material3/api/restricted_current.txt b/wear/protolayout/protolayout-material3/api/restricted_current.txt
index 8942afc..eae2d58 100644
--- a/wear/protolayout/protolayout-material3/api/restricted_current.txt
+++ b/wear/protolayout/protolayout-material3/api/restricted_current.txt
@@ -204,17 +204,6 @@
     method public static androidx.wear.protolayout.LayoutElementBuilders.LayoutElement textEdgeButton(androidx.wear.protolayout.material3.MaterialScope, androidx.wear.protolayout.ModifiersBuilders.Clickable onClick, optional androidx.wear.protolayout.modifiers.LayoutModifier modifier, optional androidx.wear.protolayout.material3.ButtonColors colors, kotlin.jvm.functions.Function1<? super androidx.wear.protolayout.material3.MaterialScope,? extends androidx.wear.protolayout.LayoutElementBuilders.LayoutElement> labelContent);
   }
 
-  public final class EdgeButtonStyle {
-    field public static final androidx.wear.protolayout.material3.EdgeButtonStyle.Companion Companion;
-    field public static final androidx.wear.protolayout.material3.EdgeButtonStyle DEFAULT;
-    field public static final androidx.wear.protolayout.material3.EdgeButtonStyle TOP_ALIGN;
-  }
-
-  public static final class EdgeButtonStyle.Companion {
-    property public final androidx.wear.protolayout.material3.EdgeButtonStyle DEFAULT;
-    property public final androidx.wear.protolayout.material3.EdgeButtonStyle TOP_ALIGN;
-  }
-
   public final class GraphicDataCardStyle {
     field public static final androidx.wear.protolayout.material3.GraphicDataCardStyle.Companion Companion;
   }
diff --git a/wear/protolayout/protolayout-material3/src/androidTest/java/androidx/wear/protolayout/material3/MaterialGoldenTest.kt b/wear/protolayout/protolayout-material3/src/androidTest/java/androidx/wear/protolayout/material3/MaterialGoldenTest.kt
index 12a274b..f05c1b6 100644
--- a/wear/protolayout/protolayout-material3/src/androidTest/java/androidx/wear/protolayout/material3/MaterialGoldenTest.kt
+++ b/wear/protolayout/protolayout-material3/src/androidTest/java/androidx/wear/protolayout/material3/MaterialGoldenTest.kt
@@ -33,8 +33,27 @@
         AndroidXScreenshotTestRule("wear/protolayout/protolayout-material3")
 
     @Test
-    fun test() {
-        RunnerUtils.runSingleScreenshotTest(mScreenshotRule, testCase, expected)
+    fun testLtr() {
+        // Skip test if it's not meant for LTR
+        if (!testCase.isForLtr) return
+        RunnerUtils.runSingleScreenshotTest(
+            rule = mScreenshotRule,
+            layout = testCase.layout,
+            expected = expected,
+            isRtlDirection = false
+        )
+    }
+
+    @Test
+    fun testRtl() {
+        // Skip test if it's not meant for RTL
+        if (!testCase.isForRtl) return
+        RunnerUtils.runSingleScreenshotTest(
+            rule = mScreenshotRule,
+            layout = testCase.layout,
+            expected = expected + "_rtl",
+            isRtlDirection = true
+        )
     }
 
     companion object {
diff --git a/wear/protolayout/protolayout-material3/src/androidTest/java/androidx/wear/protolayout/material3/RunnerUtils.kt b/wear/protolayout/protolayout-material3/src/androidTest/java/androidx/wear/protolayout/material3/RunnerUtils.kt
index 6bf8296..5ee111f 100644
--- a/wear/protolayout/protolayout-material3/src/androidTest/java/androidx/wear/protolayout/material3/RunnerUtils.kt
+++ b/wear/protolayout/protolayout-material3/src/androidTest/java/androidx/wear/protolayout/material3/RunnerUtils.kt
@@ -33,27 +33,9 @@
     // watch dimensions here.
     const val SCREEN_SIZE_SMALL: Int = 525 // ~199dp
 
-    fun runSingleScreenshotTest(
-        rule: AndroidXScreenshotTestRule,
-        testCase: TestCase,
-        expected: String
-    ) {
-        if (testCase.isForLtr) {
-            runSingleScreenshotTest(rule, testCase.mLayout, expected, /* isRtlDirection= */ false)
-        }
-        if (testCase.isForRtl) {
-            runSingleScreenshotTest(
-                rule,
-                testCase.mLayout,
-                expected + "_rtl",
-                /* isRtlDirection= */ true
-            )
-        }
-    }
-
     @SuppressLint("BanThreadSleep")
     // TODO: b/355417923 - Avoid calling sleep.
-    private fun runSingleScreenshotTest(
+    fun runSingleScreenshotTest(
         rule: AndroidXScreenshotTestRule,
         layout: LayoutElementBuilders.Layout,
         expected: String,
@@ -61,7 +43,7 @@
     ) {
         val layoutPayload = layout.toByteArray()
 
-        val startIntent: Intent =
+        val startIntent =
             Intent(
                 androidx.test.platform.app.InstrumentationRegistry.getInstrumentation()
                     .targetContext,
@@ -134,7 +116,7 @@
 
     /** Holds testcase parameters. */
     class TestCase(
-        val mLayout: LayoutElementBuilders.Layout,
+        val layout: LayoutElementBuilders.Layout,
         val isForRtl: Boolean,
         val isForLtr: Boolean
     )
diff --git a/wear/protolayout/protolayout-material3/src/androidTest/java/androidx/wear/protolayout/material3/TestCasesGenerator.kt b/wear/protolayout/protolayout-material3/src/androidTest/java/androidx/wear/protolayout/material3/TestCasesGenerator.kt
index 1826c42..4537676 100644
--- a/wear/protolayout/protolayout-material3/src/androidTest/java/androidx/wear/protolayout/material3/TestCasesGenerator.kt
+++ b/wear/protolayout/protolayout-material3/src/androidTest/java/androidx/wear/protolayout/material3/TestCasesGenerator.kt
@@ -23,11 +23,7 @@
 import androidx.wear.protolayout.DimensionBuilders.dp
 import androidx.wear.protolayout.DimensionBuilders.expand
 import androidx.wear.protolayout.LayoutElementBuilders
-import androidx.wear.protolayout.LayoutElementBuilders.Box
 import androidx.wear.protolayout.LayoutElementBuilders.Column
-import androidx.wear.protolayout.ModifiersBuilders.Background
-import androidx.wear.protolayout.ModifiersBuilders.Corner
-import androidx.wear.protolayout.ModifiersBuilders.Modifiers
 import androidx.wear.protolayout.expression.VersionBuilders.VersionInfo
 import androidx.wear.protolayout.material3.AppCardStyle.Companion.largeAppCardStyle
 import androidx.wear.protolayout.material3.ButtonDefaults.filledButtonColors
@@ -48,7 +44,6 @@
 import androidx.wear.protolayout.modifiers.clickable
 import androidx.wear.protolayout.modifiers.clip
 import androidx.wear.protolayout.modifiers.contentDescription
-import androidx.wear.protolayout.types.LayoutColor
 import androidx.wear.protolayout.types.layoutString
 import com.google.common.collect.ImmutableMap
 
@@ -88,14 +83,17 @@
         testCases["primarylayout_edgebuttonfilled_buttongroup_iconoverride_golden$goldenSuffix"] =
             materialScope(
                 ApplicationProvider.getApplicationContext(),
-                deviceParameters,
+                // renderer version 1.302 has no asymmetrical corner support, so edgebutton will use
+                // its fallback style
+                deviceParameters.copy(VersionInfo.Builder().setMajor(1).setMinor(302).build()),
                 allowDynamicTheme = false
             ) {
                 primaryLayoutWithOverrideIcon(
                     mainSlot = {
                         text(
-                            text = "Text in the main slot that overflows".layoutString,
-                            color = colorScheme.secondary
+                            text = "Overflow main text and fallback edge button".layoutString,
+                            color = colorScheme.secondary,
+                            maxLines = 3
                         )
                     },
                     bottomSlot = {
@@ -481,29 +479,28 @@
         testCases["primarylayout_circularprogressindicators_fallback__golden$NORMAL_SCALE_SUFFIX"] =
             materialScope(
                 ApplicationProvider.getApplicationContext(),
+                // renderer with version 1.302 has no DashedArcLine or asymmetrical corners support
                 deviceConfiguration =
-                    deviceParameters.copy(VersionInfo.Builder().setMajor(1).setMinor(402).build()),
+                    deviceParameters.copy(VersionInfo.Builder().setMajor(1).setMinor(302).build()),
                 allowDynamicTheme = false
             ) {
-                primaryLayout(mainSlot = { progressIndicatorGroup() })
+                primaryLayout(
+                    mainSlot = { progressIndicatorGroup() },
+                    bottomSlot = {
+                        iconEdgeButton(
+                            onClick = clickable,
+                            iconContent = { icon(ICON_ID) },
+                            modifier =
+                                LayoutModifier.contentDescription(CONTENT_DESCRIPTION_PLACEHOLDER),
+                            colors = filledTonalButtonColors()
+                        )
+                    }
+                )
             }
 
         return collectTestCases(testCases)
     }
 
-    private fun coloredBox(color: LayoutColor, shape: Corner) =
-        Box.Builder()
-            .setWidth(expand())
-            .setHeight(expand())
-            .setModifiers(
-                Modifiers.Builder()
-                    .setBackground(
-                        Background.Builder().setColor(color.prop).setCorner(shape).build()
-                    )
-                    .build()
-            )
-            .build()
-
     private fun collectTestCases(
         testCases: Map<String, LayoutElementBuilders.LayoutElement>
     ): ImmutableMap<String, LayoutElementBuilders.Layout> {
diff --git a/wear/protolayout/protolayout-material3/src/main/java/androidx/wear/protolayout/material3/EdgeButton.kt b/wear/protolayout/protolayout-material3/src/main/java/androidx/wear/protolayout/material3/EdgeButton.kt
index e503797..5c438b7 100644
--- a/wear/protolayout/protolayout-material3/src/main/java/androidx/wear/protolayout/material3/EdgeButton.kt
+++ b/wear/protolayout/protolayout-material3/src/main/java/androidx/wear/protolayout/material3/EdgeButton.kt
@@ -27,8 +27,10 @@
 import androidx.wear.protolayout.ModifiersBuilders.Clickable
 import androidx.wear.protolayout.ModifiersBuilders.Padding
 import androidx.wear.protolayout.ModifiersBuilders.SEMANTICS_ROLE_BUTTON
+import androidx.wear.protolayout.expression.VersionBuilders.VersionInfo
 import androidx.wear.protolayout.material3.ButtonDefaults.filledButtonColors
 import androidx.wear.protolayout.material3.EdgeButtonDefaults.BOTTOM_MARGIN_DP
+import androidx.wear.protolayout.material3.EdgeButtonDefaults.CONTAINER_HEIGHT_DP
 import androidx.wear.protolayout.material3.EdgeButtonDefaults.EDGE_BUTTON_HEIGHT_DP
 import androidx.wear.protolayout.material3.EdgeButtonDefaults.HORIZONTAL_MARGIN_PERCENT_LARGE
 import androidx.wear.protolayout.material3.EdgeButtonDefaults.HORIZONTAL_MARGIN_PERCENT_SMALL
@@ -37,8 +39,16 @@
 import androidx.wear.protolayout.material3.EdgeButtonDefaults.TEXT_SIDE_PADDING_DP
 import androidx.wear.protolayout.material3.EdgeButtonDefaults.TEXT_TOP_PADDING_DP
 import androidx.wear.protolayout.material3.EdgeButtonDefaults.TOP_CORNER_RADIUS
-import androidx.wear.protolayout.material3.EdgeButtonStyle.Companion.DEFAULT
-import androidx.wear.protolayout.material3.EdgeButtonStyle.Companion.TOP_ALIGN
+import androidx.wear.protolayout.material3.EdgeButtonFallbackDefaults.BOTTOM_MARGIN_FALLBACK_DP
+import androidx.wear.protolayout.material3.EdgeButtonFallbackDefaults.CORNER_RADIUS_FALLBACK_DP
+import androidx.wear.protolayout.material3.EdgeButtonFallbackDefaults.EDGE_BUTTON_HEIGHT_FALLBACK_DP
+import androidx.wear.protolayout.material3.EdgeButtonFallbackDefaults.ICON_SIDE_PADDING_FALLBACK_DP
+import androidx.wear.protolayout.material3.EdgeButtonFallbackDefaults.ICON_SIZE_FALLBACK_DP
+import androidx.wear.protolayout.material3.EdgeButtonFallbackDefaults.TEXT_SIDE_PADDING_FALLBACK_DP
+import androidx.wear.protolayout.material3.EdgeButtonStyle.Companion.ICON
+import androidx.wear.protolayout.material3.EdgeButtonStyle.Companion.ICON_FALLBACK
+import androidx.wear.protolayout.material3.EdgeButtonStyle.Companion.TEXT
+import androidx.wear.protolayout.material3.EdgeButtonStyle.Companion.TEXT_FALLBACK
 import androidx.wear.protolayout.modifiers.LayoutModifier
 import androidx.wear.protolayout.modifiers.background
 import androidx.wear.protolayout.modifiers.clickable
@@ -50,6 +60,7 @@
 import androidx.wear.protolayout.modifiers.semanticsRole
 import androidx.wear.protolayout.modifiers.tag
 import androidx.wear.protolayout.modifiers.toProtoLayoutModifiers
+import androidx.wear.protolayout.types.dp
 
 /**
  * ProtoLayout Material3 component edge button that offers a single slot to take an icon or similar
@@ -82,14 +93,22 @@
     modifier: LayoutModifier = LayoutModifier,
     colors: ButtonColors = filledButtonColors(),
     iconContent: (MaterialScope.() -> LayoutElement)
-): LayoutElement =
-    edgeButton(onClick = onClick, modifier = modifier, colors = colors, style = DEFAULT) {
+): LayoutElement {
+    val style =
+        if (deviceConfiguration.rendererSchemaVersion.hasAsymmetricalCornersSupport()) {
+            ICON
+        } else {
+            ICON_FALLBACK
+        }
+
+    return edgeButton(onClick = onClick, modifier = modifier, colors = colors, style = style) {
         withStyle(
                 defaultIconStyle =
-                    IconStyle(size = ICON_SIZE_DP.toDp(), tintColor = colors.iconColor)
+                    IconStyle(size = style.iconSizeDp.dp, tintColor = colors.iconColor)
             )
             .iconContent()
     }
+}
 
 /**
  * ProtoLayout Material3 component edge button that offers a single slot to take a text or similar
@@ -123,7 +142,17 @@
     colors: ButtonColors = filledButtonColors(),
     labelContent: (MaterialScope.() -> LayoutElement)
 ): LayoutElement =
-    edgeButton(onClick = onClick, modifier = modifier, colors = colors, style = TOP_ALIGN) {
+    edgeButton(
+        onClick = onClick,
+        modifier = modifier,
+        colors = colors,
+        style =
+            if (deviceConfiguration.rendererSchemaVersion.hasAsymmetricalCornersSupport()) {
+                TEXT
+            } else {
+                TEXT_FALLBACK
+            }
+    ) {
         withStyle(
                 defaultTextElementStyle =
                     TextElementStyle(
@@ -156,8 +185,8 @@
  * @param modifier Modifiers to set to this element. It's highly recommended to set a content
  *   description using [contentDescription].
  * @param style The style used for the inner content, specifying how the content should be aligned.
- *   It is recommended to use [EdgeButtonStyle.TOP_ALIGN] for long, wide content. If not set,
- *   defaults to [EdgeButtonStyle.DEFAULT] which center-aligns the content.
+ *   It is recommended to use [EdgeButtonStyle.TEXT] for long, wide content. If not set, defaults to
+ *   [EdgeButtonStyle.ICON] which center-aligns the content.
  * @param content The inner content to be put inside of this edge button.
  * @sample androidx.wear.protolayout.material3.samples.edgeButtonSampleIcon
  */
@@ -166,7 +195,7 @@
     onClick: Clickable,
     colors: ButtonColors,
     modifier: LayoutModifier = LayoutModifier,
-    style: EdgeButtonStyle = DEFAULT,
+    style: EdgeButtonStyle = ICON,
     content: MaterialScope.() -> LayoutElement
 ): LayoutElement {
     val containerWidth = deviceConfiguration.screenWidthDp.toDp()
@@ -175,50 +204,83 @@
         else HORIZONTAL_MARGIN_PERCENT_SMALL
     val edgeButtonWidth: Float =
         (100f - 2f * horizontalMarginPercent) * deviceConfiguration.screenWidthDp / 100f
-    val bottomCornerRadiusX = edgeButtonWidth / 2f
-    val bottomCornerRadiusY = EDGE_BUTTON_HEIGHT_DP - TOP_CORNER_RADIUS
 
     var mod =
         (LayoutModifier.semanticsRole(SEMANTICS_ROLE_BUTTON) then modifier)
             .clickable(onClick)
             .background(colors.containerColor)
-            .clip(TOP_CORNER_RADIUS)
-            .clipBottomLeft(bottomCornerRadiusX, bottomCornerRadiusY)
-            .clipBottomRight(bottomCornerRadiusX, bottomCornerRadiusY)
+            .clip(style.topCornerRadiusDp)
+
+    if (deviceConfiguration.rendererSchemaVersion.hasAsymmetricalCornersSupport()) {
+        val bottomCornerRadiusX = edgeButtonWidth / 2f
+        val bottomCornerRadiusY = style.buttonHeightDp - style.topCornerRadiusDp
+        mod =
+            mod.clipBottomLeft(bottomCornerRadiusX, bottomCornerRadiusY)
+                .clipBottomRight(bottomCornerRadiusX, bottomCornerRadiusY)
+    }
 
     style.padding?.let { mod = mod.padding(it) }
 
-    val button = Box.Builder().setHeight(EDGE_BUTTON_HEIGHT_DP.toDp()).setWidth(dp(edgeButtonWidth))
-    button
-        .setVerticalAlignment(style.verticalAlignment)
-        .setHorizontalAlignment(LayoutElementBuilders.HORIZONTAL_ALIGN_CENTER)
-        .addContent(content())
+    val button =
+        Box.Builder()
+            .setHeight(style.buttonHeightDp.dp)
+            .setWidth(dp(edgeButtonWidth))
+            .setVerticalAlignment(style.verticalAlignment)
+            .setHorizontalAlignment(LayoutElementBuilders.HORIZONTAL_ALIGN_CENTER)
+            .addContent(content())
+            .setModifiers(mod.toProtoLayoutModifiers())
+            .build()
 
     return Box.Builder()
-        .setHeight((EDGE_BUTTON_HEIGHT_DP + BOTTOM_MARGIN_DP).toDp())
+        .setHeight(CONTAINER_HEIGHT_DP.dp)
         .setWidth(containerWidth)
-        .setVerticalAlignment(LayoutElementBuilders.VERTICAL_ALIGN_TOP)
+        .setVerticalAlignment(LayoutElementBuilders.VERTICAL_ALIGN_BOTTOM)
         .setHorizontalAlignment(LayoutElementBuilders.HORIZONTAL_ALIGN_CENTER)
-        .addContent(button.setModifiers(mod.toProtoLayoutModifiers()).build())
-        .setModifiers(LayoutModifier.tag(METADATA_TAG).toProtoLayoutModifiers())
+        .addContent(button)
+        .setModifiers(
+            LayoutModifier.tag(METADATA_TAG)
+                .padding(padding(bottom = style.bottomMarginDp.toFloat()))
+                .toProtoLayoutModifiers()
+        )
         .build()
 }
 
-/** Provides style values for edge button component. */
-public class EdgeButtonStyle
-private constructor(
+/**
+ * Provides style values for edge button component.
+ *
+ * An [edgeButton] has a wrapper container with the screen width, and fixed height of
+ * [CONTAINER_HEIGHT_DP].
+ *
+ * The visible button box has height of [buttonHeightDp], it is centered horizontally in side the
+ * wrapper container with [HORIZONTAL_MARGIN_PERCENT_SMALL] or [HORIZONTAL_MARGIN_PERCENT_LARGE]
+ * depending on the screen size. It is then horizontally aligned to the bottom with bottom margin of
+ * [bottomMarginDp].
+ *
+ * The visible button box has its top two corners clipped with the [topCornerRadiusDp], while its
+ * bottom two corners will be clipped fully both horizontally and vertically to achieving the edge
+ * hugging shape. In the fallback implementation, without asymmetrical corners support, the
+ * [topCornerRadiusDp] is applied to all four corners.
+ *
+ * The content (icon or text) of the button is located inside the visible button box with [padding],
+ * horizontally centered and vertically aligned with the given [verticalAlignment].
+ */
+internal class EdgeButtonStyle
+internal constructor(
     @VerticalAlignment internal val verticalAlignment: Int = VERTICAL_ALIGN_CENTER,
-    internal val padding: Padding? = null
+    internal val padding: Padding? = null,
+    @Dimension(DP) internal val buttonHeightDp: Float = EDGE_BUTTON_HEIGHT_DP,
+    @Dimension(DP) internal val bottomMarginDp: Float = BOTTOM_MARGIN_DP,
+    @Dimension(DP) internal val iconSizeDp: Float = ICON_SIZE_DP,
+    @Dimension(DP) internal val topCornerRadiusDp: Float = TOP_CORNER_RADIUS
 ) {
-    public companion object {
+    internal companion object {
         /**
-         * Style variation for having content of the edge button anchored to the top.
+         * Style variation for having text content with edge hugging shape.
          *
-         * This should be used for text-like content, or the content that is wide, to accommodate
-         * for more space.
+         * The text is vertically aligned to top with [TEXT_TOP_PADDING_DP] to to accommodate for
+         * more horizontal space.
          */
-        @JvmField
-        public val TOP_ALIGN: EdgeButtonStyle =
+        internal val TEXT: EdgeButtonStyle =
             EdgeButtonStyle(
                 verticalAlignment = LayoutElementBuilders.VERTICAL_ALIGN_TOP,
                 padding =
@@ -230,28 +292,101 @@
             )
 
         /**
-         * Default style variation for having content of the edge button center aligned.
+         * Style variation for having icon content with edge hugging shape.
          *
-         * This should be used for icon-like or small, round content that doesn't occupy a lot of
-         * space.
+         * The icon is centered in the visible button box with the size of [ICON_SIZE_DP].
          */
-        @JvmField public val DEFAULT: EdgeButtonStyle = EdgeButtonStyle()
+        internal val ICON: EdgeButtonStyle = EdgeButtonStyle()
+
+        /**
+         * Style variation for fallback implementation with text content, when there is no
+         * asymmetrical corners support.
+         *
+         * Without the edge hugging shape, the [topCornerRadius] value is a full cornered value and
+         * is applied to all four corners. To avoid being clipped by the screen edge, the visible
+         * button box is pushed upwards with a bigger bottom margin of [BOTTOM_MARGIN_FALLBACK_DP].
+         * Also the box height shrinks to [EDGE_BUTTON_HEIGHT_FALLBACK_DP].
+         *
+         * Its text content is center placed with a increased horizontal padding of
+         * [TEXT_SIDE_PADDING_FALLBACK_DP].
+         */
+        internal val TEXT_FALLBACK: EdgeButtonStyle =
+            EdgeButtonStyle(
+                verticalAlignment = VERTICAL_ALIGN_CENTER,
+                padding =
+                    padding(
+                        start = TEXT_SIDE_PADDING_FALLBACK_DP,
+                        end = TEXT_SIDE_PADDING_FALLBACK_DP,
+                    ),
+                buttonHeightDp = EDGE_BUTTON_HEIGHT_FALLBACK_DP,
+                topCornerRadiusDp = CORNER_RADIUS_FALLBACK_DP,
+                bottomMarginDp = BOTTOM_MARGIN_FALLBACK_DP
+            )
+
+        /**
+         * Style variation for fallback implementation with icon content, when there is no
+         * asymmetrical corners support.
+         *
+         * Without the edge hugging shape, the [topCornerRadius] value is a full cornered value and
+         * is applied to all four corners. To avoid being clipped by the screen, the visible button
+         * box is pushed upwards with a bigger bottom margin of [BOTTOM_MARGIN_FALLBACK_DP]. Also
+         * the box height shrinks to [EDGE_BUTTON_HEIGHT_FALLBACK_DP]
+         *
+         * Its icon content center placed with increased horizontal padding
+         * [ICON_SIDE_PADDING_FALLBACK_DP]. Also, the icon size is also increased to
+         * [ICON_SIZE_FALLBACK_DP].
+         */
+        internal val ICON_FALLBACK: EdgeButtonStyle =
+            EdgeButtonStyle(
+                verticalAlignment = VERTICAL_ALIGN_CENTER,
+                padding =
+                    padding(
+                        start = ICON_SIDE_PADDING_FALLBACK_DP,
+                        end = ICON_SIDE_PADDING_FALLBACK_DP,
+                    ),
+                buttonHeightDp = EDGE_BUTTON_HEIGHT_FALLBACK_DP,
+                topCornerRadiusDp = CORNER_RADIUS_FALLBACK_DP,
+                bottomMarginDp = BOTTOM_MARGIN_FALLBACK_DP,
+                iconSizeDp = ICON_SIZE_FALLBACK_DP
+            )
     }
 }
 
 internal object EdgeButtonDefaults {
-    @Dimension(DP) internal const val TOP_CORNER_RADIUS: Float = 17f
+    @Dimension(DP) internal const val TOP_CORNER_RADIUS = 17f
     /** The horizontal margin used for width of the EdgeButton, below the 225dp breakpoint. */
-    internal const val HORIZONTAL_MARGIN_PERCENT_SMALL: Float = 24f
+    internal const val HORIZONTAL_MARGIN_PERCENT_SMALL = 24f
     /** The horizontal margin used for width of the EdgeButton, above the 225dp breakpoint. */
-    internal const val HORIZONTAL_MARGIN_PERCENT_LARGE: Float = 26f
-    internal const val BOTTOM_MARGIN_DP: Int = 3
-    internal const val EDGE_BUTTON_HEIGHT_DP: Int = 46
-    internal const val METADATA_TAG: String = "EB"
-    internal const val ICON_SIZE_DP = 24
-    internal const val TEXT_TOP_PADDING_DP = 12f
-    internal const val TEXT_SIDE_PADDING_DP = 8f
+    internal const val HORIZONTAL_MARGIN_PERCENT_LARGE = 26f
+    @Dimension(DP) internal const val BOTTOM_MARGIN_DP = 3f
+    @Dimension(DP) internal const val EDGE_BUTTON_HEIGHT_DP = 46f
+    @Dimension(DP) internal const val CONTAINER_HEIGHT_DP = EDGE_BUTTON_HEIGHT_DP + BOTTOM_MARGIN_DP
+    internal const val METADATA_TAG = "EB"
+    @Dimension(DP) internal const val ICON_SIZE_DP = 24f
+    @Dimension(DP) internal const val TEXT_TOP_PADDING_DP = 12f
+    @Dimension(DP) internal const val TEXT_SIDE_PADDING_DP = 8f
+}
+
+/**
+ * This object provides constants and styles of the fallback layout for [iconEdgeButton] and
+ * [textEdgeButton] when the renderer version is lower than 1.3.3 where asymmetrical corners support
+ * is not available.
+ */
+internal object EdgeButtonFallbackDefaults {
+    @Dimension(DP) internal const val ICON_SIZE_FALLBACK_DP = 26f
+    @Dimension(DP) internal const val EDGE_BUTTON_HEIGHT_FALLBACK_DP = 40f
+    @Dimension(DP) internal const val BOTTOM_MARGIN_FALLBACK_DP = 7f
+    @Dimension(DP)
+    internal const val CORNER_RADIUS_FALLBACK_DP = EDGE_BUTTON_HEIGHT_FALLBACK_DP / 2f
+    @Dimension(DP) internal const val TEXT_SIDE_PADDING_FALLBACK_DP = 14f
+    @Dimension(DP) internal const val ICON_SIDE_PADDING_FALLBACK_DP = 20f
 }
 
 internal fun LayoutElement.isSlotEdgeButton(): Boolean =
     this is Box && METADATA_TAG == this.modifiers?.metadata?.toTagName()
+
+/**
+ * Checks whether the renderer has support for asymmetrical corners, which is added in version
+ * 1.303.
+ */
+private fun VersionInfo.hasAsymmetricalCornersSupport() = major > 1 || (major == 1 && minor >= 303)
diff --git a/wear/protolayout/protolayout-material3/src/test/java/androidx/wear/protolayout/material3/EdgeButtonTest.kt b/wear/protolayout/protolayout-material3/src/test/java/androidx/wear/protolayout/material3/EdgeButtonTest.kt
index c8c40e5..15636ae 100644
--- a/wear/protolayout/protolayout-material3/src/test/java/androidx/wear/protolayout/material3/EdgeButtonTest.kt
+++ b/wear/protolayout/protolayout-material3/src/test/java/androidx/wear/protolayout/material3/EdgeButtonTest.kt
@@ -25,8 +25,11 @@
 import androidx.wear.protolayout.LayoutElementBuilders.Image
 import androidx.wear.protolayout.expression.AppDataKey
 import androidx.wear.protolayout.expression.DynamicBuilders.DynamicInt32
-import androidx.wear.protolayout.material3.EdgeButtonDefaults.BOTTOM_MARGIN_DP
+import androidx.wear.protolayout.expression.VersionBuilders.VersionInfo
+import androidx.wear.protolayout.material3.EdgeButtonDefaults.CONTAINER_HEIGHT_DP
 import androidx.wear.protolayout.material3.EdgeButtonDefaults.EDGE_BUTTON_HEIGHT_DP
+import androidx.wear.protolayout.material3.EdgeButtonFallbackDefaults.EDGE_BUTTON_HEIGHT_FALLBACK_DP
+import androidx.wear.protolayout.material3.EdgeButtonFallbackDefaults.ICON_SIZE_FALLBACK_DP
 import androidx.wear.protolayout.modifiers.LayoutModifier
 import androidx.wear.protolayout.modifiers.clickable
 import androidx.wear.protolayout.modifiers.contentDescription
@@ -41,6 +44,7 @@
 import androidx.wear.protolayout.testing.isClickable
 import androidx.wear.protolayout.types.LayoutString
 import androidx.wear.protolayout.types.asLayoutConstraint
+import androidx.wear.protolayout.types.dp
 import androidx.wear.protolayout.types.layoutString
 import org.junit.Test
 import org.junit.runner.RunWith
@@ -54,14 +58,14 @@
         LayoutElementAssertionsProvider(ICON_EDGE_BUTTON)
             .onRoot()
             .assert(hasWidth(DEVICE_CONFIGURATION.screenWidthDp.toDp()))
-            .assert(hasHeight((EDGE_BUTTON_HEIGHT_DP + BOTTOM_MARGIN_DP).toDp()))
+            .assert(hasHeight(CONTAINER_HEIGHT_DP.dp))
     }
 
     @Test
     fun visibleHeight() {
         LayoutElementAssertionsProvider(ICON_EDGE_BUTTON)
             .onElement(isClickable())
-            .assert(hasHeight(EDGE_BUTTON_HEIGHT_DP.toDp()))
+            .assert(hasHeight(EDGE_BUTTON_HEIGHT_DP.dp))
     }
 
     @Test
@@ -163,6 +167,29 @@
             .assert(hasColor(COLOR_SCHEME.onPrimary.staticArgb))
     }
 
+    @Test
+    fun containerFallbackSize() {
+        LayoutElementAssertionsProvider(ICON_EDGE_BUTTON_FALLBACK)
+            .onRoot()
+            .assert(hasWidth(DEVICE_CONFIGURATION.screenWidthDp.toDp()))
+            .assert(hasHeight(CONTAINER_HEIGHT_DP.dp))
+    }
+
+    @Test
+    fun visibleFallbackHeight() {
+        LayoutElementAssertionsProvider(ICON_EDGE_BUTTON_FALLBACK)
+            .onElement(isClickable())
+            .assert(hasHeight(EDGE_BUTTON_HEIGHT_FALLBACK_DP.dp))
+    }
+
+    @Test
+    fun iconFallbackSize() {
+        LayoutElementAssertionsProvider(ICON_EDGE_BUTTON_FALLBACK)
+            .onElement(hasImage(RES_ID))
+            .assert(hasWidth(ICON_SIZE_FALLBACK_DP.dp))
+            .assert(hasHeight(ICON_SIZE_FALLBACK_DP.dp))
+    }
+
     companion object {
         private val CONTEXT = getApplicationContext() as Context
         private val COLOR_SCHEME = ColorScheme()
@@ -171,6 +198,14 @@
             DeviceParametersBuilders.DeviceParameters.Builder()
                 .setScreenWidthDp(192)
                 .setScreenHeightDp(192)
+                .setRendererSchemaVersion(VersionInfo.Builder().setMajor(99).setMinor(999).build())
+                .build()
+
+        private val DEVICE_CONFIGURATION_WITH_OLD_RENDERER =
+            DeviceParametersBuilders.DeviceParameters.Builder()
+                .setScreenWidthDp(192)
+                .setScreenHeightDp(192)
+                .setRendererSchemaVersion(VersionInfo.Builder().setMajor(1).setMinor(302).build())
                 .build()
 
         private val CLICKABLE =
@@ -188,5 +223,18 @@
                     icon(RES_ID)
                 }
             }
+        private val ICON_EDGE_BUTTON_FALLBACK =
+            materialScope(
+                CONTEXT,
+                DEVICE_CONFIGURATION_WITH_OLD_RENDERER,
+                allowDynamicTheme = false
+            ) {
+                iconEdgeButton(
+                    onClick = CLICKABLE,
+                    modifier = LayoutModifier.contentDescription(CONTENT_DESCRIPTION)
+                ) {
+                    icon(RES_ID)
+                }
+            }
     }
 }
diff --git a/wear/protolayout/protolayout-proto/src/main/proto/resources.proto b/wear/protolayout/protolayout-proto/src/main/proto/resources.proto
index 7e04e8a..edfbff0 100644
--- a/wear/protolayout/protolayout-proto/src/main/proto/resources.proto
+++ b/wear/protolayout/protolayout-proto/src/main/proto/resources.proto
@@ -155,6 +155,9 @@
   //
   // If not set, the animation will play on load.</setter>
   androidx.wear.protolayout.expression.proto.DynamicFloat progress = 2;
+
+  // The trigger to start the animation.
+  Trigger start_trigger = 3;
 }
 
 // An image resource, which can be used by layouts. This holds multiple
diff --git a/wear/protolayout/protolayout/api/current.txt b/wear/protolayout/protolayout/api/current.txt
index 21886f5..da4e766 100644
--- a/wear/protolayout/protolayout/api/current.txt
+++ b/wear/protolayout/protolayout/api/current.txt
@@ -1309,12 +1309,14 @@
   @androidx.wear.protolayout.expression.RequiresSchemaVersion(major=1, minor=500) public static final class ResourceBuilders.AndroidLottieResourceByResId {
     method public androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat? getProgress();
     method @RawRes public int getRawResourceId();
+    method public androidx.wear.protolayout.TriggerBuilders.Trigger? getStartTrigger();
   }
 
   public static final class ResourceBuilders.AndroidLottieResourceByResId.Builder {
     ctor @androidx.wear.protolayout.expression.RequiresSchemaVersion(major=1, minor=500) public ResourceBuilders.AndroidLottieResourceByResId.Builder(@RawRes int);
     method public androidx.wear.protolayout.ResourceBuilders.AndroidLottieResourceByResId build();
     method @androidx.wear.protolayout.expression.RequiresSchemaVersion(major=1, minor=500) public androidx.wear.protolayout.ResourceBuilders.AndroidLottieResourceByResId.Builder setProgress(androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat);
+    method @androidx.wear.protolayout.expression.RequiresSchemaVersion(major=1, minor=500) public androidx.wear.protolayout.ResourceBuilders.AndroidLottieResourceByResId.Builder setStartTrigger(androidx.wear.protolayout.TriggerBuilders.Trigger);
   }
 
   @SuppressCompatibility @androidx.wear.protolayout.expression.ProtoLayoutExperimental @androidx.wear.protolayout.expression.RequiresSchemaVersion(major=1, minor=200) public static final class ResourceBuilders.AndroidSeekableAnimatedImageResourceByResId {
@@ -1434,6 +1436,24 @@
   public final class TriggerBuilders {
     method @androidx.wear.protolayout.expression.RequiresSchemaVersion(major=1, minor=200) public static androidx.wear.protolayout.TriggerBuilders.Trigger createOnConditionMetTrigger(androidx.wear.protolayout.expression.DynamicBuilders.DynamicBool);
     method @androidx.wear.protolayout.expression.RequiresSchemaVersion(major=1, minor=200) public static androidx.wear.protolayout.TriggerBuilders.Trigger createOnLoadTrigger();
+    method @androidx.wear.protolayout.expression.RequiresSchemaVersion(major=1, minor=200) public static androidx.wear.protolayout.TriggerBuilders.Trigger createOnVisibleOnceTrigger();
+    method @androidx.wear.protolayout.expression.RequiresSchemaVersion(major=1, minor=200) public static androidx.wear.protolayout.TriggerBuilders.Trigger createOnVisibleTrigger();
+  }
+
+  @androidx.wear.protolayout.expression.RequiresSchemaVersion(major=1, minor=200) public static final class TriggerBuilders.OnVisibleOnceTrigger implements androidx.wear.protolayout.TriggerBuilders.Trigger {
+  }
+
+  public static final class TriggerBuilders.OnVisibleOnceTrigger.Builder {
+    ctor @androidx.wear.protolayout.expression.RequiresSchemaVersion(major=1, minor=200) public TriggerBuilders.OnVisibleOnceTrigger.Builder();
+    method public androidx.wear.protolayout.TriggerBuilders.OnVisibleOnceTrigger build();
+  }
+
+  @androidx.wear.protolayout.expression.RequiresSchemaVersion(major=1, minor=200) public static final class TriggerBuilders.OnVisibleTrigger implements androidx.wear.protolayout.TriggerBuilders.Trigger {
+  }
+
+  public static final class TriggerBuilders.OnVisibleTrigger.Builder {
+    ctor @androidx.wear.protolayout.expression.RequiresSchemaVersion(major=1, minor=200) public TriggerBuilders.OnVisibleTrigger.Builder();
+    method public androidx.wear.protolayout.TriggerBuilders.OnVisibleTrigger build();
   }
 
   @androidx.wear.protolayout.expression.RequiresSchemaVersion(major=1, minor=200) public static interface TriggerBuilders.Trigger {
@@ -1527,6 +1547,10 @@
     method @androidx.wear.protolayout.expression.RequiresSchemaVersion(major=1, minor=400) public static androidx.wear.protolayout.modifiers.LayoutModifier clipTopRight(androidx.wear.protolayout.modifiers.LayoutModifier, @Dimension(unit=androidx.annotation.Dimension.Companion.DP) float x, optional @Dimension(unit=androidx.annotation.Dimension.Companion.DP) float y);
   }
 
+  public final class BorderKt {
+    method public static androidx.wear.protolayout.modifiers.LayoutModifier border(androidx.wear.protolayout.modifiers.LayoutModifier, @Dimension(unit=androidx.annotation.Dimension.Companion.DP) float width, androidx.wear.protolayout.types.LayoutColor color);
+  }
+
   public final class ClickableKt {
     method public static androidx.wear.protolayout.ModifiersBuilders.Clickable clickable();
     method public static androidx.wear.protolayout.ModifiersBuilders.Clickable clickable(optional androidx.wear.protolayout.ActionBuilders.Action action);
@@ -1557,6 +1581,10 @@
     method public static androidx.wear.protolayout.ModifiersBuilders.Modifiers toProtoLayoutModifiers(androidx.wear.protolayout.modifiers.LayoutModifier);
   }
 
+  public final class OpacityKt {
+    method @androidx.wear.protolayout.expression.RequiresSchemaVersion(major=1, minor=400) public static androidx.wear.protolayout.modifiers.LayoutModifier opacity(androidx.wear.protolayout.modifiers.LayoutModifier, @FloatRange(from=0.0, to=1.0) float staticValue, optional androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat? dynamicValue);
+  }
+
   public final class PaddingKt {
     method public static androidx.wear.protolayout.modifiers.LayoutModifier padding(androidx.wear.protolayout.modifiers.LayoutModifier, androidx.wear.protolayout.ModifiersBuilders.Padding padding);
     method public static androidx.wear.protolayout.modifiers.LayoutModifier padding(androidx.wear.protolayout.modifiers.LayoutModifier, @Dimension(unit=androidx.annotation.Dimension.Companion.DP) float all);
@@ -1572,6 +1600,10 @@
     method public static androidx.wear.protolayout.modifiers.LayoutModifier semanticsRole(androidx.wear.protolayout.modifiers.LayoutModifier, int semanticsRole);
   }
 
+  public final class VisibilityKt {
+    method @SuppressCompatibility @androidx.wear.protolayout.expression.ProtoLayoutExperimental @androidx.wear.protolayout.expression.RequiresSchemaVersion(major=1, minor=300) public static androidx.wear.protolayout.modifiers.LayoutModifier visibility(androidx.wear.protolayout.modifiers.LayoutModifier, boolean staticVisibility, optional androidx.wear.protolayout.expression.DynamicBuilders.DynamicBool? dynamicVisibility);
+  }
+
 }
 
 package androidx.wear.protolayout.types {
diff --git a/wear/protolayout/protolayout/api/restricted_current.txt b/wear/protolayout/protolayout/api/restricted_current.txt
index 21886f5..da4e766 100644
--- a/wear/protolayout/protolayout/api/restricted_current.txt
+++ b/wear/protolayout/protolayout/api/restricted_current.txt
@@ -1309,12 +1309,14 @@
   @androidx.wear.protolayout.expression.RequiresSchemaVersion(major=1, minor=500) public static final class ResourceBuilders.AndroidLottieResourceByResId {
     method public androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat? getProgress();
     method @RawRes public int getRawResourceId();
+    method public androidx.wear.protolayout.TriggerBuilders.Trigger? getStartTrigger();
   }
 
   public static final class ResourceBuilders.AndroidLottieResourceByResId.Builder {
     ctor @androidx.wear.protolayout.expression.RequiresSchemaVersion(major=1, minor=500) public ResourceBuilders.AndroidLottieResourceByResId.Builder(@RawRes int);
     method public androidx.wear.protolayout.ResourceBuilders.AndroidLottieResourceByResId build();
     method @androidx.wear.protolayout.expression.RequiresSchemaVersion(major=1, minor=500) public androidx.wear.protolayout.ResourceBuilders.AndroidLottieResourceByResId.Builder setProgress(androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat);
+    method @androidx.wear.protolayout.expression.RequiresSchemaVersion(major=1, minor=500) public androidx.wear.protolayout.ResourceBuilders.AndroidLottieResourceByResId.Builder setStartTrigger(androidx.wear.protolayout.TriggerBuilders.Trigger);
   }
 
   @SuppressCompatibility @androidx.wear.protolayout.expression.ProtoLayoutExperimental @androidx.wear.protolayout.expression.RequiresSchemaVersion(major=1, minor=200) public static final class ResourceBuilders.AndroidSeekableAnimatedImageResourceByResId {
@@ -1434,6 +1436,24 @@
   public final class TriggerBuilders {
     method @androidx.wear.protolayout.expression.RequiresSchemaVersion(major=1, minor=200) public static androidx.wear.protolayout.TriggerBuilders.Trigger createOnConditionMetTrigger(androidx.wear.protolayout.expression.DynamicBuilders.DynamicBool);
     method @androidx.wear.protolayout.expression.RequiresSchemaVersion(major=1, minor=200) public static androidx.wear.protolayout.TriggerBuilders.Trigger createOnLoadTrigger();
+    method @androidx.wear.protolayout.expression.RequiresSchemaVersion(major=1, minor=200) public static androidx.wear.protolayout.TriggerBuilders.Trigger createOnVisibleOnceTrigger();
+    method @androidx.wear.protolayout.expression.RequiresSchemaVersion(major=1, minor=200) public static androidx.wear.protolayout.TriggerBuilders.Trigger createOnVisibleTrigger();
+  }
+
+  @androidx.wear.protolayout.expression.RequiresSchemaVersion(major=1, minor=200) public static final class TriggerBuilders.OnVisibleOnceTrigger implements androidx.wear.protolayout.TriggerBuilders.Trigger {
+  }
+
+  public static final class TriggerBuilders.OnVisibleOnceTrigger.Builder {
+    ctor @androidx.wear.protolayout.expression.RequiresSchemaVersion(major=1, minor=200) public TriggerBuilders.OnVisibleOnceTrigger.Builder();
+    method public androidx.wear.protolayout.TriggerBuilders.OnVisibleOnceTrigger build();
+  }
+
+  @androidx.wear.protolayout.expression.RequiresSchemaVersion(major=1, minor=200) public static final class TriggerBuilders.OnVisibleTrigger implements androidx.wear.protolayout.TriggerBuilders.Trigger {
+  }
+
+  public static final class TriggerBuilders.OnVisibleTrigger.Builder {
+    ctor @androidx.wear.protolayout.expression.RequiresSchemaVersion(major=1, minor=200) public TriggerBuilders.OnVisibleTrigger.Builder();
+    method public androidx.wear.protolayout.TriggerBuilders.OnVisibleTrigger build();
   }
 
   @androidx.wear.protolayout.expression.RequiresSchemaVersion(major=1, minor=200) public static interface TriggerBuilders.Trigger {
@@ -1527,6 +1547,10 @@
     method @androidx.wear.protolayout.expression.RequiresSchemaVersion(major=1, minor=400) public static androidx.wear.protolayout.modifiers.LayoutModifier clipTopRight(androidx.wear.protolayout.modifiers.LayoutModifier, @Dimension(unit=androidx.annotation.Dimension.Companion.DP) float x, optional @Dimension(unit=androidx.annotation.Dimension.Companion.DP) float y);
   }
 
+  public final class BorderKt {
+    method public static androidx.wear.protolayout.modifiers.LayoutModifier border(androidx.wear.protolayout.modifiers.LayoutModifier, @Dimension(unit=androidx.annotation.Dimension.Companion.DP) float width, androidx.wear.protolayout.types.LayoutColor color);
+  }
+
   public final class ClickableKt {
     method public static androidx.wear.protolayout.ModifiersBuilders.Clickable clickable();
     method public static androidx.wear.protolayout.ModifiersBuilders.Clickable clickable(optional androidx.wear.protolayout.ActionBuilders.Action action);
@@ -1557,6 +1581,10 @@
     method public static androidx.wear.protolayout.ModifiersBuilders.Modifiers toProtoLayoutModifiers(androidx.wear.protolayout.modifiers.LayoutModifier);
   }
 
+  public final class OpacityKt {
+    method @androidx.wear.protolayout.expression.RequiresSchemaVersion(major=1, minor=400) public static androidx.wear.protolayout.modifiers.LayoutModifier opacity(androidx.wear.protolayout.modifiers.LayoutModifier, @FloatRange(from=0.0, to=1.0) float staticValue, optional androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat? dynamicValue);
+  }
+
   public final class PaddingKt {
     method public static androidx.wear.protolayout.modifiers.LayoutModifier padding(androidx.wear.protolayout.modifiers.LayoutModifier, androidx.wear.protolayout.ModifiersBuilders.Padding padding);
     method public static androidx.wear.protolayout.modifiers.LayoutModifier padding(androidx.wear.protolayout.modifiers.LayoutModifier, @Dimension(unit=androidx.annotation.Dimension.Companion.DP) float all);
@@ -1572,6 +1600,10 @@
     method public static androidx.wear.protolayout.modifiers.LayoutModifier semanticsRole(androidx.wear.protolayout.modifiers.LayoutModifier, int semanticsRole);
   }
 
+  public final class VisibilityKt {
+    method @SuppressCompatibility @androidx.wear.protolayout.expression.ProtoLayoutExperimental @androidx.wear.protolayout.expression.RequiresSchemaVersion(major=1, minor=300) public static androidx.wear.protolayout.modifiers.LayoutModifier visibility(androidx.wear.protolayout.modifiers.LayoutModifier, boolean staticVisibility, optional androidx.wear.protolayout.expression.DynamicBuilders.DynamicBool? dynamicVisibility);
+  }
+
 }
 
 package androidx.wear.protolayout.types {
diff --git a/wear/protolayout/protolayout/src/main/java/androidx/wear/protolayout/ResourceBuilders.java b/wear/protolayout/protolayout/src/main/java/androidx/wear/protolayout/ResourceBuilders.java
index 0fff0a2..a51c996 100644
--- a/wear/protolayout/protolayout/src/main/java/androidx/wear/protolayout/ResourceBuilders.java
+++ b/wear/protolayout/protolayout/src/main/java/androidx/wear/protolayout/ResourceBuilders.java
@@ -520,6 +520,15 @@
             }
         }
 
+        /** Gets the trigger to start the animation. */
+        public @Nullable Trigger getStartTrigger() {
+            if (mImpl.hasStartTrigger()) {
+                return TriggerBuilders.triggerFromProto(mImpl.getStartTrigger());
+            } else {
+                return null;
+            }
+        }
+
         /** Creates a new wrapper instance from the proto. */
         @RestrictTo(Scope.LIBRARY_GROUP)
         public static @NonNull AndroidLottieResourceByResId fromProto(
@@ -540,6 +549,8 @@
                     + getRawResourceId()
                     + ", progress="
                     + getProgress()
+                    + ", startTrigger="
+                    + getStartTrigger()
                     + "}";
         }
 
@@ -590,6 +601,13 @@
                 return this;
             }
 
+            /** Sets the trigger to start the animation. */
+            @RequiresSchemaVersion(major = 1, minor = 500)
+            public @NonNull Builder setStartTrigger(@NonNull Trigger startTrigger) {
+                mImpl.setStartTrigger(startTrigger.toTriggerProto());
+                return this;
+            }
+
             /** Builds an instance from accumulated values. */
             public @NonNull AndroidLottieResourceByResId build() {
                 return AndroidLottieResourceByResId.fromProto(mImpl.build());
diff --git a/wear/protolayout/protolayout/src/main/java/androidx/wear/protolayout/TriggerBuilders.java b/wear/protolayout/protolayout/src/main/java/androidx/wear/protolayout/TriggerBuilders.java
index 1a96d0e..d05a53c 100644
--- a/wear/protolayout/protolayout/src/main/java/androidx/wear/protolayout/TriggerBuilders.java
+++ b/wear/protolayout/protolayout/src/main/java/androidx/wear/protolayout/TriggerBuilders.java
@@ -48,6 +48,160 @@
         return new OnConditionMetTrigger.Builder().setCondition(dynamicBool).build();
     }
 
+    /**
+     * Creates a {@link Trigger} that fires *every time* the layout becomes visible.
+     *
+     * <p>As opposed to {@link #createOnLoadTrigger()}, this will wait until layout is fully visible
+     * before firing a trigger.
+     */
+    @RequiresSchemaVersion(major = 1, minor = 200)
+    public static @NonNull Trigger createOnVisibleTrigger() {
+        return new OnVisibleTrigger.Builder().build();
+    }
+
+    /**
+     * Creates a {@link Trigger} that fires the first time that layout becomes visible.
+     *
+     * <p>As opposed to {@link #createOnVisibleTrigger()}, this will only be fired the first time
+     * that the layout becomes visible.
+     */
+    @RequiresSchemaVersion(major = 1, minor = 200)
+    public static @NonNull Trigger createOnVisibleOnceTrigger() {
+        return new OnVisibleOnceTrigger.Builder().build();
+    }
+
+    /** Triggers when the layout visibility state turns from invisible to fully visible. */
+    @RequiresSchemaVersion(major = 1, minor = 200)
+    public static final class OnVisibleTrigger implements Trigger {
+        private final TriggerProto.OnVisibleTrigger mImpl;
+        private final @Nullable Fingerprint mFingerprint;
+
+        OnVisibleTrigger(TriggerProto.OnVisibleTrigger impl, @Nullable Fingerprint fingerprint) {
+            this.mImpl = impl;
+            this.mFingerprint = fingerprint;
+        }
+
+        @Override
+        @RestrictTo(Scope.LIBRARY_GROUP)
+        public @Nullable Fingerprint getFingerprint() {
+            return mFingerprint;
+        }
+
+        /** Creates a new wrapper instance from the proto. */
+        @RestrictTo(Scope.LIBRARY_GROUP)
+        public static @NonNull OnVisibleTrigger fromProto(
+                TriggerProto.@NonNull OnVisibleTrigger proto, @Nullable Fingerprint fingerprint) {
+            return new OnVisibleTrigger(proto, fingerprint);
+        }
+
+        static @NonNull OnVisibleTrigger fromProto(TriggerProto.@NonNull OnVisibleTrigger proto) {
+            return fromProto(proto, null);
+        }
+
+        /** Returns the internal proto instance. */
+        TriggerProto.@NonNull OnVisibleTrigger toProto() {
+            return mImpl;
+        }
+
+        @Override
+        @RestrictTo(Scope.LIBRARY_GROUP)
+        public TriggerProto.@NonNull Trigger toTriggerProto() {
+            return TriggerProto.Trigger.newBuilder().setOnVisibleTrigger(mImpl).build();
+        }
+
+        @Override
+        public @NonNull String toString() {
+            return "OnVisibleTrigger";
+        }
+
+        /** Builder for {@link OnVisibleTrigger}. */
+        @SuppressWarnings("HiddenSuperclass")
+        public static final class Builder implements Trigger.Builder {
+            private final TriggerProto.OnVisibleTrigger.Builder mImpl =
+                    TriggerProto.OnVisibleTrigger.newBuilder();
+            private final Fingerprint mFingerprint = new Fingerprint(1416366796);
+
+            /** Creates an instance of {@link Builder}. */
+            @RequiresSchemaVersion(major = 1, minor = 200)
+            public Builder() {}
+
+            /** Builds an instance from accumulated values. */
+            @Override
+            public @NonNull OnVisibleTrigger build() {
+                return new OnVisibleTrigger(mImpl.build(), mFingerprint);
+            }
+        }
+    }
+
+    /**
+     * Triggers only once when the layout visibility state turns from invisible to fully visible for
+     * the first time.
+     */
+    @RequiresSchemaVersion(major = 1, minor = 200)
+    public static final class OnVisibleOnceTrigger implements Trigger {
+        private final TriggerProto.OnVisibleOnceTrigger mImpl;
+        private final @Nullable Fingerprint mFingerprint;
+
+        OnVisibleOnceTrigger(
+                TriggerProto.OnVisibleOnceTrigger impl, @Nullable Fingerprint fingerprint) {
+            this.mImpl = impl;
+            this.mFingerprint = fingerprint;
+        }
+
+        @Override
+        @RestrictTo(Scope.LIBRARY_GROUP)
+        public @Nullable Fingerprint getFingerprint() {
+            return mFingerprint;
+        }
+
+        /** Creates a new wrapper instance from the proto. */
+        @RestrictTo(Scope.LIBRARY_GROUP)
+        public static @NonNull OnVisibleOnceTrigger fromProto(
+                TriggerProto.@NonNull OnVisibleOnceTrigger proto,
+                @Nullable Fingerprint fingerprint) {
+            return new OnVisibleOnceTrigger(proto, fingerprint);
+        }
+
+        static @NonNull OnVisibleOnceTrigger fromProto(
+                TriggerProto.@NonNull OnVisibleOnceTrigger proto) {
+            return fromProto(proto, null);
+        }
+
+        /** Returns the internal proto instance. */
+        TriggerProto.@NonNull OnVisibleOnceTrigger toProto() {
+            return mImpl;
+        }
+
+        @Override
+        @RestrictTo(Scope.LIBRARY_GROUP)
+        public TriggerProto.@NonNull Trigger toTriggerProto() {
+            return TriggerProto.Trigger.newBuilder().setOnVisibleOnceTrigger(mImpl).build();
+        }
+
+        @Override
+        public @NonNull String toString() {
+            return "OnVisibleOnceTrigger";
+        }
+
+        /** Builder for {@link OnVisibleOnceTrigger}. */
+        @SuppressWarnings("HiddenSuperclass")
+        public static final class Builder implements Trigger.Builder {
+            private final TriggerProto.OnVisibleOnceTrigger.Builder mImpl =
+                    TriggerProto.OnVisibleOnceTrigger.newBuilder();
+            private final Fingerprint mFingerprint = new Fingerprint(-1661457257);
+
+            /** Creates an instance of {@link Builder}. */
+            @RequiresSchemaVersion(major = 1, minor = 200)
+            public Builder() {}
+
+            /** Builds an instance from accumulated values. */
+            @Override
+            public @NonNull OnVisibleOnceTrigger build() {
+                return new OnVisibleOnceTrigger(mImpl.build(), mFingerprint);
+            }
+        }
+    }
+
     /** Triggers immediately when the layout is loaded / reloaded. */
     @RequiresSchemaVersion(major = 1, minor = 200)
     static final class OnLoadTrigger implements Trigger {
@@ -225,6 +379,12 @@
     @RestrictTo(Scope.LIBRARY_GROUP)
     public static @NonNull Trigger triggerFromProto(
             TriggerProto.@NonNull Trigger proto, @Nullable Fingerprint fingerprint) {
+        if (proto.hasOnVisibleTrigger()) {
+            return OnVisibleTrigger.fromProto(proto.getOnVisibleTrigger(), fingerprint);
+        }
+        if (proto.hasOnVisibleOnceTrigger()) {
+            return OnVisibleOnceTrigger.fromProto(proto.getOnVisibleOnceTrigger(), fingerprint);
+        }
         if (proto.hasOnLoadTrigger()) {
             return OnLoadTrigger.fromProto(proto.getOnLoadTrigger(), fingerprint);
         }
diff --git a/wear/protolayout/protolayout/src/main/java/androidx/wear/protolayout/modifiers/Border.kt b/wear/protolayout/protolayout/src/main/java/androidx/wear/protolayout/modifiers/Border.kt
new file mode 100644
index 0000000..d3fca75
--- /dev/null
+++ b/wear/protolayout/protolayout/src/main/java/androidx/wear/protolayout/modifiers/Border.kt
@@ -0,0 +1,38 @@
+/*
+ * Copyright 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 androidx.wear.protolayout.modifiers
+
+import androidx.annotation.Dimension
+import androidx.annotation.Dimension.Companion.DP
+import androidx.wear.protolayout.ModifiersBuilders.Border
+import androidx.wear.protolayout.types.LayoutColor
+import androidx.wear.protolayout.types.dp
+
+/**
+ * Adds a modifier to apply a border around an element.
+ *
+ * @param width The width of the border, in `DP`.
+ * @param color The color of the border.
+ */
+fun LayoutModifier.border(@Dimension(DP) width: Float, color: LayoutColor): LayoutModifier =
+    this then BaseBorderElement(width, color)
+
+internal class BaseBorderElement(@Dimension(DP) val width: Float, val color: LayoutColor) :
+    LayoutModifier.Element {
+    fun foldIn(initial: Border.Builder?): Border.Builder =
+        (initial ?: Border.Builder()).setWidth(width.dp).setColor(color.prop)
+}
diff --git a/wear/protolayout/protolayout/src/main/java/androidx/wear/protolayout/modifiers/ModifierAppliers.kt b/wear/protolayout/protolayout/src/main/java/androidx/wear/protolayout/modifiers/ModifierAppliers.kt
index 0b5531a..aee3599 100644
--- a/wear/protolayout/protolayout/src/main/java/androidx/wear/protolayout/modifiers/ModifierAppliers.kt
+++ b/wear/protolayout/protolayout/src/main/java/androidx/wear/protolayout/modifiers/ModifierAppliers.kt
@@ -16,15 +16,23 @@
 
 package androidx.wear.protolayout.modifiers
 
+import android.annotation.SuppressLint
+import androidx.annotation.OptIn
 import androidx.wear.protolayout.ModifiersBuilders
 import androidx.wear.protolayout.ModifiersBuilders.Background
+import androidx.wear.protolayout.ModifiersBuilders.Border
 import androidx.wear.protolayout.ModifiersBuilders.Clickable
 import androidx.wear.protolayout.ModifiersBuilders.Corner
 import androidx.wear.protolayout.ModifiersBuilders.ElementMetadata
 import androidx.wear.protolayout.ModifiersBuilders.Padding
 import androidx.wear.protolayout.ModifiersBuilders.Semantics
+import androidx.wear.protolayout.TypeBuilders.BoolProp
+import androidx.wear.protolayout.TypeBuilders.FloatProp
+import androidx.wear.protolayout.expression.ProtoLayoutExperimental
 
 /** Creates a [ModifiersBuilders.Modifiers] from a [LayoutModifier]. */
+@SuppressLint("ProtoLayoutMinSchema")
+@OptIn(ProtoLayoutExperimental::class)
 fun LayoutModifier.toProtoLayoutModifiers(): ModifiersBuilders.Modifiers {
     var semantics: Semantics.Builder? = null
     var background: Background.Builder? = null
@@ -32,6 +40,9 @@
     var clickable: Clickable.Builder? = null
     var padding: Padding.Builder? = null
     var metadata: ElementMetadata.Builder? = null
+    var border: Border.Builder? = null
+    var visible: BoolProp.Builder? = null
+    var opacity: FloatProp.Builder? = null
 
     this.foldIn(Unit) { _, e ->
         when (e) {
@@ -41,6 +52,9 @@
             is BaseClickableElement -> clickable = e.foldIn(clickable)
             is BasePaddingElement -> padding = e.foldIn(padding)
             is BaseMetadataElement -> metadata = e.foldIn(metadata)
+            is BaseBorderElement -> border = e.foldIn(border)
+            is BaseVisibilityElement -> visible = e.foldIn(visible)
+            is BaseOpacityElement -> opacity = e.foldIn(opacity)
         }
     }
 
@@ -53,6 +67,9 @@
             clickable?.let { setClickable(it.build()) }
             padding?.let { setPadding(it.build()) }
             metadata?.let { setMetadata(it.build()) }
+            border?.let { setBorder(it.build()) }
+            visible?.let { setVisible(it.build()) }
+            opacity?.let { setOpacity(it.build()) }
         }
         .build()
 }
diff --git a/wear/protolayout/protolayout/src/main/java/androidx/wear/protolayout/modifiers/Opacity.kt b/wear/protolayout/protolayout/src/main/java/androidx/wear/protolayout/modifiers/Opacity.kt
new file mode 100644
index 0000000..eeafb8f9
--- /dev/null
+++ b/wear/protolayout/protolayout/src/main/java/androidx/wear/protolayout/modifiers/Opacity.kt
@@ -0,0 +1,49 @@
+/*
+ * Copyright 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 androidx.wear.protolayout.modifiers
+
+import android.annotation.SuppressLint
+import androidx.annotation.FloatRange
+import androidx.wear.protolayout.TypeBuilders.FloatProp
+import androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat
+import androidx.wear.protolayout.expression.RequiresSchemaVersion
+
+/**
+ * Adds a modifier to specify the opacity of the element with a value from 0 to 1, where 0 means the
+ * element is completely transparent and 1 means the element is completely opaque.
+ *
+ * @param staticValue The static value for opacity. This value will be used if [dynamicValue] is
+ *   null, or if can't be resolved.
+ * @param dynamicValue The dynamic value for opacity. This can be used to change the opacity of the
+ *   element dynamically (without changing the layout definition). To create a smooth transition for
+ *   the dynamic change, you can use one of [DynamicFloat.animate] methods.
+ */
+@RequiresSchemaVersion(major = 1, minor = 400)
+fun LayoutModifier.opacity(
+    @FloatRange(from = 0.0, to = 1.0) staticValue: Float,
+    dynamicValue: DynamicFloat? = null
+): LayoutModifier = this then BaseOpacityElement(staticValue, dynamicValue)
+
+@RequiresSchemaVersion(major = 1, minor = 400)
+internal class BaseOpacityElement(val staticValue: Float, val dynamicValue: DynamicFloat? = null) :
+    LayoutModifier.Element {
+    @SuppressLint("ProtoLayoutMinSchema")
+    fun foldIn(initial: FloatProp.Builder?): FloatProp.Builder =
+        (initial ?: FloatProp.Builder(staticValue)).apply {
+            dynamicValue?.let { setDynamicValue(it) }
+        }
+}
diff --git a/wear/protolayout/protolayout/src/main/java/androidx/wear/protolayout/modifiers/Visibility.kt b/wear/protolayout/protolayout/src/main/java/androidx/wear/protolayout/modifiers/Visibility.kt
new file mode 100644
index 0000000..b7eabd7
--- /dev/null
+++ b/wear/protolayout/protolayout/src/main/java/androidx/wear/protolayout/modifiers/Visibility.kt
@@ -0,0 +1,53 @@
+/*
+ * Copyright 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 androidx.wear.protolayout.modifiers
+
+import android.annotation.SuppressLint
+import androidx.wear.protolayout.TypeBuilders.BoolProp
+import androidx.wear.protolayout.expression.DynamicBuilders.DynamicBool
+import androidx.wear.protolayout.expression.ProtoLayoutExperimental
+import androidx.wear.protolayout.expression.RequiresSchemaVersion
+
+/**
+ * Adds a modifier to specify the visibility of the element. A hidden element still consume space in
+ * the layout, but will not render any contents, nor will any of its children render any contents.
+ *
+ * Note that hidden elements won't receive input events.
+ *
+ * @param staticVisibility The static value for visibility. This value will be used if
+ *   [dynamicVisibility] is null, or if can't be resolved.
+ * @param dynamicVisibility The dynamic value for visibility. This can be used to change the
+ *   visibility of the element dynamically (without changing the layout definition).
+ */
+@RequiresSchemaVersion(major = 1, minor = 300)
+@ProtoLayoutExperimental
+fun LayoutModifier.visibility(
+    staticVisibility: Boolean,
+    dynamicVisibility: DynamicBool? = null
+): LayoutModifier = this then BaseVisibilityElement(staticVisibility, dynamicVisibility)
+
+@RequiresSchemaVersion(major = 1, minor = 300)
+internal class BaseVisibilityElement(
+    val visibility: Boolean,
+    val dynamicVisibility: DynamicBool? = null
+) : LayoutModifier.Element {
+    @SuppressLint("ProtoLayoutMinSchema")
+    fun foldIn(initial: BoolProp.Builder?): BoolProp.Builder =
+        (initial ?: BoolProp.Builder(visibility)).apply {
+            dynamicVisibility?.let { setDynamicValue(it) }
+        }
+}
diff --git a/wear/protolayout/protolayout/src/test/java/androidx/wear/protolayout/ResourceBuildersTest.java b/wear/protolayout/protolayout/src/test/java/androidx/wear/protolayout/ResourceBuildersTest.java
index 3591875..c0256c3 100644
--- a/wear/protolayout/protolayout/src/test/java/androidx/wear/protolayout/ResourceBuildersTest.java
+++ b/wear/protolayout/protolayout/src/test/java/androidx/wear/protolayout/ResourceBuildersTest.java
@@ -74,9 +74,25 @@
                         .setProgress(DynamicBuilders.DynamicFloat.from(new AppDataKey<>(stateKey)))
                         .build();
 
-        ResourceProto.AndroidLottieResourceByResId avdProto = lottieResource.toProto();
+        ResourceProto.AndroidLottieResourceByResId lottieProto = lottieResource.toProto();
 
-        assertThat(avdProto.getRawResourceId()).isEqualTo(RESOURCE_ID);
-        assertThat(avdProto.getProgress().getStateSource().getSourceKey()).isEqualTo(stateKey);
+        assertThat(lottieProto.getRawResourceId()).isEqualTo(RESOURCE_ID);
+        assertThat(lottieProto.getProgress().getStateSource().getSourceKey()).isEqualTo(stateKey);
+    }
+
+    @Test
+    public void lottieAnimation_hasTrigger() {
+        ResourceBuilders.AndroidLottieResourceByResId lottieResource =
+                new ResourceBuilders.AndroidLottieResourceByResId.Builder(RESOURCE_ID)
+                        .setStartTrigger(TriggerBuilders.createOnVisibleTrigger())
+                        .build();
+
+        ResourceProto.AndroidLottieResourceByResId lottieProto = lottieResource.toProto();
+
+        assertThat(lottieProto.getRawResourceId()).isEqualTo(RESOURCE_ID);
+        assertThat(lottieProto.hasStartTrigger()).isTrue();
+        assertThat(lottieProto.getStartTrigger().hasOnVisibleTrigger()).isTrue();
+        assertThat(lottieProto.getStartTrigger().hasOnVisibleOnceTrigger()).isFalse();
+        assertThat(lottieProto.getStartTrigger().hasOnLoadTrigger()).isFalse();
     }
 }
diff --git a/wear/protolayout/protolayout/src/test/java/androidx/wear/protolayout/modifiers/ModifiersTest.kt b/wear/protolayout/protolayout/src/test/java/androidx/wear/protolayout/modifiers/ModifiersTest.kt
index 80f8b5e..ca402dc 100644
--- a/wear/protolayout/protolayout/src/test/java/androidx/wear/protolayout/modifiers/ModifiersTest.kt
+++ b/wear/protolayout/protolayout/src/test/java/androidx/wear/protolayout/modifiers/ModifiersTest.kt
@@ -24,6 +24,7 @@
 import androidx.wear.protolayout.ModifiersBuilders.SEMANTICS_ROLE_BUTTON
 import androidx.wear.protolayout.ModifiersBuilders.SEMANTICS_ROLE_NONE
 import androidx.wear.protolayout.expression.AppDataKey
+import androidx.wear.protolayout.expression.DynamicBuilders.DynamicBool
 import androidx.wear.protolayout.expression.DynamicBuilders.DynamicInt32
 import androidx.wear.protolayout.expression.DynamicBuilders.DynamicString
 import androidx.wear.protolayout.expression.DynamicDataBuilders.DynamicDataValue
@@ -241,6 +242,26 @@
         assertThat(modifiers.metadata?.tagData).isEqualTo(METADATA_BYTE_ARRAY)
     }
 
+    @Test
+    fun border_toModifier() {
+        val modifier =
+            LayoutModifier.border(width = WIDTH_DP, color = COLOR).toProtoLayoutModifiers()
+
+        assertThat(modifier.border?.width?.value).isEqualTo(WIDTH_DP)
+        assertThat(modifier.border?.color?.argb).isEqualTo(COLOR.prop.argb)
+    }
+
+    @Test
+    fun visibility_toModifier() {
+        val modifier =
+            LayoutModifier.visibility(staticVisibility = false, dynamicVisibility = DYNAMIC_BOOL)
+                .toProtoLayoutModifiers()
+
+        assertThat(modifier.isVisible.value).isEqualTo(false)
+        assertThat(modifier.isVisible.dynamicValue?.toDynamicBoolProto())
+            .isEqualTo(DYNAMIC_BOOL.toDynamicBoolProto())
+    }
+
     companion object {
         const val STATIC_CONTENT_DESCRIPTION = "content desc"
         val DYNAMIC_CONTENT_DESCRIPTION = DynamicString.constant("dynamic content")
@@ -255,5 +276,7 @@
         const val PADDING_ALL = 5f
         const val METADATA = "metadata"
         val METADATA_BYTE_ARRAY = METADATA.toByteArray()
+        const val WIDTH_DP = 5f
+        val DYNAMIC_BOOL = DynamicBool.constant(true)
     }
 }
diff --git a/wear/wear-phone-interactions/api/1.1.0-beta01.txt b/wear/wear-phone-interactions/api/1.1.0-beta01.txt
new file mode 100644
index 0000000..22d6f21
--- /dev/null
+++ b/wear/wear-phone-interactions/api/1.1.0-beta01.txt
@@ -0,0 +1,170 @@
+// Signature format: 4.0
+package androidx.wear.phone.interactions {
+
+  public final class PhoneTypeHelper {
+    method public static int getPhoneDeviceType(android.content.Context context);
+    field public static final androidx.wear.phone.interactions.PhoneTypeHelper.Companion Companion;
+    field public static final int DEVICE_TYPE_ANDROID = 1; // 0x1
+    field public static final int DEVICE_TYPE_ERROR = 0; // 0x0
+    field public static final int DEVICE_TYPE_IOS = 2; // 0x2
+    field public static final int DEVICE_TYPE_NONE = 4; // 0x4
+    field public static final int DEVICE_TYPE_UNKNOWN = 3; // 0x3
+  }
+
+  public static final class PhoneTypeHelper.Companion {
+    method public int getPhoneDeviceType(android.content.Context context);
+    property public static final int DEVICE_TYPE_ANDROID;
+    property public static final int DEVICE_TYPE_ERROR;
+    property public static final int DEVICE_TYPE_IOS;
+    property public static final int DEVICE_TYPE_NONE;
+    property public static final int DEVICE_TYPE_UNKNOWN;
+  }
+
+}
+
+package androidx.wear.phone.interactions.authentication {
+
+  @RequiresApi(android.os.Build.VERSION_CODES.O) public final class CodeChallenge {
+    ctor public CodeChallenge(androidx.wear.phone.interactions.authentication.CodeVerifier codeVerifier);
+    method public String getValue();
+    property public final String value;
+  }
+
+  @RequiresApi(android.os.Build.VERSION_CODES.O) public final class CodeVerifier {
+    ctor public CodeVerifier();
+    ctor public CodeVerifier(optional int byteLength);
+    ctor public CodeVerifier(String value);
+    method public String getValue();
+    property public final String value;
+  }
+
+  public final class OAuthRequest {
+    method public String getPackageName();
+    method public String getRedirectUrl();
+    method public android.net.Uri getRequestUrl();
+    property public final String packageName;
+    property public final String redirectUrl;
+    property public final android.net.Uri requestUrl;
+    field public static final androidx.wear.phone.interactions.authentication.OAuthRequest.Companion Companion;
+    field public static final String WEAR_REDIRECT_URL_PREFIX = "https://wear.googleapis.com/3p_auth/";
+    field public static final String WEAR_REDIRECT_URL_PREFIX_CN = "https://wear.googleapis-cn.com/3p_auth/";
+  }
+
+  public static final class OAuthRequest.Builder {
+    ctor public OAuthRequest.Builder(android.content.Context context);
+    method @RequiresApi(android.os.Build.VERSION_CODES.O) public androidx.wear.phone.interactions.authentication.OAuthRequest build();
+    method public androidx.wear.phone.interactions.authentication.OAuthRequest.Builder setAuthProviderUrl(android.net.Uri authProviderUrl);
+    method public androidx.wear.phone.interactions.authentication.OAuthRequest.Builder setClientId(String clientId);
+    method public androidx.wear.phone.interactions.authentication.OAuthRequest.Builder setCodeChallenge(androidx.wear.phone.interactions.authentication.CodeChallenge codeChallenge);
+    method public androidx.wear.phone.interactions.authentication.OAuthRequest.Builder setRedirectUrl(android.net.Uri redirectUrl);
+  }
+
+  public static final class OAuthRequest.Companion {
+    property public static final String WEAR_REDIRECT_URL_PREFIX;
+    property public static final String WEAR_REDIRECT_URL_PREFIX_CN;
+  }
+
+  public final class OAuthResponse {
+    method public int getErrorCode();
+    method public android.net.Uri? getResponseUrl();
+    property public final int errorCode;
+    property public final android.net.Uri? responseUrl;
+  }
+
+  public static final class OAuthResponse.Builder {
+    ctor public OAuthResponse.Builder();
+    method public androidx.wear.phone.interactions.authentication.OAuthResponse build();
+    method public androidx.wear.phone.interactions.authentication.OAuthResponse.Builder setErrorCode(int errorCode);
+    method public androidx.wear.phone.interactions.authentication.OAuthResponse.Builder setResponseUrl(android.net.Uri responseUrl);
+  }
+
+  public final class RemoteAuthClient implements java.lang.AutoCloseable {
+    method @UiThread public void close();
+    method public static androidx.wear.phone.interactions.authentication.RemoteAuthClient create(android.content.Context context);
+    method protected void finalize();
+    method public kotlinx.coroutines.flow.Flow<java.lang.Integer> getAvailabilityStatus();
+    method @UiThread public void sendAuthorizationRequest(androidx.wear.phone.interactions.authentication.OAuthRequest request, java.util.concurrent.Executor executor, androidx.wear.phone.interactions.authentication.RemoteAuthClient.Callback clientCallback);
+    property public final kotlinx.coroutines.flow.Flow<java.lang.Integer> availabilityStatus;
+    field public static final androidx.wear.phone.interactions.authentication.RemoteAuthClient.Companion Companion;
+    field public static final int ERROR_PHONE_UNAVAILABLE = 1; // 0x1
+    field public static final int ERROR_UNSUPPORTED = 0; // 0x0
+    field public static final int NO_ERROR = -1; // 0xffffffff
+    field public static final int STATUS_AVAILABLE = 3; // 0x3
+    field public static final int STATUS_TEMPORARILY_UNAVAILABLE = 2; // 0x2
+    field public static final int STATUS_UNAVAILABLE = 1; // 0x1
+    field public static final int STATUS_UNKNOWN = 0; // 0x0
+  }
+
+  public abstract static class RemoteAuthClient.Callback {
+    ctor public RemoteAuthClient.Callback();
+    method @UiThread public abstract void onAuthorizationError(androidx.wear.phone.interactions.authentication.OAuthRequest request, int errorCode);
+    method @UiThread public abstract void onAuthorizationResponse(androidx.wear.phone.interactions.authentication.OAuthRequest request, androidx.wear.phone.interactions.authentication.OAuthResponse response);
+  }
+
+  public static final class RemoteAuthClient.Companion {
+    method public androidx.wear.phone.interactions.authentication.RemoteAuthClient create(android.content.Context context);
+    property public static final int ERROR_PHONE_UNAVAILABLE;
+    property public static final int ERROR_UNSUPPORTED;
+    property public static final int NO_ERROR;
+    property public static final int STATUS_AVAILABLE;
+    property public static final int STATUS_TEMPORARILY_UNAVAILABLE;
+    property public static final int STATUS_UNAVAILABLE;
+    property public static final int STATUS_UNKNOWN;
+  }
+
+  public interface RemoteAuthRequestHandler {
+    method public boolean isAuthSupported();
+    method public void sendAuthRequest(androidx.wear.phone.interactions.authentication.OAuthRequest request, kotlin.Pair<java.lang.String,java.lang.Integer> packageNameAndRequestId);
+  }
+
+  public abstract class RemoteAuthService extends android.app.Service {
+    ctor public RemoteAuthService();
+    method protected final android.os.IBinder onBind(android.content.Intent intent, androidx.wear.phone.interactions.authentication.RemoteAuthRequestHandler remoteAuthRequestHandler);
+    method public static final void sendResponseToCallback(androidx.wear.phone.interactions.authentication.OAuthResponse response, kotlin.Pair<java.lang.String,java.lang.Integer> packageNameAndRequestId);
+    method protected boolean verifyPackageName(android.content.Context context, String? requestPackageName);
+    field public static final androidx.wear.phone.interactions.authentication.RemoteAuthService.Companion Companion;
+  }
+
+  public static final class RemoteAuthService.Companion {
+    method public void sendResponseToCallback(androidx.wear.phone.interactions.authentication.OAuthResponse response, kotlin.Pair<java.lang.String,java.lang.Integer> packageNameAndRequestId);
+  }
+
+}
+
+package androidx.wear.phone.interactions.notifications {
+
+  public final class BridgingConfig {
+    method public java.util.Set<java.lang.String>? getExcludedTags();
+    method public boolean isBridgingEnabled();
+    property public final java.util.Set<java.lang.String>? excludedTags;
+    property public final boolean isBridgingEnabled;
+  }
+
+  public static final class BridgingConfig.Builder {
+    ctor public BridgingConfig.Builder(android.content.Context context, boolean isBridgingEnabled);
+    method public androidx.wear.phone.interactions.notifications.BridgingConfig.Builder addExcludedTag(String tag);
+    method public androidx.wear.phone.interactions.notifications.BridgingConfig.Builder addExcludedTags(java.util.Collection<java.lang.String> tags);
+    method public androidx.wear.phone.interactions.notifications.BridgingConfig build();
+  }
+
+  public fun interface BridgingConfigurationHandler {
+    method public void applyBridgingConfiguration(androidx.wear.phone.interactions.notifications.BridgingConfig bridgingConfig);
+  }
+
+  public final class BridgingManager {
+    method public static androidx.wear.phone.interactions.notifications.BridgingManager fromContext(android.content.Context context);
+    method public void setConfig(androidx.wear.phone.interactions.notifications.BridgingConfig bridgingConfig);
+    field public static final androidx.wear.phone.interactions.notifications.BridgingManager.Companion Companion;
+  }
+
+  public static final class BridgingManager.Companion {
+    method public androidx.wear.phone.interactions.notifications.BridgingManager fromContext(android.content.Context context);
+  }
+
+  public final class BridgingManagerService extends android.app.Service {
+    ctor public BridgingManagerService(android.content.Context context, androidx.wear.phone.interactions.notifications.BridgingConfigurationHandler bridgingConfigurationHandler);
+    method public android.os.IBinder? onBind(android.content.Intent? intent);
+  }
+
+}
+
diff --git a/wear/wear-phone-interactions/api/current.txt b/wear/wear-phone-interactions/api/current.txt
index 4659ee8..22d6f21 100644
--- a/wear/wear-phone-interactions/api/current.txt
+++ b/wear/wear-phone-interactions/api/current.txt
@@ -7,6 +7,7 @@
     field public static final int DEVICE_TYPE_ANDROID = 1; // 0x1
     field public static final int DEVICE_TYPE_ERROR = 0; // 0x0
     field public static final int DEVICE_TYPE_IOS = 2; // 0x2
+    field public static final int DEVICE_TYPE_NONE = 4; // 0x4
     field public static final int DEVICE_TYPE_UNKNOWN = 3; // 0x3
   }
 
@@ -15,6 +16,7 @@
     property public static final int DEVICE_TYPE_ANDROID;
     property public static final int DEVICE_TYPE_ERROR;
     property public static final int DEVICE_TYPE_IOS;
+    property public static final int DEVICE_TYPE_NONE;
     property public static final int DEVICE_TYPE_UNKNOWN;
   }
 
diff --git a/wear/wear-phone-interactions/api/res-1.1.0-beta01.txt b/wear/wear-phone-interactions/api/res-1.1.0-beta01.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/wear/wear-phone-interactions/api/res-1.1.0-beta01.txt
diff --git a/wear/wear-phone-interactions/api/restricted_1.1.0-beta01.txt b/wear/wear-phone-interactions/api/restricted_1.1.0-beta01.txt
new file mode 100644
index 0000000..0798d72
--- /dev/null
+++ b/wear/wear-phone-interactions/api/restricted_1.1.0-beta01.txt
@@ -0,0 +1,173 @@
+// Signature format: 4.0
+package androidx.wear.phone.interactions {
+
+  public final class PhoneTypeHelper {
+    method public static int getPhoneDeviceType(android.content.Context context);
+    field public static final androidx.wear.phone.interactions.PhoneTypeHelper.Companion Companion;
+    field public static final int DEVICE_TYPE_ANDROID = 1; // 0x1
+    field public static final int DEVICE_TYPE_ERROR = 0; // 0x0
+    field public static final int DEVICE_TYPE_IOS = 2; // 0x2
+    field public static final int DEVICE_TYPE_NONE = 4; // 0x4
+    field public static final int DEVICE_TYPE_UNKNOWN = 3; // 0x3
+  }
+
+  public static final class PhoneTypeHelper.Companion {
+    method public int getPhoneDeviceType(android.content.Context context);
+    property public static final int DEVICE_TYPE_ANDROID;
+    property public static final int DEVICE_TYPE_ERROR;
+    property public static final int DEVICE_TYPE_IOS;
+    property public static final int DEVICE_TYPE_NONE;
+    property public static final int DEVICE_TYPE_UNKNOWN;
+  }
+
+}
+
+package androidx.wear.phone.interactions.authentication {
+
+  @RequiresApi(android.os.Build.VERSION_CODES.O) public final class CodeChallenge {
+    ctor public CodeChallenge(androidx.wear.phone.interactions.authentication.CodeVerifier codeVerifier);
+    method public String getValue();
+    property public final String value;
+  }
+
+  @RequiresApi(android.os.Build.VERSION_CODES.O) public final class CodeVerifier {
+    ctor public CodeVerifier();
+    ctor public CodeVerifier(optional int byteLength);
+    ctor public CodeVerifier(String value);
+    method public String getValue();
+    property public final String value;
+  }
+
+  public final class OAuthRequest {
+    method public String getPackageName();
+    method public String getRedirectUrl();
+    method public android.net.Uri getRequestUrl();
+    property public final String packageName;
+    property public final String redirectUrl;
+    property public final android.net.Uri requestUrl;
+    field public static final androidx.wear.phone.interactions.authentication.OAuthRequest.Companion Companion;
+    field public static final String WEAR_REDIRECT_URL_PREFIX = "https://wear.googleapis.com/3p_auth/";
+    field public static final String WEAR_REDIRECT_URL_PREFIX_CN = "https://wear.googleapis-cn.com/3p_auth/";
+  }
+
+  public static final class OAuthRequest.Builder {
+    ctor public OAuthRequest.Builder(android.content.Context context);
+    method @RequiresApi(android.os.Build.VERSION_CODES.O) public androidx.wear.phone.interactions.authentication.OAuthRequest build();
+    method public androidx.wear.phone.interactions.authentication.OAuthRequest.Builder setAuthProviderUrl(android.net.Uri authProviderUrl);
+    method public androidx.wear.phone.interactions.authentication.OAuthRequest.Builder setClientId(String clientId);
+    method public androidx.wear.phone.interactions.authentication.OAuthRequest.Builder setCodeChallenge(androidx.wear.phone.interactions.authentication.CodeChallenge codeChallenge);
+    method public androidx.wear.phone.interactions.authentication.OAuthRequest.Builder setRedirectUrl(android.net.Uri redirectUrl);
+  }
+
+  public static final class OAuthRequest.Companion {
+    property public static final String WEAR_REDIRECT_URL_PREFIX;
+    property public static final String WEAR_REDIRECT_URL_PREFIX_CN;
+  }
+
+  public final class OAuthResponse {
+    method public int getErrorCode();
+    method public android.net.Uri? getResponseUrl();
+    property @androidx.wear.phone.interactions.authentication.RemoteAuthClient.Companion.ErrorCode public final int errorCode;
+    property public final android.net.Uri? responseUrl;
+  }
+
+  public static final class OAuthResponse.Builder {
+    ctor public OAuthResponse.Builder();
+    method public androidx.wear.phone.interactions.authentication.OAuthResponse build();
+    method public androidx.wear.phone.interactions.authentication.OAuthResponse.Builder setErrorCode(@androidx.wear.phone.interactions.authentication.RemoteAuthClient.Companion.ErrorCode int errorCode);
+    method public androidx.wear.phone.interactions.authentication.OAuthResponse.Builder setResponseUrl(android.net.Uri responseUrl);
+  }
+
+  public final class RemoteAuthClient implements java.lang.AutoCloseable {
+    method @UiThread public void close();
+    method public static androidx.wear.phone.interactions.authentication.RemoteAuthClient create(android.content.Context context);
+    method protected void finalize();
+    method public kotlinx.coroutines.flow.Flow<java.lang.Integer> getAvailabilityStatus();
+    method @UiThread public void sendAuthorizationRequest(androidx.wear.phone.interactions.authentication.OAuthRequest request, java.util.concurrent.Executor executor, androidx.wear.phone.interactions.authentication.RemoteAuthClient.Callback clientCallback);
+    property public final kotlinx.coroutines.flow.Flow<java.lang.Integer> availabilityStatus;
+    field public static final androidx.wear.phone.interactions.authentication.RemoteAuthClient.Companion Companion;
+    field public static final int ERROR_PHONE_UNAVAILABLE = 1; // 0x1
+    field public static final int ERROR_UNSUPPORTED = 0; // 0x0
+    field public static final int NO_ERROR = -1; // 0xffffffff
+    field public static final int STATUS_AVAILABLE = 3; // 0x3
+    field public static final int STATUS_TEMPORARILY_UNAVAILABLE = 2; // 0x2
+    field public static final int STATUS_UNAVAILABLE = 1; // 0x1
+    field public static final int STATUS_UNKNOWN = 0; // 0x0
+  }
+
+  public abstract static class RemoteAuthClient.Callback {
+    ctor public RemoteAuthClient.Callback();
+    method @UiThread public abstract void onAuthorizationError(androidx.wear.phone.interactions.authentication.OAuthRequest request, @androidx.wear.phone.interactions.authentication.RemoteAuthClient.Companion.ErrorCode int errorCode);
+    method @UiThread public abstract void onAuthorizationResponse(androidx.wear.phone.interactions.authentication.OAuthRequest request, androidx.wear.phone.interactions.authentication.OAuthResponse response);
+  }
+
+  public static final class RemoteAuthClient.Companion {
+    method public androidx.wear.phone.interactions.authentication.RemoteAuthClient create(android.content.Context context);
+    property public static final int ERROR_PHONE_UNAVAILABLE;
+    property public static final int ERROR_UNSUPPORTED;
+    property public static final int NO_ERROR;
+    property public static final int STATUS_AVAILABLE;
+    property public static final int STATUS_TEMPORARILY_UNAVAILABLE;
+    property public static final int STATUS_UNAVAILABLE;
+    property public static final int STATUS_UNKNOWN;
+  }
+
+  @IntDef({androidx.wear.phone.interactions.authentication.RemoteAuthClient.NO_ERROR, androidx.wear.phone.interactions.authentication.RemoteAuthClient.ERROR_UNSUPPORTED, androidx.wear.phone.interactions.authentication.RemoteAuthClient.ERROR_PHONE_UNAVAILABLE}) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) @kotlin.annotation.Retention(kotlin.annotation.AnnotationRetention.SOURCE) public static @interface RemoteAuthClient.Companion.ErrorCode {
+  }
+
+  public interface RemoteAuthRequestHandler {
+    method public boolean isAuthSupported();
+    method public void sendAuthRequest(androidx.wear.phone.interactions.authentication.OAuthRequest request, kotlin.Pair<java.lang.String,java.lang.Integer> packageNameAndRequestId);
+  }
+
+  public abstract class RemoteAuthService extends android.app.Service {
+    ctor public RemoteAuthService();
+    method protected final android.os.IBinder onBind(android.content.Intent intent, androidx.wear.phone.interactions.authentication.RemoteAuthRequestHandler remoteAuthRequestHandler);
+    method public static final void sendResponseToCallback(androidx.wear.phone.interactions.authentication.OAuthResponse response, kotlin.Pair<java.lang.String,java.lang.Integer> packageNameAndRequestId);
+    method protected boolean verifyPackageName(android.content.Context context, String? requestPackageName);
+    field public static final androidx.wear.phone.interactions.authentication.RemoteAuthService.Companion Companion;
+  }
+
+  public static final class RemoteAuthService.Companion {
+    method public void sendResponseToCallback(androidx.wear.phone.interactions.authentication.OAuthResponse response, kotlin.Pair<java.lang.String,java.lang.Integer> packageNameAndRequestId);
+  }
+
+}
+
+package androidx.wear.phone.interactions.notifications {
+
+  public final class BridgingConfig {
+    method public java.util.Set<java.lang.String>? getExcludedTags();
+    method public boolean isBridgingEnabled();
+    property public final java.util.Set<java.lang.String>? excludedTags;
+    property public final boolean isBridgingEnabled;
+  }
+
+  public static final class BridgingConfig.Builder {
+    ctor public BridgingConfig.Builder(android.content.Context context, boolean isBridgingEnabled);
+    method public androidx.wear.phone.interactions.notifications.BridgingConfig.Builder addExcludedTag(String tag);
+    method public androidx.wear.phone.interactions.notifications.BridgingConfig.Builder addExcludedTags(java.util.Collection<java.lang.String> tags);
+    method public androidx.wear.phone.interactions.notifications.BridgingConfig build();
+  }
+
+  public fun interface BridgingConfigurationHandler {
+    method public void applyBridgingConfiguration(androidx.wear.phone.interactions.notifications.BridgingConfig bridgingConfig);
+  }
+
+  public final class BridgingManager {
+    method public static androidx.wear.phone.interactions.notifications.BridgingManager fromContext(android.content.Context context);
+    method public void setConfig(androidx.wear.phone.interactions.notifications.BridgingConfig bridgingConfig);
+    field public static final androidx.wear.phone.interactions.notifications.BridgingManager.Companion Companion;
+  }
+
+  public static final class BridgingManager.Companion {
+    method public androidx.wear.phone.interactions.notifications.BridgingManager fromContext(android.content.Context context);
+  }
+
+  public final class BridgingManagerService extends android.app.Service {
+    ctor public BridgingManagerService(android.content.Context context, androidx.wear.phone.interactions.notifications.BridgingConfigurationHandler bridgingConfigurationHandler);
+    method public android.os.IBinder? onBind(android.content.Intent? intent);
+  }
+
+}
+
diff --git a/wear/wear-phone-interactions/api/restricted_current.txt b/wear/wear-phone-interactions/api/restricted_current.txt
index 8b63c78..0798d72 100644
--- a/wear/wear-phone-interactions/api/restricted_current.txt
+++ b/wear/wear-phone-interactions/api/restricted_current.txt
@@ -7,6 +7,7 @@
     field public static final int DEVICE_TYPE_ANDROID = 1; // 0x1
     field public static final int DEVICE_TYPE_ERROR = 0; // 0x0
     field public static final int DEVICE_TYPE_IOS = 2; // 0x2
+    field public static final int DEVICE_TYPE_NONE = 4; // 0x4
     field public static final int DEVICE_TYPE_UNKNOWN = 3; // 0x3
   }
 
@@ -15,6 +16,7 @@
     property public static final int DEVICE_TYPE_ANDROID;
     property public static final int DEVICE_TYPE_ERROR;
     property public static final int DEVICE_TYPE_IOS;
+    property public static final int DEVICE_TYPE_NONE;
     property public static final int DEVICE_TYPE_UNKNOWN;
   }
 
diff --git a/wear/wear-phone-interactions/src/main/java/androidx/wear/phone/interactions/PhoneTypeHelper.kt b/wear/wear-phone-interactions/src/main/java/androidx/wear/phone/interactions/PhoneTypeHelper.kt
index 4be01cd..676a0ca 100644
--- a/wear/wear-phone-interactions/src/main/java/androidx/wear/phone/interactions/PhoneTypeHelper.kt
+++ b/wear/wear-phone-interactions/src/main/java/androidx/wear/phone/interactions/PhoneTypeHelper.kt
@@ -34,9 +34,14 @@
                 .path(BLUETOOTH_MODE)
                 .build()
 
+        /**
+         * These values follow the values of platform constants defined in
+         * [Settings.Global.Wearable.PAIRED_DEVICE_OS_TYPE].
+         */
         internal const val UNKNOWN_MODE = 0
         internal const val ANDROID_MODE = 1
         internal const val IOS_MODE = 2
+        internal const val NONE_PAIRED_MODE = 3
 
         /** Indicates an error returned retrieving the type of phone we are paired to. */
         public const val DEVICE_TYPE_ERROR: Int = 0
@@ -50,18 +55,22 @@
         /** Indicates unknown type of phone we are paired to. */
         public const val DEVICE_TYPE_UNKNOWN: Int = 3
 
+        /** Indicates that device is not paired to phone. */
+        public const val DEVICE_TYPE_NONE: Int = 4
+
         /**
          * Returns the type of phone handset this Wear OS device has been paired with.
          *
-         * @return one of `DEVICE_TYPE_ERROR`, `DEVICE_TYPE_ANDROID`, `DEVICE_TYPE_IOS` or
-         *   `DEVICE_TYPE_UNKNOWN` indicating we had an error while determining the phone type, we
-         *   are paired to an Android phone, we are paired to an iOS phone or we could not determine
-         *   the phone type respectively.
+         * @return one of `DEVICE_TYPE_ERROR`, `DEVICE_TYPE_ANDROID`, `DEVICE_TYPE_IOS`,
+         *   `DEVICE_TYPE_UNKNOWN` or `DEVICE_TYPE_NONE` indicating we had an error while
+         *   determining the phone type, we are paired to an Android phone, we are paired to an iOS
+         *   phone, we could not determine the phone type respectively, or no phone is paired
+         *   respectively.
          */
         @DeviceFamily
         @JvmStatic
         public fun getPhoneDeviceType(context: Context): Int {
-            var bluetoothMode = UNKNOWN_MODE
+            var pairedDeviceType = UNKNOWN_MODE
             if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.P) {
                 val cursor =
                     context.contentResolver.query(BLUETOOTH_MODE_URI, null, null, null, null)
@@ -69,34 +78,41 @@
                 cursor.use {
                     while (it.moveToNext()) {
                         if (BLUETOOTH_MODE == it.getString(0)) {
-                            bluetoothMode = it.getInt(1)
+                            pairedDeviceType = it.getInt(1)
                             break
                         }
                     }
                 }
+                return when (pairedDeviceType) {
+                    ANDROID_MODE -> DEVICE_TYPE_ANDROID
+                    IOS_MODE -> DEVICE_TYPE_IOS
+                    else -> DEVICE_TYPE_UNKNOWN
+                }
             } else if (
                 Build.VERSION.SDK_INT == Build.VERSION_CODES.UPSIDE_DOWN_CAKE &&
                     context.applicationInfo.targetSdkVersion > Build.VERSION_CODES.UPSIDE_DOWN_CAKE
             ) {
                 return DEVICE_TYPE_ANDROID
-            } else {
-                bluetoothMode =
-                    Settings.Global.getInt(
-                        context.contentResolver,
-                        PAIRED_DEVICE_OS_TYPE,
-                        UNKNOWN_MODE
-                    )
             }
-            return when (bluetoothMode) {
+            pairedDeviceType =
+                Settings.Global.getInt(context.contentResolver, PAIRED_DEVICE_OS_TYPE, UNKNOWN_MODE)
+            return when (pairedDeviceType) {
                 ANDROID_MODE -> DEVICE_TYPE_ANDROID
                 IOS_MODE -> DEVICE_TYPE_IOS
+                NONE_PAIRED_MODE -> DEVICE_TYPE_NONE
                 else -> DEVICE_TYPE_UNKNOWN
             }
         }
 
         /** Annotates a value of DeviceType. */
         @Retention(AnnotationRetention.SOURCE)
-        @IntDef(DEVICE_TYPE_ERROR, DEVICE_TYPE_ANDROID, DEVICE_TYPE_IOS, DEVICE_TYPE_UNKNOWN)
+        @IntDef(
+            DEVICE_TYPE_ERROR,
+            DEVICE_TYPE_ANDROID,
+            DEVICE_TYPE_IOS,
+            DEVICE_TYPE_UNKNOWN,
+            DEVICE_TYPE_NONE
+        )
         internal annotation class DeviceFamily
     }
 }
diff --git a/wear/wear-phone-interactions/src/test/java/androidx/wear/phone/interactions/PhoneTypeHelperTest.kt b/wear/wear-phone-interactions/src/test/java/androidx/wear/phone/interactions/PhoneTypeHelperTest.kt
index afcf1bb..57cc0e9 100644
--- a/wear/wear-phone-interactions/src/test/java/androidx/wear/phone/interactions/PhoneTypeHelperTest.kt
+++ b/wear/wear-phone-interactions/src/test/java/androidx/wear/phone/interactions/PhoneTypeHelperTest.kt
@@ -175,6 +175,18 @@
             .isEqualTo(PhoneTypeHelper.DEVICE_TYPE_IOS)
     }
 
+    @Test
+    @Config(minSdk = 35)
+    fun testGetDeviceType_returnsNone() {
+        Settings.Global.putInt(
+            contentResolver,
+            PhoneTypeHelper.PAIRED_DEVICE_OS_TYPE,
+            PhoneTypeHelper.NONE_PAIRED_MODE
+        )
+        assertThat(getPhoneDeviceType(ApplicationProvider.getApplicationContext()))
+            .isEqualTo(PhoneTypeHelper.DEVICE_TYPE_NONE)
+    }
+
     companion object {
         private fun createFakeBluetoothModeCursor(bluetoothMode: Int): Cursor {
             val cursor = MatrixCursor(arrayOf("key", "value"))
diff --git a/webkit/integration-tests/instrumentation/src/androidTest/java/androidx/webkit/PrefetchTest.java b/webkit/integration-tests/instrumentation/src/androidTest/java/androidx/webkit/PrefetchTest.java
new file mode 100644
index 0000000..5f09ac3
--- /dev/null
+++ b/webkit/integration-tests/instrumentation/src/androidTest/java/androidx/webkit/PrefetchTest.java
@@ -0,0 +1,103 @@
+/*
+ * Copyright 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 androidx.webkit;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertThrows;
+
+import androidx.test.ext.junit.runners.AndroidJUnit4;
+import androidx.test.filters.SmallTest;
+import androidx.webkit.test.common.WebkitUtils;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+@SmallTest
+@RunWith(AndroidJUnit4.class)
+public class PrefetchTest {
+
+    /**
+     * Test setting valid values for
+     * {@link SpeculativeLoadingConfig.Builder#setPrefetchTtlSeconds(int)}
+     */
+    @Test
+    public void testTTLValidValues() {
+        WebkitUtils.checkFeature(WebViewFeature.SPECULATIVE_LOADING_CONFIG);
+        SpeculativeLoadingConfig.Builder builder = new SpeculativeLoadingConfig.Builder();
+        // lower values
+        builder.setPrefetchTtlSeconds(1);
+        assertEquals(1, builder.build().getPrefetchTtlSeconds());
+
+        builder.setPrefetchTtlSeconds(Integer.MAX_VALUE - 1);
+        assertEquals(Integer.MAX_VALUE - 1, builder.build().getMaxPrefetches());
+
+        builder.setPrefetchTtlSeconds(5685);
+        assertEquals(5685, builder.build().getMaxPrefetches());
+    }
+
+    /**
+     * Test setting valid values for {@link SpeculativeLoadingConfig.Builder#setMaxPrefetches(int)}
+     */
+    @Test
+    public void testMaxPrefetchesValidValues() {
+        WebkitUtils.checkFeature(WebViewFeature.SPECULATIVE_LOADING_CONFIG);
+        SpeculativeLoadingConfig.Builder builder = new SpeculativeLoadingConfig.Builder();
+        builder.setMaxPrefetches(1);
+        assertEquals(1, builder.build().getMaxPrefetches());
+
+        builder.setPrefetchTtlSeconds(SpeculativeLoadingConfig.ABSOLUTE_MAX_PREFETCHES);
+        assertEquals(SpeculativeLoadingConfig.ABSOLUTE_MAX_PREFETCHES,
+                builder.build().getMaxPrefetches());
+    }
+
+    /**
+     * Test setting out-of-range values for
+     * {@link SpeculativeLoadingConfig.Builder#setPrefetchTtlSeconds(int)}
+     */
+    @Test
+    public void testTTLLimit() {
+        WebkitUtils.checkFeature(WebViewFeature.SPECULATIVE_LOADING_CONFIG);
+        SpeculativeLoadingConfig.Builder builder = new SpeculativeLoadingConfig.Builder();
+
+        IllegalArgumentException expectedException = assertThrows(IllegalArgumentException.class,
+                () -> builder.setPrefetchTtlSeconds(0));
+        assertEquals("Prefetch TTL must be greater than 0", expectedException.getMessage());
+    }
+
+    /**
+     * Test setting out-of-range values for
+     * {@link SpeculativeLoadingConfig.Builder#setMaxPrefetches(int)}
+     */
+    @Test
+    public void testMaxPrefetchesLimit() {
+        WebkitUtils.checkFeature(WebViewFeature.SPECULATIVE_LOADING_CONFIG);
+        SpeculativeLoadingConfig.Builder builder = new SpeculativeLoadingConfig.Builder();
+
+        // lower bound
+        IllegalArgumentException expectedException = assertThrows(IllegalArgumentException.class,
+                () -> builder.setMaxPrefetches(0));
+        assertEquals("Max prefetches must be greater than 0", expectedException.getMessage());
+
+        // upper bound
+        expectedException = assertThrows(IllegalArgumentException.class,
+                () -> builder.setMaxPrefetches(
+                        SpeculativeLoadingConfig.ABSOLUTE_MAX_PREFETCHES + 1));
+        assertEquals("Max prefetches cannot exceed"
+                + SpeculativeLoadingConfig.ABSOLUTE_MAX_PREFETCHES, expectedException.getMessage());
+    }
+
+}
diff --git a/webkit/webkit/api/current.txt b/webkit/webkit/api/current.txt
index d147a89..4a0366f 100644
--- a/webkit/webkit/api/current.txt
+++ b/webkit/webkit/api/current.txt
@@ -80,6 +80,7 @@
     method @AnyThread @RequiresFeature(name=androidx.webkit.WebViewFeature.MULTI_PROFILE, enforcement="androidx.webkit.WebViewFeature#isFeatureSupported") public android.webkit.WebStorage getWebStorage();
     method @SuppressCompatibility @RequiresFeature(name=androidx.webkit.WebViewFeature.PROFILE_URL_PREFETCH, enforcement="androidx.webkit.WebViewFeature#isFeatureSupported") @UiThread @androidx.webkit.Profile.ExperimentalUrlPrefetch public void prefetchUrlAsync(String, android.os.CancellationSignal?, java.util.concurrent.Executor, androidx.webkit.OutcomeReceiverCompat<java.lang.Void!,androidx.webkit.PrefetchException!>);
     method @SuppressCompatibility @RequiresFeature(name=androidx.webkit.WebViewFeature.PROFILE_URL_PREFETCH, enforcement="androidx.webkit.WebViewFeature#isFeatureSupported") @UiThread @androidx.webkit.Profile.ExperimentalUrlPrefetch public void prefetchUrlAsync(String, android.os.CancellationSignal?, java.util.concurrent.Executor, androidx.webkit.SpeculativeLoadingParameters, androidx.webkit.OutcomeReceiverCompat<java.lang.Void!,androidx.webkit.PrefetchException!>);
+    method @SuppressCompatibility @RequiresFeature(name=androidx.webkit.WebViewFeature.SPECULATIVE_LOADING_CONFIG, enforcement="androidx.webkit.WebViewFeature#isFeatureSupported") @UiThread @androidx.webkit.Profile.ExperimentalUrlPrefetch public void setSpeculativeLoadingConfig(androidx.webkit.SpeculativeLoadingConfig);
     field public static final String DEFAULT_PROFILE_NAME = "Default";
   }
 
@@ -162,6 +163,21 @@
     method @RequiresFeature(name="REQUESTED_WITH_HEADER_ALLOW_LIST", enforcement="androidx.webkit.WebViewFeature#isFeatureSupported") public abstract void setRequestedWithHeaderOriginAllowList(java.util.Set<java.lang.String!>);
   }
 
+  @SuppressCompatibility @androidx.webkit.Profile.ExperimentalUrlPrefetch public class SpeculativeLoadingConfig {
+    method @IntRange(from=1, to=androidx.webkit.SpeculativeLoadingConfig.ABSOLUTE_MAX_PREFETCHES) public int getMaxPrefetches();
+    method @IntRange(from=1, to=java.lang.Integer.MAX_VALUE) public int getPrefetchTtlSeconds();
+    field public static final int ABSOLUTE_MAX_PREFETCHES = 20; // 0x14
+    field public static final int DEFAULT_MAX_PREFETCHES = 10; // 0xa
+    field public static final int DEFAULT_TTL_SECS = 60; // 0x3c
+  }
+
+  @SuppressCompatibility @androidx.webkit.Profile.ExperimentalUrlPrefetch public static final class SpeculativeLoadingConfig.Builder {
+    ctor public SpeculativeLoadingConfig.Builder();
+    method @SuppressCompatibility @androidx.webkit.Profile.ExperimentalUrlPrefetch public androidx.webkit.SpeculativeLoadingConfig build();
+    method public androidx.webkit.SpeculativeLoadingConfig.Builder setMaxPrefetches(@IntRange(from=1, to=androidx.webkit.SpeculativeLoadingConfig.ABSOLUTE_MAX_PREFETCHES) int);
+    method public androidx.webkit.SpeculativeLoadingConfig.Builder setPrefetchTtlSeconds(@IntRange(from=1, to=java.lang.Integer.MAX_VALUE) int);
+  }
+
   @SuppressCompatibility @RequiresFeature(name=androidx.webkit.WebViewFeature.PROFILE_URL_PREFETCH, enforcement="androidx.webkit.WebViewFeature#isFeatureSupported") @androidx.webkit.Profile.ExperimentalUrlPrefetch public final class SpeculativeLoadingParameters {
     method public java.util.Map<java.lang.String!,java.lang.String!> getAdditionalHeaders();
     method public androidx.webkit.NoVarySearchHeader? getExpectedNoVarySearchData();
@@ -484,6 +500,7 @@
     field public static final String SERVICE_WORKER_SHOULD_INTERCEPT_REQUEST = "SERVICE_WORKER_SHOULD_INTERCEPT_REQUEST";
     field public static final String SHOULD_OVERRIDE_WITH_REDIRECTS = "SHOULD_OVERRIDE_WITH_REDIRECTS";
     field public static final String SPECULATIVE_LOADING = "SPECULATIVE_LOADING_STATUS";
+    field @SuppressCompatibility @androidx.webkit.Profile.ExperimentalUrlPrefetch public static final String SPECULATIVE_LOADING_CONFIG = "SPECULATIVE_LOADING_CONFIG";
     field public static final String STARTUP_FEATURE_CONFIGURE_PARTITIONED_COOKIES = "STARTUP_FEATURE_CONFIGURE_PARTITIONED_COOKIES";
     field public static final String STARTUP_FEATURE_SET_DATA_DIRECTORY_SUFFIX = "STARTUP_FEATURE_SET_DATA_DIRECTORY_SUFFIX";
     field public static final String STARTUP_FEATURE_SET_DIRECTORY_BASE_PATHS = "STARTUP_FEATURE_SET_DIRECTORY_BASE_PATHS";
diff --git a/webkit/webkit/api/restricted_current.txt b/webkit/webkit/api/restricted_current.txt
index d147a89..4a0366f 100644
--- a/webkit/webkit/api/restricted_current.txt
+++ b/webkit/webkit/api/restricted_current.txt
@@ -80,6 +80,7 @@
     method @AnyThread @RequiresFeature(name=androidx.webkit.WebViewFeature.MULTI_PROFILE, enforcement="androidx.webkit.WebViewFeature#isFeatureSupported") public android.webkit.WebStorage getWebStorage();
     method @SuppressCompatibility @RequiresFeature(name=androidx.webkit.WebViewFeature.PROFILE_URL_PREFETCH, enforcement="androidx.webkit.WebViewFeature#isFeatureSupported") @UiThread @androidx.webkit.Profile.ExperimentalUrlPrefetch public void prefetchUrlAsync(String, android.os.CancellationSignal?, java.util.concurrent.Executor, androidx.webkit.OutcomeReceiverCompat<java.lang.Void!,androidx.webkit.PrefetchException!>);
     method @SuppressCompatibility @RequiresFeature(name=androidx.webkit.WebViewFeature.PROFILE_URL_PREFETCH, enforcement="androidx.webkit.WebViewFeature#isFeatureSupported") @UiThread @androidx.webkit.Profile.ExperimentalUrlPrefetch public void prefetchUrlAsync(String, android.os.CancellationSignal?, java.util.concurrent.Executor, androidx.webkit.SpeculativeLoadingParameters, androidx.webkit.OutcomeReceiverCompat<java.lang.Void!,androidx.webkit.PrefetchException!>);
+    method @SuppressCompatibility @RequiresFeature(name=androidx.webkit.WebViewFeature.SPECULATIVE_LOADING_CONFIG, enforcement="androidx.webkit.WebViewFeature#isFeatureSupported") @UiThread @androidx.webkit.Profile.ExperimentalUrlPrefetch public void setSpeculativeLoadingConfig(androidx.webkit.SpeculativeLoadingConfig);
     field public static final String DEFAULT_PROFILE_NAME = "Default";
   }
 
@@ -162,6 +163,21 @@
     method @RequiresFeature(name="REQUESTED_WITH_HEADER_ALLOW_LIST", enforcement="androidx.webkit.WebViewFeature#isFeatureSupported") public abstract void setRequestedWithHeaderOriginAllowList(java.util.Set<java.lang.String!>);
   }
 
+  @SuppressCompatibility @androidx.webkit.Profile.ExperimentalUrlPrefetch public class SpeculativeLoadingConfig {
+    method @IntRange(from=1, to=androidx.webkit.SpeculativeLoadingConfig.ABSOLUTE_MAX_PREFETCHES) public int getMaxPrefetches();
+    method @IntRange(from=1, to=java.lang.Integer.MAX_VALUE) public int getPrefetchTtlSeconds();
+    field public static final int ABSOLUTE_MAX_PREFETCHES = 20; // 0x14
+    field public static final int DEFAULT_MAX_PREFETCHES = 10; // 0xa
+    field public static final int DEFAULT_TTL_SECS = 60; // 0x3c
+  }
+
+  @SuppressCompatibility @androidx.webkit.Profile.ExperimentalUrlPrefetch public static final class SpeculativeLoadingConfig.Builder {
+    ctor public SpeculativeLoadingConfig.Builder();
+    method @SuppressCompatibility @androidx.webkit.Profile.ExperimentalUrlPrefetch public androidx.webkit.SpeculativeLoadingConfig build();
+    method public androidx.webkit.SpeculativeLoadingConfig.Builder setMaxPrefetches(@IntRange(from=1, to=androidx.webkit.SpeculativeLoadingConfig.ABSOLUTE_MAX_PREFETCHES) int);
+    method public androidx.webkit.SpeculativeLoadingConfig.Builder setPrefetchTtlSeconds(@IntRange(from=1, to=java.lang.Integer.MAX_VALUE) int);
+  }
+
   @SuppressCompatibility @RequiresFeature(name=androidx.webkit.WebViewFeature.PROFILE_URL_PREFETCH, enforcement="androidx.webkit.WebViewFeature#isFeatureSupported") @androidx.webkit.Profile.ExperimentalUrlPrefetch public final class SpeculativeLoadingParameters {
     method public java.util.Map<java.lang.String!,java.lang.String!> getAdditionalHeaders();
     method public androidx.webkit.NoVarySearchHeader? getExpectedNoVarySearchData();
@@ -484,6 +500,7 @@
     field public static final String SERVICE_WORKER_SHOULD_INTERCEPT_REQUEST = "SERVICE_WORKER_SHOULD_INTERCEPT_REQUEST";
     field public static final String SHOULD_OVERRIDE_WITH_REDIRECTS = "SHOULD_OVERRIDE_WITH_REDIRECTS";
     field public static final String SPECULATIVE_LOADING = "SPECULATIVE_LOADING_STATUS";
+    field @SuppressCompatibility @androidx.webkit.Profile.ExperimentalUrlPrefetch public static final String SPECULATIVE_LOADING_CONFIG = "SPECULATIVE_LOADING_CONFIG";
     field public static final String STARTUP_FEATURE_CONFIGURE_PARTITIONED_COOKIES = "STARTUP_FEATURE_CONFIGURE_PARTITIONED_COOKIES";
     field public static final String STARTUP_FEATURE_SET_DATA_DIRECTORY_SUFFIX = "STARTUP_FEATURE_SET_DATA_DIRECTORY_SUFFIX";
     field public static final String STARTUP_FEATURE_SET_DIRECTORY_BASE_PATHS = "STARTUP_FEATURE_SET_DIRECTORY_BASE_PATHS";
diff --git a/webkit/webkit/src/main/java/androidx/webkit/Profile.java b/webkit/webkit/src/main/java/androidx/webkit/Profile.java
index ec6fcb1..370e930 100644
--- a/webkit/webkit/src/main/java/androidx/webkit/Profile.java
+++ b/webkit/webkit/src/main/java/androidx/webkit/Profile.java
@@ -236,4 +236,22 @@
             @NonNull Executor callbackExecutor,
             @NonNull OutcomeReceiverCompat<Void, PrefetchException> operationCallback);
 
+    /**
+     * Sets the {@link SpeculativeLoadingConfig} for the current profile session.
+     * These configurations will be applied to any Prefetch requests made after they are set;
+     * they will not be applied to in-flight requests.
+     * <p>
+     * These configurations will be applied to any prefetch requests initiated by
+     * a prerender request. This applies specifically to WebViews that are
+     * associated with this Profile.
+     * <p>
+     * @param speculativeLoadingConfig the config to set for this profile session.
+     */
+    @RequiresFeature(name = WebViewFeature.SPECULATIVE_LOADING_CONFIG,
+            enforcement = "androidx.webkit.WebViewFeature#isFeatureSupported")
+    @UiThread
+    @ExperimentalUrlPrefetch
+    void setSpeculativeLoadingConfig(@NonNull SpeculativeLoadingConfig
+            speculativeLoadingConfig);
+
 }
diff --git a/webkit/webkit/src/main/java/androidx/webkit/SpeculativeLoadingConfig.java b/webkit/webkit/src/main/java/androidx/webkit/SpeculativeLoadingConfig.java
new file mode 100644
index 0000000..51ef8bd
--- /dev/null
+++ b/webkit/webkit/src/main/java/androidx/webkit/SpeculativeLoadingConfig.java
@@ -0,0 +1,151 @@
+/*
+ * Copyright 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 androidx.webkit;
+
+import androidx.annotation.IntRange;
+
+import org.jspecify.annotations.NonNull;
+
+/**
+ * Represents a configuration for speculative loading in a {@link Profile} instance. This should
+ * be set using {@link Profile#setSpeculativeLoadingConfig(SpeculativeLoadingConfig)}
+ */
+@Profile.ExperimentalUrlPrefetch
+public class SpeculativeLoadingConfig {
+
+    /**
+     * The absolute maximum number of prefetches allowed in cache.
+     */
+    public static final int ABSOLUTE_MAX_PREFETCHES = 20;
+
+    /**
+     * The default Time-to-Live (TTL) in seconds for prefetched data.
+     */
+    public static final int DEFAULT_TTL_SECS = 60;
+
+    /**
+     * The default number of prefetches allowed in cache.
+     */
+    public static final int DEFAULT_MAX_PREFETCHES = 10;
+
+    private final int mPrefetchTTLSeconds;
+
+    private final int mMaxPrefetches;
+
+    /**
+     * Private constructors, the application will need to use
+     * {@link Builder} for constructing instances of
+     * this class.
+     */
+    private SpeculativeLoadingConfig(int ttlSecs, int max) {
+        mPrefetchTTLSeconds = ttlSecs;
+        mMaxPrefetches = max;
+    }
+
+    /**
+     * The "time to live" for a prefetch inside of the prefetch cache.
+     * This is representative of the maximum time that a prefetch is considered
+     * valid and can be served to a navigation. This value is in seconds and
+     * defaults to {@link SpeculativeLoadingConfig#DEFAULT_TTL_SECS}.
+     */
+    @IntRange(from = 1, to = Integer.MAX_VALUE)
+    public int getPrefetchTtlSeconds() {
+        return mPrefetchTTLSeconds;
+    }
+
+    /**
+     * The max amount of prefetches that can live in the cache. Defaults to
+     * {@link SpeculativeLoadingConfig#DEFAULT_MAX_PREFETCHES}.
+     * <p>
+     * Cannot exceed {@link SpeculativeLoadingConfig#ABSOLUTE_MAX_PREFETCHES}.
+     */
+    @IntRange(from = 1, to = ABSOLUTE_MAX_PREFETCHES)
+    public int getMaxPrefetches() {
+        return mMaxPrefetches;
+    }
+
+    @Profile.ExperimentalUrlPrefetch
+    public static final class Builder {
+        private int mPrefetchTTLSeconds = DEFAULT_TTL_SECS;
+        private int mMaxPrefetches = DEFAULT_MAX_PREFETCHES;
+
+        public Builder() {
+        }
+
+        /**
+         * Sets the Time-to-Live (TTL) in seconds for prefetched data.
+         * <p>
+         * This value determines how long prefetched data will be considered valid before it is
+         * refreshed.
+         *
+         * @param ttlSeconds The TTL value in seconds. Must be a positive integer.
+         * @return This builder instance for method chaining.
+         * @throws IllegalArgumentException If {@code ttlSeconds} is less than 1.
+         * @see Builder#build()
+         */
+        @NonNull
+        public Builder setPrefetchTtlSeconds(
+                @IntRange(from = 1, to = Integer.MAX_VALUE) int ttlSeconds) {
+            if (ttlSeconds <= 0) {
+                throw new IllegalArgumentException("Prefetch TTL must be greater than 0");
+            }
+            mPrefetchTTLSeconds = ttlSeconds;
+            return this;
+        }
+
+        /**
+         * Sets the maximum number of allowed prefetches.
+         *
+         * <p>
+         * This value limits the number of prefetch data that can live in the cache.
+         *
+         * @param max The maximum number of prefetches. Must be a positive integer and not exceed
+         *            {@link SpeculativeLoadingConfig#ABSOLUTE_MAX_PREFETCHES}.
+         * @return This builder instance for method chaining.
+         * @throws IllegalArgumentException If {@code max} is less than 1 or greater than
+         *                                 {@link SpeculativeLoadingConfig#ABSOLUTE_MAX_PREFETCHES}.
+         * @see Builder#build()
+         */
+        @NonNull
+        public Builder setMaxPrefetches(@IntRange(from = 1, to = ABSOLUTE_MAX_PREFETCHES) int max) {
+            if (max > ABSOLUTE_MAX_PREFETCHES) {
+                String error = "Max prefetches cannot exceed" + ABSOLUTE_MAX_PREFETCHES;
+                throw new IllegalArgumentException(error);
+            }
+
+            if (max < 1) {
+                throw new IllegalArgumentException("Max prefetches must be greater than 0");
+            }
+            mMaxPrefetches = max;
+            return this;
+        }
+
+        /**
+         * Builds a new {@link SpeculativeLoadingConfig} instance.
+         * <p>
+         * This method creates a new {@link SpeculativeLoadingConfig} object using the parameters
+         * that have been set in this builder.
+         *
+         * @return A new {@link SpeculativeLoadingConfig} instance.
+         */
+        @Profile.ExperimentalUrlPrefetch
+        @NonNull
+        public SpeculativeLoadingConfig build() {
+            return new SpeculativeLoadingConfig(mPrefetchTTLSeconds, mMaxPrefetches);
+        }
+    }
+}
diff --git a/webkit/webkit/src/main/java/androidx/webkit/WebViewFeature.java b/webkit/webkit/src/main/java/androidx/webkit/WebViewFeature.java
index d532198..2411346 100644
--- a/webkit/webkit/src/main/java/androidx/webkit/WebViewFeature.java
+++ b/webkit/webkit/src/main/java/androidx/webkit/WebViewFeature.java
@@ -660,6 +660,14 @@
     public static final String PRERENDER_WITH_URL = "PRERENDER_URL_V2";
 
     /**
+     * Feature for {@link #isFeatureSupported(String)}.
+     * This feature covers
+     * {@link Profile#setSpeculativeLoadingConfig(SpeculativeLoadingConfig)}
+     */
+    @Profile.ExperimentalUrlPrefetch
+    public static final String SPECULATIVE_LOADING_CONFIG = "SPECULATIVE_LOADING_CONFIG";
+
+    /**
      * Return whether a feature is supported at run-time. This will check whether a feature is
      * supported, depending on the combination of the desired feature, the Android version of
      * device, and the WebView APK on the device.
diff --git a/webkit/webkit/src/main/java/androidx/webkit/internal/ProfileImpl.java b/webkit/webkit/src/main/java/androidx/webkit/internal/ProfileImpl.java
index dd61055..47c026a 100644
--- a/webkit/webkit/src/main/java/androidx/webkit/internal/ProfileImpl.java
+++ b/webkit/webkit/src/main/java/androidx/webkit/internal/ProfileImpl.java
@@ -25,6 +25,7 @@
 import androidx.webkit.OutcomeReceiverCompat;
 import androidx.webkit.PrefetchException;
 import androidx.webkit.Profile;
+import androidx.webkit.SpeculativeLoadingConfig;
 import androidx.webkit.SpeculativeLoadingParameters;
 
 import org.chromium.support_lib_boundary.ProfileBoundaryInterface;
@@ -152,4 +153,18 @@
         }
     }
 
+    @Override
+    public void setSpeculativeLoadingConfig(
+            @NonNull SpeculativeLoadingConfig speculativeLoadingConfig) {
+        ApiFeature.NoFramework feature = WebViewFeatureInternal.SPECULATIVE_LOADING_CONFIG;
+        if (feature.isSupportedByWebView()) {
+            InvocationHandler configInvocation =
+                    BoundaryInterfaceReflectionUtil.createInvocationHandlerFor(
+                            new SpeculativeLoadingConfigAdapter(speculativeLoadingConfig));
+            mProfileImpl.setSpeculativeLoadingConfig(configInvocation);
+        } else {
+            throw WebViewFeatureInternal.getUnsupportedOperationException();
+        }
+    }
+
 }
diff --git a/webkit/webkit/src/main/java/androidx/webkit/internal/SpeculativeLoadingConfigAdapter.java b/webkit/webkit/src/main/java/androidx/webkit/internal/SpeculativeLoadingConfigAdapter.java
new file mode 100644
index 0000000..a2a0501
--- /dev/null
+++ b/webkit/webkit/src/main/java/androidx/webkit/internal/SpeculativeLoadingConfigAdapter.java
@@ -0,0 +1,40 @@
+/*
+ * Copyright 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 androidx.webkit.internal;
+
+import androidx.webkit.SpeculativeLoadingConfig;
+
+import org.chromium.support_lib_boundary.SpeculativeLoadingConfigBoundaryInterface;
+import org.jspecify.annotations.NonNull;
+
+public class SpeculativeLoadingConfigAdapter implements SpeculativeLoadingConfigBoundaryInterface {
+    private final SpeculativeLoadingConfig mSpeculativeLoadingConfig;
+
+    public SpeculativeLoadingConfigAdapter(@NonNull SpeculativeLoadingConfig config) {
+        mSpeculativeLoadingConfig = config;
+    }
+
+    @Override
+    public int getMaxPrefetches() {
+        return mSpeculativeLoadingConfig.getMaxPrefetches();
+    }
+
+    @Override
+    public int getPrefetchTTLSeconds() {
+        return mSpeculativeLoadingConfig.getPrefetchTtlSeconds();
+    }
+}
diff --git a/webkit/webkit/src/main/java/androidx/webkit/internal/WebViewFeatureInternal.java b/webkit/webkit/src/main/java/androidx/webkit/internal/WebViewFeatureInternal.java
index cfd2156..df7473b 100644
--- a/webkit/webkit/src/main/java/androidx/webkit/internal/WebViewFeatureInternal.java
+++ b/webkit/webkit/src/main/java/androidx/webkit/internal/WebViewFeatureInternal.java
@@ -38,6 +38,7 @@
 import androidx.webkit.ProxyController;
 import androidx.webkit.SafeBrowsingResponseCompat;
 import androidx.webkit.ServiceWorkerClientCompat;
+import androidx.webkit.SpeculativeLoadingConfig;
 import androidx.webkit.SpeculativeLoadingParameters;
 import androidx.webkit.TracingConfig;
 import androidx.webkit.TracingController;
@@ -697,6 +698,13 @@
             new ApiFeature.NoFramework(WebViewFeature.PRERENDER_WITH_URL,
                     Features.PRERENDER_WITH_URL);
 
+    /**
+     * Feature for {@link WebViewFeature#isFeatureSupported(String)}.
+     * This feature covers {@link Profile#setSpeculativeLoadingConfig(SpeculativeLoadingConfig)}
+     */
+    public static final ApiFeature.NoFramework SPECULATIVE_LOADING_CONFIG =
+            new ApiFeature.NoFramework(WebViewFeature.SPECULATIVE_LOADING_CONFIG,
+                    Features.SPECULATIVE_LOADING_CONFIG);
 
     // --- Add new feature constants above this line ---
 
diff --git a/window/window/src/androidTest/java/androidx/window/WindowTestUtils.kt b/window/window/src/androidTest/java/androidx/window/WindowTestUtils.kt
index d8422e1..3b9f2f0 100644
--- a/window/window/src/androidTest/java/androidx/window/WindowTestUtils.kt
+++ b/window/window/src/androidTest/java/androidx/window/WindowTestUtils.kt
@@ -32,17 +32,17 @@
                 )
         }
 
-        fun assumeVendorApiLevel(level: Int) {
+        fun assumeWindowExtensionVersionEquals(level: Int) {
             val apiLevel = WindowSdkExtensions.getInstance().extensionVersion
             assumeTrue(apiLevel == level)
         }
 
-        fun assumeAtLeastVendorApiLevel(min: Int) {
+        fun assumeAtLeastWindowExtensionVersion(min: Int) {
             val apiLevel = WindowSdkExtensions.getInstance().extensionVersion
             assumeTrue(apiLevel >= min)
         }
 
-        fun assumeBeforeVendorApiLevel(max: Int) {
+        fun assumeBeforeWindowExtensionVersion(max: Int) {
             val apiLevel = WindowSdkExtensions.getInstance().extensionVersion
             assumeTrue(apiLevel < max)
             assumeTrue(apiLevel > 0)
diff --git a/window/window/src/androidTest/java/androidx/window/area/WindowAreaControllerImplTest.kt b/window/window/src/androidTest/java/androidx/window/area/WindowAreaControllerImplTest.kt
index d17ea2d..7fabe0f 100644
--- a/window/window/src/androidTest/java/androidx/window/area/WindowAreaControllerImplTest.kt
+++ b/window/window/src/androidTest/java/androidx/window/area/WindowAreaControllerImplTest.kt
@@ -28,7 +28,7 @@
 import androidx.annotation.RequiresApi
 import androidx.test.ext.junit.rules.ActivityScenarioRule
 import androidx.window.TestActivity
-import androidx.window.WindowTestUtils.Companion.assumeAtLeastVendorApiLevel
+import androidx.window.WindowTestUtils.Companion.assumeAtLeastWindowExtensionVersion
 import androidx.window.area.WindowAreaCapability.Operation.Companion.OPERATION_PRESENT_ON_AREA
 import androidx.window.area.WindowAreaCapability.Operation.Companion.OPERATION_TRANSFER_ACTIVITY_TO_AREA
 import androidx.window.area.WindowAreaCapability.Status.Companion.WINDOW_AREA_STATUS_AVAILABLE
@@ -82,7 +82,7 @@
     fun testRearFacingWindowAreaInfoList(): Unit =
         testScope.runTest {
             assumeTrue(Build.VERSION.SDK_INT > Build.VERSION_CODES.Q)
-            assumeAtLeastVendorApiLevel(minVendorApiLevel)
+            assumeAtLeastWindowExtensionVersion(minVendorApiLevel)
             activityScenario.scenario.onActivity {
                 val extensionComponent = FakeWindowAreaComponent()
                 val controller = WindowAreaControllerImpl(windowAreaComponent = extensionComponent)
@@ -163,7 +163,7 @@
     @Test
     fun testTransferToRearFacingWindowArea(): Unit =
         testScope.runTest {
-            assumeAtLeastVendorApiLevel(minVendorApiLevel)
+            assumeAtLeastWindowExtensionVersion(minVendorApiLevel)
             val extensions = FakeWindowAreaComponent()
             val controller = WindowAreaControllerImpl(windowAreaComponent = extensions)
             extensions.currentRearDisplayStatus = STATUS_AVAILABLE
@@ -234,7 +234,7 @@
         initialState: @WindowAreaComponent.WindowAreaStatus Int
     ) =
         testScope.runTest {
-            assumeAtLeastVendorApiLevel(minVendorApiLevel)
+            assumeAtLeastWindowExtensionVersion(minVendorApiLevel)
             val extensions = FakeWindowAreaComponent()
             val controller = WindowAreaControllerImpl(windowAreaComponent = extensions)
             extensions.currentRearDisplayStatus = initialState
@@ -278,7 +278,7 @@
     @Test
     fun testPresentRearDisplayArea(): Unit =
         testScope.runTest {
-            assumeAtLeastVendorApiLevel(minVendorApiLevel)
+            assumeAtLeastWindowExtensionVersion(minVendorApiLevel)
             val extensions = FakeWindowAreaComponent()
             val controller = WindowAreaControllerImpl(windowAreaComponent = extensions)
 
@@ -323,7 +323,7 @@
     @Test
     fun testRearDisplayPresentationModeSessionEndedError(): Unit =
         testScope.runTest {
-            assumeAtLeastVendorApiLevel(minVendorApiLevel)
+            assumeAtLeastWindowExtensionVersion(minVendorApiLevel)
             val extensionComponent = FakeWindowAreaComponent()
             val controller = WindowAreaControllerImpl(windowAreaComponent = extensionComponent)
 
@@ -361,7 +361,7 @@
     @Test
     fun testPresentContentWithNewControllerThrowsException(): Unit =
         testScope.runTest {
-            assumeAtLeastVendorApiLevel(minVendorApiLevel)
+            assumeAtLeastWindowExtensionVersion(minVendorApiLevel)
             val extensions = FakeWindowAreaComponent()
             val controller = WindowAreaControllerImpl(windowAreaComponent = extensions)
 
diff --git a/window/window/src/androidTest/java/androidx/window/embedding/EmbeddingAdapterTest.kt b/window/window/src/androidTest/java/androidx/window/embedding/EmbeddingAdapterTest.kt
index a44742b..afe4ef6 100644
--- a/window/window/src/androidTest/java/androidx/window/embedding/EmbeddingAdapterTest.kt
+++ b/window/window/src/androidTest/java/androidx/window/embedding/EmbeddingAdapterTest.kt
@@ -61,8 +61,8 @@
 
     @Test
     fun testTranslateSplitInfoWithDefaultAttrsWithApiLevel2() {
-        WindowTestUtils.assumeAtLeastVendorApiLevel(2)
-        WindowTestUtils.assumeBeforeVendorApiLevel(3)
+        WindowTestUtils.assumeAtLeastWindowExtensionVersion(2)
+        WindowTestUtils.assumeBeforeWindowExtensionVersion(3)
 
         val oemSplitInfo = createTestOEMSplitInfo(OEMSplitAttributes.Builder().build())
         val expectedSplitInfo =
@@ -80,8 +80,8 @@
     @Suppress("DEPRECATION")
     @Test
     fun testTranslateSplitInfoWithDefaultAttrsWithApiLevel3() {
-        WindowTestUtils.assumeAtLeastVendorApiLevel(3)
-        WindowTestUtils.assumeBeforeVendorApiLevel(5)
+        WindowTestUtils.assumeAtLeastWindowExtensionVersion(3)
+        WindowTestUtils.assumeBeforeWindowExtensionVersion(5)
 
         val oemSplitInfo =
             createTestOEMSplitInfo(
@@ -103,7 +103,7 @@
 
     @Test
     fun testTranslateSplitInfoWithDefaultAttrsWithApiLevel5() {
-        WindowTestUtils.assumeAtLeastVendorApiLevel(5)
+        WindowTestUtils.assumeAtLeastWindowExtensionVersion(5)
 
         val oemSplitInfo =
             createTestOEMSplitInfo(
@@ -135,8 +135,8 @@
 
     @Test
     fun testTranslateSplitInfoWithExpandingContainersWithApiLevel2() {
-        WindowTestUtils.assumeAtLeastVendorApiLevel(2)
-        WindowTestUtils.assumeBeforeVendorApiLevel(3)
+        WindowTestUtils.assumeAtLeastWindowExtensionVersion(2)
+        WindowTestUtils.assumeBeforeWindowExtensionVersion(3)
 
         val oemSplitInfo =
             createTestOEMSplitInfo(
@@ -159,8 +159,8 @@
     @Suppress("DEPRECATION")
     @Test
     fun testTranslateSplitInfoWithExpandingContainersWithApiLevel3() {
-        WindowTestUtils.assumeAtLeastVendorApiLevel(3)
-        WindowTestUtils.assumeBeforeVendorApiLevel(5)
+        WindowTestUtils.assumeAtLeastWindowExtensionVersion(3)
+        WindowTestUtils.assumeBeforeWindowExtensionVersion(5)
 
         val oemSplitInfo =
             createTestOEMSplitInfo(
@@ -184,7 +184,7 @@
 
     @Test
     fun testTranslateSplitInfoWithExpandingContainersWithApiLevel5() {
-        WindowTestUtils.assumeAtLeastVendorApiLevel(5)
+        WindowTestUtils.assumeAtLeastWindowExtensionVersion(5)
 
         val oemSplitInfo =
             createTestOEMSplitInfo(
@@ -219,7 +219,7 @@
     @Suppress("DEPRECATION")
     @Test
     fun testTranslateSplitInfoWithApiLevel1() {
-        WindowTestUtils.assumeBeforeVendorApiLevel(2)
+        WindowTestUtils.assumeBeforeWindowExtensionVersion(2)
 
         val activityStack = createTestOEMActivityStack(ArrayList(), true)
         val expectedSplitRatio = 0.3f
@@ -245,8 +245,8 @@
 
     @Test
     fun testTranslateSplitInfoWithApiLevel2() {
-        WindowTestUtils.assumeAtLeastVendorApiLevel(2)
-        WindowTestUtils.assumeBeforeVendorApiLevel(3)
+        WindowTestUtils.assumeAtLeastWindowExtensionVersion(2)
+        WindowTestUtils.assumeBeforeWindowExtensionVersion(3)
 
         val oemSplitInfo =
             createTestOEMSplitInfo(
@@ -270,8 +270,8 @@
     @Suppress("DEPRECATION")
     @Test
     fun testTranslateSplitInfoWithApiLevel3() {
-        WindowTestUtils.assumeAtLeastVendorApiLevel(3)
-        WindowTestUtils.assumeBeforeVendorApiLevel(5)
+        WindowTestUtils.assumeAtLeastWindowExtensionVersion(3)
+        WindowTestUtils.assumeBeforeWindowExtensionVersion(5)
 
         val oemSplitInfo =
             createTestOEMSplitInfo(
@@ -296,7 +296,7 @@
 
     @Test
     fun testTranslateSplitInfoWithApiLevel5() {
-        WindowTestUtils.assumeAtLeastVendorApiLevel(5)
+        WindowTestUtils.assumeAtLeastWindowExtensionVersion(5)
 
         val oemSplitInfo =
             createTestOEMSplitInfo(
@@ -331,7 +331,7 @@
 
     @Test
     fun testTranslateAnimationBackgroundWithApiLevel5() {
-        WindowTestUtils.assumeAtLeastVendorApiLevel(5)
+        WindowTestUtils.assumeAtLeastWindowExtensionVersion(5)
 
         val colorBackground = EmbeddingAnimationBackground.createColorBackground(Color.BLUE)
         val splitAttributesWithColorBackground =
@@ -378,8 +378,8 @@
 
     @Test
     fun testTranslateAnimationBackgroundBeforeApiLevel5() {
-        WindowTestUtils.assumeAtLeastVendorApiLevel(2)
-        WindowTestUtils.assumeBeforeVendorApiLevel(5)
+        WindowTestUtils.assumeAtLeastWindowExtensionVersion(2)
+        WindowTestUtils.assumeBeforeWindowExtensionVersion(5)
 
         val colorBackground = EmbeddingAnimationBackground.createColorBackground(Color.BLUE)
         val splitAttributesWithColorBackground =
@@ -402,7 +402,7 @@
     @OptIn(androidx.window.core.ExperimentalWindowApi::class)
     @Test
     fun testTranslateEmbeddingConfigurationToWindowAttributes() {
-        WindowTestUtils.assumeAtLeastVendorApiLevel(5)
+        WindowTestUtils.assumeAtLeastWindowExtensionVersion(5)
 
         val dimAreaBehavior = EmbeddingConfiguration.DimAreaBehavior.ON_TASK
         adapter.embeddingConfiguration =
@@ -414,7 +414,7 @@
 
     @Test
     fun testTranslateDividerAttributes_draggable() {
-        WindowTestUtils.assumeAtLeastVendorApiLevel(6)
+        WindowTestUtils.assumeAtLeastWindowExtensionVersion(6)
         val dividerAttributes =
             DraggableDividerAttributes.Builder()
                 .setWidthDp(20)
@@ -435,7 +435,7 @@
 
     @Test
     fun testTranslateDividerAttributes_fixed() {
-        WindowTestUtils.assumeAtLeastVendorApiLevel(6)
+        WindowTestUtils.assumeAtLeastWindowExtensionVersion(6)
         val dividerAttributes =
             FixedDividerAttributes.Builder().setWidthDp(20).setColor(Color.GRAY).build()
         val oemDividerAttributes =
@@ -467,7 +467,7 @@
 
     @Test
     fun testTranslateDividerAttributes_0width_withApiLevel7() {
-        WindowTestUtils.assumeVendorApiLevel(7)
+        WindowTestUtils.assumeWindowExtensionVersionEquals(7)
         val dividerAttributes =
             DraggableDividerAttributes.Builder().setWidthDp(0).setColor(Color.GRAY).build()
 
@@ -484,7 +484,7 @@
 
     @Test
     fun testTranslateDividerAttributes_noDivider() {
-        WindowTestUtils.assumeAtLeastVendorApiLevel(6)
+        WindowTestUtils.assumeAtLeastWindowExtensionVersion(6)
         val dividerAttributes = DividerAttributes.NO_DIVIDER
         val oemDividerAttributes = null
 
diff --git a/window/window/src/androidTest/java/androidx/window/layout/WindowInfoTrackerImplTest.kt b/window/window/src/androidTest/java/androidx/window/layout/WindowInfoTrackerImplTest.kt
index 7cf977a..30c985d 100644
--- a/window/window/src/androidTest/java/androidx/window/layout/WindowInfoTrackerImplTest.kt
+++ b/window/window/src/androidTest/java/androidx/window/layout/WindowInfoTrackerImplTest.kt
@@ -27,8 +27,8 @@
 import androidx.window.TestActivity
 import androidx.window.WindowSdkExtensions
 import androidx.window.WindowTestUtils
-import androidx.window.WindowTestUtils.Companion.assumeAtLeastVendorApiLevel
-import androidx.window.WindowTestUtils.Companion.assumeBeforeVendorApiLevel
+import androidx.window.WindowTestUtils.Companion.assumeAtLeastWindowExtensionVersion
+import androidx.window.WindowTestUtils.Companion.assumeBeforeWindowExtensionVersion
 import androidx.window.layout.adapter.WindowBackend
 import com.google.common.truth.Truth.assertThat
 import com.google.common.truth.TruthJUnit.assume
@@ -91,7 +91,7 @@
     fun testWindowLayoutInfo_contextAsListener() =
         testScope.runTest {
             assume().that(Build.VERSION.SDK_INT).isAtLeast(Build.VERSION_CODES.R)
-            assumeAtLeastVendorApiLevel(2)
+            assumeAtLeastWindowExtensionVersion(2)
             Dispatchers.setMain(testDispatcher) // Needed for flowOn(Dispatchers.Main).
             val collector = mutableListOf<WindowLayoutInfo>()
             val windowContext = WindowTestUtils.createOverlayWindowContext()
@@ -127,7 +127,7 @@
     fun testWindowLayoutInfo_multicastingWithContext() =
         testScope.runTest {
             assume().that(Build.VERSION.SDK_INT).isAtLeast(Build.VERSION_CODES.R)
-            assumeAtLeastVendorApiLevel(2)
+            assumeAtLeastWindowExtensionVersion(2)
             Dispatchers.setMain(testDispatcher) // Needed for flowOn(Dispatchers.Main).
             val collector = mutableListOf<WindowLayoutInfo>()
             val windowContext = WindowTestUtils.createOverlayWindowContext()
@@ -146,7 +146,7 @@
     fun testWindowLayoutInfo_nonUiContext_throwsError() =
         testScope.runTest {
             assume().that(Build.VERSION.SDK_INT).isAtLeast(Build.VERSION_CODES.R)
-            assumeAtLeastVendorApiLevel(2)
+            assumeAtLeastWindowExtensionVersion(2)
             Dispatchers.setMain(testDispatcher) // Needed for flowOn(Dispatchers.Main).
             val context: Context = ApplicationProvider.getApplicationContext()
             val tracker = WindowInfoTracker.getOrCreate(context)
@@ -160,7 +160,7 @@
 
     @Test
     fun testSupportedWindowPostures_throwsBeforeApi6() {
-        assumeBeforeVendorApiLevel(6)
+        assumeBeforeWindowExtensionVersion(6)
         activityScenario.scenario.onActivity { _ ->
             assertFailsWith<UnsupportedOperationException> { tracker.supportedPostures }
         }
@@ -168,7 +168,7 @@
 
     @Test
     fun testSupportedWindowPostures_reportsFeatures() {
-        assumeAtLeastVendorApiLevel(6)
+        assumeAtLeastWindowExtensionVersion(6)
         activityScenario.scenario.onActivity { _ ->
             val fakeBackend =
                 FakeWindowBackend(supportedPostures = listOf(SupportedPosture.TABLETOP))
diff --git a/window/window/src/androidTest/java/androidx/window/layout/adapter/extensions/ExtensionWindowBackendTest.kt b/window/window/src/androidTest/java/androidx/window/layout/adapter/extensions/ExtensionWindowBackendTest.kt
index 22b63c7..e4f0e55 100644
--- a/window/window/src/androidTest/java/androidx/window/layout/adapter/extensions/ExtensionWindowBackendTest.kt
+++ b/window/window/src/androidTest/java/androidx/window/layout/adapter/extensions/ExtensionWindowBackendTest.kt
@@ -30,8 +30,8 @@
 import androidx.window.TestActivity
 import androidx.window.TestConsumer
 import androidx.window.WindowTestUtils
-import androidx.window.WindowTestUtils.Companion.assumeAtLeastVendorApiLevel
-import androidx.window.WindowTestUtils.Companion.assumeBeforeVendorApiLevel
+import androidx.window.WindowTestUtils.Companion.assumeAtLeastWindowExtensionVersion
+import androidx.window.WindowTestUtils.Companion.assumeBeforeWindowExtensionVersion
 import androidx.window.core.ConsumerAdapter
 import androidx.window.core.ExtensionsUtil
 import androidx.window.extensions.core.util.function.Consumer as OEMConsumer
@@ -81,7 +81,7 @@
 
     @Test
     fun testExtensionWindowBackend_delegatesToWindowLayoutComponent() {
-        assumeAtLeastVendorApiLevel(1)
+        assumeAtLeastWindowExtensionVersion(1)
         val component = RequestTrackingWindowComponent()
 
         val backend = ExtensionWindowBackend.newInstance(component, consumerAdapter)
@@ -99,7 +99,7 @@
         if (Build.VERSION.SDK_INT < Build.VERSION_CODES.R) {
             return
         }
-        assumeAtLeastVendorApiLevel(2)
+        assumeAtLeastWindowExtensionVersion(2)
 
         val component = RequestTrackingWindowComponent()
 
@@ -123,7 +123,7 @@
     @Suppress("Deprecation")
     @Test
     fun testExtensionWindowBackend_registerAtMostOnce() {
-        assumeBeforeVendorApiLevel(2)
+        assumeBeforeWindowExtensionVersion(2)
         val component = mock<WindowLayoutComponent>()
 
         val backend = ExtensionWindowBackend.newInstance(component, consumerAdapter)
@@ -143,7 +143,7 @@
         if (Build.VERSION.SDK_INT < Build.VERSION_CODES.R) {
             return
         }
-        assumeAtLeastVendorApiLevel(2)
+        assumeAtLeastWindowExtensionVersion(2)
 
         val component = mock<WindowLayoutComponent>()
 
@@ -203,7 +203,7 @@
         if (Build.VERSION.SDK_INT < Build.VERSION_CODES.R) {
             return
         }
-        assumeAtLeastVendorApiLevel(2)
+        assumeAtLeastWindowExtensionVersion(2)
 
         val component = FakeWindowComponent()
         val windowContext = WindowTestUtils.createOverlayWindowContext()
@@ -227,7 +227,7 @@
     @Suppress("NewApi", "Deprecation") // java.util.function.Consumer was added in API 24 (N)
     @Test
     fun testExtensionWindowBackend_infoReplayedForAdditionalListener() {
-        assumeBeforeVendorApiLevel(2)
+        assumeBeforeWindowExtensionVersion(2)
         assumeTrue(Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)
 
         val component =
@@ -257,7 +257,7 @@
         if (Build.VERSION.SDK_INT < Build.VERSION_CODES.R) {
             return
         }
-        assumeAtLeastVendorApiLevel(2)
+        assumeAtLeastWindowExtensionVersion(2)
 
         val component =
             mock<WindowLayoutComponent> {
@@ -289,7 +289,7 @@
     @Suppress("Deprecation")
     @Test
     fun testExtensionWindowBackend_removeMatchingCallback() {
-        assumeBeforeVendorApiLevel(2)
+        assumeBeforeWindowExtensionVersion(2)
         val component = mock<WindowLayoutComponent>()
 
         val backend = ExtensionWindowBackend.newInstance(component, consumerAdapter)
@@ -309,7 +309,7 @@
     @Suppress("Deprecation")
     @Test
     fun testExtensionWindowBackend_removesMultipleCallback() {
-        assumeBeforeVendorApiLevel(2)
+        assumeBeforeWindowExtensionVersion(2)
         val component = mock<WindowLayoutComponent>()
 
         val backend = ExtensionWindowBackend.newInstance(component, consumerAdapter)
@@ -341,7 +341,7 @@
             // createWindowContext is available after R.
             return
         }
-        assumeAtLeastVendorApiLevel(2)
+        assumeAtLeastWindowExtensionVersion(2)
 
         val component = mock<WindowLayoutComponent>()
 
@@ -377,7 +377,7 @@
             // createWindowContext is available after R.
             return
         }
-        assumeAtLeastVendorApiLevel(2)
+        assumeAtLeastWindowExtensionVersion(2)
 
         val component = mock<WindowLayoutComponent>()
 
@@ -421,7 +421,7 @@
     @Suppress("Deprecation")
     @Test
     fun testExtensionWindowBackend_reRegisterCallback() {
-        assumeBeforeVendorApiLevel(2)
+        assumeBeforeWindowExtensionVersion(2)
         val component = mock<WindowLayoutComponent>()
 
         val backend = ExtensionWindowBackend.newInstance(component, consumerAdapter)
@@ -448,7 +448,7 @@
         if (Build.VERSION.SDK_INT < Build.VERSION_CODES.R) {
             return
         }
-        assumeAtLeastVendorApiLevel(2)
+        assumeAtLeastWindowExtensionVersion(2)
 
         val component = mock<WindowLayoutComponent>()
 
@@ -480,7 +480,7 @@
 
     @Test
     fun testRegisterLayoutChangeCallback_clearListeners() {
-        assumeBeforeVendorApiLevel(2)
+        assumeBeforeWindowExtensionVersion(2)
         activityScenario.scenario.onActivity { activity ->
             val component = FakeWindowComponent()
             val backend = ExtensionWindowBackend.newInstance(component, consumerAdapter)
@@ -518,7 +518,7 @@
         if (Build.VERSION.SDK_INT < Build.VERSION_CODES.R) {
             return
         }
-        assumeAtLeastVendorApiLevel(2)
+        assumeAtLeastWindowExtensionVersion(2)
 
         activityScenario.scenario.onActivity { activity ->
             val component = FakeWindowComponent()
@@ -550,7 +550,7 @@
     @RequiresApi(Build.VERSION_CODES.R)
     @Test
     fun testLayoutChangeCallback_emitNewValue() {
-        assumeBeforeVendorApiLevel(2)
+        assumeBeforeWindowExtensionVersion(2)
         activityScenario.scenario.onActivity { activity ->
             val component = FakeWindowComponent()
             val backend = ExtensionWindowBackend.newInstance(component, consumerAdapter)
@@ -571,7 +571,7 @@
         if (Build.VERSION.SDK_INT < Build.VERSION_CODES.R) {
             return
         }
-        assumeAtLeastVendorApiLevel(2)
+        assumeAtLeastWindowExtensionVersion(2)
 
         val component = FakeWindowComponent()
         val backend = ExtensionWindowBackend.newInstance(component, consumerAdapter)
@@ -589,7 +589,7 @@
     @RequiresApi(Build.VERSION_CODES.R)
     @Test
     fun testWindowLayoutInfo_updatesOnSubsequentRegistration() {
-        assumeAtLeastVendorApiLevel(1)
+        assumeAtLeastWindowExtensionVersion(1)
         activityScenario.scenario.onActivity { activity ->
             val component = FakeWindowComponent()
             val backend = ExtensionWindowBackend.newInstance(component, consumerAdapter)
@@ -616,7 +616,7 @@
         if (Build.VERSION.SDK_INT < Build.VERSION_CODES.R) {
             return
         }
-        assumeAtLeastVendorApiLevel(2)
+        assumeAtLeastWindowExtensionVersion(2)
 
         val component = FakeWindowComponent()
         val backend = ExtensionWindowBackend.newInstance(component, consumerAdapter)
@@ -643,7 +643,7 @@
 
     @Test
     fun testSupportedFeatures_throwsBeforeApi6() {
-        assumeBeforeVendorApiLevel(6)
+        assumeBeforeWindowExtensionVersion(6)
 
         val component = FakeWindowComponent()
         val backend = ExtensionWindowBackend.newInstance(component, consumerAdapter)
@@ -653,7 +653,7 @@
 
     @Test
     fun testSupportedFeatures_emptyListReturnsNoFeatures() {
-        assumeAtLeastVendorApiLevel(6)
+        assumeAtLeastWindowExtensionVersion(6)
 
         val supportedWindowFeatures = SupportedWindowFeatures.Builder(listOf()).build()
         val component = FakeWindowComponent(windowFeatures = supportedWindowFeatures)
@@ -665,7 +665,7 @@
 
     @Test
     fun testSupportedFeatures_halfOpenedReturnsTabletopSupport() {
-        assumeAtLeastVendorApiLevel(6)
+        assumeAtLeastWindowExtensionVersion(6)
 
         val foldFeature =
             DisplayFoldFeature.Builder(DisplayFoldFeature.TYPE_SCREEN_FOLD_IN)
