From 81253bc3765faff218f37619fef7f5bfc9ba0a97 Mon Sep 17 00:00:00 2001 From: Dmitry Shmidt Date: Fri, 19 Jul 2013 15:48:50 -0700 Subject: [PATCH] Connectivity: Add IP config to TDLS test Change-Id: I70096a042faaacdaeed7d6aae16a95704202ef1d Signed-off-by: Dmitry Shmidt --- apps/Development/res/values/strings.xml | 2 +- .../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 @@ Start TDLS Stop TDLS - MAC: + IP/MAC: Start MMS Stop MMS 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() {