Commit 7a551aee authored by jihwan.seo's avatar jihwan.seo Committed by Ashok Babu Channa

fixed some crash for NFC.

Change-Id: I6abdd1cd99771a73876ffb5e8d2a9da40d2f19c0
Signed-off-by: default avatarjihwan.seo <jihwan.seo@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/6309Tested-by: default avatarjenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: default avatarAshok Babu Channa <ashok.channa@samsung.com>
parent 9cbaf930
......@@ -70,6 +70,12 @@ void CANFCSetPacketReceiveCallback(CANFCPacketReceivedCallback callback)
CAResult_t SetCreateNdefMessageCallbackfromNative(JNIEnv* env)
{
OIC_LOG(DEBUG, TAG, "SetCreateNdefMessageCallbackfromNative IN");
VERIFY_NON_NULL(env, TAG, "env");
VERIFY_NON_NULL(g_context, TAG, "g_context");
VERIFY_NON_NULL(g_activity, TAG, "g_activity");
VERIFY_NON_NULL(g_nfcInterface, TAG, "g_nfcInterface");
jclass cid_NfcAdapter = (*env)->FindClass(env, "android/nfc/NfcAdapter");
if (!cid_NfcAdapter)
{
......@@ -122,17 +128,9 @@ CAResult_t CANfcCreateJniInterfaceObject()
{
OIC_LOG(DEBUG, TAG, "CANfcCreateJniInterfaceObject IN");
if (!g_context)
{
OIC_LOG(ERROR, TAG, "g_context is null");
return CA_STATUS_FAILED;
}
if (!g_jvm)
{
OIC_LOG(ERROR, TAG, "g_jvm is null");
return CA_STATUS_FAILED;
}
VERIFY_NON_NULL(g_activity, TAG, "g_activity");
VERIFY_NON_NULL(g_context, TAG, "g_context");
VERIFY_NON_NULL(g_jvm, TAG, "g_jvm");
bool isAttached = false;
JNIEnv* env;
......@@ -416,6 +414,8 @@ Java_org_iotivity_ca_CaNfcInterface_caNativeNfcInvokeBeam(JNIEnv *env, jobject o
OIC_LOG(DEBUG, TAG, "cANativeNfcInvokeBeam : IN");
VERIFY_NON_NULL_RET(env, TAG, "env is null", false);
VERIFY_NON_NULL_RET(obj, TAG, "obj is null", false);
VERIFY_NON_NULL_RET(g_context, TAG, "g_context is null", false);
VERIFY_NON_NULL_RET(g_activity, TAG, "g_activity is null", false);
jclass cid_NfcAdapter = (*env)->FindClass(env, "android/nfc/NfcAdapter");
if (!cid_NfcAdapter)
......@@ -516,6 +516,8 @@ CAResult_t CANfcSendDataImpl(const CAEndpoint_t * ep, const char* data, uint32_t
{
VERIFY_NON_NULL(ep, TAG, "CANfcSendDataImpl : endpoint is null");
VERIFY_NON_NULL(data, TAG, "CANfcSendDataImpl : data is null");
VERIFY_NON_NULL(g_jvm, TAG, "CANfcSendDataImpl : g_jvm is null");
OIC_LOG(INFO, TAG, "CANfcSendDataImpl moved env outside");
bool isAttached = false;
JNIEnv* env;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment