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.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_UID;
|
||||
import static com.android.networkstack.tethering.OffloadHardwareInterface.ForwardedStats;
|
||||
@@ -666,10 +666,12 @@ public class OffloadControllerTest {
|
||||
callback.onStoppedLimitReached();
|
||||
mTetherStatsProviderCb.expectNotifyStatsUpdated();
|
||||
|
||||
if (isAtLeastS()) {
|
||||
if (isAtLeastT()) {
|
||||
mTetherStatsProviderCb.expectNotifyLimitReached();
|
||||
} else if (Build.VERSION.SDK_INT == Build.VERSION_CODES.S) {
|
||||
mTetherStatsProviderCb.expectNotifyWarningOrLimitReached();
|
||||
} else {
|
||||
mTetherStatsProviderCb.expectLegacyNotifyLimitReached();
|
||||
mTetherStatsProviderCb.expectNotifyLimitReached();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -680,7 +682,12 @@ public class OffloadControllerTest {
|
||||
final OffloadHardwareInterface.ControlCallback callback = mControlCallbackCaptor.getValue();
|
||||
callback.onWarningReached();
|
||||
mTetherStatsProviderCb.expectNotifyStatsUpdated();
|
||||
mTetherStatsProviderCb.expectNotifyWarningOrLimitReached();
|
||||
|
||||
if (isAtLeastT()) {
|
||||
mTetherStatsProviderCb.expectNotifyWarningReached();
|
||||
} else {
|
||||
mTetherStatsProviderCb.expectNotifyWarningOrLimitReached();
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user