From a83101520da71b36ba435a9f6afb59cf3bc17cf3 Mon Sep 17 00:00:00 2001 From: Victor Andreasson Date: Fri, 10 May 2024 11:41:33 +0200 Subject: [PATCH] Ensure notifications permission is granted before using Git via SSH --- .../com/orgzly/android/ui/repo/git/GitRepoActivity.kt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/orgzly/android/ui/repo/git/GitRepoActivity.kt b/app/src/main/java/com/orgzly/android/ui/repo/git/GitRepoActivity.kt index 0493289d4..575d5a157 100644 --- a/app/src/main/java/com/orgzly/android/ui/repo/git/GitRepoActivity.kt +++ b/app/src/main/java/com/orgzly/android/ui/repo/git/GitRepoActivity.kt @@ -208,6 +208,13 @@ class GitRepoActivity : CommonActivity(), GitPreferences { binding.activityRepoGitHttpsAuthInfo.visibility = View.GONE binding.activityRepoGitHttpsUsernameLayout.visibility = View.GONE binding.activityRepoGitHttpsPasswordLayout.visibility = View.GONE + // Using SSH transport requires notification permission (for server key verification) + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) { + AppPermissions.isGrantedOrRequest( + App.getCurrentActivity(), + AppPermissions.Usage.POST_NOTIFICATIONS + ) + } } } @@ -513,7 +520,6 @@ class GitRepoActivity : CommonActivity(), GitPreferences { fragment.repoCheckComplete(e) } - override fun start(totalTasks: Int) { publishProgress(CloneProgressUpdate(totalTasks, true)) }