蓝牙各种小问题
1.蓝牙传输文件的存储路径:
原生的路径是String root = Environment.getExternalStorageDirectory().getPath(); 会直接存储到内部存储器中。将它改成String root = StorageManagerEx.getDefaultPath() +"/";即可。这样传输文件会存储到当前的主存储器。
代码路径是/packages/apps/Bluetooth / src/com/android/bluetooth/opp/BluetoothOppReceiveFileInfo.java
2.接收蓝牙文件通知没有亮屏解决办法:
在发送通知的地方加上:
PowerManager pm = (PowerManager)mContext.getSystemService(Context.POWER_SERVICE);
WakeLock lock = pm.newWakeLock(PowerManager.ACQUIRE_CAUSES_WAKEUP|PowerManager.SCREEN_DIM_WAKE_LOCK, "SimpleTimer");
lock.acquire(1000);
代码路径:packages/apps/Bluetooth / src/com/android/bluetooth/opp/BluetoothOppNotification.java-updateIncomingFileConfirmNotification()