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

Commit a7998431 authored by Kevin Chyn's avatar Kevin Chyn Committed by Android (Google) Code Review
Browse files

Merge "Update SensorManagerPlugin to have vendorType"

parents fd49e53a f7c3903c
Loading
Loading
Loading
Loading
+17 −1
Original line number Diff line number Diff line
@@ -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;
        }
    }
}
+1 −1
Original line number Diff line number Diff line
@@ -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 {