summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNick Armstrong-Crews <strongarm@google.com>2015-09-08 04:25:01 +0000
committerNick Armstrong-Crews <strongarm@google.com>2015-09-08 04:25:01 +0000
commitb331bf951499396111cb47b477ac35e82c805322 (patch)
tree013863aebef76afcb8fe67146a1411451d136c77
parent677adf1e66ba83b8fb2c849c181303b35bd489bc (diff)
downloadframeworks_base-b331bf951499396111cb47b477ac35e82c805322.zip
frameworks_base-b331bf951499396111cb47b477ac35e82c805322.tar.gz
frameworks_base-b331bf951499396111cb47b477ac35e82c805322.tar.bz2
Revert "Handle KEYCODE_SOFT_SLEEP from Ungaze."
This reverts commit 677adf1e66ba83b8fb2c849c181303b35bd489bc. Hiding new keycode to prevent change to public API before resubmitting. Change-Id: Ic43273dd0c7ade1d51a36b77f363543f1df466e8
-rw-r--r--api/current.txt1
-rw-r--r--api/system-current.txt1
-rw-r--r--core/java/android/os/PowerManagerInternal.java6
-rw-r--r--core/java/android/view/KeyEvent.java4
-rw-r--r--core/res/res/values/attrs.xml1
-rw-r--r--services/core/java/com/android/server/policy/PhoneWindowManager.java12
-rw-r--r--services/core/java/com/android/server/power/PowerManagerService.java31
7 files changed, 1 insertions, 55 deletions
diff --git a/api/current.txt b/api/current.txt
index 1946e49..d7fdb2d 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -35217,7 +35217,6 @@ package android.view {
field public static final int KEYCODE_SLEEP = 223; // 0xdf
field public static final int KEYCODE_SOFT_LEFT = 1; // 0x1
field public static final int KEYCODE_SOFT_RIGHT = 2; // 0x2
- field public static final int KEYCODE_SOFT_SLEEP = 276; // 0x114
field public static final int KEYCODE_SPACE = 62; // 0x3e
field public static final int KEYCODE_STAR = 17; // 0x11
field public static final int KEYCODE_STB_INPUT = 180; // 0xb4
diff --git a/api/system-current.txt b/api/system-current.txt
index b2a1539..f464292 100644
--- a/api/system-current.txt
+++ b/api/system-current.txt
@@ -37520,7 +37520,6 @@ package android.view {
field public static final int KEYCODE_SLEEP = 223; // 0xdf
field public static final int KEYCODE_SOFT_LEFT = 1; // 0x1
field public static final int KEYCODE_SOFT_RIGHT = 2; // 0x2
- field public static final int KEYCODE_SOFT_SLEEP = 276; // 0x114
field public static final int KEYCODE_SPACE = 62; // 0x3e
field public static final int KEYCODE_STAR = 17; // 0x11
field public static final int KEYCODE_STB_INPUT = 180; // 0xb4
diff --git a/core/java/android/os/PowerManagerInternal.java b/core/java/android/os/PowerManagerInternal.java
index 70cff00..e742f98 100644
--- a/core/java/android/os/PowerManagerInternal.java
+++ b/core/java/android/os/PowerManagerInternal.java
@@ -108,12 +108,6 @@ public abstract class PowerManagerInternal {
public abstract void setUserActivityTimeoutOverrideFromWindowManager(long timeoutMillis);
/**
- * Used by the window manager to tell the power manager that the user is no longer actively
- * using the device.
- */
- public abstract void setUserInactiveOverrideFromWindowManager();
-
- /**
* Used by device administration to set the maximum screen off timeout.
*
* This method must only be called by the device administration policy manager.
diff --git a/core/java/android/view/KeyEvent.java b/core/java/android/view/KeyEvent.java
index 2bd319c..52852e7 100644
--- a/core/java/android/view/KeyEvent.java
+++ b/core/java/android/view/KeyEvent.java
@@ -784,10 +784,8 @@ public class KeyEvent extends InputEvent implements Parcelable {
/** Key code constant: Step backward media key.
* Steps media backward, one frame at a time. */
public static final int KEYCODE_MEDIA_STEP_BACKWARD = 275;
- /** Key code constant: put device to sleep unless a wakelock is held. */
- public static final int KEYCODE_SOFT_SLEEP = 276;
- private static final int LAST_KEYCODE = KEYCODE_SOFT_SLEEP;
+ private static final int LAST_KEYCODE = KEYCODE_MEDIA_STEP_BACKWARD;
// NOTE: If you add a new keycode here you must also add it to:
// isSystem()
diff --git a/core/res/res/values/attrs.xml b/core/res/res/values/attrs.xml
index cf83422..a024656 100644
--- a/core/res/res/values/attrs.xml
+++ b/core/res/res/values/attrs.xml
@@ -1814,7 +1814,6 @@ i
<enum name="KEYCODE_MEDIA_SKIP_BACKWARD" value="273" />
<enum name="KEYCODE_MEDIA_STEP_FORWARD" value="274" />
<enum name="KEYCODE_MEDIA_STEP_BACKWARD" value="275" />
- <enum name="KEYCODE_SOFT_SLEEP" value="276" />
</attr>
<!-- ***************************************************************** -->
diff --git a/services/core/java/com/android/server/policy/PhoneWindowManager.java b/services/core/java/com/android/server/policy/PhoneWindowManager.java
index c7c5afd..34737c1 100644
--- a/services/core/java/com/android/server/policy/PhoneWindowManager.java
+++ b/services/core/java/com/android/server/policy/PhoneWindowManager.java
@@ -65,7 +65,6 @@ import android.os.Looper;
import android.os.Message;
import android.os.Messenger;
import android.os.PowerManager;
-import android.os.PowerManagerInternal;
import android.os.Process;
import android.os.RemoteException;
import android.os.ServiceManager;
@@ -266,7 +265,6 @@ public class PhoneWindowManager implements WindowManagerPolicy {
WindowManagerFuncs mWindowManagerFuncs;
WindowManagerInternal mWindowManagerInternal;
PowerManager mPowerManager;
- PowerManagerInternal mPowerManagerInternal;
ActivityManagerInternal mActivityManagerInternal;
DreamManagerInternal mDreamManagerInternal;
IStatusBarService mStatusBarService;
@@ -1326,7 +1324,6 @@ public class PhoneWindowManager implements WindowManagerPolicy {
mActivityManagerInternal = LocalServices.getService(ActivityManagerInternal.class);
mDreamManagerInternal = LocalServices.getService(DreamManagerInternal.class);
mAppOpsManager = (AppOpsManager) mContext.getSystemService(Context.APP_OPS_SERVICE);
- mPowerManagerInternal = LocalServices.getService(PowerManagerInternal.class);
// Init display burn-in protection
boolean burnInProtectionEnabled = context.getResources().getBoolean(
@@ -5083,15 +5080,6 @@ public class PhoneWindowManager implements WindowManagerPolicy {
break;
}
- case KeyEvent.KEYCODE_SOFT_SLEEP: {
- result &= ~ACTION_PASS_TO_USER;
- isWakeKey = false;
- if (!down) {
- mPowerManagerInternal.setUserInactiveOverrideFromWindowManager();
- }
- break;
- }
-
case KeyEvent.KEYCODE_WAKEUP: {
result &= ~ACTION_PASS_TO_USER;
isWakeKey = true;
diff --git a/services/core/java/com/android/server/power/PowerManagerService.java b/services/core/java/com/android/server/power/PowerManagerService.java
index a06ea1f..b920f97 100644
--- a/services/core/java/com/android/server/power/PowerManagerService.java
+++ b/services/core/java/com/android/server/power/PowerManagerService.java
@@ -393,10 +393,6 @@ public final class PowerManagerService extends SystemService
// Use -1 to disable.
private int mScreenBrightnessOverrideFromWindowManager = -1;
- // The window manager has determined the user to be inactive via other means.
- // Set this to false to disable.
- private boolean mUserInactiveOverrideFromWindowManager;
-
// The user activity timeout override from the window manager
// to allow the current foreground activity to override the user activity timeout.
// Use -1 to disable.
@@ -1032,10 +1028,6 @@ public final class PowerManagerService extends SystemService
mNotifier.onUserActivity(event, uid);
- if (mUserInactiveOverrideFromWindowManager) {
- mUserInactiveOverrideFromWindowManager = false;
- }
-
if (mWakefulness == WAKEFULNESS_ASLEEP
|| mWakefulness == WAKEFULNESS_DOZING
|| (flags & PowerManager.USER_ACTIVITY_FLAG_INDIRECT) != 0) {
@@ -1533,7 +1525,6 @@ public final class PowerManagerService extends SystemService
final int sleepTimeout = getSleepTimeoutLocked();
final int screenOffTimeout = getScreenOffTimeoutLocked(sleepTimeout);
final int screenDimDuration = getScreenDimDurationLocked(screenOffTimeout);
- final boolean userInactiveOverride = mUserInactiveOverrideFromWindowManager;
mUserActivitySummary = 0;
if (mLastUserActivityTime >= mLastWakeTime) {
@@ -1559,7 +1550,6 @@ public final class PowerManagerService extends SystemService
}
}
}
-
if (mUserActivitySummary == 0) {
if (sleepTimeout >= 0) {
final long anyUserActivity = Math.max(mLastUserActivityTime,
@@ -1575,12 +1565,6 @@ public final class PowerManagerService extends SystemService
nextTimeout = -1;
}
}
-
- if (mUserActivitySummary != USER_ACTIVITY_SCREEN_DREAM && userInactiveOverride) {
- mUserActivitySummary = USER_ACTIVITY_SCREEN_DREAM;
- nextTimeout = -1;
- }
-
if (mUserActivitySummary != 0 && nextTimeout >= 0) {
Message msg = mHandler.obtainMessage(MSG_USER_ACTIVITY_TIMEOUT);
msg.setAsynchronous(true);
@@ -2510,14 +2494,6 @@ public final class PowerManagerService extends SystemService
}
}
- private void setUserInactiveOverrideFromWindowManagerInternal() {
- synchronized (mLock) {
- mUserInactiveOverrideFromWindowManager = true;
- mDirty |= DIRTY_USER_ACTIVITY;
- updatePowerStateLocked();
- }
- }
-
private void setUserActivityTimeoutOverrideFromWindowManagerInternal(long timeoutMillis) {
synchronized (mLock) {
if (mUserActivityTimeoutOverrideFromWindowManager != timeoutMillis) {
@@ -2707,8 +2683,6 @@ public final class PowerManagerService extends SystemService
+ mScreenBrightnessOverrideFromWindowManager);
pw.println(" mUserActivityTimeoutOverrideFromWindowManager="
+ mUserActivityTimeoutOverrideFromWindowManager);
- pw.println(" mUserInactiveOverrideFromWindowManager="
- + mUserInactiveOverrideFromWindowManager);
pw.println(" mTemporaryScreenBrightnessSettingOverride="
+ mTemporaryScreenBrightnessSettingOverride);
pw.println(" mTemporaryScreenAutoBrightnessAdjustmentSettingOverride="
@@ -3513,11 +3487,6 @@ public final class PowerManagerService extends SystemService
}
@Override
- public void setUserInactiveOverrideFromWindowManager() {
- setUserInactiveOverrideFromWindowManagerInternal();
- }
-
- @Override
public void setUserActivityTimeoutOverrideFromWindowManager(long timeoutMillis) {
setUserActivityTimeoutOverrideFromWindowManagerInternal(timeoutMillis);
}