nxpandroid | 64fd68c | 2015-09-23 16:45:15 +0530 | [diff] [blame] | 1 | /****************************************************************************** |
nxf24591 | dc0bc2c | 2018-02-21 17:33:08 +0530 | [diff] [blame] | 2 | * |
| 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | * you may not use this file except in compliance with the License. |
| 5 | * You may obtain a copy of the License at |
| 6 | * |
| 7 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | * |
| 9 | * Unless required by applicable law or agreed to in writing, software |
| 10 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | * See the License for the specific language governing permissions and |
| 13 | * limitations under the License. |
| 14 | * |
Suraj Uday Kotharkar | e12d10f | 2019-04-17 15:44:08 +0530 | [diff] [blame] | 15 | * Copyright 2018-2019 NXP |
nxf24591 | dc0bc2c | 2018-02-21 17:33:08 +0530 | [diff] [blame] | 16 | * |
| 17 | ******************************************************************************/ |
nxpandroid | 64fd68c | 2015-09-23 16:45:15 +0530 | [diff] [blame] | 18 | |
nxf24591 | dc0bc2c | 2018-02-21 17:33:08 +0530 | [diff] [blame] | 19 | #include <android-base/stringprintf.h> |
| 20 | #include <base/logging.h> |
| 21 | #include "PowerSwitch.h" |
| 22 | #include "RoutingManager.h" |
| 23 | #include <nativehelper/ScopedPrimitiveArray.h> |
| 24 | #include <nativehelper/ScopedUtfChars.h> |
| 25 | #include <nativehelper/ScopedLocalRef.h> |
| 26 | #include "JavaClassConstants.h" |
| 27 | #include "NfcJniUtil.h" |
| 28 | #include "config.h" |
nxf24591 | dc0bc2c | 2018-02-21 17:33:08 +0530 | [diff] [blame] | 29 | #include "SecureElement.h" |
Suraj Uday Kotharkar | a09a2b7 | 2019-04-17 15:07:44 +0530 | [diff] [blame] | 30 | #include "NfcAdaptation.h" |
Suraj Uday Kotharkar | e12d10f | 2019-04-17 15:44:08 +0530 | [diff] [blame] | 31 | #include "NativeJniExtns.h" |
nxf24591 | dc0bc2c | 2018-02-21 17:33:08 +0530 | [diff] [blame] | 32 | using android::base::StringPrintf; |
| 33 | |
nxpandroid | 64fd68c | 2015-09-23 16:45:15 +0530 | [diff] [blame] | 34 | namespace android |
| 35 | { |
nxpandroid | 64fd68c | 2015-09-23 16:45:15 +0530 | [diff] [blame] | 36 | static const int EE_ERROR_INIT = -3; |
nxpandroid | 64fd68c | 2015-09-23 16:45:15 +0530 | [diff] [blame] | 37 | /******************************************************************************* |
| 38 | ** |
| 39 | ** Function: nativeNfcSecureElement_doOpenSecureElementConnection |
| 40 | ** |
| 41 | ** Description: Connect to the secure element. |
| 42 | ** e: JVM environment. |
| 43 | ** o: Java object. |
| 44 | ** |
| 45 | ** Returns: Handle of secure element. values < 0 represent failure. |
| 46 | ** |
| 47 | *******************************************************************************/ |
| 48 | static jint nativeNfcSecureElement_doOpenSecureElementConnection (JNIEnv*, jobject) |
| 49 | { |
nxf24591 | dc0bc2c | 2018-02-21 17:33:08 +0530 | [diff] [blame] | 50 | LOG(INFO) << StringPrintf("%s: Enter; ", __func__); |
nxpandroid | 64fd68c | 2015-09-23 16:45:15 +0530 | [diff] [blame] | 51 | bool stat = false; |
hariprasad nalacheruvu | ba06cec | 2018-06-06 17:55:23 +0530 | [diff] [blame] | 52 | const int32_t recvBufferMaxSize = 1024; |
| 53 | uint8_t recvBuffer [recvBufferMaxSize]; |
| 54 | int32_t recvBufferActualSize = 0; |
| 55 | |
nxpandroid | 64fd68c | 2015-09-23 16:45:15 +0530 | [diff] [blame] | 56 | jint secElemHandle = EE_ERROR_INIT; |
nxpandroid | 64fd68c | 2015-09-23 16:45:15 +0530 | [diff] [blame] | 57 | NFCSTATUS status = NFCSTATUS_FAILED; |
nxpandroid | 64fd68c | 2015-09-23 16:45:15 +0530 | [diff] [blame] | 58 | SecureElement &se = SecureElement::getInstance(); |
hariprasad nalacheruvu | f032814 | 2018-11-07 14:03:02 +0530 | [diff] [blame] | 59 | se.mModeSetNtfstatus = NFA_STATUS_FAILED; |
nxpandroid | 7d44e57 | 2016-08-01 19:11:04 +0530 | [diff] [blame] | 60 | |
Suraj Uday Kotharkar | e12d10f | 2019-04-17 15:44:08 +0530 | [diff] [blame] | 61 | NativeJniExtns::getInstance().notifyNfcEvent(__func__); |
nxf24591 | dc0bc2c | 2018-02-21 17:33:08 +0530 | [diff] [blame] | 62 | /* Tell the controller to power up to get ready for sec elem operations */ |
| 63 | PowerSwitch::getInstance ().setLevel (PowerSwitch::FULL_POWER); |
| 64 | PowerSwitch::getInstance ().setModeOn (PowerSwitch::SE_CONNECTED); |
nxpandroid | 0f06fde | 2017-08-14 11:25:28 +0530 | [diff] [blame] | 65 | |
nxf24591 | dc0bc2c | 2018-02-21 17:33:08 +0530 | [diff] [blame] | 66 | /* If controller is not routing AND there is no pipe connected, |
| 67 | then turn on the sec elem */ |
| 68 | stat = se.activate(SecureElement::ESE_ID); // It is to get the current activated handle. |
nxpandroid | 0f06fde | 2017-08-14 11:25:28 +0530 | [diff] [blame] | 69 | |
nxf24591 | dc0bc2c | 2018-02-21 17:33:08 +0530 | [diff] [blame] | 70 | if((stat) && (nfcFL.eseFL._NCI_NFCEE_PWR_LINK_CMD)) |
nxpandroid | 0f06fde | 2017-08-14 11:25:28 +0530 | [diff] [blame] | 71 | { |
nxf24591 | dc0bc2c | 2018-02-21 17:33:08 +0530 | [diff] [blame] | 72 | status = se.setNfccPwrConfig(se.POWER_ALWAYS_ON|se.COMM_LINK_ACTIVE); |
nxpandroid | 7d44e57 | 2016-08-01 19:11:04 +0530 | [diff] [blame] | 73 | } |
nxpandroid | 0f06fde | 2017-08-14 11:25:28 +0530 | [diff] [blame] | 74 | if(status != NFA_STATUS_OK) |
| 75 | { |
hariprasad nalacheruvu | f032814 | 2018-11-07 14:03:02 +0530 | [diff] [blame] | 76 | LOG(INFO) << StringPrintf("%s: power link command failed", __func__); |
| 77 | stat =false; |
nxpandroid | 0f06fde | 2017-08-14 11:25:28 +0530 | [diff] [blame] | 78 | } |
| 79 | else |
| 80 | { |
nxpandroid | 82f7e9e | 2018-04-05 14:54:41 +0530 | [diff] [blame] | 81 | stat = se.SecEle_Modeset(se.NFCEE_ENABLE); |
hariprasad nalacheruvu | f032814 | 2018-11-07 14:03:02 +0530 | [diff] [blame] | 82 | if(se.mModeSetNtfstatus != NFA_STATUS_OK) |
| 83 | { |
| 84 | stat = false; |
| 85 | LOG(INFO) << StringPrintf("%s: Mode set ntf STATUS_FAILED", __func__); |
hariprasad nalacheruvu | f032814 | 2018-11-07 14:03:02 +0530 | [diff] [blame] | 86 | |
hariprasad nalacheruvu | 7254b03 | 2018-11-13 15:43:47 +0530 | [diff] [blame] | 87 | SyncEventGuard guard (se.mEERecoveryComplete); |
| 88 | { |
| 89 | se.mEERecoveryComplete.wait(); |
| 90 | LOG(INFO) << StringPrintf("%s: Recovery complete", __func__); |
| 91 | } |
| 92 | if(se.mErrorRecovery) |
| 93 | { |
| 94 | stat = true; |
| 95 | } |
| 96 | } |
hariprasad nalacheruvu | ba06cec | 2018-06-06 17:55:23 +0530 | [diff] [blame] | 97 | if(stat == true) |
| 98 | { |
hariprasad nalacheruvu | f032814 | 2018-11-07 14:03:02 +0530 | [diff] [blame] | 99 | se.mIsWiredModeOpen = true; |
Suraj Uday Kotharkar | 9e250fb | 2018-06-08 21:06:52 +0530 | [diff] [blame] | 100 | stat = se.apduGateReset(se.mActiveEeHandle, recvBuffer, &recvBufferActualSize); |
| 101 | if (stat) |
| 102 | { |
| 103 | secElemHandle = se.mActiveEeHandle; |
| 104 | } |
hariprasad nalacheruvu | ba06cec | 2018-06-06 17:55:23 +0530 | [diff] [blame] | 105 | } |
nxpandroid | 0f06fde | 2017-08-14 11:25:28 +0530 | [diff] [blame] | 106 | } |
nxpandroid | 0f06fde | 2017-08-14 11:25:28 +0530 | [diff] [blame] | 107 | |
nxf24591 | dc0bc2c | 2018-02-21 17:33:08 +0530 | [diff] [blame] | 108 | /* if code fails to connect to the secure element, and nothing is active, then |
| 109 | * tell the controller to power down |
| 110 | */ |
| 111 | if ((!stat) && (! PowerSwitch::getInstance ().setModeOff (PowerSwitch::SE_CONNECTED))) |
| 112 | { |
| 113 | LOG(INFO) << StringPrintf("%s: stat fails; ", __func__); |
| 114 | PowerSwitch::getInstance ().setLevel (PowerSwitch::LOW_POWER); |
| 115 | se.deactivate(SecureElement::ESE_ID); |
| 116 | se.mIsWiredModeOpen = false; |
| 117 | stat = false; |
| 118 | } |
| 119 | LOG(INFO) << StringPrintf("%s: exit; return handle=0x%X", __func__, secElemHandle); |
| 120 | return secElemHandle; |
nxpandroid | 64fd68c | 2015-09-23 16:45:15 +0530 | [diff] [blame] | 121 | } |
| 122 | |
| 123 | |
| 124 | /******************************************************************************* |
| 125 | ** |
| 126 | ** Function: nativeNfcSecureElement_doDisconnectSecureElementConnection |
| 127 | ** |
| 128 | ** Description: Disconnect from the secure element. |
| 129 | ** e: JVM environment. |
| 130 | ** o: Java object. |
| 131 | ** handle: Handle of secure element. |
| 132 | ** |
| 133 | ** Returns: True if ok. |
| 134 | ** |
| 135 | *******************************************************************************/ |
| 136 | static jboolean nativeNfcSecureElement_doDisconnectSecureElementConnection (JNIEnv*, jobject, jint handle) |
| 137 | { |
nxf24591 | dc0bc2c | 2018-02-21 17:33:08 +0530 | [diff] [blame] | 138 | LOG(INFO) << StringPrintf("%s: enter; handle=0x%04x", __func__, handle); |
nxpandroid | 64fd68c | 2015-09-23 16:45:15 +0530 | [diff] [blame] | 139 | bool stat = false; |
nxpandroid | 64fd68c | 2015-09-23 16:45:15 +0530 | [diff] [blame] | 140 | NFCSTATUS status = NFCSTATUS_FAILED; |
nxpandroid | 34627bd | 2016-05-27 15:52:30 +0530 | [diff] [blame] | 141 | SecureElement &se = SecureElement::getInstance(); |
nxpandroid | 64fd68c | 2015-09-23 16:45:15 +0530 | [diff] [blame] | 142 | |
nxf24591 | dc0bc2c | 2018-02-21 17:33:08 +0530 | [diff] [blame] | 143 | if(!se.mIsWiredModeOpen) |
| 144 | return false; |
Sreenivas | 88ee6aa | 2018-05-14 13:17:57 +0530 | [diff] [blame] | 145 | /* release any pending transceive wait */ |
| 146 | se.releasePendingTransceive(); |
nxpandroid | 7d44e57 | 2016-08-01 19:11:04 +0530 | [diff] [blame] | 147 | |
nxf24591 | dc0bc2c | 2018-02-21 17:33:08 +0530 | [diff] [blame] | 148 | status = se.setNfccPwrConfig(se.POWER_ALWAYS_ON); |
| 149 | if(status != NFA_STATUS_OK) |
| 150 | { |
| 151 | LOG(INFO) << StringPrintf("%s: power link command failed", __func__); |
nxpandroid | 0f06fde | 2017-08-14 11:25:28 +0530 | [diff] [blame] | 152 | } |
nxf24591 | dc0bc2c | 2018-02-21 17:33:08 +0530 | [diff] [blame] | 153 | else |
| 154 | { |
Sreenivas | f83b876 | 2018-04-09 16:09:49 +0530 | [diff] [blame] | 155 | status = se.sendEvent(SecureElement::EVT_END_OF_APDU_TRANSFER); |
nxf24591 | dc0bc2c | 2018-02-21 17:33:08 +0530 | [diff] [blame] | 156 | if(status == NFA_STATUS_OK) |
Sreenivas | f83b876 | 2018-04-09 16:09:49 +0530 | [diff] [blame] | 157 | stat = true; |
nxf24591 | dc0bc2c | 2018-02-21 17:33:08 +0530 | [diff] [blame] | 158 | } |
Sreenivas | 88ee6aa | 2018-05-14 13:17:57 +0530 | [diff] [blame] | 159 | se.mIsWiredModeOpen = false; |
nxpandroid | 64fd68c | 2015-09-23 16:45:15 +0530 | [diff] [blame] | 160 | |
nxpandroid | 5d64ce9 | 2016-11-18 19:48:53 +0530 | [diff] [blame] | 161 | /* if nothing is active after this, then tell the controller to power down */ |
nxpandroid | 64fd68c | 2015-09-23 16:45:15 +0530 | [diff] [blame] | 162 | if (! PowerSwitch::getInstance ().setModeOff (PowerSwitch::SE_CONNECTED)) |
| 163 | PowerSwitch::getInstance ().setLevel (PowerSwitch::LOW_POWER); |
nxf24591 | dc0bc2c | 2018-02-21 17:33:08 +0530 | [diff] [blame] | 164 | LOG(INFO) << StringPrintf("%s: exit", __func__); |
nxpandroid | 64fd68c | 2015-09-23 16:45:15 +0530 | [diff] [blame] | 165 | return stat ? JNI_TRUE : JNI_FALSE; |
| 166 | } |
| 167 | /******************************************************************************* |
| 168 | ** |
Suraj Uday Kotharkar | ce445d8 | 2019-04-19 10:30:46 +0530 | [diff] [blame] | 169 | ** Function: nativeNfcSecureElement_doResetForEseCosUpdate |
nxpandroid | 64fd68c | 2015-09-23 16:45:15 +0530 | [diff] [blame] | 170 | ** |
| 171 | ** Description: Reset the secure element. |
| 172 | ** e: JVM environment. |
| 173 | ** o: Java object. |
| 174 | ** handle: Handle of secure element. |
| 175 | ** |
| 176 | ** Returns: True if ok. |
| 177 | ** |
| 178 | *******************************************************************************/ |
Suraj Uday Kotharkar | ce445d8 | 2019-04-19 10:30:46 +0530 | [diff] [blame] | 179 | static jboolean nativeNfcSecureElement_doResetForEseCosUpdate(JNIEnv*, jobject, |
| 180 | jint handle) { |
Suraj Uday Kotharkar | a09a2b7 | 2019-04-17 15:07:44 +0530 | [diff] [blame] | 181 | bool stat = false; |
| 182 | int ret = -1; |
| 183 | NfcAdaptation& theInstance = NfcAdaptation::GetInstance(); |
| 184 | tHAL_NFC_ENTRY* halFuncEntries = theInstance.GetHalEntryFuncs (); |
| 185 | nfc_nci_IoctlInOutData_t inpOutData; |
| 186 | inpOutData.inp.level = NCI_ESE_HARD_RESET_IOCTL; |
| 187 | LOG(INFO) << StringPrintf("%s: Entry", __func__); |
| 188 | if(NULL == halFuncEntries) { |
| 189 | LOG(INFO) << StringPrintf("%s: halFuncEntries is NULL", __func__); |
| 190 | } else { |
| 191 | ret = halFuncEntries->ioctl(HAL_NFC_IOCTL_ESE_HARD_RESET, (void*)&inpOutData); |
| 192 | if(ret < 0) { |
| 193 | LOG(INFO) << StringPrintf("%s: IOCTL failed", __func__); |
| 194 | } else { |
| 195 | stat = true; |
nxpandroid | 7d44e57 | 2016-08-01 19:11:04 +0530 | [diff] [blame] | 196 | } |
Suraj Uday Kotharkar | a09a2b7 | 2019-04-17 15:07:44 +0530 | [diff] [blame] | 197 | } |
| 198 | LOG(INFO) << StringPrintf("%s: exit", __func__); |
| 199 | return stat; |
nxpandroid | 64fd68c | 2015-09-23 16:45:15 +0530 | [diff] [blame] | 200 | } |
| 201 | |
| 202 | /******************************************************************************* |
| 203 | ** |
| 204 | ** Function: nativeNfcSecureElement_doGetAtr |
| 205 | ** |
| 206 | ** Description: GetAtr from the connected eSE. |
| 207 | ** e: JVM environment. |
| 208 | ** o: Java object. |
| 209 | ** handle: Handle of secure element. |
| 210 | ** |
| 211 | ** Returns: Buffer of received data. |
| 212 | ** |
| 213 | *******************************************************************************/ |
| 214 | static jbyteArray nativeNfcSecureElement_doGetAtr (JNIEnv* e, jobject, jint handle) |
| 215 | { |
| 216 | bool stat = false; |
nxpandroid | 6fd9cdb | 2017-07-12 18:25:41 +0530 | [diff] [blame] | 217 | const int32_t recvBufferMaxSize = 1024; |
| 218 | uint8_t recvBuffer [recvBufferMaxSize]; |
| 219 | int32_t recvBufferActualSize = 0; |
nxf24591 | dc0bc2c | 2018-02-21 17:33:08 +0530 | [diff] [blame] | 220 | LOG(INFO) << StringPrintf("%s: enter; handle=0x%04x", __func__, handle); |
| 221 | SecureElement &se = SecureElement::getInstance(); |
nxpandroid | 64fd68c | 2015-09-23 16:45:15 +0530 | [diff] [blame] | 222 | |
hariprasad nalacheruvu | ba06cec | 2018-06-06 17:55:23 +0530 | [diff] [blame] | 223 | stat = se.getAtr(recvBuffer, &recvBufferActualSize); |
nxpandroid | 64fd68c | 2015-09-23 16:45:15 +0530 | [diff] [blame] | 224 | |
nxf24591 | dc0bc2c | 2018-02-21 17:33:08 +0530 | [diff] [blame] | 225 | //copy results back to java |
nxpandroid | 64fd68c | 2015-09-23 16:45:15 +0530 | [diff] [blame] | 226 | jbyteArray result = e->NewByteArray(recvBufferActualSize); |
| 227 | if (result != NULL) { |
| 228 | e->SetByteArrayRegion(result, 0, recvBufferActualSize, (jbyte *) recvBuffer); |
| 229 | } |
| 230 | |
nxf24591 | dc0bc2c | 2018-02-21 17:33:08 +0530 | [diff] [blame] | 231 | LOG(INFO) << StringPrintf("%s: exit: recv len=%d", __func__, recvBufferActualSize); |
nxpandroid | 64fd68c | 2015-09-23 16:45:15 +0530 | [diff] [blame] | 232 | |
| 233 | return result; |
| 234 | } |
| 235 | |
| 236 | /******************************************************************************* |
| 237 | ** |
| 238 | ** Function: nativeNfcSecureElement_doTransceive |
| 239 | ** |
| 240 | ** Description: Send data to the secure element; retrieve response. |
| 241 | ** e: JVM environment. |
| 242 | ** o: Java object. |
| 243 | ** handle: Secure element's handle. |
| 244 | ** data: Data to send. |
| 245 | ** |
| 246 | ** Returns: Buffer of received data. |
| 247 | ** |
| 248 | *******************************************************************************/ |
| 249 | static jbyteArray nativeNfcSecureElement_doTransceive (JNIEnv* e, jobject, jint handle, jbyteArray data) |
| 250 | { |
nxpandroid | 6fd9cdb | 2017-07-12 18:25:41 +0530 | [diff] [blame] | 251 | const int32_t recvBufferMaxSize = 0x8800;//1024; 34k |
| 252 | uint8_t recvBuffer [recvBufferMaxSize]; |
| 253 | int32_t recvBufferActualSize = 0; |
nxpandroid | 64fd68c | 2015-09-23 16:45:15 +0530 | [diff] [blame] | 254 | ScopedByteArrayRW bytes(e, data); |
nxf24591 | dc0bc2c | 2018-02-21 17:33:08 +0530 | [diff] [blame] | 255 | LOG(INFO) << StringPrintf("%s: enter; handle=0x%X; buf len=%zu", __func__, handle, bytes.size()); |
| 256 | |
| 257 | SecureElement &se = SecureElement::getInstance(); |
| 258 | if(!se.mIsWiredModeOpen) |
| 259 | return NULL; |
| 260 | |
Sreenivas | 426138e | 2018-04-04 14:56:08 +0530 | [diff] [blame] | 261 | se.transceive(reinterpret_cast<uint8_t*>(&bytes[0]), bytes.size(), recvBuffer, recvBufferMaxSize, recvBufferActualSize, se.SmbTransceiveTimeOutVal); |
nxpandroid | 64fd68c | 2015-09-23 16:45:15 +0530 | [diff] [blame] | 262 | |
nxpandroid | a9a68ba | 2016-01-14 21:12:17 +0530 | [diff] [blame] | 263 | //copy results back to java |
| 264 | jbyteArray result = e->NewByteArray(recvBufferActualSize); |
| 265 | if (result != NULL) |
nxpandroid | 7d44e57 | 2016-08-01 19:11:04 +0530 | [diff] [blame] | 266 | { |
nxpandroid | a9a68ba | 2016-01-14 21:12:17 +0530 | [diff] [blame] | 267 | e->SetByteArrayRegion(result, 0, recvBufferActualSize, (jbyte *) recvBuffer); |
nxpandroid | 7d44e57 | 2016-08-01 19:11:04 +0530 | [diff] [blame] | 268 | } |
nxf24591 | dc0bc2c | 2018-02-21 17:33:08 +0530 | [diff] [blame] | 269 | |
| 270 | LOG(INFO) << StringPrintf("%s: exit: recv len=%d", __func__, recvBufferActualSize); |
nxpandroid | a9a68ba | 2016-01-14 21:12:17 +0530 | [diff] [blame] | 271 | return result; |
nxpandroid | 64fd68c | 2015-09-23 16:45:15 +0530 | [diff] [blame] | 272 | } |
| 273 | |
| 274 | /***************************************************************************** |
| 275 | ** |
| 276 | ** Description: JNI functions |
| 277 | ** |
| 278 | *****************************************************************************/ |
Suraj Uday Kotharkar | ce445d8 | 2019-04-19 10:30:46 +0530 | [diff] [blame] | 279 | static JNINativeMethod gMethods[] = { |
| 280 | {"doNativeOpenSecureElementConnection", "()I", |
| 281 | (void*)nativeNfcSecureElement_doOpenSecureElementConnection}, |
| 282 | {"doNativeDisconnectSecureElementConnection", "(I)Z", |
| 283 | (void*)nativeNfcSecureElement_doDisconnectSecureElementConnection}, |
| 284 | {"doResetForEseCosUpdate", "(I)Z", |
| 285 | (void*)nativeNfcSecureElement_doResetForEseCosUpdate}, |
| 286 | {"doTransceive", "(I[B)[B", (void*)nativeNfcSecureElement_doTransceive}, |
| 287 | {"doNativeGetAtr", "(I)[B", (void*)nativeNfcSecureElement_doGetAtr}, |
nxpandroid | 64fd68c | 2015-09-23 16:45:15 +0530 | [diff] [blame] | 288 | }; |
| 289 | |
| 290 | |
| 291 | /******************************************************************************* |
| 292 | ** |
| 293 | ** Function: register_com_android_nfc_NativeNfcSecureElement |
| 294 | ** |
| 295 | ** Description: Regisgter JNI functions with Java Virtual Machine. |
| 296 | ** e: Environment of JVM. |
| 297 | ** |
| 298 | ** Returns: Status of registration. |
| 299 | ** |
| 300 | *******************************************************************************/ |
| 301 | int register_com_android_nfc_NativeNfcSecureElement(JNIEnv *e) |
| 302 | { |
| 303 | return jniRegisterNativeMethods(e, gNativeNfcSecureElementClassName, |
| 304 | gMethods, NELEM(gMethods)); |
| 305 | } |
| 306 | |
nxpandroid | 64fd68c | 2015-09-23 16:45:15 +0530 | [diff] [blame] | 307 | } // namespace android |