Remove subtitles for the homepage IA

Remove the summary of the homepage IA if silky home enabled.

Fixes: 170933968
Test: robotest & visual with turning on/off silky home
Change-Id: I502b6590cece9b80e9923109fe0582cc4d9a1c56
This commit is contained in:
Yanting Yang
2020-10-15 16:46:20 +08:00
parent 886fe1e6ab
commit 9aa4a5463f
21 changed files with 260 additions and 16 deletions

View File

@@ -31,9 +31,12 @@ import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.util.FeatureFlagUtils;
import com.android.settings.R;
import com.android.settings.core.FeatureFlags;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -65,6 +68,13 @@ public class TopLevelDisplayPreferenceControllerTest {
mController = new TopLevelDisplayPreferenceController(mContext, "test_key");
}
@After
public void tearDown() {
if (FeatureFlagUtils.isEnabled(mContext, FeatureFlags.SILKY_HOME)) {
FeatureFlagUtils.setEnabled(mContext, FeatureFlags.SILKY_HOME, false);
}
}
@Test
public void getAvailibilityStatus_availableByDefault() {
assertThat(mController.getAvailabilityStatus()).isEqualTo(AVAILABLE);
@@ -109,4 +119,11 @@ public class TopLevelDisplayPreferenceControllerTest {
assertThat(mController.getSummary())
.isEqualTo(mContext.getText(R.string.display_dashboard_nowallpaper_summary));
}
@Test
public void getSummary_silkyHomeEnabled_shouldBeNull() {
FeatureFlagUtils.setEnabled(mContext, FeatureFlags.SILKY_HOME, true);
assertThat(mController.getSummary()).isNull();
}
}