mirror of
https://github.com/f-droid/fdroidclient.git
synced 2026-05-19 14:10:38 -04:00
Warn when we ignore external intent
This commit is contained in:
@@ -4,6 +4,7 @@ import android.Manifest.permission.POST_NOTIFICATIONS
|
||||
import android.content.pm.PackageManager.PERMISSION_GRANTED
|
||||
import android.os.Build.VERSION.SDK_INT
|
||||
import android.os.Bundle
|
||||
import android.util.Log
|
||||
import androidx.activity.compose.setContent
|
||||
import androidx.activity.enableEdgeToEdge
|
||||
import androidx.activity.result.contract.ActivityResultContracts.RequestPermission
|
||||
@@ -27,6 +28,8 @@ class MainActivity : AppCompatActivity() {
|
||||
// inform OnNewIntentListeners about the initial intent (otherwise would be missed)
|
||||
if (savedInstanceState == null && intent != null) {
|
||||
onNewIntent(intent)
|
||||
} else if (savedInstanceState != null && intent != null) {
|
||||
Log.w("MainActivity", "Ignored intent due to savedInstanceState: $intent")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,6 @@ import android.content.Intent
|
||||
import android.content.Intent.ACTION_MAIN
|
||||
import android.content.Intent.ACTION_SHOW_APP_INFO
|
||||
import android.content.Intent.EXTRA_PACKAGE_NAME
|
||||
import android.os.Build.VERSION.SDK_INT
|
||||
import androidx.core.util.Consumer
|
||||
import mu.KotlinLogging
|
||||
|
||||
@@ -53,7 +52,7 @@ class IntentRouter(private val navigator: Navigator) : Consumer<Intent> {
|
||||
navigator.navigate(NavigationKey.MyApps)
|
||||
}
|
||||
} else {
|
||||
log.warn { "Unknown intent: $intent - uri: $uri $SDK_INT" }
|
||||
log.warn { "Unknown intent: $intent - uri: $uri" }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user