Merge "Enable notification permission enforcement"

This commit is contained in:
TreeHugger Robot
2022-01-27 14:07:30 +00:00
committed by Android (Google) Code Review

View File

@@ -3624,7 +3624,7 @@ public class SettingsProvider extends ContentProvider {
}
private final class UpgradeController {
private static final int SETTINGS_VERSION = 208;
private static final int SETTINGS_VERSION = 209;
private final int mUserId;
@@ -5497,6 +5497,20 @@ public class SettingsProvider extends ContentProvider {
currentVersion = 208;
}
if (currentVersion == 208) {
// Version 208: Enable enforcement of
// android.Manifest.permission#POST_NOTIFICATIONS in order for applications
// to post notifications.
final SettingsState secureSettings = getSecureSettingsLocked(userId);
secureSettings.insertSettingLocked(
Secure.NOTIFICATION_PERMISSION_ENABLED,
/* enabled= */" 1",
/* tag= */ null,
/* makeDefault= */ false,
SettingsState.SYSTEM_PACKAGE_NAME);
currentVersion = 209;
}
// vXXX: Add new settings above this point.
if (currentVersion != newVersion) {