Clay Murphy | d01c551 | 2014-09-18 18:28:04 -0700 | [diff] [blame] | 1 | page.title=Interaction |
| 2 | @jd:body |
| 3 | |
| 4 | <!-- |
| 5 | Copyright 2014 The Android Open Source Project |
| 6 | |
| 7 | Licensed under the Apache License, Version 2.0 (the "License"); |
| 8 | you may not use this file except in compliance with the License. |
| 9 | You may obtain a copy of the License at |
| 10 | |
| 11 | http://www.apache.org/licenses/LICENSE-2.0 |
| 12 | |
| 13 | Unless required by applicable law or agreed to in writing, software |
| 14 | distributed under the License is distributed on an "AS IS" BASIS, |
| 15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 16 | See the License for the specific language governing permissions and |
| 17 | limitations under the License. |
| 18 | --> |
| 19 | |
| 20 | <p>From the perspective of Android applications, every Android sensor is an |
| 21 | independent entity, meaning there is no interaction between the different |
| 22 | sensors.</p> |
| 23 | <ul> |
| 24 | <li> This is true even though several Android sensors might share the same |
| 25 | underlying physical sensor </li> |
| 26 | <li> For example: step counter, significant motion and accelerometer, all relying on |
| 27 | the same physical accelerometer, must be able to work concurrently </li> |
| 28 | <li> This is also true for wake-up and non-wake-up versions of the same sensor </li> |
| 29 | </ul> |
| 30 | <p>Android sensors must be able to work simultaneously and independently of one |
| 31 | another. That is, any action on one Android sensor must not impact the behavior |
| 32 | of the other sensors.</p> |
| 33 | <p>Specifically, at the HAL level:</p> |
| 34 | <ul> |
| 35 | <li> activating a sensor </li> |
| 36 | <li> deactivating a sensor </li> |
| 37 | <li> changing the sampling frequency of a sensor </li> |
| 38 | <li> changing the maximum reporting latency of a sensor </li> |
| 39 | </ul> |
| 40 | <p>cannot cause:</p> |
| 41 | <ul> |
| 42 | <li> another activated sensor to stop working </li> |
| 43 | <li> another activated sensor to change sampling rate </li> |
| 44 | <li> another activated sensor to decrease the quality of its measurements </li> |
| 45 | <li> another non-activated sensor to start delivering events </li> |
| 46 | </ul> |
| 47 | <p>Nor can any of the actions above prevent actions (activation, deactivation, |
| 48 | and parameter changes) on another sensor from succeeding. For instance, |
| 49 | whether we can activate the step counter must be independent of whether the |
| 50 | accelerometer is currently activated. </p> |
| 51 | <p>As another important example, a wake-up sensor activated at 5Hz must generate events |
| 52 | at around 5Hz, even if its non-wake-up variant is being activated at 100Hz.</p> |