Make FairScan callable through the GET_CONTENT intent (#187)

This commit is contained in:
Pierre-Yves Nicolas
2026-05-30 15:52:13 +02:00
committed by GitHub
parent d3a28d0eaf
commit a38909fb52
2 changed files with 7 additions and 0 deletions

View File

@@ -36,6 +36,12 @@
<action android:name="org.fairscan.app.action.SCAN_TO_PDF" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.GET_CONTENT"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.OPENABLE"/>
<data android:mimeType="application/pdf"/>
</intent-filter>
</activity>
<provider
android:name="androidx.core.content.FileProvider"

View File

@@ -246,6 +246,7 @@ class MainActivity : ComponentActivity() {
private fun resolveLaunchMode(intent: Intent?): LaunchMode {
return when (intent?.action) {
"org.fairscan.app.action.SCAN_TO_PDF" -> LaunchMode.EXTERNAL_SCAN_TO_PDF
"android.intent.action.GET_CONTENT" -> LaunchMode.EXTERNAL_SCAN_TO_PDF
else -> LaunchMode.NORMAL
}
}