Browse Source

-Bugfix: Check for WiFi connectivity instead of general Internet connectivity

Shankar Karuppayah 8 years ago
parent
commit
fed9280319

+ 1 - 1
AndroidManifest.xml

@@ -41,7 +41,7 @@
             android:value="@integer/google_play_services_lib_version" />
 		<meta-data
 			android:name="com.google.android.maps.v2.API_KEY"
-			android:value="@string/google_maps_api_key_debug" />
+			android:value="@string/google_maps_api_key_release" />
 
         <activity
             android:name="de.tudarmstadt.informatik.hostage.ui2.activity.MainActivity"

+ 4 - 7
src/de/tudarmstadt/informatik/hostage/commons/HelperUtils.java

@@ -396,13 +396,10 @@ public final class HelperUtils {
 	}
 	
 	public static boolean isNetworkAvailable(Context context) {
-         /*Temporary Fix: Remove this after fixing null string bug*/
-        return isWifiConnected(context);
 
-
-//        if(context == null) return false;
-//		ConnectivityManager connectivityManager = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
-//		NetworkInfo activeNetworkInfo = connectivityManager.getActiveNetworkInfo();
-//		return activeNetworkInfo != null && activeNetworkInfo.isConnected();
+        if(context == null) return false;
+		ConnectivityManager connectivityManager = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
+		NetworkInfo activeNetworkInfo = connectivityManager.getActiveNetworkInfo();
+		return activeNetworkInfo != null && activeNetworkInfo.isConnected();
 	}
 }

+ 1 - 1
src/de/tudarmstadt/informatik/hostage/logging/LogExport.java

@@ -75,7 +75,7 @@ public class LogExport extends IntentService{
 			FileOutputStream log;
 			String filename = "hostage_" + (format == null ? "default" : format.toString()) + "_"+ System.currentTimeMillis() + ".log";
 			String externalLocation = pref.getString("pref_external_location", "");
-			String root = Environment.getExternalStorageDirectory().toString();
+            String root = Environment.getExternalStorageDirectory().toString();
 			if (root != null && isExternalStorageWritable()) {
 				File dir = new File(root + externalLocation);
 				dir.mkdirs();