Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
import android.os.RemoteException;
import android.os.UserHandle;
import android.os.UserManager;
import android.os.SystemProperties;
import android.util.Log;
import android.util.RotationUtils;
import android.util.SparseBooleanArray;
Expand Down Expand Up @@ -217,6 +218,10 @@ public void onReceive(Context context, Intent intent) {
}
};

private void oplusFpUiReady(boolean fingerDown) {
SystemProperties.set("sys.phh.oplus.fppress", fingerDown ? "1" : "0");
}

private void closeDialog(String reasonString) {
closeDialog(BiometricPrompt.DISMISSED_REASON_USER_CANCEL, reasonString);
}
Expand Down Expand Up @@ -297,10 +302,12 @@ private void handleAllFingerprintAuthenticatorsRegistered(
mUdfpsController.addCallback(new UdfpsController.Callback() {
@Override
public void onFingerUp() {
oplusFpUiReady(false);
}

@Override
public void onFingerDown() {
oplusFpUiReady(true);
if (mCurrentDialog != null) {
mCurrentDialog.onPointerDown();
}
Expand Down
15 changes: 15 additions & 0 deletions services/core/java/com/android/server/biometrics/AuthService.java
Original file line number Diff line number Diff line change
Expand Up @@ -1292,6 +1292,21 @@ static public int[] dynamicUdfpsProps(Context ctxt) {
return udfpsProps;
}

String fpLocationOplus = android.os.SystemProperties.get("persist.vendor.fingerprint.optical.sensorlocation");
if(!TextUtils.isEmpty(fpLocationOplus) && fpLocationOplus.contains("::")) {
int[] udfpsProps = new int[3];
String[] coordinates = fpLocationOplus.split("::");
udfpsProps[0] = Integer.parseInt(coordinates[0]);
udfpsProps[1] = Integer.parseInt(coordinates[1]);

String iconSize = android.os.SystemProperties.get("persist.vendor.fingerprint.optical.iconsize");
udfpsProps[2] = (Integer.parseInt(iconSize) /2);

Slog.d("PHH-Enroll", "Oplus/OPPO UDFPS detected. Props: " + Arrays.toString(udfpsProps));

return udfpsProps;
}

String fpLocation = android.os.SystemProperties.get("persist.vendor.sys.fp.fod.location.X_Y");
if(!TextUtils.isEmpty(fpLocation) && fpLocation.contains(",")) {
int[] udfpsProps = new int[3];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
import static android.hardware.fingerprint.FingerprintSensorConfigurations.getIFingerprint;
import static android.hardware.fingerprint.FingerprintSensorConfigurations.remapFqName;

import static android.hardware.fingerprint.FingerprintSensorProperties.TYPE_UDFPS_OPTICAL;

import android.annotation.NonNull;
import android.annotation.Nullable;
import android.app.ActivityManager;
Expand Down Expand Up @@ -297,6 +299,12 @@ private void addAidlSensors(@NonNull SensorProps prop,
android.util.Log.e("PHH-Enroll", " - " + loc.sensorLocationX + ", " + loc.sensorLocationY + ", " +loc.sensorRadius + ", disp =" + loc.display + ", shape " + loc.sensorShape);
}

if (prop.sensorLocations.length == 1 && prop.sensorLocations[0].sensorLocationX > 0) {
android.util.Log.e("PHH-Enroll", "Set fingerprint sensor type UDFPS Optical");
prop.sensorType = TYPE_UDFPS_OPTICAL;
prop.halHandlesDisplayTouches = true;
}

final Sensor sensor = new Sensor(this, mContext, mHandler, prop, mBiometricContext,
workaroundLocations, resetLockoutRequiresHardwareAuthToken);
sensor.init(gestureAvailabilityDispatcher, mLockoutResetDispatcher);
Expand Down