Merge "Do not register callback for < MIN_THRESHOLD_BYTES" into pi-dev

This commit is contained in:
Remi NGUYEN VAN
2018-04-11 03:18:57 +00:00
committed by Android (Google) Code Review
2 changed files with 11 additions and 3 deletions

View File

@@ -35,6 +35,7 @@ import android.os.Messenger;
import android.os.RemoteException;
import android.os.ServiceManager;
import android.os.ServiceManager.ServiceNotFoundException;
import android.util.DataUnit;
import android.util.Log;
import com.android.internal.annotations.VisibleForTesting;
@@ -95,6 +96,15 @@ public class NetworkStatsManager {
/** @hide */
public static final int CALLBACK_RELEASED = 1;
/**
* Minimum data usage threshold for registering usage callbacks.
*
* Requests registered with a threshold lower than this will only be triggered once this minimum
* is reached.
* @hide
*/
public static final long MIN_THRESHOLD_BYTES = DataUnit.MEBIBYTES.toBytes(2);
private final Context mContext;
private final INetworkStatsService mService;