Loading app/src/main/java/net/sourceforge/opencamera/ext/PendingIntent.kt 0 → 100644 +21 −0 Original line number Diff line number Diff line /* * SPDX-FileCopyrightText: 2024 The LineageOS Project * SPDX-License-Identifier: Apache-2.0 */ package net.sourceforge.opencamera.ext import android.app.ActivityOptions import android.app.PendingIntent import android.os.Build fun PendingIntent.sendWithBalAllowed() = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) { send( ActivityOptions.makeBasic().setPendingIntentBackgroundActivityStartMode( ActivityOptions.MODE_BACKGROUND_ACTIVITY_START_ALLOWED ).toBundle() ) } else { send() } No newline at end of file app/src/main/java/net/sourceforge/opencamera/qr/QrImageAnalyzer.kt +3 −2 Original line number Diff line number Diff line Loading @@ -44,6 +44,7 @@ import net.sourceforge.opencamera.MyDebug import net.sourceforge.opencamera.R import net.sourceforge.opencamera.ext.getThemeColor import net.sourceforge.opencamera.ext.px import net.sourceforge.opencamera.ext.sendWithBalAllowed import zxingcpp.BarcodeReader import kotlin.reflect.cast Loading Loading @@ -189,7 +190,7 @@ class QrImageAnalyzer(private val activity: Activity, private val scope: Corouti with(textClassification.actions[0]) { bottomSheetDialogCardView.setOnClickListener { try { actionIntent.send() actionIntent.sendWithBalAllowed() } catch (e: PendingIntent.CanceledException) { Toast.makeText( activity, Loading @@ -207,7 +208,7 @@ class QrImageAnalyzer(private val activity: Activity, private val scope: Corouti bottomSheetDialogActionsLayout.addView(inflateButton().apply { setOnClickListener { try { action.actionIntent.send() action.actionIntent.sendWithBalAllowed() } catch (e: PendingIntent.CanceledException) { Toast.makeText( activity, Loading Loading
app/src/main/java/net/sourceforge/opencamera/ext/PendingIntent.kt 0 → 100644 +21 −0 Original line number Diff line number Diff line /* * SPDX-FileCopyrightText: 2024 The LineageOS Project * SPDX-License-Identifier: Apache-2.0 */ package net.sourceforge.opencamera.ext import android.app.ActivityOptions import android.app.PendingIntent import android.os.Build fun PendingIntent.sendWithBalAllowed() = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) { send( ActivityOptions.makeBasic().setPendingIntentBackgroundActivityStartMode( ActivityOptions.MODE_BACKGROUND_ACTIVITY_START_ALLOWED ).toBundle() ) } else { send() } No newline at end of file
app/src/main/java/net/sourceforge/opencamera/qr/QrImageAnalyzer.kt +3 −2 Original line number Diff line number Diff line Loading @@ -44,6 +44,7 @@ import net.sourceforge.opencamera.MyDebug import net.sourceforge.opencamera.R import net.sourceforge.opencamera.ext.getThemeColor import net.sourceforge.opencamera.ext.px import net.sourceforge.opencamera.ext.sendWithBalAllowed import zxingcpp.BarcodeReader import kotlin.reflect.cast Loading Loading @@ -189,7 +190,7 @@ class QrImageAnalyzer(private val activity: Activity, private val scope: Corouti with(textClassification.actions[0]) { bottomSheetDialogCardView.setOnClickListener { try { actionIntent.send() actionIntent.sendWithBalAllowed() } catch (e: PendingIntent.CanceledException) { Toast.makeText( activity, Loading @@ -207,7 +208,7 @@ class QrImageAnalyzer(private val activity: Activity, private val scope: Corouti bottomSheetDialogActionsLayout.addView(inflateButton().apply { setOnClickListener { try { action.actionIntent.send() action.actionIntent.sendWithBalAllowed() } catch (e: PendingIntent.CanceledException) { Toast.makeText( activity, Loading