|
24 | 24 | * The motion sensor can operate in a mode that reports either "motion" events |
25 | 25 | * or "no-motion" events after an inactivity window. Sensitivity is optional: |
26 | 26 | * if unsupported, both minSensitivity and maxSensitivity are 0. |
| 27 | + * |
| 28 | + * @details |
| 29 | + * Lifecycle ownership: |
| 30 | + * The sensor uses a single-owner lifecycle model. start() and stop() |
| 31 | + * operate on the sensor instance directly — there is no per-client |
| 32 | + * controller or exclusive open/close pattern. A single middleware |
| 33 | + * component (e.g., a power management service) should own the sensor |
| 34 | + * lifecycle, while other components register as event listeners only. |
| 35 | + * |
| 36 | + * Timing controls vs active windows: |
| 37 | + * activeStartSeconds/activeStopSeconds (passed to start()) and active |
| 38 | + * windows (configured via setActiveWindows()) are independent, layered |
| 39 | + * mechanisms: |
| 40 | + * - Timing controls govern the sensor hardware lifecycle — whether |
| 41 | + * the sensor is active at all. |
| 42 | + * - Active windows govern event suppression — whether detected events |
| 43 | + * are delivered to listeners. |
| 44 | + * |
| 45 | + * Timing controls take precedence. Callers are responsible for ensuring |
| 46 | + * sensible combinations (e.g., that activeStartSeconds does not exceed |
| 47 | + * the remaining window duration). |
27 | 48 | */ |
28 | 49 | package com.rdk.hal.sensor.motion; |
29 | 50 |
|
@@ -70,9 +91,12 @@ interface IMotionSensor { |
70 | 91 | * @param activeStopSeconds Duration in seconds after which the sensor becomes inactive. |
71 | 92 | * Use 0 for no automatic stop. |
72 | 93 | * |
| 94 | + * @pre Sensor must be in STOPPED state. |
| 95 | + * |
73 | 96 | * @returns Success flag indicating sensor start status. |
74 | 97 | * @retval true Sensor accepted the start request. |
75 | | - * @retval false Sensor could not be started (e.g. invalid hw state). |
| 98 | + * @retval false Sensor could not be started due to an internal or hardware initialisation failure. |
| 99 | + * @exception binder::Status EX_ILLEGAL_STATE if sensor is not STOPPED. |
76 | 100 | */ |
77 | 101 | boolean start(in OperationalMode operationalMode, |
78 | 102 | in int noMotionSeconds, |
|
0 commit comments