From ff20e4502b0f202d13323d4211c2c475c1d62bc8 Mon Sep 17 00:00:00 2001 From: Daniel Shokouhi Date: Sun, 24 Oct 2021 15:48:09 -0700 Subject: [PATCH] Some NFC fixes for Android 12 (#1830) --- app/src/main/AndroidManifest.xml | 2 +- .../main/java/io/homeassistant/companion/android/nfc/NFCUtil.kt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 6c538f6be23..7e93d05e868 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -284,7 +284,7 @@ + android:exported="true"> diff --git a/app/src/main/java/io/homeassistant/companion/android/nfc/NFCUtil.kt b/app/src/main/java/io/homeassistant/companion/android/nfc/NFCUtil.kt index a619c88edad..a1134ed3501 100644 --- a/app/src/main/java/io/homeassistant/companion/android/nfc/NFCUtil.kt +++ b/app/src/main/java/io/homeassistant/companion/android/nfc/NFCUtil.kt @@ -37,7 +37,7 @@ object NFCUtil { fun enableNFCInForeground(nfcAdapter: NfcAdapter, activity: Activity, classType: Class) { val pendingIntent = PendingIntent.getActivity( activity, 0, - Intent(activity, classType).addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP), PendingIntent.FLAG_IMMUTABLE + Intent(activity, classType).addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP), PendingIntent.FLAG_MUTABLE ) val nfcIntentFilter = IntentFilter(NfcAdapter.ACTION_NDEF_DISCOVERED) val filters = arrayOf(nfcIntentFilter)