From 2cb619acfd052cadec5ec38579303c48240b192d Mon Sep 17 00:00:00 2001 From: Sarah Chin Date: Wed, 26 Aug 2020 12:52:44 -0700 Subject: [PATCH] Clarify documentation on TEMP_NOT_METERED API Test: build Bug: 165337240 Change-Id: Ifc0843b529e7a205b0e1caf98420adfc377c28e7 --- core/java/android/net/NetworkCapabilities.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/core/java/android/net/NetworkCapabilities.java b/core/java/android/net/NetworkCapabilities.java index f806b565b1..6ccbfc80e8 100644 --- a/core/java/android/net/NetworkCapabilities.java +++ b/core/java/android/net/NetworkCapabilities.java @@ -339,10 +339,14 @@ public final class NetworkCapabilities implements Parcelable { public static final int NET_CAPABILITY_PARTIAL_CONNECTIVITY = 24; /** + * Indicates that this network is temporarily unmetered. + *

* This capability will be set for networks that are generally metered, but are currently * unmetered, e.g., because the user is in a particular area. This capability can be changed at * any time. When it is removed, applications are responsible for stopping any data transfer * that should not occur on a metered network. + * Note that most apps should use {@link #NET_CAPABILITY_NOT_METERED} instead. For more + * information, see https://developer.android.com/about/versions/11/features/5g#meteredness. */ public static final int NET_CAPABILITY_TEMPORARILY_NOT_METERED = 25; @@ -370,8 +374,8 @@ public final class NetworkCapabilities implements Parcelable { | (1 << NET_CAPABILITY_FOREGROUND) | (1 << NET_CAPABILITY_NOT_CONGESTED) | (1 << NET_CAPABILITY_NOT_SUSPENDED) - | (1 << NET_CAPABILITY_PARTIAL_CONNECTIVITY - | (1 << NET_CAPABILITY_TEMPORARILY_NOT_METERED)); + | (1 << NET_CAPABILITY_PARTIAL_CONNECTIVITY) + | (1 << NET_CAPABILITY_TEMPORARILY_NOT_METERED); /** * Network capabilities that are not allowed in NetworkRequests. This exists because the