summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2023-09-01 13:38:34 +0000
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2023-09-01 13:38:34 +0000
commit807efaf718b5c2ff4a9ed63a947edf64e361d72b (patch)
tree3e5190cb220c9ed298de3874b11a0579ddf9d5c0
parent97887f8c54c972ba4d0b38f5a46b041e300488b4 (diff)
parentb623b8c3e3f128bb6a5b7534c2961334f9838ac0 (diff)
downloadNfc-android13-qpr3-c-s11-release.tar.gz
Merge cherrypicks of ['googleplex-android-review.googlesource.com/23518589'] into tm-qpr3-c-release.android-13.0.0_r82android-13.0.0_r81android-13.0.0_r80android13-qpr3-c-s12-releaseandroid13-qpr3-c-s11-releaseandroid13-qpr3-c-s10-release
Change-Id: I650cf00d5176c38ab2521e725d8da6251742312d
-rw-r--r--src/com/android/nfc/NfcService.java6
-rw-r--r--src/com/android/nfc/cardemulation/HostEmulationManager.java4
2 files changed, 9 insertions, 1 deletions
diff --git a/src/com/android/nfc/NfcService.java b/src/com/android/nfc/NfcService.java
index 7e99b8b9..edbdda91 100644
--- a/src/com/android/nfc/NfcService.java
+++ b/src/com/android/nfc/NfcService.java
@@ -1166,6 +1166,12 @@ public class NfcService implements DeviceHostListener {
}
}
+ public boolean isSecureNfcEnabled() {
+ synchronized (NfcService.this) {
+ return mIsSecureNfcEnabled;
+ }
+ }
+
final class NfcAdapterService extends INfcAdapter.Stub {
@Override
public boolean enable() throws RemoteException {
diff --git a/src/com/android/nfc/cardemulation/HostEmulationManager.java b/src/com/android/nfc/cardemulation/HostEmulationManager.java
index 81462024..8849cca5 100644
--- a/src/com/android/nfc/cardemulation/HostEmulationManager.java
+++ b/src/com/android/nfc/cardemulation/HostEmulationManager.java
@@ -188,7 +188,9 @@ public class HostEmulationManager {
// Resolve to default
// Check if resolvedService requires unlock
ApduServiceInfo defaultServiceInfo = resolveInfo.defaultService;
- if (defaultServiceInfo.requiresUnlock() && mKeyguard.isKeyguardLocked()) {
+ if ((defaultServiceInfo.requiresUnlock()
+ || NfcService.getInstance().isSecureNfcEnabled())
+ && mKeyguard.isKeyguardLocked()) {
NfcService.getInstance().sendRequireUnlockIntent();
NfcService.getInstance().sendData(AID_NOT_FOUND);
if (DBG) Log.d(TAG, "requiresUnlock()! show toast");