android 接收到蓝牙配对请求时如何点亮屏幕
来源:互联网 发布:3月宏观经济数据 编辑:程序博客网 时间:2024/05/08 22:23
file: BluetoothEventLoop.java
GB/GB2/GB3:
1. import android.os.PowerManager;
2. 变量申明:private PowerManager.WakeLock mWakeLock;
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);
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);
...
}
...
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);
...
}
...
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);
...
}
...
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);
...
}
...
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);
...
}
...
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 接收到蓝牙配对请求时如何点亮屏幕
- WINCE蓝牙如何检测被其他设备发起配对请求
- Android:点亮屏幕,和取消点亮屏幕
- Android开发蓝牙篇之蓝牙配对、连接与接收数据
- android 蓝牙配对
- android蓝牙自动配对
- Android蓝牙配对
- Android 蓝牙自动配对
- 7.0 灭屏接收蓝牙到文件唤醒屏幕
- android 收到新短信时,点亮屏幕
- Android点亮屏幕
- Android 点亮屏幕
- android 解锁 点亮屏幕
- android 点亮屏幕
- Android点亮解锁屏幕
- android点亮屏幕
- Android点亮屏幕
- Android点亮屏幕
- (黑马程序员)File类学习总结
- ARM协处理器指令
- android 通过蓝牙接收文件,从历史传输记录打开,无法自动选择合适的应用程序
- MFC 双缓冲技术 【转】
- Timer的schedule()方法的正确使用
- android 接收到蓝牙配对请求时如何点亮屏幕
- JavaScript的三种弹出对话框
- Linux Interrupt
- 【Linux基础】线程概述
- MYECLIPSE 8.5 启动提示
- MyEclipse 8.6的SVN 插件安装,优化,配置
- 重新设置TortoiseSVN用户名和密码
- RGB和HSV颜色空间
- 2013年IC市场生变:通信领域将成最大赢家