Update SensorManagerPlugin to have vendorType

Bug: 111414690
Test: Builds
Change-Id: Ice50275160b23bcb60aca1653b570ec9b4565c4e
This commit is contained in:
Kevin Chyn
2018-10-11 00:44:39 -07:00
parent 8a98b40cc0
commit f7c3903cda
2 changed files with 18 additions and 2 deletions

View File

@@ -67,9 +67,25 @@ public interface SensorManagerPlugin extends Plugin {
class TriggerEvent {
Sensor mSensor;
int mVendorType;
public TriggerEvent(Sensor sensor) {
/**
* Creates a trigger event
* @param sensor The type of sensor, e.g. TYPE_WAKE_LOCK_SCREEN
* @param vendorType The vendor type, which should be unique for each type of sensor,
* e.g. SINGLE_TAP = 1, DOUBLE_TAP = 2, etc.
*/
public TriggerEvent(Sensor sensor, int vendorType) {
mSensor = sensor;
mVendorType = vendorType;
}
public Sensor getSensor() {
return mSensor;
}
public int getVendorType() {
return mVendorType;
}
}
}

View File

@@ -423,7 +423,7 @@ public class DozeSensors {
}
/**
* A Sensor that is injected via plugin, for better ContextHub interface.
* A Sensor that is injected via plugin.
*/
private class PluginTriggerSensor extends TriggerSensor {