diff options
author | Suchi Amalapurapu <asuchitra@google.com> | 2010-04-07 21:32:30 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2010-04-07 21:32:30 -0700 |
commit | 3e543abbc18eec03ba7300b53cd65dc1c30fd40b (patch) | |
tree | f7d2a25ffa4c6c4b97a4cab005c597a895ee76ca /packages/SettingsProvider | |
parent | d49c455cc97d5fcdd8af497dc2ba85efdc719959 (diff) | |
parent | a599469f9095532cac95a8e7600412f156b88f1c (diff) | |
download | frameworks_base-3e543abbc18eec03ba7300b53cd65dc1c30fd40b.zip frameworks_base-3e543abbc18eec03ba7300b53cd65dc1c30fd40b.tar.gz frameworks_base-3e543abbc18eec03ba7300b53cd65dc1c30fd40b.tar.bz2 |
am a599469f: am c2461be6: Merge "Fix 2579461 Move install location values to secure settings. Diable attribute for UI. Set default value to auto. Add command line interface to set install location via pm." into froyo
Merge commit 'a599469f9095532cac95a8e7600412f156b88f1c' into kraken
* commit 'a599469f9095532cac95a8e7600412f156b88f1c':
Fix 2579461
Diffstat (limited to 'packages/SettingsProvider')
-rw-r--r-- | packages/SettingsProvider/res/values/defaults.xml | 4 | ||||
-rw-r--r-- | packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java | 63 |
2 files changed, 30 insertions, 37 deletions
diff --git a/packages/SettingsProvider/res/values/defaults.xml b/packages/SettingsProvider/res/values/defaults.xml index 34302c4..185d72a 100644 --- a/packages/SettingsProvider/res/values/defaults.xml +++ b/packages/SettingsProvider/res/values/defaults.xml @@ -56,10 +56,6 @@ <bool name="def_mount_ums_autostart">false</bool> <bool name="def_mount_ums_prompt">true</bool> <bool name="def_mount_ums_notify_enabled">true</bool> - <!-- Enable User preference for setting install location --> - <bool name="set_install_location">true</bool> - <!-- Default install location if user preference for setting install location is turned on. --> - <integer name="def_install_location">2</integer> <!-- user interface sound effects --> <integer name="def_power_sounds_enabled">1</integer> diff --git a/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java b/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java index d0e9dd9..0c0bf93 100644 --- a/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java +++ b/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java @@ -39,6 +39,8 @@ import android.util.AttributeSet; import android.util.Config; import android.util.Log; import android.util.Xml; + +import com.android.internal.content.PackageHelper; import com.android.internal.telephony.RILConstants; import com.android.internal.util.XmlUtils; import com.android.internal.widget.LockPatternUtils; @@ -61,7 +63,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 = 55; + private static final int DATABASE_VERSION = 56; private Context mContext; @@ -608,21 +610,8 @@ public class DatabaseHelper extends SQLiteOpenHelper { if (upgradeVersion == 50) { /* - * New settings for set install location UI. + * Install location no longer initiated here. */ - db.beginTransaction(); - SQLiteStatement stmt = null; - try { - stmt = db.compileStatement("INSERT INTO system(name,value)" - + " VALUES(?,?);"); - loadBooleanSetting(stmt, Settings.System.SET_INSTALL_LOCATION, - R.bool.set_install_location); - db.setTransactionSuccessful(); - } finally { - db.endTransaction(); - if (stmt != null) stmt.close(); - } - upgradeVersion = 51; } @@ -663,21 +652,8 @@ public class DatabaseHelper extends SQLiteOpenHelper { if (upgradeVersion == 53) { /* - * New settings for set install location UI. + * New settings for set install location UI no longer initiated here. */ - db.beginTransaction(); - SQLiteStatement stmt = null; - try { - stmt = db.compileStatement("INSERT INTO system(name,value)" - + " VALUES(?,?);"); - loadIntegerSetting(stmt, Settings.System.DEFAULT_INSTALL_LOCATION, - R.integer.def_install_location); - db.setTransactionSuccessful(); - } finally { - db.endTransaction(); - if (stmt != null) stmt.close(); - } - upgradeVersion = 54; } @@ -696,6 +672,28 @@ public class DatabaseHelper extends SQLiteOpenHelper { upgradeVersion = 55; } + if (upgradeVersion == 55) { + /* Move the install location settings. */ + String[] settingsToMove = { + Secure.SET_INSTALL_LOCATION, + Secure.DEFAULT_INSTALL_LOCATION + }; + moveFromSystemToSecure(db, settingsToMove); + db.beginTransaction(); + SQLiteStatement stmt = null; + try { + stmt = db.compileStatement("INSERT INTO system(name,value)" + + " VALUES(?,?);"); + loadSetting(stmt, Secure.SET_INSTALL_LOCATION, 0); + loadSetting(stmt, Secure.DEFAULT_INSTALL_LOCATION, + PackageHelper.APP_INSTALL_AUTO); + db.setTransactionSuccessful(); + } finally { + db.endTransaction(); + if (stmt != null) stmt.close(); + } + upgradeVersion = 56; + } // *** Remember to update DATABASE_VERSION above! if (upgradeVersion != currentVersion) { @@ -1021,10 +1019,9 @@ public class DatabaseHelper extends SQLiteOpenHelper { loadBooleanSetting(stmt, Settings.System.NOTIFICATION_LIGHT_PULSE, R.bool.def_notification_pulse); - loadBooleanSetting(stmt, Settings.System.SET_INSTALL_LOCATION, - R.bool.set_install_location); - loadIntegerSetting(stmt, Settings.System.DEFAULT_INSTALL_LOCATION, - R.integer.def_install_location); + loadSetting(stmt, Settings.Secure.SET_INSTALL_LOCATION, 0); + loadSetting(stmt, Settings.Secure.DEFAULT_INSTALL_LOCATION, + PackageHelper.APP_INSTALL_AUTO); loadUISoundEffectsSettings(stmt); |