Merge "[DU04-4]Appropriate changes to the NetworkPolicyManager API"
This commit is contained in:
@@ -26,7 +26,7 @@ import static android.net.NetworkStats.UID_TETHERING;
|
|||||||
import static android.net.RouteInfo.RTN_UNICAST;
|
import static android.net.RouteInfo.RTN_UNICAST;
|
||||||
import static android.provider.Settings.Global.TETHER_OFFLOAD_DISABLED;
|
import static android.provider.Settings.Global.TETHER_OFFLOAD_DISABLED;
|
||||||
|
|
||||||
import static com.android.modules.utils.build.SdkLevel.isAtLeastS;
|
import static com.android.modules.utils.build.SdkLevel.isAtLeastT;
|
||||||
import static com.android.networkstack.tethering.OffloadController.StatsType.STATS_PER_IFACE;
|
import static com.android.networkstack.tethering.OffloadController.StatsType.STATS_PER_IFACE;
|
||||||
import static com.android.networkstack.tethering.OffloadController.StatsType.STATS_PER_UID;
|
import static com.android.networkstack.tethering.OffloadController.StatsType.STATS_PER_UID;
|
||||||
import static com.android.networkstack.tethering.OffloadHardwareInterface.ForwardedStats;
|
import static com.android.networkstack.tethering.OffloadHardwareInterface.ForwardedStats;
|
||||||
@@ -666,10 +666,12 @@ public class OffloadControllerTest {
|
|||||||
callback.onStoppedLimitReached();
|
callback.onStoppedLimitReached();
|
||||||
mTetherStatsProviderCb.expectNotifyStatsUpdated();
|
mTetherStatsProviderCb.expectNotifyStatsUpdated();
|
||||||
|
|
||||||
if (isAtLeastS()) {
|
if (isAtLeastT()) {
|
||||||
|
mTetherStatsProviderCb.expectNotifyLimitReached();
|
||||||
|
} else if (Build.VERSION.SDK_INT == Build.VERSION_CODES.S) {
|
||||||
mTetherStatsProviderCb.expectNotifyWarningOrLimitReached();
|
mTetherStatsProviderCb.expectNotifyWarningOrLimitReached();
|
||||||
} else {
|
} else {
|
||||||
mTetherStatsProviderCb.expectLegacyNotifyLimitReached();
|
mTetherStatsProviderCb.expectNotifyLimitReached();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -680,8 +682,13 @@ public class OffloadControllerTest {
|
|||||||
final OffloadHardwareInterface.ControlCallback callback = mControlCallbackCaptor.getValue();
|
final OffloadHardwareInterface.ControlCallback callback = mControlCallbackCaptor.getValue();
|
||||||
callback.onWarningReached();
|
callback.onWarningReached();
|
||||||
mTetherStatsProviderCb.expectNotifyStatsUpdated();
|
mTetherStatsProviderCb.expectNotifyStatsUpdated();
|
||||||
|
|
||||||
|
if (isAtLeastT()) {
|
||||||
|
mTetherStatsProviderCb.expectNotifyWarningReached();
|
||||||
|
} else {
|
||||||
mTetherStatsProviderCb.expectNotifyWarningOrLimitReached();
|
mTetherStatsProviderCb.expectNotifyWarningOrLimitReached();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testAddRemoveDownstreams() throws Exception {
|
public void testAddRemoveDownstreams() throws Exception {
|
||||||
|
|||||||
Reference in New Issue
Block a user