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

Commit 2820c62a authored by Ilya Matyukhin's avatar Ilya Matyukhin
Browse files

Make function names consistent in AidlConversionUtils

Bug: 181358178
Test: atest CtsBiometricsTestCases
Change-Id: I118590e4c335438d801133e6917b0c7829e0cf62
parent 97579558
Loading
Loading
Loading
Loading
+9 −7
Original line number Diff line number Diff line
@@ -31,7 +31,7 @@ import android.hardware.face.FaceEnrollCell;
import android.hardware.face.FaceEnrollFrame;

/**
 * Utilities for converting between hardware and framework-defined AIDL models.
 * Utilities for converting from hardware to framework-defined AIDL models.
 */
final class AidlConversionUtils {
    // Prevent instantiation.
@@ -128,17 +128,19 @@ final class AidlConversionUtils {
    }

    @NonNull
    public static FaceAuthenticationFrame convert(@NonNull AuthenticationFrame frame) {
        return new FaceAuthenticationFrame(convert(frame.data));
    public static FaceAuthenticationFrame toFrameworkAuthenticationFrame(
            @NonNull AuthenticationFrame frame) {
        return new FaceAuthenticationFrame(toFrameworkBaseFrame(frame.data));
    }

    @NonNull
    public static FaceEnrollFrame convert(@NonNull EnrollmentFrame frame) {
        return new FaceEnrollFrame(convert(frame.cell), frame.stage, convert(frame.data));
    public static FaceEnrollFrame toFrameworkEnrollmentFrame(@NonNull EnrollmentFrame frame) {
        return new FaceEnrollFrame(toFrameworkCell(frame.cell), frame.stage,
                toFrameworkBaseFrame(frame.data));
    }

    @NonNull
    public static FaceDataFrame convert(@NonNull BaseFrame frame) {
    public static FaceDataFrame toFrameworkBaseFrame(@NonNull BaseFrame frame) {
        return new FaceDataFrame(
                toFrameworkAcquiredInfo(frame.acquiredInfo),
                frame.vendorCode,
@@ -149,7 +151,7 @@ final class AidlConversionUtils {
    }

    @Nullable
    public static FaceEnrollCell convert(@Nullable Cell cell) {
    public static FaceEnrollCell toFrameworkCell(@Nullable Cell cell) {
        return cell == null ? null : new FaceEnrollCell(cell.x, cell.y, cell.z);
    }
}
+3 −2
Original line number Diff line number Diff line
@@ -186,7 +186,7 @@ public class Sensor {
                    return;
                }
                ((FaceAuthenticationClient) client).onAuthenticationFrame(
                        AidlConversionUtils.convert(frame));
                        AidlConversionUtils.toFrameworkAuthenticationFrame(frame));
            });
        }

@@ -204,7 +204,8 @@ public class Sensor {
                            + Utils.getClientName(client));
                    return;
                }
                ((FaceEnrollClient) client).onEnrollmentFrame(AidlConversionUtils.convert(frame));
                ((FaceEnrollClient) client).onEnrollmentFrame(
                        AidlConversionUtils.toFrameworkEnrollmentFrame(frame));
            });
        }

+1 −1
Original line number Diff line number Diff line
@@ -21,7 +21,7 @@ import android.hardware.biometrics.fingerprint.AcquiredInfo;
import android.hardware.biometrics.fingerprint.Error;

/**
 * Utilities for converting between hardware and framework-defined AIDL models.
 * Utilities for converting from hardware to framework-defined AIDL models.
 */
final class AidlConversionUtils {
    // Prevent instantiation.