Stay organized with collections
Save and categorize content based on your preferences.
AdServicesState
open class AdServicesState
This class specifies the state of the APIs exposed by AdServicesApi apk.
Summary
Public methods |
open static Boolean |
Returns current state of the AdServicesApi .
|
Public methods
isAdServicesStateEnabled
open static fun isAdServicesStateEnabled(): Boolean
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.
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[null,null,["Last updated 2025-02-10 UTC."],[],[],null,["# AdServicesState\n\nAdded in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \nAlso in [Ad Services Extensions 4](https://developer.android.com/sdkExtensions)\n\nAdServicesState\n===============\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/adservices/AdServicesState \"View this page in Java\") \n\n```\nopen class AdServicesState\n```\n\n|---|-----------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||\n| ↳ | [android.adservices.AdServicesState](#) |\n\nThis class specifies the state of the APIs exposed by AdServicesApi apk.\n\nSummary\n-------\n\n| Public methods ||\n|------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------|\n| open static [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | [isAdServicesStateEnabled](#isAdServicesStateEnabled())`()` Returns current state of the `AdServicesApi`. |\n\nPublic methods\n--------------\n\n### isAdServicesStateEnabled\n\nAdded in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \nAlso in [Ad Services Extensions 4](https://developer.android.com/sdkExtensions) \n\n```\nopen static fun isAdServicesStateEnabled(): Boolean\n```\n\nReturns 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."]]