summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff Sharkey <jsharkey@android.com>2011-06-16 15:08:08 -0700
committerJeff Sharkey <jsharkey@android.com>2011-06-17 13:39:33 -0700
commit1a3e41d629c269dc66531cef0fb331ac94e5c273 (patch)
tree04127cda6cefea24d5399629b30cee9614cf8b2a
parent9a2442711ea9a3263795e969cf387cdf412e72e9 (diff)
downloadpackages_apps_settings-1a3e41d629c269dc66531cef0fb331ac94e5c273.zip
packages_apps_settings-1a3e41d629c269dc66531cef0fb331ac94e5c273.tar.gz
packages_apps_settings-1a3e41d629c269dc66531cef0fb331ac94e5c273.tar.bz2
Refactor network policy: paid to metered.
Also bind policy checkbox correctly. Bug: 4691427 Change-Id: Ib05b39c391bf59582106afff5599d62a04c3c75b
-rw-r--r--src/com/android/settings/DataUsageAppDetail.java10
-rw-r--r--src/com/android/settings/DataUsageSummary.java1
2 files changed, 4 insertions, 7 deletions
diff --git a/src/com/android/settings/DataUsageAppDetail.java b/src/com/android/settings/DataUsageAppDetail.java
index cee54ee..0d15dac 100644
--- a/src/com/android/settings/DataUsageAppDetail.java
+++ b/src/com/android/settings/DataUsageAppDetail.java
@@ -17,7 +17,7 @@
package com.android.settings;
import static android.net.NetworkPolicyManager.POLICY_NONE;
-import static android.net.NetworkPolicyManager.POLICY_REJECT_PAID_BACKGROUND;
+import static android.net.NetworkPolicyManager.POLICY_REJECT_METERED_BACKGROUND;
import static android.net.TrafficStats.TEMPLATE_MOBILE_ALL;
import static com.android.settings.DataUsageSummary.getHistoryBounds;
@@ -76,8 +76,6 @@ public class DataUsageAppDetail extends Fragment {
private LinearLayout mSwitches;
private DataUsageChartView mChart;
-
- private int mUidPolicy;
private NetworkStatsHistory mHistory;
@Override
@@ -185,7 +183,7 @@ public class DataUsageAppDetail extends Fragment {
}
// update policy checkbox
- final boolean restrictBackground = (mUidPolicy & POLICY_REJECT_PAID_BACKGROUND) != 0;
+ final boolean restrictBackground = (uidPolicy & POLICY_REJECT_METERED_BACKGROUND) != 0;
mRestrictBackground.setChecked(restrictBackground);
// kick preference views so they rebind from changes above
@@ -210,7 +208,7 @@ public class DataUsageAppDetail extends Fragment {
if (LOGD) Log.d(TAG, "setRestrictBackground()");
try {
mPolicyService.setUidPolicy(
- mUid, restrictBackground ? POLICY_REJECT_PAID_BACKGROUND : POLICY_NONE);
+ mUid, restrictBackground ? POLICY_REJECT_METERED_BACKGROUND : POLICY_NONE);
} catch (RemoteException e) {
throw new RuntimeException("unable to save policy", e);
}
@@ -269,7 +267,7 @@ public class DataUsageAppDetail extends Fragment {
/**
* Dialog to request user confirmation before setting
- * {@link #POLICY_REJECT_PAID_BACKGROUND}.
+ * {@link #POLICY_REJECT_METERED_BACKGROUND}.
*/
public static class ConfirmRestrictFragment extends DialogFragment {
public static void show(DataUsageAppDetail parent) {
diff --git a/src/com/android/settings/DataUsageSummary.java b/src/com/android/settings/DataUsageSummary.java
index eafd22b..087525c 100644
--- a/src/com/android/settings/DataUsageSummary.java
+++ b/src/com/android/settings/DataUsageSummary.java
@@ -18,7 +18,6 @@ package com.android.settings;
import static android.net.NetworkPolicy.LIMIT_DISABLED;
import static android.net.NetworkPolicyManager.ACTION_DATA_USAGE_LIMIT;
-import static android.net.NetworkPolicyManager.ACTION_DATA_USAGE_WARNING;
import static android.net.NetworkPolicyManager.EXTRA_NETWORK_TEMPLATE;
import static android.net.NetworkPolicyManager.computeLastCycleBoundary;
import static android.net.NetworkPolicyManager.computeNextCycleBoundary;