Loading android/app/src/com/android/bluetooth/btservice/PhonePolicy.java +9 −2 Original line number Diff line number Diff line Loading @@ -281,16 +281,23 @@ public class PhonePolicy implements AdapterService.BluetoothStateCallback { return isLeAudioOnlyGroup(device); } private static final String SYSPROP_HAP_ENABLED = "bluetooth.profile.hap.enabled_by_default"; // return true if device support Hearing Access Service and it has not been manually disabled private boolean shouldEnableHapByDefault(BluetoothDevice device, ParcelUuid[] uuids) { if (!Flags.enableHapByDefault()) { Log.i(TAG, "shouldDefaultToHap: Flag enableHapByDefault is disabled"); Log.i(TAG, "shouldEnableHapByDefault: Flag is disabled"); return false; } HapClientService hap = mFactory.getHapClientService(); if (hap == null) { Log.e(TAG, "shouldDefaultToHap: HapClient is null"); Log.e(TAG, "shouldEnableHapByDefault: No HapClientService"); return false; } if (!SystemProperties.getBoolean(SYSPROP_HAP_ENABLED, true)) { Log.i(TAG, "shouldEnableHapByDefault: SystemProperty is overridden to false"); return false; } Loading Loading
android/app/src/com/android/bluetooth/btservice/PhonePolicy.java +9 −2 Original line number Diff line number Diff line Loading @@ -281,16 +281,23 @@ public class PhonePolicy implements AdapterService.BluetoothStateCallback { return isLeAudioOnlyGroup(device); } private static final String SYSPROP_HAP_ENABLED = "bluetooth.profile.hap.enabled_by_default"; // return true if device support Hearing Access Service and it has not been manually disabled private boolean shouldEnableHapByDefault(BluetoothDevice device, ParcelUuid[] uuids) { if (!Flags.enableHapByDefault()) { Log.i(TAG, "shouldDefaultToHap: Flag enableHapByDefault is disabled"); Log.i(TAG, "shouldEnableHapByDefault: Flag is disabled"); return false; } HapClientService hap = mFactory.getHapClientService(); if (hap == null) { Log.e(TAG, "shouldDefaultToHap: HapClient is null"); Log.e(TAG, "shouldEnableHapByDefault: No HapClientService"); return false; } if (!SystemProperties.getBoolean(SYSPROP_HAP_ENABLED, true)) { Log.i(TAG, "shouldEnableHapByDefault: SystemProperty is overridden to false"); return false; } Loading