From baef32faa544ac60de6bda527a9ec343f068f5a0 Mon Sep 17 00:00:00 2001 From: Jorim Jaggi Date: Thu, 21 Aug 2014 14:51:58 +0200 Subject: Content description for padlock icon depending on state Bug: 15694090 Change-Id: I340b67f2036bd4b29388f437ab5bac1f1aabb93e --- packages/SystemUI/res/layout/keyguard_bottom_area.xml | 2 +- packages/SystemUI/res/values/strings.xml | 13 +++++++++++-- .../systemui/statusbar/phone/KeyguardBottomAreaView.java | 13 +++++++++++-- 3 files changed, 23 insertions(+), 5 deletions(-) diff --git a/packages/SystemUI/res/layout/keyguard_bottom_area.xml b/packages/SystemUI/res/layout/keyguard_bottom_area.xml index ca07c87..ef0c9bb 100644 --- a/packages/SystemUI/res/layout/keyguard_bottom_area.xml +++ b/packages/SystemUI/res/layout/keyguard_bottom_area.xml @@ -67,6 +67,6 @@ android:src="@drawable/ic_lock_24dp" android:scaleType="center" android:tint="#ffffffff" - android:contentDescription="@string/accessibility_unlock_button" /> + android:contentDescription="@string/accessibility_unlock_button_not_secured" /> diff --git a/packages/SystemUI/res/values/strings.xml b/packages/SystemUI/res/values/strings.xml index 8f05f7b..9ff67bb 100644 --- a/packages/SystemUI/res/values/strings.xml +++ b/packages/SystemUI/res/values/strings.xml @@ -213,8 +213,6 @@ Camera Phone - - Unlock unlock @@ -222,6 +220,17 @@ open camera + + Device secured. + + Device not secured. + + Device secured, trust agent active. + + Device not secured, trust agent active. + + Face detection running, trust agent active. + Switch input method button. diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java index 44d8d23..cb2d40a 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java @@ -377,11 +377,20 @@ public class KeyguardBottomAreaView extends FrameLayout implements View.OnClickL boolean trustManaged = mUnlockMethodCache.isTrustManaged(); mTrustDrawable.setTrustManaged(trustManaged); - // TODO: Update content description depending on state updateLockIconClickability(); + updateLockIconContentDescription(mUnlockMethodCache.isFaceUnlockRunning(), + mUnlockMethodCache.isMethodInsecure(), trustManaged); } - + private void updateLockIconContentDescription(boolean faceUnlockRunning, boolean insecure, + boolean trustManaged) { + mLockIcon.setContentDescription(getResources().getString( + faceUnlockRunning ? R.string.accessibility_unlock_button_face_unlock_running + : insecure && !trustManaged ? R.string.accessibility_unlock_button_not_secured + : insecure ? R.string.accessibility_unlock_button_not_secured_trust_managed + : !trustManaged ? R.string.accessibility_unlock_button_secured + : R.string.accessibility_unlock_button_secured_trust_managed)); + } public KeyguardAffordanceView getPhoneView() { return mPhoneImageView; -- cgit v1.1