Proactively disable data when over policy limit.
Add policy controls to NetworkStateTracker which are combined with
other user preference and internal flags to decide if data connection
should be established. Better locking around enabled flags.
When data network would be over limit, proactively disable data on
that network. Enable when policy is snoozed or when cycle resets.
Track and dismiss notifications from now-stale policies.
Bug: 4587023, 5178147
Change-Id: Ibfcc9f73cda7c369209af701b46eddd3d1943f2d
diff --git a/core/java/android/bluetooth/BluetoothTetheringDataTracker.java b/core/java/android/bluetooth/BluetoothTetheringDataTracker.java
index a7b0037..83d1bda 100644
--- a/core/java/android/bluetooth/BluetoothTetheringDataTracker.java
+++ b/core/java/android/bluetooth/BluetoothTetheringDataTracker.java
@@ -19,7 +19,6 @@
import android.content.Context;
import android.net.ConnectivityManager;
import android.net.DhcpInfoInternal;
-import android.net.LinkAddress;
import android.net.LinkCapabilities;
import android.net.LinkProperties;
import android.net.NetworkInfo;
@@ -30,7 +29,6 @@
import android.os.Message;
import android.util.Log;
-import java.net.InetAddress;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicInteger;
@@ -184,11 +182,14 @@
return -1;
}
- /**
- * @param enabled
- */
- public void setDataEnable(boolean enabled) {
- android.util.Log.d(TAG, "setDataEnabled: IGNORING enabled=" + enabled);
+ @Override
+ public void setUserDataEnable(boolean enabled) {
+ Log.w(TAG, "ignoring setUserDataEnable(" + enabled + ")");
+ }
+
+ @Override
+ public void setPolicyDataEnable(boolean enabled) {
+ Log.w(TAG, "ignoring setPolicyDataEnable(" + enabled + ")");
}
/**