Starting from late 2021, on Android 12 devices, when isLimitAdTrackingEnabled() is true, the returned value of this API will be 00000000-0000-0000-0000-000000000000 regardless of the app’s target SDK level.
In early 2022, this change will be applied to all the devices that support Google Play services.
Apps with target API level set to 33 (Android 13) or later must declare the normal permission com.google.android.gms.permission.AD_ID as below in the AndroidManifest.xml in order to use this API.
This permission will be granted when the app is installed.
If this permission is not declared, the returned value will be 00000000-0000-0000-0000-000000000000 starting early 2022.
Until then, to help developers, a warning line is logged if the permission is missing when the app targets API level 33 (Android 13) or higher.
This warning line is under the Log tag AdvertisingIdSettings.
If you need to prevent the permission from getting merged into your app through dependencies such as SDKs, include the below element in your manifest instead.