Skip to content

Commit

Permalink
Don't start SIP service before decrypted
Browse files Browse the repository at this point in the history
 * WiFi service is not considered as a core service so it won't start in
   min framework, but SipService accesses to WiFi service's API. This
   would lead to a fatal exception and trigger RescueParty.
 * We don't really need SipService during such early stage, so simply
   disable it to avoid invoking WifiManager.

Change-Id: Ie471523a50f83519187c3be02b556aee4b679b4d
  • Loading branch information
moetayuko authored and Darkstar085 committed Oct 10, 2019
1 parent 9a5d08f commit 02f5662
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/com/android/phone/PhoneGlobals.java
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,8 @@ public void handleMessage(Message msg) {
// This is the same procedure that is triggered in the SipIncomingCallReceiver
// upon BOOT_COMPLETED.
UserManager userManager = UserManager.get(sMe);
if (userManager != null && userManager.isUserUnlocked()) {
if (userManager != null && userManager.isUserUnlocked()
&& !isDataEncrypted()) {
SipUtil.startSipService();
}
break;
Expand Down Expand Up @@ -584,6 +585,11 @@ private void maybeTurnCellOn(Context context, boolean isAirplaneNewlyOn) {
}
}

private static boolean isDataEncrypted() {
String voldState = SystemProperties.get("vold.decrypt");
return "1".equals(voldState) || "trigger_restart_min_framework".equals(voldState);
}

/**
* Receiver for misc intent broadcasts the Phone app cares about.
*/
Expand Down Expand Up @@ -669,7 +675,7 @@ public void onReceive(Context context, Intent intent) {
String action = intent.getAction();

SipAccountRegistry sipAccountRegistry = SipAccountRegistry.getInstance();
if (action.equals(Intent.ACTION_BOOT_COMPLETED)) {
if (action.equals(Intent.ACTION_BOOT_COMPLETED) && !isDataEncrypted()) {
SipUtil.startSipService();
} else if (action.equals(SipManager.ACTION_SIP_SERVICE_UP)
|| action.equals(SipManager.ACTION_SIP_CALL_OPTION_CHANGED)) {
Expand Down

0 comments on commit 02f5662

Please sign in to comment.