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

Commit 59ab8e03 authored by Tyler Gunn's avatar Tyler Gunn
Browse files

Add intent filter priority for critical intents Telecom relies on.

We saw an issue where the Bluetooth ACTION_ACTIVE_DEVICE_CHANGED intent
was not received by Telecom in a timely manner.  As a consequence Telecom
could not route audio to the BT device.

Adding in intent filter priority for all intents Telecom registers to
ensure that it can receive timely notification.

Test: Manual regression testing of calling with bluetooth.
Bug: 284410158
Change-Id: I46a259c6cb8c8c1a3f25460d6cd9075210c3d8a6
parent 218b3a80
Loading
Loading
Loading
Loading
+13 −6
Original line number Diff line number Diff line
@@ -1629,12 +1629,19 @@ public class CallAudioRouteStateMachine extends StateMachine {
        mAvailableRoutes = mDeviceSupportedRoutes & getCurrentCallSupportedRoutes();
        mIsMuted = initState.isMuted();
        mWasOnSpeaker = false;
        mContext.registerReceiver(mMuteChangeReceiver,
                new IntentFilter(AudioManager.ACTION_MICROPHONE_MUTE_CHANGED));
        mContext.registerReceiver(mMuteChangeReceiver,
                new IntentFilter(AudioManager.STREAM_MUTE_CHANGED_ACTION));
        mContext.registerReceiver(mSpeakerPhoneChangeReceiver,
                new IntentFilter(AudioManager.ACTION_SPEAKERPHONE_STATE_CHANGED));
        IntentFilter micMuteChangedFilter = new IntentFilter(
                AudioManager.ACTION_MICROPHONE_MUTE_CHANGED);
        micMuteChangedFilter.setPriority(IntentFilter.SYSTEM_HIGH_PRIORITY);
        mContext.registerReceiver(mMuteChangeReceiver, micMuteChangedFilter);

        IntentFilter muteChangedFilter = new IntentFilter(AudioManager.STREAM_MUTE_CHANGED_ACTION);
        muteChangedFilter.setPriority(IntentFilter.SYSTEM_HIGH_PRIORITY);
        mContext.registerReceiver(mMuteChangeReceiver, muteChangedFilter);

        IntentFilter speakerChangedFilter = new IntentFilter(
                AudioManager.ACTION_SPEAKERPHONE_STATE_CHANGED);
        speakerChangedFilter.setPriority(IntentFilter.SYSTEM_HIGH_PRIORITY);
        mContext.registerReceiver(mSpeakerPhoneChangeReceiver, speakerChangedFilter);

        mStatusBarNotifier.notifyMute(initState.isMuted());
        // We used to call mStatusBarNotifier.notifySpeakerphone, but that makes no sense as there
+1 −0
Original line number Diff line number Diff line
@@ -689,6 +689,7 @@ public class CallsManager extends Call.ListenerBase
        // Register BroadcastReceiver to handle enhanced call blocking feature related event.
        IntentFilter intentFilter = new IntentFilter(
                CarrierConfigManager.ACTION_CARRIER_CONFIG_CHANGED);
        intentFilter.setPriority(IntentFilter.SYSTEM_HIGH_PRIORITY);
        intentFilter.addAction(SystemContract.ACTION_BLOCK_SUPPRESSION_STATE_CHANGED);
        context.registerReceiver(mReceiver, intentFilter, Context.RECEIVER_EXPORTED);
        mGraphHandlerThreads = new LinkedList<>();
+1 −0
Original line number Diff line number Diff line
@@ -160,6 +160,7 @@ public class DefaultDialerCache {
        packageIntentFilter.addAction(Intent.ACTION_PACKAGE_REMOVED);
        packageIntentFilter.addAction(Intent.ACTION_PACKAGE_ADDED);
        packageIntentFilter.addDataScheme("package");
        packageIntentFilter.setPriority(IntentFilter.SYSTEM_HIGH_PRIORITY);
        context.registerReceiverAsUser(mReceiver, UserHandle.ALL, packageIntentFilter, null, null);

        IntentFilter bootIntentFilter = new IntentFilter(Intent.ACTION_BOOT_COMPLETED);
+1 −0
Original line number Diff line number Diff line
@@ -76,6 +76,7 @@ public class DockManager {

        // Register for misc other intent broadcasts.
        IntentFilter intentFilter = new IntentFilter(Intent.ACTION_DOCK_EVENT);
        intentFilter.setPriority(IntentFilter.SYSTEM_HIGH_PRIORITY);
        context.registerReceiver(mReceiver, intentFilter);
    }

+3 −1
Original line number Diff line number Diff line
@@ -1119,7 +1119,9 @@ public class InCallController extends CallsManagerListenerBase implements
        mSystemStateHelper.addListener(mSystemStateListener);
        mClockProxy = clockProxy;
        restrictPhoneCallOps();
        mContext.registerReceiver(mUserAddedReceiver, new IntentFilter(Intent.ACTION_USER_ADDED));
        IntentFilter userAddedFilter = new IntentFilter(Intent.ACTION_USER_ADDED);
        userAddedFilter.setPriority(IntentFilter.SYSTEM_HIGH_PRIORITY);
        mContext.registerReceiver(mUserAddedReceiver, userAddedFilter);
    }

    private void restrictPhoneCallOps() {
Loading