Update the Dev Tools app to the new route add/remove API.

Cherry-pick of:
https://googleplex-android-review.git.corp.google.com/#/c/450447/

Change-Id: I629123567c907f0979e44998ef8d828b47059ec0
This commit is contained in:
Sreeram Ramachandran
2014-04-15 19:04:19 -07:00
committed by Lorenzo Colitti
parent f98bce8f58
commit b24ff8773d
3 changed files with 13 additions and 2 deletions

View File

@@ -524,7 +524,8 @@ public class Connectivity extends Activity {
private void onAddDefaultRoute() {
try {
mNetd.addRoute("eth0", new RouteInfo(null,
int netId = Integer.valueOf(((TextView) findViewById(R.id.netid)).getText().toString());
mNetd.addRoute(netId, new RouteInfo(null,
NetworkUtils.numericToInetAddress("8.8.8.8")));
} catch (Exception e) {
Log.e(TAG, "onAddDefaultRoute got exception: " + e.toString());
@@ -533,7 +534,8 @@ public class Connectivity extends Activity {
private void onRemoveDefaultRoute() {
try {
mNetd.removeRoute("eth0", new RouteInfo(null,
int netId = Integer.valueOf(((TextView) findViewById(R.id.netid)).getText().toString());
mNetd.removeRoute(netId, new RouteInfo(null,
NetworkUtils.numericToInetAddress("8.8.8.8")));
} catch (Exception e) {
Log.e(TAG, "onRemoveDefaultRoute got exception: " + e.toString());