Configure devices to use Privacy Sandbox on Android

As you read through the Privacy Sandbox on Android documentation, use the Developer Preview or Beta button to select the program version that you're working with, as instructions may vary.


Display the Privacy Sandbox user control UI

Privacy Sandbox on Android allows device users to control whether the Privacy-Preserving APIs (PPAPI) and the SDK Runtime are enabled on their own devices, or not. As of Developer Preview 5, the setting to display the user control UI is disabled by default. For development and test purposes, you may want to enable the user control UI. To enable the user control UI, use the following adb command:

adb shell am start -n com.google.android.adservices.api/com.android.adservices.ui.settings.AdServicesSettingsActivity

By default, the user control is set to disabled on the device. To enable the Privacy Sandbox API and SDK Runtime, on the device, tap the toggle button.

Diagram
Figure 1. Privacy Sandbox user control UI on Android device.

Enable the Privacy Sandbox on the device

While the previous section enabled the device user to choose whether they wanted Privacy Sandbox running on their device, this section explains how a developer can enable the APIs on a device using adb commands.

Enable the PPAPI on the device

Enable the PPAPI

adb shell device_config put adservices ppapi_app_allow_list \"*\"
adb shell device_config put adservices ppapi_app_signature_allow_list \"*\"
adb shell device_config put adservices adservice_system_service_enabled true
adb shell device_config put adservices adservice_enabled true
adb shell device_config put adservices adservice_enable_status true

Disable the PPAPI

For development and test purposes, you can enable or disable PPAPI access on the device by running the following commands:

Set to false to enable:

adb shell device_config put adservices global_kill_switch false

Set to true to disable:

adb shell device_config put adservices global_kill_switch true

Enable the SDK Runtime on the device

adb shell device_config put adservices disable_sdk_sandbox false