Override homepage tile positions for silky home

Create configs to record the packages and orders of homepage tiles and
then according to these data to override homepage tile positions.

Bug: 168166015
Test: visual with turning on/off silky home
Change-Id: I3fcb54ac531a124101084bb40064b5a7227bf311
This commit is contained in:
Yanting Yang
2021-01-12 13:41:04 +08:00
parent bfcb1dc2c4
commit b3381de206
4 changed files with 54 additions and 0 deletions

View File

@@ -707,4 +707,18 @@ public class DashboardFeatureProviderImplTest {
assertThat(preference.getSummary()).isEqualTo(
mContext.getText(R.string.about_settings_summary));
}
@Test
@Config(qualifiers = "mcc999")
public void bindPreference_specificHomepageTile_shouldOverridePosition() {
FeatureFlagUtils.setEnabled(mContext, FeatureFlags.SILKY_HOME, true);
final Preference preference = new Preference(RuntimeEnvironment.application);
final Tile tile = new ActivityTile(mActivityInfo, CategoryKey.CATEGORY_HOMEPAGE);
mImpl.bindPreferenceToTileAndGetObservers(mActivity, mForceRoundedIcon,
MetricsEvent.VIEW_UNKNOWN, preference, tile, null /*key */,
Preference.DEFAULT_ORDER);
assertThat(preference.getOrder()).isEqualTo(100);
}
}