1 /* 2 * Copyright (C) 2024 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package com.android.systemui.mediaprojection.data.model 18 19 import android.app.ActivityManager.RunningTaskInfo 20 21 /** Represents the state of media projection. */ 22 sealed interface MediaProjectionState { 23 /** There is no media being projected. */ 24 data object NotProjecting : MediaProjectionState 25 26 /** 27 * Media is currently being projected. 28 * 29 * @property hostPackage the package name of the app that is receiving the content of the media 30 * projection (aka which app the phone screen contents are being sent to). 31 */ 32 sealed class Projecting(open val hostPackage: String) : MediaProjectionState { 33 /** The entire screen is being projected. */ 34 data class EntireScreen(override val hostPackage: String) : Projecting(hostPackage) 35 36 /** Only a single task is being projected. */ 37 data class SingleTask(override val hostPackage: String, val task: RunningTaskInfo) : 38 Projecting(hostPackage) 39 } 40 } 41