Commit 7cefa911 authored by Brandon Wylie's avatar Brandon Wylie Committed by Commit Bot

Fix 'Select all' option remains selected after deselecting options

Bug: 1014420
Change-Id: Idd2b5211db5a547e1364966f8c43efc5e0c7c0eb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1893518Reviewed-by: default avatarEric Seckler <eseckler@chromium.org>
Commit-Queue: Brandon Wylie <wylieb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#711409}
parent b16a7697
# Android developer preferences
Pages aimed at developers for debugging/tracing.
## How to enable
Enabling developer preferences is similar to enabling developer options in the
Android OS.
1. Navigate to Settings > "About Chrome".
2. Tap "Application version" continuously until it reads "Developer options are
now enabled."
3. Find the developer preferences under Settings > "Developer options".
......@@ -38,6 +38,7 @@ public class TracingCategoriesPreferences
private @TracingPreferences.CategoryType int mType;
private Set<String> mEnabledCategories;
private List<CheckBoxPreference> mAllPreferences;
private CheckBoxPreference mSelectAllPreference;
@Override
public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
......@@ -55,13 +56,12 @@ public class TracingCategoriesPreferences
Collections.sort(sortedCategories);
// Special preference to select all or deselect the entire list.
CheckBoxPreference selectAllPreference =
new ChromeBaseCheckBoxPreference(getStyledContext(), null);
selectAllPreference.setKey(SELECT_ALL_KEY);
selectAllPreference.setTitle(SELECT_ALL_TITLE);
selectAllPreference.setPersistent(false);
selectAllPreference.setOnPreferenceChangeListener(this);
preferenceScreen.addPreference(selectAllPreference);
mSelectAllPreference = new ChromeBaseCheckBoxPreference(getStyledContext(), null);
mSelectAllPreference.setKey(SELECT_ALL_KEY);
mSelectAllPreference.setTitle(SELECT_ALL_TITLE);
mSelectAllPreference.setPersistent(false);
mSelectAllPreference.setOnPreferenceChangeListener(this);
preferenceScreen.addPreference(mSelectAllPreference);
for (String category : sortedCategories) {
if (TracingPreferences.getCategoryType(category) == mType) {
......@@ -70,7 +70,7 @@ public class TracingCategoriesPreferences
preferenceScreen.addPreference(pref);
}
}
selectAllPreference.setChecked(mEnabledCategories.size() == mAllPreferences.size());
mSelectAllPreference.setChecked(mEnabledCategories.size() == mAllPreferences.size());
setPreferenceScreen(preferenceScreen);
}
......@@ -100,6 +100,7 @@ public class TracingCategoriesPreferences
} else {
mEnabledCategories.remove(preference.getKey());
}
mSelectAllPreference.setChecked(mEnabledCategories.size() == mAllPreferences.size());
TracingPreferences.setEnabledCategories(mType, mEnabledCategories);
return true;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment