privacysandbox ui

  
TODO
Latest Update Stable Release Release Candidate Beta Release Alpha Release
September 18, 2024 - - - 1.0.0-alpha10

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
    implementation "androidx.privacysandbox.ui:ui:1.0.0-alpha10"

    // Use to implement privacysandbox ui-core
    implementation "androidx.privacysandbox.ui:ui-core:1.0.0-alpha10"
   
    // Use to implement privacysandbox ui-core
    implementation "androidx.privacysandbox.ui:ui-provider:1.0.0-alpha10"
}

Kotlin

dependencies {
    // Use to implement privacysandbox ui
    implementation("androidx.privacysandbox.ui:ui:1.0.0-alpha10")

    // Use to implement privacysandbox ui-core
    implementation("androidx.privacysandbox.ui:ui-core:1.0.0-alpha10")

    // Use to implement privacysandbox ui-provider
    implementation("androidx.privacysandbox.ui:ui-provider:1.0.0-alpha10")

    
}

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.

Create a new issue

See the Issue Tracker documentation for more information.

Version 1.0

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 SandboxedSdkView if the window containing the SandboxedSdkView is visible.
  • Updated SessionObserver logic to send onUiContainerChanged when the visibility of the window containing the SandboxedSdkView changes.

Bug Fixes

  • Invoke onUiContainerChanged when 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 AbstractSandboxedUiAdapter and AbstractSandboxedUiAdapter.AbstractSession abstract classes that can be used by UI providers to avoid implementing the entire SandboxedUiAdapter or Session interfaces. It is recommended for UI providers to use these abstract classes.
  • Added registerObserverFactory logic that allows a SessionObserverFactory to be attached to a SandboxedUiAdapter. When a SessionObserverFactory is attached to an adapter, a SessionObserver will be created for each new UI session created for that adapter. The created SessionObserver will receive an onSessionOpened callback when the UI session is opened. When the UI presentation of the Session’s view changes, SessionObserver.onUiContainerChanged will be called. onUiContainerChanged is throttled and will be called at most every 200ms.
  • Added SandboxedSdkViewUiInfo which can be created from the Bundle sent in SessionObserver.onUiContainerChanged. This object represents the UI state of the SandboxedSdkView that is hosting the UI session. It contains height and width information, a Rect representing 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.onUiContainerChanged and SandboxedSdkViewUiInfo. (Ie98bc)
  • Add SessionObserver interface and registration logic. (I047dc)
  • Add AbstractSandboxedUiAdapter and AbstractSession. (I3617a)

Known Issues

  • When the UI provider is in the same process as the client application, SessionObserver.onUiContainerChanged is 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 SandboxedSdkView inside a PoolingContainer such as a RecyclerView. When a SandboxedSdkView has a parent that is a PoolingContainer, the lifecycle of its UI sessions will be aligned with that of the PoolingContainer to 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.activity instead. (I68beb)

Bug Fixes

  • Fixed rendering bug when displaying remote content inside pooling containers. (I804df)
  • Fixed a bug that caused rendering issues for ViewGroups in backwards compatibility mode. (I8de92)
  • When one of SandboxedSdkView's parents is a PoolingContainer, close the UI Session when the PoolingContainer indicates resources can be released, instead of on window detachment. (I2046b)

External Contribution

  • GestureDetectorCompat is now deprecated as GestureDetector is available from the minSdk. (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 SandboxedSdkView to the “bounding parent” View that it may scroll within. This ensures that the contents of the SandboxedSdkView do not occlude other views or any UI components outside of the root content view. (I9ea94)

API Changes

  • Rename SandboxedSdkView.setZOrderOnTopAndEnableUserInteraction to orderProviderUiAboveClientUi (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 windowInputToken parameter to SandboxedUiAdapter (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 windowInputToken parameter to SandboxedUiAdapter. This is necessary to ensure that the SurfaceControlViewHost's token is correctly associated with the host of the embedded hierarchy. (Ief578)
  • Run notifyResized inside 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 notifyZOrderChanged race 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 the SandboxedSdkView is 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

  • StateChangedListener informs the application of changes in the UI session

API Changes

  • Added StateChangedListener to replace the ErrorConsumer (Icd5d3)

Bug Fixes

  • Fixed notifyZOrderChanged race 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).