Fix search indexing for encryption_and_credential page

- Rewrite search index provider to include all possible keys through
  getXmlResourcesToIndex()
- Add isPageSearchEnabled() to disable all keys if user is not admin
- Add getNonIndexableKeys to suppress unrelated keys based on current
  device state

Change-Id: I2c6943483789bf4c9f3931d344cf279fec0edaee
Fix: 37650170
Test: robotests
This commit is contained in:
Fan Zhang
2017-07-21 17:51:47 -07:00
parent 6666bf5605
commit a4a3833a08
7 changed files with 149 additions and 90 deletions

View File

@@ -24,25 +24,21 @@
android:order="100">
<com.android.settingslib.RestrictedPreference android:key="credential_storage_type"
android:title="@string/credential_storage_type"
android:persistent="false" />
android:title="@string/credential_storage_type" />
<Preference android:key="trusted_credentials"
android:title="@string/trusted_credentials"
android:summary="@string/trusted_credentials_summary"
android:persistent="false"
android:fragment="com.android.settings.TrustedCredentialsSettings"/>
<com.android.settingslib.RestrictedPreference android:key="user_credentials"
android:title="@string/user_credentials"
android:summary="@string/user_credentials_summary"
android:persistent="false"
android:fragment="com.android.settings.UserCredentialsSettings"/>
<com.android.settingslib.RestrictedPreference android:key="credentials_install"
android:title="@string/credentials_install"
android:summary="@string/credentials_install_summary"
android:persistent="false">
android:summary="@string/credentials_install_summary">
<intent android:action="android.credentials.INSTALL"
android:targetPackage="com.android.certinstaller"
@@ -52,8 +48,7 @@
<com.android.settingslib.RestrictedPreference android:key="credentials_reset"
android:title="@string/credentials_reset"
android:summary="@string/credentials_reset_summary"
android:persistent="false">
android:summary="@string/credentials_reset_summary">
<intent android:action="com.android.credentials.RESET"
android:targetPackage="com.android.settings"

View File

@@ -18,12 +18,10 @@
android:title="@string/security_settings_title">
<PreferenceCategory
android:key="security_category"
android:key="security_category_for_encrypted_device"
android:title="@string/crypt_keeper_settings_title">
<Preference
android:enabled="false"
android:shouldDisableView="false"
android:key="crypt_keeper_encrypt_title"
android:title="@string/crypt_keeper_encrypt_title"
android:summary="@string/crypt_keeper_encrypted_summary"/>

View File

@@ -18,14 +18,14 @@
android:title="@string/crypt_keeper_settings_title">
<PreferenceCategory
android:key="security_category"
android:key="security_category_for_unencrypted_device"
android:title="@string/crypt_keeper_settings_title">
<Preference
android:key="encryption"
android:title="@string/crypt_keeper_encrypt_title"
android:fragment="com.android.settings.CryptKeeperSettings" />
</PreferenceCategory>
</PreferenceScreen>