summaryrefslogtreecommitdiffstats
path: root/packages/Keyguard
diff options
context:
space:
mode:
authorJorim Jaggi <jjaggi@google.com>2015-02-02 19:25:34 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2015-02-02 19:25:34 +0000
commit2ffb3400f7922aba597b61cea91b82bcfc3d7e7d (patch)
treedff14dc219a02d67878c9ba39edb4ac7793d6b66 /packages/Keyguard
parent235f60bc134646d1ce18ab872b982ff63b14845e (diff)
parent515148dcaaf5b63e69998d67958829d4347071ec (diff)
downloadframeworks_base-2ffb3400f7922aba597b61cea91b82bcfc3d7e7d.zip
frameworks_base-2ffb3400f7922aba597b61cea91b82bcfc3d7e7d.tar.gz
frameworks_base-2ffb3400f7922aba597b61cea91b82bcfc3d7e7d.tar.bz2
am 515148dc: Merge "Send accessibility event when bouncer is shown" into lmp-mr1-dev
* commit '515148dcaaf5b63e69998d67958829d4347071ec': Send accessibility event when bouncer is shown
Diffstat (limited to 'packages/Keyguard')
-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
3 files changed, 22 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 28ce265..63e55d5 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 faecaed..559b112 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 e1e1cfc..fc17909 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;
}