privacysandbox ui
| Latest Update | Stable Release | Release Candidate | Beta Release | Alpha Release |
|---|---|---|---|---|
| May 20, 2025 | - | - | - | 1.0.0-alpha16 |
Declaring dependencies
To add a dependency on privacysandbox-ui, you must add the Google Maven repository to your project. Read Google's Maven repository for more information.
Add the dependencies for the artifacts you need in the build.gradle file for
your app or module:
Groovy
dependencies { // Use to implement privacysandbox ui-client implementation "androidx.privacysandbox.ui:ui-client:1.0.0-alpha16" // Use to implement privacysandbox ui-core implementation "androidx.privacysandbox.ui:ui-core:1.0.0-alpha16" // Use to implement privacysandbox ui-core implementation "androidx.privacysandbox.ui:ui-provider:1.0.0-alpha16" }
Kotlin
dependencies { // Use to implement privacysandbox ui-client implementation("androidx.privacysandbox.ui:ui-client:1.0.0-alpha16") // Use to implement privacysandbox ui-core implementation("androidx.privacysandbox.ui:ui-core:1.0.0-alpha16") // Use to implement privacysandbox ui-provider implementation("androidx.privacysandbox.ui:ui-provider:1.0.0-alpha16") }
For more information about dependencies, see Add build dependencies.
Feedback
Your feedback helps make Jetpack better. Let us know if you discover new issues or have ideas for improving this library. Please take a look at the existing issues in this library before you create a new one. You can add your vote to an existing issue by clicking the star button.
See the Issue Tracker documentation for more information.
Version 1.0
Version 1.0.0-alpha16
May 20, 2025
androidx.privacysandbox.ui:ui-*:1.0.0-alpha16 is released. Version 1.0.0-alpha16 contains these commits.
New Features
- Added logic to measure obstructions on
SandboxedSdkView, which will be sent inSessionObserver.onUiContainerChanged()ifSandboxedUiAdapterSignalOptions.OBSTRUCTIONSis included in the associatedSessionObserverFactory.signalOptions. Obstructions are reported relative to the view itself.
API Changes
- Moved
SandboxedSdkUifrom ui-client into a new ui-client-compose library. - Added logic to measure obstructions on UI containers. (I34bea)
Bug Fixes
- Fixed
SandboxedSdkView.setAlpha(), which now updates the alpha of its content view.
Version 1.0.0-alpha15
March 26, 2025
androidx.privacysandbox.ui:ui-client:1.0.0-alpha15, androidx.privacysandbox.ui:ui-core:1.0.0-alpha15, and androidx.privacysandbox.ui:ui-provider:1.0.0-alpha15 are released. Version 1.0.0-alpha15 contains these commits.
New Features
- Set the default Z-ordering of
SandboxedSdkViewandSandboxedSdkUito “below”, indicating that the provider’s surface is now placed below the client’s window. Added support for the UI provider to receiveMotionEventsin this mode after being received by the client window. - Added a
signalOptionsfield to theSessionObserverFactoryinterface. This can be used to define a set of String options which will be used to determine which signals are collected for the associatedSessionObserver. The initial set of signals is defined inSandboxedUiAdapterSignalOptions. If no signal options are set, onlySessionObserver.onSessionOpened()andSessionObserver.onSessionClosed()will be called.
API Changes
- Renamed
SessionConstantstoSessionDatainSandboxedUiAdapter.openSession().
Known Issues
- When the SDK is loaded in the SDK Runtime and the Z-order of
SandboxedSdkVieworSandboxedSdkUiis “above”, the gesture is exclusively received by the provider window and not transferred to the client window anymore.
Version 1.0.0-alpha14
February 26, 2025
androidx.privacysandbox.ui:ui-client:1.0.0-alpha14, androidx.privacysandbox.ui:ui-core:1.0.0-alpha14, and androidx.privacysandbox.ui:ui-provider:1.0.0-alpha14 are released. Version 1.0.0-alpha14 contains these commits.
New Features
- You can now create ‘shared UI’, i.e. UI that can have elements that are client-owned and provider-owned. Shared UI can be hosted using
SharedUiContainer, which extendsViewGroup. New APIs utilize the concept of session management similar to that ofSandboxedSdkViewandSandboxedUiAdapter. - All APIs added in this release are behind the
SharedUiPresentationApi@RequiresOptInflag.
API Changes
- Added session management and asset registration APIs to
SharedUiContainer. Session management is implemented usingSharedUiAdapterintroduced in the same release. (Ic60b0) - Added
SharedUiContainerthat can host client-owned and provider-owned UI. It places all of its child views in the top left corner. (Ia7310) - Added backwards compatibility support for
SharedUiAdapter. (I56d7a) - Added
SharedUiAdapterfor session management of View containers that can host client-owned and provider-owned UI. Session management logic is similar to that ofSandboxedUiAdapter. (I501f6)
Bug Fixes
- Compute viewability when
onVisibilityAggregatedis called. (I91c69)
Known Issues
- When placed inside a
PoolingContainer,SharedUiContainercloses the session on window detachment.
Version 1.0.0-alpha13
January 29, 2025
androidx.privacysandbox.ui:ui-client:1.0.0-alpha13, androidx.privacysandbox.ui:ui-core:1.0.0-alpha13, and androidx.privacysandbox.ui:ui-provider:1.0.0-alpha13 are released. Version 1.0.0-alpha13 contains these commits.
New Features
- Added a Composable object called
SandboxedSdkUiwhich can be used to display remote content within a Compose UI. This object utilizes existingSandboxedSdkViewconcepts for session management and event listeners. (I009cf) - Changed the
SandboxedUiAdapter.openSessionsignature to include a newSessionConstantsparameter which replaces the previouswindowInputToken. This parameter is to be used to pass values which will be constant for the lifetime of theSandboxedUiAdapter.Session. (Ibc0df, I28435)
Known Issues
SessionObserverevents are not sent forSandboxedSdkUiwhen it is scrolled.SandboxedSdkUiis not clipped by parent views when it is in Z-above mode.
API Changes
- Remove deprecated
SDKActivityLaunchercode (I49a4f) - Separated observer factory registration logic from
SandboxedUiAdapterby adding a newSessionObserverFactoryRegistryinterface. (I245cc)
Version 1.0.0-alpha12
December 11, 2024
androidx.privacysandbox.ui:ui-client:1.0.0-alpha12, androidx.privacysandbox.ui:ui-core:1.0.0-alpha12, and androidx.privacysandbox.ui:ui-provider:1.0.0-alpha12 are released. Version 1.0.0-alpha12 contains these commits.
New Features
- Replaced
StateChangedListenerwithSandboxedSdkViewEventListener. This event listener can be used to listen to UI displayed, session closed and session error events.
API Changes
- Adds
SandboxedSdkViewEventListenerfor listening to UI events insideSandboxedSdkView. This version also removesStateChangedListener. (Id71ea)
Bug Fixes
- Removed clipping bounds logic from
SandboxedSdkView. This will cause UX issues ifSandboxedSdkViewis placed in a scrollable container andorderProviderUiAboveClientUi(false)has not been called (until the underlying framework bug is fixed). (Id420d) - Fixed
RemoteExceptionthat could occur if the remote process dies while usingDelegatingSandboxedUiAdapter.
Version 1.0.0-alpha11
November 13, 2024
androidx.privacysandbox.ui:ui-client:1.0.0-alpha11, androidx.privacysandbox.ui:ui-core:1.0.0-alpha11, and androidx.privacysandbox.ui:ui-provider:1.0.0-alpha11 are released. Version 1.0.0-alpha11 contains these commits.
New Features
- Introduced an experimental API,
DelegatingSandboxedUiAdapter, which extendsSandboxedUiAdapterand can be used to delegate between differentSandboxedUiAdapters. When this adapter is set on a client container such asSandboxedSdkView, the delegating adapter can change the delegate adapter usingupdateDelegate. This will close the existing session and create a newSandboxedUiAdapter.Sessionfor the new delegate. This allows for seamless transitions between delegates. (I5f1c5, I9e3e7) - Added better
SandboxedSdkViewsupport for padding. (Ic414f)
Bug Fixes
- Fixed
NullPointerExceptionthat could occur on a global layout event.
Version 1.0.0-alpha10
September 18, 2024
androidx.privacysandbox.ui:ui-client:1.0.0-alpha10, androidx.privacysandbox.ui:ui-core:1.0.0-alpha10, and androidx.privacysandbox.ui:ui-provider:1.0.0-alpha10 are released. Version 1.0.0-alpha10 contains these commits.
New Features
- Updated session opening logic to only open a session inside a
SandboxedSdkViewif the window containing theSandboxedSdkViewis visible. - Updated
SessionObserverlogic to sendonUiContainerChangedwhen the visibility of the window containing theSandboxedSdkViewchanges.
Bug Fixes
- Invoke
onUiContainerChangedwhen the window visibility changes (I541cf) - 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. (If6b4c, b/345472586)
Version 1.0.0-alpha09
June 26, 2024
androidx.privacysandbox.ui:ui-client:1.0.0-alpha09, androidx.privacysandbox.ui:ui-core:1.0.0-alpha09, and androidx.privacysandbox.ui:ui-provider:1.0.0-alpha09 are released. Version 1.0.0-alpha09 contains these commits.
New Features
- Introduced
AbstractSandboxedUiAdapterandAbstractSandboxedUiAdapter.AbstractSessionabstract classes that can be used by UI providers to avoid implementing the entireSandboxedUiAdapterorSessioninterfaces. It is recommended for UI providers to use these abstract classes. - Added
registerObserverFactorylogic that allows aSessionObserverFactoryto be attached to aSandboxedUiAdapter. When aSessionObserverFactoryis attached to an adapter, aSessionObserverwill be created for each new UI session created for that adapter. The createdSessionObserverwill receive anonSessionOpenedcallback when the UI session is opened. When the UI presentation of theSession’s view changes,SessionObserver.onUiContainerChangedwill be called.onUiContainerChangedis throttled and will be called at most every 200ms. - Added
SandboxedSdkViewUiInfowhich can be created from theBundlesent inSessionObserver.onUiContainerChanged. This object represents the UI state of theSandboxedSdkViewthat is hosting the UI session. It contains height and width information, aRectrepresenting the geometry of the view that is visible on screen, and an opacity hint that represents the opacity of the view.
API Changes
- Add opacity hint to
SandboxedSdkViewUiInfo. (I093ac) - Add
SessionObserver.onUiContainerChangedandSandboxedSdkViewUiInfo. (Ie98bc) - Add
SessionObserverinterface and registration logic. (I047dc) - Add
AbstractSandboxedUiAdapterandAbstractSession. (I3617a)
Known Issues
- When the UI provider is in the same process as the client application,
SessionObserver.onUiContainerChangedis not sent when the container scrolls.
Version 1.0.0-alpha08
May 14, 2024
androidx.privacysandbox.ui:ui-client:1.0.0-alpha08, androidx.privacysandbox.ui:ui-core:1.0.0-alpha08, and androidx.privacysandbox.ui:ui-provider:1.0.0-alpha08 are released. Version 1.0.0-alpha08 contains these commits.
New Features
- Added support for using
SandboxedSdkViewinside aPoolingContainersuch as aRecyclerView. When aSandboxedSdkViewhas a parent that is aPoolingContainer, the lifecycle of its UI sessions will be aligned with that of thePoolingContainerto ensure that the session can persist through window detachment.
API Changes
- Deprecated Privacy Sandbox Activity APIs. These APIs can now be found in the dedicated Activity library
androidx.privacysandbox.activityinstead. (I68beb)
Bug Fixes
- Fixed rendering bug when displaying remote content inside pooling containers. (I804df)
- Fixed a bug that caused rendering issues for
ViewGroupsin backwards compatibility mode. (I8de92) - When one of
SandboxedSdkView's parents is aPoolingContainer, close the UI Session when thePoolingContainerindicates resources can be released, instead of on window detachment. (I2046b)
External Contribution
GestureDetectorCompatis now deprecated asGestureDetectoris available from theminSdk. (Icc4cd)
Version 1.0.0-alpha07
October 18, 2023
androidx.privacysandbox.ui:ui-client:1.0.0-alpha07, androidx.privacysandbox.ui:ui-core:1.0.0-alpha07, and androidx.privacysandbox.ui:ui-provider:1.0.0-alpha07 are released. Version 1.0.0-alpha07 contains these commits.
New Features
- Added backwards compatibility support for the library. On API 33 and below, the provider’s view will be rendered inside the app process, in a different classloader. (If0b7a)
- Added logic that allows the resizing of host and provider containers to be committed in the same frame to avoid visible UI jank. (Ic2cd9)
API Changes
- MinSdk for the library bumped to API 21. (I474b8)
Version 1.0.0-alpha06
September 20, 2023
androidx.privacysandbox.ui:ui-client:1.0.0-alpha06, androidx.privacysandbox.ui:ui-core:1.0.0-alpha06, and androidx.privacysandbox.ui:ui-provider:1.0.0-alpha06 are released. Version 1.0.0-alpha06 contains these commits.
New Features
- Added logic to clip
SandboxedSdkViewto the “bounding parent” View that it may scroll within. This ensures that the contents of theSandboxedSdkViewdo not occlude other views or any UI components outside of the root content view. (I9ea94)
API Changes
- Rename
SandboxedSdkView.setZOrderOnTopAndEnableUserInteractiontoorderProviderUiAboveClientUi(Iecb7e)
Bug Fixes
- Send the correct Z-order value to the host. (Ib0ddf)
- Only transfer touch focus for vertical scrolls/flings. (I0528c)
Version 1.0.0-alpha05
August 9, 2023
androidx.privacysandbox.ui:ui-client:1.0.0-alpha05, androidx.privacysandbox.ui:ui-core:1.0.0-alpha05, and androidx.privacysandbox.ui:ui-provider:1.0.0-alpha05 are released. Version 1.0.0-alpha05 contains these commits.
New Features
- Added logic to transfer touch focus to host on scroll and fling gestures originating from
SandboxedSdkView. This allows the client’s scrollable container hosting provider UI to respond correctly to scrolls and flings.
API Changes
- Added
windowInputTokenparameter toSandboxedUiAdapter(Ief578)
Bug Fixes
- Set session state to Active after the first draw (I36f3f)
- Fix layout issue with
SandboxedSdkView. (I09cb8) - Added logic to transfer touch focus to host. (I33b54)
- Add
windowInputTokenparameter toSandboxedUiAdapter. This is necessary to ensure that theSurfaceControlViewHost's token is correctly associated with the host of the embedded hierarchy. (Ief578) - Run
notifyResizedinside the main thread. (I62440) - Fix crash in the
Session.close()flow. (I5392e)
Version 1.0.0-alpha04
June 21, 2023
androidx.privacysandbox.ui:ui-client:1.0.0-alpha04, androidx.privacysandbox.ui:ui-core:1.0.0-alpha04, and androidx.privacysandbox.ui:ui-provider:1.0.0-alpha04 are released. Version 1.0.0-alpha04 contains these commits.
New Features
- Introduce the
SdkActivityLauncher. An interface for allowing runtime enabled SDKs to launch activities. (I5b3dc)
Bug Fixes
- Fix
notifyZOrderChangedrace condition. Ensures that the UI provider is notified for all Z-order changes. The UI provider will not be explicitly notified if the Z-order of theSandboxedSdkViewis changed before openSession is invoked.
Version 1.0.0-alpha03
May 24, 2023
androidx.privacysandbox.ui:ui-client:1.0.0-alpha03, androidx.privacysandbox.ui:ui-core:1.0.0-alpha03, and androidx.privacysandbox.ui:ui-provider:1.0.0-alpha03 are released. Version 1.0.0-alpha03 contains these commits.
New Features
StateChangedListenerinforms the application of changes in the UI session
API Changes
- Added
StateChangedListenerto replace theErrorConsumer(Icd5d3)
Bug Fixes
- Fixed
notifyZOrderChangedrace condition so the UI provider is notified for all Z-order changes
Version 1.0.0-alpha02
April 19, 2023
androidx.privacysandbox.ui:ui-client:1.0.0-alpha02, androidx.privacysandbox.ui:ui-core:1.0.0-alpha02, and androidx.privacysandbox.ui:ui-provider:1.0.0-alpha02 are released. Version 1.0.0-alpha02 contains these commits.
Bug Fixes
- Disabled flaking testChangingSandboxedSdkViewLayoutChangesChildLayout test
Version 1.0.0-alpha01
March 8, 2023
androidx.privacysandbox.ui:ui-client:1.0.0-alpha01, androidx.privacysandbox.ui:ui-core:1.0.0-alpha01, and androidx.privacysandbox.ui:ui-provider:1.0.0-alpha01 are released. Version 1.0.0-alpha01 contains these commits.
New Features
- These are new jetpack libraries that applications and Runtime Enabled SDKs (Privacy Sandbox) can use to let the application (client) host any UI provided by the SDK (provider).