use of com.android.settingslib.drawer.ActivityTile in project android_packages_apps_Settings by omnirom.
the class CategoryManagerTest method backwardCompatCleanupForCategory_shouldNotChangeCategoryForMixedKeys.
@Test
public void backwardCompatCleanupForCategory_shouldNotChangeCategoryForMixedKeys() {
final Tile tile1 = new ActivityTile(mActivityInfo, CategoryKey.CATEGORY_ACCOUNT);
final String oldCategory = "com.android.settings.category.wireless";
final Tile tile2 = new ActivityTile(mActivityInfo, oldCategory);
final DashboardCategory category1 = new DashboardCategory(CategoryKey.CATEGORY_ACCOUNT);
category1.addTile(tile1);
final DashboardCategory category2 = new DashboardCategory(oldCategory);
category2.addTile(tile2);
mCategoryByKeyMap.put(CategoryKey.CATEGORY_ACCOUNT, category1);
mCategoryByKeyMap.put(oldCategory, category2);
mTileByComponentCache.put(new Pair<>("PACKAGE", "CLASS1"), tile1);
mTileByComponentCache.put(new Pair<>("PACKAGE", "CLASS2"), tile2);
mCategoryManager.backwardCompatCleanupForCategory(mTileByComponentCache, mCategoryByKeyMap);
assertThat(mCategoryByKeyMap.size()).isEqualTo(2);
assertThat(mCategoryByKeyMap.get(CategoryKey.CATEGORY_ACCOUNT).getTilesCount()).isEqualTo(1);
assertThat(mCategoryByKeyMap.get(oldCategory).getTilesCount()).isEqualTo(1);
}
Aggregations