OSDN Git Service

Bluetooth: Don't throw exception when stopAdvertisingSet fails
authorJakub Pawlowski <jpawlowski@google.com>
Thu, 17 Aug 2017 13:15:43 +0000 (06:15 -0700)
committerJakub Pawlowski <jpawlowski@google.com>
Thu, 17 Aug 2017 14:39:02 +0000 (07:39 -0700)
When advertising is stopped while Bluetooth is disabled, we should not
throw any exceptions, just log the failure.
This was the default behaviour before the AdvertisingSet was introduced.

Bug: 63819108
Test: manual
Change-Id: I518e071b77b127973aee6f24fa6ced4f28bc9531

core/java/android/bluetooth/le/BluetoothLeAdvertiser.java

index dfd5996..fb9b19f 100644 (file)
@@ -453,8 +453,7 @@ public final class BluetoothLeAdvertiser {
             gatt.stopAdvertisingSet(wrapped);
        } catch (RemoteException e) {
             Log.e(TAG, "Failed to stop advertising - ", e);
-            throw new IllegalStateException("Failed to stop advertising");
-        }
+       }
     }
 
     /**