From 6dd683f83d261099a7a4eee5101ea1e53d7a06c2 Mon Sep 17 00:00:00 2001 From: cyBerta Date: Fri, 28 Jun 2024 00:49:42 +0200 Subject: recheck canRequestPackageInstalls() after user was guided to the apps permission settings --- .../se.leap.bitmaskclient/appUpdate/InstallActivity.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'app') diff --git a/app/src/fatweb/java/se.leap.bitmaskclient/appUpdate/InstallActivity.java b/app/src/fatweb/java/se.leap.bitmaskclient/appUpdate/InstallActivity.java index 92291a43..b0e6b392 100644 --- a/app/src/fatweb/java/se.leap.bitmaskclient/appUpdate/InstallActivity.java +++ b/app/src/fatweb/java/se.leap.bitmaskclient/appUpdate/InstallActivity.java @@ -75,8 +75,16 @@ public class InstallActivity extends Activity { if (resultCode == RESULT_OK) { installUpdate(); } else { - Toast.makeText(this, getString(R.string.version_update_error_permissions), Toast.LENGTH_LONG).show(); - finish(); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + if (this.getPackageManager().canRequestPackageInstalls()) { + installUpdate(); + } else { + Toast.makeText(this, getString(R.string.version_update_error_permissions), Toast.LENGTH_LONG).show(); + finish(); + } + } else { + finish(); + } } } } -- cgit v1.2.3