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

Commit 3ea50051 authored by Prince's avatar Prince Committed by Prince Donkor
Browse files

Calling Glanceable hub container controller directly in communal touch handler

Test: atest CommunalTouchHandlerTest GlanceableHubContainerControllerTest
Flag: com.android.systemui.communal_hub
Fixes: 335466210
Change-Id: I003a03c14164f73ff188a7d5d0c2f2906e30533d
parent 4c1803f8
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
@@ -322,6 +322,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
@@ -80,6 +80,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