summaryrefslogtreecommitdiffstats
path: root/packages/SettingsProvider
diff options
context:
space:
mode:
Diffstat (limited to 'packages/SettingsProvider')
-rw-r--r--packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java32
1 files changed, 29 insertions, 3 deletions
diff --git a/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java b/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java
index 90acd41..f8b5700 100644
--- a/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java
+++ b/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java
@@ -27,7 +27,6 @@ import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.database.sqlite.SQLiteStatement;
-import android.location.LocationManager;
import android.media.AudioManager;
import android.media.AudioService;
import android.net.ConnectivityManager;
@@ -64,7 +63,7 @@ class DatabaseHelper extends SQLiteOpenHelper {
private static final String TAG = "SettingsProvider";
private static final String DATABASE_NAME = "settings.db";
- private static final int DATABASE_VERSION = 32;
+ private static final int DATABASE_VERSION = 33;
private Context mContext;
@@ -354,6 +353,24 @@ class DatabaseHelper extends SQLiteOpenHelper {
upgradeVersion = 32;
}
+ if (upgradeVersion == 32) {
+ // The Wi-Fi watchdog SSID list is now seeded with the value of
+ // the property ro.com.android.wifi-watchlist
+ String wifiWatchList = SystemProperties.get("ro.com.android.wifi-watchlist");
+ if (!TextUtils.isEmpty(wifiWatchList)) {
+ db.beginTransaction();
+ try {
+ db.execSQL("INSERT OR IGNORE INTO secure(name,value) values('" +
+ Settings.Secure.WIFI_WATCHDOG_WATCH_LIST + "','" +
+ wifiWatchList + "');");
+ db.setTransactionSuccessful();
+ } finally {
+ db.endTransaction();
+ }
+ }
+ upgradeVersion = 33;
+ }
+
if (upgradeVersion != currentVersion) {
Log.w(TAG, "Got stuck trying to upgrade from version " + upgradeVersion
+ ", must wipe the settings provider");
@@ -619,11 +636,20 @@ class DatabaseHelper extends SQLiteOpenHelper {
R.bool.def_wifi_on);
loadBooleanSetting(stmt, Settings.Secure.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON,
R.bool.def_networks_available_notification_on);
-
+
+ String wifiWatchList = SystemProperties.get("ro.com.android.wifi-watchlist");
+ if (!TextUtils.isEmpty(wifiWatchList)) {
+ loadSetting(stmt, Settings.Secure.WIFI_WATCHDOG_WATCH_LIST, wifiWatchList);
+ }
+
// Don't do this. The SystemServer will initialize ADB_ENABLED from a
// persistent system property instead.
//loadSetting(stmt, Settings.Secure.ADB_ENABLED, 0);
+ // Allow mock locations default, based on build
+ loadSetting(stmt, Settings.Secure.ALLOW_MOCK_LOCATION,
+ "1".equals(SystemProperties.get("ro.allow.mock.location")) ? 1 : 0);
+
stmt.close();
}