Remove REVOKE runtime perms from systemui
Instead, limit them to only being able to revoke the notification permission specifically Fixes: 208562972 Test: DefaultPermissionGrantPolicyTest, enable flag and turn off notifs for an app Change-Id: Ie2769a49499eac404e015a703cd725858e23e79f
This commit is contained in:
@@ -218,7 +218,6 @@
|
||||
|
||||
<!-- notifications & DND access -->
|
||||
<uses-permission android:name="android.permission.MANAGE_NOTIFICATIONS" />
|
||||
<uses-permission android:name="android.permission.REVOKE_RUNTIME_PERMISSIONS" />
|
||||
<uses-permission android:name="android.permission.GET_RUNTIME_PERMISSIONS" />
|
||||
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
|
||||
|
||||
|
||||
@@ -167,6 +167,7 @@ public final class PermissionHelper {
|
||||
public void setNotificationPermission(String packageName, @UserIdInt int userId, boolean grant,
|
||||
boolean userSet) {
|
||||
assertFlag();
|
||||
final long callingId = Binder.clearCallingIdentity();
|
||||
try {
|
||||
if (grant) {
|
||||
mPermManager.grantRuntimePermission(packageName, NOTIFICATION_PERMISSION, userId);
|
||||
@@ -180,13 +181,20 @@ public final class PermissionHelper {
|
||||
}
|
||||
} catch (RemoteException e) {
|
||||
Slog.e(TAG, "Could not reach system server", e);
|
||||
} finally {
|
||||
Binder.restoreCallingIdentity(callingId);
|
||||
}
|
||||
}
|
||||
|
||||
public void setNotificationPermission(PackagePermission pkgPerm) {
|
||||
assertFlag();
|
||||
setNotificationPermission(
|
||||
pkgPerm.packageName, pkgPerm.userId, pkgPerm.granted, pkgPerm.userSet);
|
||||
final long callingId = Binder.clearCallingIdentity();
|
||||
try {
|
||||
setNotificationPermission(
|
||||
pkgPerm.packageName, pkgPerm.userId, pkgPerm.granted, pkgPerm.userSet);
|
||||
} finally {
|
||||
Binder.restoreCallingIdentity(callingId);
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isPermissionFixed(String packageName, @UserIdInt int userId) {
|
||||
|
||||
Reference in New Issue
Block a user