[MS45] Expose SystemApis to query summary and history with template am: 685a738d19 am: e0ee61ea66
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1940846 Change-Id: I6459419abf7943e708902f97c60cf5ac3478829b
This commit is contained in:
@@ -56,6 +56,11 @@ package android.app.usage {
|
|||||||
public class NetworkStatsManager {
|
public class NetworkStatsManager {
|
||||||
method @RequiresPermission(anyOf={android.net.NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK, android.Manifest.permission.NETWORK_STACK}) public void forceUpdate();
|
method @RequiresPermission(anyOf={android.net.NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK, android.Manifest.permission.NETWORK_STACK}) public void forceUpdate();
|
||||||
method @RequiresPermission(anyOf={android.net.NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK, android.Manifest.permission.NETWORK_STACK}) public void notifyNetworkStatus(@NonNull java.util.List<android.net.Network>, @NonNull java.util.List<android.net.NetworkStateSnapshot>, @Nullable String, @NonNull java.util.List<android.net.UnderlyingNetworkInfo>);
|
method @RequiresPermission(anyOf={android.net.NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK, android.Manifest.permission.NETWORK_STACK}) public void notifyNetworkStatus(@NonNull java.util.List<android.net.Network>, @NonNull java.util.List<android.net.NetworkStateSnapshot>, @Nullable String, @NonNull java.util.List<android.net.UnderlyingNetworkInfo>);
|
||||||
|
method @NonNull @WorkerThread public android.app.usage.NetworkStats queryDetailsForDevice(@NonNull android.net.NetworkTemplate, long, long);
|
||||||
|
method @NonNull @WorkerThread public android.app.usage.NetworkStats queryDetailsForUidTagState(@NonNull android.net.NetworkTemplate, long, long, int, int, int) throws java.lang.SecurityException;
|
||||||
|
method @NonNull @WorkerThread public android.app.usage.NetworkStats querySummary(@NonNull android.net.NetworkTemplate, long, long) throws java.lang.SecurityException;
|
||||||
|
method @NonNull @WorkerThread public android.app.usage.NetworkStats.Bucket querySummaryForDevice(@NonNull android.net.NetworkTemplate, long, long);
|
||||||
|
method @NonNull @WorkerThread public android.app.usage.NetworkStats queryTaggedSummary(@NonNull android.net.NetworkTemplate, long, long) throws java.lang.SecurityException;
|
||||||
method @RequiresPermission(anyOf={android.net.NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK, android.Manifest.permission.NETWORK_STACK}) public void setDefaultGlobalAlert(long);
|
method @RequiresPermission(anyOf={android.net.NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK, android.Manifest.permission.NETWORK_STACK}) public void setDefaultGlobalAlert(long);
|
||||||
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);
|
||||||
|
|||||||
@@ -211,9 +211,10 @@ public class NetworkStatsManager {
|
|||||||
*/
|
*/
|
||||||
@NonNull
|
@NonNull
|
||||||
@WorkerThread
|
@WorkerThread
|
||||||
// @SystemApi(client = MODULE_LIBRARIES)
|
@SystemApi(client = MODULE_LIBRARIES)
|
||||||
public Bucket querySummaryForDevice(@NonNull NetworkTemplate template,
|
public Bucket querySummaryForDevice(@NonNull NetworkTemplate template,
|
||||||
long startTime, long endTime) {
|
long startTime, long endTime) {
|
||||||
|
Objects.requireNonNull(template);
|
||||||
try {
|
try {
|
||||||
NetworkStats stats =
|
NetworkStats stats =
|
||||||
new NetworkStats(mContext, template, mFlags, startTime, endTime, mService);
|
new NetworkStats(mContext, template, mFlags, startTime, endTime, mService);
|
||||||
@@ -385,10 +386,11 @@ public class NetworkStatsManager {
|
|||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
@NonNull
|
@NonNull
|
||||||
// @SystemApi(client = MODULE_LIBRARIES)
|
@SystemApi(client = MODULE_LIBRARIES)
|
||||||
@WorkerThread
|
@WorkerThread
|
||||||
public NetworkStats querySummary(@NonNull NetworkTemplate template, long startTime,
|
public NetworkStats querySummary(@NonNull NetworkTemplate template, long startTime,
|
||||||
long endTime) throws SecurityException {
|
long endTime) throws SecurityException {
|
||||||
|
Objects.requireNonNull(template);
|
||||||
try {
|
try {
|
||||||
NetworkStats result =
|
NetworkStats result =
|
||||||
new NetworkStats(mContext, template, mFlags, startTime, endTime, mService);
|
new NetworkStats(mContext, template, mFlags, startTime, endTime, mService);
|
||||||
@@ -418,10 +420,11 @@ public class NetworkStatsManager {
|
|||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
@NonNull
|
@NonNull
|
||||||
// @SystemApi(client = MODULE_LIBRARIES)
|
@SystemApi(client = MODULE_LIBRARIES)
|
||||||
@WorkerThread
|
@WorkerThread
|
||||||
public NetworkStats queryTaggedSummary(@NonNull NetworkTemplate template, long startTime,
|
public NetworkStats queryTaggedSummary(@NonNull NetworkTemplate template, long startTime,
|
||||||
long endTime) throws SecurityException {
|
long endTime) throws SecurityException {
|
||||||
|
Objects.requireNonNull(template);
|
||||||
try {
|
try {
|
||||||
NetworkStats result =
|
NetworkStats result =
|
||||||
new NetworkStats(mContext, template, mFlags, startTime, endTime, mService);
|
new NetworkStats(mContext, template, mFlags, startTime, endTime, mService);
|
||||||
@@ -453,10 +456,11 @@ public class NetworkStatsManager {
|
|||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
@NonNull
|
@NonNull
|
||||||
// @SystemApi(client = MODULE_LIBRARIES)
|
@SystemApi(client = MODULE_LIBRARIES)
|
||||||
@WorkerThread
|
@WorkerThread
|
||||||
public NetworkStats queryDetailsForDevice(@NonNull NetworkTemplate template,
|
public NetworkStats queryDetailsForDevice(@NonNull NetworkTemplate template,
|
||||||
long startTime, long endTime) {
|
long startTime, long endTime) {
|
||||||
|
Objects.requireNonNull(template);
|
||||||
try {
|
try {
|
||||||
final NetworkStats result =
|
final NetworkStats result =
|
||||||
new NetworkStats(mContext, template, mFlags, startTime, endTime, mService);
|
new NetworkStats(mContext, template, mFlags, startTime, endTime, mService);
|
||||||
@@ -580,10 +584,11 @@ public class NetworkStatsManager {
|
|||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
@NonNull
|
@NonNull
|
||||||
// @SystemApi(client = MODULE_LIBRARIES)
|
@SystemApi(client = MODULE_LIBRARIES)
|
||||||
@WorkerThread
|
@WorkerThread
|
||||||
public NetworkStats queryDetailsForUidTagState(@NonNull NetworkTemplate template,
|
public NetworkStats queryDetailsForUidTagState(@NonNull NetworkTemplate template,
|
||||||
long startTime, long endTime, int uid, int tag, int state) throws SecurityException {
|
long startTime, long endTime, int uid, int tag, int state) throws SecurityException {
|
||||||
|
Objects.requireNonNull(template);
|
||||||
try {
|
try {
|
||||||
final NetworkStats result = new NetworkStats(
|
final NetworkStats result = new NetworkStats(
|
||||||
mContext, template, mFlags, startTime, endTime, mService);
|
mContext, template, mFlags, startTime, endTime, mService);
|
||||||
|
|||||||
Reference in New Issue
Block a user