[Android] Restrict access to the incognito mode when safe mode is activated
Nicolas Pomepuy
git at videolan.org
Wed Jul 12 08:30:36 UTC 2023
vlc-android | branch: master | Nicolas Pomepuy <nicolas at videolabs.io> | Wed Jul 5 15:30:53 2023 +0200| [9ed7320bd897943a9cc1d876fd8393dec0464359] | committer: Duncan McNamara
Restrict access to the incognito mode when safe mode is activated
> https://code.videolan.org/videolan/vlc-android/commit/9ed7320bd897943a9cc1d876fd8393dec0464359
---
.../vlc-android/src/org/videolan/vlc/gui/MainActivity.kt | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/application/vlc-android/src/org/videolan/vlc/gui/MainActivity.kt b/application/vlc-android/src/org/videolan/vlc/gui/MainActivity.kt
index 074ac182a6..ded700fec3 100644
--- a/application/vlc-android/src/org/videolan/vlc/gui/MainActivity.kt
+++ b/application/vlc-android/src/org/videolan/vlc/gui/MainActivity.kt
@@ -34,6 +34,8 @@ import android.widget.ImageView
import androidx.appcompat.view.ActionMode
import androidx.core.content.ContextCompat
import androidx.fragment.app.Fragment
+import androidx.lifecycle.lifecycleScope
+import kotlinx.coroutines.launch
import org.videolan.libvlc.util.AndroidUtil
import org.videolan.medialibrary.interfaces.Medialibrary
import org.videolan.resources.ACTIVITY_RESULT_OPEN
@@ -51,6 +53,7 @@ import org.videolan.vlc.gui.helpers.INavigator
import org.videolan.vlc.gui.helpers.Navigator
import org.videolan.vlc.gui.helpers.UiTools
import org.videolan.vlc.gui.helpers.UiTools.isTablet
+import org.videolan.vlc.gui.helpers.UiTools.showPinIfNeeded
import org.videolan.vlc.gui.video.VideoGridFragment
import org.videolan.vlc.interfaces.Filterable
import org.videolan.vlc.interfaces.IRefreshable
@@ -197,9 +200,12 @@ class MainActivity : ContentActivity(),
true
}
R.id.incognito_mode -> {
- Settings.getInstance (this).putSingle(KEY_INCOGNITO, !Settings.getInstance(this).getBoolean(KEY_INCOGNITO, false))
- item.isChecked = !item.isChecked
- updateIncognitoModeIcon()
+ lifecycleScope.launch {
+ if (showPinIfNeeded()) return at launch
+ Settings.getInstance (this at MainActivity).putSingle(KEY_INCOGNITO, !Settings.getInstance(this at MainActivity).getBoolean(KEY_INCOGNITO, false))
+ item.isChecked = !item.isChecked
+ updateIncognitoModeIcon()
+ }
true
}
android.R.id.home ->
More information about the Android
mailing list