最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

android接收到藍(lán)牙配對請求時如何點亮屏幕具體實現(xiàn)

 更新時間:2013年06月17日 15:31:54   作者:  
android 在接收到藍(lán)牙配對請求時如何自動點亮屏幕配對過程中很實用,具體的實現(xiàn)思路及代碼如下,感興趣的朋友可以參考下哈
file: BluetoothEventLoop.java
GB/GB2/GB3:
1. import android.os.PowerManager;
2. 變量申明:private PowerManager.WakeLock mWakeLock;
3. BluetoothEventLoop(){} 構(gòu)造函數(shù)里面添加定義:
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), 刪掉對應(yīng)function中的mWakeLock.release();
修改完后,模塊會被編譯進(jìn)framework.jar

相關(guān)文章

最新評論

巴中市| 大冶市| 阜城县| 北宁市| 上犹县| 巴里| 台南县| 廉江市| 延吉市| 万年县| 长海县| 宁安市| 吴江市| 莱西市| 张家界市| 缙云县| 同江市| 惠安县| 长白| 义乌市| 桑植县| 磐石市| 松桃| 雅江县| 靖边县| 合作市| 桑日县| 抚宁县| 恩施市| 林口县| 内江市| 两当县| 济阳县| 拜城县| 田林县| 浠水县| 陈巴尔虎旗| 天峨县| 塔城市| 钦州市| 江阴市|