Improve Search results highlighting
- remove unnecessary code
- use keyed Tag with a well known App key for preventing collisions
- fix missing Brightness Level preference key (used for highlight)
Change-Id: I070e3b8c3cb43da7addd34be192aade21951f57c
diff --git a/src/com/android/settings/DataUsageSummary.java b/src/com/android/settings/DataUsageSummary.java
index 1d41816..dbef6cb 100644
--- a/src/com/android/settings/DataUsageSummary.java
+++ b/src/com/android/settings/DataUsageSummary.java
@@ -360,7 +360,8 @@
mDataEnabled = new Switch(inflater.getContext());
mDataEnabledView = inflatePreference(inflater, mNetworkSwitches, mDataEnabled);
- mDataEnabledView.setTag(DATA_USAGE_ENABLE_MOBILE_KEY);
+ mDataEnabledView.setTag(R.id.preference_highlight_key,
+ DATA_USAGE_ENABLE_MOBILE_KEY);
mDataEnabled.setOnCheckedChangeListener(mDataEnabledListener);
mNetworkSwitches.addView(mDataEnabledView);
@@ -368,7 +369,8 @@
mDisableAtLimit.setClickable(false);
mDisableAtLimit.setFocusable(false);
mDisableAtLimitView = inflatePreference(inflater, mNetworkSwitches, mDisableAtLimit);
- mDisableAtLimitView.setTag(DATA_USAGE_DISABLE_MOBILE_LIMIT_KEY);
+ mDisableAtLimitView.setTag(R.id.preference_highlight_key,
+ DATA_USAGE_DISABLE_MOBILE_LIMIT_KEY);
mDisableAtLimitView.setClickable(true);
mDisableAtLimitView.setFocusable(true);
mDisableAtLimitView.setOnClickListener(mDisableAtLimitListener);
@@ -377,7 +379,7 @@
// bind cycle dropdown
mCycleView = mHeader.findViewById(R.id.cycles);
- mCycleView.setTag(DATA_USAGE_CYCLE_KEY);
+ mCycleView.setTag(R.id.preference_highlight_key, DATA_USAGE_CYCLE_KEY);
mCycleSpinner = (Spinner) mCycleView.findViewById(R.id.cycles_spinner);
mCycleAdapter = new CycleAdapter(context);
mCycleSpinner.setAdapter(mCycleAdapter);