Skip to content
Snippets Groups Projects
Commit 9aea83eb authored by Dhina17's avatar Dhina17
Browse files

Revert "Revert "UdfpsSurfaceView: Allow for increasing enrollment radius""

This reverts commit 9c8f2f5a.

Change-Id: I380b5a667dc636aaf0e6e2ebfb484668babba223
parent a2cf0b12
No related branches found
No related tags found
No related merge requests found
......@@ -34,4 +34,6 @@
<!-- HD calling icon -->
<dimen name="signal_icon_viewport_size">24dp</dimen>
<!-- Size to enlarge Enrollment GHBM Dot Size by in DP. -->
<dimen name="udfps_enroll_dot_additional_size">0dp</dimen>
</resources>
......@@ -276,6 +276,9 @@ class UdfpsControllerOverlay @JvmOverloads constructor(
overlayTouchListener!!
)
overlayTouchListener?.onTouchExplorationStateChanged(true)
if (requestReason.isEnrollmentReason()) {
this.setEnrolling(true);
}
}
} catch (e: RuntimeException) {
Log.e(TAG, "showUdfpsOverlay | failed to add window", e)
......@@ -505,6 +508,10 @@ class UdfpsControllerOverlay @JvmOverloads constructor(
}
}
@ShowReason
private fun Int.isEnrollmentReason() =
this == REASON_ENROLL_FIND_SENSOR || this == REASON_ENROLL_ENROLLING
@RequestReason
private fun Int.isImportantForAccessibility() =
this == REASON_ENROLL_FIND_SENSOR ||
......
......@@ -56,6 +56,7 @@ public class UdfpsSurfaceView extends SurfaceView implements SurfaceHolder.Callb
@Nullable private Runnable mOnDisplayConfigured;
boolean mAwaitingSurfaceToStartIllumination;
boolean mHasValidSurface;
private boolean mEnrolling = false;
private Drawable mUdfpsIconPressed;
......@@ -141,6 +142,19 @@ public class UdfpsSurfaceView extends SurfaceView implements SurfaceHolder.Callb
Canvas canvas = null;
try {
canvas = mHolder.lockCanvas();
int addDotSize =
getResources().getDimensionPixelSize(R.dimen.udfps_enroll_dot_additional_size);
if (addDotSize > 0 && mEnrolling) {
float newRadius = ((sensorRect.right - sensorRect.left) / 2) + addDotSize;
float centerX = sensorRect.centerX();
float centerY = sensorRect.centerY();
sensorRect.set(
centerX - newRadius,
centerY - newRadius,
centerX + newRadius,
centerY + newRadius
);
}
mUdfpsIconPressed.setBounds(
Math.round(sensorRect.left),
Math.round(sensorRect.top),
......@@ -156,4 +170,8 @@ public class UdfpsSurfaceView extends SurfaceView implements SurfaceHolder.Callb
}
}
}
void setEnrolling(boolean enrolling) {
mEnrolling = enrolling;
}
}
......@@ -144,4 +144,6 @@ class UdfpsView(
}
mUdfpsDisplayMode?.disable(null /* onDisabled */)
}
fun setEnrolling(enrolling: Boolean) = ghbmView?.setEnrolling(enrolling)
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment