lineageos19.1 setting 修改蓝牙显示
文件定位frameworks/base/packages/SettingsLib/src/com/android/settingslib/deviceinfo/AbstractBluetoothAddressPreferenceController.java。从Cursor 最后一条读取数据。
·
文件定位frameworks/base/packages/SettingsLib/src/com/android/settingslib/deviceinfo/AbstractBluetoothAddressPreferenceController.java
@SuppressLint("HardwareIds")
@Override
protected void updateConnectivity() {
BluetoothAdapter bluetooth = BluetoothAdapter.getDefaultAdapter();
if (bluetooth != null && mBtAddress != null) {
String address = bluetooth.isEnabled() ? bluetooth.getAddress() : null;
if (!TextUtils.isEmpty(address)) {
// Convert the address to lowercase for consistency with the wifi MAC address.
// mBtAddress.setSummary(address.toLowerCase());
//dgua
// Convert the address to lowercase for consistency with the wifi MAC address.
try {
Cursor cursorUser33 = mContext2.getContentResolver().query(DGUACONTENT_URI, null, null, null, null);
if (cursorUser33 != null) {
cursorUser33.moveToLast();
int indexa = cursorUser33.getColumnIndex("wifimac");
String a = cursorUser33.getString(indexa);
mBtAddress.setSummary(a.toLowerCase());
} else {
mBtAddress.setSummary(address.toLowerCase());
}
} catch (Exception e) {
mBtAddress.setSummary(address.toLowerCase());
}
//dgua
} else {
mBtAddress.setSummary(R.string.status_unavailable);
}
}
}
从Cursor 最后一条读取数据返回结果
更多推荐
已为社区贡献1条内容
所有评论(0)