Merge "Accessibility change when Trusted Face icon shows." into pi-dev
am: 3e169cac13
Change-Id: Idc4627e52ab370d1b5f5b5ec2bd6071ab0296e54
This commit is contained in:
@@ -240,6 +240,8 @@
|
|||||||
<string name="accessibility_waiting_for_fingerprint">Waiting for fingerprint</string>
|
<string name="accessibility_waiting_for_fingerprint">Waiting for fingerprint</string>
|
||||||
<!-- Accessibility action of the unlock button when fingerpint is on (not shown on the screen). [CHAR LIMIT=NONE] -->
|
<!-- Accessibility action of the unlock button when fingerpint is on (not shown on the screen). [CHAR LIMIT=NONE] -->
|
||||||
<string name="accessibility_unlock_without_fingerprint">Unlock without using your fingerprint</string>
|
<string name="accessibility_unlock_without_fingerprint">Unlock without using your fingerprint</string>
|
||||||
|
<!-- Content description of the Trusted Face icon for accessibility. [CHAR LIMIT=NONE] -->
|
||||||
|
<string name="accessibility_scanning_face">Scanning face</string>
|
||||||
<!-- Click action label for accessibility for the smart reply buttons (not shown on-screen).". [CHAR LIMIT=NONE] -->
|
<!-- Click action label for accessibility for the smart reply buttons (not shown on-screen).". [CHAR LIMIT=NONE] -->
|
||||||
<string name="accessibility_send_smart_reply">Send</string>
|
<string name="accessibility_send_smart_reply">Send</string>
|
||||||
<!-- Click action label for accessibility for the unlock button. [CHAR LIMIT=NONE] -->
|
<!-- Click action label for accessibility for the unlock button. [CHAR LIMIT=NONE] -->
|
||||||
|
|||||||
@@ -55,6 +55,7 @@ public class LockIcon extends KeyguardAffordanceView implements OnUserInfoChange
|
|||||||
private final UnlockMethodCache mUnlockMethodCache;
|
private final UnlockMethodCache mUnlockMethodCache;
|
||||||
private AccessibilityController mAccessibilityController;
|
private AccessibilityController mAccessibilityController;
|
||||||
private boolean mHasFingerPrintIcon;
|
private boolean mHasFingerPrintIcon;
|
||||||
|
private boolean mHasFaceUnlockIcon;
|
||||||
private int mDensity;
|
private int mDensity;
|
||||||
|
|
||||||
private final Runnable mDrawOffTimeout = () -> update(true /* forceUpdate */);
|
private final Runnable mDrawOffTimeout = () -> update(true /* forceUpdate */);
|
||||||
@@ -130,6 +131,7 @@ public class LockIcon extends KeyguardAffordanceView implements OnUserInfoChange
|
|||||||
}
|
}
|
||||||
int state = getState();
|
int state = getState();
|
||||||
boolean anyFingerprintIcon = state == STATE_FINGERPRINT || state == STATE_FINGERPRINT_ERROR;
|
boolean anyFingerprintIcon = state == STATE_FINGERPRINT || state == STATE_FINGERPRINT_ERROR;
|
||||||
|
mHasFaceUnlockIcon = state == STATE_FACE_UNLOCK;
|
||||||
boolean useAdditionalPadding = anyFingerprintIcon;
|
boolean useAdditionalPadding = anyFingerprintIcon;
|
||||||
boolean trustHidden = anyFingerprintIcon;
|
boolean trustHidden = anyFingerprintIcon;
|
||||||
if (state != mLastState || mDeviceInteractive != mLastDeviceInteractive
|
if (state != mLastState || mDeviceInteractive != mLastDeviceInteractive
|
||||||
@@ -179,6 +181,11 @@ public class LockIcon extends KeyguardAffordanceView implements OnUserInfoChange
|
|||||||
setRestingAlpha(
|
setRestingAlpha(
|
||||||
anyFingerprintIcon ? 1f : KeyguardAffordanceHelper.SWIPE_RESTING_ALPHA_AMOUNT);
|
anyFingerprintIcon ? 1f : KeyguardAffordanceHelper.SWIPE_RESTING_ALPHA_AMOUNT);
|
||||||
setImageDrawable(icon, false);
|
setImageDrawable(icon, false);
|
||||||
|
if (mHasFaceUnlockIcon) {
|
||||||
|
announceForAccessibility(getContext().getString(
|
||||||
|
R.string.accessibility_scanning_face));
|
||||||
|
}
|
||||||
|
|
||||||
mHasFingerPrintIcon = anyFingerprintIcon;
|
mHasFingerPrintIcon = anyFingerprintIcon;
|
||||||
if (animation != null && isAnim) {
|
if (animation != null && isAnim) {
|
||||||
animation.forceAnimationOnUI();
|
animation.forceAnimationOnUI();
|
||||||
@@ -228,6 +235,11 @@ public class LockIcon extends KeyguardAffordanceView implements OnUserInfoChange
|
|||||||
info.addAction(unlock);
|
info.addAction(unlock);
|
||||||
info.setHintText(getContext().getString(
|
info.setHintText(getContext().getString(
|
||||||
R.string.accessibility_waiting_for_fingerprint));
|
R.string.accessibility_waiting_for_fingerprint));
|
||||||
|
} else if (mHasFaceUnlockIcon){
|
||||||
|
//Avoid 'button' to be spoken for scanning face
|
||||||
|
info.setClassName(LockIcon.class.getName());
|
||||||
|
info.setContentDescription(getContext().getString(
|
||||||
|
R.string.accessibility_scanning_face));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user