Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4df6113a authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge changes I255c033f,I4269b194 into sc-dev am: 357a7d7b

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14505937

Change-Id: I76cd7fe79c4f268f224e65e20e3efbe1837c6762
parents c88b324f 357a7d7b
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -95,6 +95,7 @@
        android:background="@drawable/wallet_lockscreen_bg"
        android:layout_marginEnd="@dimen/keyguard_affordance_horizontal_offset"
        android:layout_marginBottom="@dimen/keyguard_affordance_vertical_offset"
        android:contentDescription="@string/accessibility_wallet_button"
        android:visibility="gone" />

    <FrameLayout
+5 −1
Original line number Diff line number Diff line
@@ -336,6 +336,8 @@
    <string name="accessibility_phone_button">Phone</string>
    <!-- Content description of the phone button for accessibility (not shown on the screen). [CHAR LIMIT=NONE] -->
    <string name="accessibility_voice_assist_button">Voice Assist</string>
    <!-- Content description of the wallet button for accessibility (not shown on the screen). [CHAR LIMIT=NONE] -->
    <string name="accessibility_wallet_button">Wallet</string>
    <!-- Content description of the unlock button for accessibility (not shown on the screen). [CHAR LIMIT=NONE] -->
    <string name="accessibility_unlock_button">Unlock</string>
    <!-- Content description of the lock icon for accessibility (not shown on the screen). [CHAR LIMIT=NONE] -->
@@ -2965,8 +2967,10 @@
    <!-- Accessibility action for tapping on an affordance on an unlocked lock screen (ie: "Double
     tap to enter device") [CHAR LIMIT=NONE] -->
    <string name="accessibility_enter_hint">enter device</string>
    <!-- Message shown to suggest authentication using [CHAR LIMIT=60]-->
    <!-- Message shown to suggest authentication using fingerprint [CHAR LIMIT=60]-->
    <string name="keyguard_try_fingerprint">Use fingerprint to open</string>
    <!-- Accessibility announcement to inform user to unlock using the fingerprint sensor [CHAR LIMIT=NONE] -->
    <string name="accessibility_fingerprint_bouncer">Authentication required. Touch the fingerprint sensor to authenticate.</string>

    <!-- Content description for a chip in the status bar showing that the user is currently on a phone call. [CHAR LIMIT=NONE] -->
    <string name="ongoing_phone_call_content_description">Ongoing phone call</string>
+17 −14
Original line number Diff line number Diff line
@@ -50,6 +50,7 @@ import com.android.systemui.util.ViewController;

import java.io.FileDescriptor;
import java.io.PrintWriter;
import java.util.Objects;

import javax.inject.Inject;

@@ -75,6 +76,9 @@ public class LockIconViewController extends ViewController<LockIconView> impleme
    @NonNull private final Drawable mButton;
    @NonNull private final Drawable mUnlockIcon;
    @NonNull private final Drawable mLockIcon;
    @NonNull private final CharSequence mDisabledLabel;
    @NonNull private final CharSequence mUnlockedLabel;
    @NonNull private final CharSequence mLockedLabel;

    private boolean mIsDozing;
    private boolean mIsBouncerShowing;
@@ -121,6 +125,10 @@ public class LockIconViewController extends ViewController<LockIconView> impleme
                com.android.internal.R.drawable.ic_lock, context.getTheme()),
                context.getResources().getDimensionPixelSize(
                        com.android.systemui.R.dimen.udfps_unlock_icon_inset));
        mDisabledLabel = context.getResources().getString(
                R.string.accessibility_udfps_disabled_button);
        mUnlockedLabel = context.getResources().getString(R.string.accessibility_unlock_button);
        mLockedLabel = context.getResources().getString(R.string.accessibility_lock_icon);
        dumpManager.registerDumpable("LockIconViewController", this);
    }

