summaryrefslogtreecommitdiffstats
path: root/core/java
diff options
context:
space:
mode:
authorJeff Brown <jeffbrown@google.com>2012-10-01 15:20:22 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-10-01 15:20:23 -0700
commitcb6f950f15919794d26a55c20090fe5dacd11e4a (patch)
treebef822ab877bce84ab10a664380aae9e50f99b77 /core/java
parent4b08e07477f1763a93d9658f618606c1f1e9f249 (diff)
parent1e3b98d47df596d0c4eadbdf60143709f8465b28 (diff)
downloadframeworks_base-cb6f950f15919794d26a55c20090fe5dacd11e4a.zip
frameworks_base-cb6f950f15919794d26a55c20090fe5dacd11e4a.tar.gz
frameworks_base-cb6f950f15919794d26a55c20090fe5dacd11e4a.tar.bz2
Merge "New internal API to eliminate poke locks." into jb-mr1-dev
Diffstat (limited to 'core/java')
-rw-r--r--core/java/android/os/IPowerManager.aidl1
-rw-r--r--core/java/android/os/LocalPowerManager.java28
-rw-r--r--core/java/android/view/WindowManager.java40
3 files changed, 40 insertions, 29 deletions
diff --git a/core/java/android/os/IPowerManager.aidl b/core/java/android/os/IPowerManager.aidl
index 5345a6d..557d3f3 100644
--- a/core/java/android/os/IPowerManager.aidl
+++ b/core/java/android/os/IPowerManager.aidl
@@ -40,7 +40,6 @@ interface IPowerManager
void reboot(String reason);
void crash(String message);
- void setPokeLock(int pokey, IBinder lock, String tag);
void setStayOnSetting(int val);
void setMaximumScreenOffTimeoutFromDeviceAdmin(int timeMs);
diff --git a/core/java/android/os/LocalPowerManager.java b/core/java/android/os/LocalPowerManager.java
deleted file mode 100644
index 519315c..0000000
--- a/core/java/android/os/LocalPowerManager.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Copyright (C) 2007 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package android.os;
-
-/** @hide */
-public interface LocalPowerManager {
- // FIXME: Replace poke locks with something else.
-
- public static final int POKE_LOCK_IGNORE_TOUCH_EVENTS = 0x1;
-
- public static final int POKE_LOCK_SHORT_TIMEOUT = 0x2;
- public static final int POKE_LOCK_MEDIUM_TIMEOUT = 0x4;
- public static final int POKE_LOCK_TIMEOUT_MASK = 0x6;
-}
diff --git a/core/java/android/view/WindowManager.java b/core/java/android/view/WindowManager.java
index fa2d4e8..6e51270 100644
--- a/core/java/android/view/WindowManager.java
+++ b/core/java/android/view/WindowManager.java
@@ -1176,14 +1176,42 @@ public interface WindowManager extends ViewManager {
public static final int INPUT_FEATURE_NO_INPUT_CHANNEL = 0x00000002;
/**
+ * When this window has focus, does not call user activity for all input events so
+ * the application will have to do it itself. Should only be used by
+ * the keyguard and phone app.
+ * <p>
+ * Should only be used by the keyguard and phone app.
+ * </p>
+ *
+ * @hide
+ */
+ public static final int INPUT_FEATURE_DISABLE_USER_ACTIVITY = 0x00000004;
+
+ /**
* Control special features of the input subsystem.
*
* @see #INPUT_FEATURE_DISABLE_TOUCH_PAD_GESTURES
* @see #INPUT_FEATURE_NO_INPUT_CHANNEL
+ * @see #INPUT_FEATURE_DISABLE_USER_ACTIVITY
* @hide
*/
public int inputFeatures;
+ /**
+ * Sets the number of milliseconds before the user activity timeout occurs
+ * when this window has focus. A value of -1 uses the standard timeout.
+ * A value of 0 uses the minimum support display timeout.
+ * <p>
+ * This property can only be used to reduce the user specified display timeout;
+ * it can never make the timeout longer than it normally would be.
+ * </p><p>
+ * Should only be used by the keyguard and phone app.
+ * </p>
+ *
+ * @hide
+ */
+ public long userActivityTimeout = -1;
+
public LayoutParams() {
super(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
type = TYPE_APPLICATION;
@@ -1268,6 +1296,7 @@ public interface WindowManager extends ViewManager {
out.writeInt(subtreeSystemUiVisibility);
out.writeInt(hasSystemUiListeners ? 1 : 0);
out.writeInt(inputFeatures);
+ out.writeLong(userActivityTimeout);
}
public static final Parcelable.Creator<LayoutParams> CREATOR
@@ -1308,6 +1337,7 @@ public interface WindowManager extends ViewManager {
subtreeSystemUiVisibility = in.readInt();
hasSystemUiListeners = in.readInt() != 0;
inputFeatures = in.readInt();
+ userActivityTimeout = in.readLong();
}
@SuppressWarnings({"PointlessBitwiseExpression"})
@@ -1334,6 +1364,8 @@ public interface WindowManager extends ViewManager {
/** {@hide} */
public static final int PRIVATE_FLAGS_CHANGED = 1<<16;
/** {@hide} */
+ public static final int USER_ACTIVITY_TIMEOUT_CHANGED = 1<<17;
+ /** {@hide} */
public static final int EVERYTHING_CHANGED = 0xffffffff;
// internal buffer to backup/restore parameters under compatibility mode.
@@ -1455,6 +1487,11 @@ public interface WindowManager extends ViewManager {
changes |= INPUT_FEATURES_CHANGED;
}
+ if (userActivityTimeout != o.userActivityTimeout) {
+ userActivityTimeout = o.userActivityTimeout;
+ changes |= USER_ACTIVITY_TIMEOUT_CHANGED;
+ }
+
return changes;
}
@@ -1547,6 +1584,9 @@ public interface WindowManager extends ViewManager {
if (inputFeatures != 0) {
sb.append(" if=0x").append(Integer.toHexString(inputFeatures));
}
+ if (userActivityTimeout >= 0) {
+ sb.append(" userActivityTimeout=").append(userActivityTimeout);
+ }
sb.append('}');
return sb.toString();
}