Merge "Fix incorrect API invoke for BT profiles"

This commit is contained in:
Lei Yu
2018-09-20 00:13:55 +00:00
committed by Android (Google) Code Review
4 changed files with 10 additions and 10 deletions

View File

@@ -93,12 +93,9 @@ public class HandsFreeProfileOutputPreferenceController extends
if (hapProfile != null && hfpProfile != null && device == null) {
hfpProfile.setActiveDevice(null);
hapProfile.setActiveDevice(null);
return;
}
if (hapProfile != null && hapProfile.getHiSyncId(device) != HI_SYNC_ID_INVALID) {
} else if (hapProfile != null && hapProfile.getHiSyncId(device) != HI_SYNC_ID_INVALID) {
hapProfile.setActiveDevice(device);
}
if (hfpProfile != null) {
} else if (hfpProfile != null) {
hfpProfile.setActiveDevice(device);
}
}

View File

@@ -106,12 +106,9 @@ public class MediaOutputPreferenceController extends AudioSwitchPreferenceContro
if (hapProfile != null && a2dpProfile != null && device == null) {
hapProfile.setActiveDevice(null);
a2dpProfile.setActiveDevice(null);
return;
}
if (hapProfile != null && hapProfile.getHiSyncId(device) != HI_SYNC_ID_INVALID) {
} else if (hapProfile != null && hapProfile.getHiSyncId(device) != HI_SYNC_ID_INVALID) {
hapProfile.setActiveDevice(device);
}
if (a2dpProfile != null) {
} else if (a2dpProfile != null) {
a2dpProfile.setActiveDevice(device);
}
}