Radio is not turned on after turn off airplane mode in safe mode
In safe mode, airplane mode will be turned on. However, Phone process
is not started at that time. Therefore, PhoneGlobals can't handle
ACTION_AIRPLANE_MODE_CHANGED broadcast and can't update
Settings.Global.CELL_ON to CELL_OFF_DUE_TO_AIRPLANE_MODE_FLAG.
As a result, when turn off the airplane mode, telephony will not set
radio on because Settings.Global.CELL_ON status incorrect.
To resolve this issue, initialize cell status using current airplane
mode setting when phone process starts.
Test: Manual - Verify that the network is registered after airplane
mode is turned off in safe mode.
Bug: 142433367
Change-Id: Ia30a15a44608347a2492e079aeed5b5790edf307
diff --git a/src/com/android/phone/PhoneGlobals.java b/src/com/android/phone/PhoneGlobals.java
index b9c6728..1eb5f50 100644
--- a/src/com/android/phone/PhoneGlobals.java
+++ b/src/com/android/phone/PhoneGlobals.java
@@ -369,6 +369,10 @@
// register for MMI/USSD
mCM.registerForMmiComplete(mHandler, MMI_COMPLETE, null);
+ // Initialize cell status using current airplane mode.
+ handleAirplaneModeChange(this, Settings.Global.getInt(getContentResolver(),
+ Settings.Global.AIRPLANE_MODE_ON, AIRPLANE_OFF));
+
// Register for misc other intent broadcasts.
IntentFilter intentFilter =
new IntentFilter(Intent.ACTION_AIRPLANE_MODE_CHANGED);