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

Commit 9b88eae5 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Fix NameNotFound exception in loadAppResources" into main

parents cdd4c0fb d8fedb73
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -167,7 +167,11 @@ class WindowDecorTaskResourceLoader(
    private fun loadAppResources(taskInfo: RunningTaskInfo): AppResources {
        Trace.beginSection("$TAG#loadAppResources")
        try {
            val pm = userProfilesContexts.getOrCreate(taskInfo.userId).packageManager
            val pm =
                userProfilesContexts
                .getOrCreate(taskInfo.userId)
                .createPackageContext(taskInfo.component().packageName, /* flags= */ 0)
                .packageManager
            val activityInfo = getActivityInfo(taskInfo, pm)
            val appName = pm.getApplicationLabel(activityInfo.applicationInfo)
            val appIconDrawable = iconProvider.getIcon(activityInfo)
+1 −0
Original line number Diff line number Diff line
@@ -87,6 +87,7 @@ class WindowDecorTaskResourceLoaderTest : ShellTestCase() {
        spyContext = spy(mContext)
        spyContext.setMockPackageManager(mockPackageManager)
        doReturn(spyContext).whenever(spyContext).createContextAsUser(any(), anyInt())
        doReturn(spyContext).whenever(spyContext).createPackageContext(any(), anyInt())
        doReturn(spyContext).whenever(mMockUserProfileContexts)[anyInt()]
        doReturn(spyContext).whenever(mMockUserProfileContexts).getOrCreate(anyInt())
        loader =