summaryrefslogtreecommitdiffstats
path: root/policy
diff options
context:
space:
mode:
authorJohn Spurlock <jspurlock@google.com>2013-04-08 12:59:26 -0400
committerJohn Spurlock <jspurlock@google.com>2013-04-08 19:18:59 +0000
commitc8b46ca5754a9ac9e0afea2f9c0b5d9984c5c128 (patch)
tree379652fc66bcbdf5e71ec287b631c395c9b1db44 /policy
parenta56b78dcd1292a4291d85113bdeeda8496c1a0c0 (diff)
downloadframeworks_base-c8b46ca5754a9ac9e0afea2f9c0b5d9984c5c128.zip
frameworks_base-c8b46ca5754a9ac9e0afea2f9c0b5d9984c5c128.tar.gz
frameworks_base-c8b46ca5754a9ac9e0afea2f9c0b5d9984c5c128.tar.bz2
Awaken dreams on home + recents.
Fixes the KEYCODE_HOME case, awakes when home is started for any reason. Also awaken when toggling recents (and not locked). Bug:8557212 Change-Id: I6578ae3971740a03c27596b838d27a5ab9b03752
Diffstat (limited to 'policy')
-rw-r--r--policy/src/com/android/internal/policy/impl/PhoneWindowManager.java21
1 files changed, 20 insertions, 1 deletions
diff --git a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
index 49460de..5f9e921 100644
--- a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
+++ b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
@@ -59,6 +59,8 @@ import android.os.UEventObserver;
import android.os.UserHandle;
import android.os.Vibrator;
import android.provider.Settings;
+import android.service.dreams.DreamService;
+import android.service.dreams.IDreamManager;
import android.util.DisplayMetrics;
import android.util.EventLog;
import android.util.Log;
@@ -1801,7 +1803,23 @@ public class PhoneWindowManager implements WindowManagerPolicy {
? com.android.internal.R.anim.lock_screen_wallpaper_behind_enter
: com.android.internal.R.anim.lock_screen_behind_enter);
}
-
+
+ private static void awakenDreams() {
+ IDreamManager dreamManager = getDreamManager();
+ if (dreamManager != null) {
+ try {
+ dreamManager.awaken();
+ } catch (RemoteException e) {
+ // fine, stay asleep then
+ }
+ }
+ }
+
+ static IDreamManager getDreamManager() {
+ return IDreamManager.Stub.asInterface(
+ ServiceManager.checkService(DreamService.DREAM_SERVICE));
+ }
+
static ITelephony getTelephonyService() {
return ITelephony.Stub.asInterface(
ServiceManager.checkService(Context.TELEPHONY_SERVICE));
@@ -4550,6 +4568,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
}
void startDockOrHome() {
+ awakenDreams();
// We don't have dock home anymore. Home is home. If you lived here, you'd be home by now.
mContext.startActivityAsUser(mHomeIntent, UserHandle.CURRENT);
}