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

Commit 1f0943dd authored by Svet Ganov's avatar Svet Ganov Committed by Android (Google) Code Review
Browse files

Merge "DO NOT MERGE Do not clean up global/system settings on package unintalls." into mnc-dev

parents c83d46a2 8de34809
Loading
Loading
Loading
Loading
+7 −8
Original line number Diff line number Diff line
@@ -1500,17 +1500,16 @@ public class SettingsProvider extends ContentProvider {
        }

        public void onPackageRemovedLocked(String packageName, int userId) {
            final int globalKey = makeKey(SETTINGS_TYPE_GLOBAL, UserHandle.USER_OWNER);
            SettingsState globalSettings = mSettingsStates.get(globalKey);
            if (globalSettings != null) globalSettings.onPackageRemovedLocked(packageName);

            final int secureKey = makeKey(SETTINGS_TYPE_SECURE, userId);
            SettingsState secureSettings = mSettingsStates.get(secureKey);
            if (secureSettings != null) secureSettings.onPackageRemovedLocked(packageName);
            // Global and secure settings are signature protected. Apps signed
            // by the platform certificate are generally not uninstalled  and
            // the main exception is tests. We trust components signed
            // by the platform certificate and do not do a clean up after them.

            final int systemKey = makeKey(SETTINGS_TYPE_SYSTEM, userId);
            SettingsState systemSettings = mSettingsStates.get(systemKey);
            if (systemSettings != null) systemSettings.onPackageRemovedLocked(packageName);
            if (systemSettings != null) {
                systemSettings.onPackageRemovedLocked(packageName);
            }
        }

        private SettingsState peekSettingsStateLocked(int key) {
+1 −1
Original line number Diff line number Diff line
@@ -153,7 +153,7 @@ final class SettingsState {
        final int settingCount = mSettings.size();
        for (int i = settingCount - 1; i >= 0; i--) {
            String name = mSettings.keyAt(i);
            // Settings defined by use are never dropped.
            // Settings defined by us are never dropped.
            if (Settings.System.PUBLIC_SETTINGS.contains(name)
                    || Settings.System.PRIVATE_SETTINGS.contains(name)) {
                continue;