summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTreeHugger Robot <treehugger-gerrit@google.com>2020-06-10 16:12:19 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2020-06-10 16:12:19 +0000
commit48b648d75c5a60c5ed25c98a95131f8b49ceeda8 (patch)
tree28e6403c0f813d72307dd23d45976438a1a81089 /src
parentbf247e11b235326419138f48149a22eda96e8cfd (diff)
parenta69c3d10eee3d4d817251472cd3f38669858a12a (diff)
Merge "Allow OpenLogicalChannel with null aid for privilege apps" into rvc-dev am: da6daab1eb am: a69c3d10ee
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/SecureElement/+/11628925 Change-Id: I4b493adab9fde398ecc411f5cf6411a48599cbc1
Diffstat (limited to 'src')
-rw-r--r--src/com/android/se/SecureElementService.java3
-rw-r--r--src/com/android/se/Terminal.java6
2 files changed, 5 insertions, 4 deletions
diff --git a/src/com/android/se/SecureElementService.java b/src/com/android/se/SecureElementService.java
index 5ca4646..e979fd9 100644
--- a/src/com/android/se/SecureElementService.java
+++ b/src/com/android/se/SecureElementService.java
@@ -303,9 +303,6 @@ public final class SecureElementService extends Service {
throw new IllegalStateException("Session is closed");
} else if (listener == null) {
throw new NullPointerException("listener must not be null");
- } else if (((aid == null) || (aid.length == 0)) && mReader.getTerminal().getName()
- .startsWith(SecureElementService.UICC_TERMINAL)) {
- return null;
} else if ((p2 != 0x00) && (p2 != 0x04) && (p2 != 0x08)
&& (p2 != (byte) 0x0C)) {
throw new UnsupportedOperationException("p2 not supported: "
diff --git a/src/com/android/se/Terminal.java b/src/com/android/se/Terminal.java
index 080f337..4638926 100644
--- a/src/com/android/se/Terminal.java
+++ b/src/com/android/se/Terminal.java
@@ -517,7 +517,7 @@ public class Terminal {
packageName);
try {
channelAccess = setUpChannelAccess(aid, packageName, pid, false);
- } catch (MissingResourceException e) {
+ } catch (MissingResourceException | UnsupportedOperationException e) {
return null;
}
}
@@ -761,6 +761,10 @@ public class Terminal {
}
if (isBasicChannel) {
throw new MissingResourceException("openBasicChannel is not allowed.", "", "");
+ } else if (aid == null) {
+ // openLogicalChannel with null aid is only allowed for privilege applications
+ throw new UnsupportedOperationException(
+ "null aid is not accepted in UICC terminal.");
}
}