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

Commit dbb0f9ab authored by Adnan Begovic's avatar Adnan Begovic Committed by Steve Kondik
Browse files

Migrate QS_TILES to Settings.Secure

Change-Id: I42783f574d7e050a04e960c91883f2aefc8ab7d6
parent 8db41c5c
Loading
Loading
Loading
Loading
+23 −5
Original line number Diff line number Diff line
@@ -1239,11 +1239,15 @@ public final class Settings {
            MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_PING_COUNT);
            MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_PING_DELAY_MS);
            MOVED_TO_SECURE.add(Secure.WIFI_WATCHDOG_PING_TIMEOUT_MS);
            MOVED_TO_SECURE.add(Secure.STATS_COLLECTION);
            MOVED_TO_SECURE.add(Secure.VOLUME_LINK_NOTIFICATION);

            // At one time in System, then Global, but now back in Secure
            MOVED_TO_SECURE.add(Secure.INSTALL_NON_MARKET_APPS);

            /* CM12 CHANGES */
            MOVED_TO_SECURE.add(Secure.STATS_COLLECTION);
            MOVED_TO_SECURE.add(Secure.VOLUME_LINK_NOTIFICATION);
            MOVED_TO_SECURE.add(Secure.QS_TILES);
            MOVED_TO_SECURE.add(Secure.QS_USE_MAIN_TILES);
        }

        private static final HashSet<String> MOVED_TO_GLOBAL;
@@ -2108,16 +2112,17 @@ public final class Settings {
        public static final String QS_SHOW_BRIGHTNESS_SLIDER = "qs_show_brightness_slider";

        /**
         * List of QS tile names
         * Deprecated Use {@link android.provider.Settings.Secure.QS_TILES}
         * @hide
         */
        @Deprecated
        public static final String QS_TILES = "sysui_qs_tiles";

        /**
         * Use "main" tiles on the first row of the quick settings panel
         * 0 = no, 1 = yes
         * Deprecated Use {@link android.provider.Settings.Secure.QS_USE_MAIN_TILES}
         * @hide
         */
        @Deprecated
        public static final String QS_USE_MAIN_TILES = "sysui_qs_main_tiles";

        /**
@@ -5633,6 +5638,19 @@ public final class Settings {
         */
        public static final String APP_PERFORMANCE_PROFILES_ENABLED = "app_perf_profiles_enabled";

        /**
         * List of QS tile names
         * @hide
         */
        public static final String QS_TILES = "sysui_qs_tiles";

        /**
         * Use "main" tiles on the first row of the quick settings panel
         * 0 = no, 1 = yes
         * @hide
         */
        public static final String QS_USE_MAIN_TILES = "sysui_qs_main_tiles";

        /**
         * This are the settings to be backed up.
         *
+12 −1
Original line number Diff line number Diff line
@@ -75,7 +75,7 @@ public class DatabaseHelper extends SQLiteOpenHelper {
    // database gets upgraded properly. At a minimum, please confirm that 'upgradeVersion'
    // is properly propagated through your change.  Not doing so will result in a loss of user
    // settings.
    private static final int DATABASE_VERSION = 117;
    private static final int DATABASE_VERSION = 118;

    private static final String HEADSET = "_headset";
    private static final String SPEAKER = "_speaker";
@@ -1880,6 +1880,17 @@ public class DatabaseHelper extends SQLiteOpenHelper {
            upgradeVersion = 117;
        }

        if (upgradeVersion < 118) {
            String[] qsTiles = new String[] {
                    Settings.Secure.QS_TILES,
                    Settings.Secure.QS_USE_MAIN_TILES
            };

            moveSettingsToNewTable(db, TABLE_SYSTEM, TABLE_SECURE,
                    qsTiles, true);
            upgradeVersion = 118;
        }

        // *** Remember to update DATABASE_VERSION above!

        if (upgradeVersion != currentVersion) {