国产探花免费观看_亚洲丰满少妇自慰呻吟_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ā)表
主站蜘蛛池模板: 寻乌县| 东丽区| 隆昌县| 嘉兴市| 沈丘县| 正蓝旗| 台北县| 会同县| 奉节县| 东光县| 嘉荫县| 称多县| 新竹市| 民勤县| 东乌珠穆沁旗| 桑植县| 黄平县| 山东省| 靖州| 丰城市| 通辽市| 灌阳县| 三门县| 大悟县| 广河县| 容城县| 泗阳县| 台前县| 资兴市| 商水县| 信阳市| 佛山市| 汝南县| 瑞金市| 罗山县| 包头市| 峡江县| 芦溪县| 建水县| 灵山县| 南川市|