summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Jorim Jaggi <jjaggi@google.com> 2015-02-02 19:30:34 +0000
committer android-build-merger <android-build-merger@google.com> 2015-02-02 19:30:34 +0000
commit83eaf6cc8c94e0b503a1326229fb8200b9e27461 (patch)
treec109b9fd879c8833f1d341382ba7d2d03868c640
parent21475c6a92b893f5d078ba23f06f0be6edaaacbd (diff)
parent2ffb3400f7922aba597b61cea91b82bcfc3d7e7d (diff)
am 515148dc: Merge "Send accessibility event when bouncer is shown" into lmp-mr1-dev
automerge: 2ffb340 * commit '2ffb3400f7922aba597b61cea91b82bcfc3d7e7d': Send accessibility event when bouncer is shown
-rw-r--r--packages/Keyguard/res/layout/keyguard_simple_host_view.xml4
-rw-r--r--packages/Keyguard/src/com/android/keyguard/KeyguardSecurityContainer.java8
-rw-r--r--packages/Keyguard/src/com/android/keyguard/KeyguardViewBase.java11
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java2
4 files changed, 24 insertions, 1 deletions
diff --git a/packages/Keyguard/res/layout/keyguard_simple_host_view.xml b/packages/Keyguard/res/layout/keyguard_simple_host_view.xml
index 28ce26509f0c..63e55d59bf2e 100644
--- a/packages/Keyguard/res/layout/keyguard_simple_host_view.xml
+++ b/packages/Keyguard/res/layout/keyguard_simple_host_view.xml
@@ -26,7 +26,9 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clipChildren="false"
- android:clipToPadding="false">
+ android:clipToPadding="false"
+ android:importantForAccessibility="yes"> <!-- Needed because TYPE_WINDOW_STATE_CHANGED is sent
+ from this view when bouncer is shown -->
<com.android.keyguard.KeyguardSecurityContainer
android:id="@+id/keyguard_security_container"
diff --git a/packages/Keyguard/src/com/android/keyguard/KeyguardSecurityContainer.java b/packages/Keyguard/src/com/android/keyguard/KeyguardSecurityContainer.java
index faecaed648f4..559b112f206f 100644
--- a/packages/Keyguard/src/com/android/keyguard/KeyguardSecurityContainer.java
+++ b/packages/Keyguard/src/com/android/keyguard/KeyguardSecurityContainer.java
@@ -121,6 +121,14 @@ public class KeyguardSecurityContainer extends FrameLayout implements KeyguardSe
}
}
+ public CharSequence getCurrentSecurityModeContentDescription() {
+ View v = (View) getSecurityView(mCurrentSecuritySelection);
+ if (v != null) {
+ return v.getContentDescription();
+ }
+ return "";
+ }
+
private KeyguardSecurityView getSecurityView(SecurityMode securityMode) {
final int securityViewIdForMode = getSecurityViewIdForMode(securityMode);
KeyguardSecurityView view = null;
diff --git a/packages/Keyguard/src/com/android/keyguard/KeyguardViewBase.java b/packages/Keyguard/src/com/android/keyguard/KeyguardViewBase.java
index e1e1cfcb9e3e..fc179094d6cb 100644
--- a/packages/Keyguard/src/com/android/keyguard/KeyguardViewBase.java
+++ b/packages/Keyguard/src/com/android/keyguard/KeyguardViewBase.java
@@ -38,6 +38,7 @@ import android.util.Slog;
import android.view.KeyEvent;
import android.view.MotionEvent;
import android.view.View;
+import android.view.accessibility.AccessibilityEvent;
import android.widget.FrameLayout;
import com.android.internal.widget.LockPatternUtils;
@@ -151,6 +152,16 @@ public abstract class KeyguardViewBase extends FrameLayout implements SecurityCa
mSecurityContainer.announceCurrentSecurityMethod();
}
+ @Override
+ public boolean dispatchPopulateAccessibilityEvent(AccessibilityEvent event) {
+ if (event.getEventType() == AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED) {
+ event.getText().add(mSecurityContainer.getCurrentSecurityModeContentDescription());
+ return true;
+ } else {
+ return super.dispatchPopulateAccessibilityEvent(event);
+ }
+ }
+
protected KeyguardSecurityContainer getSecurityContainer() {
return mSecurityContainer;
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
index 5bc13211b69b..d0fe32eb7232 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
@@ -22,6 +22,7 @@ import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
+import android.view.accessibility.AccessibilityEvent;
import com.android.internal.widget.LockPatternUtils;
import com.android.keyguard.KeyguardViewBase;
@@ -86,6 +87,7 @@ public class KeyguardBouncer {
mKeyguardView.onResume();
mKeyguardView.startAppearAnimation();
mShowingSoon = false;
+ mKeyguardView.sendAccessibilityEvent(AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED);
}
};