merge from open-source master

Change-Id: I627b3a7080e413f756d1751cdae88ec6642b02c4
diff --git a/core/java/android/text/method/PasswordTransformationMethod.java b/core/java/android/text/method/PasswordTransformationMethod.java
index fad4f64..b769b76 100644
--- a/core/java/android/text/method/PasswordTransformationMethod.java
+++ b/core/java/android/text/method/PasswordTransformationMethod.java
@@ -51,6 +51,8 @@
                 sp.removeSpan(vr[i]);
             }
 
+            removeVisibleSpans(sp);
+
             sp.setSpan(new ViewReference(view), 0, 0,
                        Spannable.SPAN_POINT_POINT);
         }
@@ -100,10 +102,7 @@
             int pref = TextKeyListener.getInstance().getPrefs(v.getContext());
             if ((pref & TextKeyListener.SHOW_PASSWORD) != 0) {
                 if (count > 0) {
-                    Visible[] old = sp.getSpans(0, sp.length(), Visible.class);
-                    for (int i = 0; i < old.length; i++) {
-                        sp.removeSpan(old[i]);
-                    }
+                    removeVisibleSpans(sp);
 
                     if (count == 1) {
                         sp.setSpan(new Visible(sp, this), start, start + count,
@@ -125,14 +124,18 @@
             if (sourceText instanceof Spannable) {
                 Spannable sp = (Spannable) sourceText;
 
-                Visible[] old = sp.getSpans(0, sp.length(), Visible.class);
-                for (int i = 0; i < old.length; i++) {
-                    sp.removeSpan(old[i]);
-                }
+                removeVisibleSpans(sp);
             }
         }
     }
 
+    private static void removeVisibleSpans(Spannable sp) {
+        Visible[] old = sp.getSpans(0, sp.length(), Visible.class);
+        for (int i = 0; i < old.length; i++) {
+            sp.removeSpan(old[i]);
+        }
+    }
+
     private static class PasswordCharSequence
     implements CharSequence, GetChars
     {
diff --git a/opengl/tests/gl_jni/jni/gl_code.cpp b/opengl/tests/gl_jni/jni/gl_code.cpp
index 33b25ab..f031c79 100644
--- a/opengl/tests/gl_jni/jni/gl_code.cpp
+++ b/opengl/tests/gl_jni/jni/gl_code.cpp
@@ -180,4 +180,5 @@
 JNIEXPORT void JNICALL Java_com_android_gljni_GLJNILib_changeBackground(JNIEnv * env, jobject obj)
 {
     background = 1.0f - background;
-}
\ No newline at end of file
+}
+