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

Commit d08c9b2b authored by chen xu's avatar chen xu
Browse files

using the correct intent extra for subId

Some telephony subscription related intent uses hidden extra
PhoneConstants.SUBSCRIPTION_KEY. We should sent the public extra
SubscriptionManager.EXTRA_SUBSCRIPTION_INDEX instead.

Bug: 116754807
Test: telephony unit test
Change-Id: I9a9f1fd26bc4d9f207157d48869de57c2c1b6fe6
parent c04d548e
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -30,6 +30,7 @@ import android.os.Message;
import android.os.PersistableBundle;
import android.telephony.CarrierConfigManager;
import android.telephony.Rlog;
import android.telephony.SubscriptionManager;
import android.text.TextUtils;
import android.util.LocalLog;
import android.util.Log;
@@ -313,6 +314,7 @@ public class CarrierSignalAgent extends Handler {
                return;
            }

            signal.putExtra(SubscriptionManager.EXTRA_SUBSCRIPTION_INDEX, mPhone.getSubId());
            signal.putExtra(PhoneConstants.SUBSCRIPTION_KEY, mPhone.getSubId());
            signal.addFlags(Intent.FLAG_RECEIVER_FOREGROUND);
            if (!wakeup) signal.setFlags(Intent.FLAG_EXCLUDE_STOPPED_PACKAGES);
+2 −0
Original line number Diff line number Diff line
@@ -1683,6 +1683,7 @@ public class SubscriptionController extends ISub.Stub {
        intent.addFlags(Intent.FLAG_RECEIVER_REPLACE_PENDING
                | Intent.FLAG_RECEIVER_INCLUDE_BACKGROUND);
        intent.putExtra(PhoneConstants.SUBSCRIPTION_KEY, subId);
        intent.putExtra(SubscriptionManager.EXTRA_SUBSCRIPTION_INDEX, subId);
        mContext.sendStickyBroadcastAsUser(intent, UserHandle.ALL);
    }

@@ -1767,6 +1768,7 @@ public class SubscriptionController extends ISub.Stub {
        intent.addFlags(Intent.FLAG_RECEIVER_REPLACE_PENDING
                | Intent.FLAG_RECEIVER_INCLUDE_BACKGROUND);
        intent.putExtra(PhoneConstants.SUBSCRIPTION_KEY, subId);
        intent.putExtra(SubscriptionManager.EXTRA_SUBSCRIPTION_INDEX, subId);
        mContext.sendStickyBroadcastAsUser(intent, UserHandle.ALL);
    }