Loading core/api/module-lib-current.txt +1 −0 Original line number Original line Diff line number Diff line Loading @@ -66,6 +66,7 @@ package android.app.usage { method @RequiresPermission(anyOf={android.net.NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK, android.Manifest.permission.NETWORK_STACK}) public void setPollOnOpen(boolean); method @RequiresPermission(anyOf={android.net.NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK, android.Manifest.permission.NETWORK_STACK}) public void setPollOnOpen(boolean); method @RequiresPermission(anyOf={android.net.NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK, android.Manifest.permission.NETWORK_STACK}) public void setStatsProviderWarningAndLimitAsync(@NonNull String, long, long); method @RequiresPermission(anyOf={android.net.NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK, android.Manifest.permission.NETWORK_STACK}) public void setStatsProviderWarningAndLimitAsync(@NonNull String, long, long); method @RequiresPermission(anyOf={android.net.NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK, android.Manifest.permission.NETWORK_STACK}) public void setUidForeground(int, boolean); method @RequiresPermission(anyOf={android.net.NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK, android.Manifest.permission.NETWORK_STACK}) public void setUidForeground(int, boolean); field public static final int NETWORK_TYPE_5G_NSA = -2; // 0xfffffffe } } public abstract static class NetworkStatsManager.UsageCallback { public abstract static class NetworkStatsManager.UsageCallback { Loading packages/ConnectivityT/framework-t/src/android/app/usage/NetworkStatsManager.java +12 −0 Original line number Original line Diff line number Diff line Loading @@ -145,6 +145,18 @@ public class NetworkStatsManager { /** @hide */ /** @hide */ public static final int FLAG_AUGMENT_WITH_SUBSCRIPTION_PLAN = 1 << 2; public static final int FLAG_AUGMENT_WITH_SUBSCRIPTION_PLAN = 1 << 2; /** * Virtual RAT type to represent 5G NSA (Non Stand Alone) mode, where the primary cell is * still LTE and network allocates a secondary 5G cell so telephony reports RAT = LTE along * with NR state as connected. This is a concept added by NetworkStats on top of the telephony * constants for backward compatibility of metrics so this should not be overlapped with any of * the {@code TelephonyManager.NETWORK_TYPE_*} constants. * * @hide */ @SystemApi(client = MODULE_LIBRARIES) public static final int NETWORK_TYPE_5G_NSA = -2; private int mFlags; private int mFlags; /** @hide */ /** @hide */ Loading packages/ConnectivityT/framework-t/src/android/net/NetworkIdentity.java +2 −1 Original line number Original line Diff line number Diff line Loading @@ -26,6 +26,7 @@ import android.annotation.NonNull; import android.annotation.Nullable; import android.annotation.Nullable; import android.annotation.SuppressLint; import android.annotation.SuppressLint; import android.annotation.SystemApi; import android.annotation.SystemApi; import android.app.usage.NetworkStatsManager; import android.content.Context; import android.content.Context; import android.net.wifi.WifiInfo; import android.net.wifi.WifiInfo; import android.service.NetworkIdentityProto; import android.service.NetworkIdentityProto; Loading Loading @@ -435,7 +436,7 @@ public class NetworkIdentity { public Builder setRatType(@Annotation.NetworkType int ratType) { public Builder setRatType(@Annotation.NetworkType int ratType) { if (!CollectionUtils.contains(TelephonyManager.getAllNetworkTypes(), ratType) if (!CollectionUtils.contains(TelephonyManager.getAllNetworkTypes(), ratType) && ratType != TelephonyManager.NETWORK_TYPE_UNKNOWN && ratType != TelephonyManager.NETWORK_TYPE_UNKNOWN && ratType != NetworkTemplate.NETWORK_TYPE_5G_NSA) { && ratType != NetworkStatsManager.NETWORK_TYPE_5G_NSA) { throw new IllegalArgumentException("Invalid ratType " + ratType); throw new IllegalArgumentException("Invalid ratType " + ratType); } } mRatType = ratType; mRatType = ratType; Loading packages/ConnectivityT/framework-t/src/android/net/NetworkTemplate.java +8 −14 Original line number Original line Diff line number Diff line Loading @@ -41,6 +41,7 @@ import android.annotation.IntDef; import android.annotation.NonNull; import android.annotation.NonNull; import android.annotation.Nullable; import android.annotation.Nullable; import android.annotation.SystemApi; import android.annotation.SystemApi; import android.app.usage.NetworkStatsManager; import android.compat.annotation.UnsupportedAppUsage; import android.compat.annotation.UnsupportedAppUsage; import android.net.wifi.WifiInfo; import android.net.wifi.WifiInfo; import android.os.Build; import android.os.Build; Loading Loading @@ -136,15 +137,6 @@ public final class NetworkTemplate implements Parcelable { * {@code TelephonyManager.NETWORK_TYPE_*} constants, and thus needs to stay in sync. * {@code TelephonyManager.NETWORK_TYPE_*} constants, and thus needs to stay in sync. */ */ public static final int NETWORK_TYPE_ALL = -1; public static final int NETWORK_TYPE_ALL = -1; /** * Virtual RAT type to represent 5G NSA (Non Stand Alone) mode, where the primary cell is * still LTE and network allocates a secondary 5G cell so telephony reports RAT = LTE along * with NR state as connected. This should not be overlapped with any of the * {@code TelephonyManager.NETWORK_TYPE_*} constants. * * @hide */ public static final int NETWORK_TYPE_5G_NSA = -2; /** @hide */ /** @hide */ @Retention(RetentionPolicy.SOURCE) @Retention(RetentionPolicy.SOURCE) Loading Loading @@ -791,9 +783,10 @@ public final class NetworkTemplate implements Parcelable { return TelephonyManager.NETWORK_TYPE_LTE; return TelephonyManager.NETWORK_TYPE_LTE; case TelephonyManager.NETWORK_TYPE_NR: case TelephonyManager.NETWORK_TYPE_NR: return TelephonyManager.NETWORK_TYPE_NR; return TelephonyManager.NETWORK_TYPE_NR; // Virtual RAT type for 5G NSA mode, see {@link NetworkTemplate#NETWORK_TYPE_5G_NSA}. // Virtual RAT type for 5G NSA mode, see case NetworkTemplate.NETWORK_TYPE_5G_NSA: // {@link NetworkStatsManager#NETWORK_TYPE_5G_NSA}. return NetworkTemplate.NETWORK_TYPE_5G_NSA; case NetworkStatsManager.NETWORK_TYPE_5G_NSA: return NetworkStatsManager.NETWORK_TYPE_5G_NSA; default: default: return TelephonyManager.NETWORK_TYPE_UNKNOWN; return TelephonyManager.NETWORK_TYPE_UNKNOWN; } } Loading @@ -815,8 +808,9 @@ public final class NetworkTemplate implements Parcelable { } } // Add NETWORK_TYPE_5G_NSA to the returned list since 5G NSA is a virtual RAT type and // Add NETWORK_TYPE_5G_NSA to the returned list since 5G NSA is a virtual RAT type and // it is not in TelephonyManager#NETWORK_TYPE_* constants. // it is not in TelephonyManager#NETWORK_TYPE_* constants. // See {@link NetworkTemplate#NETWORK_TYPE_5G_NSA}. // See {@link NetworkStatsManager#NETWORK_TYPE_5G_NSA}. collapsedRatTypes.add(NetworkTemplate.getCollapsedRatType(NETWORK_TYPE_5G_NSA)); collapsedRatTypes.add( NetworkTemplate.getCollapsedRatType(NetworkStatsManager.NETWORK_TYPE_5G_NSA)); // Ensure that unknown type is returned. // Ensure that unknown type is returned. collapsedRatTypes.add(TelephonyManager.NETWORK_TYPE_UNKNOWN); collapsedRatTypes.add(TelephonyManager.NETWORK_TYPE_UNKNOWN); return toIntArray(collapsedRatTypes); return toIntArray(collapsedRatTypes); Loading packages/ConnectivityT/service/src/com/android/server/net/NetworkStatsSubscriptionsMonitor.java +1 −1 Original line number Original line Diff line number Diff line Loading @@ -16,7 +16,7 @@ package com.android.server.net; package com.android.server.net; import static android.net.NetworkTemplate.NETWORK_TYPE_5G_NSA; import static android.app.usage.NetworkStatsManager.NETWORK_TYPE_5G_NSA; import static android.net.NetworkTemplate.getCollapsedRatType; import static android.net.NetworkTemplate.getCollapsedRatType; import static android.telephony.TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_NR_ADVANCED; import static android.telephony.TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_NR_ADVANCED; import static android.telephony.TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_NR_NSA; import static android.telephony.TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_NR_NSA; Loading Loading
core/api/module-lib-current.txt +1 −0 Original line number Original line Diff line number Diff line Loading @@ -66,6 +66,7 @@ package android.app.usage { method @RequiresPermission(anyOf={android.net.NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK, android.Manifest.permission.NETWORK_STACK}) public void setPollOnOpen(boolean); method @RequiresPermission(anyOf={android.net.NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK, android.Manifest.permission.NETWORK_STACK}) public void setPollOnOpen(boolean); method @RequiresPermission(anyOf={android.net.NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK, android.Manifest.permission.NETWORK_STACK}) public void setStatsProviderWarningAndLimitAsync(@NonNull String, long, long); method @RequiresPermission(anyOf={android.net.NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK, android.Manifest.permission.NETWORK_STACK}) public void setStatsProviderWarningAndLimitAsync(@NonNull String, long, long); method @RequiresPermission(anyOf={android.net.NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK, android.Manifest.permission.NETWORK_STACK}) public void setUidForeground(int, boolean); method @RequiresPermission(anyOf={android.net.NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK, android.Manifest.permission.NETWORK_STACK}) public void setUidForeground(int, boolean); field public static final int NETWORK_TYPE_5G_NSA = -2; // 0xfffffffe } } public abstract static class NetworkStatsManager.UsageCallback { public abstract static class NetworkStatsManager.UsageCallback { Loading
packages/ConnectivityT/framework-t/src/android/app/usage/NetworkStatsManager.java +12 −0 Original line number Original line Diff line number Diff line Loading @@ -145,6 +145,18 @@ public class NetworkStatsManager { /** @hide */ /** @hide */ public static final int FLAG_AUGMENT_WITH_SUBSCRIPTION_PLAN = 1 << 2; public static final int FLAG_AUGMENT_WITH_SUBSCRIPTION_PLAN = 1 << 2; /** * Virtual RAT type to represent 5G NSA (Non Stand Alone) mode, where the primary cell is * still LTE and network allocates a secondary 5G cell so telephony reports RAT = LTE along * with NR state as connected. This is a concept added by NetworkStats on top of the telephony * constants for backward compatibility of metrics so this should not be overlapped with any of * the {@code TelephonyManager.NETWORK_TYPE_*} constants. * * @hide */ @SystemApi(client = MODULE_LIBRARIES) public static final int NETWORK_TYPE_5G_NSA = -2; private int mFlags; private int mFlags; /** @hide */ /** @hide */ Loading
packages/ConnectivityT/framework-t/src/android/net/NetworkIdentity.java +2 −1 Original line number Original line Diff line number Diff line Loading @@ -26,6 +26,7 @@ import android.annotation.NonNull; import android.annotation.Nullable; import android.annotation.Nullable; import android.annotation.SuppressLint; import android.annotation.SuppressLint; import android.annotation.SystemApi; import android.annotation.SystemApi; import android.app.usage.NetworkStatsManager; import android.content.Context; import android.content.Context; import android.net.wifi.WifiInfo; import android.net.wifi.WifiInfo; import android.service.NetworkIdentityProto; import android.service.NetworkIdentityProto; Loading Loading @@ -435,7 +436,7 @@ public class NetworkIdentity { public Builder setRatType(@Annotation.NetworkType int ratType) { public Builder setRatType(@Annotation.NetworkType int ratType) { if (!CollectionUtils.contains(TelephonyManager.getAllNetworkTypes(), ratType) if (!CollectionUtils.contains(TelephonyManager.getAllNetworkTypes(), ratType) && ratType != TelephonyManager.NETWORK_TYPE_UNKNOWN && ratType != TelephonyManager.NETWORK_TYPE_UNKNOWN && ratType != NetworkTemplate.NETWORK_TYPE_5G_NSA) { && ratType != NetworkStatsManager.NETWORK_TYPE_5G_NSA) { throw new IllegalArgumentException("Invalid ratType " + ratType); throw new IllegalArgumentException("Invalid ratType " + ratType); } } mRatType = ratType; mRatType = ratType; Loading
packages/ConnectivityT/framework-t/src/android/net/NetworkTemplate.java +8 −14 Original line number Original line Diff line number Diff line Loading @@ -41,6 +41,7 @@ import android.annotation.IntDef; import android.annotation.NonNull; import android.annotation.NonNull; import android.annotation.Nullable; import android.annotation.Nullable; import android.annotation.SystemApi; import android.annotation.SystemApi; import android.app.usage.NetworkStatsManager; import android.compat.annotation.UnsupportedAppUsage; import android.compat.annotation.UnsupportedAppUsage; import android.net.wifi.WifiInfo; import android.net.wifi.WifiInfo; import android.os.Build; import android.os.Build; Loading Loading @@ -136,15 +137,6 @@ public final class NetworkTemplate implements Parcelable { * {@code TelephonyManager.NETWORK_TYPE_*} constants, and thus needs to stay in sync. * {@code TelephonyManager.NETWORK_TYPE_*} constants, and thus needs to stay in sync. */ */ public static final int NETWORK_TYPE_ALL = -1; public static final int NETWORK_TYPE_ALL = -1; /** * Virtual RAT type to represent 5G NSA (Non Stand Alone) mode, where the primary cell is * still LTE and network allocates a secondary 5G cell so telephony reports RAT = LTE along * with NR state as connected. This should not be overlapped with any of the * {@code TelephonyManager.NETWORK_TYPE_*} constants. * * @hide */ public static final int NETWORK_TYPE_5G_NSA = -2; /** @hide */ /** @hide */ @Retention(RetentionPolicy.SOURCE) @Retention(RetentionPolicy.SOURCE) Loading Loading @@ -791,9 +783,10 @@ public final class NetworkTemplate implements Parcelable { return TelephonyManager.NETWORK_TYPE_LTE; return TelephonyManager.NETWORK_TYPE_LTE; case TelephonyManager.NETWORK_TYPE_NR: case TelephonyManager.NETWORK_TYPE_NR: return TelephonyManager.NETWORK_TYPE_NR; return TelephonyManager.NETWORK_TYPE_NR; // Virtual RAT type for 5G NSA mode, see {@link NetworkTemplate#NETWORK_TYPE_5G_NSA}. // Virtual RAT type for 5G NSA mode, see case NetworkTemplate.NETWORK_TYPE_5G_NSA: // {@link NetworkStatsManager#NETWORK_TYPE_5G_NSA}. return NetworkTemplate.NETWORK_TYPE_5G_NSA; case NetworkStatsManager.NETWORK_TYPE_5G_NSA: return NetworkStatsManager.NETWORK_TYPE_5G_NSA; default: default: return TelephonyManager.NETWORK_TYPE_UNKNOWN; return TelephonyManager.NETWORK_TYPE_UNKNOWN; } } Loading @@ -815,8 +808,9 @@ public final class NetworkTemplate implements Parcelable { } } // Add NETWORK_TYPE_5G_NSA to the returned list since 5G NSA is a virtual RAT type and // Add NETWORK_TYPE_5G_NSA to the returned list since 5G NSA is a virtual RAT type and // it is not in TelephonyManager#NETWORK_TYPE_* constants. // it is not in TelephonyManager#NETWORK_TYPE_* constants. // See {@link NetworkTemplate#NETWORK_TYPE_5G_NSA}. // See {@link NetworkStatsManager#NETWORK_TYPE_5G_NSA}. collapsedRatTypes.add(NetworkTemplate.getCollapsedRatType(NETWORK_TYPE_5G_NSA)); collapsedRatTypes.add( NetworkTemplate.getCollapsedRatType(NetworkStatsManager.NETWORK_TYPE_5G_NSA)); // Ensure that unknown type is returned. // Ensure that unknown type is returned. collapsedRatTypes.add(TelephonyManager.NETWORK_TYPE_UNKNOWN); collapsedRatTypes.add(TelephonyManager.NETWORK_TYPE_UNKNOWN); return toIntArray(collapsedRatTypes); return toIntArray(collapsedRatTypes); Loading
packages/ConnectivityT/service/src/com/android/server/net/NetworkStatsSubscriptionsMonitor.java +1 −1 Original line number Original line Diff line number Diff line Loading @@ -16,7 +16,7 @@ package com.android.server.net; package com.android.server.net; import static android.net.NetworkTemplate.NETWORK_TYPE_5G_NSA; import static android.app.usage.NetworkStatsManager.NETWORK_TYPE_5G_NSA; import static android.net.NetworkTemplate.getCollapsedRatType; import static android.net.NetworkTemplate.getCollapsedRatType; import static android.telephony.TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_NR_ADVANCED; import static android.telephony.TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_NR_ADVANCED; import static android.telephony.TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_NR_NSA; import static android.telephony.TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_NR_NSA; Loading