Fix broken tests on LocalBluetoothProfileManagerTest

Bug: 215308761
Test: make -j64 RunSettingsLibRoboTests
Change-Id: Id2146dd4461ea848fc59f90c8caafcf6104647f8
This commit is contained in:
Hugh Chen
2022-01-19 10:29:17 +00:00
parent 9e02fbf652
commit 726cc14c01
2 changed files with 7 additions and 0 deletions

View File

@@ -175,6 +175,12 @@ public class BluetoothEventManager {
null, mReceiverHandler);
}
@VisibleForTesting
void registerProfileIntentReceiverForTest() {
mContext.registerReceiverAsUser(mProfileBroadcastReceiver, mUserHandle,
mProfileIntentFilter, null, mReceiverHandler);
}
@VisibleForTesting
void addProfileHandler(String action, Handler handler) {
mHandlerMap.put(action, handler);

View File

@@ -84,6 +84,7 @@ public class LocalBluetoothProfileManagerTest {
when(mCachedBluetoothDevice.getDevice()).thenReturn(mDevice);
mProfileManager = new LocalBluetoothProfileManager(mContext, mLocalBluetoothAdapter,
mDeviceManager, mEventManager);
mEventManager.registerProfileIntentReceiverForTest();
}
/**