diff --git a/AndroidManifest.xml b/AndroidManifest.xml index b2a8dd12a75..2f42c8f5cbf 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -812,6 +812,7 @@ android:resource="@string/wallpaper_suggestion_summary" /> + + + + { @@ -445,7 +450,7 @@ public class DashboardAdapterTest { } @Test - public void testSuggestioDismissed_notOnlySuggestion_doNothing() { + public void testSuggestionDismissed_notOnlySuggestion_doNothing() { final DashboardAdapter adapter = spy(new DashboardAdapter(mContext, null, null)); adapter.setCategoriesAndSuggestions( new ArrayList<>(), makeSuggestions("pkg1", "pkg2", "pkg3")); @@ -459,7 +464,7 @@ public class DashboardAdapterTest { } @Test - public void testSuggestioDismissed_onlySuggestion_updateDashboardData() { + public void testSuggestionDismissed_onlySuggestion_updateDashboardData() { DashboardAdapter adapter = spy(new DashboardAdapter(mContext, null, null)); adapter.setCategoriesAndSuggestions(new ArrayList<>(), makeSuggestions("pkg1")); final DashboardData dashboardData = adapter.mDashboardData; @@ -471,6 +476,22 @@ public class DashboardAdapterTest { verify(adapter).notifyDashboardDataChanged(any()); } + @Test + public void testSetCategoriesAndSuggestions_iconTinted() { + TypedArray mockTypedArray = mock(TypedArray.class); + doReturn(mockTypedArray).when(mContext).obtainStyledAttributes(any(int[].class)); + doReturn(0x89000000).when(mockTypedArray).getColor(anyInt(), anyInt()); + + List packages = makeSuggestions("pkg1"); + Icon mockIcon = mock(Icon.class); + packages.get(0).isIconTintable = true; + packages.get(0).icon = mockIcon; + + mDashboardAdapter.setCategoriesAndSuggestions(Collections.emptyList(), packages); + + verify(mockIcon).setTint(eq(0x89000000)); + } + private List makeSuggestions(String... pkgNames) { final List suggestions = new ArrayList<>(); for (String pkgName : pkgNames) {