diff options
author | Vikram Aggarwal <viki@google.com> | 2012-05-04 14:05:49 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2012-05-04 14:05:49 -0700 |
commit | 8b399cc71c960db05aa804c7e982709a1af5502d (patch) | |
tree | 4dee1c787c42c9ec60cadab876b4c2e7ba891299 | |
parent | 37dfc0c1acc675723e2fb48488e75a72003d63c9 (diff) | |
parent | ea1186db19e673b44084b43b6a70bbdb07480aa9 (diff) | |
download | packages_apps_settings-8b399cc71c960db05aa804c7e982709a1af5502d.zip packages_apps_settings-8b399cc71c960db05aa804c7e982709a1af5502d.tar.gz packages_apps_settings-8b399cc71c960db05aa804c7e982709a1af5502d.tar.bz2 |
Merge "Go into airplane mode in minimal boot mode." into jb-dev
-rw-r--r-- | src/com/android/settings/CryptKeeper.java | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/com/android/settings/CryptKeeper.java b/src/com/android/settings/CryptKeeper.java index 2739d91..928b45b 100644 --- a/src/com/android/settings/CryptKeeper.java +++ b/src/com/android/settings/CryptKeeper.java @@ -49,6 +49,7 @@ import android.widget.ProgressBar; import android.widget.TextView; import com.android.internal.telephony.ITelephony; +import com.android.internal.telephony.Phone; import java.util.List; @@ -296,6 +297,7 @@ public class CryptKeeper extends Activity implements TextView.OnEditorActionList | StatusBarManager.DISABLE_HOME | StatusBarManager.DISABLE_RECENT); + setAirplaneModeIfNecessary(); mAudioManager = (AudioManager) getSystemService(Context.AUDIO_SERVICE); // Check for (and recover) retained instance data final Object lastInstance = getLastNonConfigurationInstance(); @@ -607,6 +609,32 @@ public class CryptKeeper extends Activity implements TextView.OnEditorActionList } /** + * Set airplane mode on the device if it isn't an LTE device. + * Full story: In minimal boot mode, we cannot save any state. In particular, we cannot save + * any incoming SMS's. So SMSs that are received here will be silently dropped to the floor. + * That is bad. Also, we cannot receive any telephone calls in this state. So to avoid + * both these problems, we turn the radio off. However, on certain networks turning on and + * off the radio takes a long time. In such cases, we are better off leaving the radio + * running so the latency of an E911 call is short. + * The behavior after this is: + * 1. Emergency dialing: the emergency dialer has logic to force the device out of + * airplane mode and restart the radio. + * 2. Full boot: we read the persistent settings from the previous boot and restore the + * radio to whatever it was before it restarted. This also happens when rebooting a + * phone that has no encryption. + */ + private final void setAirplaneModeIfNecessary() { + final boolean isLteDevice = + TelephonyManager.getDefault().getLteOnCdmaMode() == Phone.LTE_ON_CDMA_TRUE; + if (!isLteDevice) { + Log.d(TAG, "Going into airplane mode."); + final Intent intent = new Intent(Intent.ACTION_AIRPLANE_MODE_CHANGED); + intent.putExtra("state", true); + sendBroadcast(intent); + } + } + + /** * Code to update the state of, and handle clicks from, the "Emergency call" button. * * This code is mostly duplicated from the corresponding code in |