Loading src/com/android/settings/dashboard/CategoryManager.java +3 −9 Original line number Diff line number Diff line Loading @@ -51,25 +51,19 @@ public class CategoryManager { private final Map<String, DashboardCategory> mCategoryByKeyMap; private List<DashboardCategory> mCategories; private String mExtraAction; public static CategoryManager get(Context context) { return get(context, null); } public static CategoryManager get(Context context, String action) { if (sInstance == null) { sInstance = new CategoryManager(context, action); sInstance = new CategoryManager(context); } return sInstance; } CategoryManager(Context context, String action) { CategoryManager(Context context) { mTileByComponentCache = new ArrayMap<>(); mCategoryByKeyMap = new ArrayMap<>(); mInterestingConfigChanges = new InterestingConfigChanges(); mInterestingConfigChanges.applyNewConfig(context.getResources()); mExtraAction = action; } public synchronized DashboardCategory getTilesByCategory(Context context, String categoryKey) { Loading Loading @@ -117,7 +111,7 @@ public class CategoryManager { mTileByComponentCache.clear(); } mCategoryByKeyMap.clear(); mCategories = TileUtils.getCategories(context, mTileByComponentCache, mExtraAction); mCategories = TileUtils.getCategories(context, mTileByComponentCache); for (DashboardCategory category : mCategories) { mCategoryByKeyMap.put(category.key, category); } Loading src/com/android/settings/dashboard/DashboardFeatureProvider.java +0 −5 Original line number Diff line number Diff line Loading @@ -58,11 +58,6 @@ public interface DashboardFeatureProvider { void bindPreferenceToTile(FragmentActivity activity, boolean forceRoundedIcon, int sourceMetricsCategory, Preference pref, Tile tile, String key, int baseOrder); /** * Returns additional intent filter action for dashboard tiles */ String getExtraIntentAction(); /** * Opens a tile to its destination intent. */ Loading src/com/android/settings/dashboard/DashboardFeatureProviderImpl.java +1 −6 Original line number Diff line number Diff line Loading @@ -71,7 +71,7 @@ public class DashboardFeatureProviderImpl implements DashboardFeatureProvider { public DashboardFeatureProviderImpl(Context context) { mContext = context.getApplicationContext(); mCategoryManager = CategoryManager.get(context, getExtraIntentAction()); mCategoryManager = CategoryManager.get(context); mMetricsFeatureProvider = FeatureFactory.getFactory(context).getMetricsFeatureProvider(); mPackageManager = context.getPackageManager(); } Loading Loading @@ -151,11 +151,6 @@ public class DashboardFeatureProviderImpl implements DashboardFeatureProvider { } } @Override public String getExtraIntentAction() { return null; } @Override public void openTileIntent(FragmentActivity activity, Tile tile) { if (tile == null) { Loading tests/robotests/src/com/android/settings/dashboard/DashboardFeatureProviderImplTest.java +0 −5 Original line number Diff line number Diff line Loading @@ -365,11 +365,6 @@ public class DashboardFeatureProviderImplTest { assertThat(launchIntent).isNull(); } @Test public void testGetExtraIntentAction_shouldReturnNull() { assertThat(mImpl.getExtraIntentAction()).isNull(); } @Test public void openTileIntent_profileSelectionDialog_shouldShow() { final Tile tile = new Tile(mActivityInfo, CategoryKey.CATEGORY_HOMEPAGE); Loading Loading
src/com/android/settings/dashboard/CategoryManager.java +3 −9 Original line number Diff line number Diff line Loading @@ -51,25 +51,19 @@ public class CategoryManager { private final Map<String, DashboardCategory> mCategoryByKeyMap; private List<DashboardCategory> mCategories; private String mExtraAction; public static CategoryManager get(Context context) { return get(context, null); } public static CategoryManager get(Context context, String action) { if (sInstance == null) { sInstance = new CategoryManager(context, action); sInstance = new CategoryManager(context); } return sInstance; } CategoryManager(Context context, String action) { CategoryManager(Context context) { mTileByComponentCache = new ArrayMap<>(); mCategoryByKeyMap = new ArrayMap<>(); mInterestingConfigChanges = new InterestingConfigChanges(); mInterestingConfigChanges.applyNewConfig(context.getResources()); mExtraAction = action; } public synchronized DashboardCategory getTilesByCategory(Context context, String categoryKey) { Loading Loading @@ -117,7 +111,7 @@ public class CategoryManager { mTileByComponentCache.clear(); } mCategoryByKeyMap.clear(); mCategories = TileUtils.getCategories(context, mTileByComponentCache, mExtraAction); mCategories = TileUtils.getCategories(context, mTileByComponentCache); for (DashboardCategory category : mCategories) { mCategoryByKeyMap.put(category.key, category); } Loading
src/com/android/settings/dashboard/DashboardFeatureProvider.java +0 −5 Original line number Diff line number Diff line Loading @@ -58,11 +58,6 @@ public interface DashboardFeatureProvider { void bindPreferenceToTile(FragmentActivity activity, boolean forceRoundedIcon, int sourceMetricsCategory, Preference pref, Tile tile, String key, int baseOrder); /** * Returns additional intent filter action for dashboard tiles */ String getExtraIntentAction(); /** * Opens a tile to its destination intent. */ Loading
src/com/android/settings/dashboard/DashboardFeatureProviderImpl.java +1 −6 Original line number Diff line number Diff line Loading @@ -71,7 +71,7 @@ public class DashboardFeatureProviderImpl implements DashboardFeatureProvider { public DashboardFeatureProviderImpl(Context context) { mContext = context.getApplicationContext(); mCategoryManager = CategoryManager.get(context, getExtraIntentAction()); mCategoryManager = CategoryManager.get(context); mMetricsFeatureProvider = FeatureFactory.getFactory(context).getMetricsFeatureProvider(); mPackageManager = context.getPackageManager(); } Loading Loading @@ -151,11 +151,6 @@ public class DashboardFeatureProviderImpl implements DashboardFeatureProvider { } } @Override public String getExtraIntentAction() { return null; } @Override public void openTileIntent(FragmentActivity activity, Tile tile) { if (tile == null) { Loading
tests/robotests/src/com/android/settings/dashboard/DashboardFeatureProviderImplTest.java +0 −5 Original line number Diff line number Diff line Loading @@ -365,11 +365,6 @@ public class DashboardFeatureProviderImplTest { assertThat(launchIntent).isNull(); } @Test public void testGetExtraIntentAction_shouldReturnNull() { assertThat(mImpl.getExtraIntentAction()).isNull(); } @Test public void openTileIntent_profileSelectionDialog_shouldShow() { final Tile tile = new Tile(mActivityInfo, CategoryKey.CATEGORY_HOMEPAGE); Loading