forked from jens/Automation
Small changes
This commit is contained in:
parent
94f7936c4a
commit
9daf4c4747
@ -94,20 +94,21 @@ public class BluetoothReceiver extends BroadcastReceiver implements AutomationLi
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent)
|
||||
{
|
||||
// Miscellaneous.logEvent("i", "BluetoothReceiver", "Bluetooth event.", 4);
|
||||
|
||||
String action = intent.getAction();
|
||||
|
||||
Miscellaneous.logEvent("i", "BluetoothReceiver", "Bluetooth event: " + action, 5);
|
||||
|
||||
BluetoothDevice bluetoothDevice = null;
|
||||
|
||||
if(action.equals(BluetoothDevice.ACTION_ACL_CONNECTED) | action.equals("android.bluetooth.device.action.ACL_CONNECTED"))
|
||||
{
|
||||
if(action.equals(BluetoothDevice.ACTION_ACL_CONNECTED) || action.equals("android.bluetooth.device.action.ACL_CONNECTED"))
|
||||
{
|
||||
bluetoothDevice = intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE);
|
||||
lastAffectedDevice = bluetoothDevice;
|
||||
lastAction = action;
|
||||
connectedDevices.add(bluetoothDevice);
|
||||
Miscellaneous.logEvent("i", "BluetoothReceiver", String.format(context.getResources().getString(R.string.bluetoothConnectionTo), bluetoothDevice.getName()), 3);
|
||||
}
|
||||
else if(action.equals(BluetoothDevice.ACTION_ACL_DISCONNECTED) | action.equals(BluetoothDevice.ACTION_ACL_DISCONNECT_REQUESTED) | action.equals("android.bluetooth.device.ACTION_ACL_DISCONNECTED") | action.equals("android.bluetooth.device.ACTION_ACL_DISCONNECT_REQUESTED"))
|
||||
else if(action.equals(BluetoothDevice.ACTION_ACL_DISCONNECTED) || action.equals(BluetoothDevice.ACTION_ACL_DISCONNECT_REQUESTED) || action.equals("android.bluetooth.device.ACTION_ACL_DISCONNECTED") || action.equals("android.bluetooth.device.ACTION_ACL_DISCONNECT_REQUESTED"))
|
||||
{
|
||||
bluetoothDevice = intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE);
|
||||
lastAffectedDevice = bluetoothDevice;
|
||||
@ -115,7 +116,7 @@ public class BluetoothReceiver extends BroadcastReceiver implements AutomationLi
|
||||
connectedDevices.remove(bluetoothDevice);
|
||||
Miscellaneous.logEvent("i", "BluetoothReceiver", String.format(context.getResources().getString(R.string.bluetoothDisconnectFrom), bluetoothDevice.getName()), 3);
|
||||
}
|
||||
else if(action.equals(BluetoothDevice.ACTION_FOUND) | action.equals("android.bluetooth.device.ACTION_FOUND"))
|
||||
else if(action.equals(BluetoothDevice.ACTION_FOUND) || action.equals("android.bluetooth.device.ACTION_FOUND"))
|
||||
{
|
||||
bluetoothDevice = intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE);
|
||||
lastAffectedDevice = bluetoothDevice;
|
||||
|
@ -422,7 +422,7 @@
|
||||
<string name="noDataChangedReadingAnyway">It appears no data change has been saved. However there may have been changes in memory that need to be rolled back. Rereading file.</string>
|
||||
<string name="bluetoothConnection">Bluetooth connection</string>
|
||||
<string name="bluetoothConnectionTo">Bluetooth connection to %1$s</string>
|
||||
<string name="bluetoothDisconnectFrom">Bluetooth connection to %1$s torn</string>
|
||||
<string name="bluetoothDisconnectFrom">Bluetooth connection from %1$s torn</string>
|
||||
<string name="bluetoothDeviceInRange">Bluetooth device %1$s in range.</string>
|
||||
<string name="bluetoothDeviceOutOfRange">Bluetooth device %1$s out of range.</string>
|
||||
<string name="anyDevice">any device</string>
|
||||
|
@ -1,5 +1,6 @@
|
||||
* Fixed: Added overlay permission for start-phone-call action
|
||||
* Fixed: Trigger "battery is charging" would only fire once and not after disconnecting and connecting charger
|
||||
* Fixed: Wifi trigger would not reliably fire upon disconnection
|
||||
* Fixed: On Api level <=28 a permission was requested for ActivityDetection that could not be granted
|
||||
* Change: Icon changed in Play store version
|
||||
* Change: Was forced to raise targetSdk to 32 for Google Play version. If that should break something, consider switching to the F-Droid or APK version.
|
Loading…
Reference in New Issue
Block a user