Skip to content

Commit

Permalink
gms获取ADID时,如果isLimitAdTrackingEnabled()为true,判定为无法获取ADID
Browse files Browse the repository at this point in the history
  • Loading branch information
a365344743s authored Oct 12, 2024
1 parent 038f26e commit 58f5441
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,9 @@ public void doGet(final IGetter getter) {
public String callRemoteInterface(IBinder service) throws OAIDException, RemoteException {
IAdvertisingIdService anInterface = IAdvertisingIdService.Stub.asInterface(service);
if (anInterface.isLimitAdTrackingEnabled(true)) {
// 实测在系统设置中停用了广告化功能也是能获取到广告标识符的
OAIDLog.print("User has disabled advertising identifier");
// 从2022年开始,当isLimitAdTrackingEnabled()为true时,无论应用的目标SDK级别如何,getId()的返回值都是00000000-0000-0000-0000-000000000000
throw new OAIDException("AAID acquire failed");
}
return anInterface.getId();
}
Expand Down

0 comments on commit 58f5441

Please sign in to comment.