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

Commit 71f6cb13 authored by Wink Saville's avatar Wink Saville
Browse files

TelephonyRegistry remove 4 uses of FLAG_RECEIVER_REPLACE_PENDING.

The use of FLAG_RECEIVER_REPLACE_PENDING is an optimization to reduce
redundant messages. For some calls this is fine, such as
broadcastSignalStrengthChanged. For others it can cause problems, such
as broadcastDataConnectionStateChanged where the MobileDataStateTracker
will not be able to properly track the state if messages are dropped.
This changes removes the optimization from all methods in
TelephonyRegistry except broadcastSignalStrengthChanged.

bug: 4427303
Change-Id: Ia9c0dd0ce66b8b3dcda770f5ab2c63cf08f3ebfc
parent ed9321ab
Loading
Loading
Loading
Loading
+0 −4
Original line number Diff line number Diff line
@@ -546,7 +546,6 @@ class TelephonyRegistry extends ITelephonyRegistry.Stub {
        }

        Intent intent = new Intent(TelephonyIntents.ACTION_SERVICE_STATE_CHANGED);
        intent.addFlags(Intent.FLAG_RECEIVER_REPLACE_PENDING);
        Bundle data = new Bundle();
        state.fillInNotifierBundle(data);
        intent.putExtras(data);
@@ -586,7 +585,6 @@ class TelephonyRegistry extends ITelephonyRegistry.Stub {
        }

        Intent intent = new Intent(TelephonyManager.ACTION_PHONE_STATE_CHANGED);
        intent.addFlags(Intent.FLAG_RECEIVER_REPLACE_PENDING);
        intent.putExtra(Phone.STATE_KEY, DefaultPhoneNotifier.convertCallState(state).toString());
        if (!TextUtils.isEmpty(incomingNumber)) {
            intent.putExtra(TelephonyManager.EXTRA_INCOMING_NUMBER, incomingNumber);
@@ -602,7 +600,6 @@ class TelephonyRegistry extends ITelephonyRegistry.Stub {
        // status bar takes care of that after taking into account all of the
        // required info.
        Intent intent = new Intent(TelephonyIntents.ACTION_ANY_DATA_CONNECTION_STATE_CHANGED);
        intent.addFlags(Intent.FLAG_RECEIVER_REPLACE_PENDING);
        intent.putExtra(Phone.STATE_KEY, DefaultPhoneNotifier.convertDataState(state).toString());
        if (!isDataConnectivityPossible) {
            intent.putExtra(Phone.NETWORK_UNAVAILABLE_KEY, true);
@@ -627,7 +624,6 @@ class TelephonyRegistry extends ITelephonyRegistry.Stub {

    private void broadcastDataConnectionFailed(String reason, String apnType) {
        Intent intent = new Intent(TelephonyIntents.ACTION_DATA_CONNECTION_FAILED);
        intent.addFlags(Intent.FLAG_RECEIVER_REPLACE_PENDING);
        intent.putExtra(Phone.FAILURE_REASON_KEY, reason);
        intent.putExtra(Phone.DATA_APN_TYPE_KEY, apnType);
        mContext.sendStickyBroadcast(intent);