ActivityDetection permission fixed

This commit is contained in:
Jens 2023-10-26 23:30:45 +02:00
parent 02f7b642cf
commit 94f7936c4a
4 changed files with 7 additions and 6 deletions

View File

@ -456,7 +456,8 @@ public class ActivityPermissions extends Activity
{
case activityDetection:
addToArrayListUnique(permissionNameGoogleActivityDetection, requiredPermissions);
addToArrayListUnique(Manifest.permission.ACTIVITY_RECOGNITION, requiredPermissions);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q)
addToArrayListUnique(Manifest.permission.ACTIVITY_RECOGNITION, requiredPermissions);
break;
case airplaneMode:
addToArrayListUnique(Manifest.permission.ACCESS_NETWORK_STATE, requiredPermissions);

View File

@ -395,7 +395,7 @@ public class ReceiverCoordinator
{
if(!HeadphoneJackListener.isHeadphoneJackListenerActive())
{
Miscellaneous.logEvent("i", "LocationProvider", "Starting HeadphoneJackListener because used in a new/changed rule.", 4);
Miscellaneous.logEvent("i", "HeadphoneJackListener", "Starting HeadphoneJackListener because used in a new/changed rule.", 4);
if(HeadphoneJackListener.getInstance().haveAllPermission())
HeadphoneJackListener.getInstance().startListener(AutomationService.getInstance());
}
@ -404,7 +404,7 @@ public class ReceiverCoordinator
{
if(HeadphoneJackListener.isHeadphoneJackListenerActive())
{
Miscellaneous.logEvent("i", "LocationProvider", "Shutting down HeadphoneJackListener because not used in any rule.", 4);
Miscellaneous.logEvent("i", "HeadphoneJackListener", "Shutting down HeadphoneJackListener because not used in any rule.", 4);
HeadphoneJackListener.getInstance().stopListener(AutomationService.getInstance());
}
}

View File

@ -20,7 +20,7 @@ public class HeadphoneJackListener extends BroadcastReceiver implements Automati
private static boolean headsetConnected = false;
private static int headphoneType = -1;
protected static boolean headphoneJackListenerActive=false;
protected static boolean headphoneJackListenerActive = false;
protected static IntentFilter headphoneJackListenerIntentFilter = null;
protected static HeadphoneJackListener instance;
@ -108,7 +108,7 @@ public class HeadphoneJackListener extends BroadcastReceiver implements Automati
}
catch(Exception ex)
{
Miscellaneous.logEvent("e", "ActivityDetectionReceiver", "Error starting HeadsetJackListener: " + Log.getStackTraceString(ex), 3);
Miscellaneous.logEvent("e", "HeadsetJackListener", "Error starting HeadsetJackListener: " + Log.getStackTraceString(ex), 3);
}
}

View File

@ -886,5 +886,5 @@
<string name="overlayPermissionHint">After clicking OK you\'ll be sent to a system dialog. Please select Automation there and allow "Display over other apps".</string>
<string name="variablesOnlyForTypes">Variables are only available for parameter types String and URI</string>
<string name="intentParametersHint">If you want to specify a parameter you also have to click \"Add intent pair\". Otherwise your changes will not be saved.</string>
<string name="wifiTriggerDisconnectionHint">This trigger will be valid if you just disconnected from the wifi specified above\n\nOR\n\nwhile the service is still starting and if you\'re not connected to any wifi.</string>
<string name="wifiTriggerDisconnectionHint">This trigger will be valid if you just disconnected from the wifi specified above\n\nOR\n\nwhile the service is still starting and if you\'re not connected to any wifi.\n\nIf you want the trigger to fire only when you\'re explicitly disconnecting from a certain wifi, add another trigger \"service is not starting\".</string>
</resources>