cmsdk: remove 'hide clock' option from clock position tunable

* Hiding the clock is now possible using the icon blacklist.
* Since the the hide option in the clock position tunable
  isn't currently implemented let's remove it

Change-Id: I2412051289a922dfc72cdf266b47f32cf7aaa31a
This commit is contained in:
Hendrik Hagendorn
2016-12-13 18:32:16 +01:00
parent 8f7ef5dfea
commit 5bb06dccb5
3 changed files with 36 additions and 16 deletions

View File

@@ -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";

View File

@@ -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) {

View File

@@ -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