Merge "[PK Setting] update searchable if page is not visible" into main

This commit is contained in:
Shaowei Shen
2023-11-30 07:17:47 +00:00
committed by Android (Google) Code Review
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) {
return FeatureFlagUtils
.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;
return Arrays.asList(sir);
}
@Override
protected boolean isPageSearchEnabled(Context context) {
return !getHardKeyboards(context).isEmpty();
}
};
}