diff options
author | John Spurlock <jspurlock@google.com> | 2015-05-11 20:42:51 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-05-11 20:42:52 +0000 |
commit | fb9a664b2bcb41844f1e00264ff5c5f18956a9fa (patch) | |
tree | e084b9b26888d8b96e8b63f2bd6e5662a95afd56 | |
parent | faf55219877416c1bdfbdfe5b7d24e35e9971a03 (diff) | |
parent | e11ae116314a32ff1570f023b95e0ece3dbcc2e9 (diff) | |
download | frameworks_base-fb9a664b2bcb41844f1e00264ff5c5f18956a9fa.zip frameworks_base-fb9a664b2bcb41844f1e00264ff5c5f18956a9fa.tar.gz frameworks_base-fb9a664b2bcb41844f1e00264ff5c5f18956a9fa.tar.bz2 |
Merge "Zen: Reset zen + ringer modes on upgrades to M." into mnc-dev
-rw-r--r-- | packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java b/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java index 1953e75..5f5d61e 100644 --- a/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java +++ b/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java @@ -35,6 +35,7 @@ import android.database.MatrixCursor; import android.database.sqlite.SQLiteDatabase; import android.database.sqlite.SQLiteQueryBuilder; import android.hardware.camera2.utils.ArrayUtils; +import android.media.AudioManager; import android.net.Uri; import android.os.Binder; import android.os.Build; @@ -52,9 +53,11 @@ import android.util.ArrayMap; import android.util.ArraySet; import android.util.Slog; import android.util.SparseArray; + import com.android.internal.annotations.GuardedBy; import com.android.internal.content.PackageMonitor; import com.android.internal.os.BackgroundThread; + import java.io.File; import java.io.FileDescriptor; import java.io.FileNotFoundException; @@ -1788,7 +1791,7 @@ public class SettingsProvider extends ContentProvider { } private final class UpgradeController { - private static final int SETTINGS_VERSION = 118; + private static final int SETTINGS_VERSION = 119; private final int mUserId; @@ -1891,6 +1894,20 @@ public class SettingsProvider extends ContentProvider { int currentVersion = oldVersion; + // v119: Reset zen + ringer mode. + if (currentVersion == 118) { + if (userId == UserHandle.USER_OWNER) { + final SettingsState globalSettings = getGlobalSettingsLocked(); + globalSettings.updateSettingLocked(Settings.Global.ZEN_MODE, + Integer.toString(Settings.Global.ZEN_MODE_OFF), + SettingsState.SYSTEM_PACKAGE_NAME); + globalSettings.updateSettingLocked(Settings.Global.MODE_RINGER, + Integer.toString(AudioManager.RINGER_MODE_NORMAL), + SettingsState.SYSTEM_PACKAGE_NAME); + } + currentVersion = 119; + } + // vXXX: Add new settings above this point. // Return the current version. |