Loading packages/SystemUI/multivalentTests/src/com/android/systemui/screenrecord/ScreenRecordPermissionDialogDelegateTest.kt +2 −1 Original line number Diff line number Diff line Loading @@ -43,6 +43,7 @@ import com.android.systemui.mediaprojection.permission.SINGLE_APP import com.android.systemui.plugins.ActivityStarter import com.android.systemui.res.R import com.android.systemui.screenrecord.domain.interactor.screenRecordingStartStopInteractor import com.android.systemui.shade.data.repository.shadeDialogContextInteractor import com.android.systemui.shade.shared.flag.ShadeWindowGoesAround import com.android.systemui.statusbar.phone.SystemUIDialog import com.android.systemui.statusbar.phone.SystemUIDialogManager Loading Loading @@ -103,8 +104,8 @@ class ScreenRecordPermissionDialogDelegateTest : SysuiTestCase() { systemUIDialogFactory, context, context.getSystemService(DisplayManager::class.java)!!, { fakeDisplayWindowPropertiesRepository }, kosmos.screenRecordingStartStopInteractor, kosmos.shadeDialogContextInteractor, ) dialog = underTest.createDialog() } Loading packages/SystemUI/src/com/android/systemui/screenrecord/ScreenRecordPermissionDialogDelegate.kt +5 −17 Original line number Diff line number Diff line Loading @@ -20,9 +20,7 @@ import android.hardware.display.DisplayManager import android.os.Bundle import android.os.UserHandle import android.view.View import android.view.WindowManager.LayoutParams.TYPE_STATUS_BAR import androidx.annotation.StyleRes import com.android.systemui.display.data.repository.DisplayWindowPropertiesRepository import com.android.systemui.mediaprojection.MediaProjectionMetricsLogger import com.android.systemui.mediaprojection.permission.BaseMediaProjectionPermissionContentManager import com.android.systemui.mediaprojection.permission.BaseMediaProjectionPermissionDialogDelegate Loading @@ -32,9 +30,9 @@ import com.android.systemui.plugins.ActivityStarter import com.android.systemui.res.R import com.android.systemui.screenrecord.domain.interactor.ScreenRecordingStartStopInteractor import com.android.systemui.shade.ShadeDisplayAware import com.android.systemui.shade.domain.interactor.ShadeDialogContextInteractor import com.android.systemui.shade.shared.flag.ShadeWindowGoesAround import com.android.systemui.statusbar.phone.SystemUIDialog import dagger.Lazy import dagger.assisted.Assisted import dagger.assisted.AssistedFactory import dagger.assisted.AssistedInject Loading @@ -52,8 +50,8 @@ class ScreenRecordPermissionDialogDelegate( @StyleRes private val theme: Int, private val context: Context, private val displayManager: DisplayManager, private val displayWindowPropertiesRepository: Lazy<DisplayWindowPropertiesRepository>, private val screenRecordingStartStopInteractor: ScreenRecordingStartStopInteractor, private val shadeDialogContextInteractor: ShadeDialogContextInteractor, ) : BaseMediaProjectionPermissionDialogDelegate<SystemUIDialog>( ScreenRecordPermissionContentManager.createOptionList(displayManager), Loading @@ -76,8 +74,8 @@ class ScreenRecordPermissionDialogDelegate( systemUIDialogFactory: SystemUIDialog.Factory, @ShadeDisplayAware context: Context, displayManager: DisplayManager, displayWindowPropertiesRepository: Lazy<DisplayWindowPropertiesRepository>, screenRecordingStartStopInteractor: ScreenRecordingStartStopInteractor, shadeDialogContextInteractor: ShadeDialogContextInteractor, ) : this( hostUserHandle, hostUid, Loading @@ -90,8 +88,8 @@ class ScreenRecordPermissionDialogDelegate( theme = SystemUIDialog.DEFAULT_THEME, context, displayManager, displayWindowPropertiesRepository, screenRecordingStartStopInteractor, shadeDialogContextInteractor, ) @AssistedFactory Loading Loading @@ -121,17 +119,7 @@ class ScreenRecordPermissionDialogDelegate( override fun createDialog(): SystemUIDialog { val displayContext = if (ShadeWindowGoesAround.isEnabled) { // This dialog needs to stay visible even if the notification shade closes, // for example, after unlocking the device. If we used the shade's own context, the // dialog would be tied to the shade and disappear when the shade collapses. // To avoid this, we get a context associated with the status bar on the current // display. This ensures the dialog remains visible independently of the shade. displayWindowPropertiesRepository .get() .get(context.displayId, TYPE_STATUS_BAR) ?.context // falls back to the default context if the status bar context is not available ?: context shadeDialogContextInteractor.context } else { context } Loading Loading
packages/SystemUI/multivalentTests/src/com/android/systemui/screenrecord/ScreenRecordPermissionDialogDelegateTest.kt +2 −1 Original line number Diff line number Diff line Loading @@ -43,6 +43,7 @@ import com.android.systemui.mediaprojection.permission.SINGLE_APP import com.android.systemui.plugins.ActivityStarter import com.android.systemui.res.R import com.android.systemui.screenrecord.domain.interactor.screenRecordingStartStopInteractor import com.android.systemui.shade.data.repository.shadeDialogContextInteractor import com.android.systemui.shade.shared.flag.ShadeWindowGoesAround import com.android.systemui.statusbar.phone.SystemUIDialog import com.android.systemui.statusbar.phone.SystemUIDialogManager Loading Loading @@ -103,8 +104,8 @@ class ScreenRecordPermissionDialogDelegateTest : SysuiTestCase() { systemUIDialogFactory, context, context.getSystemService(DisplayManager::class.java)!!, { fakeDisplayWindowPropertiesRepository }, kosmos.screenRecordingStartStopInteractor, kosmos.shadeDialogContextInteractor, ) dialog = underTest.createDialog() } Loading
packages/SystemUI/src/com/android/systemui/screenrecord/ScreenRecordPermissionDialogDelegate.kt +5 −17 Original line number Diff line number Diff line Loading @@ -20,9 +20,7 @@ import android.hardware.display.DisplayManager import android.os.Bundle import android.os.UserHandle import android.view.View import android.view.WindowManager.LayoutParams.TYPE_STATUS_BAR import androidx.annotation.StyleRes import com.android.systemui.display.data.repository.DisplayWindowPropertiesRepository import com.android.systemui.mediaprojection.MediaProjectionMetricsLogger import com.android.systemui.mediaprojection.permission.BaseMediaProjectionPermissionContentManager import com.android.systemui.mediaprojection.permission.BaseMediaProjectionPermissionDialogDelegate Loading @@ -32,9 +30,9 @@ import com.android.systemui.plugins.ActivityStarter import com.android.systemui.res.R import com.android.systemui.screenrecord.domain.interactor.ScreenRecordingStartStopInteractor import com.android.systemui.shade.ShadeDisplayAware import com.android.systemui.shade.domain.interactor.ShadeDialogContextInteractor import com.android.systemui.shade.shared.flag.ShadeWindowGoesAround import com.android.systemui.statusbar.phone.SystemUIDialog import dagger.Lazy import dagger.assisted.Assisted import dagger.assisted.AssistedFactory import dagger.assisted.AssistedInject Loading @@ -52,8 +50,8 @@ class ScreenRecordPermissionDialogDelegate( @StyleRes private val theme: Int, private val context: Context, private val displayManager: DisplayManager, private val displayWindowPropertiesRepository: Lazy<DisplayWindowPropertiesRepository>, private val screenRecordingStartStopInteractor: ScreenRecordingStartStopInteractor, private val shadeDialogContextInteractor: ShadeDialogContextInteractor, ) : BaseMediaProjectionPermissionDialogDelegate<SystemUIDialog>( ScreenRecordPermissionContentManager.createOptionList(displayManager), Loading @@ -76,8 +74,8 @@ class ScreenRecordPermissionDialogDelegate( systemUIDialogFactory: SystemUIDialog.Factory, @ShadeDisplayAware context: Context, displayManager: DisplayManager, displayWindowPropertiesRepository: Lazy<DisplayWindowPropertiesRepository>, screenRecordingStartStopInteractor: ScreenRecordingStartStopInteractor, shadeDialogContextInteractor: ShadeDialogContextInteractor, ) : this( hostUserHandle, hostUid, Loading @@ -90,8 +88,8 @@ class ScreenRecordPermissionDialogDelegate( theme = SystemUIDialog.DEFAULT_THEME, context, displayManager, displayWindowPropertiesRepository, screenRecordingStartStopInteractor, shadeDialogContextInteractor, ) @AssistedFactory Loading Loading @@ -121,17 +119,7 @@ class ScreenRecordPermissionDialogDelegate( override fun createDialog(): SystemUIDialog { val displayContext = if (ShadeWindowGoesAround.isEnabled) { // This dialog needs to stay visible even if the notification shade closes, // for example, after unlocking the device. If we used the shade's own context, the // dialog would be tied to the shade and disappear when the shade collapses. // To avoid this, we get a context associated with the status bar on the current // display. This ensures the dialog remains visible independently of the shade. displayWindowPropertiesRepository .get() .get(context.displayId, TYPE_STATUS_BAR) ?.context // falls back to the default context if the status bar context is not available ?: context shadeDialogContextInteractor.context } else { context } Loading