[Android] Prevent showing the download button on release builds

Nicolas Pomepuy git at videolan.org
Mon Sep 9 09:29:23 UTC 2024


vlc-android | branch: master | Nicolas Pomepuy <nicolas at videolabs.io> | Thu Sep  5 09:49:30 2024 +0200| [83e8d3a81e2e75cc6379bcc125bcfd586475fd51] | committer: Duncan McNamara

Prevent showing the download button on release builds

As those builds don't have the install package permission.

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

 .../vlc-android/src/org/videolan/vlc/gui/dialogs/UpdateDialog.kt       | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/application/vlc-android/src/org/videolan/vlc/gui/dialogs/UpdateDialog.kt b/application/vlc-android/src/org/videolan/vlc/gui/dialogs/UpdateDialog.kt
index fe2d401401..8e69c1c56d 100644
--- a/application/vlc-android/src/org/videolan/vlc/gui/dialogs/UpdateDialog.kt
+++ b/application/vlc-android/src/org/videolan/vlc/gui/dialogs/UpdateDialog.kt
@@ -40,6 +40,8 @@ import org.videolan.resources.util.parcelable
 import org.videolan.tools.KEY_SHOW_UPDATE
 import org.videolan.tools.Settings
 import org.videolan.tools.putSingle
+import org.videolan.tools.setGone
+import org.videolan.vlc.BuildConfig
 import org.videolan.vlc.R
 import org.videolan.vlc.databinding.DialogUpdateBinding
 import org.videolan.vlc.util.AutoUpdate
@@ -87,6 +89,7 @@ class UpdateDialog : VLCBottomSheetDialogFragment() {
 
     override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View {
         binding = DialogUpdateBinding.inflate(layoutInflater, container, false)
+        if (!BuildConfig.DEBUG) binding.download.setGone()
         binding.download.setOnClickListener {
             if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
                 if (!requireActivity().packageManager.canRequestPackageInstalls()) {



More information about the Android mailing list