Various fixes and improvements to window, activity.

- New meta-data you can add to a dock activity to have it launched by the
  home key when the device is in that dock.

- Fix a deadlock involving ActivityThread's internal content provider lock.

- New window flag to have a non-secure keyguard entirely dismissed when a
  window is displayed.

- New WindowManagerPolicy APIs to allow the policy to tell the system when
  a change it makes during layout may cause the wall paper or
  overall configuration to change.

- Fix a bug where an application token removed while one of its windows is
  animating could cause the animating window to get stuck on screen.

Change-Id: I6d33fd39edd796bb9bdfd9dd7e077b84ca62ea08
diff --git a/core/java/android/content/Intent.java b/core/java/android/content/Intent.java
index f6ca50d..5fb5768 100644
--- a/core/java/android/content/Intent.java
+++ b/core/java/android/content/Intent.java
@@ -1885,7 +1885,7 @@
             "android.intent.category.FRAMEWORK_INSTRUMENTATION_TEST";
     /**
      * An activity to run when device is inserted into a car dock.
-    * Used with {@link #ACTION_MAIN} to launch an activity.
+     * Used with {@link #ACTION_MAIN} to launch an activity.
      * To monitor dock state, use {@link #ACTION_DOCK_EVENT} instead.
      */
     @SdkConstant(SdkConstantType.INTENT_CATEGORY)
@@ -2056,6 +2056,12 @@
     public static final int EXTRA_DOCK_STATE_CAR = 2;
 
     /**
+     * Boolean that can be supplied as meta-data with a dock activity, to
+     * indicate that the dock should take over the home key when it is active.
+     */
+    public static final String METADATA_DOCK_HOME = "android.dock_home";
+    
+    /**
      * Used as a parcelable extra field in {@link #ACTION_APP_ERROR}, containing
      * the bug report.
      *
@@ -3605,7 +3611,7 @@
             }
         } else {
             ResolveInfo info = pm.resolveActivity(
-                this, PackageManager.MATCH_DEFAULT_ONLY);
+                this, PackageManager.MATCH_DEFAULT_ONLY | flags);
             if (info != null) {
                 ai = info.activityInfo;
             }