Loading core/java/android/provider/Settings.java +12 −1 Original line number Diff line number Diff line Loading @@ -2610,6 +2610,7 @@ public final class Settings { MOVED_TO_GLOBAL.add(Settings.Global.ADB_ENABLED); MOVED_TO_GLOBAL.add(Settings.Global.ASSISTED_GPS_ENABLED); MOVED_TO_GLOBAL.add(Settings.Global.BLUETOOTH_ON); MOVED_TO_GLOBAL.add(Settings.Global.BUGREPORT_IN_POWER_MENU); MOVED_TO_GLOBAL.add(Settings.Global.CDMA_CELL_BROADCAST_SMS); MOVED_TO_GLOBAL.add(Settings.Global.CDMA_ROAMING_MODE); MOVED_TO_GLOBAL.add(Settings.Global.CDMA_SUBSCRIPTION_MODE); Loading Loading @@ -3081,8 +3082,10 @@ public final class Settings { /** * When the user has enable the option to have a "bug report" command * in the power menu. * @deprecated Use {@link android.provider.Settings.Global#BUGREPORT_IN_POWER_MENU} instead * @hide */ @Deprecated public static final String BUGREPORT_IN_POWER_MENU = "bugreport_in_power_menu"; /** Loading Loading @@ -4037,7 +4040,7 @@ public final class Settings { * @hide */ public static final String[] SETTINGS_TO_BACKUP = { BUGREPORT_IN_POWER_MENU, BUGREPORT_IN_POWER_MENU, // moved to global ALLOW_MOCK_LOCATION, PARENTAL_CONTROL_ENABLED, PARENTAL_CONTROL_REDIRECT_URL, Loading Loading @@ -4315,6 +4318,13 @@ public final class Settings { */ public static final String STAY_ON_WHILE_PLUGGED_IN = "stay_on_while_plugged_in"; /** * When the user has enable the option to have a "bug report" command * in the power menu. * @hide */ public static final String BUGREPORT_IN_POWER_MENU = "bugreport_in_power_menu"; /** * Whether ADB is enabled. */ Loading Loading @@ -5359,6 +5369,7 @@ public final class Settings { * @hide */ public static final String[] SETTINGS_TO_BACKUP = { BUGREPORT_IN_POWER_MENU, STAY_ON_WHILE_PLUGGED_IN, MODE_RINGER, AUTO_TIME, Loading packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java +15 −3 Original line number Diff line number Diff line Loading @@ -71,7 +71,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 = 95; private static final int DATABASE_VERSION = 96; private Context mContext; private int mUserHandle; Loading Loading @@ -1488,7 +1488,6 @@ public class DatabaseHelper extends SQLiteOpenHelper { // Redo this step, since somehow it didn't work the first time for some users if (mUserHandle == UserHandle.USER_OWNER) { db.beginTransaction(); SQLiteStatement stmt = null; try { // Migrate now-global settings String[] settingsToMove = hashsetToStringArray(SettingsProvider.sSystemGlobalKeys); Loading @@ -1499,7 +1498,6 @@ public class DatabaseHelper extends SQLiteOpenHelper { db.setTransactionSuccessful(); } finally { db.endTransaction(); if (stmt != null) stmt.close(); } } upgradeVersion = 94; Loading @@ -1524,6 +1522,20 @@ public class DatabaseHelper extends SQLiteOpenHelper { upgradeVersion = 95; } if (upgradeVersion == 95) { if (mUserHandle == UserHandle.USER_OWNER) { db.beginTransaction(); try { String[] settingsToMove = { Settings.Global.BUGREPORT_IN_POWER_MENU }; moveSettingsToNewTable(db, TABLE_SECURE, TABLE_GLOBAL, settingsToMove, true); db.setTransactionSuccessful(); } finally { db.endTransaction(); } } upgradeVersion = 96; } // *** Remember to update DATABASE_VERSION above! if (upgradeVersion != currentVersion) { Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettingsModel.java +2 −2 Original line number Diff line number Diff line Loading @@ -139,7 +139,7 @@ class QuickSettingsModel implements BluetoothStateChangeCallback, public void startObserving() { final ContentResolver cr = mContext.getContentResolver(); cr.registerContentObserver( Settings.Secure.getUriFor(Settings.Secure.BUGREPORT_IN_POWER_MENU), false, this); Settings.Global.getUriFor(Settings.Global.BUGREPORT_IN_POWER_MENU), false, this); } } Loading Loading @@ -544,7 +544,7 @@ class QuickSettingsModel implements BluetoothStateChangeCallback, final ContentResolver cr = mContext.getContentResolver(); boolean enabled = false; try { enabled = (Settings.Secure.getInt(cr, Settings.Secure.BUGREPORT_IN_POWER_MENU) != 0); enabled = (Settings.Global.getInt(cr, Settings.Global.BUGREPORT_IN_POWER_MENU) != 0); } catch (SettingNotFoundException e) { } Loading policy/src/com/android/internal/policy/impl/GlobalActions.java +2 −2 Original line number Diff line number Diff line Loading @@ -260,8 +260,8 @@ class GlobalActions implements DialogInterface.OnDismissListener, DialogInterfac mItems.add(mAirplaneModeOn); // next: bug report, if enabled if (Settings.Secure.getInt(mContext.getContentResolver(), Settings.Secure.BUGREPORT_IN_POWER_MENU, 0) != 0) { if (Settings.Global.getInt(mContext.getContentResolver(), Settings.Global.BUGREPORT_IN_POWER_MENU, 0) != 0) { mItems.add( new SinglePressAction(com.android.internal.R.drawable.stat_sys_adb, R.string.global_action_bug_report) { Loading Loading
core/java/android/provider/Settings.java +12 −1 Original line number Diff line number Diff line Loading @@ -2610,6 +2610,7 @@ public final class Settings { MOVED_TO_GLOBAL.add(Settings.Global.ADB_ENABLED); MOVED_TO_GLOBAL.add(Settings.Global.ASSISTED_GPS_ENABLED); MOVED_TO_GLOBAL.add(Settings.Global.BLUETOOTH_ON); MOVED_TO_GLOBAL.add(Settings.Global.BUGREPORT_IN_POWER_MENU); MOVED_TO_GLOBAL.add(Settings.Global.CDMA_CELL_BROADCAST_SMS); MOVED_TO_GLOBAL.add(Settings.Global.CDMA_ROAMING_MODE); MOVED_TO_GLOBAL.add(Settings.Global.CDMA_SUBSCRIPTION_MODE); Loading Loading @@ -3081,8 +3082,10 @@ public final class Settings { /** * When the user has enable the option to have a "bug report" command * in the power menu. * @deprecated Use {@link android.provider.Settings.Global#BUGREPORT_IN_POWER_MENU} instead * @hide */ @Deprecated public static final String BUGREPORT_IN_POWER_MENU = "bugreport_in_power_menu"; /** Loading Loading @@ -4037,7 +4040,7 @@ public final class Settings { * @hide */ public static final String[] SETTINGS_TO_BACKUP = { BUGREPORT_IN_POWER_MENU, BUGREPORT_IN_POWER_MENU, // moved to global ALLOW_MOCK_LOCATION, PARENTAL_CONTROL_ENABLED, PARENTAL_CONTROL_REDIRECT_URL, Loading Loading @@ -4315,6 +4318,13 @@ public final class Settings { */ public static final String STAY_ON_WHILE_PLUGGED_IN = "stay_on_while_plugged_in"; /** * When the user has enable the option to have a "bug report" command * in the power menu. * @hide */ public static final String BUGREPORT_IN_POWER_MENU = "bugreport_in_power_menu"; /** * Whether ADB is enabled. */ Loading Loading @@ -5359,6 +5369,7 @@ public final class Settings { * @hide */ public static final String[] SETTINGS_TO_BACKUP = { BUGREPORT_IN_POWER_MENU, STAY_ON_WHILE_PLUGGED_IN, MODE_RINGER, AUTO_TIME, Loading
packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java +15 −3 Original line number Diff line number Diff line Loading @@ -71,7 +71,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 = 95; private static final int DATABASE_VERSION = 96; private Context mContext; private int mUserHandle; Loading Loading @@ -1488,7 +1488,6 @@ public class DatabaseHelper extends SQLiteOpenHelper { // Redo this step, since somehow it didn't work the first time for some users if (mUserHandle == UserHandle.USER_OWNER) { db.beginTransaction(); SQLiteStatement stmt = null; try { // Migrate now-global settings String[] settingsToMove = hashsetToStringArray(SettingsProvider.sSystemGlobalKeys); Loading @@ -1499,7 +1498,6 @@ public class DatabaseHelper extends SQLiteOpenHelper { db.setTransactionSuccessful(); } finally { db.endTransaction(); if (stmt != null) stmt.close(); } } upgradeVersion = 94; Loading @@ -1524,6 +1522,20 @@ public class DatabaseHelper extends SQLiteOpenHelper { upgradeVersion = 95; } if (upgradeVersion == 95) { if (mUserHandle == UserHandle.USER_OWNER) { db.beginTransaction(); try { String[] settingsToMove = { Settings.Global.BUGREPORT_IN_POWER_MENU }; moveSettingsToNewTable(db, TABLE_SECURE, TABLE_GLOBAL, settingsToMove, true); db.setTransactionSuccessful(); } finally { db.endTransaction(); } } upgradeVersion = 96; } // *** Remember to update DATABASE_VERSION above! if (upgradeVersion != currentVersion) { Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettingsModel.java +2 −2 Original line number Diff line number Diff line Loading @@ -139,7 +139,7 @@ class QuickSettingsModel implements BluetoothStateChangeCallback, public void startObserving() { final ContentResolver cr = mContext.getContentResolver(); cr.registerContentObserver( Settings.Secure.getUriFor(Settings.Secure.BUGREPORT_IN_POWER_MENU), false, this); Settings.Global.getUriFor(Settings.Global.BUGREPORT_IN_POWER_MENU), false, this); } } Loading Loading @@ -544,7 +544,7 @@ class QuickSettingsModel implements BluetoothStateChangeCallback, final ContentResolver cr = mContext.getContentResolver(); boolean enabled = false; try { enabled = (Settings.Secure.getInt(cr, Settings.Secure.BUGREPORT_IN_POWER_MENU) != 0); enabled = (Settings.Global.getInt(cr, Settings.Global.BUGREPORT_IN_POWER_MENU) != 0); } catch (SettingNotFoundException e) { } Loading
policy/src/com/android/internal/policy/impl/GlobalActions.java +2 −2 Original line number Diff line number Diff line Loading @@ -260,8 +260,8 @@ class GlobalActions implements DialogInterface.OnDismissListener, DialogInterfac mItems.add(mAirplaneModeOn); // next: bug report, if enabled if (Settings.Secure.getInt(mContext.getContentResolver(), Settings.Secure.BUGREPORT_IN_POWER_MENU, 0) != 0) { if (Settings.Global.getInt(mContext.getContentResolver(), Settings.Global.BUGREPORT_IN_POWER_MENU, 0) != 0) { mItems.add( new SinglePressAction(com.android.internal.R.drawable.stat_sys_adb, R.string.global_action_bug_report) { Loading