summaryrefslogtreecommitdiffstats
path: root/packages
diff options
context:
space:
mode:
Diffstat (limited to 'packages')
-rw-r--r--packages/DefaultContainerService/src/com/android/defcontainer/DefaultContainerService.java30
-rw-r--r--packages/SettingsProvider/res/values/defaults.xml4
-rw-r--r--packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java63
3 files changed, 42 insertions, 55 deletions
diff --git a/packages/DefaultContainerService/src/com/android/defcontainer/DefaultContainerService.java b/packages/DefaultContainerService/src/com/android/defcontainer/DefaultContainerService.java
index 14c8806..57f9ce7 100644
--- a/packages/DefaultContainerService/src/com/android/defcontainer/DefaultContainerService.java
+++ b/packages/DefaultContainerService/src/com/android/defcontainer/DefaultContainerService.java
@@ -339,25 +339,19 @@ public class DefaultContainerService extends IntentService {
checkBoth = true;
break check_inner;
}
- // Check if user option is enabled
- boolean setInstallLoc = Settings.System.getInt(getApplicationContext()
+ // Pick user preference
+ int installPreference = Settings.System.getInt(getApplicationContext()
.getContentResolver(),
- Settings.System.SET_INSTALL_LOCATION, 0) != 0;
- if (setInstallLoc) {
- // Pick user preference
- int installPreference = Settings.System.getInt(getApplicationContext()
- .getContentResolver(),
- Settings.System.DEFAULT_INSTALL_LOCATION,
- PackageHelper.APP_INSTALL_AUTO);
- if (installPreference == PackageHelper.APP_INSTALL_INTERNAL) {
- checkInt = true;
- checkBoth = true;
- break check_inner;
- } else if (installPreference == PackageHelper.APP_INSTALL_EXTERNAL) {
- checkExt = true;
- checkBoth = true;
- break check_inner;
- }
+ Settings.Secure.DEFAULT_INSTALL_LOCATION,
+ PackageHelper.APP_INSTALL_AUTO);
+ if (installPreference == PackageHelper.APP_INSTALL_INTERNAL) {
+ checkInt = true;
+ checkBoth = true;
+ break check_inner;
+ } else if (installPreference == PackageHelper.APP_INSTALL_EXTERNAL) {
+ checkExt = true;
+ checkBoth = true;
+ break check_inner;
}
// Fall back to default policy if nothing else is specified.
checkInt = true;
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);