[PK Setting] update searchable if page is not visible

if PK setting is not available, also make it not searchable.

Test: verified on device
Bug: 301881819
Change-Id: I6e71634ce5ddc6d5db3d31f5614fef7ccabc6d3d
This commit is contained in:
shaoweishen
2023-11-29 08:59:31 +00:00
parent 6bb2c73579
commit 365f55efc5
2 changed files with 7 additions and 1 deletions

View File

@@ -58,7 +58,8 @@ public class ModifierKeysSettings extends DashboardFragment {
protected boolean isPageSearchEnabled(Context context) { protected boolean isPageSearchEnabled(Context context) {
return FeatureFlagUtils return FeatureFlagUtils
.isEnabled( .isEnabled(
context, FeatureFlagUtils.SETTINGS_NEW_KEYBOARD_MODIFIER_KEY); context, FeatureFlagUtils.SETTINGS_NEW_KEYBOARD_MODIFIER_KEY)
&& !PhysicalKeyboardFragment.getHardKeyboards(context).isEmpty();
} }
}; };
} }

View File

@@ -474,5 +474,10 @@ public final class PhysicalKeyboardFragment extends SettingsPreferenceFragment
sir.xmlResId = R.xml.physical_keyboard_settings; sir.xmlResId = R.xml.physical_keyboard_settings;
return Arrays.asList(sir); return Arrays.asList(sir);
} }
@Override
protected boolean isPageSearchEnabled(Context context) {
return !getHardKeyboards(context).isEmpty();
}
}; };
} }