Loading android/app/src/com/android/bluetooth/bass_client/BassClientService.java +15 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,9 @@ package com.android.bluetooth.bass_client; import static android.Manifest.permission.BLUETOOTH_CONNECT; import static com.android.bluetooth.Utils.enforceBluetoothPrivilegedPermission; import android.bluetooth.BluetoothAdapter; import android.bluetooth.BluetoothDevice; import android.bluetooth.BluetoothLeBroadcastMetadata; Loading Loading @@ -1119,6 +1122,7 @@ public class BassClientService extends ProfileService { Log.e(TAG, "Service is null"); return false; } mService.enforceCallingOrSelfPermission(BLUETOOTH_CONNECT, "Need BLUETOOTH_CONNECT permission"); return service.setConnectionPolicy(device, connectionPolicy); } catch (RuntimeException e) { Log.e(TAG, "Exception happened", e); Loading @@ -1134,6 +1138,7 @@ public class BassClientService extends ProfileService { Log.e(TAG, "Service is null"); return BluetoothProfile.CONNECTION_POLICY_FORBIDDEN; } mService.enforceCallingOrSelfPermission(BLUETOOTH_CONNECT, "Need BLUETOOTH_CONNECT permission"); return service.getConnectionPolicy(device); } catch (RuntimeException e) { Log.e(TAG, "Exception happened", e); Loading @@ -1149,6 +1154,7 @@ public class BassClientService extends ProfileService { Log.e(TAG, "Service is null"); return; } enforceBluetoothPrivilegedPermission(service); service.registerCallback(cb); } catch (RuntimeException e) { Log.e(TAG, "Exception happened", e); Loading @@ -1163,6 +1169,7 @@ public class BassClientService extends ProfileService { Log.e(TAG, "Service is null"); return; } enforceBluetoothPrivilegedPermission(service); service.unregisterCallback(cb); } catch (RuntimeException e) { Log.e(TAG, "Exception happened", e); Loading @@ -1177,6 +1184,7 @@ public class BassClientService extends ProfileService { Log.e(TAG, "Service is null"); return; } enforceBluetoothPrivilegedPermission(service); service.startSearchingForSources(filters); } catch (RuntimeException e) { Log.e(TAG, "Exception happened", e); Loading @@ -1191,6 +1199,7 @@ public class BassClientService extends ProfileService { Log.e(TAG, "Service is null"); return; } enforceBluetoothPrivilegedPermission(service); service.stopSearchingForSources(); } catch (RuntimeException e) { Log.e(TAG, "Exception happened", e); Loading @@ -1205,6 +1214,7 @@ public class BassClientService extends ProfileService { Log.e(TAG, "Service is null"); return false; } enforceBluetoothPrivilegedPermission(service); return service.isSearchInProgress(); } catch (RuntimeException e) { Log.e(TAG, "Exception happened", e); Loading @@ -1222,6 +1232,7 @@ public class BassClientService extends ProfileService { Log.e(TAG, "Service is null"); return; } enforceBluetoothPrivilegedPermission(service); service.addSource(sink, sourceMetadata, isGroupOp); } catch (RuntimeException e) { Log.e(TAG, "Exception happened", e); Loading @@ -1237,6 +1248,7 @@ public class BassClientService extends ProfileService { Log.e(TAG, "Service is null"); return; } enforceBluetoothPrivilegedPermission(service); service.modifySource(sink, sourceId, updatedMetadata); } catch (RuntimeException e) { Log.e(TAG, "Exception happened", e); Loading @@ -1251,6 +1263,7 @@ public class BassClientService extends ProfileService { Log.e(TAG, "Service is null"); return; } enforceBluetoothPrivilegedPermission(service); service.removeSource(sink, sourceId); } catch (RuntimeException e) { Log.e(TAG, "Exception happened", e); Loading @@ -1265,6 +1278,7 @@ public class BassClientService extends ProfileService { Log.e(TAG, "Service is null"); return Collections.emptyList(); } enforceBluetoothPrivilegedPermission(service); return service.getAllSources(sink); } catch (RuntimeException e) { Log.e(TAG, "Exception happened", e); Loading @@ -1280,6 +1294,7 @@ public class BassClientService extends ProfileService { Log.e(TAG, "Service is null"); return 0; } enforceBluetoothPrivilegedPermission(service); return service.getMaximumSourceCapacity(sink); } catch (RuntimeException e) { Log.e(TAG, "Exception happened", e); Loading Loading
android/app/src/com/android/bluetooth/bass_client/BassClientService.java +15 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,9 @@ package com.android.bluetooth.bass_client; import static android.Manifest.permission.BLUETOOTH_CONNECT; import static com.android.bluetooth.Utils.enforceBluetoothPrivilegedPermission; import android.bluetooth.BluetoothAdapter; import android.bluetooth.BluetoothDevice; import android.bluetooth.BluetoothLeBroadcastMetadata; Loading Loading @@ -1119,6 +1122,7 @@ public class BassClientService extends ProfileService { Log.e(TAG, "Service is null"); return false; } mService.enforceCallingOrSelfPermission(BLUETOOTH_CONNECT, "Need BLUETOOTH_CONNECT permission"); return service.setConnectionPolicy(device, connectionPolicy); } catch (RuntimeException e) { Log.e(TAG, "Exception happened", e); Loading @@ -1134,6 +1138,7 @@ public class BassClientService extends ProfileService { Log.e(TAG, "Service is null"); return BluetoothProfile.CONNECTION_POLICY_FORBIDDEN; } mService.enforceCallingOrSelfPermission(BLUETOOTH_CONNECT, "Need BLUETOOTH_CONNECT permission"); return service.getConnectionPolicy(device); } catch (RuntimeException e) { Log.e(TAG, "Exception happened", e); Loading @@ -1149,6 +1154,7 @@ public class BassClientService extends ProfileService { Log.e(TAG, "Service is null"); return; } enforceBluetoothPrivilegedPermission(service); service.registerCallback(cb); } catch (RuntimeException e) { Log.e(TAG, "Exception happened", e); Loading @@ -1163,6 +1169,7 @@ public class BassClientService extends ProfileService { Log.e(TAG, "Service is null"); return; } enforceBluetoothPrivilegedPermission(service); service.unregisterCallback(cb); } catch (RuntimeException e) { Log.e(TAG, "Exception happened", e); Loading @@ -1177,6 +1184,7 @@ public class BassClientService extends ProfileService { Log.e(TAG, "Service is null"); return; } enforceBluetoothPrivilegedPermission(service); service.startSearchingForSources(filters); } catch (RuntimeException e) { Log.e(TAG, "Exception happened", e); Loading @@ -1191,6 +1199,7 @@ public class BassClientService extends ProfileService { Log.e(TAG, "Service is null"); return; } enforceBluetoothPrivilegedPermission(service); service.stopSearchingForSources(); } catch (RuntimeException e) { Log.e(TAG, "Exception happened", e); Loading @@ -1205,6 +1214,7 @@ public class BassClientService extends ProfileService { Log.e(TAG, "Service is null"); return false; } enforceBluetoothPrivilegedPermission(service); return service.isSearchInProgress(); } catch (RuntimeException e) { Log.e(TAG, "Exception happened", e); Loading @@ -1222,6 +1232,7 @@ public class BassClientService extends ProfileService { Log.e(TAG, "Service is null"); return; } enforceBluetoothPrivilegedPermission(service); service.addSource(sink, sourceMetadata, isGroupOp); } catch (RuntimeException e) { Log.e(TAG, "Exception happened", e); Loading @@ -1237,6 +1248,7 @@ public class BassClientService extends ProfileService { Log.e(TAG, "Service is null"); return; } enforceBluetoothPrivilegedPermission(service); service.modifySource(sink, sourceId, updatedMetadata); } catch (RuntimeException e) { Log.e(TAG, "Exception happened", e); Loading @@ -1251,6 +1263,7 @@ public class BassClientService extends ProfileService { Log.e(TAG, "Service is null"); return; } enforceBluetoothPrivilegedPermission(service); service.removeSource(sink, sourceId); } catch (RuntimeException e) { Log.e(TAG, "Exception happened", e); Loading @@ -1265,6 +1278,7 @@ public class BassClientService extends ProfileService { Log.e(TAG, "Service is null"); return Collections.emptyList(); } enforceBluetoothPrivilegedPermission(service); return service.getAllSources(sink); } catch (RuntimeException e) { Log.e(TAG, "Exception happened", e); Loading @@ -1280,6 +1294,7 @@ public class BassClientService extends ProfileService { Log.e(TAG, "Service is null"); return 0; } enforceBluetoothPrivilegedPermission(service); return service.getMaximumSourceCapacity(sink); } catch (RuntimeException e) { Log.e(TAG, "Exception happened", e); Loading