Loading android/app/src/com/android/bluetooth/gatt/GattService.java +10 −10 Original line number Diff line number Diff line Loading @@ -343,7 +343,7 @@ public class GattService extends ProfileService { if (isScanClient(mScannerId)) { ScanClient client = new ScanClient(mScannerId); client.appDied = true; stopScan(client); stopScan(client.scannerId); } } Loading Loading @@ -500,7 +500,7 @@ public class GattService extends ProfileService { if (service == null) { return; } service.stopScan(new ScanClient(scannerId)); service.stopScan(scannerId); } @Override Loading Loading @@ -1031,7 +1031,7 @@ public class GattService extends ProfileService { } catch (RemoteException | PendingIntent.CanceledException e) { Log.e(TAG, "Exception: " + e); mScannerMap.remove(client.scannerId); mScanManager.stopScan(client); mScanManager.stopScan(client.scannerId); } } } Loading @@ -1043,7 +1043,7 @@ public class GattService extends ProfileService { try { sendResultsByPendingIntent(pii, results, callbackType); } catch (PendingIntent.CanceledException e) { stopScan(client); stopScan(client.scannerId); unregisterScanner(client.scannerId); } } Loading Loading @@ -1595,7 +1595,7 @@ public class GattService extends ProfileService { } catch (RemoteException | PendingIntent.CanceledException e) { Log.e(TAG, "Exception: " + e); mScannerMap.remove(client.scannerId); mScanManager.stopScan(client); mScanManager.stopScan(client.scannerId); } } Loading Loading @@ -2039,7 +2039,7 @@ public class GattService extends ProfileService { mScanManager.flushBatchScanResults(new ScanClient(scannerId)); } void stopScan(ScanClient client) { void stopScan(int scannerId) { enforceAdminPermission(); int scanQueueSize = mScanManager.getBatchScanQueue().size() + mScanManager.getRegularScanQueue().size(); Loading @@ -2048,12 +2048,12 @@ public class GattService extends ProfileService { } AppScanStats app = null; app = mScannerMap.getAppScanStatsById(client.scannerId); app = mScannerMap.getAppScanStatsById(scannerId); if (app != null) { app.recordScanStop(client.scannerId); app.recordScanStop(scannerId); } mScanManager.stopScan(client); mScanManager.stopScan(scannerId); } void stopScan(PendingIntent intent, String callingPackage) { Loading @@ -2066,7 +2066,7 @@ public class GattService extends ProfileService { } if (app != null) { final int scannerId = app.id; stopScan(new ScanClient(scannerId)); stopScan(scannerId); // Also unregister the scanner unregisterScanner(scannerId); } Loading android/app/src/com/android/bluetooth/gatt/ScanManager.java +5 −1 Original line number Diff line number Diff line Loading @@ -223,7 +223,11 @@ public class ScanManager { sendMessage(MSG_START_BLE_SCAN, client); } void stopScan(ScanClient client) { void stopScan(int scannerId) { ScanClient client = mScanNative.getBatchScanClient(scannerId); if (client == null) { client = mScanNative.getRegularScanClient(scannerId); } sendMessage(MSG_STOP_BLE_SCAN, client); } Loading Loading
android/app/src/com/android/bluetooth/gatt/GattService.java +10 −10 Original line number Diff line number Diff line Loading @@ -343,7 +343,7 @@ public class GattService extends ProfileService { if (isScanClient(mScannerId)) { ScanClient client = new ScanClient(mScannerId); client.appDied = true; stopScan(client); stopScan(client.scannerId); } } Loading Loading @@ -500,7 +500,7 @@ public class GattService extends ProfileService { if (service == null) { return; } service.stopScan(new ScanClient(scannerId)); service.stopScan(scannerId); } @Override Loading Loading @@ -1031,7 +1031,7 @@ public class GattService extends ProfileService { } catch (RemoteException | PendingIntent.CanceledException e) { Log.e(TAG, "Exception: " + e); mScannerMap.remove(client.scannerId); mScanManager.stopScan(client); mScanManager.stopScan(client.scannerId); } } } Loading @@ -1043,7 +1043,7 @@ public class GattService extends ProfileService { try { sendResultsByPendingIntent(pii, results, callbackType); } catch (PendingIntent.CanceledException e) { stopScan(client); stopScan(client.scannerId); unregisterScanner(client.scannerId); } } Loading Loading @@ -1595,7 +1595,7 @@ public class GattService extends ProfileService { } catch (RemoteException | PendingIntent.CanceledException e) { Log.e(TAG, "Exception: " + e); mScannerMap.remove(client.scannerId); mScanManager.stopScan(client); mScanManager.stopScan(client.scannerId); } } Loading Loading @@ -2039,7 +2039,7 @@ public class GattService extends ProfileService { mScanManager.flushBatchScanResults(new ScanClient(scannerId)); } void stopScan(ScanClient client) { void stopScan(int scannerId) { enforceAdminPermission(); int scanQueueSize = mScanManager.getBatchScanQueue().size() + mScanManager.getRegularScanQueue().size(); Loading @@ -2048,12 +2048,12 @@ public class GattService extends ProfileService { } AppScanStats app = null; app = mScannerMap.getAppScanStatsById(client.scannerId); app = mScannerMap.getAppScanStatsById(scannerId); if (app != null) { app.recordScanStop(client.scannerId); app.recordScanStop(scannerId); } mScanManager.stopScan(client); mScanManager.stopScan(scannerId); } void stopScan(PendingIntent intent, String callingPackage) { Loading @@ -2066,7 +2066,7 @@ public class GattService extends ProfileService { } if (app != null) { final int scannerId = app.id; stopScan(new ScanClient(scannerId)); stopScan(scannerId); // Also unregister the scanner unregisterScanner(scannerId); } Loading
android/app/src/com/android/bluetooth/gatt/ScanManager.java +5 −1 Original line number Diff line number Diff line Loading @@ -223,7 +223,11 @@ public class ScanManager { sendMessage(MSG_START_BLE_SCAN, client); } void stopScan(ScanClient client) { void stopScan(int scannerId) { ScanClient client = mScanNative.getBatchScanClient(scannerId); if (client == null) { client = mScanNative.getRegularScanClient(scannerId); } sendMessage(MSG_STOP_BLE_SCAN, client); } Loading