Loading android/app/src/com/android/bluetooth/gatt/GattService.java +14 −2 Original line number Diff line number Diff line Loading @@ -147,6 +147,14 @@ public class GattService extends ProfileService { } } private final PendingIntent.CancelListener mScanIntentCancelListener = new PendingIntent.CancelListener(){ public void onCancelled(PendingIntent intent) { Log.d(TAG, "scanning PendingIntent cancelled"); stopScan(intent); } }; /** * List of our registered scanners. */ Loading Loading @@ -515,7 +523,7 @@ public class GattService extends ProfileService { if (service == null) { return; } service.stopScan(intent, callingPackage); service.stopScan(intent); } @Override Loading Loading @@ -2174,6 +2182,9 @@ public class GattService extends ProfileService { } ScannerMap.App app = mScannerMap.add(uuid, null, null, piInfo, this); pendingIntent.registerCancelListener(mScanIntentCancelListener); app.mUserHandle = UserHandle.of(UserHandle.getCallingUserId()); mAppOps.checkPackage(Binder.getCallingUid(), callingPackage); app.mEligibleForSanitizedExposureNotification = Loading Loading @@ -2250,7 +2261,7 @@ public class GattService extends ProfileService { mScanManager.stopScan(scannerId); } void stopScan(PendingIntent intent, String callingPackage) { void stopScan(PendingIntent intent) { enforceAdminPermission(); PendingIntentInfo pii = new PendingIntentInfo(); pii.intent = intent; Loading @@ -2259,6 +2270,7 @@ public class GattService extends ProfileService { Log.d(TAG, "stopScan(PendingIntent): app found = " + app); } if (app != null) { intent.unregisterCancelListener(mScanIntentCancelListener); final int scannerId = app.id; stopScan(scannerId); // Also unregister the scanner Loading Loading
android/app/src/com/android/bluetooth/gatt/GattService.java +14 −2 Original line number Diff line number Diff line Loading @@ -147,6 +147,14 @@ public class GattService extends ProfileService { } } private final PendingIntent.CancelListener mScanIntentCancelListener = new PendingIntent.CancelListener(){ public void onCancelled(PendingIntent intent) { Log.d(TAG, "scanning PendingIntent cancelled"); stopScan(intent); } }; /** * List of our registered scanners. */ Loading Loading @@ -515,7 +523,7 @@ public class GattService extends ProfileService { if (service == null) { return; } service.stopScan(intent, callingPackage); service.stopScan(intent); } @Override Loading Loading @@ -2174,6 +2182,9 @@ public class GattService extends ProfileService { } ScannerMap.App app = mScannerMap.add(uuid, null, null, piInfo, this); pendingIntent.registerCancelListener(mScanIntentCancelListener); app.mUserHandle = UserHandle.of(UserHandle.getCallingUserId()); mAppOps.checkPackage(Binder.getCallingUid(), callingPackage); app.mEligibleForSanitizedExposureNotification = Loading Loading @@ -2250,7 +2261,7 @@ public class GattService extends ProfileService { mScanManager.stopScan(scannerId); } void stopScan(PendingIntent intent, String callingPackage) { void stopScan(PendingIntent intent) { enforceAdminPermission(); PendingIntentInfo pii = new PendingIntentInfo(); pii.intent = intent; Loading @@ -2259,6 +2270,7 @@ public class GattService extends ProfileService { Log.d(TAG, "stopScan(PendingIntent): app found = " + app); } if (app != null) { intent.unregisterCancelListener(mScanIntentCancelListener); final int scannerId = app.id; stopScan(scannerId); // Also unregister the scanner Loading