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

Commit 67280cba authored by Ted Bauer's avatar Ted Bauer Committed by Automerger Merge Worker
Browse files

Merge "Remove READ_DEVICE_CONFIG checks." into main am: 1a9937a2

parents ac3576b0 1a9937a2
Loading
Loading
Loading
Loading
+0 −16
Original line number Diff line number Diff line
@@ -3470,7 +3470,6 @@ public final class Settings {
        public ArrayMap<String, String> getStringsForPrefix(ContentResolver cr, String prefix,
                List<String> names) {
            String namespace = prefix.substring(0, prefix.length() - 1);
            Config.enforceReadPermission(namespace);
            ArrayMap<String, String> keyValues = new ArrayMap<>();
            int currentGeneration = -1;
            boolean needsGenerationTracker = false;
@@ -19385,21 +19384,6 @@ public final class Settings {
               .getApplicationContext().checkCallingOrSelfPermission(permission);
        }
        /**
         * Enforces READ_DEVICE_CONFIG permission if namespace is not one of public namespaces.
         * @hide
         */
        public static void enforceReadPermission(String namespace) {
            if (ActivityThread.currentApplication().getApplicationContext()
                    .checkCallingOrSelfPermission(Manifest.permission.READ_DEVICE_CONFIG)
                    != PackageManager.PERMISSION_GRANTED) {
                if (!DeviceConfig.getPublicNamespaces().contains(namespace)) {
                    throw new SecurityException("Permission denial: reading from settings requires:"
                        + Manifest.permission.READ_DEVICE_CONFIG);
                }
            }
        }
        private static void setMonitorCallbackAsUser(
                @NonNull @CallbackExecutor Executor executor,
                @NonNull ContentResolver resolver, @UserIdInt int userHandle,
+0 −5
Original line number Diff line number Diff line
@@ -1194,8 +1194,6 @@ public class SettingsProvider extends ContentProvider {
            Slog.v(LOG_TAG, "getConfigSetting(" + name + ")");
        }

        Settings.Config.enforceReadPermission(/*namespace=*/name.split("/")[0]);

        // Get the value.
        synchronized (mLock) {
            return mSettingsRegistry.getSettingLocked(SETTINGS_TYPE_CONFIG,
@@ -1375,9 +1373,6 @@ public class SettingsProvider extends ContentProvider {
            Slog.v(LOG_TAG, "getAllConfigFlags() for " + prefix);
        }

        Settings.Config.enforceReadPermission(
                prefix != null ? prefix.split("/")[0] : null);

        synchronized (mLock) {
            // Get the settings.
            SettingsState settingsState = mSettingsRegistry.getSettingsLocked(