service is starting can be inverted

This commit is contained in:
2022-07-24 19:53:45 +02:00
parent d17e8b70fe
commit 7fdbf74906
19 changed files with 467 additions and 26 deletions

View File

@@ -300,4 +300,16 @@ public class BluetoothReceiver extends BroadcastReceiver implements AutomationLi
{
return new Trigger_Enum[] { Trigger_Enum.bluetoothConnection };
}
}
/**
* Check for Bluetooth.
*
* @return true if Bluetooth is available.
*/
public static boolean isBluetoothEnabled()
{
final BluetoothAdapter bluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
return bluetoothAdapter != null && bluetoothAdapter.isEnabled() && bluetoothAdapter.getState() == BluetoothAdapter.STATE_ON;
}
}