Loading packages/SystemUI/src/com/android/systemui/screenshot/ScreenshotDetectionController.kt +3 −1 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ package com.android.systemui.screenshot import android.content.pm.PackageManager import android.content.pm.PackageManager.ComponentInfoFlags import android.content.pm.PackageManager.MATCH_ANY_USER import android.content.pm.PackageManager.MATCH_DISABLED_COMPONENTS import android.view.Display import android.view.IWindowManager Loading Loading @@ -47,7 +48,8 @@ constructor( // Convert component names to app names. return components.map { packageManager .getActivityInfo(it, ComponentInfoFlags.of(MATCH_DISABLED_COMPONENTS.toLong())) .getActivityInfo(it, ComponentInfoFlags.of( (MATCH_DISABLED_COMPONENTS or MATCH_ANY_USER).toLong())) .loadLabel(packageManager) } } Loading packages/SystemUI/tests/src/com/android/systemui/screenshot/ScreenshotDetectionControllerTest.kt +6 −6 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ package com.android.systemui.screenshot import android.content.ComponentName import android.content.pm.ActivityInfo import android.content.pm.PackageManager import android.content.pm.PackageManager.MATCH_ANY_USER import android.content.pm.PackageManager.MATCH_DISABLED_COMPONENTS import android.testing.AndroidTestingRunner import android.view.Display Loading Loading @@ -191,16 +192,16 @@ class ScreenshotDetectionControllerTest { whenever( packageManager.getActivityInfo( eq(component), argThat(includesFlagBits(MATCH_DISABLED_COMPONENTS)) argThat(includesFlagBits(MATCH_DISABLED_COMPONENTS or MATCH_ANY_USER)) ) ).thenReturn(activityInfo); ).thenReturn(activityInfo) whenever( packageManager.getActivityInfo( eq(component), argThat(excludesFlagBits(MATCH_DISABLED_COMPONENTS)) ) ).thenThrow(PackageManager.NameNotFoundException::class.java); ).thenThrow(PackageManager.NameNotFoundException::class.java) whenever(windowManager.notifyScreenshotListeners(eq(Display.DEFAULT_DISPLAY))) .thenReturn(listOf(component)) Loading @@ -212,5 +213,4 @@ class ScreenshotDetectionControllerTest { assertEquals(1, list.size) assertEquals(appName, list[0]) } } Loading
packages/SystemUI/src/com/android/systemui/screenshot/ScreenshotDetectionController.kt +3 −1 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ package com.android.systemui.screenshot import android.content.pm.PackageManager import android.content.pm.PackageManager.ComponentInfoFlags import android.content.pm.PackageManager.MATCH_ANY_USER import android.content.pm.PackageManager.MATCH_DISABLED_COMPONENTS import android.view.Display import android.view.IWindowManager Loading Loading @@ -47,7 +48,8 @@ constructor( // Convert component names to app names. return components.map { packageManager .getActivityInfo(it, ComponentInfoFlags.of(MATCH_DISABLED_COMPONENTS.toLong())) .getActivityInfo(it, ComponentInfoFlags.of( (MATCH_DISABLED_COMPONENTS or MATCH_ANY_USER).toLong())) .loadLabel(packageManager) } } Loading
packages/SystemUI/tests/src/com/android/systemui/screenshot/ScreenshotDetectionControllerTest.kt +6 −6 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ package com.android.systemui.screenshot import android.content.ComponentName import android.content.pm.ActivityInfo import android.content.pm.PackageManager import android.content.pm.PackageManager.MATCH_ANY_USER import android.content.pm.PackageManager.MATCH_DISABLED_COMPONENTS import android.testing.AndroidTestingRunner import android.view.Display Loading Loading @@ -191,16 +192,16 @@ class ScreenshotDetectionControllerTest { whenever( packageManager.getActivityInfo( eq(component), argThat(includesFlagBits(MATCH_DISABLED_COMPONENTS)) argThat(includesFlagBits(MATCH_DISABLED_COMPONENTS or MATCH_ANY_USER)) ) ).thenReturn(activityInfo); ).thenReturn(activityInfo) whenever( packageManager.getActivityInfo( eq(component), argThat(excludesFlagBits(MATCH_DISABLED_COMPONENTS)) ) ).thenThrow(PackageManager.NameNotFoundException::class.java); ).thenThrow(PackageManager.NameNotFoundException::class.java) whenever(windowManager.notifyScreenshotListeners(eq(Display.DEFAULT_DISPLAY))) .thenReturn(listOf(component)) Loading @@ -212,5 +213,4 @@ class ScreenshotDetectionControllerTest { assertEquals(1, list.size) assertEquals(appName, list[0]) } }