[Android] Prevent displaying the edit ctx entry on a non root network favorite

Nicolas Pomepuy git at videolan.org
Mon Apr 3 13:06:21 UTC 2023


vlc-android | branch: master | Nicolas Pomepuy <nicolas at videolabs.io> | Mon Mar 20 13:03:20 2023 +0100| [3a2ec9637543a3994c7fa66a2eb53a82750852f1] | committer: Duncan McNamara

Prevent displaying the edit ctx entry on a non root network favorite

Fixes #2557

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

 .../src/org/videolan/vlc/gui/browser/BaseBrowserFragment.kt         | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/application/vlc-android/src/org/videolan/vlc/gui/browser/BaseBrowserFragment.kt b/application/vlc-android/src/org/videolan/vlc/gui/browser/BaseBrowserFragment.kt
index 88831badd3..814ba2ea5d 100644
--- a/application/vlc-android/src/org/videolan/vlc/gui/browser/BaseBrowserFragment.kt
+++ b/application/vlc-android/src/org/videolan/vlc/gui/browser/BaseBrowserFragment.kt
@@ -75,7 +75,6 @@ import org.videolan.vlc.media.MediaUtils
 import org.videolan.vlc.media.PlaylistManager
 import org.videolan.vlc.repository.BrowserFavRepository
 import org.videolan.vlc.util.Permissions
-import org.videolan.vlc.util.isSchemeFavoriteEditable
 import org.videolan.vlc.util.isSchemeSupported
 import org.videolan.vlc.util.isTalkbackIsEnabled
 import org.videolan.vlc.viewmodels.browser.BrowserModel
@@ -571,10 +570,7 @@ abstract class BaseBrowserFragment : MediaBrowserFragment<BrowserModel>(), IRefr
                 val isNetworkBrowser = this at BaseBrowserFragment is NetworkBrowserFragment
                 if (isFileBrowser || isNetworkBrowser) {
                     val favExists = browserFavRepository.browserFavExists(mw.uri)
-                    flags = if (favExists) {
-                        if (mw.uri.scheme.isSchemeFavoriteEditable() && isNetworkBrowser) flags or CTX_FAV_EDIT or CTX_FAV_REMOVE
-                        else flags or CTX_FAV_REMOVE
-                    } else flags or CTX_FAV_ADD
+                    flags = if (favExists) flags or CTX_FAV_REMOVE else flags or CTX_FAV_ADD
                 }
                 if (isFileBrowser && !isRootDirectory && !MedialibraryUtils.isScanned(item.uri.toString())) {
                     flags = flags or CTX_ADD_SCANNED



More information about the Android mailing list