Add accessibility shortcuts fragment in a11y settings
Accessibility settings category restructure, add accessibility shortcuts fragment for related accessibility services. Bug: 174829936 Test: atest AccessibilityShortcutsFragmentTest, atest AccessibilitySettingsTest Change-Id: I9706906863872bc60d31eae54bbf3a35d70e812e
This commit is contained in:
@@ -372,6 +372,9 @@ public class AccessibilitySettings extends DashboardFragment {
|
||||
} else {
|
||||
getPreferenceScreen().addPreference(downloadedServicesCategory);
|
||||
}
|
||||
|
||||
// Hide screen reader category if it is empty.
|
||||
updatePreferenceCategoryVisibility(CATEGORY_SCREEN_READER);
|
||||
}
|
||||
|
||||
private List<RestrictedPreference> getInstalledAccessibilityList(Context context) {
|
||||
@@ -452,6 +455,16 @@ public class AccessibilitySettings extends DashboardFragment {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates the visibility of a category according to its child preference count.
|
||||
*
|
||||
* @param categoryKey The key of the category which needs to check
|
||||
*/
|
||||
private void updatePreferenceCategoryVisibility(String categoryKey) {
|
||||
final PreferenceCategory category = mCategoryToPrefCategoryMap.get(categoryKey);
|
||||
category.setVisible(category.getPreferenceCount() != 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates preferences related to system configurations.
|
||||
*/
|
||||
|
Reference in New Issue
Block a user