From 930eaf7c4dc4b40e139be9fa5e34d3f5f3d611e6 Mon Sep 17 00:00:00 2001 From: d34d Date: Tue, 10 Nov 2015 10:48:47 -0800 Subject: [PATCH] CMSettings: Move Secure settings to CMSettings This moves all Settings.Secure.* settings that, were added to CyanogenMod, to CMSettings. Change-Id: Ieaac288bfcb6189b3bc393484d27e441d805aea2 --- .../cmsettings/CMSettingsProvider.java | 71 +++++++++++++++++++ .../cyanogenmod/providers/CMSettings.java | 54 ++++++++++++++ 2 files changed, 125 insertions(+) diff --git a/packages/CMSettingsProvider/src/org/cyanogenmod/cmsettings/CMSettingsProvider.java b/packages/CMSettingsProvider/src/org/cyanogenmod/cmsettings/CMSettingsProvider.java index 5a6b891..657c963 100644 --- a/packages/CMSettingsProvider/src/org/cyanogenmod/cmsettings/CMSettingsProvider.java +++ b/packages/CMSettingsProvider/src/org/cyanogenmod/cmsettings/CMSettingsProvider.java @@ -288,6 +288,62 @@ public class CMSettingsProvider extends ContentProvider { public static final String RECENTS_LONG_PRESS_ACTIVITY = CMSettings.Secure.RECENTS_LONG_PRESS_ACTIVITY; + /** + * Whether to display the ADB notification. + * @hide + */ + public static final String ADB_NOTIFY = CMSettings.Secure.ADB_NOTIFY; + + /** + * The TCP/IP port to run ADB on, or -1 for USB + * @hide + */ + public static final String ADB_PORT = CMSettings.Secure.ADB_PORT; + + /** + * The hostname for this device + * @hide + */ + public static final String DEVICE_HOSTNAME = CMSettings.Secure.DEVICE_HOSTNAME; + + /** + * Whether to allow killing of the foreground app by long-pressing the Back button + * @hide + */ + public static final String KILL_APP_LONGPRESS_BACK = + CMSettings.Secure.KILL_APP_LONGPRESS_BACK; + + /** Protected Components + * @hide + */ + public static final String PROTECTED_COMPONENTS = "protected_components"; + + /** + * Stored color matrix for LiveDisplay. This is used to allow co-existence with + * display tuning done by DisplayAdjustmentUtils when hardware support isn't + * available. + * @hide + */ + public static final String LIVE_DISPLAY_COLOR_MATRIX = "live_display_color_matrix"; + + /** + * Whether to include options in power menu for rebooting into recovery or bootloader + * @hide + */ + public static final String ADVANCED_REBOOT = CMSettings.Secure.ADVANCED_REBOOT; + + /** + * This will be set to the system's current theme API version when ThemeService starts. + * It is useful for when an upgrade from one version of CM to another occurs. + * For example, after a user upgrades from CM11 to CM12, the value of this field + * might be 19. ThemeService would then change the value to 21. This is useful + * when an API change breaks a theme. Themeservice can identify old themes and + * unapply them from the system. + * @hide + */ + public static final String THEME_PREV_BOOT_API_LEVEL = + CMSettings.Secure.THEME_PREV_BOOT_API_LEVEL; + /** * Navigation controls to Use * @hide @@ -831,6 +887,21 @@ public class CMSettingsProvider extends ContentProvider { secureToCmSettingsMap.put(LegacyCMSettings.INCALL_POWER_BUTTON_BEHAVIOR, CMSettings.Secure.INCALL_POWER_BUTTON_BEHAVIOR); + secureToCmSettingsMap.put(LegacyCMSettings.ADB_NOTIFY, CMSettings.Secure.ADB_NOTIFY); + secureToCmSettingsMap.put(LegacyCMSettings.ADB_PORT, CMSettings.Secure.ADB_PORT); + secureToCmSettingsMap.put(LegacyCMSettings.DEVICE_HOSTNAME, + CMSettings.Secure.DEVICE_HOSTNAME); + secureToCmSettingsMap.put(LegacyCMSettings.KILL_APP_LONGPRESS_BACK, + CMSettings.Secure.KILL_APP_LONGPRESS_BACK); + secureToCmSettingsMap.put(LegacyCMSettings.PROTECTED_COMPONENTS, + CMSettings.Secure.PROTECTED_COMPONENTS); + secureToCmSettingsMap.put(LegacyCMSettings.LIVE_DISPLAY_COLOR_MATRIX, + CMSettings.Secure.LIVE_DISPLAY_COLOR_MATRIX); + secureToCmSettingsMap.put(LegacyCMSettings.ADVANCED_REBOOT, + CMSettings.Secure.ADVANCED_REBOOT); + secureToCmSettingsMap.put(LegacyCMSettings.THEME_PREV_BOOT_API_LEVEL, + CMSettings.Secure.THEME_PREV_BOOT_API_LEVEL); + rowsMigrated = migrateCMSettingsForTable(userId, CMDatabaseHelper.CMTableNames.TABLE_SECURE, secureToCmSettingsMap); if (LOCAL_LOGV) Log.d(TAG, "Migrated " + rowsMigrated + " to CM secure table"); diff --git a/src/java/cyanogenmod/providers/CMSettings.java b/src/java/cyanogenmod/providers/CMSettings.java index 8418997..25c1ea7 100644 --- a/src/java/cyanogenmod/providers/CMSettings.java +++ b/src/java/cyanogenmod/providers/CMSettings.java @@ -1636,6 +1636,60 @@ public final class CMSettings { */ public static final int INCALL_POWER_BUTTON_BEHAVIOR_DEFAULT = INCALL_POWER_BUTTON_BEHAVIOR_SCREEN_OFF; + + /** + * Whether to display the ADB notification. + * @hide + */ + public static final String ADB_NOTIFY = "adb_notify"; + + /** + * The TCP/IP port to run ADB on, or -1 for USB + * @hide + */ + public static final String ADB_PORT = "adb_port"; + + /** + * The hostname for this device + * @hide + */ + public static final String DEVICE_HOSTNAME = "device_hostname"; + + /** + * Whether to allow killing of the foreground app by long-pressing the Back button + * @hide + */ + public static final String KILL_APP_LONGPRESS_BACK = "kill_app_longpress_back"; + + /** Protected Components + * @hide + */ + public static final String PROTECTED_COMPONENTS = "protected_components"; + + /** + * Stored color matrix for LiveDisplay. This is used to allow co-existence with + * display tuning done by DisplayAdjustmentUtils when hardware support isn't + * available. + * @hide + */ + public static final String LIVE_DISPLAY_COLOR_MATRIX = "live_display_color_matrix"; + + /** + * Whether to include options in power menu for rebooting into recovery or bootloader + * @hide + */ + public static final String ADVANCED_REBOOT = "advanced_reboot"; + + /** + * This will be set to the system's current theme API version when ThemeService starts. + * It is useful for when an upgrade from one version of CM to another occurs. + * For example, after a user upgrades from CM11 to CM12, the value of this field + * might be 19. ThemeService would then change the value to 21. This is useful + * when an API change breaks a theme. Themeservice can identify old themes and + * unapply them from the system. + * @hide + */ + public static final String THEME_PREV_BOOT_API_LEVEL = "theme_prev_boot_api_level"; // endregion }