am fe86e979: am 661b6cfb: Merge "Okay, new plan for dialogs." into honeycomb

* commit 'fe86e9793ce62c6a1aa34e5712f16b45800efdd0':
  Okay, new plan for dialogs.
diff --git a/core/java/android/view/Window.java b/core/java/android/view/Window.java
index 04dff8b..2095a93 100644
--- a/core/java/android/view/Window.java
+++ b/core/java/android/view/Window.java
@@ -807,8 +807,11 @@
     }
     
     /** @hide */
-    public boolean hasSetCloseOnTouchOutside() {
-        return mSetCloseOnTouchOutside;
+    public void setCloseOnTouchOutsideIfNotSet(boolean close) {
+        if (!mSetCloseOnTouchOutside) {
+            mCloseOnTouchOutside = close;
+            mSetCloseOnTouchOutside = true;
+        }
     }
     
     /** @hide */
diff --git a/core/java/com/android/internal/app/AlertController.java b/core/java/com/android/internal/app/AlertController.java
index a139d31..71a7a52 100644
--- a/core/java/com/android/internal/app/AlertController.java
+++ b/core/java/com/android/internal/app/AlertController.java
@@ -391,6 +391,7 @@
         View buttonPanel = mWindow.findViewById(R.id.buttonPanel);
         if (!hasButtons) {
             buttonPanel.setVisibility(View.GONE);
+            mWindow.setCloseOnTouchOutsideIfNotSet(true);
         }
 
         FrameLayout customPanel = null;
diff --git a/core/java/com/android/internal/app/ChooserActivity.java b/core/java/com/android/internal/app/ChooserActivity.java
index 9ed4dd8..38ac37d 100644
--- a/core/java/com/android/internal/app/ChooserActivity.java
+++ b/core/java/com/android/internal/app/ChooserActivity.java
@@ -17,7 +17,6 @@
 package com.android.internal.app;
 
 import android.content.Intent;
-import android.content.pm.ResolveInfo;
 import android.os.Bundle;
 import android.os.Parcelable;
 import android.util.Log;
diff --git a/core/res/res/values-large/config.xml b/core/res/res/values-large/config.xml
index 4449fd0..05dd050 100644
--- a/core/res/res/values-large/config.xml
+++ b/core/res/res/values-large/config.xml
@@ -22,6 +22,4 @@
 <resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
     <!-- see comment in values/config.xml -->
     <dimen name="config_prefDialogWidth">440dp</dimen>
-    <!-- see comment in values/config.xml -->
-    <bool name="config_closeDialogWhenTouchOutside">true</bool>
 </resources>
diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml
index 552c2f7..e0c26d4 100644
--- a/core/res/res/values/config.xml
+++ b/core/res/res/values/config.xml
@@ -82,8 +82,7 @@
     <dimen name="config_prefDialogWidth">0px</dimen>
     
     <!-- Whether dialogs should close automatically when the user touches outside
-         of them.  This should not normally be modified; the default value will
-         pick the correct behavior depending on the screen size. -->
+         of them.  This should not normally be modified. -->
     <bool name="config_closeDialogWhenTouchOutside">false</bool>
     
     <!-- The duration (in milliseconds) that the radio will scan for a signal
diff --git a/policy/src/com/android/internal/policy/impl/PhoneWindow.java b/policy/src/com/android/internal/policy/impl/PhoneWindow.java
index 3cb6f75..546c7c3 100644
--- a/policy/src/com/android/internal/policy/impl/PhoneWindow.java
+++ b/policy/src/com/android/internal/policy/impl/PhoneWindow.java
@@ -2347,12 +2347,10 @@
         
         if (mAlwaysReadCloseOnTouchAttr || getContext().getApplicationInfo().targetSdkVersion
                 >= android.os.Build.VERSION_CODES.HONEYCOMB) {
-            if (!hasSetCloseOnTouchOutside()) {
-                if (a.getBoolean(
-                        com.android.internal.R.styleable.Window_windowCloseOnTouchOutside,
-                        false)) {
-                    setCloseOnTouchOutside(true);
-                }
+            if (a.getBoolean(
+                    com.android.internal.R.styleable.Window_windowCloseOnTouchOutside,
+                    false)) {
+                setCloseOnTouchOutsideIfNotSet(true);
             }
         }