Android 13 wifi permission

This commit is contained in:
Jens 2023-03-01 23:35:19 +01:00
parent e5433bf2ec
commit a7ae0c6588
3 changed files with 9 additions and 5 deletions

View File

@ -259,8 +259,7 @@ public class ActivityPermissions extends Activity
if (!havePermission(s, context)) if (!havePermission(s, context))
return true; return true;
} }
else else if (!havePermission(s, context))
if (!havePermission(s, context))
return true; return true;
} }
} }
@ -515,9 +514,13 @@ public class ActivityPermissions extends Activity
addToArrayListUnique(Manifest.permission.ACCESS_NETWORK_STATE, requiredPermissions); addToArrayListUnique(Manifest.permission.ACCESS_NETWORK_STATE, requiredPermissions);
addToArrayListUnique(Manifest.permission.ACCESS_WIFI_STATE, requiredPermissions); addToArrayListUnique(Manifest.permission.ACCESS_WIFI_STATE, requiredPermissions);
if( if(
(
Miscellaneous.getTargetSDK(Miscellaneous.getAnyContext()) >= 29 Miscellaneous.getTargetSDK(Miscellaneous.getAnyContext()) >= 29
&& &&
isPermissionDeclaratedInManifest(Miscellaneous.getAnyContext(), Manifest.permission.ACCESS_BACKGROUND_LOCATION) isPermissionDeclaratedInManifest(Miscellaneous.getAnyContext(), Manifest.permission.ACCESS_BACKGROUND_LOCATION)
)
||
Build.VERSION.SDK_INT >= 33
) )
addToArrayListUnique(Manifest.permission.ACCESS_BACKGROUND_LOCATION, requiredPermissions); addToArrayListUnique(Manifest.permission.ACCESS_BACKGROUND_LOCATION, requiredPermissions);
break; break;
@ -775,6 +778,7 @@ public class ActivityPermissions extends Activity
break; break;
case Manifest.permission.ACCESS_BACKGROUND_LOCATION: case Manifest.permission.ACCESS_BACKGROUND_LOCATION:
usingElements.add(getResources().getString(R.string.googleLocationChicanery)); usingElements.add(getResources().getString(R.string.googleLocationChicanery));
usingElements.add(getResources().getString(R.string.wifiMonitoringAlsoRequiresThis));
for(String ruleName : getRulesUsing(Trigger.Trigger_Enum.pointOfInterest)) for(String ruleName : getRulesUsing(Trigger.Trigger_Enum.pointOfInterest))
usingElements.add(String.format(getResources().getString(R.string.ruleXrequiresThis), ruleName)); usingElements.add(String.format(getResources().getString(R.string.ruleXrequiresThis), ruleName));
for(String ruleName : getRulesUsing(Trigger.Trigger_Enum.speed)) for(String ruleName : getRulesUsing(Trigger.Trigger_Enum.speed))
@ -1034,7 +1038,7 @@ public class ActivityPermissions extends Activity
startActivityForResult(intent, requestCodeForPermissionsWriteSettings); startActivityForResult(intent, requestCodeForPermissionsWriteSettings);
return; return;
} }
if (s.equalsIgnoreCase(Manifest.permission.BIND_DEVICE_ADMIN)) else if (s.equalsIgnoreCase(Manifest.permission.BIND_DEVICE_ADMIN))
{ {
requiredPermissions.remove(s); requiredPermissions.remove(s);
cachedPermissionsToRequest = requiredPermissions; cachedPermissionsToRequest = requiredPermissions;

View File

@ -790,5 +790,4 @@
<string name="notificationAccessAndroid13">Nachdem Sie auf OK geklickt haben, wählen Sie Automatisierung, dann \"Benachrichtigungszugriff zulassen\" und dann \"Zulassen\".</string> <string name="notificationAccessAndroid13">Nachdem Sie auf OK geklickt haben, wählen Sie Automatisierung, dann \"Benachrichtigungszugriff zulassen\" und dann \"Zulassen\".</string>
<string name="displayLanguage">Anzeigesprache</string> <string name="displayLanguage">Anzeigesprache</string>
<string name="displayLanguageSummary">Bestimmte Anzeigesprache wählen</string> <string name="displayLanguageSummary">Bestimmte Anzeigesprache wählen</string>
<string name="displayLanguageSummary">B</string>
</resources> </resources>

View File

@ -876,7 +876,8 @@
<string name="startAppByStartService">by startService()</string> <string name="startAppByStartService">by startService()</string>
<string name="showToastsForEvents">Show toasts</string> <string name="showToastsForEvents">Show toasts</string>
<string name="showToastsForEventsSummary">Show toasts when events like rule executions occur</string> <string name="showToastsForEventsSummary">Show toasts when events like rule executions occur</string>
<string name="notificationAccessAndroid13">After clicking ok, select Automation, then select \"Allow notification access\", then \"allow\".</string> <string name="notificationAccessAndroid13">After clicking ok, select Automation, then select \"Allow notification access\", then \"allow\".\n\nOn some systems this setting is greyed out. In those cases you need to go to \"settings\" -> \"apps\" -> \"Automation\" -> 3-dots-menu -> Lift these restrictions. Afterwards return here.</string>
<string name="displayLanguage">Display language</string> <string name="displayLanguage">Display language</string>
<string name="displayLanguageSummary">Set a custom language for the application</string> <string name="displayLanguageSummary">Set a custom language for the application</string>
<string name="wifiMonitoringAlsoRequiresThis">This permission is also required if the trigger is using the current wifi connection.</string>
</resources> </resources>