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

Commit fd247198 authored by jrior001's avatar jrior001 Committed by Sam Mortimer
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).

Updated for Lineage SDK and squashed with the following change:

  Author: Ethan Chen <intervigil@gmail.com>
  Date:   Sat Jan 28 21:39:21 2017 -0800

    Correctly name LID_STATE_CHANGED broadcast

    Change-Id: I472becdcf310fab8536fb24e6cacf646199f464d

Change-Id: I8ce163d0d3f71e40680f42348847e548b41a0045
parent 0be286de
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -541,6 +541,9 @@
    <protected-broadcast android:name="android.media.tv.action.WATCH_NEXT_PROGRAM_BROWSABLE_DISABLED" />
    <protected-broadcast android:name="android.media.tv.action.CHANNEL_BROWSABLE_REQUESTED" />

    <!-- LineageOS additions -->
    <protected-broadcast android:name="lineageos.intent.action.LID_STATE_CHANGED" />

    <!-- ====================================================================== -->
    <!--                          RUNTIME PERMISSIONS                           -->
    <!-- ====================================================================== -->
+9 −0
Original line number Diff line number Diff line
@@ -7481,6 +7481,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(lineageos.content.Intent.ACTION_LID_STATE_CHANGED);
        intent.putExtra(lineageos.content.Intent.EXTRA_LID_STATE, mLidState);
        intent.setFlags(Intent.FLAG_RECEIVER_REPLACE_PENDING);
        mContext.sendBroadcastAsUser(intent, UserHandle.SYSTEM);
    }

    void updateUiMode() {