Commit fa601425 authored by Tomasz Wasilczyk's avatar Tomasz Wasilczyk Committed by Al Sutton

BACKPORT: Fix initialization of USER_ROTATION setting.

Until now, def_user_rotation was effectively a dead default:
- added missing def_user_rotation -> USER_ROTATION first-run initialization
- corrected the setting type when upgrading database

Bug: 178000973
Test: set def_user_rotation to 1 in default.xml and flash Pixel 3a
Change-Id: If2aa9665a0167f696f6b16a16be48ac473271631
parent 751fb2d2
......@@ -849,8 +849,8 @@ class DatabaseHelper extends SQLiteOpenHelper {
try {
stmt = db.compileStatement("INSERT INTO system(name,value)"
+ " VALUES(?,?);");
loadBooleanSetting(stmt, Settings.System.USER_ROTATION,
R.integer.def_user_rotation); // should be zero degrees
loadIntegerSetting(stmt, Settings.System.USER_ROTATION,
R.integer.def_user_rotation);
db.setTransactionSuccessful();
} finally {
db.endTransaction();
......@@ -2269,6 +2269,8 @@ class DatabaseHelper extends SQLiteOpenHelper {
loadBooleanSetting(stmt, Settings.System.ACCELEROMETER_ROTATION,
R.bool.def_accelerometer_rotation);
loadIntegerSetting(stmt, Settings.System.USER_ROTATION, R.integer.def_user_rotation);
loadDefaultHapticSettings(stmt);
loadBooleanSetting(stmt, Settings.System.NOTIFICATION_LIGHT_PULSE,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment