Loading android/app/src/com/android/bluetooth/gatt/GattService.java +12 −0 Original line number Diff line number Diff line Loading @@ -165,6 +165,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, getAttributionSource()); } }; /** * List of our registered scanners. */ Loading Loading @@ -2342,6 +2350,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 @@ -2447,6 +2458,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, attributionSource); // Also unregister the scanner Loading Loading
android/app/src/com/android/bluetooth/gatt/GattService.java +12 −0 Original line number Diff line number Diff line Loading @@ -165,6 +165,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, getAttributionSource()); } }; /** * List of our registered scanners. */ Loading Loading @@ -2342,6 +2350,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 @@ -2447,6 +2458,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, attributionSource); // Also unregister the scanner Loading