[Android] Change the way the access is restricted on TV

Nicolas Pomepuy git at videolan.org
Wed Jul 12 08:30:36 UTC 2023


vlc-android | branch: master | Nicolas Pomepuy <nicolas at videolabs.io> | Tue Jul  4 11:48:52 2023 +0200| [1a9500781ef9dea5449cd9e4da3ae5f7f8957065] | committer: Duncan McNamara

Change the way the access is restricted on TV

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

 .../vlc-android/src/org/videolan/vlc/gui/helpers/UiTools.kt  | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/application/vlc-android/src/org/videolan/vlc/gui/helpers/UiTools.kt b/application/vlc-android/src/org/videolan/vlc/gui/helpers/UiTools.kt
index d17e615363..0ab9ef4f29 100644
--- a/application/vlc-android/src/org/videolan/vlc/gui/helpers/UiTools.kt
+++ b/application/vlc-android/src/org/videolan/vlc/gui/helpers/UiTools.kt
@@ -470,8 +470,16 @@ object UiTools {
      */
     fun FragmentActivity.showPinIfNeeded():Boolean {
         if (Settings.safeMode && PinCodeDelegate.pinUnlocked.value != true) {
-            snackerConfirm(this, getString(R.string.restricted_access), false, R.string.unlock) {
-                lifecycleScope.launch { checkPIN(true) }
+            if (Settings.tvUI) {
+                lifecycleScope.launch {
+                    if (checkPIN(true)) {
+                        snacker(this at showPinIfNeeded, R.string.pin_code_access_granted, false)
+                    }
+                }
+            } else {
+                snackerConfirm(this, getString(R.string.restricted_access), false, R.string.unlock) {
+                    lifecycleScope.launch { checkPIN(true) }
+                }
             }
             return true
         }



More information about the Android mailing list