diff --git a/Tethering/tests/unit/src/com/android/networkstack/tethering/OffloadControllerTest.java b/Tethering/tests/unit/src/com/android/networkstack/tethering/OffloadControllerTest.java index e9716b397f..8ef0c76aa3 100644 --- a/Tethering/tests/unit/src/com/android/networkstack/tethering/OffloadControllerTest.java +++ b/Tethering/tests/unit/src/com/android/networkstack/tethering/OffloadControllerTest.java @@ -26,6 +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; @@ -668,7 +669,7 @@ public class OffloadControllerTest { if (isAtLeastT()) { mTetherStatsProviderCb.expectNotifyLimitReached(); - } else if (Build.VERSION.SDK_INT == Build.VERSION_CODES.S) { + } else if (isAtLeastS()) { mTetherStatsProviderCb.expectNotifyWarningOrLimitReached(); } else { mTetherStatsProviderCb.expectNotifyLimitReached();