Merge "Connectivity: Add IP config to TDLS test"

This commit is contained in:
Dmitry Shmidt
2013-07-19 23:27:15 +00:00
committed by Android (Google) Code Review
2 changed files with 15 additions and 3 deletions

View File

@@ -36,7 +36,7 @@
<string name="start_tdls">Start TDLS</string> <string name="start_tdls">Start TDLS</string>
<string name="stop_tdls">Stop TDLS</string> <string name="stop_tdls">Stop TDLS</string>
<string name="mac_tdls"> MAC: </string> <string name="mac_tdls"> IP/MAC: </string>
<string name="start_mms">Start MMS</string> <string name="start_mms">Start MMS</string>
<string name="stop_mms">Stop MMS</string> <string name="stop_mms">Stop MMS</string>

View File

@@ -501,14 +501,26 @@ public class Connectivity extends Activity {
private void onStartTdls() { private void onStartTdls() {
mTdlsAddr = ((EditText)findViewById(R.id.sc_ip_mac)).getText().toString(); mTdlsAddr = ((EditText)findViewById(R.id.sc_ip_mac)).getText().toString();
Log.d(TAG, "TDLS: START " + mTdlsAddr); Log.d(TAG, "TDLS: START " + mTdlsAddr);
InetAddress inetAddress = null;
try {
inetAddress = InetAddress.getByName(mTdlsAddr);
mWm.enableTdls(inetAddress, true);
} catch (Exception e) {
mWm.enableTdlsWithMacAddress(mTdlsAddr, true); mWm.enableTdlsWithMacAddress(mTdlsAddr, true);
} }
}
private void onStopTdls() { private void onStopTdls() {
if (mTdlsAddr == null) return; if (mTdlsAddr == null) return;
Log.d(TAG, "TDLS: STOP " + mTdlsAddr); Log.d(TAG, "TDLS: STOP " + mTdlsAddr);
InetAddress inetAddress = null;
try {
inetAddress = InetAddress.getByName(mTdlsAddr);
mWm.enableTdls(inetAddress, false);
} catch (Exception e) {
mWm.enableTdlsWithMacAddress(mTdlsAddr, false); mWm.enableTdlsWithMacAddress(mTdlsAddr, false);
} }
}
private void onAddDefaultRoute() { private void onAddDefaultRoute() {
try { try {