Closed okstartapp closed 1 year ago
Could you try running these commands and then try to run the app again?
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
adb shell device_config put adservices global_kill_switch false
adb shell device_config put adservices disable_sdk_sandbox false
Hey @okstartapp We released a new SDK, emulator, and device images including Privacy Sandbox support for UDC. You can find these as "UpsideDownCakePrivacySandbox" in Android Studio
Hey @okstartapp We released a new SDK, emulator, and device images including Privacy Sandbox support for UDC. You can find these as "UpsideDownCakePrivacySandbox" in Android Studio
Hello @cshmerling , I've updated everything to the most recent versions and I still get the same error. Moreover, I can see such error in logcat right before the exception:
adservices com...ices.samples.topics.sampleapp E onNullBinding android.adservices.TOPICS_SERVICE
Thanks for checking back on this- it seems our documentation may be missing a step specifically to enable the Topics API on the device. Assuming you have enabled the Privacy Sandbox via the UI (by opening it via adb shell am start -n com.google.android.adservices.api/com.android.adservices.ui.settings.activities.AdServicesSettingsMainActivity
The total commands to be run would be:
adb shell device_config set_sync_disabled_for_tests persistent
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
adb shell device_config put adservices global_kill_switch false
adb shell device_config put adservices topics_kill_switch false
With the first and last commands being new. The first command will disable your device from resetting to the default where everything is disabled, and the last command will actually enable the Topics API.
Let me know if that works and I can see that our documentation gets updated to reflect this.
Now I can get the TopicsManager reference, but it returns me empty list of topics. I can see that there's no apps generating topics via the UI (see screenshots).
I also tried to use preinstalled apps such as YouTube and Chrome and then, according to the setting below, I waited for at least 5 minutes in order to give enough time to the system to generate some topics for me.
adb shell setprop debug.adservices.topics_epoch_job_period_ms 300000
But I still get empty list in onResult()
callback.
There a few more steps to be able to get Topics- namely only apps that integrate with Topics are considered, hence why none of the pre-installed apps are giving you any results. If you take a look at our (testing section)[https://github.com/android/privacy-sandbox-samples/tree/main/TopicsJava#testing] (specifically, towards the bottom we have the Note about running some sample apps), you will be able to see some Topics being inferred.
Eventually, I got positive results. Thank you @cshmerling !
I get the following exception while trying to run the app from TopicsJava project.
Steps that have been executed
This command doesn't work in my command line (MasOS 12.4), so I executed the first part:
adb shell
and only then I was able to executedevice_config put adservices ppapi_app_allow_list \"*\"
.These two commands were executed without errors.
Then I executed the following script:
After that I can see sample apps installed on my emulator.
Once I launched one of these apps, I pressed the
Launch Settings App
button and turned on the switchPrivacy Sandbox
.Environment
Android Studio Giraffe | 2022.3.1 Canary 11 Google Play ARM 64 v8a System Image, TiramisuPrivacySandbox, revision 9