February 12, 2025

New Features

  • Added hand tracking support. Use Hand.left and Hand.right to access the tracking information.
  • APIs that generate an anchor (Anchor.create, Anchor.load, Plane.createAnchor) now all return AnchorCreateResult and properly implement AnchorCreateResourcesExhausted.

Bug fixes

  • Anchor.detach no longer causes a fatal crash due to a race condition with the Session update thread.
  • Anchor.create is more stable when running on an emulator

API Changes

  • Moved TraceProcessor.runSession() extension APIs to be experimental, as they are likely to move to be concrete constructors eventually on Android. Ib0528 b/393640753
  • Most of the implementation of Startup Insights are now public/experimental, and move to the TraceProcessor artifact See StartupInsights. I0aa00
  • Deprecate BenchmarkRule.runWithTimingDisabled {} in favor of BenchmarkRule.runWithMeasurementDisabled {}, which more clearly describes the behavior - all metrics are paused. Additionally, expose the MicrobenchmarkScope superclass since redeclaring the runWithMeasurementDisabled function to open access isn't possible, since it's inline. I9e23b b/389149423 b/149979716
  • Benchmark libraries have moved to Kotlin 2.0. I9d1e0
  • Removed androidx.benchmark.startupProfiles.enable instrumentation argument. It is no longer useful, as it can be controlled by includeInStartupProfile arg in BaselineProfileRule.collect(). I39eb4

Bug Fixes

  • Reduced the amount of Microbenchmark internal functions called during profiling to make e.g. Method traces more clear Ifaed8
  • Speculative fix for crashes: 'Failed to stop [ProcessPid(processName=perfetto, pid=...)]'. Now Benchmark will log a message instead of crashing when a background Perfetto process isn't able to be stopped before running the benchmark. I37d3e b/323601788
  • Fix IllegalStateExceptions with 'Expected pm dump-profiles stdout' label that were caused by overly strict output format check. I358dc

Bug Fixes

  • Fixed an issue where overscroll implementations using LayoutModifierNode would not work correctly inside scrolling containers.

New Features

  • Added an TimePickerDialog API that can be used for TimePicker, TimeInput or to have a switchable version. Id2d83

  • New search bar APIs:

    • Collapsed search bars and expanded search "views" are now separate composables.
    • SearchBar represents a search bar in the collapsed state.
    • ExpandedFullScreenSearchBar and ExpandedDockedSearchBar represent the search bar in the expanded state. These open in a new window.
    • SearchBarState to control the state of the search bar
    • TopSearchBar to add insets handling and scroll behavior
    • New overload of InputField which uses SearchBarState Ie0723 b/261496232 b/283311462 b/350916229 b/352872248

API Changes

  • Support corner shape morphing of icon buttons on press. I21843
  • Text field decorator/decoration box APIs are no longer experimental. I31d95
  • Added samples and defaults for the connected variant for ButtonGroup. I5c8ce
  • Make state param the last one in NavigationSuiteScaffold and NavigationSuiteScaffoldLayout. I9cc7b

Bug Fixes

  • Added custom accessibility actions to the FloatingToolbars so accessibility services can now expand or collapse all FloatingToolbar variations. The FAB-equipped version applies this to the FAB, while the FAB-less version applies it to the main content. I26420
  • The FloatingToolbars now observe the touch exploration service (e.g., TalkBack) and keep the toolbar expanded and visible whenever the service is on. I02172
  • Fixed a crash at the progress and loading indicators in case a Float.NaN is passed in as a progress. I4fa96 b/352364576

API Changes

  • Changed how isPredictiveBackInProgress is set in MutableThreePaneScaffoldState animation functions to preserve state consistency. Idc97f

Bug Fixes

  • The default back behavior of NavigableListDetailPaneScaffold and NavigableSupportingPaneScaffold has been changed to PopUntilScaffoldValueChange for consistency with the rest of the library. I873f0
  • Set the correct accessibility traversing order of pane scaffolds. 67d030
  • Fix the issue that pane content states are not saved. 88b0ff
  • Support alternative accessibility actions in place of dragging. 28266d
  • Announce the current pane split after it's changed. 0c3a80

New Features

  • Added a lint check to warn against calls to Configuration#screenWidth/heightDp - LocalWindowInfo.current.containerSize can be used instead to retrieve the current window size.

Bug Fixes

  • FragmentContainerView's setOnApplyWindowInsetsListener override now takes a null listener, matching what the framework allows. I575f0 b/282790626

