Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 43098f56 authored by Prince Donkor's avatar Prince Donkor Committed by Android (Google) Code Review
Browse files

Merge "Calling Glanceable hub container controller directly in communal touch handler" into main

parents 3f7579cd 3ea50051
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -108,7 +108,7 @@ public class CommunalTouchHandlerTest extends SysuiTestCase {
        mTouchHandler.onSessionStart(mTouchSession);
        verify(mTouchSession).registerInputListener(inputEventListenerArgumentCaptor.capture());
        inputEventListenerArgumentCaptor.getValue().onInputEvent(motionEvent);
        verify(mCentralSurfaces).handleDreamTouch(motionEvent);
        verify(mCentralSurfaces).handleCommunalHubTouch(motionEvent);
    }

    @Test
+1 −1
Original line number Diff line number Diff line
@@ -98,7 +98,7 @@ public class CommunalTouchHandler implements TouchHandler {
        // Notification shade window has its own logic to be visible if the hub is open, no need to
        // do anything here other than send touch events over.
        session.registerInputListener(ev -> {
            surfaces.handleDreamTouch((MotionEvent) ev);
            surfaces.handleCommunalHubTouch((MotionEvent) ev);
            if (ev != null && ((MotionEvent) ev).getAction() == MotionEvent.ACTION_UP) {
                var unused = session.pop();
            }
+2 −0
Original line number Diff line number Diff line
@@ -43,6 +43,7 @@ import com.android.systemui.communal.ui.compose.CommunalContainer
import com.android.systemui.communal.ui.compose.CommunalContent
import com.android.systemui.communal.ui.viewmodel.CommunalViewModel
import com.android.systemui.communal.util.CommunalColors
import com.android.systemui.dagger.SysUISingleton
import com.android.systemui.keyguard.domain.interactor.KeyguardInteractor
import com.android.systemui.keyguard.domain.interactor.KeyguardTransitionInteractor
import com.android.systemui.keyguard.shared.model.KeyguardState
@@ -64,6 +65,7 @@ import kotlinx.coroutines.launch
 *
 * This will be used until the glanceable hub is integrated into Flexiglass.
 */
@SysUISingleton
class GlanceableHubContainerController
@Inject
constructor(
+5 −0
Original line number Diff line number Diff line
@@ -327,6 +327,11 @@ public interface CentralSurfaces extends Dumpable, LifecycleOwner, CoreStartable
    @Deprecated
    float getDisplayDensity();

    /**
     * Forwards touch events to communal hub
     */
    void handleCommunalHubTouch(MotionEvent event);

    public static class KeyboardShortcutsMessage {
        final int mDeviceId;

+1 −0
Original line number Diff line number Diff line
@@ -81,6 +81,7 @@ abstract class CentralSurfacesEmptyImpl : CentralSurfaces {
    override fun shouldIgnoreTouch() = false
    override fun isDeviceInteractive() = false
    override fun handleDreamTouch(event: MotionEvent?) {}
    override fun handleCommunalHubTouch(event: MotionEvent?) {}
    override fun awakenDreams() {}
    override fun isBouncerShowing() = false
    override fun isBouncerShowingScrimmed() = false
Loading