AdServicesState


public class AdServicesState
extends Object

java.lang.Object
   ↳ android.adservices.AdServicesState


This class was deprecated in API level 37.
The Rubidium (Rb) Measurement APIs, including those in android.adservices.measurement, are being deprecated. There are no direct replacement APIs for the Measurement APIs. Developers currently using these APIs should cease integration, as calls to these APIs will be rejected in upcoming Android releases as part of a soft removal process. Please refer to the official Privacy Sandbox developer documentation and announcements for more details on this deprecation and the future roadmap of Privacy Sandbox on Android: https://privacysandbox.com/news/update-on-plans-for-privacy-sandbox-technologies/

This class specifies the state of the APIs exposed by AdServicesApi apk.

Summary

Public methods

static boolean isAdServicesStateEnabled()

Returns current state of the AdServicesApi.

Inherited methods

Public methods

isAdServicesStateEnabled

Added in API level 34
Also in Ad Services Extensions 4
Deprecated in API level 37
public static boolean isAdServicesStateEnabled ()

Returns current state of the AdServicesApi. The state of AdServicesApi may change only upon reboot, so this value can be cached, but not persisted, i.e., the value should be rechecked after a reboot.

Returns
boolean