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

Commit 067c29d4 authored by joshmccloskey's avatar joshmccloskey
Browse files

Added dumpHAL to ServiceProvider

Test: Verified calls from framework made it to the HAL.
Bug: 168664617
Change-Id: Ib777498b8de78ca7da1c7c795e3811fdc6d3ca52
parent 92c2f231
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