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

Commit 603931d0 authored by jrior001's avatar jrior001 Committed by Danny Baumann
Browse files

Allow lid to send a generic COVER_CHANGED broadcast

This intent will be used to launch a common app for devices
with a view window flip cover(LG, Asus..)  or dotcase(HTC).

Change-Id: I8ce163d0d3f71e40680f42348847e548b41a0045
parent 3ee3f8aa
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -510,6 +510,7 @@

    <protected-broadcast android:name="com.android.server.retaildemo.ACTION_RESET_DEMO" />

    <protected-broadcast android:name="cyanogenmod.intent.action.ACTION_LID_STATE_CHANGED" />
    <!-- ====================================================================== -->
    <!--                          RUNTIME PERMISSIONS                           -->
    <!-- ====================================================================== -->
+9 −0
Original line number Diff line number Diff line
@@ -8018,6 +8018,15 @@ public class PhoneWindowManager implements WindowManagerPolicy {
        synchronized (mLock) {
            updateWakeGestureListenerLp();
        }
        sendLidChangeBroadcast();
    }

    private void sendLidChangeBroadcast() {
        Log.d(TAG, "Sending cover change broadcast, mLidState=" + mLidState);
        Intent intent = new Intent(cyanogenmod.content.Intent.ACTION_LID_STATE_CHANGED);
        intent.putExtra(cyanogenmod.content.Intent.EXTRA_LID_STATE, mLidState);
        intent.setFlags(Intent.FLAG_RECEIVER_REPLACE_PENDING);
        mContext.sendBroadcastAsUser(intent, UserHandle.SYSTEM);
    }

    void updateUiMode() {