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

Commit 121abada authored by Wei Wang's avatar Wei Wang
Browse files

Fix filter index stack initialization issue caused by GattServiceStateMachine...

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

Change-Id: I4f487378b332d3b33c8646fd78d9ccec41431975
parent ff30f46c
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();