Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2c550f7d authored by Les Lee's avatar Les Lee Committed by Automerger Merge Worker
Browse files

Merge "Fix: query TYPE_WIFI usage with empty string" am: d9905a0e am: e0c2f2d5 am: 5ac7901f

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1727620

Change-Id: I68c6412ee562c620612932cd03466a894953c8e8
parents 99e28398 5ac7901f
Loading
Loading
Loading
Loading
+26 −1
Original line number Diff line number Diff line
@@ -48,6 +48,7 @@ import android.os.RemoteException;
import android.os.ServiceManager;
import android.os.ServiceManager.ServiceNotFoundException;
import android.telephony.TelephonyManager;
import android.text.TextUtils;
import android.util.DataUnit;
import android.util.Log;

@@ -214,6 +215,10 @@ public class NetworkStatsManager {
     *                     null} value when querying for the mobile network type to receive usage
     *                     for all mobile networks. For additional details see {@link
     *                     TelephonyManager#getSubscriberId()}.
     *                     <p>Starting with API level 31, calling apps can provide a
     *                     {@code subscriberId} with wifi network type to receive usage for
     *                     wifi networks which is under the given subscription if applicable.
     *                     Otherwise, pass {@code null} when querying all wifi networks.
     * @param startTime Start of period. Defined in terms of "Unix time", see
     *            {@link java.lang.System#currentTimeMillis}.
     * @param endTime End of period. Defined in terms of "Unix time", see
@@ -255,6 +260,10 @@ public class NetworkStatsManager {
     *                     null} value when querying for the mobile network type to receive usage
     *                     for all mobile networks. For additional details see {@link
     *                     TelephonyManager#getSubscriberId()}.
     *                     <p>Starting with API level 31, calling apps can provide a
     *                     {@code subscriberId} with wifi network type to receive usage for
     *                     wifi networks which is under the given subscription if applicable.
     *                     Otherwise, pass {@code null} when querying all wifi networks.
     * @param startTime Start of period. Defined in terms of "Unix time", see
     *            {@link java.lang.System#currentTimeMillis}.
     * @param endTime End of period. Defined in terms of "Unix time", see
@@ -300,6 +309,10 @@ public class NetworkStatsManager {
     *                     null} value when querying for the mobile network type to receive usage
     *                     for all mobile networks. For additional details see {@link
     *                     TelephonyManager#getSubscriberId()}.
     *                     <p>Starting with API level 31, calling apps can provide a
     *                     {@code subscriberId} with wifi network type to receive usage for
     *                     wifi networks which is under the given subscription if applicable.
     *                     Otherwise, pass {@code null} when querying all wifi networks.
     * @param startTime Start of period. Defined in terms of "Unix time", see
     *            {@link java.lang.System#currentTimeMillis}.
     * @param endTime End of period. Defined in terms of "Unix time", see
@@ -388,6 +401,10 @@ public class NetworkStatsManager {
     *                     null} value when querying for the mobile network type to receive usage
     *                     for all mobile networks. For additional details see {@link
     *                     TelephonyManager#getSubscriberId()}.
     *                     <p>Starting with API level 31, calling apps can provide a
     *                     {@code subscriberId} with wifi network type to receive usage for
     *                     wifi networks which is under the given subscription if applicable.
     *                     Otherwise, pass {@code null} when querying all wifi networks.
     * @param startTime Start of period. Defined in terms of "Unix time", see
     *            {@link java.lang.System#currentTimeMillis}.
     * @param endTime End of period. Defined in terms of "Unix time", see
@@ -450,6 +467,10 @@ public class NetworkStatsManager {
     *                     null} value when querying for the mobile network type to receive usage
     *                     for all mobile networks. For additional details see {@link
     *                     TelephonyManager#getSubscriberId()}.
     *                     <p>Starting with API level 31, calling apps can provide a
     *                     {@code subscriberId} with wifi network type to receive usage for
     *                     wifi networks which is under the given subscription if applicable.
     *                     Otherwise, pass {@code null} when querying all wifi networks.
     * @param startTime Start of period. Defined in terms of "Unix time", see
     *            {@link java.lang.System#currentTimeMillis}.
     * @param endTime End of period. Defined in terms of "Unix time", see
@@ -531,6 +552,10 @@ public class NetworkStatsManager {
     *                     null} value when registering for the mobile network type to receive
     *                     notifications for all mobile networks. For additional details see {@link
     *                     TelephonyManager#getSubscriberId()}.
     *                     <p>Starting with API level 31, calling apps can provide a
     *                     {@code subscriberId} with wifi network type to receive usage for
     *                     wifi networks which is under the given subscription if applicable.
     *                     Otherwise, pass {@code null} when querying all wifi networks.
     * @param thresholdBytes Threshold in bytes to be notified on.
     * @param callback The {@link UsageCallback} that the system will call when data usage
     *            has exceeded the specified threshold.
@@ -644,7 +669,7 @@ public class NetworkStatsManager {
                        : NetworkTemplate.buildTemplateMobileAll(subscriberId);
                break;
            case ConnectivityManager.TYPE_WIFI:
                template = subscriberId == null
                template = TextUtils.isEmpty(subscriberId)
                        ? NetworkTemplate.buildTemplateWifiWildcard()
                        : NetworkTemplate.buildTemplateWifi(NetworkTemplate.WIFI_NETWORKID_ALL,
                                subscriberId);