diff options
| author | 2021-01-22 04:42:49 +0000 | |
|---|---|---|
| committer | 2021-01-22 04:42:49 +0000 | |
| commit | c7396ea49277adb009e86ab0c0173ef4ece40b12 (patch) | |
| tree | 57bc17bf9338e694290859dc819c72d66b5d1ccb | |
| parent | 796c87835254d84c1d1ad210b3bc3ffa13683271 (diff) | |
| parent | 27a214dabd3730d6e2159e88cba4c54ca8140c4d (diff) | |
Merge "Add intent to notify applications when the secure element state changed" am: 286dc55bc9 am: 27a214dabd
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1531801
MUST ONLY BE SUBMITTED BY AUTOMERGER
Change-Id: I7cded08c01c754a8ef4b80ca8f0f2bda21c68e48
| -rw-r--r-- | core/api/current.txt | 3 | ||||
| -rw-r--r-- | core/java/android/se/omapi/SEService.java | 25 | ||||
| -rw-r--r-- | core/res/AndroidManifest.xml | 3 |
3 files changed, 31 insertions, 0 deletions
diff --git a/core/api/current.txt b/core/api/current.txt index 3551db6d2a43..047761a0cbe9 100644 --- a/core/api/current.txt +++ b/core/api/current.txt @@ -35889,6 +35889,9 @@ package android.se.omapi { method @NonNull public String getVersion(); method public boolean isConnected(); method public void shutdown(); + field public static final String ACTION_SECURE_ELEMENT_STATE_CHANGED = "android.se.omapi.action.SECURE_ELEMENT_STATE_CHANGED"; + field public static final String EXTRA_READER_NAME = "android.se.omapi.extra.READER_NAME"; + field public static final String EXTRA_READER_STATE = "android.se.omapi.extra.READER_STATE"; } public static interface SEService.OnConnectedListener { diff --git a/core/java/android/se/omapi/SEService.java b/core/java/android/se/omapi/SEService.java index a5c5c613e1f2..333af91ac872 100644 --- a/core/java/android/se/omapi/SEService.java +++ b/core/java/android/se/omapi/SEService.java @@ -22,7 +22,10 @@ package android.se.omapi; +import android.annotation.BroadcastBehavior; import android.annotation.NonNull; +import android.annotation.SdkConstant; +import android.annotation.SdkConstant.SdkConstantType; import android.content.ComponentName; import android.content.Context; import android.content.Intent; @@ -71,6 +74,28 @@ public final class SEService { } /** + * Broadcast Action: Intent to notify if the secure element state is changed. + */ + @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) + @BroadcastBehavior(registeredOnly = true, protectedBroadcast = true) + public static final String ACTION_SECURE_ELEMENT_STATE_CHANGED = + "android.se.omapi.action.SECURE_ELEMENT_STATE_CHANGED"; + + /** + * Mandatory extra containing the reader name of the state changed secure element. + * + * @see Reader#getName() + */ + public static final String EXTRA_READER_NAME = "android.se.omapi.extra.READER_NAME"; + + /** + * Mandatory extra containing the connected state of the state changed secure element. + * + * True if the secure element is connected correctly, false otherwise. + */ + public static final String EXTRA_READER_STATE = "android.se.omapi.extra.READER_STATE"; + + /** * Listener object that allows the notification of the caller if this * SEService could be bound to the backend. */ diff --git a/core/res/AndroidManifest.xml b/core/res/AndroidManifest.xml index d2a0c91112aa..1cdfbd0b7e94 100644 --- a/core/res/AndroidManifest.xml +++ b/core/res/AndroidManifest.xml @@ -315,6 +315,9 @@ <protected-broadcast android:name="android.net.nsd.STATE_CHANGED" /> + <!-- For OMAPI --> + <protected-broadcast android:name="android.se.omapi.action.SECURE_ELEMENT_STATE_CHANGED" /> + <protected-broadcast android:name="android.nfc.action.ADAPTER_STATE_CHANGED" /> <protected-broadcast android:name="android.nfc.action.ALWAYS_ON_STATE_CHANGED" /> <protected-broadcast android:name="android.nfc.action.PREFERRED_PAYMENT_CHANGED" /> |