国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 系統(tǒng) > Android > 正文

android接收到藍牙配對請求時如何點亮屏幕具體實現

2020-04-11 12:09:13
字體:
來源:轉載
供稿:網友
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
發(fā)表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發(fā)表
主站蜘蛛池模板: 靖边县| 汪清县| 辽宁省| 大庆市| 阿荣旗| 孝感市| 合江县| 齐齐哈尔市| 东丽区| 佛山市| 尼木县| 浠水县| 鱼台县| 彩票| 西贡区| 崇礼县| 蒙自县| 沾益县| 大田县| 凉城县| 当阳市| 彭水| 虹口区| 开平市| 石嘴山市| 海丰县| 敦煌市| 望奎县| 襄樊市| 沾化县| 灌阳县| 江津市| 北票市| 漾濞| 马龙县| 三河市| 祁连县| 上杭县| 波密县| 隆尧县| 凤阳县|