Loading packages/SystemUI/src/com/android/systemui/media/MediaProjectionAppSelectorActivity.kt +1 −1 Original line number Diff line number Diff line Loading @@ -111,7 +111,7 @@ class MediaProjectionAppSelectorActivity( if (featureFlags.isEnabled(Flags.WM_ENABLE_PARTIAL_SCREEN_SHARING_ENTERPRISE_POLICIES)) { component.emptyStateProvider } else { super.createBlockerEmptyStateProvider() object : EmptyStateProvider {} } override fun createListController(userHandle: UserHandle): ResolverListController = Loading packages/SystemUI/src/com/android/systemui/mediaprojection/appselector/MediaProjectionAppSelectorController.kt +1 −8 Original line number Diff line number Diff line Loading @@ -19,7 +19,6 @@ package com.android.systemui.mediaprojection.appselector import android.content.ComponentName import android.os.UserHandle import com.android.systemui.flags.FeatureFlags import com.android.systemui.flags.Flags import com.android.systemui.mediaprojection.appselector.data.RecentTask import com.android.systemui.mediaprojection.appselector.data.RecentTaskListProvider import javax.inject.Inject Loading Loading @@ -59,13 +58,7 @@ constructor( * Removes all recent tasks that are different from the profile of the host app to avoid any * cross-profile sharing */ private fun List<RecentTask>.filterDevicePolicyRestrictedTasks(): List<RecentTask> = if (flags.isEnabled(Flags.WM_ENABLE_PARTIAL_SCREEN_SHARING_ENTERPRISE_POLICIES)) { // TODO(b/263950746): filter tasks based on the enterprise policies this } else { filter { UserHandle.of(it.userId) == hostUserHandle } } private fun List<RecentTask>.filterDevicePolicyRestrictedTasks(): List<RecentTask> = this private fun List<RecentTask>.filterAppSelector(): List<RecentTask> = filter { // Only take tasks that is not the app selector Loading packages/SystemUI/tests/src/com/android/systemui/mediaprojection/appselector/MediaProjectionAppSelectorControllerTest.kt +5 −1 Original line number Diff line number Diff line Loading @@ -132,7 +132,7 @@ class MediaProjectionAppSelectorControllerTest : SysuiTestCase() { } @Test fun initRecentTasksWithAppSelectorTasks_enterprisePoliciesDisabled_bindsOnlyTasksWithHostProfile() { fun initRecentTasksWithAppSelectorTasks_enterprisePoliciesDisabled_bindsAllTasks() { givenEnterprisePoliciesFeatureFlag(enabled = false) val tasks = Loading @@ -147,11 +147,15 @@ class MediaProjectionAppSelectorControllerTest : SysuiTestCase() { controller.init() // TODO (b/263950746): Cross-profile filtering is removed for now. This should be brought // back with the future fix verify(view) .bind( listOf( createRecentTask(taskId = 1, userId = hostUserHandle.identifier), createRecentTask(taskId = 2, userId = otherUserHandle.identifier), createRecentTask(taskId = 3, userId = hostUserHandle.identifier), createRecentTask(taskId = 4, userId = otherUserHandle.identifier), createRecentTask(taskId = 5, userId = hostUserHandle.identifier), ) ) Loading Loading
packages/SystemUI/src/com/android/systemui/media/MediaProjectionAppSelectorActivity.kt +1 −1 Original line number Diff line number Diff line Loading @@ -111,7 +111,7 @@ class MediaProjectionAppSelectorActivity( if (featureFlags.isEnabled(Flags.WM_ENABLE_PARTIAL_SCREEN_SHARING_ENTERPRISE_POLICIES)) { component.emptyStateProvider } else { super.createBlockerEmptyStateProvider() object : EmptyStateProvider {} } override fun createListController(userHandle: UserHandle): ResolverListController = Loading
packages/SystemUI/src/com/android/systemui/mediaprojection/appselector/MediaProjectionAppSelectorController.kt +1 −8 Original line number Diff line number Diff line Loading @@ -19,7 +19,6 @@ package com.android.systemui.mediaprojection.appselector import android.content.ComponentName import android.os.UserHandle import com.android.systemui.flags.FeatureFlags import com.android.systemui.flags.Flags import com.android.systemui.mediaprojection.appselector.data.RecentTask import com.android.systemui.mediaprojection.appselector.data.RecentTaskListProvider import javax.inject.Inject Loading Loading @@ -59,13 +58,7 @@ constructor( * Removes all recent tasks that are different from the profile of the host app to avoid any * cross-profile sharing */ private fun List<RecentTask>.filterDevicePolicyRestrictedTasks(): List<RecentTask> = if (flags.isEnabled(Flags.WM_ENABLE_PARTIAL_SCREEN_SHARING_ENTERPRISE_POLICIES)) { // TODO(b/263950746): filter tasks based on the enterprise policies this } else { filter { UserHandle.of(it.userId) == hostUserHandle } } private fun List<RecentTask>.filterDevicePolicyRestrictedTasks(): List<RecentTask> = this private fun List<RecentTask>.filterAppSelector(): List<RecentTask> = filter { // Only take tasks that is not the app selector Loading
packages/SystemUI/tests/src/com/android/systemui/mediaprojection/appselector/MediaProjectionAppSelectorControllerTest.kt +5 −1 Original line number Diff line number Diff line Loading @@ -132,7 +132,7 @@ class MediaProjectionAppSelectorControllerTest : SysuiTestCase() { } @Test fun initRecentTasksWithAppSelectorTasks_enterprisePoliciesDisabled_bindsOnlyTasksWithHostProfile() { fun initRecentTasksWithAppSelectorTasks_enterprisePoliciesDisabled_bindsAllTasks() { givenEnterprisePoliciesFeatureFlag(enabled = false) val tasks = Loading @@ -147,11 +147,15 @@ class MediaProjectionAppSelectorControllerTest : SysuiTestCase() { controller.init() // TODO (b/263950746): Cross-profile filtering is removed for now. This should be brought // back with the future fix verify(view) .bind( listOf( createRecentTask(taskId = 1, userId = hostUserHandle.identifier), createRecentTask(taskId = 2, userId = otherUserHandle.identifier), createRecentTask(taskId = 3, userId = hostUserHandle.identifier), createRecentTask(taskId = 4, userId = otherUserHandle.identifier), createRecentTask(taskId = 5, userId = hostUserHandle.identifier), ) ) Loading