diff options
| author | Dmitry Shmidt <dimitrysh@google.com> | 2013-07-19 15:48:50 -0700 |
|---|---|---|
| committer | Dmitry Shmidt <dimitrysh@google.com> | 2013-07-19 15:55:35 -0700 |
| commit | 81253bc3765faff218f37619fef7f5bfc9ba0a97 (patch) | |
| tree | 165dd0f79402ccd9f53f197da48317059c5ae0fe /apps | |
| parent | 47a5a18431a9fd7256f4a53a9d845fd2ab5bba3a (diff) | |
| download | android_development-81253bc3765faff218f37619fef7f5bfc9ba0a97.tar.gz android_development-81253bc3765faff218f37619fef7f5bfc9ba0a97.tar.bz2 android_development-81253bc3765faff218f37619fef7f5bfc9ba0a97.zip | |
Connectivity: Add IP config to TDLS test
Change-Id: I70096a042faaacdaeed7d6aae16a95704202ef1d
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
Diffstat (limited to 'apps')
| -rw-r--r-- | apps/Development/res/values/strings.xml | 2 | ||||
| -rw-r--r-- | apps/Development/src/com/android/development/Connectivity.java | 16 |
2 files changed, 15 insertions, 3 deletions
diff --git a/apps/Development/res/values/strings.xml b/apps/Development/res/values/strings.xml index dc36859aa..ced7b727d 100644 --- a/apps/Development/res/values/strings.xml +++ b/apps/Development/res/values/strings.xml @@ -36,7 +36,7 @@ <string name="start_tdls">Start 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="stop_mms">Stop MMS</string> diff --git a/apps/Development/src/com/android/development/Connectivity.java b/apps/Development/src/com/android/development/Connectivity.java index 12fa24a8e..0da1410f0 100644 --- a/apps/Development/src/com/android/development/Connectivity.java +++ b/apps/Development/src/com/android/development/Connectivity.java @@ -501,13 +501,25 @@ public class Connectivity extends Activity { private void onStartTdls() { mTdlsAddr = ((EditText)findViewById(R.id.sc_ip_mac)).getText().toString(); Log.d(TAG, "TDLS: START " + mTdlsAddr); - mWm.enableTdlsWithMacAddress(mTdlsAddr, true); + InetAddress inetAddress = null; + try { + inetAddress = InetAddress.getByName(mTdlsAddr); + mWm.enableTdls(inetAddress, true); + } catch (Exception e) { + mWm.enableTdlsWithMacAddress(mTdlsAddr, true); + } } private void onStopTdls() { if (mTdlsAddr == null) return; Log.d(TAG, "TDLS: STOP " + mTdlsAddr); - mWm.enableTdlsWithMacAddress(mTdlsAddr, false); + InetAddress inetAddress = null; + try { + inetAddress = InetAddress.getByName(mTdlsAddr); + mWm.enableTdls(inetAddress, false); + } catch (Exception e) { + mWm.enableTdlsWithMacAddress(mTdlsAddr, false); + } } private void onAddDefaultRoute() { |
