[Hearing device shortcut] Setup shortcut for hearing device

* Hearing aids page need to set restricted mode to DISALLOW_CONFIG_BLUETOOTH, so change AccessibilityShortcutPreferenceFragment to extend RestrictedDashboardFragment
* move ShortcutPreference under the device control category for the 1st order

Bug: 237625815
Test: make RunSettingsRoboTests ROBOTEST_FILTER=AccessibilityShortcutPreferenceFragmentTest
Change-Id: I13da8d979694aeab76d8a10edf1348c0ee7810f6
This commit is contained in:
jasonwshsu
2022-12-09 02:12:56 +08:00
parent 23a91ff7d9
commit ad6351d614
5 changed files with 78 additions and 12 deletions

View File

@@ -93,7 +93,7 @@ public class AccessibilityShortcutPreferenceFragmentTest {
public void setUpTestFragment() {
MockitoAnnotations.initMocks(this);
mFragment = spy(new TestAccessibilityShortcutPreferenceFragment());
mFragment = spy(new TestAccessibilityShortcutPreferenceFragment(null));
when(mFragment.getPreferenceManager()).thenReturn(mPreferenceManager);
when(mFragment.getPreferenceManager().getContext()).thenReturn(mContext);
when(mFragment.getContext()).thenReturn(mContext);
@@ -256,6 +256,10 @@ public class AccessibilityShortcutPreferenceFragmentTest {
public static class TestAccessibilityShortcutPreferenceFragment
extends AccessibilityShortcutPreferenceFragment {
public TestAccessibilityShortcutPreferenceFragment(String restrictionKey) {
super(restrictionKey);
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {