Merge "Fix broken tests on LocalBluetoothProfileManagerTest"

This commit is contained in:
TreeHugger Robot
2022-01-20 04:55:25 +00:00
committed by Android (Google) Code Review
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();
}
/**