Merge "Change NETWORK_TYPE_5G_NSA reference package"
This commit is contained in:
commit
85a2ef3dd5
3 changed files with 6 additions and 5 deletions
|
|
@ -26,6 +26,7 @@ import android.net.NetworkIdentity.OEM_NONE
|
|||
import android.net.NetworkIdentity.OEM_PAID
|
||||
import android.net.NetworkIdentity.OEM_PRIVATE
|
||||
import android.net.NetworkIdentity.getOemBitfield
|
||||
import android.app.usage.NetworkStatsManager
|
||||
import android.telephony.TelephonyManager
|
||||
import android.os.Build
|
||||
import com.android.testutils.DevSdkIgnoreRule
|
||||
|
|
@ -171,7 +172,7 @@ class NetworkIdentityTest {
|
|||
fun testBuilder_ratType() {
|
||||
// Assert illegal ratTypes cannot make an identity.
|
||||
listOf(Integer.MIN_VALUE, NetworkTemplate.NETWORK_TYPE_ALL,
|
||||
NetworkTemplate.NETWORK_TYPE_5G_NSA - 1, Integer.MAX_VALUE)
|
||||
NetworkStatsManager.NETWORK_TYPE_5G_NSA - 1, Integer.MAX_VALUE)
|
||||
.forEach {
|
||||
assertFailsWith<IllegalArgumentException> {
|
||||
NetworkIdentity.Builder()
|
||||
|
|
@ -184,7 +185,7 @@ class NetworkIdentityTest {
|
|||
// Verify legitimate ratTypes can make an identity.
|
||||
TelephonyManager.getAllNetworkTypes().toMutableList().also {
|
||||
it.add(TelephonyManager.NETWORK_TYPE_UNKNOWN)
|
||||
it.add(NetworkTemplate.NETWORK_TYPE_5G_NSA)
|
||||
it.add(NetworkStatsManager.NETWORK_TYPE_5G_NSA)
|
||||
}.forEach { rat ->
|
||||
NetworkIdentity.Builder()
|
||||
.setType(TYPE_MOBILE)
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@
|
|||
|
||||
package android.net
|
||||
|
||||
import android.app.usage.NetworkStatsManager.NETWORK_TYPE_5G_NSA
|
||||
import android.content.Context
|
||||
import android.net.ConnectivityManager.TYPE_MOBILE
|
||||
import android.net.ConnectivityManager.TYPE_WIFI
|
||||
|
|
@ -36,7 +37,6 @@ import android.net.NetworkTemplate.MATCH_MOBILE_WILDCARD
|
|||
import android.net.NetworkTemplate.MATCH_PROXY
|
||||
import android.net.NetworkTemplate.MATCH_WIFI
|
||||
import android.net.NetworkTemplate.MATCH_WIFI_WILDCARD
|
||||
import android.net.NetworkTemplate.NETWORK_TYPE_5G_NSA
|
||||
import android.net.NetworkTemplate.NETWORK_TYPE_ALL
|
||||
import android.net.NetworkTemplate.OEM_MANAGED_ALL
|
||||
import android.net.NetworkTemplate.OEM_MANAGED_NO
|
||||
|
|
|
|||
|
|
@ -35,8 +35,8 @@ import static org.mockito.Mockito.when;
|
|||
|
||||
import android.annotation.NonNull;
|
||||
import android.annotation.Nullable;
|
||||
import android.app.usage.NetworkStatsManager;
|
||||
import android.content.Context;
|
||||
import android.net.NetworkTemplate;
|
||||
import android.os.Build;
|
||||
import android.os.Looper;
|
||||
import android.os.Parcel;
|
||||
|
|
@ -282,7 +282,7 @@ public final class NetworkStatsSubscriptionsMonitorTest {
|
|||
// NETWORK_TYPE_5G_NSA.
|
||||
setRatTypeForSub(TEST_SUBID1, TelephonyManager.NETWORK_TYPE_LTE,
|
||||
OVERRIDE_NETWORK_TYPE_NR_NSA);
|
||||
assertRatTypeChangedForSub(TEST_IMSI1, NetworkTemplate.NETWORK_TYPE_5G_NSA);
|
||||
assertRatTypeChangedForSub(TEST_IMSI1, NetworkStatsManager.NETWORK_TYPE_5G_NSA);
|
||||
reset(mDelegate);
|
||||
|
||||
// Set RAT type to LTE without NR connected, the RAT type should be downgraded to LTE.
|
||||
|
|
|
|||
Loading…
Reference in a new issue