Merge "Verify BluetoothDevice is not null before calling BluetoothHearingAid System APIs" into rvc-dev am: 32ec718cfa am: f07ee55a4a

Change-Id: I789d4f511b06ac399d252cabf268f11922f1b407
This commit is contained in:
TreeHugger Robot
2020-03-25 13:53:03 +00:00
committed by Automerger Merge Worker

View File

@@ -171,7 +171,8 @@ public class HandsFreeProfileOutputPreferenceController extends AudioSwitchPrefe
if (hapProfile != null && hfpProfile != null && device == null) {
hfpProfile.setActiveDevice(null);
hapProfile.setActiveDevice(null);
} else if (hapProfile != null && hapProfile.getHiSyncId(device) != HI_SYNC_ID_INVALID) {
} else if (hapProfile != null && device != null
&& hapProfile.getHiSyncId(device) != HI_SYNC_ID_INVALID) {
hapProfile.setActiveDevice(device);
} else if (hfpProfile != null) {
hfpProfile.setActiveDevice(device);