Do not register callback for < MIN_THRESHOLD_BYTES
This also avoids returning a nonzero multipath preference if remaining data is low but nonzero. Bug: b/72877610 Change-Id: I2459ded06de77d284ae1fe81a60d9e1df56b0c26 Fixes: b/72877610 Test: Tests in go/ag/3842960 pass
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user