When Bluetooth is enabled on android R, the status bar does not display the Bluetooth icon directly. The Bluetooth icon is displayed only when the Bluetooth connection is transmitting.

Native implementation is in PhoneStatusBarPolicy. In Java:

private final void updateBluetooth() { ...... if (mBluetooth ! = null) { if (mBluetooth.isBluetoothConnected() && (mBluetooth.isBluetoothAudioActive() || ! mBluetooth.isBluetoothAudioProfileOnly())) { contentDescription = mResources.getString( R.string.accessibility_bluetooth_connected); bluetoothVisible = mBluetooth.isBluetoothEnabled(); }}... }Copy the code

Solution:

Set the condition of bluetoothVisible assignment to Bluetooth Enable.

boolean bluetoothVisible = false; if (mBluetooth ! = null) { + if(mBluetooth.isBluetoothEnabled()){ + bluetoothVisible = mBluetooth.isBluetoothEnabled(); + } if (mBluetooth.isBluetoothConnected() && (mBluetooth.isBluetoothAudioActive() || ! mBluetooth.isBluetoothAudioProfileOnly())) { contentDescription = mResources.getString( R.string.accessibility_bluetooth_connected); - bluetoothVisible = mBluetooth.isBluetoothEnabled(); + //bluetoothVisible = mBluetooth.isBluetoothEnabled(); }Copy the code