CONNECTIVITY_ACTION is the new _IMMEDIATE

Bug: 20013379
Change-Id: I3e904dc0a0ddb30c7bb8cdb24d0762052ddc59eb
This commit is contained in:
Erik Kline
2015-04-20 16:03:48 +09:00
parent 60df4aaea6
commit 152d1b96a6
2 changed files with 18 additions and 18 deletions

View File

@@ -16,7 +16,7 @@
package com.android.server;
import static android.net.ConnectivityManager.CONNECTIVITY_ACTION_IMMEDIATE;
import static android.net.ConnectivityManager.CONNECTIVITY_ACTION;
import static android.net.ConnectivityManager.TYPE_MOBILE;
import static android.net.ConnectivityManager.TYPE_WIFI;
import static android.net.ConnectivityManager.getNetworkTypeName;
@@ -157,7 +157,7 @@ public class ConnectivityServiceTest extends AndroidTestCase {
// mMobile.link.addRoute(MOBILE_ROUTE_V6);
// mMobile.doReturnDefaults();
//
// nextConnBroadcast = mServiceContext.nextBroadcastIntent(CONNECTIVITY_ACTION_IMMEDIATE);
// nextConnBroadcast = mServiceContext.nextBroadcastIntent(CONNECTIVITY_ACTION);
// mTrackerHandler.obtainMessage(EVENT_STATE_CHANGED, mMobile.info).sendToTarget();
// nextConnBroadcast.get();
//
@@ -177,7 +177,7 @@ public class ConnectivityServiceTest extends AndroidTestCase {
// mMobile.link.addRoute(MOBILE_ROUTE_V6);
// mMobile.doReturnDefaults();
//
// nextConnBroadcast = mServiceContext.nextBroadcastIntent(CONNECTIVITY_ACTION_IMMEDIATE);
// nextConnBroadcast = mServiceContext.nextBroadcastIntent(CONNECTIVITY_ACTION);
// mTrackerHandler.obtainMessage(EVENT_STATE_CHANGED, mMobile.info).sendToTarget();
// nextConnBroadcast.get();
//
@@ -193,7 +193,7 @@ public class ConnectivityServiceTest extends AndroidTestCase {
// // expect that mobile will be torn down
// doReturn(true).when(mMobile.tracker).teardown();
//
// nextConnBroadcast = mServiceContext.nextBroadcastIntent(CONNECTIVITY_ACTION_IMMEDIATE);
// nextConnBroadcast = mServiceContext.nextBroadcastIntent(CONNECTIVITY_ACTION);
// mTrackerHandler.obtainMessage(EVENT_STATE_CHANGED, mWifi.info).sendToTarget();
// nextConnBroadcast.get();
//
@@ -212,7 +212,7 @@ public class ConnectivityServiceTest extends AndroidTestCase {
// mMobile.link.clear();
// mMobile.doReturnDefaults();
//
// nextConnBroadcast = mServiceContext.nextBroadcastIntent(CONNECTIVITY_ACTION_IMMEDIATE);
// nextConnBroadcast = mServiceContext.nextBroadcastIntent(CONNECTIVITY_ACTION);
// mTrackerHandler.obtainMessage(EVENT_STATE_CHANGED, mMobile.info).sendToTarget();
// nextConnBroadcast.get();
//

View File

@@ -18,7 +18,7 @@ package com.android.server;
import static android.content.Intent.ACTION_UID_REMOVED;
import static android.content.Intent.EXTRA_UID;
import static android.net.ConnectivityManager.CONNECTIVITY_ACTION_IMMEDIATE;
import static android.net.ConnectivityManager.CONNECTIVITY_ACTION;
import static android.net.ConnectivityManager.TYPE_MOBILE;
import static android.net.ConnectivityManager.TYPE_WIFI;
import static android.net.ConnectivityManager.TYPE_WIMAX;
@@ -191,7 +191,7 @@ public class NetworkStatsServiceTest extends AndroidTestCase {
expectNetworkStatsPoll();
replay();
mServiceContext.sendBroadcast(new Intent(CONNECTIVITY_ACTION_IMMEDIATE));
mServiceContext.sendBroadcast(new Intent(CONNECTIVITY_ACTION));
// verify service has empty history for wifi
assertNetworkTotal(sTemplateWifi, 0L, 0L, 0L, 0L, 0);
@@ -245,7 +245,7 @@ public class NetworkStatsServiceTest extends AndroidTestCase {
expectNetworkStatsPoll();
replay();
mServiceContext.sendBroadcast(new Intent(CONNECTIVITY_ACTION_IMMEDIATE));
mServiceContext.sendBroadcast(new Intent(CONNECTIVITY_ACTION));
// verify service has empty history for wifi
assertNetworkTotal(sTemplateWifi, 0L, 0L, 0L, 0L, 0);
@@ -336,7 +336,7 @@ public class NetworkStatsServiceTest extends AndroidTestCase {
expectNetworkStatsPoll();
replay();
mServiceContext.sendBroadcast(new Intent(CONNECTIVITY_ACTION_IMMEDIATE));
mServiceContext.sendBroadcast(new Intent(CONNECTIVITY_ACTION));
verifyAndReset();
// modify some number on wifi, and trigger poll event
@@ -388,7 +388,7 @@ public class NetworkStatsServiceTest extends AndroidTestCase {
expectNetworkStatsPoll();
replay();
mServiceContext.sendBroadcast(new Intent(CONNECTIVITY_ACTION_IMMEDIATE));
mServiceContext.sendBroadcast(new Intent(CONNECTIVITY_ACTION));
verifyAndReset();
// create some traffic on first network
@@ -430,7 +430,7 @@ public class NetworkStatsServiceTest extends AndroidTestCase {
expectNetworkStatsPoll();
replay();
mServiceContext.sendBroadcast(new Intent(CONNECTIVITY_ACTION_IMMEDIATE));
mServiceContext.sendBroadcast(new Intent(CONNECTIVITY_ACTION));
mServiceContext.sendBroadcast(new Intent(ACTION_NETWORK_STATS_POLL));
verifyAndReset();
@@ -476,7 +476,7 @@ public class NetworkStatsServiceTest extends AndroidTestCase {
expectNetworkStatsPoll();
replay();
mServiceContext.sendBroadcast(new Intent(CONNECTIVITY_ACTION_IMMEDIATE));
mServiceContext.sendBroadcast(new Intent(CONNECTIVITY_ACTION));
verifyAndReset();
// create some traffic
@@ -545,7 +545,7 @@ public class NetworkStatsServiceTest extends AndroidTestCase {
expectNetworkStatsPoll();
replay();
mServiceContext.sendBroadcast(new Intent(CONNECTIVITY_ACTION_IMMEDIATE));
mServiceContext.sendBroadcast(new Intent(CONNECTIVITY_ACTION));
verifyAndReset();
// create some traffic
@@ -579,7 +579,7 @@ public class NetworkStatsServiceTest extends AndroidTestCase {
expectNetworkStatsPoll();
replay();
mServiceContext.sendBroadcast(new Intent(CONNECTIVITY_ACTION_IMMEDIATE));
mServiceContext.sendBroadcast(new Intent(CONNECTIVITY_ACTION));
mServiceContext.sendBroadcast(new Intent(ACTION_NETWORK_STATS_POLL));
verifyAndReset();
@@ -616,7 +616,7 @@ public class NetworkStatsServiceTest extends AndroidTestCase {
expectNetworkStatsPoll();
replay();
mServiceContext.sendBroadcast(new Intent(CONNECTIVITY_ACTION_IMMEDIATE));
mServiceContext.sendBroadcast(new Intent(CONNECTIVITY_ACTION));
verifyAndReset();
// create some traffic for two apps
@@ -682,7 +682,7 @@ public class NetworkStatsServiceTest extends AndroidTestCase {
expectNetworkStatsPoll();
replay();
mServiceContext.sendBroadcast(new Intent(CONNECTIVITY_ACTION_IMMEDIATE));
mServiceContext.sendBroadcast(new Intent(CONNECTIVITY_ACTION));
verifyAndReset();
// create some initial traffic
@@ -747,7 +747,7 @@ public class NetworkStatsServiceTest extends AndroidTestCase {
expectNetworkStatsPoll();
replay();
mServiceContext.sendBroadcast(new Intent(CONNECTIVITY_ACTION_IMMEDIATE));
mServiceContext.sendBroadcast(new Intent(CONNECTIVITY_ACTION));
verifyAndReset();
// create some tethering traffic
@@ -787,7 +787,7 @@ public class NetworkStatsServiceTest extends AndroidTestCase {
expectNetworkStatsPoll();
replay();
mServiceContext.sendBroadcast(new Intent(CONNECTIVITY_ACTION_IMMEDIATE));
mServiceContext.sendBroadcast(new Intent(CONNECTIVITY_ACTION));
verifyAndReset();
// create some traffic, but only for DEV, and across 1.5 buckets