summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJorim Jaggi <jjaggi@google.com>2015-02-02 20:45:32 +0100
committerJorim Jaggi <jjaggi@google.com>2015-02-02 20:45:32 +0100
commit10c85c76a9110f2b09f71d9a830b593058e3ef4e (patch)
tree243a572d242cd737ceac8f7e66828b81f8b5d28a
parent462c9f50c3e52fb62287830056d5b1346120a233 (diff)
parent83eaf6cc8c94e0b503a1326229fb8200b9e27461 (diff)
downloadframeworks_base-10c85c76a9110f2b09f71d9a830b593058e3ef4e.zip
frameworks_base-10c85c76a9110f2b09f71d9a830b593058e3ef4e.tar.gz
frameworks_base-10c85c76a9110f2b09f71d9a830b593058e3ef4e.tar.bz2
Merge commit '83eaf6cc' into HEAD
Change-Id: I13918ee8116ac17169910a1414de913bcc2d184e
-rw-r--r--packages/Keyguard/res/layout/keyguard_host_view.xml4
-rw-r--r--packages/Keyguard/src/com/android/keyguard/KeyguardHostView.java11
-rw-r--r--packages/Keyguard/src/com/android/keyguard/KeyguardSecurityContainer.java8
-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_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;
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 fc4d7fe..262d955 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.KeyguardHostView;
@@ -85,6 +86,7 @@ public class KeyguardBouncer {
mKeyguardView.onResume();
mKeyguardView.startAppearAnimation();
mShowingSoon = false;
+ mKeyguardView.sendAccessibilityEvent(AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED);
}
};