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

Commit 72109895 authored by Joshua Mccloskey's avatar Joshua Mccloskey Committed by Android (Google) Code Review
Browse files

Merge "Added dumpHAL to ServiceProvider"

parents 961f7375 067c29d4
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -64,6 +64,7 @@ import com.android.server.biometrics.sensors.face.hidl.Face10;
import java.io.FileDescriptor;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;

@@ -425,6 +426,13 @@ public class FaceService extends SystemService implements BiometricServiceCallba
                            provider.dumpProtoMetrics(props.sensorId, fd);
                        }
                    }
                } else if (args.length > 1 && "--hal".equals(args[0])) {
                    for (ServiceProvider provider : mServiceProviders) {
                        for (FaceSensorPropertiesInternal props : provider.getSensorProperties()) {
                            provider.dumpHal(props.sensorId, fd,
                                    Arrays.copyOfRange(args, 1, args.length, args.getClass()));
                        }
                    }
                } else {
                    for (ServiceProvider provider : mServiceProviders) {
                        for (FaceSensorPropertiesInternal props : provider.getSensorProperties()) {
+2 −0
Original line number Diff line number Diff line
@@ -118,4 +118,6 @@ public interface ServiceProvider {

    @NonNull
    ITestSession createTestSession(int sensorId, @NonNull String opPackageName);

    void dumpHal(int sensorId, @NonNull FileDescriptor fd, @NonNull String[] args);
}
+3 −0
Original line number Diff line number Diff line
@@ -579,6 +579,9 @@ public class FaceProvider implements IBinder.DeathRecipient, ServiceProvider {
        return null; // TODO
    }

    @Override
    public void dumpHal(int sensorId, @NonNull FileDescriptor fd, @NonNull String[] args) {}

    @Override
    public void binderDied() {
        Slog.e(getTag(), "HAL died");
+4 −1
Original line number Diff line number Diff line
@@ -874,7 +874,10 @@ public class Face10 implements IHwBinder.DeathRecipient, ServiceProvider {
        });
    }

    public void dumpHal(@NonNull FileDescriptor fd, @NonNull String[] args) {
    /**
     * Sends a debug message to the HAL with the provided FileDescriptor and arguments.
     */
    public void dumpHal(int sensorId, @NonNull FileDescriptor fd, @NonNull String[] args) {
        // WARNING: CDD restricts image data from leaving TEE unencrypted on
        //          production devices:
        // [C-1-10] MUST not allow unencrypted access to identifiable biometric