From 5fd62bb4e782b0b1a710ea7dbe6c94015f813b6c Mon Sep 17 00:00:00 2001 From: Pierre-Hugues Husson Date: Thu, 27 Dec 2018 14:44:44 +0100 Subject: [PATCH] Add op-fp command to debug op6t fingerprint --- cmds/Android.bp | 12 ++++++++++++ cmds/op-fp.cpp | 16 ++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 cmds/op-fp.cpp diff --git a/cmds/Android.bp b/cmds/Android.bp index dd8faf6..4c04469 100644 --- a/cmds/Android.bp +++ b/cmds/Android.bp @@ -10,6 +10,18 @@ cc_binary { ], } +cc_binary { + name: "op-fp", + srcs: [ + "op-fp.cpp", + ], + shared_libs: [ + "vendor.oneplus.fingerprint.extension@1.0", + "libutils", + "libhidlbase", + ], +} + cc_binary { name: "uevent", srcs: [ diff --git a/cmds/op-fp.cpp b/cmds/op-fp.cpp new file mode 100644 index 0000000..0ab7164 --- /dev/null +++ b/cmds/op-fp.cpp @@ -0,0 +1,16 @@ +#include +#include + +using ::vendor::oneplus::fingerprint::extension::V1_0::IVendorFingerprintExtensions; +using ::android::sp; + +int main(int argc, char **argv) { + auto svc = IVendorFingerprintExtensions::getService(); + if(argc!=2) return 1; + int v = atoi(argv[0]); + auto ret = svc->updateStatus(v); + if(!ret.isOk()) { + std::cerr << "HWBinder call failed" << std::endl; + } + std::cout << "updateStatus returned " << ret << std::endl; +}