Clean up unused NetworkPolicyEditor

From DataUsageSummaryPreferenceController.

NetworkPolicyEditor.read() is not called, so
NetworkPolicyEditor.getPolicy() will always returns null.

Data limit info is already set in getDataUsageInfo().

Bug: 295260929
Test: robo test
Change-Id: I56a40cc906aa95207785886e704b1a59ea344e9c
This commit is contained in:
Chaohui Wang
2023-08-18 17:18:23 +08:00
parent 83e402a412
commit abe2710dc0
6 changed files with 0 additions and 118 deletions

View File

@@ -14,29 +14,12 @@
package com.android.settings.datausage;
import android.net.NetworkPolicy;
import com.android.settingslib.net.DataUsageController.DataUsageInfo;
/**
* Controller to handle caching and mobile data logic.
*/
public class DataUsageInfoController {
/**
* Take the cached data usage values in the NetworkPolicy to update DataUsageInfo.
*/
public void updateDataLimit(DataUsageInfo info, NetworkPolicy policy) {
if (info == null || policy == null) {
return;
}
if (policy.warningBytes >= 0) {
info.warningLevel = policy.warningBytes;
}
if (policy.limitBytes >= 0) {
info.limitLevel = policy.limitBytes;
}
}
/**
* @returns the most appropriate limit for the data usage summary. Use the total usage when it
* is higher than the limit and warning level. Use the limit when it is set and less than usage.