Name specific app for rapid data usage.

When a single app is responsible for more than half of the data usage
that caused us to trigger a "rapid usage" alert, name that app in the
notification.  Tests to verify.

Move NPMS->NSS direct calls to "Internal" pattern, following
best-practices to avoid unnecessary AIDL exposure.

Remove 3G/4G split mobile plan support, which has been deprecated for
years and was never supported in a shipping product.

Move MultipathPolicyTracker in tree to reflect its package name.

Test: bit FrameworksNetTests:*
Test: bit FrameworksServicesTests:com.android.server.NetworkPolicyManagerServiceTest
Bug: 69263587, 64221505, 73431080, 72746951
Exempt-From-Owner-Approval: approved in previous PS
Change-Id: I3e4ec1ae2222d51b232f76f32faca93d4f8cd272
This commit is contained in:
Jeff Sharkey
2018-02-20 17:24:55 -07:00
committed by Jeff Sharkey
parent 2b1592206b
commit d7fce6abbd
2 changed files with 11 additions and 3 deletions

View File

@@ -914,8 +914,10 @@ public class ConnectivityServiceTest {
mock(INetworkPolicyManager.class),
mock(IpConnectivityLog.class));
mService.systemReady();
// Create local CM before sending system ready so that we can answer
// getSystemService() correctly.
mCm = new WrappedConnectivityManager(InstrumentationRegistry.getContext(), mService);
mService.systemReady();
mCm.bindProcessToNetwork(null);
// Ensure that the default setting for Captive Portals is used for most tests
@@ -3412,8 +3414,10 @@ public class ConnectivityServiceTest {
@Test
public void testNetworkCallbackMaximum() {
final int MAX_REQUESTS = 100;
final int CALLBACKS = 90;
// We can only have 99 callbacks, because MultipathPolicyTracker is
// already one of them.
final int MAX_REQUESTS = 99;
final int CALLBACKS = 89;
final int INTENTS = 10;
assertEquals(MAX_REQUESTS, CALLBACKS + INTENTS);

View File

@@ -95,6 +95,7 @@ import android.telephony.TelephonyManager;
import com.android.internal.net.VpnInfo;
import com.android.internal.util.test.BroadcastInterceptingContext;
import com.android.server.LocalServices;
import com.android.server.net.NetworkStatsService.NetworkStatsSettings;
import com.android.server.net.NetworkStatsService.NetworkStatsSettings.Config;
@@ -221,6 +222,9 @@ public class NetworkStatsServiceTest {
@After
public void tearDown() throws Exception {
// Registered by NetworkStatsService's constructor.
LocalServices.removeServiceForTest(NetworkStatsManagerInternal.class);
IoUtils.deleteContents(mStatsDir);
mServiceContext = null;