Loading core/java/android/view/WindowManagerPolicy.java +11 −0 Original line number Diff line number Diff line Loading @@ -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 Loading core/res/res/values/config.xml +11 −0 Original line number Diff line number Diff line Loading @@ -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. Loading core/res/res/values/symbols.xml +1 −0 Original line number Diff line number Diff line Loading @@ -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" /> Loading policy/src/com/android/internal/policy/impl/PhoneWindowManager.java +13 −1 Original line number Diff line number Diff line Loading @@ -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); Loading Loading @@ -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) { Loading Loading
core/java/android/view/WindowManagerPolicy.java +11 −0 Original line number Diff line number Diff line Loading @@ -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 Loading
core/res/res/values/config.xml +11 −0 Original line number Diff line number Diff line Loading @@ -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. Loading
core/res/res/values/symbols.xml +1 −0 Original line number Diff line number Diff line Loading @@ -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" /> Loading
policy/src/com/android/internal/policy/impl/PhoneWindowManager.java +13 −1 Original line number Diff line number Diff line Loading @@ -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); Loading Loading @@ -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) { Loading