Started SDK 29 background location crap.

This commit is contained in:
Jens 2021-02-28 23:06:20 +01:00
parent 5758e5ee2b
commit 8a5fa20cad

View File

@ -769,6 +769,16 @@ public class ActivityPermissions extends Activity
}
}
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q)
{
if (requestCode == requestCodeForPermissionsBackgroundLocation)
{
NotificationManager mNotificationManager = (NotificationManager) ActivityPermissions.this.getSystemService(Context.NOTIFICATION_SERVICE);
if (mNotificationManager.isNotificationPolicyAccessGranted())
requestPermissions(cachedPermissionsToRequest, true);
}
}
}
}
@ -828,6 +838,15 @@ public class ActivityPermissions extends Activity
startActivityForResult(intent, requestCodeForPermissionsNotificationPolicy);
return;
}
else if (s.equalsIgnoreCase(permissionNameLocationBackground) && Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q)
{
requiredPermissions.remove(s);
cachedPermissionsToRequest = requiredPermissions;
Intent intent = new Intent(android.provider.Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
intent.setData(Uri.parse("package:" + getPackageName()));
startActivityForResult(intent, requestCodeForPermissionsBackgroundLocation);
return;
}
}
}