Major features of 4.0.0

  • AAR files now contain prebuilt static libraries. Application code is now expected to use those libraries via prefabs and only include headers (like #include "GameActivity.h") instead of including the implementation (like #include "GameActivity.cpp").
  • Also Android locale information is now available to the native code that uses GameActivity.

Bug Fixes

  • Numerous bugs in GameTextInput have been fixed. The library is now more stable and works with many popular software and hardware keyboards.

New Features

  • Disk and network size savings: Serialization of StrokeInputBatch, saving many lines of code, with the resulting objects a tiny fraction of the size of traditionally stored strokes. Ie898d
  • Lasso selection: dashed line brush to draw a selection stroke, and a function to turn the selection stroke into a PartitionedMesh for geometry queries. Ia38a0

New Features

  • The Activity Panel can now scrim its content when a Spatial Dialog is activated.
  • The Orbiter API is now usable in SubspaceComposable contexts and will attach Orbiters to their nearest SubspaceLayout-based composable parent.
  • Introduced LayoutCoordinatesAwareModifierNode to allow custom positioning-based modifiers.
  • Added attach/detach lifecycle methods to SubspaceModifier.Node.
  • Added scaleWithDistance to the movable modifier. When scaleWithDistance is enabled, the subspace element moved will grow or shrink. It will also maintain any explicit scale that it had before movement.

API Changes

  • Removed SessionCallbackProvider in favor of SpatialCapabilities.

Other changes

  • Reduced minSDK to 24. All Jetpack XR APIs continue to require API 34 at runtime.
  • Orbiter EdgeOffset.inner, EdgeOffset.outer, and EdgeOffset.overlap constructors are no longer @Composable methods, which allows them to be used in non-composable contexts.
  • Update Spatial Elevation Levels to match the latest UX spec.
  • Implement SubspaceSemanticsInfo interface into MeasurableLayout.
  • Renamed SubspaceModifierElement to SubspaceModifierNodeElement.

Bug fixes

  • Fixes to stabilize SubspaceModifier ordering. SubspaceModifier should behave more reliably. Offset, rotate, scale, movable, and resizable modifier should now be usable in any order.

Upcoming breaking change affecting apps built before 1.0.0-alpha02

  • Factory methods have been moved from the Session class to a companion method on each respective type:
    • Session.createActivityPanelEntity(Dimensions, String, Activity, Pose) has been deleted and replaced with ActivityPanelEntity.create(Session, Dimensions, String, Pose)
    • Session.createAnchorEntity(Anchor) has been deleted and replaced with AnchorEntity.create(Session, Anchor)
    • Session.createAnchorEntity(Dimensions, Int, Int, Duration) has been deleted and replaced with AnchorEntity.create(Session, Dimensions, Int, Int, Duration)
    • Session.createEntity(String, Pose) has been deleted and replaced with ContentlessEntity.create(Session, String, Pose)
    • Session.createExrImageResource(String) has been deleted and replaced with ExrImage.create(Session, String)
    • Session.createGltfEntity(GltfModel, Pose) has been deleted and replaced with GltfModelEntity.create(Session, GltfModel, Pose)
    • Session.createGltfModelResource(String) has been deleted and replaced with GltfModel.create(Session, String)
    • Session.createInteractableComponent(Executor, InputEventListener) has been deleted and replaced with InteractableComponent.create(Session, Executor, InputEventListener)
    • Session.createMovableComponent(Boolean, Boolean, Set<AnchorPlacement>, Boolean) has been deleted and replaced with MovableComponent.create(Session, Boolean, Boolean, Set<AnchorPlacement>, Boolean)
    • Session.createPanelEntity(View, Dimensions, Dimensions, String, Pose) has been deleted and replaced with PanelEntity.create(Session, View, Dimensions, Dimensions, String, Pose)
    • Session.createResizableComponent(Dimensions, Dimensions) has been deleted and replaced with ResizableComponent.create(Session, Dimensions, Dimensions)
    • Session.createStereoSurfaceEntity(Int, Dimensions, Pose) has been deleted and replaced with StereoSurface.create(Session, Int, Dimensions, Pose)
  • The following deprecated methods were removed:
    • Session.canEmbedActivityPanel(Activity) has been deleted. Use getSpatialCapabilities.hasCapabilility(SPATIAL_CAPABILITY_EMBED_ACTIVITY) instead.
    • Session.hasSpatialCapability(Int) has been deleted. It has been replaced in favor of using getSpatialCapabilities().hasCapability() as a more compartmentalized way to check for the presence of spatial capabilities since getSpatialCapabilities() returns a SpatialCapabilities object.
    • Session.requestFullSpaceMode() has been deleted and replaced with SpatialEnvironment.requestFullSpaceMode()
    • Session.requestHomeSpaceMode() has been deleted and replaced with SpatialEnvironment.requestHomeSpaceMode()
  • Session.setFullSpaceMode(Bundle) and Session.setFullSpaceModeWithEnvironmentInherited(Bundle) have been moved to extension functions. Developer files will need to add the new imports for access:
    • import androidx.xr.scenecore.setFullSpaceMode
    • import androidx.xr.scenecore.setFullSpaceModeWithEnvironmentInherited
  • Session.setPreferredAspectRatio(Activity, Float) has been moved to an extension function. Developer files will need to add the new import for access:
    • import androidx.xr.scenecore.setPreferredAspectRatio
  • Session.getEntitiesOfType(Class<out T>) and Session.getEntityForRtEntity(RtEntity) have been moved to extension functions. Developer files will need to add the new imports for access:
    • import androidx.xr.scenecore.getEntitiesOfType
    • import androidx.xr.scenecore.getEntityForRtEntity
  • Session.unpersistAnchor(Anchor) has been deleted
  • Session.createPersistedAnchorEntity(UUID) has been deleted

Known issues

  • PanelEntity.setCornerRadius() and ActivityPanelEntity.setCornerRadius() may not take effect until the panel is next moved, this can be mitigated by moving the panel to its current position
  • When BoundsChanged is called on the ActivitySpace, some ActivityPoses may not have been correctly updated. It will be updated on the following OnSpaceUpdated call on the ActivitySpace

Breaking & behavioral changes

  • PanelEntity and ActivityPanelEntity will have a default corner radius of 32dp or smaller if the panel has a width or height smaller than 32dp

New APIs and capabilities

  • Introduces StereoSurface.CanvasShape, which allows for the creation of Spherical and Hemispherical canvases for rendering immersive media.
  • StereoSurfaceEntity.create() now accepts a CanvasShape parameter. (This parameter is currently ignored, but will be used in a future release)
  • StereoSurfaceEntity.create() no longer takes a Dimensions parameter. Applications should control the size of the canvas through setting the CanvasShape
  • StereoSurfaceEntity has a CanvasShape member which can be set dynamically.
  • StereoSurfaceEntity.dimensions is now a read-only property; applications should set the CanvasShape to change dimensions.
  • StereoSurfaceEntity now allows the StereoMode to be re-set after construction.

Other changes

  • Reduced compile-time minSDK to 24. All Jetpack XR APIs continue to require API 34 at runtime.
  • SceneCore's Session factory (Session.create) no longer launches an intent to acquire the SCENE_UNDERSTANDING permission. Instead, the client application must explicitly request the permissions from the user, before attempting to create the anchors. Anchor creation will fail if the permission is not granted by the user.

Bug fixes

  • getActivitySpacePose() has been fixed to account for the ActivitySpace scale by returning translation values in scaled meters rather than always returning non-scaled meters. transformPoseTo now also uses the right units to compute coordinate changes when the ActivitySpace is involved in the source or destination.
  • The skybox will now be set to an all-black skybox whenever a null skybox preference is passed using setSpatialEnvironmentPreference(new SpatialEnvironmentPreference(null, geom)). To revert to the system default skybox and geometry, use setSpatialEnvironmentPreference(null).

API Changes

  • Move MutableStateSerializer to savedstate-compose from lifecycle-viewmodel-compose. I4f690 b/378895074

External Contribution

  • Adds a new Lint issue for calling Lifecycle::currentState in composition, instead suggesting using currentStateAsalue().value to ensure that changes in the Lifecycle state correctly cause recomposition. Thanks Steven Schoen! Iad484

New Features

  • Navigation Safe Args actions are now generated with the @CheckResult annotation to ensure they are used. I14d4c b/356323084

Bug Fixes

  • Fixed an error in NavController where the backStack states were incorrectly attempted to be restored into an array when they were saved into a list. Idfb9b
  • From Navigation 2.8.7: Navigation Safe Args now provides support for composable destinations. I35320 b/362791955

Bug Fixes

  • Refresh and retry signals sent during an initial Refresh will now be stored and automatically re-sent once the Paging presenter is ready.

External Contribution

  • Thank you Eva for submitting the bug fix #754

Bug Fixes

  • Fix an issue with RoomDatabase.inTransaction() opening a closed database when it shouldn’t and should quickly return false if the database is closed b/325432967.
  • Fix a crash (IllegalArgumentException: not a valid name) in Room’s compiler when processing DAO functions with Kotlin inline / value classes b/388299754.
  • Include Proguard rules in the JVM artifact of room-runtime so that the default constructor of the generated database implementation is not removed since it is used by Room’s default initialization that uses reflection b/392657750.

New Features

  • Move MutableStateSerializer to savedstate-compose from lifecycle-viewmodel-compose, allowing you to use the SavedState Serialization APIs with Compose’s MutableState. I4f690 b/378895074

API Changes

  • Add a factory function to create SavedState from an existing SavedState. I39f9a
  • Adds support for Array<SavedState> and List<SavedState> in androidx.savedstate. Idd8a5
  • Add SavedStateConfig optional parameter to SavedState encoding/decoding I6c4c0

API Changes

  • Moved all the code from the tracing-ktx module to tracing. Iba550
  • Converted androidx.tracing.Trace class to Kotlin. Ie4e5d

Bug Fixes

  • Removed manual outlining of access to new platform APIs since this happens automatically via API modeling when using R8 with AGP 7.3 or later (e.g. R8 version 3.3) and for all builds when using AGP 8.1 or later (e.g. D8 version 8.1). Clients who are not using AGP are advised to update to D8 version 8.1 or later. See this article for more details. Ia60e0 b/345472586

Bug Fixes

  • We have guarded against a crash when accessing the global reducemotion setting, which was triggered on some platforms where that setting was not provided. I01e2c

New Features

  • Add FontSetting list parameter for Material3 text. Ic102d
  • Added DynamicDataMap class which StateBuilder now supports for a better type safe Kotlin API for app states I012ba
  • Added factory methods such as intAppDataKey for easier creation of AppDataKey objects Icea2a
  • DynamicDataValue now has a hasValueOfType(Class<?>) method in addition to hasInt/hasColor/.... methods I4f7a6
  • We have added errorDim to the Material3 ProtoLayout ColorScheme, for high priority errors or emergency actions such as safety alerts. Ia17bb
  • We have added a guard against a crash when accessing the global reducemotion setting, which was triggered on some platforms where that setting was not provided. I01e2c

API Changes

  • addKeyToValueMapping is renamed to addToStateMap and DynamicDataMap.put methods are removed as they were redundant. Ibe9dd
  • Material3 Typography now supports roundness variable axis for system fonts that support this axis. ProtoLayout FontSetting supports roundness axis for fonts that support this axis. I33eb5
  • Renamed multilineAlignment to alignment in Material3 text method. I2b66b
  • Update the circular progress indicator to be Box type, also specify the mainContent in constructGraphic to be Box type I5a3dc
  • Better support for using circular progress indicator in graph I039db

Bug Fixes

  • Allow dynamic values in ColorStop and also for start/end angles in SweepGradient. I0146d
  • Docs fixes. I4a63a
  • Updated Material 3 components (graphicCard and avatarButton) to provide fallback when weight expand dimension is not supported (e.g. below API 33). Updated text component to fallback to TEXT_OVERFLOW_ELLIPSIZE_END when TEXT_OVERFLOW_ELLIPSIZE is not supported by the renderer. I19e2c
  • Docs update for PrimaryLayoutMargins. Ibaf7b

API Changes

  • TileService.onRecentInteractionEvents() to return ListenableFuture<Void> to allow for long running tasks. Iaa6c5

API Changes

  • Add Async suffix to prerender API. Rename any Data to Header in NoVarySearch to reflect the new name. Ie91c9
  • Add executor parameter to the url prerendering API. Also, restricting the API to be called only from the UI thread. I50520
  • Add an API to configure cache config for the profile prefetch requests. It also applies to Prerender requests initiated from WebViews associated with this Profile. Iebb6e

Bug Fixes

  • Change behavior of URLUtilCompat.guessFileName to only use the mimeType parameter to suggest an extension for filenames derived from the URL parameter. I53ecd b/382864232

Breaking & behavioral changes

  • OpenXR runtime functions that return an Anchor now throw AnchorResourcesExhaustedException if they encounter an error code notifying that the OpenXR resource limit has been reached.
  • Permission android.permission.HAND_TRACKING is now required for Session.create and Session.resume.

New features

  • Added hand tracking support.

Bug fixes

  • Creating anchors is more stable when running on an emulator