removed build warning for android
authorjihwan.seo <jihwan.seo@samsung.com>
Tue, 28 Jun 2016 08:01:21 +0000 (17:01 +0900)
committerAshok Babu Channa <ashok.channa@samsung.com>
Wed, 29 Jun 2016 12:33:12 +0000 (12:33 +0000)
- removed unused method
- removed 'write to static field' warning

Change-Id: I1964dbae99b01c62a739cca34de57304ac79a434
Signed-off-by: jihwan.seo <jihwan.seo@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/8985
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Ashok Babu Channa <ashok.channa@samsung.com>
android/android_api/base/src/main/java/org/iotivity/ca/CaBtPairingInterface.java
android/android_api/base/src/main/java/org/iotivity/ca/CaEdrInterface.java
android/android_api/base/src/main/java/org/iotivity/ca/CaIpInterface.java
android/android_api/base/src/main/java/org/iotivity/ca/CaLeClientInterface.java
android/android_api/base/src/main/java/org/iotivity/ca/CaNfcInterface.java
resource/csdk/connectivity/src/bt_le_adapter/android/caleclient.c

index 57b8738..e06d574 100644 (file)
@@ -31,7 +31,9 @@ public class CaBtPairingInterface {
     private static Context mContext;
 
     private CaBtPairingInterface(Context context) {
-        mContext = context;
+        synchronized(CaBtPairingInterface.class) {
+            mContext = context;
+        }
         registerIntentFilter();
     }
 
index a24e1f3..aaf8bc6 100644 (file)
@@ -32,7 +32,9 @@ public class CaEdrInterface {
     private static Context mContext;
 
     private CaEdrInterface(Context context) {
-        mContext = context;
+        synchronized(CaEdrInterface.class) {
+            mContext = context;
+        }
         registerIntentFilter();
     }
 
index 2314df9..a747953 100644 (file)
@@ -53,7 +53,9 @@ public class CaIpInterface {
     }\r
 \r
     private CaIpInterface(Context context) {\r
-        mContext = context;\r
+        synchronized(CaIpInterface.class) {\r
+            mContext = context;\r
+        }\r
         registerIpStateReceiver();\r
     }\r
 \r
index 0aac643..695359b 100644 (file)
@@ -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);
     }
index ebb273b..dee2ac1 100644 (file)
@@ -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);
index 4c8df7d..62b4fdc 100644 (file)
@@ -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