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

Commit 2d596f0e authored by Ricardo Cerqueira's avatar Ricardo Cerqueira Committed by Gerrit Code Review
Browse files

Merge "frameworks: add SmartCover stubs" into cm-11.0

parents 7ae217d0 96a06465
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -128,6 +128,17 @@ public interface WindowManagerPolicy {
     */
    public final static int ACTION_GO_TO_SLEEP = 0x00000004;

    /**
     * Sticky broadcast of the current lid state
     */
    public final static String ACTION_LID_STATE_CHANGED = "android.intent.action.LID_STATE_CHANGED";

    /**
     * Extra in {@link #ACTION_LID_STATE_CHANGED} indicating the state:
     * See {@link #LID_ABSENT}, {@link #LID_CLOSED}, and {@link #LID_OPEN}.
     */
    public final static String EXTRA_LID_STATE = "state";

    /**
     * Interface to the Window Manager state associated with a particular
     * window.  You can hold on to an instance of this interface from the call
+11 −0
Original line number Diff line number Diff line
@@ -473,6 +473,17 @@
         The default is false. -->
    <bool name="config_lidControlsSleep">false</bool>

    <!-- Indicate the device's Smart Cover coordinates.
         If none are provided, then the feature will be disabled.
         The array should contain 4 values, in pixels, (sample values provided):
            Top      0
            Left     100
            Bottom   Top + 400
            Right    Display Width - 100
    -->
    <integer-array name="config_smartCoverWindowCoords">
    </integer-array>

    <!-- Indicate whether to allow the device to suspend when the screen is off
         due to the proximity sensor.  This resource should only be set to true
         if the sensor HAL correctly handles the proximity sensor as a wake-up source.
+1 −0
Original line number Diff line number Diff line
@@ -1318,6 +1318,7 @@
  <java-symbol type="array" name="config_longPressVibePattern" />
  <java-symbol type="array" name="config_safeModeDisabledVibePattern" />
  <java-symbol type="array" name="config_safeModeEnabledVibePattern" />
  <java-symbol type="array" name="config_smartCoverWindowCoords" />
  <java-symbol type="array" name="config_virtualKeyVibePattern" />
  <java-symbol type="attr" name="actionModePopupWindowStyle" />
  <java-symbol type="attr" name="dialogCustomTitleDecorLayout" />
+13 −1
Original line number Diff line number Diff line
@@ -4323,6 +4323,11 @@ public class PhoneWindowManager implements WindowManagerPolicy {
        }

        mLidState = newLidState;

        Intent intent = new Intent(ACTION_LID_STATE_CHANGED);
        intent.putExtra(EXTRA_LID_STATE, mLidState);
        mContext.sendStickyBroadcastAsUser(intent, UserHandle.ALL);

        applyLidSwitchState();
        updateRotation(true);

@@ -5766,8 +5771,15 @@ public class PhoneWindowManager implements WindowManagerPolicy {
        mPowerManager.setKeyboardVisibility(isBuiltInKeyboardVisible());

        if (mLidState == LID_CLOSED && mLidControlsSleep) {
            ITelephony telephonyService = getTelephonyService();
            try {
                if(telephonyService != null && telephonyService.isIdle()) {
                    mPowerManager.goToSleep(SystemClock.uptimeMillis());
                }
            } catch (RemoteException e) {
                e.printStackTrace();
            }
        }
    }

    void updateRotation(boolean alwaysSendConfiguration) {