Migrate to @Override to remove warnings.
Bug: 6303344 Change-Id: I8f17edc3b12d50cedab2c5f555c63bc07d85bca2
This commit is contained in:
@@ -560,9 +560,9 @@ public class DataUsageSummary extends Fragment {
|
||||
* Listener to setup {@link LayoutTransition} after first layout pass.
|
||||
*/
|
||||
private OnGlobalLayoutListener mFirstLayoutListener = new OnGlobalLayoutListener() {
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public void onGlobalLayout() {
|
||||
mListView.getViewTreeObserver().removeGlobalOnLayoutListener(mFirstLayoutListener);
|
||||
mListView.getViewTreeObserver().removeOnGlobalLayoutListener(mFirstLayoutListener);
|
||||
|
||||
mTabsContainer.setLayoutTransition(buildLayoutTransition());
|
||||
mHeader.setLayoutTransition(buildLayoutTransition());
|
||||
@@ -628,7 +628,7 @@ public class DataUsageSummary extends Fragment {
|
||||
* Factory that provide empty {@link View} to make {@link TabHost} happy.
|
||||
*/
|
||||
private TabContentFactory mEmptyTabContent = new TabContentFactory() {
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public View createTabContent(String tag) {
|
||||
return new View(mTabHost.getContext());
|
||||
}
|
||||
@@ -643,7 +643,7 @@ public class DataUsageSummary extends Fragment {
|
||||
}
|
||||
|
||||
private OnTabChangeListener mTabListener = new OnTabChangeListener() {
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public void onTabChanged(String tabId) {
|
||||
// user changed tab; update body
|
||||
updateBody();
|
||||
@@ -990,7 +990,7 @@ public class DataUsageSummary extends Fragment {
|
||||
}
|
||||
|
||||
private OnCheckedChangeListener mDataEnabledListener = new OnCheckedChangeListener() {
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
||||
if (mBinding) return;
|
||||
|
||||
@@ -1011,7 +1011,7 @@ public class DataUsageSummary extends Fragment {
|
||||
};
|
||||
|
||||
private View.OnClickListener mDisableAtLimitListener = new View.OnClickListener() {
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
final boolean disableAtLimit = !mDisableAtLimit.isChecked();
|
||||
if (disableAtLimit) {
|
||||
@@ -1025,7 +1025,7 @@ public class DataUsageSummary extends Fragment {
|
||||
};
|
||||
|
||||
private View.OnClickListener mAppRestrictListener = new View.OnClickListener() {
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
final boolean restrictBackground = !mAppRestrict.isChecked();
|
||||
|
||||
@@ -1041,7 +1041,7 @@ public class DataUsageSummary extends Fragment {
|
||||
};
|
||||
|
||||
private OnClickListener mAppSettingsListener = new OnClickListener() {
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
// TODO: target torwards entire UID instead of just first package
|
||||
startActivity(mAppSettingsIntent);
|
||||
@@ -1049,7 +1049,7 @@ public class DataUsageSummary extends Fragment {
|
||||
};
|
||||
|
||||
private OnItemClickListener mListListener = new OnItemClickListener() {
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
|
||||
final Context context = view.getContext();
|
||||
final AppItem app = (AppItem) parent.getItemAtPosition(position);
|
||||
@@ -1059,7 +1059,7 @@ public class DataUsageSummary extends Fragment {
|
||||
};
|
||||
|
||||
private OnItemSelectedListener mCycleListener = new OnItemSelectedListener() {
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
||||
final CycleItem cycle = (CycleItem) parent.getItemAtPosition(position);
|
||||
if (cycle instanceof CycleChangeItem) {
|
||||
@@ -1084,7 +1084,7 @@ public class DataUsageSummary extends Fragment {
|
||||
}
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public void onNothingSelected(AdapterView<?> parent) {
|
||||
// ignored
|
||||
}
|
||||
@@ -1149,12 +1149,12 @@ public class DataUsageSummary extends Fragment {
|
||||
|
||||
private final LoaderCallbacks<ChartData> mChartDataCallbacks = new LoaderCallbacks<
|
||||
ChartData>() {
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public Loader<ChartData> onCreateLoader(int id, Bundle args) {
|
||||
return new ChartDataLoader(getActivity(), mStatsSession, args);
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public void onLoadFinished(Loader<ChartData> loader, ChartData data) {
|
||||
mChartData = data;
|
||||
mChart.bindNetworkStats(mChartData.network);
|
||||
@@ -1170,7 +1170,7 @@ public class DataUsageSummary extends Fragment {
|
||||
}
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public void onLoaderReset(Loader<ChartData> loader) {
|
||||
mChartData = null;
|
||||
mChart.bindNetworkStats(null);
|
||||
@@ -1180,18 +1180,18 @@ public class DataUsageSummary extends Fragment {
|
||||
|
||||
private final LoaderCallbacks<NetworkStats> mSummaryCallbacks = new LoaderCallbacks<
|
||||
NetworkStats>() {
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public Loader<NetworkStats> onCreateLoader(int id, Bundle args) {
|
||||
return new SummaryForAllUidLoader(getActivity(), mStatsSession, args);
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public void onLoadFinished(Loader<NetworkStats> loader, NetworkStats data) {
|
||||
mAdapter.bindStats(data);
|
||||
updateEmptyVisible();
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public void onLoaderReset(Loader<NetworkStats> loader) {
|
||||
mAdapter.bindStats(null);
|
||||
updateEmptyVisible();
|
||||
@@ -1203,6 +1203,7 @@ public class DataUsageSummary extends Fragment {
|
||||
}
|
||||
};
|
||||
|
||||
@Deprecated
|
||||
private boolean isMobilePolicySplit() {
|
||||
final Context context = getActivity();
|
||||
if (hasReadyMobileRadio(context)) {
|
||||
@@ -1213,6 +1214,7 @@ public class DataUsageSummary extends Fragment {
|
||||
}
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
private void setMobilePolicySplit(boolean split) {
|
||||
final Context context = getActivity();
|
||||
if (hasReadyMobileRadio(context)) {
|
||||
@@ -1228,28 +1230,28 @@ public class DataUsageSummary extends Fragment {
|
||||
}
|
||||
|
||||
private DataUsageChartListener mChartListener = new DataUsageChartListener() {
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public void onInspectRangeChanged() {
|
||||
if (LOGD) Log.d(TAG, "onInspectRangeChanged()");
|
||||
updateDetailData();
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public void onWarningChanged() {
|
||||
setPolicyWarningBytes(mChart.getWarningBytes());
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public void onLimitChanged() {
|
||||
setPolicyLimitBytes(mChart.getLimitBytes());
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public void requestWarningEdit() {
|
||||
WarningEditorFragment.show(DataUsageSummary.this);
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public void requestLimitEdit() {
|
||||
LimitEditorFragment.show(DataUsageSummary.this);
|
||||
}
|
||||
@@ -1287,7 +1289,7 @@ public class DataUsageSummary extends Fragment {
|
||||
return false;
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public int compareTo(CycleItem another) {
|
||||
return Long.compare(start, another.start);
|
||||
}
|
||||
@@ -1615,6 +1617,7 @@ public class DataUsageSummary extends Fragment {
|
||||
builder.setMessage(message);
|
||||
|
||||
builder.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
final DataUsageSummary target = (DataUsageSummary) getTargetFragment();
|
||||
if (target != null) {
|
||||
@@ -1670,6 +1673,7 @@ public class DataUsageSummary extends Fragment {
|
||||
|
||||
builder.setPositiveButton(R.string.data_usage_cycle_editor_positive,
|
||||
new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
final int cycleDay = cycleDayPicker.getValue();
|
||||
final String cycleTimezone = new Time().timezone;
|
||||
@@ -1730,6 +1734,7 @@ public class DataUsageSummary extends Fragment {
|
||||
|
||||
builder.setPositiveButton(R.string.data_usage_cycle_editor_positive,
|
||||
new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
// clear focus to finish pending text edits
|
||||
bytesPicker.clearFocus();
|
||||
@@ -1792,6 +1797,7 @@ public class DataUsageSummary extends Fragment {
|
||||
|
||||
builder.setPositiveButton(R.string.data_usage_cycle_editor_positive,
|
||||
new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
// clear focus to finish pending text edits
|
||||
bytesPicker.clearFocus();
|
||||
@@ -1825,6 +1831,7 @@ public class DataUsageSummary extends Fragment {
|
||||
builder.setMessage(R.string.data_usage_disable_mobile);
|
||||
|
||||
builder.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
final DataUsageSummary target = (DataUsageSummary) getTargetFragment();
|
||||
if (target != null) {
|
||||
@@ -1841,7 +1848,7 @@ public class DataUsageSummary extends Fragment {
|
||||
|
||||
/**
|
||||
* Dialog to request user confirmation before setting
|
||||
* {@link Settings.Secure#DATA_ROAMING}.
|
||||
* {@link android.provider.Settings.Secure#DATA_ROAMING}.
|
||||
*/
|
||||
public static class ConfirmDataRoamingFragment extends DialogFragment {
|
||||
public static void show(DataUsageSummary parent) {
|
||||
@@ -1861,6 +1868,7 @@ public class DataUsageSummary extends Fragment {
|
||||
builder.setMessage(R.string.roaming_warning);
|
||||
|
||||
builder.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
final DataUsageSummary target = (DataUsageSummary) getTargetFragment();
|
||||
if (target != null) {
|
||||
@@ -1896,6 +1904,7 @@ public class DataUsageSummary extends Fragment {
|
||||
builder.setMessage(getString(R.string.data_usage_restrict_background));
|
||||
|
||||
builder.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
final DataUsageSummary target = (DataUsageSummary) getTargetFragment();
|
||||
if (target != null) {
|
||||
@@ -1958,6 +1967,7 @@ public class DataUsageSummary extends Fragment {
|
||||
builder.setMessage(R.string.data_usage_app_restrict_dialog);
|
||||
|
||||
builder.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
final DataUsageSummary target = (DataUsageSummary) getTargetFragment();
|
||||
if (target != null) {
|
||||
|
@@ -296,7 +296,7 @@ public class ChartDataUsageView extends ChartView {
|
||||
}
|
||||
|
||||
private OnSweepListener mHorizListener = new OnSweepListener() {
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public void onSweep(ChartSweepView sweep, boolean sweepDone) {
|
||||
updatePrimaryRange();
|
||||
|
||||
@@ -306,7 +306,7 @@ public class ChartDataUsageView extends ChartView {
|
||||
}
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public void requestEdit(ChartSweepView sweep) {
|
||||
// ignored
|
||||
}
|
||||
@@ -324,7 +324,7 @@ public class ChartDataUsageView extends ChartView {
|
||||
}
|
||||
|
||||
private OnSweepListener mVertListener = new OnSweepListener() {
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public void onSweep(ChartSweepView sweep, boolean sweepDone) {
|
||||
if (sweepDone) {
|
||||
clearUpdateAxisDelayed(sweep);
|
||||
@@ -341,7 +341,7 @@ public class ChartDataUsageView extends ChartView {
|
||||
}
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public void requestEdit(ChartSweepView sweep) {
|
||||
if (sweep == mSweepWarning && mListener != null) {
|
||||
mListener.requestWarningEdit();
|
||||
@@ -469,7 +469,7 @@ public class ChartDataUsageView extends ChartView {
|
||||
return Objects.hashCode(mMin, mMax, mSize);
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public boolean setBounds(long min, long max) {
|
||||
if (mMin != min || mMax != max) {
|
||||
mMin = min;
|
||||
@@ -480,7 +480,7 @@ public class ChartDataUsageView extends ChartView {
|
||||
}
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public boolean setSize(float size) {
|
||||
if (mSize != size) {
|
||||
mSize = size;
|
||||
@@ -490,24 +490,24 @@ public class ChartDataUsageView extends ChartView {
|
||||
}
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public float convertToPoint(long value) {
|
||||
return (mSize * (value - mMin)) / (mMax - mMin);
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public long convertToValue(float point) {
|
||||
return (long) (mMin + ((point * (mMax - mMin)) / mSize));
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public long buildLabel(Resources res, SpannableStringBuilder builder, long value) {
|
||||
// TODO: convert to better string
|
||||
builder.replace(0, builder.length(), Long.toString(value));
|
||||
return value;
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public float[] getTickPoints() {
|
||||
final float[] ticks = new float[32];
|
||||
int i = 0;
|
||||
@@ -532,7 +532,7 @@ public class ChartDataUsageView extends ChartView {
|
||||
return Arrays.copyOf(ticks, i);
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public int shouldAdjustAxis(long value) {
|
||||
// time axis never adjusts
|
||||
return 0;
|
||||
@@ -551,7 +551,7 @@ public class ChartDataUsageView extends ChartView {
|
||||
return Objects.hashCode(mMin, mMax, mSize);
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public boolean setBounds(long min, long max) {
|
||||
if (mMin != min || mMax != max) {
|
||||
mMin = min;
|
||||
@@ -562,7 +562,7 @@ public class ChartDataUsageView extends ChartView {
|
||||
}
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public boolean setSize(float size) {
|
||||
if (mSize != size) {
|
||||
mSize = size;
|
||||
@@ -572,7 +572,7 @@ public class ChartDataUsageView extends ChartView {
|
||||
}
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public float convertToPoint(long value) {
|
||||
if (LOG_SCALE) {
|
||||
// derived polynomial fit to make lower values more visible
|
||||
@@ -585,7 +585,7 @@ public class ChartDataUsageView extends ChartView {
|
||||
}
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public long convertToValue(float point) {
|
||||
if (LOG_SCALE) {
|
||||
final double normalized = point / mSize;
|
||||
@@ -600,7 +600,7 @@ public class ChartDataUsageView extends ChartView {
|
||||
private static final Object sSpanSize = new Object();
|
||||
private static final Object sSpanUnit = new Object();
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public long buildLabel(Resources res, SpannableStringBuilder builder, long value) {
|
||||
|
||||
final CharSequence unit;
|
||||
@@ -633,7 +633,7 @@ public class ChartDataUsageView extends ChartView {
|
||||
return (long) resultRounded;
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public float[] getTickPoints() {
|
||||
final long range = mMax - mMin;
|
||||
|
||||
@@ -650,7 +650,7 @@ public class ChartDataUsageView extends ChartView {
|
||||
return tickPoints;
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public int shouldAdjustAxis(long value) {
|
||||
final float point = convertToPoint(value);
|
||||
if (point < mSize * 0.1) {
|
||||
|
@@ -30,33 +30,33 @@ public class InvertedChartAxis implements ChartAxis {
|
||||
mWrapped = wrapped;
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public boolean setBounds(long min, long max) {
|
||||
return mWrapped.setBounds(min, max);
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public boolean setSize(float size) {
|
||||
mSize = size;
|
||||
return mWrapped.setSize(size);
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public float convertToPoint(long value) {
|
||||
return mSize - mWrapped.convertToPoint(value);
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public long convertToValue(float point) {
|
||||
return mWrapped.convertToValue(mSize - point);
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public long buildLabel(Resources res, SpannableStringBuilder builder, long value) {
|
||||
return mWrapped.buildLabel(res, builder, value);
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public float[] getTickPoints() {
|
||||
final float[] points = mWrapped.getTickPoints();
|
||||
for (int i = 0; i < points.length; i++) {
|
||||
@@ -65,7 +65,7 @@ public class InvertedChartAxis implements ChartAxis {
|
||||
return points;
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public int shouldAdjustAxis(long value) {
|
||||
return mWrapped.shouldAdjustAxis(value);
|
||||
}
|
||||
|
Reference in New Issue
Block a user