SecurityException:getSerial:用户10134不符合访问设备标识符的要求 [英] SecurityException: getSerial: The user 10134 does not meet the requirements to access device identifiers
本文介绍了SecurityException:getSerial:用户10134不符合访问设备标识符的要求的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想从Android手机获取Build.getSerial().最高Android O,我需要Manifest.permission.READ_PHONE_STATE权限.但是在Android 10中,我得到了上述异常. 我所做的就是将此权限添加到清单中
I want to get the Build.getSerial() from the Android phone. Up to Android O i needed the Manifest.permission.READ_PHONE_STATE permission. However in Android 10 i get the above exception. What i did is added this permission to the manifest
<uses-permission android:name="android.permission.READ_PRIVILEGED_PHONE_STATE"
tools:ignore="ProtectedPermissions"/>
在活动中,我需要请求许可,但是没有这样的许可
And in the activity i need to request for the permission but there is not such a permission
ActivityCompat.requestPermissions(this@ListActivity,
arrayOf(Manifest.permission.READ_PHONE_STATE,
<<Manifest.permission.READ_PRIVILEGED_PHONE_STATE>>),
SERIAL_NUMBER_PERMISSION)
因此,如果我不能授予许可,我该如何获得序列号?我该怎么办?
So how can i get the serial Number if i cannot Grant the permission..? What should i do?
推荐答案
查看全文