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

Commit b81116aa authored by Grace Jia's avatar Grace Jia
Browse files

Change ImsPhoneCallTracker to listen to the correct broadcast when

default dialer changed.

ImsPhoneCallTracker used to listen to protected broadcast ACTION_CHANGE_DEFAULT_DIALER
instead of ACTION_DEFAULT_DIALER_CHANGED. Fixed this to make
ImsPhoneCallTracker know the change of default dialer and prevent
untrusted app from setting mDefaultDialerUid.

Bug: 162741489
Test: Manually set default dialer to another app and check if
mDefaultDialerUid changed correspondingly by dumpsys.

Change-Id: I2335eb77b337454082f8c9db195fd8ecc4b2c72c
parent 203e00cd
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -335,7 +335,7 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall {
                    log("onReceive : Updating mAllowEmergencyVideoCalls = " +
                            mAllowEmergencyVideoCalls);
                }
            } else if (TelecomManager.ACTION_CHANGE_DEFAULT_DIALER.equals(intent.getAction())) {
            } else if (TelecomManager.ACTION_DEFAULT_DIALER_CHANGED.equals(intent.getAction())) {
                mDefaultDialerUid.set(getPackageUid(context, intent.getStringExtra(
                        TelecomManager.EXTRA_CHANGE_DEFAULT_DIALER_PACKAGE_NAME)));
            }
@@ -879,7 +879,7 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall {

        IntentFilter intentfilter = new IntentFilter();
        intentfilter.addAction(CarrierConfigManager.ACTION_CARRIER_CONFIG_CHANGED);
        intentfilter.addAction(TelecomManager.ACTION_CHANGE_DEFAULT_DIALER);
        intentfilter.addAction(TelecomManager.ACTION_DEFAULT_DIALER_CHANGED);
        mPhone.getContext().registerReceiver(mReceiver, intentfilter);
        cacheCarrierConfiguration(mPhone.getSubId());