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

Commit 14fe6761 authored by Patrick Baumann's avatar Patrick Baumann
Browse files

Inject more dependencies in PackageManagerService

We're now using the injector for the majority of constructor
dependencies.

This change is part of a larger effort to break PackageManagerService
from directly instantiating its dependencies and to avoid using static
service providers, factories and getInstance methods in favor of
a mockable injector and provider / wrapper classes.

Test: device boots and runs as expected; this change doesn't change any behavior
Bug: 169360984
Change-Id: Ife7a052defa6f16482751b330febc1074a4d2489
parent ab09038c
Loading
Loading
Loading
Loading
+219 −172

File changed.

Preview size limit exceeded, changes collapsed.

+3 −1
Original line number Diff line number Diff line
@@ -45,6 +45,7 @@ import org.junit.Before
import org.junit.Test
import org.junit.runner.RunWith
import org.junit.runners.Parameterized
import org.mockito.Mockito
import org.mockito.Mockito.any
import org.mockito.Mockito.anyBoolean
import org.mockito.Mockito.anyInt
@@ -341,7 +342,8 @@ class PackageManagerComponentLabelIconOverrideTest {
            whenever(this.userManagerService) { mockUserManagerService }
            whenever(this.permissionManagerServiceInternal) { mockPermissionManagerService }
            whenever(this.settings) { mockSettings }
            whenever(this.activityTaskManagerInternal) { mockActivityTaskManager }
            whenever(this.getLocalService(ActivityTaskManagerInternal::class.java)) {
                mockActivityTaskManager}
            whenever(this.appsFilter) { mockAppsFilter }
            whenever(this.context) { mockContext }
        }