Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ef2e171b authored by hoffc's avatar hoffc
Browse files

Settings: Fix force close for telephony callback exceeding limitation

When sub info changed, new telephony callback will be registered but old telephony callback not un-registered. Finally result in force close for registered telephony callback count exceeding its allowed.

No need to re-registered the telephony callback for one sub if registered.

Bug: 328716180

Change-Id: Ia0c3b311b5b5cc77f061d81ec21250abde2fa9f4
parent 2e090585
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -245,7 +245,11 @@ public class MobileNetworkRepository extends SubscriptionManager.OnSubscriptions
    }

    private void createTelephonyManagerBySubId(int subId) {
        if (subId == SubscriptionManager.INVALID_SUBSCRIPTION_ID) {
        if (subId == SubscriptionManager.INVALID_SUBSCRIPTION_ID
                || mTelephonyCallbackMap.containsKey(subId)) {
            if (DEBUG) {
                Log.d(TAG, "createTelephonyManagerBySubId: directly return for subId = " + subId);
            }
            return;
        }
        PhoneCallStateTelephonyCallback