Loading android/app/src/com/android/bluetooth/bass_client/BassClientService.java +19 −18 Original line number Diff line number Diff line Loading @@ -64,6 +64,7 @@ public class BassClientService extends ProfileService { private static BassClientService sService; private final Map<BluetoothDevice, BassClientStateMachine> mStateMachines = new HashMap<>(); private final Object mSearchScanCallbackLock = new Object(); private HandlerThread mStateMachinesThread; private HandlerThread mCallbackHandlerThread; Loading Loading @@ -619,7 +620,7 @@ public class BassClientService extends ProfileService { Log.e(TAG, "startLeScan: cannot get BluetoothLeScanner"); return; } synchronized (mSearchScanCallback) { synchronized (mSearchScanCallbackLock) { if (mSearchScanCallback != null) { Log.e(TAG, "LE Scan has already started"); mCallbacks.notifySearchStartFailed(BluetoothStatusCodes.ERROR_UNKNOWN); Loading Loading @@ -685,7 +686,7 @@ public class BassClientService extends ProfileService { Log.e(TAG, "startLeScan: cannot get BluetoothLeScanner"); return; } synchronized (mSearchScanCallback) { synchronized (mSearchScanCallbackLock) { if (mSearchScanCallback == null) { Log.e(TAG, "Scan not started yet"); mCallbacks.notifySearchStopFailed(BluetoothStatusCodes.ERROR_UNKNOWN); Loading @@ -702,7 +703,7 @@ public class BassClientService extends ProfileService { * @return true if a search has been started by this application */ public boolean isSearchInProgress() { synchronized (mSearchScanCallback) { synchronized (mSearchScanCallbackLock) { return mSearchScanCallback != null; } } Loading Loading @@ -1047,7 +1048,7 @@ public class BassClientService extends ProfileService { } return service.getConnectionState(sink); } catch (RuntimeException e) { Log.e(TAG, "Stack:" + Log.getStackTraceString(new Throwable())); Log.e(TAG, "Exception happened", e); return BluetoothProfile.STATE_DISCONNECTED; } } Loading @@ -1062,7 +1063,7 @@ public class BassClientService extends ProfileService { } return service.getDevicesMatchingConnectionStates(states); } catch (RuntimeException e) { Log.e(TAG, "Stack:" + Log.getStackTraceString(new Throwable())); Log.e(TAG, "Exception happened", e); return Collections.emptyList(); } } Loading @@ -1077,7 +1078,7 @@ public class BassClientService extends ProfileService { } return service.getConnectedDevices(); } catch (RuntimeException e) { Log.e(TAG, "Stack:" + Log.getStackTraceString(new Throwable())); Log.e(TAG, "Exception happened", e); return Collections.emptyList(); } } Loading @@ -1092,7 +1093,7 @@ public class BassClientService extends ProfileService { } return service.setConnectionPolicy(device, connectionPolicy); } catch (RuntimeException e) { Log.e(TAG, "Stack:" + Log.getStackTraceString(new Throwable())); Log.e(TAG, "Exception happened", e); return false; } } Loading @@ -1107,7 +1108,7 @@ public class BassClientService extends ProfileService { } return service.getConnectionPolicy(device); } catch (RuntimeException e) { Log.e(TAG, "Stack:" + Log.getStackTraceString(new Throwable())); Log.e(TAG, "Exception happened", e); return BluetoothProfile.CONNECTION_POLICY_FORBIDDEN; } } Loading @@ -1122,7 +1123,7 @@ public class BassClientService extends ProfileService { } service.registerCallback(cb); } catch (RuntimeException e) { Log.e(TAG, "Stack:" + Log.getStackTraceString(new Throwable())); Log.e(TAG, "Exception happened", e); } } Loading @@ -1136,7 +1137,7 @@ public class BassClientService extends ProfileService { } service.unregisterCallback(cb); } catch (RuntimeException e) { Log.e(TAG, "Stack:" + Log.getStackTraceString(new Throwable())); Log.e(TAG, "Exception happened", e); } } Loading @@ -1150,7 +1151,7 @@ public class BassClientService extends ProfileService { } service.startSearchingForSources(filters); } catch (RuntimeException e) { Log.e(TAG, "Stack:" + Log.getStackTraceString(new Throwable())); Log.e(TAG, "Exception happened", e); } } Loading @@ -1164,7 +1165,7 @@ public class BassClientService extends ProfileService { } service.stopSearchingForSources(); } catch (RuntimeException e) { Log.e(TAG, "Stack:" + Log.getStackTraceString(new Throwable())); Log.e(TAG, "Exception happened", e); } } Loading @@ -1178,7 +1179,7 @@ public class BassClientService extends ProfileService { } return service.isSearchInProgress(); } catch (RuntimeException e) { Log.e(TAG, "Stack:" + Log.getStackTraceString(new Throwable())); Log.e(TAG, "Exception happened", e); return false; } } Loading @@ -1195,7 +1196,7 @@ public class BassClientService extends ProfileService { } service.addSource(sink, sourceMetadata, isGroupOp); } catch (RuntimeException e) { Log.e(TAG, "Stack:" + Log.getStackTraceString(new Throwable())); Log.e(TAG, "Exception happened", e); } } Loading @@ -1210,7 +1211,7 @@ public class BassClientService extends ProfileService { } service.modifySource(sink, sourceId, updatedMetadata); } catch (RuntimeException e) { Log.e(TAG, "Stack:" + Log.getStackTraceString(new Throwable())); Log.e(TAG, "Exception happened", e); } } Loading @@ -1224,7 +1225,7 @@ public class BassClientService extends ProfileService { } service.removeSource(sink, sourceId); } catch (RuntimeException e) { Log.e(TAG, "Stack:" + Log.getStackTraceString(new Throwable())); Log.e(TAG, "Exception happened", e); } } Loading @@ -1238,7 +1239,7 @@ public class BassClientService extends ProfileService { } return service.getAllSources(sink); } catch (RuntimeException e) { Log.e(TAG, "Stack:" + Log.getStackTraceString(new Throwable())); Log.e(TAG, "Exception happened", e); return Collections.emptyList(); } } Loading @@ -1253,7 +1254,7 @@ public class BassClientService extends ProfileService { } return service.getMaximumSourceCapacity(sink); } catch (RuntimeException e) { Log.e(TAG, "Stack:" + Log.getStackTraceString(new Throwable())); Log.e(TAG, "Exception happened", e); return 0; } } Loading Loading
android/app/src/com/android/bluetooth/bass_client/BassClientService.java +19 −18 Original line number Diff line number Diff line Loading @@ -64,6 +64,7 @@ public class BassClientService extends ProfileService { private static BassClientService sService; private final Map<BluetoothDevice, BassClientStateMachine> mStateMachines = new HashMap<>(); private final Object mSearchScanCallbackLock = new Object(); private HandlerThread mStateMachinesThread; private HandlerThread mCallbackHandlerThread; Loading Loading @@ -619,7 +620,7 @@ public class BassClientService extends ProfileService { Log.e(TAG, "startLeScan: cannot get BluetoothLeScanner"); return; } synchronized (mSearchScanCallback) { synchronized (mSearchScanCallbackLock) { if (mSearchScanCallback != null) { Log.e(TAG, "LE Scan has already started"); mCallbacks.notifySearchStartFailed(BluetoothStatusCodes.ERROR_UNKNOWN); Loading Loading @@ -685,7 +686,7 @@ public class BassClientService extends ProfileService { Log.e(TAG, "startLeScan: cannot get BluetoothLeScanner"); return; } synchronized (mSearchScanCallback) { synchronized (mSearchScanCallbackLock) { if (mSearchScanCallback == null) { Log.e(TAG, "Scan not started yet"); mCallbacks.notifySearchStopFailed(BluetoothStatusCodes.ERROR_UNKNOWN); Loading @@ -702,7 +703,7 @@ public class BassClientService extends ProfileService { * @return true if a search has been started by this application */ public boolean isSearchInProgress() { synchronized (mSearchScanCallback) { synchronized (mSearchScanCallbackLock) { return mSearchScanCallback != null; } } Loading Loading @@ -1047,7 +1048,7 @@ public class BassClientService extends ProfileService { } return service.getConnectionState(sink); } catch (RuntimeException e) { Log.e(TAG, "Stack:" + Log.getStackTraceString(new Throwable())); Log.e(TAG, "Exception happened", e); return BluetoothProfile.STATE_DISCONNECTED; } } Loading @@ -1062,7 +1063,7 @@ public class BassClientService extends ProfileService { } return service.getDevicesMatchingConnectionStates(states); } catch (RuntimeException e) { Log.e(TAG, "Stack:" + Log.getStackTraceString(new Throwable())); Log.e(TAG, "Exception happened", e); return Collections.emptyList(); } } Loading @@ -1077,7 +1078,7 @@ public class BassClientService extends ProfileService { } return service.getConnectedDevices(); } catch (RuntimeException e) { Log.e(TAG, "Stack:" + Log.getStackTraceString(new Throwable())); Log.e(TAG, "Exception happened", e); return Collections.emptyList(); } } Loading @@ -1092,7 +1093,7 @@ public class BassClientService extends ProfileService { } return service.setConnectionPolicy(device, connectionPolicy); } catch (RuntimeException e) { Log.e(TAG, "Stack:" + Log.getStackTraceString(new Throwable())); Log.e(TAG, "Exception happened", e); return false; } } Loading @@ -1107,7 +1108,7 @@ public class BassClientService extends ProfileService { } return service.getConnectionPolicy(device); } catch (RuntimeException e) { Log.e(TAG, "Stack:" + Log.getStackTraceString(new Throwable())); Log.e(TAG, "Exception happened", e); return BluetoothProfile.CONNECTION_POLICY_FORBIDDEN; } } Loading @@ -1122,7 +1123,7 @@ public class BassClientService extends ProfileService { } service.registerCallback(cb); } catch (RuntimeException e) { Log.e(TAG, "Stack:" + Log.getStackTraceString(new Throwable())); Log.e(TAG, "Exception happened", e); } } Loading @@ -1136,7 +1137,7 @@ public class BassClientService extends ProfileService { } service.unregisterCallback(cb); } catch (RuntimeException e) { Log.e(TAG, "Stack:" + Log.getStackTraceString(new Throwable())); Log.e(TAG, "Exception happened", e); } } Loading @@ -1150,7 +1151,7 @@ public class BassClientService extends ProfileService { } service.startSearchingForSources(filters); } catch (RuntimeException e) { Log.e(TAG, "Stack:" + Log.getStackTraceString(new Throwable())); Log.e(TAG, "Exception happened", e); } } Loading @@ -1164,7 +1165,7 @@ public class BassClientService extends ProfileService { } service.stopSearchingForSources(); } catch (RuntimeException e) { Log.e(TAG, "Stack:" + Log.getStackTraceString(new Throwable())); Log.e(TAG, "Exception happened", e); } } Loading @@ -1178,7 +1179,7 @@ public class BassClientService extends ProfileService { } return service.isSearchInProgress(); } catch (RuntimeException e) { Log.e(TAG, "Stack:" + Log.getStackTraceString(new Throwable())); Log.e(TAG, "Exception happened", e); return false; } } Loading @@ -1195,7 +1196,7 @@ public class BassClientService extends ProfileService { } service.addSource(sink, sourceMetadata, isGroupOp); } catch (RuntimeException e) { Log.e(TAG, "Stack:" + Log.getStackTraceString(new Throwable())); Log.e(TAG, "Exception happened", e); } } Loading @@ -1210,7 +1211,7 @@ public class BassClientService extends ProfileService { } service.modifySource(sink, sourceId, updatedMetadata); } catch (RuntimeException e) { Log.e(TAG, "Stack:" + Log.getStackTraceString(new Throwable())); Log.e(TAG, "Exception happened", e); } } Loading @@ -1224,7 +1225,7 @@ public class BassClientService extends ProfileService { } service.removeSource(sink, sourceId); } catch (RuntimeException e) { Log.e(TAG, "Stack:" + Log.getStackTraceString(new Throwable())); Log.e(TAG, "Exception happened", e); } } Loading @@ -1238,7 +1239,7 @@ public class BassClientService extends ProfileService { } return service.getAllSources(sink); } catch (RuntimeException e) { Log.e(TAG, "Stack:" + Log.getStackTraceString(new Throwable())); Log.e(TAG, "Exception happened", e); return Collections.emptyList(); } } Loading @@ -1253,7 +1254,7 @@ public class BassClientService extends ProfileService { } return service.getMaximumSourceCapacity(sink); } catch (RuntimeException e) { Log.e(TAG, "Stack:" + Log.getStackTraceString(new Throwable())); Log.e(TAG, "Exception happened", e); return 0; } } Loading