Merge change 8216 into donut

* changes:
  Fixes #1994125. Ensures AbsListView's filter window is always dismissed.
diff --git a/core/java/android/app/SuggestionsAdapter.java b/core/java/android/app/SuggestionsAdapter.java
index 593b7b7..4cd35a4 100644
--- a/core/java/android/app/SuggestionsAdapter.java
+++ b/core/java/android/app/SuggestionsAdapter.java
@@ -27,6 +27,7 @@
 import android.database.Cursor;
 import android.graphics.drawable.ColorDrawable;
 import android.graphics.drawable.Drawable;
+import android.graphics.drawable.DrawableContainer;
 import android.graphics.drawable.StateListDrawable;
 import android.net.Uri;
 import android.os.Bundle;
@@ -359,6 +360,10 @@
             newBg.addState(new int[]{android.R.attr.state_selected}, transparent);
             newBg.addState(new int[]{android.R.attr.state_pressed}, transparent);
             newBg.addState(new int[]{}, background);
+            // Workaround for the fact that StateListDrawable.getPadding(Rect) always returns
+            // true, and thus sets the padding of any view that has it as a background.
+            ((DrawableContainer.DrawableContainerState) newBg.getConstantState())
+                    .setVariablePadding(true);
             mBackgroundsCache.put(backgroundColor, newBg.getConstantState());
             return newBg;
         }
diff --git a/core/java/android/server/search/SearchDialogWrapper.java b/core/java/android/server/search/SearchDialogWrapper.java
index d3ef5de..b8a9875 100644
--- a/core/java/android/server/search/SearchDialogWrapper.java
+++ b/core/java/android/server/search/SearchDialogWrapper.java
@@ -190,6 +190,9 @@
         msgData.putBundle(KEY_APP_SEARCH_DATA, appSearchData);
         msgData.putInt(KEY_IDENT, ident);
         mSearchUiThread.sendMessage(msg);
+        // be a little more eager in setting this so isVisible will return the correct value if
+        // called immediately after startSearch
+        mVisible = true;
     }
 
     /**
@@ -199,6 +202,9 @@
     public void stopSearch() {
         if (DBG) debug("stopSearch()");
         mSearchUiThread.sendEmptyMessage(MSG_STOP_SEARCH);
+        // be a little more eager in setting this so isVisible will return the correct value if
+        // called immediately after stopSearch
+        mVisible = false;
     }
 
     /**
diff --git a/core/java/android/widget/AutoCompleteTextView.java b/core/java/android/widget/AutoCompleteTextView.java
index 4bc00de..47798a4 100644
--- a/core/java/android/widget/AutoCompleteTextView.java
+++ b/core/java/android/widget/AutoCompleteTextView.java
@@ -205,11 +205,10 @@
      * Private hook into the on click event, dispatched from {@link PassThroughClickListener}
      */
     private void onClickImpl() {
-        // if drop down should always visible, bring it back in front of the soft
-        // keyboard when the user touches the text field
-        if (mDropDownAlwaysVisible
-                && mPopup.isShowing()
-                && mPopup.getInputMethodMode() == PopupWindow.INPUT_METHOD_NOT_NEEDED) {
+        // If the dropdown is showing, bring it back in front of the soft
+        // keyboard when the user touches the text field.
+        if (mPopup.isShowing() &&
+                mPopup.getInputMethodMode() == PopupWindow.INPUT_METHOD_NOT_NEEDED) {
             ensureImeVisible();
         }
     }
diff --git a/services/java/com/android/server/WifiService.java b/services/java/com/android/server/WifiService.java
index b4754b6..394ed3a 100644
--- a/services/java/com/android/server/WifiService.java
+++ b/services/java/com/android/server/WifiService.java
@@ -1075,6 +1075,17 @@
                 break setVariables;
             }
 
+            if ((config.phase2 != null) && !WifiNative.setNetworkVariableCommand(
+                    netId,
+                    WifiConfiguration.phase2VarName,
+                    config.phase2)) {
+                if (DBG) {
+                    Log.d(TAG, config.SSID + ": failed to set phase2: "+
+                          config.phase2);
+                }
+                break setVariables;
+            }
+
             if ((config.identity != null) && !WifiNative.setNetworkVariableCommand(
                     netId,
                     WifiConfiguration.identityVarName,
diff --git a/wifi/java/android/net/wifi/WifiConfiguration.java b/wifi/java/android/net/wifi/WifiConfiguration.java
index eda2f2d..f85aadd 100644
--- a/wifi/java/android/net/wifi/WifiConfiguration.java
+++ b/wifi/java/android/net/wifi/WifiConfiguration.java
@@ -45,6 +45,8 @@
     /** {@hide} */
     public static final String eapVarName = "eap";
     /** {@hide} */
+    public static final String phase2VarName = "phase2";
+    /** {@hide} */
     public static final String identityVarName = "identity";
     /** {@hide} */
     public static final String anonymousIdentityVarName = "anonymous_identity";
@@ -273,6 +275,11 @@
      */
     public String eap;
     /**
+     * The phase2 authenication could be PAP, MSCHAP, MSCHAP2, GTC.
+     * {@hide}
+     */
+    public String phase2;
+    /**
      * The identity of the user in string,
      * which is used for the authentication.
      * {@hide}
@@ -314,6 +321,7 @@
         for (int i = 0; i < wepKeys.length; i++)
             wepKeys[i] = null;
         eap = null;
+        phase2 = null;
         identity = null;
         anonymousIdentity = null;
         password = null;
@@ -399,6 +407,10 @@
         if (this.eap != null) {
             sbuf.append(eap);
         }
+        sbuf.append('\n').append(" phase2: ");
+        if (this.phase2 != null) {
+            sbuf.append(phase2);
+        }
         sbuf.append('\n').append(" Identity: ");
         if (this.identity != null) {
             sbuf.append(identity);
@@ -486,6 +498,7 @@
         writeBitSet(dest, allowedPairwiseCiphers);
         writeBitSet(dest, allowedGroupCiphers);
         dest.writeString(eap);
+        dest.writeString(phase2);
         dest.writeString(identity);
         dest.writeString(anonymousIdentity);
         dest.writeString(password);
@@ -516,6 +529,7 @@
                 config.allowedPairwiseCiphers = readBitSet(in);
                 config.allowedGroupCiphers    = readBitSet(in);
                 config.eap = in.readString();
+                config.phase2 = in.readString();
                 config.identity = in.readString();
                 config.anonymousIdentity = in.readString();
                 config.password = in.readString();