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

Commit f6bd36df authored by jackqdyulei's avatar jackqdyulei
Browse files

Remove useless broadcast registeration

In constructor the mProfileIntentFilter is empty, we don't need to
register at that time.

LocalBluetootohProfileManager will tell EventManger to register
after all the profiles are finalized.

Bug: 111803044
Test: robo still pass
Change-Id: I0ac485eb80c297bc230056c1f40c19a14b7634b2
parent 6c567057
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -106,7 +106,6 @@ public class BluetoothEventManager {
                new AudioModeChangedHandler());

        mContext.registerReceiver(mBroadcastReceiver, mAdapterIntentFilter, null, mReceiverHandler);
        mContext.registerReceiver(mProfileBroadcastReceiver, mProfileIntentFilter, null, mReceiverHandler);
    }

    public void setReceiverHandler(android.os.Handler handler) {
+1 −0
Original line number Diff line number Diff line
@@ -241,6 +241,7 @@ public class LocalBluetoothProfileManagerTest {
        mShadowBluetoothAdapter.setSupportedProfiles(null);
        mProfileManager = new LocalBluetoothProfileManager(mContext, mLocalBluetoothAdapter,
                mDeviceManager, mEventManager);
        mEventManager.registerProfileIntentReceiver();
        // Refer to BluetoothControllerImpl, it will call setReceiverHandler after
        // LocalBluetoothProfileManager created.
        mEventManager.setReceiverHandler(null);