今天调试指纹时,发现有个报错如下:
里边提到了IBiometricsFingerprint.java这个类,虽然我们知道IBiometricsFingerprint.java其实对应调用的是Fingerprint HAL service: BiometricsFingerprint.cpp中对应注册的服务。
但还是想知道IBiometricsFingerprint.java:381行到底对应的是什么, 瞧瞧。
10-14 11:56:21.313121 1189 1217 W Watchdog: *** WATCHDOG KILLING SYSTEM PROCESS: Blocked in handler on main thread (main)
10-14 11:56:21.316275 1189 1217 W Watchdog: main annotated stack trace:
10-14 11:56:21.316921 1189 1217 W Watchdog: at android.os.HwRemoteBinder.transact(Native Method)
10-14 11:56:21.317529 1189 1217 W Watchdog: at android.hardware.biometrics.fingerprint.V2_1.IBiometricsFingerprint$Proxy.cancel(IBiometricsFingerprint.java:381)
10-14 11:56:21.318058 1189 1217 W Watchdog: at com.android.server.biometrics.fingerprint.FingerprintService$2.cancel(FingerprintService.java:696)
10-14 11:56:21.318569 1189 1217 W Watchdog: at com.android.server.biometrics.AuthenticationClient.stop(AuthenticationClient.java:262)
10-14 11:56:21.319257 1189 1217 W Watchdog: at com.android.server.biometrics.BiometricServiceBase.lambda$cancelAuthenticationInternal$3$BiometricServiceBase(BiometricServiceBase.java:893)
10-14 11:56:21.320871 1189 1217 W Watchdog: at com.android.server.biometrics.-$$Lambda$BiometricServiceBase$aivpKkOumO0Y5eW-DasbcdjcN4o.run(Unknown Source:6)
10-14 11:56:21.321314 1189 1217 W Watchdog: at android.os.Handler.handleCallback(Handler.java:883)
10-14 11:56:21.321713 1189 1217 W Watchdog: at android.os.Handler.dispatchMessage(Handler.java:100)
10-14 11:56:21.322013 1189 1217 W Watchdog: at android.os.Looper.loop(Looper.java:214)
10-14 11:56:21.322421 1189 1217 W Watchdog: at com.android.server.SystemServer.run(SystemServer.java:591)
10-14 11:56:21.323219 1189 1217 W Watchdog: at com.android.server.SystemServer.main(SystemServer.java:375)
10-14 11:56:21.323639 1189 1217 W Watchdog: at java.lang.reflect.Method.invoke(Native Method)
10-14 11:56:21.324174 1189 1217 W Watchdog: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
10-14 11:56:21.324615 1189 1217 W Watchdog: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:958)
10-14 11:56:21.398276 1189 1217 W Watchdog: *** GOODBYE!
最终在下面路径找到:
xie@HZCS13:~/coding/tokyo/out$ find . -name IBiometricsFingerprint.java
./soong/.intermediates/hardware/interfaces/biometrics/fingerprint/2.1/android.hardware.biometrics.fingerprint-V2.1-java_gen_java/gen/srcs/android/hardware/biometrics/fingerprint/V2_1/IBiometricsFingerprint.java
再看看381行:
我们还知道IBiometricsFingerprint.java是由IBiometricsFingerprint.hal经过hidl-gen生成的。
另外,其生成cpp还是java, 取决于调用需求, 它可以支持很多语言,见HIDL最全编译流程 。
看目录:
/out/soong/.intermediates/hardware/interfaces/biometrics/fingerprint/2.1/
其中IBiometricsFingerprint.hal被转换成了IBiometricsFingerprint.h和IBiometricsFingerprint.java, 分别供Java上层调用,和HAL service依赖。
再来分别看IBiometricsFingerprint.hal声明:
IBiometricsFingerprint.h
IBiometricsFingerprint.h的引用:
/hardware/interfaces/biometrics/fingerprint/2.1/default/service.cpp
#define LOG_TAG "android.hardware.biometrics.fingerprint@2.1-service"
#include <android/log.h>
#include <hidl/HidlSupport.h>
#include <hidl/HidlTransportSupport.h>
#include <android/hardware/biometrics/fingerprint/2.1/IBiometricsFingerprint.h>
#include <android/hardware/biometrics/fingerprint/2.1/types.h>
#include "BiometricsFingerprint.h"
using android::hardware::biometrics::fingerprint::V2_1::IBiometricsFingerprint;
using android::hardware::biometrics::fingerprint::V2_1::implementation::BiometricsFingerprint;
using android::hardware::configureRpcThreadpool;
IBiometricsFingerprint.java
IBiometricsFingerprint.java的引用:
/frameworks/base/services/core/java/com/android/server/biometrics/fingerprint/FingerprintService.java
import android.hardware.biometrics.IBiometricServiceLockoutResetCallback;
import android.hardware.biometrics.IBiometricServiceReceiverInternal;
import android.hardware.biometrics.fingerprint.V2_1.IBiometricsFingerprint;
import android.hardware.biometrics.fingerprint.V2_1.IBiometricsFingerprintClientCallback;
import android.hardware.fingerprint.Fingerprint;
import android.hardware.fingerprint.FingerprintManager;
到这里就清晰了。
补充:AIDL中间文件放在:
xie@HZCS13:~/coding/tokyo/out$ find . -name IFingerprintService*
./soong/.intermediates/frameworks/base/framework/android_common/gen/aidl/frameworks/base/core/java/android/hardware/fingerprint/IFingerprintServiceReceiver.java
./soong/.intermediates/frameworks/base/framework/android_common/gen/aidl/frameworks/base/core/java/android/hardware/fingerprint/IFingerprintServiceReceiver.java.d
./soong/.intermediates/frameworks/base/framework/android_common/gen/aidl/frameworks/base/core/java/android/hardware/fingerprint/IFingerprintService.java.d
./soong/.intermediates/frameworks/base/framework/android_common/gen/aidl/frameworks/base/core/java/android/hardware/fingerprint/IFingerprintService.java
./soong/.intermediates/frameworks/base/framework/android_common/javac/shard27/classes/android/hardware/fingerprint/IFingerprintService$Stub$Proxy.class
./soong/.intermediates/frameworks/base/framework/android_common/javac/shard27/classes/android/hardware/fingerprint/IFingerprintServiceReceiver.class
./soong/.intermediates/frameworks/base/framework/android_common/javac/shard27/classes/android/hardware/fingerprint/IFingerprintService.class
./soong/.intermediates/frameworks/base/framework/android_common/javac/shard27/classes/android/hardware/fingerprint/IFingerprintServiceReceiver$Stub$Proxy.class
./soong/.intermediates/frameworks/base/framework/android_common/javac/shard27/classes/android/hardware/fingerprint/IFingerprintService$Default.class
./soong/.intermediates/frameworks/base/framework/android_common/javac/shard27/classes/android/hardware/fingerprint/IFingerprintServiceReceiver$Default.class
./soong/.intermediates/frameworks/base/framework/android_common/javac/shard27/classes/android/hardware/fingerprint/IFingerprintService$Stub.class
./soong/.intermediates/frameworks/base/framework/android_common/javac/shard27/classes/android/hardware/fingerprint/IFingerprintServiceReceiver$Stub.class