Loading libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/common/WindowDecorTaskResourceLoader.kt +5 −1 Original line number Diff line number Diff line Loading @@ -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) Loading libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/windowdecor/common/WindowDecorTaskResourceLoaderTest.kt +1 −0 Original line number Diff line number Diff line Loading @@ -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 = Loading Loading
libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/common/WindowDecorTaskResourceLoader.kt +5 −1 Original line number Diff line number Diff line Loading @@ -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) Loading
libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/windowdecor/common/WindowDecorTaskResourceLoaderTest.kt +1 −0 Original line number Diff line number Diff line Loading @@ -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 = Loading