diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index a831c4ba0..f0189c6b8 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -16,8 +16,6 @@ - - diff --git a/app/src/main/java/com/orgzly/android/ui/repos/ReposActivity.kt b/app/src/main/java/com/orgzly/android/ui/repos/ReposActivity.kt index cfbb250ef..efba405f5 100644 --- a/app/src/main/java/com/orgzly/android/ui/repos/ReposActivity.kt +++ b/app/src/main/java/com/orgzly/android/ui/repos/ReposActivity.kt @@ -1,13 +1,9 @@ package com.orgzly.android.ui.repos import android.Manifest -import android.content.Intent import android.content.pm.PackageManager -import android.net.Uri import android.os.Build import android.os.Bundle -import android.os.Environment -import android.provider.Settings import android.view.ContextMenu import android.view.MenuItem import android.view.View @@ -33,7 +29,6 @@ import com.orgzly.android.ui.showSnackbar import com.orgzly.databinding.ActivityReposBinding import javax.inject.Inject - /** * List of user-configured repositories. */ @@ -225,18 +220,14 @@ class ReposActivity : CommonActivity(), AdapterView.OnItemClickListener, Activit } R.id.repos_options_menu_item_new_git -> { - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R && !Environment.isExternalStorageManager()) { - val uri = Uri.parse("package:" + BuildConfig.APPLICATION_ID) - startActivity( - Intent(Settings.ACTION_MANAGE_APP_ALL_FILES_ACCESS_PERMISSION, uri)) - } else if (Build.VERSION.SDK_INT < Build.VERSION_CODES.R && ContextCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R || ContextCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE) == PackageManager.PERMISSION_GRANTED) { + GitRepoActivity.start(this) + } else { // TODO: Show explanation why possibly, if ActivityCompat.shouldShowRequestPermissionRationale() says so? ActivityCompat.requestPermissions( this, arrayOf(Manifest.permission.WRITE_EXTERNAL_STORAGE), ACTIVITY_REQUEST_CODE_FOR_READ_WRITE_EXTERNAL_STORAGE) - } else { - GitRepoActivity.start(this) } return }