author | kejun.gao <kejun.gao@amlogic.com> | 2014-04-24 14:13:09 (GMT) |
---|---|---|
committer | tao.dong <tao.dong@amlogic.com> | 2014-05-20 07:31:33 (GMT) |
commit | e7e92f76dd503a3f5306d950d7f57be81577c49b (patch) | |
tree | 120109dd880e2d404e6bf0a853ccbbec6873b283 | |
parent | 7a9547dcfa020a3ecdaf334287a274aa82b57a8a (diff) | |
download | PPPoE-e7e92f76dd503a3f5306d950d7f57be81577c49b.zip PPPoE-e7e92f76dd503a3f5306d950d7f57be81577c49b.tar.gz PPPoE-e7e92f76dd503a3f5306d950d7f57be81577c49b.tar.bz2 |
pd#89991:1. Disable net.dhcp.repeat when pppoe connecting and enable net.dhcp.repeat when pppoe disconnected.
2. BUG: Click disconnect button in DialogOfDisconnect causes pppoe connect.
-rwxr-xr-x | src/com/amlogic/PPPoE/PppoeBroadcastReceiver.java | 2 | ||||
-rwxr-xr-x | src/com/amlogic/PPPoE/PppoeConfigDialog.java | 20 |
2 files changed, 19 insertions, 3 deletions
diff --git a/src/com/amlogic/PPPoE/PppoeBroadcastReceiver.java b/src/com/amlogic/PPPoE/PppoeBroadcastReceiver.java index 939d853..5800547 100755 --- a/src/com/amlogic/PPPoE/PppoeBroadcastReceiver.java +++ b/src/com/amlogic/PPPoE/PppoeBroadcastReceiver.java @@ -135,6 +135,8 @@ public class PppoeBroadcastReceiver extends BroadcastReceiver { void set_pppoe_running_flag()
{
+ SystemProperties.set(PppoeConfigDialog.ethernet_dhcp_repeat_flag, "disabled");
+
SystemProperties.set(PppoeConfigDialog.pppoe_running_flag, "100");
String propVal = SystemProperties.get(PppoeConfigDialog.pppoe_running_flag);
int n = 0;
diff --git a/src/com/amlogic/PPPoE/PppoeConfigDialog.java b/src/com/amlogic/PPPoE/PppoeConfigDialog.java index 89e4c54..18e5360 100755 --- a/src/com/amlogic/PPPoE/PppoeConfigDialog.java +++ b/src/com/amlogic/PPPoE/PppoeConfigDialog.java @@ -79,8 +79,9 @@ public class PppoeConfigDialog extends AlertDialog implements DialogInterface.On Timer disconnect_timer = null;
private int pppoe_state = PPPOE_STATE_UNDEFINED;
-
+ private boolean isDialogOfDisconnect = false;
public static final String pppoe_running_flag = "net.pppoe.running";
+ public static final String ethernet_dhcp_repeat_flag = "net.dhcp.repeat";
private TextView mNetworkInterfaces;
private Spinner spinner;
@@ -109,6 +110,8 @@ public class PppoeConfigDialog extends AlertDialog implements DialogInterface.On private void set_pppoe_running_flag()
{
+ SystemProperties.set(ethernet_dhcp_repeat_flag, "disabled");
+
SystemProperties.set(pppoe_running_flag, "100");
String propVal = SystemProperties.get(pppoe_running_flag);
int n = 0;
@@ -127,6 +130,7 @@ public class PppoeConfigDialog extends AlertDialog implements DialogInterface.On private void clear_pppoe_running_flag()
{
+ SystemProperties.set(ethernet_dhcp_repeat_flag, "enabled");
SystemProperties.set(pppoe_running_flag, "0");
String propVal = SystemProperties.get(pppoe_running_flag);
int n = 0;
@@ -244,10 +248,12 @@ public class PppoeConfigDialog extends AlertDialog implements DialogInterface.On if(connectStatus() != PppoeOperation.PPP_STATUS_CONNECTED)
{
+ isDialogOfDisconnect = false;
this.setButton(BUTTON_POSITIVE, context.getText(R.string.pppoe_dial), this);
}
else {
Log.d(TAG, "connectStatus is CONNECTED");
+ isDialogOfDisconnect = true;
//hide AutoDial CheckBox
mCbAutoDial.setVisibility(View.GONE);
@@ -521,8 +527,16 @@ public class PppoeConfigDialog extends AlertDialog implements DialogInterface.On {
switch (which) {
case BUTTON_POSITIVE:
- if(connectStatus() == PppoeOperation.PPP_STATUS_CONNECTED)
+ if(isDialogOfDisconnect) {
+ if (connectStatus() != PppoeOperation.PPP_STATUS_CONNECTED) {
+ Log.d(TAG, "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@");
+ Log.d(TAG, "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@");
+ Log.d(TAG, "@@DANGER: SHOULD CONNECTED when in DialogOfDisconnect@@");
+ Log.d(TAG, "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@");
+ Log.d(TAG, "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@");
+ }
handleStopDial();
+ }
else
handleStartDial();
break;
@@ -562,8 +576,8 @@ public class PppoeConfigDialog extends AlertDialog implements DialogInterface.On if (pppoe_state == PPPOE_STATE_DISCONNECTING) {
waitDialog.cancel();
disconnect_timer.cancel();
- clear_pppoe_running_flag();
}
+ clear_pppoe_running_flag();
pppoe_state = PPPOE_STATE_DISCONNECTED;
showAlertDialog(context.getResources().getString(R.string.pppoe_disconnect_ok));
SystemProperties.set("net.pppoe.isConnected", "false");
|