Merge "Remove DataUsageSummaryPreference unused fields" into main
This commit is contained in:
@@ -67,15 +67,9 @@ public class DataUsageSummaryPreference extends Preference {
|
||||
private CharSequence mStartLabel;
|
||||
private CharSequence mEndLabel;
|
||||
|
||||
/** large vs small size is 36/16 ~ 2.25 */
|
||||
private static final float LARGER_FONT_RATIO = 2.25f;
|
||||
private static final float SMALLER_FONT_RATIO = 1.0f;
|
||||
|
||||
private boolean mDefaultTextColorSet;
|
||||
private int mDefaultTextColor;
|
||||
private int mNumPlans;
|
||||
/** The specified un-initialized value for cycle time */
|
||||
private final long CYCLE_TIME_UNINITIAL_VALUE = 0;
|
||||
private static final long CYCLE_TIME_UNINITIAL_VALUE = 0;
|
||||
/** The ending time of the billing cycle in milliseconds since epoch. */
|
||||
private long mCycleEndTimeMs;
|
||||
/** The time of the last update in standard milliseconds since the epoch */
|
||||
|
@@ -64,8 +64,6 @@ public class DataUsageSummaryPreferenceController extends TelephonyBasePreferenc
|
||||
private static final String TAG = "DataUsageController";
|
||||
private static final String KEY = "status_header";
|
||||
private static final long PETA = 1000000000000000L;
|
||||
private static final float RELATIVE_SIZE_LARGE = 1.25f * 1.25f; // (1/0.8)^2
|
||||
private static final float RELATIVE_SIZE_SMALL = 1.0f / RELATIVE_SIZE_LARGE; // 0.8^2
|
||||
|
||||
private EntityHeaderController mEntityHeaderController;
|
||||
private final Lifecycle mLifecycle;
|
||||
@@ -74,7 +72,6 @@ public class DataUsageSummaryPreferenceController extends TelephonyBasePreferenc
|
||||
protected DataUsageInfoController mDataInfoController;
|
||||
private NetworkTemplate mDefaultTemplate;
|
||||
protected NetworkPolicyEditor mPolicyEditor;
|
||||
private int mDataUsageTemplate;
|
||||
private boolean mHasMobileData;
|
||||
|
||||
/** Name of the carrier, or null if not available */
|
||||
@@ -95,8 +92,6 @@ public class DataUsageSummaryPreferenceController extends TelephonyBasePreferenc
|
||||
private long mDataBarSize;
|
||||
/** The number of bytes used since the start of the cycle. */
|
||||
private long mDataplanUse;
|
||||
/** The starting time of the billing cycle in ms since the epoch */
|
||||
private long mCycleStart;
|
||||
/** The ending time of the billing cycle in ms since the epoch */
|
||||
private long mCycleEnd;
|
||||
|
||||
@@ -134,13 +129,10 @@ public class DataUsageSummaryPreferenceController extends TelephonyBasePreferenc
|
||||
mDataInfoController = new DataUsageInfoController();
|
||||
|
||||
if (subInfo != null) {
|
||||
mDataUsageTemplate = R.string.cell_data_template;
|
||||
mDefaultTemplate = DataUsageLib.getMobileTemplate(context, subscriptionId);
|
||||
} else if (DataUsageUtils.hasWifiRadio(context)) {
|
||||
mDataUsageTemplate = R.string.wifi_data_template;
|
||||
mDefaultTemplate = new NetworkTemplate.Builder(NetworkTemplate.MATCH_WIFI).build();
|
||||
} else {
|
||||
mDataUsageTemplate = R.string.ethernet_data_template;
|
||||
mDefaultTemplate = DataUsageUtils.getDefaultTemplate(context, subscriptionId);
|
||||
}
|
||||
}
|
||||
@@ -156,7 +148,6 @@ public class DataUsageSummaryPreferenceController extends TelephonyBasePreferenc
|
||||
DataUsageInfoController dataInfoController,
|
||||
NetworkTemplate defaultTemplate,
|
||||
NetworkPolicyEditor policyEditor,
|
||||
int dataUsageTemplate,
|
||||
Activity activity,
|
||||
Lifecycle lifecycle,
|
||||
EntityHeaderController entityHeaderController,
|
||||
@@ -167,7 +158,6 @@ public class DataUsageSummaryPreferenceController extends TelephonyBasePreferenc
|
||||
mDataInfoController = dataInfoController;
|
||||
mDefaultTemplate = defaultTemplate;
|
||||
mPolicyEditor = policyEditor;
|
||||
mDataUsageTemplate = dataUsageTemplate;
|
||||
mHasMobileData = true;
|
||||
mLifecycle = lifecycle;
|
||||
mEntityHeaderController = entityHeaderController;
|
||||
@@ -302,7 +292,6 @@ public class DataUsageSummaryPreferenceController extends TelephonyBasePreferenc
|
||||
mDataplanSize = -1L;
|
||||
mDataBarSize = mDataInfoController.getSummaryLimit(info);
|
||||
mDataplanUse = info.usageLevel;
|
||||
mCycleStart = info.cycleStart;
|
||||
mCycleEnd = info.cycleEnd;
|
||||
mSnapshotTime = -1L;
|
||||
|
||||
@@ -322,7 +311,6 @@ public class DataUsageSummaryPreferenceController extends TelephonyBasePreferenc
|
||||
|
||||
RecurrenceRule rule = primaryPlan.getCycleRule();
|
||||
if (rule != null && rule.start != null && rule.end != null) {
|
||||
mCycleStart = rule.start.toEpochSecond() * 1000L;
|
||||
mCycleEnd = rule.end.toEpochSecond() * 1000L;
|
||||
}
|
||||
mSnapshotTime = primaryPlan.getDataUsageTime();
|
||||
|
@@ -44,7 +44,6 @@ import androidx.preference.PreferenceFragmentCompat;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.android.internal.logging.nano.MetricsProto;
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.testutils.FakeFeatureFactory;
|
||||
import com.android.settings.testutils.shadow.ShadowEntityHeaderController;
|
||||
import com.android.settings.widget.EntityHeaderController;
|
||||
@@ -147,7 +146,6 @@ public class DataUsageSummaryPreferenceControllerTest {
|
||||
mDataInfoController,
|
||||
mNetworkTemplate,
|
||||
mPolicyEditor,
|
||||
R.string.cell_data_template,
|
||||
mActivity, null, null, null, mDefaultSubscriptionId));
|
||||
doReturn(null).when(mController).getSubscriptionInfo(
|
||||
SubscriptionManager.INVALID_SUBSCRIPTION_ID);
|
||||
@@ -375,7 +373,6 @@ public class DataUsageSummaryPreferenceControllerTest {
|
||||
mDataInfoController,
|
||||
mNetworkTemplate,
|
||||
mPolicyEditor,
|
||||
R.string.cell_data_template,
|
||||
mActivity, mLifecycle, mHeaderController, mPreferenceFragment,
|
||||
mDefaultSubscriptionId));
|
||||
|
||||
|
Reference in New Issue
Block a user