小编VMS*_*VMS的帖子

Android Q 中的唯一标识符

Android Q 限制对 IMEI 和序列号的访问。它仅适用于具有特殊运营商许可的平台和应用程序。此外,权限 READ_PRIVILEGED_PHONE_STATE 不适用于非平台应用程序。

现有版本(Android P、Android O、Android M)我们使用序列号来唯一标识设备。现在,我们在尝试访问设备标识符时遇到了以下异常。

Android Q 限制对 IMEI 和序列号的访问。

android.os.Build 类中的 getSerial()

06-21 12:37:07.460  1250  2555 W DevicePolicyManager: Package com.nagra.nmp.corepaktest (uid=10201, pid=32694) cannot access Device IDs
06-21 12:37:07.460  1250  2555 W TelephonyPermissions: reportAccessDeniedToReadIdentifiers:com.nagra.nmp.corepaktest:getSerial:isPreinstalled=false:isPrivApp=false
06-21 12:37:07.464 32694 32718 W System.err: java.lang.SecurityException: getSerial: The user 10201 does not meet the requirements to access device identifiers.
06-21 12:37:07.464 32694 32718 W System.err:    at android.os.Parcel.createException(Parcel.java:2069)
06-21 12:37:07.464 32694 32718 W System.err:    at android.os.Parcel.readException(Parcel.java:2037)
06-21 12:37:07.465 32694 32718 …
Run Code Online (Sandbox Code Playgroud)

android

5
推荐指数
1
解决办法
8844
查看次数

标签 统计

android ×1