Loading packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/chips/call/ui/viewmodel/CallChipViewModelTest.kt +9 −2 Original line number Diff line number Diff line Loading @@ -193,13 +193,20 @@ class CallChipViewModelTest(flags: FlagsParameterization) : SysuiTestCase() { val latest by collectLastValue(underTest.chip) val instanceId = InstanceId.fakeInstanceId(10) addOngoingCallState(startTimeMs = -2, isAppVisible = false, instanceId = instanceId) addOngoingCallState( startTimeMs = -2, isAppVisible = false, instanceId = instanceId, packageName = PACKAGE_NAME, ) assertThat((latest as OngoingActivityChipModel.Active).content) .isInstanceOf(OngoingActivityChipModel.Content.IconOnly::class.java) assertThat((latest as OngoingActivityChipModel.Active).isHidden).isFalse() assertThat((latest as OngoingActivityChipModel.Active).isImportantForPrivacy).isFalse() assertThat((latest as OngoingActivityChipModel.Active).instanceId).isEqualTo(instanceId) assertThat((latest as OngoingActivityChipModel.Active).managingPackageName) .isEqualTo(PACKAGE_NAME) } @Test Loading Loading @@ -1455,7 +1462,7 @@ class CallChipViewModelTest(flags: FlagsParameterization) : SysuiTestCase() { private const val NOTIFICATION_KEY = "testKey" private const val NOTIFICATION_UID = 12345 private const val PACKAGE_NAME = "testApp.package.name" @get:Parameters(name = "{0}") @JvmStatic val flags: List<FlagsParameterization> Loading packages/SystemUI/src/com/android/systemui/statusbar/chips/call/ui/viewmodel/CallChipViewModel.kt +1 −0 Original line number Diff line number Diff line Loading @@ -255,6 +255,7 @@ constructor( return OngoingActivityChipModel.Active( key = key, icon = icon, managingPackageName = state.packageName, content = content, colors = colors, onClickListenerLegacy = getOnClickListener(intent, instanceId, state.notificationKey), Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/ongoingcall/OngoingCallController.kt +3 −0 Original line number Diff line number Diff line Loading @@ -174,6 +174,7 @@ constructor( // be safely made false. isAppVisible = false, notificationInstanceId = currentInfo.instanceId, packageName = currentInfo.packageName, ) } else { return OngoingCallModel.NoCall Loading Loading @@ -236,6 +237,7 @@ constructor( notifModel.promotedContent, isOngoing = true, statusBarSwipedAway = callNotificationInfo?.statusBarSwipedAway ?: false, packageName = notifModel.packageName, ) if (newOngoingCallInfo == callNotificationInfo) { return Loading Loading @@ -367,6 +369,7 @@ constructor( val isOngoing: Boolean, /** True if the user has swiped away the status bar while in this phone call. */ val statusBarSwipedAway: Boolean, val packageName: String, ) override fun dump(pw: PrintWriter, args: Array<out String>) { Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/ongoingcall/domain/interactor/OngoingCallInteractor.kt +1 −0 Original line number Diff line number Diff line Loading @@ -169,6 +169,7 @@ constructor( requestedPromotion = model.requestedPromotion, isAppVisible = isVisible, notificationInstanceId = model.instanceId, packageName = model.packageName, ) } Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/ongoingcall/shared/model/OngoingCallModel.kt +2 −0 Original line number Diff line number Diff line Loading @@ -50,6 +50,7 @@ sealed interface OngoingCallModel { * @property isAppVisible whether the app to which the call belongs is currently visible. * @property notificationInstanceId an optional per-chip ID used for logging. Should stay the * same throughout the lifetime of a single chip. * @property packageName the package name of the app to which the call belongs. */ data class InCall( val startTimeMs: Long, Loading @@ -61,6 +62,7 @@ sealed interface OngoingCallModel { val promotedContent: PromotedNotificationContentModels?, val isAppVisible: Boolean, val notificationInstanceId: InstanceId?, val packageName: String, ) : OngoingCallModel { override fun logString(): String { return "InCall(notifKey=$notificationKey " + Loading Loading
packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/chips/call/ui/viewmodel/CallChipViewModelTest.kt +9 −2 Original line number Diff line number Diff line Loading @@ -193,13 +193,20 @@ class CallChipViewModelTest(flags: FlagsParameterization) : SysuiTestCase() { val latest by collectLastValue(underTest.chip) val instanceId = InstanceId.fakeInstanceId(10) addOngoingCallState(startTimeMs = -2, isAppVisible = false, instanceId = instanceId) addOngoingCallState( startTimeMs = -2, isAppVisible = false, instanceId = instanceId, packageName = PACKAGE_NAME, ) assertThat((latest as OngoingActivityChipModel.Active).content) .isInstanceOf(OngoingActivityChipModel.Content.IconOnly::class.java) assertThat((latest as OngoingActivityChipModel.Active).isHidden).isFalse() assertThat((latest as OngoingActivityChipModel.Active).isImportantForPrivacy).isFalse() assertThat((latest as OngoingActivityChipModel.Active).instanceId).isEqualTo(instanceId) assertThat((latest as OngoingActivityChipModel.Active).managingPackageName) .isEqualTo(PACKAGE_NAME) } @Test Loading Loading @@ -1455,7 +1462,7 @@ class CallChipViewModelTest(flags: FlagsParameterization) : SysuiTestCase() { private const val NOTIFICATION_KEY = "testKey" private const val NOTIFICATION_UID = 12345 private const val PACKAGE_NAME = "testApp.package.name" @get:Parameters(name = "{0}") @JvmStatic val flags: List<FlagsParameterization> Loading
packages/SystemUI/src/com/android/systemui/statusbar/chips/call/ui/viewmodel/CallChipViewModel.kt +1 −0 Original line number Diff line number Diff line Loading @@ -255,6 +255,7 @@ constructor( return OngoingActivityChipModel.Active( key = key, icon = icon, managingPackageName = state.packageName, content = content, colors = colors, onClickListenerLegacy = getOnClickListener(intent, instanceId, state.notificationKey), Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/ongoingcall/OngoingCallController.kt +3 −0 Original line number Diff line number Diff line Loading @@ -174,6 +174,7 @@ constructor( // be safely made false. isAppVisible = false, notificationInstanceId = currentInfo.instanceId, packageName = currentInfo.packageName, ) } else { return OngoingCallModel.NoCall Loading Loading @@ -236,6 +237,7 @@ constructor( notifModel.promotedContent, isOngoing = true, statusBarSwipedAway = callNotificationInfo?.statusBarSwipedAway ?: false, packageName = notifModel.packageName, ) if (newOngoingCallInfo == callNotificationInfo) { return Loading Loading @@ -367,6 +369,7 @@ constructor( val isOngoing: Boolean, /** True if the user has swiped away the status bar while in this phone call. */ val statusBarSwipedAway: Boolean, val packageName: String, ) override fun dump(pw: PrintWriter, args: Array<out String>) { Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/ongoingcall/domain/interactor/OngoingCallInteractor.kt +1 −0 Original line number Diff line number Diff line Loading @@ -169,6 +169,7 @@ constructor( requestedPromotion = model.requestedPromotion, isAppVisible = isVisible, notificationInstanceId = model.instanceId, packageName = model.packageName, ) } Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/ongoingcall/shared/model/OngoingCallModel.kt +2 −0 Original line number Diff line number Diff line Loading @@ -50,6 +50,7 @@ sealed interface OngoingCallModel { * @property isAppVisible whether the app to which the call belongs is currently visible. * @property notificationInstanceId an optional per-chip ID used for logging. Should stay the * same throughout the lifetime of a single chip. * @property packageName the package name of the app to which the call belongs. */ data class InCall( val startTimeMs: Long, Loading @@ -61,6 +62,7 @@ sealed interface OngoingCallModel { val promotedContent: PromotedNotificationContentModels?, val isAppVisible: Boolean, val notificationInstanceId: InstanceId?, val packageName: String, ) : OngoingCallModel { override fun logString(): String { return "InCall(notifKey=$notificationKey " + Loading