Jelly Bean Sensor Framework
来源:互联网 发布:sql树结构 所以父节点 编辑:程序博客网 时间:2024/06/04 19:42
如果您要转载,请注明原创作者是蝈蝈
Frameworks
Below is a picture to show how sensor works in JB.
Each Application would create an EventListener to handle events from sensorHW. Below is a snap shot for EventListener, usually, onSensorChanged() and onAccuracyChanged() would be provided.
The Application registers the created EventListener to the SystemSensorManager which has a pooling thread and will invokes the callback functions in EventThread once read any event data from SensorEventQueue whose data is from SensorService.
SystemSensorManager enables the required sensor once registered with the EventListener. The control commands are sent to sensorService also through SensorEventQueue.
For the data flow, the sensorEventQueue holds a bitTube buffer; sensorSevice is responsible to write it with sensor event polled from sensorhal while systemSensorManager has a thread reads data from the bitTube buffer and invokes registered callbacks.
2. Sensor Service
Sensor Service is an android service run in system_server.
Sensor Service has a fancy fusion instance which could generate virtual sensors event data. Once hardware not supplies such virtual sensors, Sensor Service uses its own virtual sensors. Those virtual sensors include Rotation vector, Gravity, Linear Acceleration, and Orientation. And to support those virtual sensors, hardware should at least provide Accelerator, Magnetic and Gyroscope sensors.
SensorDevice holds an internal class BatteryService. It is used to inform the BatteryService that how much time the sensor running. noteStartSensor() is called when enabling a sensor while noteStopSensor() is called when disabling a sensor.
3. Control Flow sequence
Below is the control flow for register an event listener by applications.
- Jelly Bean Sensor Framework
- Android: Jelly Bean 来了!
- Jelly Bean Audio Flinger Study
- Android 4.1~4.3 Jelly Bean
- Android 4.1 Jelly Bean 相关资源
- Wikipad个性游戏平板: 手柄+Jelly Bean
- 解读 Android 4.2 Jelly Bean 新特性
- Jelly Bean Wifi研究(1)
- Android 4.1 (Jelly Bean,果冻豆)
- Android Jelly Bean滑动解锁控件实现
- Android 4.1 Jelly Bean安全機制探討 【转】
- Android 4.1 Jelly Bean安全機制探討
- Android 4.1 Jelly Bean安全機制探討
- 在 Jelly Bean 中使用应用加密
- Android Multimedia Framework 架构--base on jelly...
- android framework sensor
- Android (Gingerbread) Sensor Framework
- Android(Gingerbread) Sensor Framework
- 语音识别过程分析2
- python flask newsmeme 搭建 安装
- 课程设计---图书登记管理系统(217行代码)【没看】
- 流年,经不起怀念
- 课程设计---停车场管理系统 【没看】
- Jelly Bean Sensor Framework
- Window消息循环补遗
- 课程设计---约瑟夫环【没看】
- C#编写的通讯录
- Allegro可供产品包含L、XL和GXL三个级别
- 七夕,染红了我的相思
- java笔记-io-BufferedReader类
- EasySize - Dialog resizing in no time!
- 学生信息管理系统【没看】