android接收到蓝牙配对请求时如何点亮屏幕具体实现
2013-06-17 15:31
549 查看
file: BluetoothEventLoop.java
GB/GB2/GB3:
1. import android.os.PowerManager;
2. 变量申明:private PowerManager.WakeLock mWakeLock;
3. BluetoothEventLoop(){} 构造函数里面添加定义:
PowerManager pm = (PowerManager)context.getSystemService(Context.POWER_SERVICE);
mWakeLock = pm.newWakeLock(PowerManager.FULL_WAKE_LOCK | PowerManager.ACQUIRE_CAUSES_WAKEUP
| PowerManager.ON_AFTER_RELEASE, TAG);
mWakeLock.setReferenceCounted(false);
4. onRequestPairingConsent(){
...
mWakeLock.acquire(5000); // xintong , 亮屏5s
Intent intent = new Intent(BluetoothDevice.ACTION_PAIRING_REQUEST);
...
}
5. onRequestPasskeyConfirmation(){
...
mWakeLock.acquire(5000); // xintong , 亮屏5s
Intent intent = new Intent(BluetoothDevice.ACTION_PAIRING_REQUEST);
...
}
6. onRequestPasskey(){
...
mWakeLock.acquire(5000); // xintong , 亮屏5s
Intent intent = new Intent(BluetoothDevice.ACTION_PAIRING_REQUEST);
...
}
7. onRequestPinCode(){
...
mWakeLock.acquire(5000); // xintong 亮屏5s
Intent intent = new Intent(BluetoothDevice.ACTION_PAIRING_REQUEST);
...
}
8. onDisplayPasskey(){
...
mWakeLock.acquire(5000); // xintong , 亮屏5s
Intent intent = new Intent(BluetoothDevice.ACTION_PAIRING_REQUEST);
...
}
ICS/ICS2/JB/JB2/JB3:
省略掉GB中修改的第1、2、3步;
对4、5、6、7、8中修改的function中:将原生的mWakeLock.acquire(); 改为mWakeLock.acquire(5000), 删掉对应function中的mWakeLock.release();
修改完后,模块会被编译进framework.jar
GB/GB2/GB3:
1. import android.os.PowerManager;
2. 变量申明:private PowerManager.WakeLock mWakeLock;
3. BluetoothEventLoop(){} 构造函数里面添加定义:
PowerManager pm = (PowerManager)context.getSystemService(Context.POWER_SERVICE);
mWakeLock = pm.newWakeLock(PowerManager.FULL_WAKE_LOCK | PowerManager.ACQUIRE_CAUSES_WAKEUP
| PowerManager.ON_AFTER_RELEASE, TAG);
mWakeLock.setReferenceCounted(false);
4. onRequestPairingConsent(){
...
mWakeLock.acquire(5000); // xintong , 亮屏5s
Intent intent = new Intent(BluetoothDevice.ACTION_PAIRING_REQUEST);
...
}
5. onRequestPasskeyConfirmation(){
...
mWakeLock.acquire(5000); // xintong , 亮屏5s
Intent intent = new Intent(BluetoothDevice.ACTION_PAIRING_REQUEST);
...
}
6. onRequestPasskey(){
...
mWakeLock.acquire(5000); // xintong , 亮屏5s
Intent intent = new Intent(BluetoothDevice.ACTION_PAIRING_REQUEST);
...
}
7. onRequestPinCode(){
...
mWakeLock.acquire(5000); // xintong 亮屏5s
Intent intent = new Intent(BluetoothDevice.ACTION_PAIRING_REQUEST);
...
}
8. onDisplayPasskey(){
...
mWakeLock.acquire(5000); // xintong , 亮屏5s
Intent intent = new Intent(BluetoothDevice.ACTION_PAIRING_REQUEST);
...
}
ICS/ICS2/JB/JB2/JB3:
省略掉GB中修改的第1、2、3步;
对4、5、6、7、8中修改的function中:将原生的mWakeLock.acquire(); 改为mWakeLock.acquire(5000), 删掉对应function中的mWakeLock.release();
修改完后,模块会被编译进framework.jar
您可能感兴趣的文章:
相关文章推荐
- android 接收到蓝牙配对请求时如何点亮屏幕
- 如何实现android蓝牙开发 自动配对连接,并不弹出提示框
- 如何实现android蓝牙开发 自动配对连接,并不弹出提示框
- 如何实现android蓝牙开发 自动配对连接,并不弹出提示框
- 如何实现android蓝牙开发 自动配对连接,并不弹出提示框
- Android中如何实现蓝牙的配对与连接
- 如何实现android蓝牙开发 自动配对连接,并不弹出提示框
- 如何实现android蓝牙开发 自动配对连接,并不弹出提示框
- android修改系统源码之实现蓝牙自动配对以及取消开机锁屏
- android手机实现插入后拔出电源,屏幕点亮
- android 如何在activity中控制屏幕点亮与关闭
- Android如何在activity中控制屏幕点亮与关闭
- Android 如何实现双向通话录音?有大神做过吗?具体实现方式是怎样的?
- android 取消蓝牙配对框 实现自动配对
- android 蓝牙编程重点---如何发送和接收16进制数据
- android USB如何修改VID具体实现
- android如何实现实时在屏幕上找图或者找颜色块的功能
- android中如何如何定义圆角,实现dp转换px适应不同屏幕需求
- Android 如何实现屏幕转换方向
- android 取消蓝牙配对框 实现自动配对