summaryrefslogtreecommitdiff
path: root/app/src/fatweb/java/se.leap.bitmaskclient/appUpdate
diff options
context:
space:
mode:
Diffstat (limited to 'app/src/fatweb/java/se.leap.bitmaskclient/appUpdate')
-rw-r--r--app/src/fatweb/java/se.leap.bitmaskclient/appUpdate/InstallActivity.java12
1 files changed, 10 insertions, 2 deletions
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();
+ }
}
}
}