diff options
author | Jorim Jaggi <jjaggi@google.com> | 2015-02-02 20:45:32 +0100 |
---|---|---|
committer | Jorim Jaggi <jjaggi@google.com> | 2015-02-02 20:45:32 +0100 |
commit | 10c85c76a9110f2b09f71d9a830b593058e3ef4e (patch) | |
tree | 243a572d242cd737ceac8f7e66828b81f8b5d28a /packages/Keyguard | |
parent | 462c9f50c3e52fb62287830056d5b1346120a233 (diff) | |
parent | 83eaf6cc8c94e0b503a1326229fb8200b9e27461 (diff) | |
download | frameworks_base-10c85c76a9110f2b09f71d9a830b593058e3ef4e.zip frameworks_base-10c85c76a9110f2b09f71d9a830b593058e3ef4e.tar.gz frameworks_base-10c85c76a9110f2b09f71d9a830b593058e3ef4e.tar.bz2 |
Merge commit '83eaf6cc' into HEAD
Change-Id: I13918ee8116ac17169910a1414de913bcc2d184e
Diffstat (limited to 'packages/Keyguard')
3 files changed, 22 insertions, 1 deletions
diff --git a/packages/Keyguard/res/layout/keyguard_host_view.xml b/packages/Keyguard/res/layout/keyguard_host_view.xml index 3635aff..7291cd4 100644 --- a/packages/Keyguard/res/layout/keyguard_host_view.xml +++ b/packages/Keyguard/res/layout/keyguard_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/KeyguardHostView.java b/packages/Keyguard/src/com/android/keyguard/KeyguardHostView.java index c7bc04d..08f6991 100644 --- a/packages/Keyguard/src/com/android/keyguard/KeyguardHostView.java +++ b/packages/Keyguard/src/com/android/keyguard/KeyguardHostView.java @@ -29,6 +29,7 @@ import android.util.AttributeSet; import android.util.Log; import android.view.KeyEvent; import android.view.MotionEvent; +import android.view.accessibility.AccessibilityEvent; import android.widget.FrameLayout; import com.android.internal.widget.LockPatternUtils; @@ -153,6 +154,16 @@ public class KeyguardHostView extends FrameLayout implements SecurityCallback { return false; } + @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/Keyguard/src/com/android/keyguard/KeyguardSecurityContainer.java b/packages/Keyguard/src/com/android/keyguard/KeyguardSecurityContainer.java index 61eef48..fb4f480 100644 --- a/packages/Keyguard/src/com/android/keyguard/KeyguardSecurityContainer.java +++ b/packages/Keyguard/src/com/android/keyguard/KeyguardSecurityContainer.java @@ -111,6 +111,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; |