Loading services/core/java/com/android/server/vr/VrManagerService.java +0 −19 Original line number Diff line number Diff line Loading @@ -218,7 +218,6 @@ public class VrManagerService extends SystemService implements EnabledComponentC String packageName = mNotificationAccessPackageToUserId.keyAt(i); revokeNotificationListenerAccess(packageName, grantUserId); revokeNotificationPolicyAccess(packageName); revokeCoarseLocationPermissionIfNeeded(packageName, grantUserId); mNotificationAccessPackageToUserId.removeAt(i); } } Loading @@ -227,7 +226,6 @@ public class VrManagerService extends SystemService implements EnabledComponentC if (!packageNames.contains(pkg)) { revokeNotificationListenerAccess(pkg, currentUserId); revokeNotificationPolicyAccess(pkg); revokeCoarseLocationPermissionIfNeeded(pkg, currentUserId); mNotificationAccessPackageToUserId.remove(pkg); } } Loading @@ -235,7 +233,6 @@ public class VrManagerService extends SystemService implements EnabledComponentC if (!allowed.contains(pkg)) { grantNotificationPolicyAccess(pkg); grantNotificationListenerAccess(pkg, currentUserId); grantCoarseLocationPermissionIfNeeded(pkg, currentUserId); mNotificationAccessPackageToUserId.put(pkg, currentUserId); } } Loading Loading @@ -760,22 +757,6 @@ public class VrManagerService extends SystemService implements EnabledComponentC flatSettings, userId); } private void grantCoarseLocationPermissionIfNeeded(String pkg, int userId) { // Don't clobber the user if permission set in current state explicitly if (!isPermissionUserUpdated(Manifest.permission.ACCESS_COARSE_LOCATION, pkg, userId)) { mContext.getPackageManager().grantRuntimePermission(pkg, Manifest.permission.ACCESS_COARSE_LOCATION, new UserHandle(userId)); } } private void revokeCoarseLocationPermissionIfNeeded(String pkg, int userId) { // Don't clobber the user if permission set in current state explicitly if (!isPermissionUserUpdated(Manifest.permission.ACCESS_COARSE_LOCATION, pkg, userId)) { mContext.getPackageManager().revokeRuntimePermission(pkg, Manifest.permission.ACCESS_COARSE_LOCATION, new UserHandle(userId)); } } private boolean isPermissionUserUpdated(String permission, String pkg, int userId) { final int flags = mContext.getPackageManager().getPermissionFlags( permission, pkg, new UserHandle(userId)); Loading Loading
services/core/java/com/android/server/vr/VrManagerService.java +0 −19 Original line number Diff line number Diff line Loading @@ -218,7 +218,6 @@ public class VrManagerService extends SystemService implements EnabledComponentC String packageName = mNotificationAccessPackageToUserId.keyAt(i); revokeNotificationListenerAccess(packageName, grantUserId); revokeNotificationPolicyAccess(packageName); revokeCoarseLocationPermissionIfNeeded(packageName, grantUserId); mNotificationAccessPackageToUserId.removeAt(i); } } Loading @@ -227,7 +226,6 @@ public class VrManagerService extends SystemService implements EnabledComponentC if (!packageNames.contains(pkg)) { revokeNotificationListenerAccess(pkg, currentUserId); revokeNotificationPolicyAccess(pkg); revokeCoarseLocationPermissionIfNeeded(pkg, currentUserId); mNotificationAccessPackageToUserId.remove(pkg); } } Loading @@ -235,7 +233,6 @@ public class VrManagerService extends SystemService implements EnabledComponentC if (!allowed.contains(pkg)) { grantNotificationPolicyAccess(pkg); grantNotificationListenerAccess(pkg, currentUserId); grantCoarseLocationPermissionIfNeeded(pkg, currentUserId); mNotificationAccessPackageToUserId.put(pkg, currentUserId); } } Loading Loading @@ -760,22 +757,6 @@ public class VrManagerService extends SystemService implements EnabledComponentC flatSettings, userId); } private void grantCoarseLocationPermissionIfNeeded(String pkg, int userId) { // Don't clobber the user if permission set in current state explicitly if (!isPermissionUserUpdated(Manifest.permission.ACCESS_COARSE_LOCATION, pkg, userId)) { mContext.getPackageManager().grantRuntimePermission(pkg, Manifest.permission.ACCESS_COARSE_LOCATION, new UserHandle(userId)); } } private void revokeCoarseLocationPermissionIfNeeded(String pkg, int userId) { // Don't clobber the user if permission set in current state explicitly if (!isPermissionUserUpdated(Manifest.permission.ACCESS_COARSE_LOCATION, pkg, userId)) { mContext.getPackageManager().revokeRuntimePermission(pkg, Manifest.permission.ACCESS_COARSE_LOCATION, new UserHandle(userId)); } } private boolean isPermissionUserUpdated(String permission, String pkg, int userId) { final int flags = mContext.getPackageManager().getPermissionFlags( permission, pkg, new UserHandle(userId)); Loading