Loading core/java/android/os/IHardwareService.aidl +3 −0 Original line number Diff line number Diff line Loading @@ -32,6 +32,9 @@ interface IHardwareService // sets the brightness of the backlights (screen, keyboard, button) 0-255 void setBacklights(int brightness); // enables or disables automatic brightness mode void setAutoBrightness(boolean on); // for the phone void setAttentionLight(boolean on); } Loading core/java/android/provider/Settings.java +6 −0 Original line number Diff line number Diff line Loading @@ -1060,6 +1060,12 @@ public final class Settings { */ public static final String SCREEN_BRIGHTNESS = "screen_brightness"; /** * Control whether to enable automatic brightness mode. * @hide */ public static final String SCREEN_BRIGHTNESS_MODE = "screen_brightness_mode"; /** * Control whether the process CPU usage meter should be shown. */ Loading core/res/res/values/config.xml +2 −0 Original line number Diff line number Diff line Loading @@ -81,4 +81,6 @@ <item>30</item> </integer-array> <!-- Flag indicating whether the device supports automatic brightness mode. --> <bool name="config_automatic_brightness_available">false</bool> </resources> packages/SettingsProvider/res/values/defaults.xml +1 −0 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ <bool name="def_accelerometer_rotation">true</bool> <!-- Default screen brightness, from 0 to 255. 102 is 40%. --> <integer name="def_screen_brightness">102</integer> <bool name="def_screen_brightness_automatic_mode">false</bool> <fraction name="def_window_animation_scale">100%</fraction> <fraction name="def_window_transition_scale">0%</fraction> Loading packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java +20 −1 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 = 39; private static final int DATABASE_VERSION = 40; private Context mContext; Loading Loading @@ -465,6 +465,22 @@ public class DatabaseHelper extends SQLiteOpenHelper { upgradeVersion = 39; } if (upgradeVersion == 39) { db.beginTransaction(); try { String value = mContext.getResources().getBoolean( R.bool.def_screen_brightness_automatic_mode) ? "1" : "0"; db.execSQL("INSERT OR IGNORE INTO system(name,value) values('" + Settings.System.SCREEN_BRIGHTNESS_MODE + "','" + value + "');"); db.setTransactionSuccessful(); } finally { db.endTransaction(); } upgradeVersion = 40; } if (upgradeVersion != currentVersion) { Log.w(TAG, "Got stuck trying to upgrade from version " + upgradeVersion + ", must wipe the settings provider"); Loading Loading @@ -701,6 +717,9 @@ public class DatabaseHelper extends SQLiteOpenHelper { loadIntegerSetting(stmt, Settings.System.SCREEN_BRIGHTNESS, R.integer.def_screen_brightness); loadBooleanSetting(stmt, Settings.System.SCREEN_BRIGHTNESS_MODE, R.bool.def_screen_brightness_automatic_mode); loadDefaultAnimationSettings(stmt); loadBooleanSetting(stmt, Settings.System.ACCELEROMETER_ROTATION, Loading Loading
core/java/android/os/IHardwareService.aidl +3 −0 Original line number Diff line number Diff line Loading @@ -32,6 +32,9 @@ interface IHardwareService // sets the brightness of the backlights (screen, keyboard, button) 0-255 void setBacklights(int brightness); // enables or disables automatic brightness mode void setAutoBrightness(boolean on); // for the phone void setAttentionLight(boolean on); } Loading
core/java/android/provider/Settings.java +6 −0 Original line number Diff line number Diff line Loading @@ -1060,6 +1060,12 @@ public final class Settings { */ public static final String SCREEN_BRIGHTNESS = "screen_brightness"; /** * Control whether to enable automatic brightness mode. * @hide */ public static final String SCREEN_BRIGHTNESS_MODE = "screen_brightness_mode"; /** * Control whether the process CPU usage meter should be shown. */ Loading
core/res/res/values/config.xml +2 −0 Original line number Diff line number Diff line Loading @@ -81,4 +81,6 @@ <item>30</item> </integer-array> <!-- Flag indicating whether the device supports automatic brightness mode. --> <bool name="config_automatic_brightness_available">false</bool> </resources>
packages/SettingsProvider/res/values/defaults.xml +1 −0 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ <bool name="def_accelerometer_rotation">true</bool> <!-- Default screen brightness, from 0 to 255. 102 is 40%. --> <integer name="def_screen_brightness">102</integer> <bool name="def_screen_brightness_automatic_mode">false</bool> <fraction name="def_window_animation_scale">100%</fraction> <fraction name="def_window_transition_scale">0%</fraction> Loading
packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java +20 −1 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 = 39; private static final int DATABASE_VERSION = 40; private Context mContext; Loading Loading @@ -465,6 +465,22 @@ public class DatabaseHelper extends SQLiteOpenHelper { upgradeVersion = 39; } if (upgradeVersion == 39) { db.beginTransaction(); try { String value = mContext.getResources().getBoolean( R.bool.def_screen_brightness_automatic_mode) ? "1" : "0"; db.execSQL("INSERT OR IGNORE INTO system(name,value) values('" + Settings.System.SCREEN_BRIGHTNESS_MODE + "','" + value + "');"); db.setTransactionSuccessful(); } finally { db.endTransaction(); } upgradeVersion = 40; } if (upgradeVersion != currentVersion) { Log.w(TAG, "Got stuck trying to upgrade from version " + upgradeVersion + ", must wipe the settings provider"); Loading Loading @@ -701,6 +717,9 @@ public class DatabaseHelper extends SQLiteOpenHelper { loadIntegerSetting(stmt, Settings.System.SCREEN_BRIGHTNESS, R.integer.def_screen_brightness); loadBooleanSetting(stmt, Settings.System.SCREEN_BRIGHTNESS_MODE, R.bool.def_screen_brightness_automatic_mode); loadDefaultAnimationSettings(stmt); loadBooleanSetting(stmt, Settings.System.ACCELEROMETER_ROTATION, Loading