diff --git a/host/migration/src/CMSettings.java b/host/migration/src/CMSettings.java index 98e31940..5290d58c 100644 --- a/host/migration/src/CMSettings.java +++ b/host/migration/src/CMSettings.java @@ -58,13 +58,11 @@ public final class CMSettings { public static final String SYSTEM_PROFILES_ENABLED = "system_profiles_enabled"; /** - * Whether to hide the clock, show it in the right or left - * position or show it in the center - * 0: don't show the clock - * 1: show the clock in the right position (LTR) - * 2: show the clock in the center - * 3: show the clock in the left position (LTR) - * default: 1 + * Whether to show the clock in the right or left position or show it in the center + * 0: show the clock in the right position (LTR) + * 1: show the clock in the center + * 2: show the clock in the left position (LTR) + * default: 0 * @hide */ public static final String STATUS_BAR_CLOCK = "status_bar_clock"; diff --git a/packages/CMSettingsProvider/src/org/cyanogenmod/cmsettings/CMDatabaseHelper.java b/packages/CMSettingsProvider/src/org/cyanogenmod/cmsettings/CMDatabaseHelper.java index d35f4496..91c56018 100644 --- a/packages/CMSettingsProvider/src/org/cyanogenmod/cmsettings/CMDatabaseHelper.java +++ b/packages/CMSettingsProvider/src/org/cyanogenmod/cmsettings/CMDatabaseHelper.java @@ -46,7 +46,7 @@ public class CMDatabaseHelper extends SQLiteOpenHelper{ private static final boolean LOCAL_LOGV = false; private static final String DATABASE_NAME = "cmsettings.db"; - private static final int DATABASE_VERSION = 6; + private static final int DATABASE_VERSION = 7; public static class CMTableNames { public static final String TABLE_SYSTEM = "system"; @@ -232,6 +232,30 @@ public class CMDatabaseHelper extends SQLiteOpenHelper{ } upgradeVersion = 6; } + + if (upgradeVersion < 7) { + if (mUserHandle == UserHandle.USER_OWNER) { + db.beginTransaction(); + SQLiteStatement stmt = null; + try { + stmt = db.compileStatement("SELECT value FROM system WHERE name=?"); + stmt.bindString(1, CMSettings.System.STATUS_BAR_CLOCK); + long value = stmt.simpleQueryForLong(); + + if (value != 0) { + stmt = db.compileStatement("UPDATE system SET value=? WHERE name=?"); + stmt.bindLong(1, value - 1); + stmt.bindString(2, CMSettings.System.STATUS_BAR_CLOCK); + stmt.execute(); + } + db.setTransactionSuccessful(); + } finally { + if (stmt != null) stmt.close(); + db.endTransaction(); + } + } + upgradeVersion = 7; + } // *** Remember to update DATABASE_VERSION above! if (upgradeVersion < newVersion) { diff --git a/sdk/src/java/cyanogenmod/providers/CMSettings.java b/sdk/src/java/cyanogenmod/providers/CMSettings.java index 264ae64d..c1e6f920 100644 --- a/sdk/src/java/cyanogenmod/providers/CMSettings.java +++ b/sdk/src/java/cyanogenmod/providers/CMSettings.java @@ -834,19 +834,17 @@ public final class CMSettings { sBooleanValidator; /** - * Whether to hide the clock, show it in the right or left - * position or show it in the center - * 0: don't show the clock - * 1: show the clock in the right position (LTR) - * 2: show the clock in the center - * 3: show the clock in the left position (LTR) - * default: 1 + * Whether to show the clock in the right or left position or show it in the center + * 0: show the clock in the right position (LTR) + * 1: show the clock in the center + * 2: show the clock in the left position (LTR) + * default: 0 */ public static final String STATUS_BAR_CLOCK = "status_bar_clock"; /** @hide */ public static final Validator STATUS_BAR_CLOCK_VALIDATOR = - new InclusiveIntegerRangeValidator(0, 3); + new InclusiveIntegerRangeValidator(0, 2); /** * Whether the notification light will be allowed when in zen mode during downtime