Merge changes I9761c313,I25dacbfa into sc-dev am: f7b45b69e5
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14537656 Change-Id: Ic11a2482f6f0a9c5b7147dadfbbf81a71a2e6322
This commit is contained in:
@@ -630,6 +630,14 @@ public class UdfpsController implements DozeReceiver {
|
|||||||
animation.init();
|
animation.init();
|
||||||
mView.setAnimationViewController(animation);
|
mView.setAnimationViewController(animation);
|
||||||
|
|
||||||
|
// This view overlaps the sensor area, so prevent it from being selectable
|
||||||
|
// during a11y.
|
||||||
|
if (reason == IUdfpsOverlayController.REASON_ENROLL_FIND_SENSOR
|
||||||
|
|| reason == IUdfpsOverlayController.REASON_ENROLL_ENROLLING) {
|
||||||
|
mView.setImportantForAccessibility(
|
||||||
|
View.IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS);
|
||||||
|
}
|
||||||
|
|
||||||
mWindowManager.addView(mView, computeLayoutParams(animation));
|
mWindowManager.addView(mView, computeLayoutParams(animation));
|
||||||
mAccessibilityManager.addTouchExplorationStateChangeListener(
|
mAccessibilityManager.addTouchExplorationStateChangeListener(
|
||||||
mTouchExplorationStateChangeListener);
|
mTouchExplorationStateChangeListener);
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ import android.os.UserHandle;
|
|||||||
import android.provider.Settings;
|
import android.provider.Settings;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.util.TypedValue;
|
import android.util.TypedValue;
|
||||||
|
import android.view.accessibility.AccessibilityManager;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -53,6 +54,7 @@ public class UdfpsEnrollHelper {
|
|||||||
@NonNull private final Context mContext;
|
@NonNull private final Context mContext;
|
||||||
// IUdfpsOverlayController reason
|
// IUdfpsOverlayController reason
|
||||||
private final int mEnrollReason;
|
private final int mEnrollReason;
|
||||||
|
private final boolean mAccessibilityEnabled;
|
||||||
@NonNull private final List<PointF> mGuidedEnrollmentPoints;
|
@NonNull private final List<PointF> mGuidedEnrollmentPoints;
|
||||||
|
|
||||||
private int mTotalSteps = -1;
|
private int mTotalSteps = -1;
|
||||||
@@ -67,6 +69,10 @@ public class UdfpsEnrollHelper {
|
|||||||
public UdfpsEnrollHelper(@NonNull Context context, int reason) {
|
public UdfpsEnrollHelper(@NonNull Context context, int reason) {
|
||||||
mContext = context;
|
mContext = context;
|
||||||
mEnrollReason = reason;
|
mEnrollReason = reason;
|
||||||
|
|
||||||
|
final AccessibilityManager am = context.getSystemService(AccessibilityManager.class);
|
||||||
|
mAccessibilityEnabled = am.isEnabled();
|
||||||
|
|
||||||
mGuidedEnrollmentPoints = new ArrayList<>();
|
mGuidedEnrollmentPoints = new ArrayList<>();
|
||||||
|
|
||||||
// Number of pixels per mm
|
// Number of pixels per mm
|
||||||
@@ -148,6 +154,8 @@ public class UdfpsEnrollHelper {
|
|||||||
boolean isCenterEnrollmentComplete() {
|
boolean isCenterEnrollmentComplete() {
|
||||||
if (mTotalSteps == -1 || mRemainingSteps == -1) {
|
if (mTotalSteps == -1 || mRemainingSteps == -1) {
|
||||||
return false;
|
return false;
|
||||||
|
} else if (mAccessibilityEnabled) {
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
final int stepsEnrolled = mTotalSteps - mRemainingSteps;
|
final int stepsEnrolled = mTotalSteps - mRemainingSteps;
|
||||||
return stepsEnrolled >= NUM_CENTER_TOUCHES;
|
return stepsEnrolled >= NUM_CENTER_TOUCHES;
|
||||||
@@ -155,6 +163,10 @@ public class UdfpsEnrollHelper {
|
|||||||
|
|
||||||
@NonNull
|
@NonNull
|
||||||
PointF getNextGuidedEnrollmentPoint() {
|
PointF getNextGuidedEnrollmentPoint() {
|
||||||
|
if (mAccessibilityEnabled) {
|
||||||
|
return new PointF(0f, 0f);
|
||||||
|
}
|
||||||
|
|
||||||
float scale = SCALE;
|
float scale = SCALE;
|
||||||
if (Build.IS_ENG || Build.IS_USERDEBUG) {
|
if (Build.IS_ENG || Build.IS_USERDEBUG) {
|
||||||
scale = Settings.Secure.getFloatForUser(mContext.getContentResolver(),
|
scale = Settings.Secure.getFloatForUser(mContext.getContentResolver(),
|
||||||
|
|||||||
Reference in New Issue
Block a user