Loading src/com/android/bluetooth/gatt/GattService.java +14 −6 Original line number Diff line number Diff line Loading @@ -2138,7 +2138,20 @@ public class GattService extends ProfileService { } private void continueSearch(int connId, int status) throws RemoteException { if (status == 0 && !mSearchQueue.isEmpty()) { // Search is complete when there was error, or nothing more to process if (status != 0 || mSearchQueue.isEmptyFor(connId)) { // In case we complete because of error, clean up // any remaining operations for this connection. mSearchQueue.removeConnId(connId); ClientMap.App app = mClientMap.getByConnId(connId); if (app != null) { app.callback.onSearchComplete(mClientMap.addressByConnId(connId), status); } } if (!mSearchQueue.isEmpty()) { SearchQueue.Entry svc = mSearchQueue.pop(); if (svc.charUuidLsb == 0) { Loading @@ -2151,11 +2164,6 @@ public class GattService extends ProfileService { svc.srvcInstId, svc.srvcUuidLsb, svc.srvcUuidMsb, svc.charInstId, svc.charUuidLsb, svc.charUuidMsb, 0, 0, 0); } } else { ClientMap.App app = mClientMap.getByConnId(connId); if (app != null) { app.callback.onSearchComplete(mClientMap.addressByConnId(connId), status); } } } Loading src/com/android/bluetooth/gatt/SearchQueue.java +10 −0 Original line number Diff line number Diff line Loading @@ -86,6 +86,16 @@ import java.util.List; return mEntries.isEmpty(); } boolean isEmptyFor(int connId) { for (Iterator<Entry> it = mEntries.iterator(); it.hasNext();) { Entry entry = it.next(); if (entry.connId == connId) { return false; } } return true; } void clear() { mEntries.clear(); } Loading Loading
src/com/android/bluetooth/gatt/GattService.java +14 −6 Original line number Diff line number Diff line Loading @@ -2138,7 +2138,20 @@ public class GattService extends ProfileService { } private void continueSearch(int connId, int status) throws RemoteException { if (status == 0 && !mSearchQueue.isEmpty()) { // Search is complete when there was error, or nothing more to process if (status != 0 || mSearchQueue.isEmptyFor(connId)) { // In case we complete because of error, clean up // any remaining operations for this connection. mSearchQueue.removeConnId(connId); ClientMap.App app = mClientMap.getByConnId(connId); if (app != null) { app.callback.onSearchComplete(mClientMap.addressByConnId(connId), status); } } if (!mSearchQueue.isEmpty()) { SearchQueue.Entry svc = mSearchQueue.pop(); if (svc.charUuidLsb == 0) { Loading @@ -2151,11 +2164,6 @@ public class GattService extends ProfileService { svc.srvcInstId, svc.srvcUuidLsb, svc.srvcUuidMsb, svc.charInstId, svc.charUuidLsb, svc.charUuidMsb, 0, 0, 0); } } else { ClientMap.App app = mClientMap.getByConnId(connId); if (app != null) { app.callback.onSearchComplete(mClientMap.addressByConnId(connId), status); } } } Loading
src/com/android/bluetooth/gatt/SearchQueue.java +10 −0 Original line number Diff line number Diff line Loading @@ -86,6 +86,16 @@ import java.util.List; return mEntries.isEmpty(); } boolean isEmptyFor(int connId) { for (Iterator<Entry> it = mEntries.iterator(); it.hasNext();) { Entry entry = it.next(); if (entry.connId == connId) { return false; } } return true; } void clear() { mEntries.clear(); } Loading