summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Chang <georgekgchang@google.com>2021-04-13 15:32:38 +0800
committeralk3pInjection <webmaster@raspii.tech>2021-09-14 11:26:25 +0800
commitb299711dd053a468d7f9aa5677a45593ad576ae0 (patch)
tree170f01e16268f5c6d66b8f81c40087910364039e
parente1ceb7431af5da478db19decb6057ed34f483dba (diff)
SecureElement: Improve isNfcEventAllowed
Return when SE is not connected Bug: 185198557 Test: manual Change-Id: I0c90862585f311bc6695235e316023aeceb9df7a (cherry picked from commit cba6328078700b0d3adc92c8a95da9337718597a)
-rw-r--r--src/com/android/se/Terminal.java5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/com/android/se/Terminal.java b/src/com/android/se/Terminal.java
index 54dc256..d8033ed 100644
--- a/src/com/android/se/Terminal.java
+++ b/src/com/android/se/Terminal.java
@@ -670,11 +670,16 @@ public class Terminal {
*/
public boolean[] isNfcEventAllowed(PackageManager packageManager, byte[] aid,
String[] packageNames) {
+ if (!mIsConnected) {
+ // Return if not connected
+ return null;
+ }
// Attempt to initialize the access control enforcer if it failed in the previous attempt
// due to a kind of temporary failure or no rule was found.
if (mAccessControlEnforcer == null || mAccessControlEnforcer.isNoRuleFound()) {
try {
initializeAccessControl();
+ Log.i(mTag, "AccessControlEnforcer initialized");
// Just finished to initialize the access control enforcer.
// It is too much to check the refresh tag in this case.
} catch (Exception e) {