[Android] Fix onboarding permission wrongly asked on lower API versions

Nicolas Pomepuy git at videolan.org
Thu Aug 5 05:25:53 UTC 2021


vlc-android | branch: master | Nicolas Pomepuy <nicolas at videolabs.io> | Wed Aug  4 09:04:07 2021 +0200| [e87f370d9e0de6bc01f734d3c0e9d5dba2b247ea] | committer: Nicolas Pomepuy

Fix onboarding permission wrongly asked on lower API versions

Fixes #2124

> https://code.videolan.org/videolan/vlc-android/commit/e87f370d9e0de6bc01f734d3c0e9d5dba2b247ea
---

 .../src/org/videolan/vlc/gui/onboarding/OnboardingActivity.kt           | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/application/vlc-android/src/org/videolan/vlc/gui/onboarding/OnboardingActivity.kt b/application/vlc-android/src/org/videolan/vlc/gui/onboarding/OnboardingActivity.kt
index ab725cc37..e7b30338b 100644
--- a/application/vlc-android/src/org/videolan/vlc/gui/onboarding/OnboardingActivity.kt
+++ b/application/vlc-android/src/org/videolan/vlc/gui/onboarding/OnboardingActivity.kt
@@ -99,7 +99,7 @@ class OnboardingActivity : AppCompatActivity(), OnboardingFragmentListener {
 
     override fun onNext() {
         when(viewModel.currentFragment) {
-            FragmentName.WELCOME -> showFragment(FragmentName.ASK_PERMISSION)
+            FragmentName.WELCOME -> if (Permissions.canReadStorage(this)) showFragment(FragmentName.SCAN) else showFragment(FragmentName.ASK_PERMISSION)
             FragmentName.ASK_PERMISSION -> showFragment(if (Permissions.canReadStorage(applicationContext)) FragmentName.SCAN else FragmentName.NO_PERMISSION)
             FragmentName.NO_PERMISSION -> showFragment(if (Permissions.canReadStorage(applicationContext)) FragmentName.SCAN else FragmentName.THEME)
             FragmentName.SCAN -> showFragment(FragmentName.THEME)



More information about the Android mailing list