Support accessibility shortcut secondary action (6/n)

Implements new edit shortcut dialog selection and save what user
prefered key back for color inversion, color correction, magnifiction,
downlaoded service - LEGACY, INVISIBLE, INTUITIVE case.

Bug: 142530063
Bug: 142531156
Test: make RunSettingsRoboTests ROBOTEST_FILTER=AccessibilityUtilTest
Test: make RunSettingsRoboTests2
Change-Id: I94607db918047ae4082457dd33f17c8675934e2c
This commit is contained in:
menghanli
2019-12-30 17:10:22 +08:00
parent 2951e4eddf
commit a5d8e12766
10 changed files with 718 additions and 213 deletions

View File

@@ -21,6 +21,8 @@ import android.view.View;
import androidx.preference.PreferenceScreen;
import com.android.settings.R;
/** For accessibility services that target SDK <= Q. */
public class LegacyAccessibilityServicePreferenceFragment extends
ToggleAccessibilityServicePreferenceFragment {
@@ -29,10 +31,13 @@ public class LegacyAccessibilityServicePreferenceFragment extends
super.onViewCreated(view, savedInstanceState);
final PreferenceScreen preferenceScreen = getPreferenceScreen();
final ShortcutPreference preference = preferenceScreen.findPreference(
final ShortcutPreference shortcutPreference = preferenceScreen.findPreference(
getShortcutPreferenceKey());
if (preference != null) {
preference.setSettingsVisibility(View.GONE);
if (shortcutPreference != null) {
final CharSequence hardwareTitle = getPrefContext().getText(
R.string.accessibility_shortcut_edit_dialog_title_hardware);
shortcutPreference.setSummary(hardwareTitle);
shortcutPreference.setSettingsVisibility(View.GONE);
}
}
}