Skip to content

Commit 2568416

Browse files
committed
Fixes #179: Specialize connectivity error messages to indicate Wifi connectivity
1 parent c3baacb commit 2568416

File tree

5 files changed

+10
-7
lines changed

5 files changed

+10
-7
lines changed

Examples/restcomm-messenger/app/src/main/java/com/telestax/restcomm_messenger/CallActivity.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ public void run() {
189189

190190
if (connection == null) {
191191
Log.e(TAG, "Error: error connecting");
192-
showOkAlert("RCDevice Error", "No network connectivity");
192+
showOkAlert("RCDevice Error", "No Wifi connectivity");
193193
return;
194194
}
195195
}

Examples/restcomm-messenger/app/src/main/java/com/telestax/restcomm_messenger/MainActivity.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ protected void onResume() {
113113
super.onResume();
114114

115115
if (device.getState() == RCDevice.DeviceState.OFFLINE) {
116-
showOkAlert("No Connectivity", "No network connectivity");
116+
showOkAlert("No Connectivity", "No Wifi connectivity");
117117
}
118118
// The activity has become visible (it is now "resumed").
119119
Log.i(TAG, "%% onResume");
@@ -176,7 +176,7 @@ public void onClick(View view) {
176176
}
177177
else if (view.getId() == R.id.button_register) {
178178
if (!device.updateParams(params)) {
179-
showOkAlert("RCDevice Error", "No network connectivity");
179+
showOkAlert("RCDevice Error", "No Wifi connectivity");
180180
}
181181

182182
}
@@ -223,7 +223,7 @@ public void onStopListening(RCDevice device)
223223
public void onStopListening(RCDevice device, int errorCode, String errorText)
224224
{
225225
if (errorCode == RCClient.ErrorCodes.NO_CONNECTIVITY.ordinal()) {
226-
showOkAlert("No Connectivity", errorText);
226+
showOkAlert("No Wifi Connectivity", errorText);
227227
}
228228
else if (errorCode == RCClient.ErrorCodes.GENERIC_ERROR.ordinal()) {
229229
showOkAlert("Generic Error", errorText);
@@ -289,7 +289,7 @@ public void onSharedPreferenceChanged(SharedPreferences sharedPreferences,
289289
}
290290
if (updated) {
291291
if (!device.updateParams(params)) {
292-
showOkAlert("RCDevice Error", "No network connectivity");
292+
showOkAlert("RCDevice Error", "No Wifi connectivity");
293293
}
294294
}
295295
}

Examples/restcomm-messenger/app/src/main/java/com/telestax/restcomm_messenger/MessageActivity.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ public void onClick(View view) {
119119
txtMessage.setText("");
120120
}
121121
else {
122-
showOkAlert("RCDevice Error", "No network connectivity");
122+
showOkAlert("RCDevice Error", "No Wifi connectivity");
123123
}
124124
}
125125
}

restcomm.android.client.sdk/src/main/java/org/mobicents/restcomm/android/client/sdk/RCClient.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ else if (errorCode == ErrorCodes.CONNECTION_TIMEOUT) {
6363
return "Connection timed out";
6464
}
6565
else if (errorCode == ErrorCodes.NO_CONNECTIVITY) {
66-
return "No network connectivity";
66+
return "No Wifi connectivity";
6767
}
6868
else if (errorCode == ErrorCodes.WEBRTC_PEERCONNECTION_ERROR) {
6969
return "Webrtc Peer Connection error";

sipua/src/main/java/org/mobicents/restcomm/android/sipua/impl/DeviceImpl.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,10 +344,13 @@ static public ReachabilityState checkReachability(Context context)
344344
return ReachabilityState.REACHABILITY_WIFI;
345345
}
346346

347+
// TODO: leave mobile internet out until we fix some issues that came up; check https://github.com/Mobicents/restcomm-android-sdk/issues/172
348+
/*
347349
if (activeNetwork.getType() == ConnectivityManager.TYPE_MOBILE && activeNetwork.isConnected()) {
348350
Log.w(TAG, "Reachability event: MOBILE");
349351
return ReachabilityState.REACHABILITY_MOBILE;
350352
}
353+
*/
351354
}
352355
Log.w(TAG, "Reachability event: NONE");
353356
return ReachabilityState.REACHABILITY_NONE;

0 commit comments

Comments
 (0)