Merge "[DU04-2]Appropriate changes to the NetworkPolicyManager API"
This commit is contained in:
commit
73c476d79d
3 changed files with 15 additions and 7 deletions
|
|
@ -26,6 +26,7 @@ import android.net.NetworkStats;
|
|||
oneway interface INetworkStatsProviderCallback {
|
||||
void notifyStatsUpdated(int token, in NetworkStats ifaceStats, in NetworkStats uidStats);
|
||||
void notifyAlertReached();
|
||||
void notifyWarningOrLimitReached();
|
||||
void notifyWarningReached();
|
||||
void notifyLimitReached();
|
||||
void unregister();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -152,19 +152,19 @@ public abstract class NetworkStatsProvider {
|
|||
try {
|
||||
// Reuse the code path to notify warning reached with limit reached
|
||||
// since framework handles them in the same way.
|
||||
getProviderCallbackBinderOrThrow().notifyWarningOrLimitReached();
|
||||
getProviderCallbackBinderOrThrow().notifyWarningReached();
|
||||
} catch (RemoteException e) {
|
||||
e.rethrowAsRuntimeException();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Notify system that the quota set by {@link #onSetLimit} or limit set by
|
||||
* Notify system that the limit set by {@link #onSetLimit} or limit set by
|
||||
* {@link #onSetWarningAndLimit} has been reached.
|
||||
*/
|
||||
public void notifyLimitReached() {
|
||||
try {
|
||||
getProviderCallbackBinderOrThrow().notifyWarningOrLimitReached();
|
||||
getProviderCallbackBinderOrThrow().notifyLimitReached();
|
||||
} catch (RemoteException e) {
|
||||
e.rethrowAsRuntimeException();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2393,10 +2393,17 @@ public class NetworkStatsService extends INetworkStatsService.Stub {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void notifyWarningOrLimitReached() {
|
||||
Log.d(TAG, mTag + ": notifyWarningOrLimitReached");
|
||||
public void notifyWarningReached() {
|
||||
Log.d(TAG, mTag + ": notifyWarningReached");
|
||||
BinderUtils.withCleanCallingIdentity(() ->
|
||||
mNetworkPolicyManager.notifyStatsProviderWarningOrLimitReached());
|
||||
mNetworkPolicyManager.notifyStatsProviderWarningReached());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void notifyLimitReached() {
|
||||
Log.d(TAG, mTag + ": notifyLimitReached");
|
||||
BinderUtils.withCleanCallingIdentity(() ->
|
||||
mNetworkPolicyManager.notifyStatsProviderLimitReached());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
Loading…
Reference in a new issue