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

Commit d57519d2 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Prevent GattService modifying transitionalScanHelper lifecycle when not...

Merge "Prevent GattService modifying transitionalScanHelper lifecycle when not in control if the flag is on." into main
parents 395d43e0 2d3fb10a
Loading
Loading
Loading
Loading
+7 −5
Original line number Diff line number Diff line
@@ -241,12 +241,11 @@ public class GattService extends ProfileService {
            Log.w(TAG, "stop() called before start()");
            return;
        }

        if (Flags.scanManagerRefactor()) {
            setGattService(null);
        }

        } else {
            mTransitionalScanHelper.stop();
        }
        mAdvertiserMap.clear();
        mClientMap.clear();
        if (Flags.gattCleanupRestrictedHandles()) {
@@ -271,8 +270,10 @@ public class GattService extends ProfileService {
        if (mDistanceMeasurementManager != null) {
            mDistanceMeasurementManager.cleanup();
        }
        if (!Flags.scanManagerRefactor()) {
            mTransitionalScanHelper.cleanup();
        }
    }

    /** This is only used when Flags.scanManagerRefactor() is true. */
    public static synchronized GattService getGattService() {
@@ -306,7 +307,8 @@ public class GattService extends ProfileService {
                        new Handler(getMainLooper()) {
                            public void handleMessage(Message msg) {
                                synchronized (mTestModeLock) {
                                    if (!GattService.this.isTestModeEnabled()) {
                                    if (!GattService.this.isTestModeEnabled()
                                            || Flags.scanManagerRefactor()) {
                                        return;
                                    }
                                    for (String test : TEST_MODE_BEACONS) {