@@ -225,25 +233,27 @@ public class LockIconViewController extends ViewController<LockIconView> impleme
            && mFaceAuthEnrolled;

        updateClickListener();
        final CharSequence prevContentDescription = mView.getContentDescription();
        if (mShowButton) {
            mView.setImageDrawable(mButton);
            mView.setVisibility(View.VISIBLE);
            mView.setContentDescription(getResources().getString(
                    R.string.accessibility_udfps_disabled_button));
            mView.setContentDescription(mDisabledLabel);
        } else if (mShowUnlockIcon) {
            mView.setImageDrawable(mUnlockIcon);
            mView.setVisibility(View.VISIBLE);
            mView.setContentDescription(getResources().getString(
                    R.string.accessibility_unlock_button));
            mView.setContentDescription(mUnlockedLabel);
        } else if (mShowLockIcon) {
            mView.setImageDrawable(mLockIcon);
            mView.setVisibility(View.VISIBLE);
            mView.setContentDescription(getResources().getString(
                    R.string.accessibility_lock_icon));
            mView.setContentDescription(mLockedLabel);
        } else {
            mView.setVisibility(View.INVISIBLE);
            mView.setContentDescription(null);
        }
        if (!Objects.equals(prevContentDescription, mView.getContentDescription())
                && mView.getContentDescription() != null) {
            mView.announceForAccessibility(mView.getContentDescription());
        }
    }

    private final View.AccessibilityDelegate mAccessibilityDelegate =
@@ -258,20 +268,12 @@ public class LockIconViewController extends ViewController<LockIconView> impleme
                        getResources().getString(R.string.accessibility_enter_hint));
        public void onInitializeAccessibilityNodeInfo(View v, AccessibilityNodeInfo info) {
            super.onInitializeAccessibilityNodeInfo(v, info);
            removeAllActions(info);
            if (mShowButton || mShowLockIcon) {
                info.addAction(mAccessibilityAuthenticateHint);
            } else if (mShowUnlockIcon) {
                info.addAction(mAccessibilityEnterHint);
            }
        }

        private void removeAllActions(AccessibilityNodeInfo info) {
            info.removeAction(mAccessibilityAuthenticateHint);
            info.removeAction(mAccessibilityEnterHint);
            info.removeAction(AccessibilityNodeInfo.AccessibilityAction.ACTION_LONG_CLICK);
            mView.setLongClickable(false);
        }
    };

    private boolean isLockScreen() {
@@ -286,6 +288,7 @@ public class LockIconViewController extends ViewController<LockIconView> impleme
            mView.setOnClickListener(v -> onAffordanceClick());
            if (mAccessibilityManager.isTouchExplorationEnabled()) {
                mView.setOnLongClickListener(null);
                mView.setLongClickable(false);
            } else {
                mView.setOnLongClickListener(v -> onAffordanceClick());
            }
+3 −1
Original line number Diff line number Diff line
@@ -338,7 +338,7 @@ public class UdfpsController implements DozeReceiver {
        switch (event.getActionMasked()) {
            case MotionEvent.ACTION_OUTSIDE:
                udfpsView.onTouchOutsideView();
                break;
                return true;
            case MotionEvent.ACTION_DOWN:
            case MotionEvent.ACTION_HOVER_ENTER:
                // To simplify the lifecycle of the velocity tracker, make sure it's never null
@@ -602,6 +602,8 @@ public class UdfpsController implements DozeReceiver {
            default:
                // Do nothing to stay in portrait mode.
        }
        // avoid announcing window title
        mCoreLayoutParams.accessibilityTitle = " ";
        return mCoreLayoutParams;
    }

+3 −0
Original line number Diff line number Diff line
@@ -27,6 +27,7 @@ import androidx.annotation.Nullable;

import com.android.keyguard.KeyguardUpdateMonitor;
import com.android.keyguard.KeyguardUpdateMonitorCallback;
import com.android.systemui.R;
import com.android.systemui.dump.DumpManager;
import com.android.systemui.keyguard.KeyguardViewMediator;
import com.android.systemui.plugins.statusbar.StatusBarStateController;
@@ -165,6 +166,8 @@ public class UdfpsKeyguardViewController extends UdfpsAnimationViewController<Ud
        updatePauseAuth();
        if (mShowingUdfpsBouncer) {
            mView.animateUdfpsBouncer();
            mView.announceForAccessibility(mView.getContext().getString(
                    R.string.accessibility_fingerprint_bouncer));
        } else {
            mView.animateAwayUdfpsBouncer(() -> mKeyguardViewManager.cancelPostAuthActions());
        }
Loading