Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2e4d4808 authored by Automerger Merge Worker's avatar Automerger Merge Worker
Browse files

Merge "Enforce MODIFY_SETTINGS_OVERRIDEABLE_BY_RESTORE permission" into rvc-dev am: d0effa24

Change-Id: I65a378750e049de27777093b039c50b09aa544cc
parents 6b0d3dfb d0effa24
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -98,7 +98,8 @@ import java.util.Set;
 * The Settings provider contains global system-level device preferences.
 * The Settings provider contains global system-level device preferences.
 */
 */
public final class Settings {
public final class Settings {
    private static final boolean DEFAULT_OVERRIDEABLE_BY_RESTORE = false;
    /** @hide */
    public static final boolean DEFAULT_OVERRIDEABLE_BY_RESTORE = false;
    // Intent actions for Settings
    // Intent actions for Settings
+5 −0
Original line number Original line Diff line number Diff line
@@ -2778,6 +2778,11 @@ public class SettingsProvider extends ContentProvider {
        public boolean insertSettingLocked(int type, int userId, String name, String value,
        public boolean insertSettingLocked(int type, int userId, String name, String value,
                String tag, boolean makeDefault, boolean forceNonSystemPackage, String packageName,
                String tag, boolean makeDefault, boolean forceNonSystemPackage, String packageName,
                boolean forceNotify, Set<String> criticalSettings, boolean overrideableByRestore) {
                boolean forceNotify, Set<String> criticalSettings, boolean overrideableByRestore) {
            if (overrideableByRestore != Settings.DEFAULT_OVERRIDEABLE_BY_RESTORE) {
                getContext().enforceCallingOrSelfPermission(
                        Manifest.permission.MODIFY_SETTINGS_OVERRIDEABLE_BY_RESTORE,
                        "Caller is not allowed to modify settings overrideable by restore");
            }
            final int key = makeKey(type, userId);
            final int key = makeKey(type, userId);


            boolean success = false;
            boolean success = false;