diff options
author | Lorenzo Colitti <lorenzo@google.com> | 2014-12-19 10:54:27 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2014-12-19 10:54:27 +0000 |
commit | cdaf5c447831935383beb1361f43054b12076aa1 (patch) | |
tree | 6166a495b8b590f126ad7aa53fda72d901575572 /apps | |
parent | bcc85ef1191370563f5e444e72b0b52c4e6a0877 (diff) | |
parent | d0834b363575d6cac6618124f3334720166473c6 (diff) | |
download | android_development-cdaf5c447831935383beb1361f43054b12076aa1.tar.gz android_development-cdaf5c447831935383beb1361f43054b12076aa1.tar.bz2 android_development-cdaf5c447831935383beb1361f43054b12076aa1.zip |
am d0834b36: am 864b2b32: am 85018408: Add a button to the debug app to call reportBadNetwork.
* commit 'd0834b363575d6cac6618124f3334720166473c6':
Add a button to the debug app to call reportBadNetwork.
Diffstat (limited to 'apps')
-rw-r--r-- | apps/Development/res/layout/connectivity.xml | 10 | ||||
-rw-r--r-- | apps/Development/res/values/strings.xml | 2 | ||||
-rw-r--r-- | apps/Development/src/com/android/development/Connectivity.java | 12 |
3 files changed, 24 insertions, 0 deletions
diff --git a/apps/Development/res/layout/connectivity.xml b/apps/Development/res/layout/connectivity.xml index 2aaf6c61f..d23a6b1b9 100644 --- a/apps/Development/res/layout/connectivity.xml +++ b/apps/Development/res/layout/connectivity.xml @@ -274,6 +274,16 @@ android:orientation="horizontal" android:layout_width="match_parent" android:layout_height="wrap_content"> + <Button android:id="@+id/report_all_bad" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="@string/report_all_bad" /> + </LinearLayout> + + <LinearLayout + android:orientation="horizontal" + android:layout_width="match_parent" + android:layout_height="wrap_content"> <Button android:id="@+id/crash" android:layout_width="wrap_content" android:layout_height="wrap_content" diff --git a/apps/Development/res/values/strings.xml b/apps/Development/res/values/strings.xml index 0c13987c4..d670cf4c4 100644 --- a/apps/Development/res/values/strings.xml +++ b/apps/Development/res/values/strings.xml @@ -43,6 +43,8 @@ <string name="start_hipri">Start HiPri</string> <string name="stop_hipri">Stop HiPri</string> <string name="crash">CRASH</string> + <string name="report_all_bad">Report all bad</string> + <string name="netid">NetId</string> <string name="add_default_route">Add Default Route</string> <string name="remove_default_route">Remove Default Route</string> diff --git a/apps/Development/src/com/android/development/Connectivity.java b/apps/Development/src/com/android/development/Connectivity.java index 2dba0e351..a576eb397 100644 --- a/apps/Development/src/com/android/development/Connectivity.java +++ b/apps/Development/src/com/android/development/Connectivity.java @@ -29,6 +29,7 @@ import android.content.SharedPreferences; import android.content.pm.PackageManager.NameNotFoundException; import android.net.ConnectivityManager; import android.net.LinkAddress; +import android.net.Network; import android.net.NetworkUtils; import android.net.RouteInfo; import android.net.wifi.ScanResult; @@ -304,6 +305,7 @@ public class Connectivity extends Activity { findViewById(R.id.stop_mms).setOnClickListener(mClickListener); findViewById(R.id.start_hipri).setOnClickListener(mClickListener); findViewById(R.id.stop_hipri).setOnClickListener(mClickListener); + findViewById(R.id.report_all_bad).setOnClickListener(mClickListener); findViewById(R.id.crash).setOnClickListener(mClickListener); findViewById(R.id.add_default_route).setOnClickListener(mClickListener); @@ -392,6 +394,9 @@ public class Connectivity extends Activity { case R.id.add_default_route: onAddDefaultRoute(); break; + case R.id.report_all_bad: + onReportAllBad(); + break; case R.id.crash: onCrash(); break; @@ -465,6 +470,13 @@ public class Connectivity extends Activity { private void onStopScreenCycle() { } + private void onReportAllBad() { + Network[] networks = mCm.getAllNetworks(); + for (Network network : networks) { + mCm.reportBadNetwork(network); + } + } + private void onCrash() { ConnectivityManager foo = null; foo.startUsingNetworkFeature(ConnectivityManager.TYPE_MOBILE, |