Merge "Make bluetooth toggle be on when Bluetooth is turning on" into main

This commit is contained in:
Haijie Hong
2023-10-10 07:16:05 +00:00
committed by Android (Google) Code Review

View File

@@ -124,7 +124,8 @@ public class BluetoothSliceBuilder {
private static boolean isBluetoothEnabled() {
final BluetoothAdapter adapter = BluetoothAdapter.getDefaultAdapter();
return adapter.isEnabled();
return adapter.getState() == BluetoothAdapter.STATE_ON
|| adapter.getState() == BluetoothAdapter.STATE_TURNING_ON;
}
private static PendingIntent getPrimaryAction(Context context) {