Loading res/values/config.xml +32 −10 Original line number Diff line number Diff line Loading @@ -101,6 +101,14 @@ --> </string-array> <!-- List containing the component names of pre-installed speech services. --> <string-array name="config_preinstalled_speech_services" translatable="false"> <!-- <item>com.example.package.first/com.example.class.FirstService</item> <item>com.example.package.second/com.example.class.SecondService</item> --> </string-array> <!-- List containing the component names of pre-installed interaction control services. --> <string-array name="config_preinstalled_interaction_control_services" translatable="false"> <!-- Loading @@ -109,8 +117,9 @@ --> </string-array> <!-- List containing the order of services in screen reader category by componentname. All componentnames in a category need to be specified to guarantee correct behavior.--> <!-- List containing the order of services in screen reader category by {@link ComponentName}. All {@link ComponentName} in a category need to be specified to guarantee correct behavior.--> <string-array name="config_order_screen_reader_services" translatable="false"> <!-- <item>com.example.package.first/com.example.class.FirstService</item> Loading @@ -119,8 +128,8 @@ </string-array> <!-- List containing the order of services in captions category by preference key or componentname. All preference keys in a category need to be specified to guarantee correct behavior.--> {@link ComponentName}. All preference keys in a category need to be specified to guarantee correct behavior.--> <string-array name="config_order_captions_services" translatable="false"> <!-- <item>com.example.package.first/com.example.class.FirstService</item> Loading @@ -131,8 +140,8 @@ --> </string-array> <!-- List containing the order of services in audio and caption category by preference key or componentname. All preference keys in a category need to be specified to guarantee <!-- List containing the order of services in audio and caption category by preference key or {@link ComponentName}. All preference keys in a category need to be specified to guarantee correct behavior.--> <string-array name="config_order_audio_services" translatable="false"> <!-- Loading @@ -144,8 +153,8 @@ --> </string-array> <!-- List containing the order of services in display category by preference key or componentname. All preference keys in a category need to be specified to guarantee <!-- List containing the order of services in display category by preference key or {@link ComponentName}. All preference keys in a category need to be specified to guarantee correct behavior.--> <string-array name="config_order_display_services" translatable="false"> <!-- Loading @@ -157,8 +166,21 @@ --> </string-array> <!-- List containing the order of services in interaction control category by preference key or componentname. All preference keys in a category need to be specified to guarantee <!-- List containing the order of services in speech category by preference key or {@link ComponentName}. All preference keys in a category need to be specified to guarantee correct behavior.--> <string-array name="config_order_speech_services" translatable="false"> <!-- <item>com.example.package.first/com.example.class.FirstService</item> <item>com.example.package.second/com.example.class.SecondService</item> <item>font_size_preference_screen</item> <item>dark_ui_mode_accessibility</item> <item>...</item> --> </string-array> <!-- List containing the order of services in interaction control category by preference key or {@link ComponentName}. All preference keys in a category need to be specified to guarantee correct behavior.--> <string-array name="config_order_interaction_control_services" translatable="false"> <!-- Loading res/xml/accessibility_settings.xml +5 −0 Original line number Diff line number Diff line Loading @@ -169,6 +169,11 @@ </PreferenceCategory> <PreferenceCategory android:key="speech_category" android:persistent="false" android:title="@string/speech_category_title"/> <PreferenceCategory android:persistent="false" android:title="@string/general_category_title"> Loading src/com/android/settings/accessibility/AccessibilitySettings.java +8 −2 Original line number Diff line number Diff line Loading @@ -63,6 +63,7 @@ public class AccessibilitySettings extends DashboardFragment { private static final String CATEGORY_SCREEN_READER = "screen_reader_category"; private static final String CATEGORY_CAPTIONS = "captions_category"; private static final String CATEGORY_AUDIO = "audio_category"; private static final String CATEGORY_SPEECH = "speech_category"; private static final String CATEGORY_DISPLAY = "display_category"; private static final String CATEGORY_DOWNLOADED_SERVICES = "user_installed_services_category"; @VisibleForTesting Loading @@ -70,7 +71,7 @@ public class AccessibilitySettings extends DashboardFragment { private static final String[] CATEGORIES = new String[]{ CATEGORY_SCREEN_READER, CATEGORY_CAPTIONS, CATEGORY_AUDIO, CATEGORY_DISPLAY, CATEGORY_INTERACTION_CONTROL, CATEGORY_DOWNLOADED_SERVICES CATEGORY_SPEECH, CATEGORY_INTERACTION_CONTROL, CATEGORY_DOWNLOADED_SERVICES }; // Extras passed to sub-fragments. Loading Loading @@ -351,6 +352,8 @@ public class AccessibilitySettings extends DashboardFragment { R.array.config_preinstalled_audio_services); initializePreBundledServicesMapFromArray(CATEGORY_DISPLAY, R.array.config_preinstalled_display_services); initializePreBundledServicesMapFromArray(CATEGORY_SPEECH, R.array.config_preinstalled_speech_services); initializePreBundledServicesMapFromArray(CATEGORY_INTERACTION_CONTROL, R.array.config_preinstalled_interaction_control_services); Loading Loading @@ -390,6 +393,8 @@ public class AccessibilitySettings extends DashboardFragment { R.array.config_order_interaction_control_services); updateCategoryOrderFromArray(CATEGORY_DISPLAY, R.array.config_order_display_services); updateCategoryOrderFromArray(CATEGORY_SPEECH, R.array.config_order_speech_services); // Need to check each time when updateServicePreferences() called. if (downloadedServicesCategory.getPreferenceCount() == 0) { Loading @@ -398,8 +403,9 @@ public class AccessibilitySettings extends DashboardFragment { getPreferenceScreen().addPreference(downloadedServicesCategory); } // Hide screen reader category if it is empty. // Hide category if it is empty. updatePreferenceCategoryVisibility(CATEGORY_SCREEN_READER); updatePreferenceCategoryVisibility(CATEGORY_SPEECH); } private List<RestrictedPreference> getInstalledAccessibilityList(Context context) { Loading Loading
res/values/config.xml +32 −10 Original line number Diff line number Diff line Loading @@ -101,6 +101,14 @@ --> </string-array> <!-- List containing the component names of pre-installed speech services. --> <string-array name="config_preinstalled_speech_services" translatable="false"> <!-- <item>com.example.package.first/com.example.class.FirstService</item> <item>com.example.package.second/com.example.class.SecondService</item> --> </string-array> <!-- List containing the component names of pre-installed interaction control services. --> <string-array name="config_preinstalled_interaction_control_services" translatable="false"> <!-- Loading @@ -109,8 +117,9 @@ --> </string-array> <!-- List containing the order of services in screen reader category by componentname. All componentnames in a category need to be specified to guarantee correct behavior.--> <!-- List containing the order of services in screen reader category by {@link ComponentName}. All {@link ComponentName} in a category need to be specified to guarantee correct behavior.--> <string-array name="config_order_screen_reader_services" translatable="false"> <!-- <item>com.example.package.first/com.example.class.FirstService</item> Loading @@ -119,8 +128,8 @@ </string-array> <!-- List containing the order of services in captions category by preference key or componentname. All preference keys in a category need to be specified to guarantee correct behavior.--> {@link ComponentName}. All preference keys in a category need to be specified to guarantee correct behavior.--> <string-array name="config_order_captions_services" translatable="false"> <!-- <item>com.example.package.first/com.example.class.FirstService</item> Loading @@ -131,8 +140,8 @@ --> </string-array> <!-- List containing the order of services in audio and caption category by preference key or componentname. All preference keys in a category need to be specified to guarantee <!-- List containing the order of services in audio and caption category by preference key or {@link ComponentName}. All preference keys in a category need to be specified to guarantee correct behavior.--> <string-array name="config_order_audio_services" translatable="false"> <!-- Loading @@ -144,8 +153,8 @@ --> </string-array> <!-- List containing the order of services in display category by preference key or componentname. All preference keys in a category need to be specified to guarantee <!-- List containing the order of services in display category by preference key or {@link ComponentName}. All preference keys in a category need to be specified to guarantee correct behavior.--> <string-array name="config_order_display_services" translatable="false"> <!-- Loading @@ -157,8 +166,21 @@ --> </string-array> <!-- List containing the order of services in interaction control category by preference key or componentname. All preference keys in a category need to be specified to guarantee <!-- List containing the order of services in speech category by preference key or {@link ComponentName}. All preference keys in a category need to be specified to guarantee correct behavior.--> <string-array name="config_order_speech_services" translatable="false"> <!-- <item>com.example.package.first/com.example.class.FirstService</item> <item>com.example.package.second/com.example.class.SecondService</item> <item>font_size_preference_screen</item> <item>dark_ui_mode_accessibility</item> <item>...</item> --> </string-array> <!-- List containing the order of services in interaction control category by preference key or {@link ComponentName}. All preference keys in a category need to be specified to guarantee correct behavior.--> <string-array name="config_order_interaction_control_services" translatable="false"> <!-- Loading
res/xml/accessibility_settings.xml +5 −0 Original line number Diff line number Diff line Loading @@ -169,6 +169,11 @@ </PreferenceCategory> <PreferenceCategory android:key="speech_category" android:persistent="false" android:title="@string/speech_category_title"/> <PreferenceCategory android:persistent="false" android:title="@string/general_category_title"> Loading
src/com/android/settings/accessibility/AccessibilitySettings.java +8 −2 Original line number Diff line number Diff line Loading @@ -63,6 +63,7 @@ public class AccessibilitySettings extends DashboardFragment { private static final String CATEGORY_SCREEN_READER = "screen_reader_category"; private static final String CATEGORY_CAPTIONS = "captions_category"; private static final String CATEGORY_AUDIO = "audio_category"; private static final String CATEGORY_SPEECH = "speech_category"; private static final String CATEGORY_DISPLAY = "display_category"; private static final String CATEGORY_DOWNLOADED_SERVICES = "user_installed_services_category"; @VisibleForTesting Loading @@ -70,7 +71,7 @@ public class AccessibilitySettings extends DashboardFragment { private static final String[] CATEGORIES = new String[]{ CATEGORY_SCREEN_READER, CATEGORY_CAPTIONS, CATEGORY_AUDIO, CATEGORY_DISPLAY, CATEGORY_INTERACTION_CONTROL, CATEGORY_DOWNLOADED_SERVICES CATEGORY_SPEECH, CATEGORY_INTERACTION_CONTROL, CATEGORY_DOWNLOADED_SERVICES }; // Extras passed to sub-fragments. Loading Loading @@ -351,6 +352,8 @@ public class AccessibilitySettings extends DashboardFragment { R.array.config_preinstalled_audio_services); initializePreBundledServicesMapFromArray(CATEGORY_DISPLAY, R.array.config_preinstalled_display_services); initializePreBundledServicesMapFromArray(CATEGORY_SPEECH, R.array.config_preinstalled_speech_services); initializePreBundledServicesMapFromArray(CATEGORY_INTERACTION_CONTROL, R.array.config_preinstalled_interaction_control_services); Loading Loading @@ -390,6 +393,8 @@ public class AccessibilitySettings extends DashboardFragment { R.array.config_order_interaction_control_services); updateCategoryOrderFromArray(CATEGORY_DISPLAY, R.array.config_order_display_services); updateCategoryOrderFromArray(CATEGORY_SPEECH, R.array.config_order_speech_services); // Need to check each time when updateServicePreferences() called. if (downloadedServicesCategory.getPreferenceCount() == 0) { Loading @@ -398,8 +403,9 @@ public class AccessibilitySettings extends DashboardFragment { getPreferenceScreen().addPreference(downloadedServicesCategory); } // Hide screen reader category if it is empty. // Hide category if it is empty. updatePreferenceCategoryVisibility(CATEGORY_SCREEN_READER); updatePreferenceCategoryVisibility(CATEGORY_SPEECH); } private List<RestrictedPreference> getInstalledAccessibilityList(Context context) { Loading