Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fe76d80f authored by Olivier St-Onge's avatar Olivier St-Onge Committed by Android (Google) Code Review
Browse files

Merge "Add the app icon for installed apps in Edit mode" into main

parents 930b3854 b5b62083
Loading
Loading
Loading
Loading
+11 −6
Original line number Diff line number Diff line
@@ -62,6 +62,7 @@ class IconAndNameCustomRepositoryTest : SysuiTestCase() {
            tileService1,
            drawable1,
            appName1,
            appIcon1,
        )

    private val service2 =
@@ -70,6 +71,7 @@ class IconAndNameCustomRepositoryTest : SysuiTestCase() {
            tileService2,
            drawable2,
            appName2,
            appIcon2,
        )

    private val underTest =
@@ -78,6 +80,7 @@ class IconAndNameCustomRepositoryTest : SysuiTestCase() {
                installedTilesRepository,
                userTracker,
                mainCoroutineContext,
                appIconRepositoryFactory,
            )
        }

@@ -85,7 +88,7 @@ class IconAndNameCustomRepositoryTest : SysuiTestCase() {
    fun setUp() {
        kosmos.fakeInstalledTilesRepository.setInstalledServicesForUser(
            userTracker.userId,
            listOf(service1, service2)
            listOf(service1, service2),
        )
    }

@@ -100,6 +103,7 @@ class IconAndNameCustomRepositoryTest : SysuiTestCase() {
                        Icon.Loaded(drawable1, ContentDescription.Loaded(tileService1)),
                        Text.Loaded(tileService1),
                        Text.Loaded(appName1),
                        Icon.Loaded(appIcon1, ContentDescription.Loaded(null)),
                        TileCategory.PROVIDED_BY_APP,
                    )
                val expectedData2 =
@@ -108,6 +112,7 @@ class IconAndNameCustomRepositoryTest : SysuiTestCase() {
                        Icon.Loaded(drawable2, ContentDescription.Loaded(tileService2)),
                        Text.Loaded(tileService2),
                        Text.Loaded(appName2),
                        Icon.Loaded(appIcon2, ContentDescription.Loaded(null)),
                        TileCategory.PROVIDED_BY_APP,
                    )

@@ -131,13 +136,10 @@ class IconAndNameCustomRepositoryTest : SysuiTestCase() {
        with(kosmos) {
            testScope.runTest {
                val serviceNullIcon =
                    FakeInstalledTilesComponentRepository.ServiceInfo(
                        component2,
                        tileService2,
                    )
                    FakeInstalledTilesComponentRepository.ServiceInfo(component2, tileService2)
                fakeInstalledTilesRepository.setInstalledServicesForUser(
                    userTracker.userId,
                    listOf(service1, serviceNullIcon)
                    listOf(service1, serviceNullIcon),
                )

                val expectedData1 =
@@ -146,6 +148,7 @@ class IconAndNameCustomRepositoryTest : SysuiTestCase() {
                        Icon.Loaded(drawable1, ContentDescription.Loaded(tileService1)),
                        Text.Loaded(tileService1),
                        Text.Loaded(appName1),
                        Icon.Loaded(appIcon1, ContentDescription.Loaded(null)),
                        TileCategory.PROVIDED_BY_APP,
                    )

@@ -156,11 +159,13 @@ class IconAndNameCustomRepositoryTest : SysuiTestCase() {

    private companion object {
        val drawable1 = TestStubDrawable("drawable1")
        val appIcon1 = TestStubDrawable("appIcon1")
        val appName1 = "App1"
        val tileService1 = "Tile Service 1"
        val component1 = ComponentName("pkg1", "srv1")

        val drawable2 = TestStubDrawable("drawable2")
        val appIcon2 = TestStubDrawable("appIcon2")
        val appName2 = "App2"
        val tileService2 = "Tile Service 2"
        val component2 = ComponentName("pkg2", "srv2")
+3 −0
Original line number Diff line number Diff line
@@ -129,6 +129,7 @@ class EditTilesListInteractorTest : SysuiTestCase() {
                        label = Text.Loaded(tileName),
                        appName = Text.Loaded(appName),
                        category = TileCategory.PROVIDED_BY_APP,
                        appIcon = null,
                    )

                assertThat(editTiles.customTiles).hasSize(1)
@@ -180,6 +181,7 @@ class EditTilesListInteractorTest : SysuiTestCase() {
                label = Text.Loaded(spec),
                appName = null,
                category = TileCategory.UNKNOWN,
                appIcon = null,
            )
        }

@@ -191,6 +193,7 @@ class EditTilesListInteractorTest : SysuiTestCase() {
                label = Text.Resource(uiConfig.labelRes),
                appName = null,
                category = category,
                appIcon = null,
            )
        }
    }
+1 −0
Original line number Diff line number Diff line
@@ -232,6 +232,7 @@ class EditTileListStateTest : SysuiTestCase() {
                isCurrent = true,
                isDualTarget = false,
                availableEditActions = emptySet(),
                appIcon = null,
                category = TileCategory.UNKNOWN,
            )
        }
+2 −0
Original line number Diff line number Diff line
@@ -767,6 +767,7 @@ class EditModeViewModelTest(flags: FlagsParameterization) : SysuiTestCase() {
                icon = Icon.Resource(R.drawable.star_on, ContentDescription.Loaded(spec)),
                label = Text.Loaded(spec),
                appName = null,
                appIcon = null,
                category = TileCategory.UNKNOWN,
            )
        }
@@ -778,6 +779,7 @@ class EditModeViewModelTest(flags: FlagsParameterization) : SysuiTestCase() {
                    Icon.Resource(uiConfig.iconRes, ContentDescription.Resource(uiConfig.labelRes)),
                label = Text.Resource(uiConfig.labelRes),
                appName = null,
                appIcon = null,
                category = category,
            )
        }
+26 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?><!--
  ~ Copyright (C) 2025 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.
  -->

<vector xmlns:android="http://schemas.android.com/apk/res/android"
    android:width="24dp"
    android:height="24dp"
    android:tint="?attr/colorControlNormal"
    android:viewportHeight="960"
    android:viewportWidth="960">
    <path
        android:fillColor="@android:color/white"
        android:pathData="M280,920Q247,920 223.5,896.5Q200,873 200,840L200,120Q200,87 223.5,63.5Q247,40 280,40L680,40Q713,40 736.5,63.5Q760,87 760,120L760,840Q760,873 736.5,896.5Q713,920 680,920L280,920ZM280,720L680,720L680,240L280,240L280,720Z" />
</vector>
 No newline at end of file
Loading