author | kejun.gao <kejun.gao@amlogic.com> | 2012-06-27 15:04:03 (GMT) |
---|---|---|
committer | kejun.gao <kejun.gao@amlogic.com> | 2012-06-27 15:04:03 (GMT) |
commit | 0bf469825d289823e41581323d6a3ff69dda9fee (patch) | |
tree | 8e75149d26e7f106b4c2c0e1256492195994464f | |
parent | 0d674dc7d464b125d927014a0d5b0165e1159dbd (diff) | |
download | PPPoE-0bf469825d289823e41581323d6a3ff69dda9fee.zip PPPoE-0bf469825d289823e41581323d6a3ff69dda9fee.tar.gz PPPoE-0bf469825d289823e41581323d6a3ff69dda9fee.tar.bz2 |
Support get error code for APK
-rwxr-xr-x | res/values-zh-rCN/strings.xml | 2 | ||||
-rwxr-xr-x | res/values-zh-rTW/strings.xml | 2 | ||||
-rwxr-xr-x | res/values/strings.xml | 4 | ||||
-rwxr-xr-x | src/com/amlogic/PPPoE/PppoeConfigDialog.java | 28 |
4 files changed, 30 insertions, 6 deletions
diff --git a/res/values-zh-rCN/strings.xml b/res/values-zh-rCN/strings.xml index adf1f29..71a3cba 100755 --- a/res/values-zh-rCN/strings.xml +++ b/res/values-zh-rCN/strings.xml @@ -14,6 +14,8 @@ <string name="pppoe_conf_summary">宽带拨号配置</string> <string name="pppoe_connect_ok">宽带拨号成功</string> <string name="pppoe_connect_failed">宽带拨号失败</string> + <string name="pppoe_connect_failed_server_no_response">服务器未响应</string> + <string name="pppoe_connect_failed_auth">无效的用户名或密码</string> <string name="pppoe_disconnect_ok">宽带拨号断开成功</string> <string name="pppoe_disconnect_failed">宽带拨号断开失败</string> <string name="pppoe_ppp_interface_occupied">ppp接口被占用</string> diff --git a/res/values-zh-rTW/strings.xml b/res/values-zh-rTW/strings.xml index 92070f5..33bc789 100755 --- a/res/values-zh-rTW/strings.xml +++ b/res/values-zh-rTW/strings.xml @@ -14,6 +14,8 @@ <string name="pppoe_conf_summary">寬帶撥號配置</string> <string name="pppoe_connect_ok">寬帶撥號成功</string> <string name="pppoe_connect_failed">寬帶撥號失败</string> + <string name="pppoe_connect_failed_server_no_response">服務器未響應</string> + <string name="pppoe_connect_failed_auth">無效的用戶名或密碼</string> <string name="pppoe_disconnect_ok">寬帶撥號断开成功</string> <string name="pppoe_disconnect_failed">寬帶撥號断开失败</string> <string name="pppoe_ppp_interface_occupied">ppp接口被佔用</string> diff --git a/res/values/strings.xml b/res/values/strings.xml index 6c88644..c4f9c10 100755 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -13,7 +13,9 @@ <string name="pppoe_hangup_waiting_msg">Please wait for hangup...</string> <string name="pppoe_conf_summary">Configure dial</string> <string name="pppoe_connect_ok">Connect Ok!</string> - <string name="pppoe_connect_failed">Connect failed!</string> + <string name="pppoe_connect_failed">Connect failed</string> + <string name="pppoe_connect_failed_server_no_response">NO Response</string> + <string name="pppoe_connect_failed_auth">Invalid username or password</string> <string name="pppoe_disconnect_ok">Disconnect OK!</string> <string name="pppoe_disconnect_failed">Disconnect failed!</string> <string name="pppoe_ppp_interface_occupied">ppp interface occupied!</string> diff --git a/src/com/amlogic/PPPoE/PppoeConfigDialog.java b/src/com/amlogic/PPPoE/PppoeConfigDialog.java index 93e8c1a..4a63c28 100755 --- a/src/com/amlogic/PPPoE/PppoeConfigDialog.java +++ b/src/com/amlogic/PPPoE/PppoeConfigDialog.java @@ -450,7 +450,7 @@ public class PppoeConfigDialog extends AlertDialog implements DialogInterface.On disconnect_before_connect_timer.schedule(disconnect_before_connect_check_task, 5000);
- connect_timer.schedule(check_task, 35000);
+ connect_timer.schedule(check_task, 60000 * 3);
showWaitDialog(R.string.pppoe_dial_waiting_msg);
set_pppoe_running_flag();
@@ -468,7 +468,7 @@ public class PppoeConfigDialog extends AlertDialog implements DialogInterface.On switch (msg.what) {
case MSG_DISCONNECT_TIMEOUT:
waitDialog.cancel();
- showAlertDialog(context.getResources().getString(R.string.pppoe_disconnect_ok));
+ showAlertDialog(context.getResources().getString(R.string.pppoe_disconnect_failed));
clear_pppoe_running_flag();
break;
}
@@ -491,7 +491,7 @@ public class PppoeConfigDialog extends AlertDialog implements DialogInterface.On };
//Timeout after 5 seconds
- disconnect_timer.schedule(check_task, 5000);
+ disconnect_timer.schedule(check_task, 50000);
showWaitDialog(R.string.pppoe_hangup_waiting_msg);
}
@@ -559,8 +559,26 @@ public class PppoeConfigDialog extends AlertDialog implements DialogInterface.On if(event == PppoeStateTracker.EVENT_DISCONNECTED)
{
- //waitDialog.cancel();
- //showAlertDialog(context.getResources().getString(R.string.pppoe_connect_failed));
+ waitDialog.cancel();
+ disconnect_timer.cancel();
+ showAlertDialog(context.getResources().getString(R.string.pppoe_disconnect_ok));
+ clear_pppoe_running_flag();
+ }
+
+ if(event == PppoeStateTracker.EVENT_CONNECT_FAILED)
+ {
+ String ppp_err = intent.getStringExtra(PppoeManager.EXTRA_PPPOE_ERRCODE);
+ Log.d(TAG, "#####errcode: " + ppp_err);
+ waitDialog.cancel();
+ connect_timer.cancel();
+
+ String reason = "";
+ if (ppp_err.equals("10:1"))
+ reason = context.getResources().getString(R.string.pppoe_connect_failed_auth);
+ else if (ppp_err.equals("10:2"))
+ reason = context.getResources().getString(R.string.pppoe_connect_failed_server_no_response);
+
+ showAlertDialog(context.getResources().getString(R.string.pppoe_connect_failed) + "\n" + reason);
}
}
|