mirror of
https://github.com/fankes/termux-app.git
synced 2025-09-06 02:35:19 +08:00
Fixed: Fix Settings.ACTION_*
permission requests result callback
Adding `FLAG_ACTIVITY_NEW_TASK` will start permission activity in separate task and `onActivityResult()` will be called early in the calling activity without grant/not-grant result being actually set.
This commit is contained in:
@@ -352,7 +352,6 @@ public class PermissionUtils {
|
||||
Intent intent = new Intent(Settings.ACTION_MANAGE_APP_ALL_FILES_ACCESS_PERMISSION);
|
||||
intent.addCategory("android.intent.category.DEFAULT");
|
||||
intent.setData(Uri.parse("package:" + context.getPackageName()));
|
||||
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
|
||||
Error error;
|
||||
if (requestCode >=0)
|
||||
@@ -464,7 +463,6 @@ public class PermissionUtils {
|
||||
|
||||
Intent intent = new Intent(Settings.ACTION_MANAGE_OVERLAY_PERMISSION);
|
||||
intent.setData(Uri.parse("package:" + context.getPackageName()));
|
||||
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
|
||||
if (requestCode >=0)
|
||||
return ActivityUtils.startActivityForResult(context, requestCode, intent);
|
||||
@@ -534,7 +532,6 @@ public class PermissionUtils {
|
||||
|
||||
Intent intent = new Intent(Settings.ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS);
|
||||
intent.setData(Uri.parse("package:" + context.getPackageName()));
|
||||
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
|
||||
if (requestCode >=0)
|
||||
return ActivityUtils.startActivityForResult(context, requestCode, intent);
|
||||
|
Reference in New Issue
Block a user