Loading packages/SystemUI/src/com/android/systemui/keyguard/KeyguardIndication.java +25 −2 Original line number Diff line number Diff line Loading @@ -32,6 +32,8 @@ import android.view.View; public class KeyguardIndication { @Nullable private final CharSequence mMessage; @Nullable private final boolean mForceAccessibilityLiveRegionAssertive; @NonNull private final ColorStateList mTextColor; @Nullable Loading @@ -49,13 +51,15 @@ public class KeyguardIndication { Drawable icon, View.OnClickListener onClickListener, Drawable background, Long minVisibilityMillis) { Long minVisibilityMillis, Boolean foceAssertive) { mMessage = message; mTextColor = textColor; mIcon = icon; mOnClickListener = onClickListener; mBackground = background; mMinVisibilityMillis = minVisibilityMillis; mForceAccessibilityLiveRegionAssertive = foceAssertive; } /** Loading Loading @@ -101,6 +105,15 @@ public class KeyguardIndication { return mMinVisibilityMillis; } /** * Whether to force the accessibility live region to be assertive. */ public boolean getForceAssertiveAccessibilityLiveRegion() { return mForceAccessibilityLiveRegionAssertive; } @Override public String toString() { String str = "KeyguardIndication{"; Loading @@ -109,6 +122,7 @@ public class KeyguardIndication { if (mOnClickListener != null) str += " mOnClickListener=" + mOnClickListener; if (mBackground != null) str += " mBackground=" + mBackground; if (mMinVisibilityMillis != null) str += " mMinVisibilityMillis=" + mMinVisibilityMillis; if (mForceAccessibilityLiveRegionAssertive) str += "mForceAccessibilityLiveRegionAssertive"; str += "}"; return str; } Loading @@ -123,6 +137,7 @@ public class KeyguardIndication { private ColorStateList mTextColor; private Drawable mBackground; private Long mMinVisibilityMillis; private boolean mForceAccessibilityLiveRegionAssertive; public Builder() { } Loading Loading @@ -177,6 +192,14 @@ public class KeyguardIndication { return this; } /** * Optional. Can force the accessibility live region to be assertive for this message. */ public Builder setForceAccessibilityLiveRegionAssertive() { this.mForceAccessibilityLiveRegionAssertive = true; return this; } /** * Build the KeyguardIndication. */ Loading @@ -190,7 +213,7 @@ public class KeyguardIndication { return new KeyguardIndication( mMessage, mTextColor, mIcon, mOnClickListener, mBackground, mMinVisibilityMillis); mMinVisibilityMillis, mForceAccessibilityLiveRegionAssertive); } } } packages/SystemUI/src/com/android/systemui/statusbar/KeyguardIndicationController.java +1 −0 Original line number Diff line number Diff line Loading @@ -633,6 +633,7 @@ public class KeyguardIndicationController { INDICATION_TYPE_BIOMETRIC_MESSAGE, new KeyguardIndication.Builder() .setMessage(mBiometricMessage) .setForceAccessibilityLiveRegionAssertive() .setMinVisibilityMillis(IMPORTANT_MSG_MIN_DURATION) .setTextColor(mInitialTextColorState) .build(), Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardIndicationTextView.java +9 −0 Original line number Diff line number Diff line Loading @@ -219,6 +219,7 @@ public class KeyguardIndicationTextView extends TextView { } private void setNextIndication() { boolean forceAssertiveAccessibilityLiveRegion = false; if (mKeyguardIndicationInfo != null) { // First, update the style. // If a background is set on the text, we don't want shadow on the text Loading @@ -239,8 +240,16 @@ public class KeyguardIndicationTextView extends TextView { } } setCompoundDrawablesRelativeWithIntrinsicBounds(icon, null, null, null); forceAssertiveAccessibilityLiveRegion = mKeyguardIndicationInfo.getForceAssertiveAccessibilityLiveRegion(); } if (!forceAssertiveAccessibilityLiveRegion) { setAccessibilityLiveRegion(ACCESSIBILITY_LIVE_REGION_NONE); } setText(mMessage); if (forceAssertiveAccessibilityLiveRegion) { setAccessibilityLiveRegion(ACCESSIBILITY_LIVE_REGION_ASSERTIVE); } if (mAlwaysAnnounceText) { announceForAccessibility(mMessage); } Loading Loading
packages/SystemUI/src/com/android/systemui/keyguard/KeyguardIndication.java +25 −2 Original line number Diff line number Diff line Loading @@ -32,6 +32,8 @@ import android.view.View; public class KeyguardIndication { @Nullable private final CharSequence mMessage; @Nullable private final boolean mForceAccessibilityLiveRegionAssertive; @NonNull private final ColorStateList mTextColor; @Nullable Loading @@ -49,13 +51,15 @@ public class KeyguardIndication { Drawable icon, View.OnClickListener onClickListener, Drawable background, Long minVisibilityMillis) { Long minVisibilityMillis, Boolean foceAssertive) { mMessage = message; mTextColor = textColor; mIcon = icon; mOnClickListener = onClickListener; mBackground = background; mMinVisibilityMillis = minVisibilityMillis; mForceAccessibilityLiveRegionAssertive = foceAssertive; } /** Loading Loading @@ -101,6 +105,15 @@ public class KeyguardIndication { return mMinVisibilityMillis; } /** * Whether to force the accessibility live region to be assertive. */ public boolean getForceAssertiveAccessibilityLiveRegion() { return mForceAccessibilityLiveRegionAssertive; } @Override public String toString() { String str = "KeyguardIndication{"; Loading @@ -109,6 +122,7 @@ public class KeyguardIndication { if (mOnClickListener != null) str += " mOnClickListener=" + mOnClickListener; if (mBackground != null) str += " mBackground=" + mBackground; if (mMinVisibilityMillis != null) str += " mMinVisibilityMillis=" + mMinVisibilityMillis; if (mForceAccessibilityLiveRegionAssertive) str += "mForceAccessibilityLiveRegionAssertive"; str += "}"; return str; } Loading @@ -123,6 +137,7 @@ public class KeyguardIndication { private ColorStateList mTextColor; private Drawable mBackground; private Long mMinVisibilityMillis; private boolean mForceAccessibilityLiveRegionAssertive; public Builder() { } Loading Loading @@ -177,6 +192,14 @@ public class KeyguardIndication { return this; } /** * Optional. Can force the accessibility live region to be assertive for this message. */ public Builder setForceAccessibilityLiveRegionAssertive() { this.mForceAccessibilityLiveRegionAssertive = true; return this; } /** * Build the KeyguardIndication. */ Loading @@ -190,7 +213,7 @@ public class KeyguardIndication { return new KeyguardIndication( mMessage, mTextColor, mIcon, mOnClickListener, mBackground, mMinVisibilityMillis); mMinVisibilityMillis, mForceAccessibilityLiveRegionAssertive); } } }
packages/SystemUI/src/com/android/systemui/statusbar/KeyguardIndicationController.java +1 −0 Original line number Diff line number Diff line Loading @@ -633,6 +633,7 @@ public class KeyguardIndicationController { INDICATION_TYPE_BIOMETRIC_MESSAGE, new KeyguardIndication.Builder() .setMessage(mBiometricMessage) .setForceAccessibilityLiveRegionAssertive() .setMinVisibilityMillis(IMPORTANT_MSG_MIN_DURATION) .setTextColor(mInitialTextColorState) .build(), Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardIndicationTextView.java +9 −0 Original line number Diff line number Diff line Loading @@ -219,6 +219,7 @@ public class KeyguardIndicationTextView extends TextView { } private void setNextIndication() { boolean forceAssertiveAccessibilityLiveRegion = false; if (mKeyguardIndicationInfo != null) { // First, update the style. // If a background is set on the text, we don't want shadow on the text Loading @@ -239,8 +240,16 @@ public class KeyguardIndicationTextView extends TextView { } } setCompoundDrawablesRelativeWithIntrinsicBounds(icon, null, null, null); forceAssertiveAccessibilityLiveRegion = mKeyguardIndicationInfo.getForceAssertiveAccessibilityLiveRegion(); } if (!forceAssertiveAccessibilityLiveRegion) { setAccessibilityLiveRegion(ACCESSIBILITY_LIVE_REGION_NONE); } setText(mMessage); if (forceAssertiveAccessibilityLiveRegion) { setAccessibilityLiveRegion(ACCESSIBILITY_LIVE_REGION_ASSERTIVE); } if (mAlwaysAnnounceText) { announceForAccessibility(mMessage); } Loading