Android预制APP第一次打开时不弹权限提示页面

  • frameworks/base/services/core/java/com/android/server/pm/DefaultPermissionGrantPolicy.java
--- a/frameworks/base/services/core/java/com/android/server/pm/DefaultPermissionGrantPolicy.java
+++ b/frameworks/base/services/core/java/com/android/server/pm/DefaultPermissionGrantPolicy.java
@@ -548,6 +548,15 @@ final class DefaultPermissionGrantPolicy {
                 grantRuntimePermissionsLPw(emailPackage, CALENDAR_PERMISSIONS, userId);
             }
 

+            PackageParser.Package feedBackPackage = null;
+            feedBackPackage = getPackageLPr("android.com.feedback");
+            if (feedBackPackage != null
+                    && doesPackageSupportRuntimePermissions(feedBackPackage)) {
+                grantRuntimePermissionsLPw(feedBackPackage, STORAGE_PERMISSIONS, userId);
+                grantRuntimePermissionsLPw(feedBackPackage, CAMERA_PERMISSIONS, userId);
+            } 
             // Browser
             PackageParser.Package browserPackage = null;
             String defaultBrowserPackage = mService.getDefaultBrowserPackageName(userId);

你可能感兴趣的:(Android预制APP第一次打开时不弹权限提示页面)