[SOLUTION]
L版本蓝牙设置部分有很大修改,L版本去除了蓝牙可见性设置,只有当手机处于蓝牙设置界面(BluetoothSetting)时才会打开可见性,才能被其他手机搜索到,当退出蓝牙设置界面时,将关闭可见性。
但是,当一直停留在蓝牙设置界面关闭蓝牙,再打开时,即使此时还在蓝牙设置界面,对外也是不可见。这是Google的bug。
如果希望当在蓝牙设置界面时,不管第几次打开蓝牙,蓝牙都能对外可见,修改方式如下:
在BluetoothSettings.java文件的onBluetoothStateChanged方法中,添加如下三句:
@Override
public void onBluetoothStateChanged(int bluetoothState) {
super.onBluetoothStateChanged(bluetoothState);
//add by mtk start
if( bluetoothState==BluetoothAdapter.STATE_ON)
{
mInitiateDiscoverable=true;
}
//add by mtk end
updateContent(bluetoothState);
}
添加后使用mmm 的方式编译,编译完后通过snod的方式打包进system.img,然后download到手机中测试即可。