Merge "Merge "BluetoothClass: Use mask to get MajorDeviceClass" am: a9f7570de6 am: 9fa0668d29 am: e1271704a9"

This commit is contained in:
Automerger Merge Worker
2020-12-03 21:25:15 +00:00
committed by Android (Google) Code Review

View File

@@ -426,13 +426,13 @@ public final class BluetoothClass implements Parcelable {
return false;
}
} else if (profile == PROFILE_HID) {
return (getDeviceClass() & Device.Major.PERIPHERAL) == Device.Major.PERIPHERAL;
return getMajorDeviceClass() == Device.Major.PERIPHERAL;
} else if (profile == PROFILE_PANU || profile == PROFILE_NAP) {
// No good way to distinguish between the two, based on class bits.
if (hasService(Service.NETWORKING)) {
return true;
}
return (getDeviceClass() & Device.Major.NETWORKING) == Device.Major.NETWORKING;
return getMajorDeviceClass() == Device.Major.NETWORKING;
} else {
return false;
}