ActivityDetection permission fixed

This commit is contained in:
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);
}
}