Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fix bug 14: code by vrthra

  • Loading branch information...
commit 8673ac9367dce08fecfde0f4858a03df4647864a 1 parent 8bc56a1
Terkel Sørensen authored
4 AndroidManifest.xml
View
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.voidcode.diasporawebclient"
- android:versionCode="9"
- android:versionName="1.6.2">
+ android:versionCode="10"
+ android:versionName="1.6.3">
<uses-sdk android:minSdkVersion="7" />
<uses-permission android:name="android.permission.INTERNET"/>
BIN  bin/Diaspora-Webclient.apk
View
Binary file not shown
BIN  bin/classes.dex
View
Binary file not shown
BIN  bin/classes/com/voidcode/diasporawebclient/MainActivity$1.class
View
Binary file not shown
BIN  bin/classes/com/voidcode/diasporawebclient/MainActivity$2.class
View
Binary file not shown
BIN  bin/classes/com/voidcode/diasporawebclient/MainActivity$3.class
View
Binary file not shown
BIN  bin/classes/com/voidcode/diasporawebclient/MainActivity$4.class
View
Binary file not shown
BIN  bin/classes/com/voidcode/diasporawebclient/MainActivity.class
View
Binary file not shown
BIN  bin/classes/com/voidcode/diasporawebclient/PodSettingsActivity.class
View
Binary file not shown
BIN  bin/classes/com/voidcode/diasporawebclient/ShareActivity.class
View
Binary file not shown
BIN  bin/resources.ap_
View
Binary file not shown
30 src/com/voidcode/diasporawebclient/MainActivity.java
View
@@ -11,6 +11,7 @@
import android.app.Activity;
import android.app.AlertDialog;
import android.app.ProgressDialog;
+import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
@@ -289,17 +290,20 @@ public boolean onOptionsItemSelected(MenuItem item) {
return super.onOptionsItemSelected(item);
}
}
- private boolean isNetworkAvailable()
- {
- ConnectivityManager connec = (ConnectivityManager)getSystemService(CONNECTIVITY_SERVICE);
- NetworkInfo mobileInfo = connec.getNetworkInfo(0);
- NetworkInfo wifiInfo = connec.getNetworkInfo(1);
- NetworkInfo wimaxInfo = connec.getNetworkInfo(6);
- if (wimaxInfo!=null) {
- return mobileInfo.isConnected() || wifiInfo.isConnected()|| wimaxInfo.isConnected();
- }
- else {
- return mobileInfo.isConnected() || wifiInfo.isConnected();
- }
- }
+ private boolean isNetworkAvailable()
+ {
+ ConnectivityManager connec = (ConnectivityManager)getSystemService(Context.CONNECTIVITY_SERVICE);
+ NetworkInfo mobileInfo = connec.getNetworkInfo(0);
+ NetworkInfo wifiInfo = connec.getNetworkInfo(1);
+ NetworkInfo wimaxInfo = connec.getNetworkInfo(6);
+
+ //fix to bug 14 by vrthra: https://github.com/voidcode/Diaspora-Webclient/issues/14
+ boolean bm = false;
+ boolean bw = false;
+ boolean bx = false;
+ if (mobileInfo != null) bm = mobileInfo.isConnected();
+ if (wimaxInfo != null) bx = wimaxInfo.isConnected();
+ if (wifiInfo != null) bw = wifiInfo.isConnected();
+ return (bm || bw || bx);
+ }
}
16 src/com/voidcode/diasporawebclient/PodSettingsActivity.java
View
@@ -171,15 +171,19 @@ public void Onclick_SaveSettings(View v) throws IOException
private boolean isNetworkAvailable()
{
+
ConnectivityManager connec = (ConnectivityManager)getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo mobileInfo = connec.getNetworkInfo(0);
NetworkInfo wifiInfo = connec.getNetworkInfo(1);
NetworkInfo wimaxInfo = connec.getNetworkInfo(6);
- if (wimaxInfo!=null) {
- return mobileInfo.isConnected() || wifiInfo.isConnected()|| wimaxInfo.isConnected();
- }
- else {
- return mobileInfo.isConnected() || wifiInfo.isConnected();
- }
+
+ //fix to bug 14 by vrthra: https://github.com/voidcode/Diaspora-Webclient/issues/14
+ boolean bm = false;
+ boolean bw = false;
+ boolean bx = false;
+ if (mobileInfo != null) bm = mobileInfo.isConnected();
+ if (wimaxInfo != null) bx = wimaxInfo.isConnected();
+ if (wifiInfo != null) bw = wifiInfo.isConnected();
+ return (bm || bw || bx);
}
}
15 src/com/voidcode/diasporawebclient/ShareActivity.java
View
@@ -93,11 +93,14 @@ private boolean isNetworkAvailable()
NetworkInfo mobileInfo = connec.getNetworkInfo(0);
NetworkInfo wifiInfo = connec.getNetworkInfo(1);
NetworkInfo wimaxInfo = connec.getNetworkInfo(6);
- if (wimaxInfo!=null) {
- return mobileInfo.isConnected() || wifiInfo.isConnected()|| wimaxInfo.isConnected();
- }
- else {
- return mobileInfo.isConnected() || wifiInfo.isConnected();
- }
+
+ //fix to bug 14 by vrthra: https://github.com/voidcode/Diaspora-Webclient/issues/14
+ boolean bm = false;
+ boolean bw = false;
+ boolean bx = false;
+ if (mobileInfo != null) bm = mobileInfo.isConnected();
+ if (wimaxInfo != null) bx = wimaxInfo.isConnected();
+ if (wifiInfo != null) bw = wifiInfo.isConnected();
+ return (bm || bw || bx);
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.