Android 10 如何默认给应用授权获取IMEI号

Android 10 如何默认给应用授权获取IMEI号,第1张

代码路径:
frameworks/base/telephony/java/com/android/internal/telephony/TelephonyPermissions.java

--- a/telephony/java/com/android/internal/telephony/TelephonyPermissions.java
+++ b/telephony/java/com/android/internal/telephony/TelephonyPermissions.java
@@ -315,7 +315,7 @@ public final class TelephonyPermissions {
         }
         // Allow access to packages that have the READ_PRIVILEGED_PHONE_STATE permission.
         if (context.checkPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE, pid,
-                uid) == PackageManager.PERMISSION_GRANTED) {
+                uid) == PackageManager.PERMISSION_GRANTED||("包名".equals(callingPackage))) {
             return true;
         }
         // If the calling package has carrier privileges for any subscription then allow access.

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/langs/797552.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-06
下一篇 2022-05-06

发表评论

登录后才能评论

评论列表(0条)

保存