From: jihwan.seo Date: Tue, 28 Jun 2016 08:01:21 +0000 (+0900) Subject: removed build warning for android X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=996ec86d36d98f9552d5fe6ddea5e34a8ae02f04;p=contrib%2Fiotivity.git removed build warning for android - removed unused method - removed 'write to static field' warning Change-Id: I1964dbae99b01c62a739cca34de57304ac79a434 Signed-off-by: jihwan.seo Reviewed-on: https://gerrit.iotivity.org/gerrit/8985 Tested-by: jenkins-iotivity Reviewed-by: Ashok Babu Channa --- diff --git a/android/android_api/base/src/main/java/org/iotivity/ca/CaBtPairingInterface.java b/android/android_api/base/src/main/java/org/iotivity/ca/CaBtPairingInterface.java index 57b8738..e06d574 100644 --- a/android/android_api/base/src/main/java/org/iotivity/ca/CaBtPairingInterface.java +++ b/android/android_api/base/src/main/java/org/iotivity/ca/CaBtPairingInterface.java @@ -31,7 +31,9 @@ public class CaBtPairingInterface { private static Context mContext; private CaBtPairingInterface(Context context) { - mContext = context; + synchronized(CaBtPairingInterface.class) { + mContext = context; + } registerIntentFilter(); } diff --git a/android/android_api/base/src/main/java/org/iotivity/ca/CaEdrInterface.java b/android/android_api/base/src/main/java/org/iotivity/ca/CaEdrInterface.java index a24e1f3..aaf8bc6 100644 --- a/android/android_api/base/src/main/java/org/iotivity/ca/CaEdrInterface.java +++ b/android/android_api/base/src/main/java/org/iotivity/ca/CaEdrInterface.java @@ -32,7 +32,9 @@ public class CaEdrInterface { private static Context mContext; private CaEdrInterface(Context context) { - mContext = context; + synchronized(CaEdrInterface.class) { + mContext = context; + } registerIntentFilter(); } diff --git a/android/android_api/base/src/main/java/org/iotivity/ca/CaIpInterface.java b/android/android_api/base/src/main/java/org/iotivity/ca/CaIpInterface.java index 2314df9..a747953 100644 --- a/android/android_api/base/src/main/java/org/iotivity/ca/CaIpInterface.java +++ b/android/android_api/base/src/main/java/org/iotivity/ca/CaIpInterface.java @@ -53,7 +53,9 @@ public class CaIpInterface { } private CaIpInterface(Context context) { - mContext = context; + synchronized(CaIpInterface.class) { + mContext = context; + } registerIpStateReceiver(); } diff --git a/android/android_api/base/src/main/java/org/iotivity/ca/CaLeClientInterface.java b/android/android_api/base/src/main/java/org/iotivity/ca/CaLeClientInterface.java index 0aac643..695359b 100644 --- a/android/android_api/base/src/main/java/org/iotivity/ca/CaLeClientInterface.java +++ b/android/android_api/base/src/main/java/org/iotivity/ca/CaLeClientInterface.java @@ -47,10 +47,14 @@ public class CaLeClientInterface { private CaLeClientInterface(Context context) { caLeRegisterLeScanCallback(mLeScanCallback); caLeRegisterGattCallback(mGattCallback); - mContext = context; + synchronized(CaLeClientInterface.class) { + mContext = context; + } registerIntentFilter(); } + + public static void getLeScanCallback() { caLeRegisterLeScanCallback(mLeScanCallback); } diff --git a/android/android_api/base/src/main/java/org/iotivity/ca/CaNfcInterface.java b/android/android_api/base/src/main/java/org/iotivity/ca/CaNfcInterface.java index ebb273b..dee2ac1 100644 --- a/android/android_api/base/src/main/java/org/iotivity/ca/CaNfcInterface.java +++ b/android/android_api/base/src/main/java/org/iotivity/ca/CaNfcInterface.java @@ -49,7 +49,9 @@ public class CaNfcInterface implements NfcAdapter.CreateNdefMessageCallback { private CaNfcInterface(Context context, Activity activity) { Log.d(MYTAG, "NFC registerNfcReceiver"); - mContext = context; + synchronized(CaNfcInterface.class) { + mContext = context; + } mActivity = activity; mAdapter = NfcAdapter.getDefaultAdapter(mContext); diff --git a/resource/csdk/connectivity/src/bt_le_adapter/android/caleclient.c b/resource/csdk/connectivity/src/bt_le_adapter/android/caleclient.c index 4c8df7d..62b4fdc 100644 --- a/resource/csdk/connectivity/src/bt_le_adapter/android/caleclient.c +++ b/resource/csdk/connectivity/src/bt_le_adapter/android/caleclient.c @@ -160,7 +160,7 @@ static void CALEScanThread(void* object) (void)object; bool isAttached = false; - JNIEnv* env; + JNIEnv* env = NULL; jint res = (*g_jvm)->GetEnv(g_jvm, (void**) &env, JNI_VERSION_1_6); if (JNI_OK != res) { @@ -4166,39 +4166,6 @@ Java_org_iotivity_ca_CaLeClientInterface_caLeScanCallback(JNIEnv *env, jobject o } } -static jstring CALEClientGetAddressFromGatt(JNIEnv *env, jobject gatt) -{ - OIC_LOG(DEBUG, TAG, "IN - CAManagerGetAddressFromGatt"); - - VERIFY_NON_NULL_RET(env, TAG, "env is null", NULL); - VERIFY_NON_NULL_RET(gatt, TAG, "gatt is null", NULL); - - jmethodID jni_mid_getDevice = CAGetJNIMethodID(env, CLASSPATH_BT_GATT, - "getDevice", METHODID_BT_DEVICE); - if (!jni_mid_getDevice) - { - OIC_LOG(ERROR, TAG, "jni_mid_getDevice is null"); - return NULL; - } - - jobject jni_obj_device = (*env)->CallObjectMethod(env, gatt, jni_mid_getDevice); - if (!jni_obj_device) - { - OIC_LOG(ERROR, TAG, "jni_obj_device is null"); - return NULL; - } - - jstring jni_address = CALEGetAddressFromBTDevice(env, jni_obj_device); - if (!jni_address) - { - OIC_LOG(ERROR, TAG, "jni_address is null"); - return NULL; - } - - OIC_LOG(DEBUG, TAG, "OUT - CAManagerGetAddressFromGatt"); - return jni_address; -} - /* * Class: org_iotivity_ca_jar_caleinterface * Method: CALeGattConnectionStateChangeCallback