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. onRequestP
airin
GConsent(){
...
mWakeLock.acquire(5000); // xintong , 亮屏5s
Intent intent = new Intent(BluetoothDevice.ACT
ioN_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图库播放幻灯片时按power键灭屏再亮屏显示keyguardAndroid点亮屏幕或屏幕解锁和锁定以及其他相关权限实现代码Android四大组件之Activity详解Android四大组件之Service详解Android四大组件之BroadcastReceiver详解Android三级
缓存原理讲解Android亮屏速度分析
总结
0