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

Commit 1b025fd8 authored by Mingming Yin's avatar Mingming Yin Committed by Gerrit Code Review
Browse files

PhoneWindowManager: Release wakelock after headset detection.

- Device does not go to suspend mode after boots up with headset connected.
- Wakelock is not released properly if headsed is detected during boot up.
- Release wakelock in headset intent handler.

CRs-fixed: 384362

(cherry picked from commit 67ddd3c31c7a58aed89f12f956a4d29d58654ed7)

Change-Id: I09f81f4f0e4b2035b13acbb23f6c1dd7b84652c1
parent e4cfb749
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -3779,12 +3779,12 @@ public class PhoneWindowManager implements WindowManagerPolicy {
        Slog.d(TAG,"Headset detect: Inside handleMessage() for IntentHandler" + (String)msg.obj);
            if (mSystemBooted) {
            sendIntents((String)msg.obj);
            mBroadcastWakeLock.release();
            } else {
                Log.e(TAG, "system not booted yet, send headset intent later");
                mHeadsetIntent = true;
                mHeadsetName = (String)msg.obj;
            }
            mBroadcastWakeLock.release();
        }
    };

@@ -4728,7 +4728,6 @@ public class PhoneWindowManager implements WindowManagerPolicy {
            if (mHeadsetIntent) {
                Log.e(TAG, "send headset intent after system booted");
                sendIntents(mHeadsetName);
                mBroadcastWakeLock.release();
            }
        }
    }