#1196 fix access to app from lock screen

This commit is contained in:
Thibault Deckers 2024-09-16 19:52:51 +02:00
parent fc04a1cf89
commit 4851b997cf
2 changed files with 1 additions and 2 deletions

View file

@ -119,7 +119,6 @@
android:label="@string/app_name" android:label="@string/app_name"
android:requestLegacyExternalStorage="true" android:requestLegacyExternalStorage="true"
android:roundIcon="@mipmap/ic_launcher_round" android:roundIcon="@mipmap/ic_launcher_round"
android:showWhenLocked="true"
android:supportsRtl="true" android:supportsRtl="true"
tools:targetApi="tiramisu"> tools:targetApi="tiramisu">
<activity <activity
@ -128,7 +127,6 @@
android:exported="true" android:exported="true"
android:hardwareAccelerated="true" android:hardwareAccelerated="true"
android:launchMode="singleTop" android:launchMode="singleTop"
android:showWhenLocked="true"
android:supportsPictureInPicture="true" android:supportsPictureInPicture="true"
android:theme="@style/NormalTheme" android:theme="@style/NormalTheme"
android:windowSoftInputMode="adjustResize"> android:windowSoftInputMode="adjustResize">

View file

@ -320,6 +320,7 @@ open class MainActivity : FlutterFragmentActivity() {
val keyguardManager = getSystemService(Context.KEYGUARD_SERVICE) as android.app.KeyguardManager val keyguardManager = getSystemService(Context.KEYGUARD_SERVICE) as android.app.KeyguardManager
val isLocked = keyguardManager.isKeyguardLocked val isLocked = keyguardManager.isKeyguardLocked
setShowWhenLocked(isLocked)
if (isLocked) { if (isLocked) {
// device is locked, so access to content is limited to intent URI by default // device is locked, so access to content is limited to intent URI by default
fields[INTENT_DATA_KEY_SECURE_URIS] = listOf(uri.toString()) fields[INTENT_DATA_KEY_SECURE_URIS] = listOf(uri.toString())