auto import from //branches/cupcake/...@126645
diff --git a/policy/com/android/internal/policy/impl/KeyguardViewManager.java b/policy/com/android/internal/policy/impl/KeyguardViewManager.java
index a48f4f9..f5dd3e5 100644
--- a/policy/com/android/internal/policy/impl/KeyguardViewManager.java
+++ b/policy/com/android/internal/policy/impl/KeyguardViewManager.java
@@ -97,7 +97,8 @@
 
             final int stretch = ViewGroup.LayoutParams.FILL_PARENT;
             int flags = WindowManager.LayoutParams.FLAG_DITHER
-                    | WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN;
+                    | WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN
+                    | WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM;
             WindowManager.LayoutParams lp = new WindowManager.LayoutParams(
                     stretch, stretch, WindowManager.LayoutParams.TYPE_KEYGUARD,
                     flags, PixelFormat.OPAQUE);
diff --git a/policy/com/android/internal/policy/impl/PhoneWindow.java b/policy/com/android/internal/policy/impl/PhoneWindow.java
index dfc4b6c..80a2120 100644
--- a/policy/com/android/internal/policy/impl/PhoneWindow.java
+++ b/policy/com/android/internal/policy/impl/PhoneWindow.java
@@ -65,7 +65,6 @@
 import static android.view.WindowManager.LayoutParams.FLAG_FULLSCREEN;
 import static android.view.WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN;
 import static android.view.WindowManager.LayoutParams.FLAG_LAYOUT_INSET_DECOR;
-import static android.view.WindowManager.LayoutParams.FLAG_RESTORED_STATE;
 import android.view.animation.Animation;
 import android.view.animation.AnimationUtils;
 import android.widget.FrameLayout;
@@ -1376,8 +1375,6 @@
             return;
         }
 
-        setFlags(FLAG_RESTORED_STATE, FLAG_RESTORED_STATE);
-        
         SparseArray<Parcelable> savedStates
                 = savedInstanceState.getSparseParcelableArray(VIEWS_TAG);
         if (savedStates != null) {
@@ -1946,7 +1943,7 @@
         WindowManager.LayoutParams params = getAttributes();
         
         if (!hasSoftInputMode()) {
-            params.softInputMode = (byte)a.getInt(
+            params.softInputMode = a.getInt(
                     com.android.internal.R.styleable.Window_windowSoftInputMode,
                     params.softInputMode);
         }
diff --git a/policy/com/android/internal/policy/impl/PowerDialog.java b/policy/com/android/internal/policy/impl/PowerDialog.java
index ce9363e..77c42ab 100644
--- a/policy/com/android/internal/policy/impl/PowerDialog.java
+++ b/policy/com/android/internal/policy/impl/PowerDialog.java
@@ -72,6 +72,8 @@
         getWindow().setType(WindowManager.LayoutParams.TYPE_SYSTEM_DIALOG);
         getWindow().setFlags(WindowManager.LayoutParams.FLAG_BLUR_BEHIND,
                 WindowManager.LayoutParams.FLAG_BLUR_BEHIND);
+        getWindow().setFlags(WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM,
+                WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM);
 
         setTitle(context.getText(R.string.power_dialog));
 
diff --git a/policy/com/android/internal/policy/impl/RecentApplicationsDialog.java b/policy/com/android/internal/policy/impl/RecentApplicationsDialog.java
index 0c4a7dc..5442dd4 100644
--- a/policy/com/android/internal/policy/impl/RecentApplicationsDialog.java
+++ b/policy/com/android/internal/policy/impl/RecentApplicationsDialog.java
@@ -78,7 +78,9 @@
         theWindow.requestFeature(Window.FEATURE_NO_TITLE);
         theWindow.setType(WindowManager.LayoutParams.TYPE_SYSTEM_DIALOG);
         theWindow.setFlags(WindowManager.LayoutParams.FLAG_BLUR_BEHIND,
-                           WindowManager.LayoutParams.FLAG_BLUR_BEHIND);
+                WindowManager.LayoutParams.FLAG_BLUR_BEHIND);
+        theWindow.setFlags(WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM,
+                WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM);
         
         setContentView(com.android.internal.R.layout.recent_apps_dialog);