OSDN Git Service

Fix null settings in AdvertiseCallback.onStartSuccess
authorJakub Pawlowski <jpawlowski@google.com>
Thu, 1 Dec 2016 17:21:06 +0000 (09:21 -0800)
committerAndre Eisenbach <eisenbach@google.com>
Thu, 1 Dec 2016 17:29:31 +0000 (17:29 +0000)
Test: acts FilteringTest
Bug: 33171815
Bug: 30622771
Change-Id: Ib3df1d13535999ede0e820651fc6d69daeb8ef17

src/com/android/bluetooth/gatt/AdvertiseManager.java
src/com/android/bluetooth/gatt/GattService.java

index b41ebd9..ee44a7a 100644 (file)
@@ -137,7 +137,7 @@ class AdvertiseManager {
         }
     }
 
-    private AdvertiseClient getAdvertiseClient(int advertiserId) {
+    public AdvertiseClient getAdvertiseClient(int advertiserId) {
         for (AdvertiseClient client : mAdvertiseClients) {
             if (client.advertiserId == advertiserId) {
                 return client;
index 9485c60..e9a27f6 100644 (file)
@@ -1193,8 +1193,10 @@ public class GattService extends ProfileService {
         AdvertiserMap.App app = mAdvertiserMap.getById(advertiserId);
         if (app != null) {
             if (status == 0) {
+                AdvertiseClient client = mAdvertiseManager.getAdvertiseClient(advertiserId);
+                AdvertiseSettings settings = (client == null) ? null : client.settings;
                 app.callback.onMultiAdvertiseCallback(AdvertiseCallback.ADVERTISE_SUCCESS,
-                        true, null);
+                        true, settings);
             } else {
                 app.callback.onMultiAdvertiseCallback(
                         AdvertiseCallback.ADVERTISE_FAILED_INTERNAL_ERROR, true, null);