Create MoreSecurtiyPrivacyFragment
Created a new MoreSecurityPrivacyFragment, a new more_security_privacy_settings xml. This more_security_privacy_settings xml is a created by merging privacy_advanced_settings.xml and security_advanced_settings.xml and the MoreSecurityPrivacyFragment is created by merging PrivacyDashboardFragment and SecurityAdvancedSettings fragments. Test: adb shell am start -a com.android.settings.security.MORE_SECURITY_PRIVACY_SETTINGS Bug: b/261557620 Change-Id: I8729f4eaf25a31f91354383e7b6cb5e0fc7df976
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
|
||||
package com.android.settings.security;
|
||||
|
||||
|
||||
import static com.google.common.truth.Truth.assertThat;
|
||||
|
||||
import static org.mockito.ArgumentMatchers.any;
|
||||
@@ -29,7 +30,9 @@ import androidx.test.annotation.UiThreadTest;
|
||||
import androidx.test.core.app.ApplicationProvider;
|
||||
import androidx.test.ext.junit.runners.AndroidJUnit4;
|
||||
|
||||
import com.android.settings.TestUtils;
|
||||
import com.android.settings.safetycenter.SafetyCenterManagerWrapper;
|
||||
import com.android.settings.search.BaseSearchIndexProvider;
|
||||
import com.android.settings.testutils.FakeFeatureFactory;
|
||||
import com.android.settings.testutils.ResourcesUtils;
|
||||
import com.android.settingslib.drawer.CategoryKey;
|
||||
@@ -40,6 +43,8 @@ import org.junit.runner.RunWith;
|
||||
import org.mockito.Mock;
|
||||
import org.mockito.MockitoAnnotations;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
public class SecurityAdvancedSettingsTest {
|
||||
private static final String SCREEN_XML_RESOURCE_NAME = "security_advanced_settings";
|
||||
@@ -100,6 +105,18 @@ public class SecurityAdvancedSettingsTest {
|
||||
.isEqualTo(LEGACY_CATEGORY_KEY);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void whenSafetyCenterIsEnabled_pageIndexExcluded() throws Exception {
|
||||
when(mSafetyCenterManagerWrapper.isEnabled(any())).thenReturn(false);
|
||||
BaseSearchIndexProvider indexProvider = SecurityAdvancedSettings.SEARCH_INDEX_DATA_PROVIDER;
|
||||
|
||||
List<String> allXmlKeys = TestUtils.getAllXmlKeys(mContext, indexProvider);
|
||||
List<String> nonIndexableKeys = indexProvider.getNonIndexableKeys(mContext);
|
||||
allXmlKeys.removeAll(nonIndexableKeys);
|
||||
|
||||
assertThat(allXmlKeys).isEmpty();
|
||||
}
|
||||
|
||||
private int getXmlResId(String resName) {
|
||||
return ResourcesUtils.getResourcesId(mContext, "xml", resName);
|
||||
}
|
||||
|
Reference in New Issue
Block a user