Enable Encryption & Creds UI for Secondary users
Bug: 123211155 Test: Manual,m -j RunSettingsRoboTests Change-Id: Ic669102c72a5270423f000d5326b48c91901a0ed
This commit is contained in:
@@ -16,19 +16,13 @@
|
||||
|
||||
package com.android.settings.security;
|
||||
|
||||
import static com.android.settings.security.EncryptionAndCredential.SEARCH_INDEX_DATA_PROVIDER;
|
||||
|
||||
import static com.google.common.truth.Truth.assertThat;
|
||||
|
||||
import static org.mockito.Mockito.when;
|
||||
|
||||
import android.app.admin.DevicePolicyManager;
|
||||
import android.content.Context;
|
||||
import android.os.UserManager;
|
||||
import android.provider.SearchIndexableResource;
|
||||
|
||||
import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
|
||||
import com.android.settings.search.BaseSearchIndexProvider;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
@@ -39,9 +33,6 @@ import org.robolectric.RobolectricTestRunner;
|
||||
import org.robolectric.RuntimeEnvironment;
|
||||
import org.robolectric.shadows.ShadowApplication;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@RunWith(RobolectricTestRunner.class)
|
||||
public class EncryptionAndCredentialTest {
|
||||
|
||||
@@ -67,19 +58,4 @@ public class EncryptionAndCredentialTest {
|
||||
assertThat(fragment.getMetricsCategory()).isEqualTo(MetricsEvent.ENCRYPTION_AND_CREDENTIAL);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getNonIndexableKeys_pageIsDisabled_shouldReturnAllKeysAsNonIndexable() {
|
||||
when(mUserManager.isAdminUser()).thenReturn(false);
|
||||
|
||||
final List<SearchIndexableResource> index =
|
||||
SEARCH_INDEX_DATA_PROVIDER.getXmlResourcesToIndex(mContext, true /* enabled */);
|
||||
final List<String> expectedKeys = new ArrayList<>();
|
||||
for (SearchIndexableResource res : index) {
|
||||
expectedKeys.addAll(((BaseSearchIndexProvider) SEARCH_INDEX_DATA_PROVIDER)
|
||||
.getNonIndexableKeysFromXml(mContext, res.xmlResId, true /* suppressAll */));
|
||||
}
|
||||
final List<String> keys = SEARCH_INDEX_DATA_PROVIDER.getNonIndexableKeys(mContext);
|
||||
|
||||
assertThat(keys).containsExactlyElementsIn(expectedKeys);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user