Loading tests/AndroidManifest-common.xml +14 −1 Original line number Diff line number Diff line Loading @@ -183,6 +183,7 @@ </activity> <activity-alias android:name="Activity2" android:label="TestActivity2" android:icon="@drawable/test_icon" android:exported="true" android:targetActivity="com.android.launcher3.testcomponent.BaseTestingActivity"> <intent-filter> Loading @@ -192,6 +193,7 @@ </activity-alias> <activity-alias android:name="Activity3" android:label="TestActivity3" android:icon="@drawable/test_icon" android:exported="true" android:targetActivity="com.android.launcher3.testcomponent.BaseTestingActivity"> <intent-filter> Loading @@ -201,6 +203,7 @@ </activity-alias> <activity-alias android:name="Activity4" android:label="TestActivity4" android:icon="@drawable/test_icon" android:exported="true" android:targetActivity="com.android.launcher3.testcomponent.BaseTestingActivity"> <intent-filter> Loading @@ -210,6 +213,7 @@ </activity-alias> <activity-alias android:name="Activity5" android:label="TestActivity5" android:icon="@drawable/test_icon" android:exported="true" android:targetActivity="com.android.launcher3.testcomponent.BaseTestingActivity"> <intent-filter> Loading @@ -219,6 +223,7 @@ </activity-alias> <activity-alias android:name="Activity6" android:label="TestActivity6" android:icon="@drawable/test_icon" android:exported="true" android:targetActivity="com.android.launcher3.testcomponent.BaseTestingActivity"> <intent-filter> Loading @@ -228,6 +233,7 @@ </activity-alias> <activity-alias android:name="Activity7" android:label="TestActivity7" android:icon="@drawable/test_icon" android:exported="true" android:targetActivity="com.android.launcher3.testcomponent.BaseTestingActivity"> <intent-filter> Loading @@ -237,6 +243,7 @@ </activity-alias> <activity-alias android:name="Activity8" android:label="TestActivity8" android:icon="@drawable/test_icon" android:exported="true" android:targetActivity="com.android.launcher3.testcomponent.BaseTestingActivity"> <intent-filter> Loading @@ -246,6 +253,7 @@ </activity-alias> <activity-alias android:name="Activity9" android:exported="true" android:label="TestActivity9" android:icon="@drawable/test_icon" android:targetActivity="com.android.launcher3.testcomponent.OtherBaseTestingActivity"> <intent-filter> <action android:name="android.intent.action.MAIN" /> Loading @@ -254,6 +262,7 @@ </activity-alias> <activity-alias android:name="Activity10" android:exported="true" android:label="TestActivity10" android:icon="@drawable/test_icon" android:targetActivity="com.android.launcher3.testcomponent.OtherBaseTestingActivity"> <intent-filter> <action android:name="android.intent.action.MAIN" /> Loading @@ -262,6 +271,7 @@ </activity-alias> <activity-alias android:name="Activity11" android:exported="true" android:label="TestActivity11" android:icon="@drawable/test_icon" android:targetActivity="com.android.launcher3.testcomponent.OtherBaseTestingActivity"> <intent-filter> <action android:name="android.intent.action.MAIN" /> Loading @@ -270,6 +280,7 @@ </activity-alias> <activity-alias android:name="Activity12" android:exported="true" android:label="TestActivity12" android:icon="@drawable/test_icon" android:targetActivity="com.android.launcher3.testcomponent.OtherBaseTestingActivity"> <intent-filter> <action android:name="android.intent.action.MAIN" /> Loading @@ -278,6 +289,7 @@ </activity-alias> <activity-alias android:name="Activity13" android:exported="true" android:label="TestActivity13" android:icon="@drawable/test_icon" android:targetActivity="com.android.launcher3.testcomponent.OtherBaseTestingActivity"> <intent-filter> <action android:name="android.intent.action.MAIN" /> Loading @@ -286,6 +298,7 @@ </activity-alias> <activity-alias android:name="Activity14" android:exported="true" android:label="TestActivity14" android:icon="@drawable/test_icon" android:targetActivity="com.android.launcher3.testcomponent.OtherBaseTestingActivity"> <intent-filter> <action android:name="android.intent.action.MAIN" /> Loading Loading @@ -363,7 +376,7 @@ </activity> <activity android:name="com.android.launcher3.testcomponent.ImeTestActivity" android:label="ImeTestActivity" android:icon="@drawable/test_theme_icon" android:icon="@drawable/test_icon" android:exported="true"> <intent-filter> <action android:name="android.intent.action.MAIN" /> Loading tests/multivalentTests/src/com/android/launcher3/model/FolderIconLoadTest.kt +13 −1 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ package com.android.launcher3.model import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.filters.SmallTest import com.android.launcher3.LauncherAppState import com.android.launcher3.icons.BitmapInfo import com.android.launcher3.model.data.WorkspaceItemInfo import com.android.launcher3.util.Executors import com.android.launcher3.util.LauncherLayoutBuilder Loading Loading @@ -58,7 +59,7 @@ class FolderIconLoadTest { TEST_ACTIVITY11, TEST_ACTIVITY12, TEST_ACTIVITY13, TEST_ACTIVITY14 TEST_ACTIVITY14, ) @Before Loading Loading @@ -169,6 +170,9 @@ class FolderIconLoadTest { assertWithMessage("Index $index was not highRes") .that(items[index].bitmap.isNullOrLowRes) .isFalse() assertWithMessage("Index $index was the default icon") .that(isDefaultIcon(items[index].bitmap)) .isFalse() } } Loading @@ -177,9 +181,17 @@ class FolderIconLoadTest { assertWithMessage("Index $index was not lowRes") .that(items[index].bitmap.isNullOrLowRes) .isTrue() assertWithMessage("Index $index was the default icon") .that(isDefaultIcon(items[index].bitmap)) .isFalse() } } private fun isDefaultIcon(bitmap: BitmapInfo) = LauncherAppState.getInstance(modelHelper.sandboxContext) .iconCache .isDefaultIcon(bitmap, modelHelper.sandboxContext.user) /** Recreate DeviceProfiles after changing InvariantDeviceProfile */ private fun recreateSupportedDeviceProfiles() { LauncherAppState.getIDP(modelHelper.sandboxContext).supportedProfiles = Loading tests/res/drawable/test_icon.xml 0 → 100644 +29 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- Copyright (C) 2024 The Android Open Source Project Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android"> <background android:drawable="@android:color/white"/> <foreground> <color android:color="#FFFF0000" /> </foreground> <monochrome> <vector android:width="48dp" android:height="48dp" android:viewportWidth="48.0" android:viewportHeight="48.0"> <path android:fillColor="#FF000000" android:pathData="M0,24L48,24 48,48, 0,48 Z"/> </vector> </monochrome> </adaptive-icon> Loading
tests/AndroidManifest-common.xml +14 −1 Original line number Diff line number Diff line Loading @@ -183,6 +183,7 @@ </activity> <activity-alias android:name="Activity2" android:label="TestActivity2" android:icon="@drawable/test_icon" android:exported="true" android:targetActivity="com.android.launcher3.testcomponent.BaseTestingActivity"> <intent-filter> Loading @@ -192,6 +193,7 @@ </activity-alias> <activity-alias android:name="Activity3" android:label="TestActivity3" android:icon="@drawable/test_icon" android:exported="true" android:targetActivity="com.android.launcher3.testcomponent.BaseTestingActivity"> <intent-filter> Loading @@ -201,6 +203,7 @@ </activity-alias> <activity-alias android:name="Activity4" android:label="TestActivity4" android:icon="@drawable/test_icon" android:exported="true" android:targetActivity="com.android.launcher3.testcomponent.BaseTestingActivity"> <intent-filter> Loading @@ -210,6 +213,7 @@ </activity-alias> <activity-alias android:name="Activity5" android:label="TestActivity5" android:icon="@drawable/test_icon" android:exported="true" android:targetActivity="com.android.launcher3.testcomponent.BaseTestingActivity"> <intent-filter> Loading @@ -219,6 +223,7 @@ </activity-alias> <activity-alias android:name="Activity6" android:label="TestActivity6" android:icon="@drawable/test_icon" android:exported="true" android:targetActivity="com.android.launcher3.testcomponent.BaseTestingActivity"> <intent-filter> Loading @@ -228,6 +233,7 @@ </activity-alias> <activity-alias android:name="Activity7" android:label="TestActivity7" android:icon="@drawable/test_icon" android:exported="true" android:targetActivity="com.android.launcher3.testcomponent.BaseTestingActivity"> <intent-filter> Loading @@ -237,6 +243,7 @@ </activity-alias> <activity-alias android:name="Activity8" android:label="TestActivity8" android:icon="@drawable/test_icon" android:exported="true" android:targetActivity="com.android.launcher3.testcomponent.BaseTestingActivity"> <intent-filter> Loading @@ -246,6 +253,7 @@ </activity-alias> <activity-alias android:name="Activity9" android:exported="true" android:label="TestActivity9" android:icon="@drawable/test_icon" android:targetActivity="com.android.launcher3.testcomponent.OtherBaseTestingActivity"> <intent-filter> <action android:name="android.intent.action.MAIN" /> Loading @@ -254,6 +262,7 @@ </activity-alias> <activity-alias android:name="Activity10" android:exported="true" android:label="TestActivity10" android:icon="@drawable/test_icon" android:targetActivity="com.android.launcher3.testcomponent.OtherBaseTestingActivity"> <intent-filter> <action android:name="android.intent.action.MAIN" /> Loading @@ -262,6 +271,7 @@ </activity-alias> <activity-alias android:name="Activity11" android:exported="true" android:label="TestActivity11" android:icon="@drawable/test_icon" android:targetActivity="com.android.launcher3.testcomponent.OtherBaseTestingActivity"> <intent-filter> <action android:name="android.intent.action.MAIN" /> Loading @@ -270,6 +280,7 @@ </activity-alias> <activity-alias android:name="Activity12" android:exported="true" android:label="TestActivity12" android:icon="@drawable/test_icon" android:targetActivity="com.android.launcher3.testcomponent.OtherBaseTestingActivity"> <intent-filter> <action android:name="android.intent.action.MAIN" /> Loading @@ -278,6 +289,7 @@ </activity-alias> <activity-alias android:name="Activity13" android:exported="true" android:label="TestActivity13" android:icon="@drawable/test_icon" android:targetActivity="com.android.launcher3.testcomponent.OtherBaseTestingActivity"> <intent-filter> <action android:name="android.intent.action.MAIN" /> Loading @@ -286,6 +298,7 @@ </activity-alias> <activity-alias android:name="Activity14" android:exported="true" android:label="TestActivity14" android:icon="@drawable/test_icon" android:targetActivity="com.android.launcher3.testcomponent.OtherBaseTestingActivity"> <intent-filter> <action android:name="android.intent.action.MAIN" /> Loading Loading @@ -363,7 +376,7 @@ </activity> <activity android:name="com.android.launcher3.testcomponent.ImeTestActivity" android:label="ImeTestActivity" android:icon="@drawable/test_theme_icon" android:icon="@drawable/test_icon" android:exported="true"> <intent-filter> <action android:name="android.intent.action.MAIN" /> Loading
tests/multivalentTests/src/com/android/launcher3/model/FolderIconLoadTest.kt +13 −1 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ package com.android.launcher3.model import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.filters.SmallTest import com.android.launcher3.LauncherAppState import com.android.launcher3.icons.BitmapInfo import com.android.launcher3.model.data.WorkspaceItemInfo import com.android.launcher3.util.Executors import com.android.launcher3.util.LauncherLayoutBuilder Loading Loading @@ -58,7 +59,7 @@ class FolderIconLoadTest { TEST_ACTIVITY11, TEST_ACTIVITY12, TEST_ACTIVITY13, TEST_ACTIVITY14 TEST_ACTIVITY14, ) @Before Loading Loading @@ -169,6 +170,9 @@ class FolderIconLoadTest { assertWithMessage("Index $index was not highRes") .that(items[index].bitmap.isNullOrLowRes) .isFalse() assertWithMessage("Index $index was the default icon") .that(isDefaultIcon(items[index].bitmap)) .isFalse() } } Loading @@ -177,9 +181,17 @@ class FolderIconLoadTest { assertWithMessage("Index $index was not lowRes") .that(items[index].bitmap.isNullOrLowRes) .isTrue() assertWithMessage("Index $index was the default icon") .that(isDefaultIcon(items[index].bitmap)) .isFalse() } } private fun isDefaultIcon(bitmap: BitmapInfo) = LauncherAppState.getInstance(modelHelper.sandboxContext) .iconCache .isDefaultIcon(bitmap, modelHelper.sandboxContext.user) /** Recreate DeviceProfiles after changing InvariantDeviceProfile */ private fun recreateSupportedDeviceProfiles() { LauncherAppState.getIDP(modelHelper.sandboxContext).supportedProfiles = Loading
tests/res/drawable/test_icon.xml 0 → 100644 +29 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- Copyright (C) 2024 The Android Open Source Project Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android"> <background android:drawable="@android:color/white"/> <foreground> <color android:color="#FFFF0000" /> </foreground> <monochrome> <vector android:width="48dp" android:height="48dp" android:viewportWidth="48.0" android:viewportHeight="48.0"> <path android:fillColor="#FF000000" android:pathData="M0,24L48,24 48,48, 0,48 Z"/> </vector> </monochrome> </adaptive-icon>