diff options
author | Jorim Jaggi <jjaggi@google.com> | 2015-02-02 14:45:39 +0100 |
---|---|---|
committer | Jorim Jaggi <jjaggi@google.com> | 2015-02-02 20:18:26 +0100 |
commit | c1dff8cee8cf334906c1572cc3c50fbff96d1839 (patch) | |
tree | 37d9d879b72d57c2edd7c24d47cc36db4226b47b /packages/Keyguard | |
parent | dcce25a9a7fb3458f2fb65b23912b5f7eb42c596 (diff) | |
download | frameworks_base-c1dff8cee8cf334906c1572cc3c50fbff96d1839.zip frameworks_base-c1dff8cee8cf334906c1572cc3c50fbff96d1839.tar.gz frameworks_base-c1dff8cee8cf334906c1572cc3c50fbff96d1839.tar.bz2 |
Send accessibility event when bouncer is shown
Bug: 18996476
Change-Id: I0e402aa198263807e3013c7fb151f28d049ea51a
Diffstat (limited to 'packages/Keyguard')
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; } |