diff options
author | Siarhei Vishniakou <svv@google.com> | 2019-02-07 15:42:06 -0800 |
---|---|---|
committer | Siarhei Vishniakou <svv@google.com> | 2019-02-07 15:42:06 -0800 |
commit | 443e98b12d829a83f25b845f31a7eccd71aa01db (patch) | |
tree | 1dfecb1c402bfc38a6b58ef2554b66c7bb896705 /input | |
parent | 312f58e1a0d6bd90b9eca77869280f032c35e7d6 (diff) | |
download | platform_hardware_interfaces-443e98b12d829a83f25b845f31a7eccd71aa01db.tar.gz platform_hardware_interfaces-443e98b12d829a83f25b845f31a7eccd71aa01db.tar.bz2 platform_hardware_interfaces-443e98b12d829a83f25b845f31a7eccd71aa01db.zip |
Remove impl from InputClassifier HAL
Make the reference implementation for InputClassifier HAL do nothing.
This is to allow cuttlefish to install this implementation.
It is safe for any device to install this implementation, and is
equivalent to not having the HAL running at all.
Test: boot up cuttlefish, and interact with the virtual device to ensure
that input works okay. Then 'ps -A | grep -i input' and ensure that the
HAL is running on the device.
Bug: 122600147
Change-Id: I841811bc0da3d78db8d7c1589cf1c59819d901a1
Diffstat (limited to 'input')
-rw-r--r-- | input/classifier/1.0/default/Android.bp | 4 | ||||
-rw-r--r-- | input/classifier/1.0/default/InputClassifier.cpp | 33 | ||||
-rw-r--r-- | input/classifier/1.0/default/android.hardware.input.classifier@1.0-service.default.rc (renamed from input/classifier/1.0/default/android.hardware.input.classifier@1.0-service-example.rc) | 2 |
3 files changed, 11 insertions, 28 deletions
diff --git a/input/classifier/1.0/default/Android.bp b/input/classifier/1.0/default/Android.bp index ddd883ce38..ceb2aca9f8 100644 --- a/input/classifier/1.0/default/Android.bp +++ b/input/classifier/1.0/default/Android.bp @@ -1,6 +1,6 @@ cc_binary { - name: "android.hardware.input.classifier@1.0-service-example", - init_rc: ["android.hardware.input.classifier@1.0-service-example.rc"], + name: "android.hardware.input.classifier@1.0-service.default", + init_rc: ["android.hardware.input.classifier@1.0-service.default.rc"], relative_install_path: "hw", vendor: true, vintf_fragments: ["manifest_input.classifier.xml"], diff --git a/input/classifier/1.0/default/InputClassifier.cpp b/input/classifier/1.0/default/InputClassifier.cpp index a78bbc5c94..cce9190cc8 100644 --- a/input/classifier/1.0/default/InputClassifier.cpp +++ b/input/classifier/1.0/default/InputClassifier.cpp @@ -31,41 +31,24 @@ namespace V1_0 { namespace implementation { // Methods from ::android::hardware::input::classifier::V1_0::IInputClassifier follow. -Return<Classification> InputClassifier::classify(const MotionEvent& event) { +Return<Classification> InputClassifier::classify(const MotionEvent& /*event*/) { /** - * In this example implementation, we will see how many "pixels" inside the video frame - * exceed the value of 250. If more than 6 such pixels are present, then treat the event - * as a "DEEP_PRESS". + * The touchscreen data is highly device-dependent. + * As a result, the implementation of this method will likely be hardware-specific. + * Here we just report gesture as not having any classification, which means that the + * default action will be taken in the framework. + * This is equivalent to not having the InputClassifier HAL at all. */ - if (event.frames.size() == 0) { - return Classification::NONE; - } - ALOGI("Frame(O) timestamp = %" PRIu64 ", received %zu frame(s)", event.frames[0].timestamp, - event.frames.size()); - for (const VideoFrame& frame : event.frames) { - size_t count = 0; - for (size_t i = 0; i < frame.data.size(); i++) { - if (frame.data[i] > 250) { - count++; - } - } - if (count > 6) { - return Classification::DEEP_PRESS; - } - } - return Classification::NONE; } Return<void> InputClassifier::reset() { - // We don't have any internal state in this example implementation, - // so no work needed here. + // We don't have any internal state, so no work needed here. return Void(); } Return<void> InputClassifier::resetDevice(int32_t /*deviceId*/) { - // We don't have any internal per-device state in this example implementation, - // so no work needed here. + // We don't have any internal per-device state, so no work needed here. return Void(); } diff --git a/input/classifier/1.0/default/android.hardware.input.classifier@1.0-service-example.rc b/input/classifier/1.0/default/android.hardware.input.classifier@1.0-service.default.rc index f799bf4359..e7d16ae05e 100644 --- a/input/classifier/1.0/default/android.hardware.input.classifier@1.0-service-example.rc +++ b/input/classifier/1.0/default/android.hardware.input.classifier@1.0-service.default.rc @@ -1,4 +1,4 @@ -service vendor.input.classifier-1-0 /vendor/bin/hw/android.hardware.input.classifier@1.0-service-example +service vendor.input.classifier-1-0 /vendor/bin/hw/android.hardware.input.classifier@1.0-service.default # Must be specified if "disabled" is set. This HAL will only start if requested via getService interface android.hardware.input.classifier@1.0::IInputClassifier default class hal |