Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 12b7b4e9 authored by Wei Wang's avatar Wei Wang Committed by Android Git Automerger
Browse files

am 121abada: Fix filter index stack initialization issue caused by...

am 121abada: Fix filter index stack initialization issue caused by GattServiceStateMachine created before adapter property is filled.

* commit '121abada':
  Fix filter index stack initialization issue caused by GattServiceStateMachine created before adapter property is filled.
parents 2e8a73ad 121abada
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -1019,7 +1019,6 @@ public class GattService extends ProfileService {
    }

    void onScanFilterEnableDisabled(int action, int status, int clientIf) {
        Log.d(TAG, "called");
        if (DBG) {
            Log.d(TAG, "onScanFilterEnableDisabled() - clientIf=" + clientIf + ", status=" + status
                    + ", action=" + action);
+5 −2
Original line number Diff line number Diff line
@@ -144,7 +144,6 @@ public class GattServiceStateMachine extends StateMachine {
        mAdvertiseClients = new HashMap<Integer, AdvertiseClient>();
        mFilterIndexStack = new ArrayDeque<Integer>();
        mClientFilterIndexMap = new HashMap<Integer, Deque<Integer>>();
        initFilterIndexStack();

        addState(mIdle);
        addState(mScanStarting);
@@ -285,6 +284,10 @@ public class GattServiceStateMachine extends StateMachine {
            if (DBG) {
                log("enter scan starting state: " + getCurrentMessage().what);
            }
            // TODO: find a better place for this.
            if (mFilterIndexStack.isEmpty()) {
                initFilterIndexStack();
            }
        }

        @SuppressWarnings("unchecked")
@@ -360,10 +363,10 @@ public class GattServiceStateMachine extends StateMachine {
    private void enableBleScan(ScanClient client) {
        if (client == null || client.settings == null
                || client.settings.getReportDelayNanos() == 0) {
            logd("enabling ble scan, appIf " + client.appIf);
            gattClientScanNative(true);
            return;
        }
        logd("enabling ble scan, appIf " + client.appIf);
        int fullScanPercent = 20;
        int notifyThreshold = 95;
        resetCallbackLatch();