Loading packages/SystemUI/aconfig/systemui.aconfig +0 −9 Original line number Diff line number Diff line Loading @@ -1048,15 +1048,6 @@ flag { bug: "343505271" } flag { name: "glanceable_hub_animate_timer_activity_starts" namespace: "systemui" description: "Properly animates activity starts from live timers on the glanceable hub" bug: "345741071" metadata { purpose: PURPOSE_BUGFIX } } flag { name: "new_touchpad_gestures_tutorial" Loading packages/SystemUI/compose/features/src/com/android/systemui/communal/ui/compose/CommunalContent.kt +2 −2 Original line number Diff line number Diff line Loading @@ -25,9 +25,9 @@ import androidx.compose.ui.layout.Layout import androidx.compose.ui.unit.IntRect import com.android.compose.animation.scene.SceneScope import com.android.compose.theme.LocalAndroidColorScheme import com.android.systemui.communal.smartspace.SmartspaceInteractionHandler import com.android.systemui.communal.ui.compose.section.AmbientStatusBarSection import com.android.systemui.communal.ui.viewmodel.CommunalViewModel import com.android.systemui.communal.widgets.WidgetInteractionHandler import com.android.systemui.keyguard.ui.composable.blueprint.BlueprintAlignmentLines import com.android.systemui.keyguard.ui.composable.section.LockSection import com.android.systemui.statusbar.phone.SystemUIDialogFactory Loading @@ -38,7 +38,7 @@ class CommunalContent @Inject constructor( private val viewModel: CommunalViewModel, private val interactionHandler: WidgetInteractionHandler, private val interactionHandler: SmartspaceInteractionHandler, private val dialogFactory: SystemUIDialogFactory, private val lockSection: LockSection, private val ambientStatusBarSection: AmbientStatusBarSection, Loading packages/SystemUI/compose/features/src/com/android/systemui/communal/ui/compose/CommunalHub.kt +1 −4 Original line number Diff line number Diff line Loading @@ -135,7 +135,6 @@ import com.android.compose.modifiers.thenIf import com.android.compose.theme.LocalAndroidColorScheme import com.android.compose.ui.graphics.painter.rememberDrawablePainter import com.android.internal.R.dimen.system_app_widget_background_radius import com.android.systemui.Flags.glanceableHubAnimateTimerActivityStarts import com.android.systemui.communal.domain.model.CommunalContentModel import com.android.systemui.communal.shared.model.CommunalContentSize import com.android.systemui.communal.shared.model.CommunalScenes Loading Loading @@ -1209,9 +1208,7 @@ private fun SmartspaceContent( modifier = modifier, factory = { context -> SmartspaceAppWidgetHostView(context).apply { if (glanceableHubAnimateTimerActivityStarts()) { interactionHandler?.let { setInteractionHandler(it) } } updateAppWidget(model.remoteViews) } }, Loading packages/SystemUI/multivalentTests/src/com/android/systemui/communal/smartspace/SmartspaceInteractionHandlerTest.kt 0 → 100644 +97 −0 Original line number Diff line number Diff line /* * Copyright (C) 2024 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.systemui.communal.smartspace import android.app.PendingIntent import android.content.Intent import android.view.View import android.widget.FrameLayout import android.widget.RemoteViews.RemoteResponse import androidx.core.util.component1 import androidx.core.util.component2 import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.filters.SmallTest import com.android.systemui.SysuiTestCase import com.android.systemui.communal.widgets.SmartspaceAppWidgetHostView import com.android.systemui.plugins.ActivityStarter import org.junit.Test import org.junit.runner.RunWith import org.mockito.kotlin.eq import org.mockito.kotlin.isNull import org.mockito.kotlin.mock import org.mockito.kotlin.notNull import org.mockito.kotlin.refEq import org.mockito.kotlin.verify @SmallTest @RunWith(AndroidJUnit4::class) class SmartspaceInteractionHandlerTest : SysuiTestCase() { private val activityStarter = mock<ActivityStarter>() private val testIntent = PendingIntent.getActivity( context, /* requestCode = */ 0, Intent("action"), PendingIntent.FLAG_IMMUTABLE ) private val testResponse = RemoteResponse.fromPendingIntent(testIntent) private val underTest: SmartspaceInteractionHandler by lazy { SmartspaceInteractionHandler(activityStarter) } @Test fun launchAnimatorIsUsedForSmartspaceView() { val parent = FrameLayout(context) val view = SmartspaceAppWidgetHostView(context) parent.addView(view) val (fillInIntent, activityOptions) = testResponse.getLaunchOptions(view) underTest.onInteraction(view, testIntent, testResponse) verify(activityStarter) .startPendingIntentWithoutDismissing( eq(testIntent), eq(false), isNull(), notNull(), refEq(fillInIntent), refEq(activityOptions.toBundle()), ) } @Test fun launchAnimatorIsNotUsedForRegularView() { val parent = FrameLayout(context) val view = View(context) parent.addView(view) val (fillInIntent, activityOptions) = testResponse.getLaunchOptions(view) underTest.onInteraction(view, testIntent, testResponse) verify(activityStarter) .startPendingIntentWithoutDismissing( eq(testIntent), eq(false), isNull(), isNull(), refEq(fillInIntent), refEq(activityOptions.toBundle()), ) } } packages/SystemUI/multivalentTests/src/com/android/systemui/communal/widgets/WidgetInteractionHandlerTest.kt +0 −20 Original line number Diff line number Diff line Loading @@ -74,26 +74,6 @@ class WidgetInteractionHandlerTest : SysuiTestCase() { ) } @Test fun launchAnimatorIsUsedForSmartspaceView() { val parent = FrameLayout(context) val view = SmartspaceAppWidgetHostView(context) parent.addView(view) val (fillInIntent, activityOptions) = testResponse.getLaunchOptions(view) underTest.onInteraction(view, testIntent, testResponse) verify(activityStarter) .startPendingIntentMaybeDismissingKeyguard( eq(testIntent), eq(false), isNull(), notNull(), refEq(fillInIntent), refEq(activityOptions.toBundle()), ) } @Test fun launchAnimatorIsNotUsedForRegularView() { val parent = FrameLayout(context) Loading Loading
packages/SystemUI/aconfig/systemui.aconfig +0 −9 Original line number Diff line number Diff line Loading @@ -1048,15 +1048,6 @@ flag { bug: "343505271" } flag { name: "glanceable_hub_animate_timer_activity_starts" namespace: "systemui" description: "Properly animates activity starts from live timers on the glanceable hub" bug: "345741071" metadata { purpose: PURPOSE_BUGFIX } } flag { name: "new_touchpad_gestures_tutorial" Loading
packages/SystemUI/compose/features/src/com/android/systemui/communal/ui/compose/CommunalContent.kt +2 −2 Original line number Diff line number Diff line Loading @@ -25,9 +25,9 @@ import androidx.compose.ui.layout.Layout import androidx.compose.ui.unit.IntRect import com.android.compose.animation.scene.SceneScope import com.android.compose.theme.LocalAndroidColorScheme import com.android.systemui.communal.smartspace.SmartspaceInteractionHandler import com.android.systemui.communal.ui.compose.section.AmbientStatusBarSection import com.android.systemui.communal.ui.viewmodel.CommunalViewModel import com.android.systemui.communal.widgets.WidgetInteractionHandler import com.android.systemui.keyguard.ui.composable.blueprint.BlueprintAlignmentLines import com.android.systemui.keyguard.ui.composable.section.LockSection import com.android.systemui.statusbar.phone.SystemUIDialogFactory Loading @@ -38,7 +38,7 @@ class CommunalContent @Inject constructor( private val viewModel: CommunalViewModel, private val interactionHandler: WidgetInteractionHandler, private val interactionHandler: SmartspaceInteractionHandler, private val dialogFactory: SystemUIDialogFactory, private val lockSection: LockSection, private val ambientStatusBarSection: AmbientStatusBarSection, Loading
packages/SystemUI/compose/features/src/com/android/systemui/communal/ui/compose/CommunalHub.kt +1 −4 Original line number Diff line number Diff line Loading @@ -135,7 +135,6 @@ import com.android.compose.modifiers.thenIf import com.android.compose.theme.LocalAndroidColorScheme import com.android.compose.ui.graphics.painter.rememberDrawablePainter import com.android.internal.R.dimen.system_app_widget_background_radius import com.android.systemui.Flags.glanceableHubAnimateTimerActivityStarts import com.android.systemui.communal.domain.model.CommunalContentModel import com.android.systemui.communal.shared.model.CommunalContentSize import com.android.systemui.communal.shared.model.CommunalScenes Loading Loading @@ -1209,9 +1208,7 @@ private fun SmartspaceContent( modifier = modifier, factory = { context -> SmartspaceAppWidgetHostView(context).apply { if (glanceableHubAnimateTimerActivityStarts()) { interactionHandler?.let { setInteractionHandler(it) } } updateAppWidget(model.remoteViews) } }, Loading
packages/SystemUI/multivalentTests/src/com/android/systemui/communal/smartspace/SmartspaceInteractionHandlerTest.kt 0 → 100644 +97 −0 Original line number Diff line number Diff line /* * Copyright (C) 2024 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.systemui.communal.smartspace import android.app.PendingIntent import android.content.Intent import android.view.View import android.widget.FrameLayout import android.widget.RemoteViews.RemoteResponse import androidx.core.util.component1 import androidx.core.util.component2 import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.filters.SmallTest import com.android.systemui.SysuiTestCase import com.android.systemui.communal.widgets.SmartspaceAppWidgetHostView import com.android.systemui.plugins.ActivityStarter import org.junit.Test import org.junit.runner.RunWith import org.mockito.kotlin.eq import org.mockito.kotlin.isNull import org.mockito.kotlin.mock import org.mockito.kotlin.notNull import org.mockito.kotlin.refEq import org.mockito.kotlin.verify @SmallTest @RunWith(AndroidJUnit4::class) class SmartspaceInteractionHandlerTest : SysuiTestCase() { private val activityStarter = mock<ActivityStarter>() private val testIntent = PendingIntent.getActivity( context, /* requestCode = */ 0, Intent("action"), PendingIntent.FLAG_IMMUTABLE ) private val testResponse = RemoteResponse.fromPendingIntent(testIntent) private val underTest: SmartspaceInteractionHandler by lazy { SmartspaceInteractionHandler(activityStarter) } @Test fun launchAnimatorIsUsedForSmartspaceView() { val parent = FrameLayout(context) val view = SmartspaceAppWidgetHostView(context) parent.addView(view) val (fillInIntent, activityOptions) = testResponse.getLaunchOptions(view) underTest.onInteraction(view, testIntent, testResponse) verify(activityStarter) .startPendingIntentWithoutDismissing( eq(testIntent), eq(false), isNull(), notNull(), refEq(fillInIntent), refEq(activityOptions.toBundle()), ) } @Test fun launchAnimatorIsNotUsedForRegularView() { val parent = FrameLayout(context) val view = View(context) parent.addView(view) val (fillInIntent, activityOptions) = testResponse.getLaunchOptions(view) underTest.onInteraction(view, testIntent, testResponse) verify(activityStarter) .startPendingIntentWithoutDismissing( eq(testIntent), eq(false), isNull(), isNull(), refEq(fillInIntent), refEq(activityOptions.toBundle()), ) } }
packages/SystemUI/multivalentTests/src/com/android/systemui/communal/widgets/WidgetInteractionHandlerTest.kt +0 −20 Original line number Diff line number Diff line Loading @@ -74,26 +74,6 @@ class WidgetInteractionHandlerTest : SysuiTestCase() { ) } @Test fun launchAnimatorIsUsedForSmartspaceView() { val parent = FrameLayout(context) val view = SmartspaceAppWidgetHostView(context) parent.addView(view) val (fillInIntent, activityOptions) = testResponse.getLaunchOptions(view) underTest.onInteraction(view, testIntent, testResponse) verify(activityStarter) .startPendingIntentMaybeDismissingKeyguard( eq(testIntent), eq(false), isNull(), notNull(), refEq(fillInIntent), refEq(activityOptions.toBundle()), ) } @Test fun launchAnimatorIsNotUsedForRegularView() { val parent = FrameLayout(context) Loading