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

Commit c9a7b45e authored by Vinit Nayak's avatar Vinit Nayak
Browse files

Pass nav button disable and AOD events to launcher

Bug: 180046394
Change-Id: Ic6f552f57b48fc15b9873e59e3d8b53a17e312d6
parent 35ff9589
Loading
Loading
Loading
Loading
+5 −1
Original line number Original line Diff line number Diff line
@@ -114,6 +114,8 @@ public class QuickStepContract {
    public static final int SYSUI_STATE_MAGNIFICATION_OVERLAP = 1 << 19;
    public static final int SYSUI_STATE_MAGNIFICATION_OVERLAP = 1 << 19;
    // ImeSwitcher is showing
    // ImeSwitcher is showing
    public static final int SYSUI_STATE_IME_SWITCHER_SHOWING = 1 << 20;
    public static final int SYSUI_STATE_IME_SWITCHER_SHOWING = 1 << 20;
    // Device dozing/AOD state
    public static final int SYSUI_STATE_DEVICE_DOZING = 1 << 21;


    @Retention(RetentionPolicy.SOURCE)
    @Retention(RetentionPolicy.SOURCE)
    @IntDef({SYSUI_STATE_SCREEN_PINNING,
    @IntDef({SYSUI_STATE_SCREEN_PINNING,
@@ -136,7 +138,8 @@ public class QuickStepContract {
            SYSUI_STATE_ALLOW_GESTURE_IGNORING_BAR_VISIBILITY,
            SYSUI_STATE_ALLOW_GESTURE_IGNORING_BAR_VISIBILITY,
            SYSUI_STATE_IME_SHOWING,
            SYSUI_STATE_IME_SHOWING,
            SYSUI_STATE_MAGNIFICATION_OVERLAP,
            SYSUI_STATE_MAGNIFICATION_OVERLAP,
            SYSUI_STATE_IME_SWITCHER_SHOWING
            SYSUI_STATE_IME_SWITCHER_SHOWING,
            SYSUI_STATE_DEVICE_DOZING
    })
    })
    public @interface SystemUiStateFlags {}
    public @interface SystemUiStateFlags {}


@@ -166,6 +169,7 @@ public class QuickStepContract {
        str.add((flags & SYSUI_STATE_IME_SHOWING) != 0 ? "ime_visible" : "");
        str.add((flags & SYSUI_STATE_IME_SHOWING) != 0 ? "ime_visible" : "");
        str.add((flags & SYSUI_STATE_MAGNIFICATION_OVERLAP) != 0 ? "magnification_overlap" : "");
        str.add((flags & SYSUI_STATE_MAGNIFICATION_OVERLAP) != 0 ? "magnification_overlap" : "");
        str.add((flags & SYSUI_STATE_IME_SWITCHER_SHOWING) != 0 ? "ime_switcher_showing" : "");
        str.add((flags & SYSUI_STATE_IME_SWITCHER_SHOWING) != 0 ? "ime_switcher_showing" : "");
        str.add((flags & SYSUI_STATE_DEVICE_DOZING) != 0 ? "device_dozing" : "");
        return str.toString();
        return str.toString();
    }
    }


+1 −1
Original line number Original line Diff line number Diff line
@@ -161,7 +161,7 @@ public class SystemActions extends SystemUI {
        mNotificationShadeController = notificationShadeController;
        mNotificationShadeController = notificationShadeController;
        // Saving in instance variable since to prevent GC since
        // Saving in instance variable since to prevent GC since
        // NotificationShadeWindowController.registerCallback() only keeps weak references.
        // NotificationShadeWindowController.registerCallback() only keeps weak references.
        mNotificationShadeCallback = (keyguardShowing, keyguardOccluded, bouncerShowing) ->
        mNotificationShadeCallback = (keyguardShowing, keyguardOccluded, bouncerShowing, mDozing) ->
                registerOrUnregisterDismissNotificationShadeAction();
                registerOrUnregisterDismissNotificationShadeAction();
        mStatusBar = statusBar;
        mStatusBar = statusBar;
    }
    }
+5 −2
Original line number Original line Diff line number Diff line
@@ -64,6 +64,7 @@ import com.android.systemui.navigationbar.NavigationBarA11yHelper;
import com.android.systemui.navigationbar.NavigationBarController;
import com.android.systemui.navigationbar.NavigationBarController;
import com.android.systemui.navigationbar.NavigationBarOverlayController;
import com.android.systemui.navigationbar.NavigationBarOverlayController;
import com.android.systemui.navigationbar.NavigationModeController;
import com.android.systemui.navigationbar.NavigationModeController;
import com.android.systemui.navigationbar.TaskbarDelegate;
import com.android.systemui.plugins.PluginInitializerImpl;
import com.android.systemui.plugins.PluginInitializerImpl;
import com.android.systemui.plugins.statusbar.StatusBarStateController;
import com.android.systemui.plugins.statusbar.StatusBarStateController;
import com.android.systemui.qs.ReduceBrightColorsController;
import com.android.systemui.qs.ReduceBrightColorsController;
@@ -233,7 +234,8 @@ public class DependencyProvider {
            UiEventLogger uiEventLogger,
            UiEventLogger uiEventLogger,
            NavigationBarOverlayController navBarOverlayController,
            NavigationBarOverlayController navBarOverlayController,
            ConfigurationController configurationController,
            ConfigurationController configurationController,
            NavigationBarA11yHelper navigationBarA11yHelper) {
            NavigationBarA11yHelper navigationBarA11yHelper,
            TaskbarDelegate taskbarDelegate) {
        return new NavigationBarController(context,
        return new NavigationBarController(context,
                windowManager,
                windowManager,
                assistManagerLazy,
                assistManagerLazy,
@@ -259,7 +261,8 @@ public class DependencyProvider {
                uiEventLogger,
                uiEventLogger,
                navBarOverlayController,
                navBarOverlayController,
                configurationController,
                configurationController,
                navigationBarA11yHelper);
                navigationBarA11yHelper,
                taskbarDelegate);
    }
    }


    /** */
    /** */
+4 −2
Original line number Original line Diff line number Diff line
@@ -153,7 +153,8 @@ public class NavigationBarController implements Callbacks,
            UiEventLogger uiEventLogger,
            UiEventLogger uiEventLogger,
            NavigationBarOverlayController navBarOverlayController,
            NavigationBarOverlayController navBarOverlayController,
            ConfigurationController configurationController,
            ConfigurationController configurationController,
            NavigationBarA11yHelper navigationBarA11yHelper) {
            NavigationBarA11yHelper navigationBarA11yHelper,
            TaskbarDelegate taskbarDelegate) {
        mContext = context;
        mContext = context;
        mWindowManager = windowManager;
        mWindowManager = windowManager;
        mAssistManagerLazy = assistManagerLazy;
        mAssistManagerLazy = assistManagerLazy;
@@ -185,7 +186,8 @@ public class NavigationBarController implements Callbacks,
        mNavBarOverlayController = navBarOverlayController;
        mNavBarOverlayController = navBarOverlayController;
        mNavMode = mNavigationModeController.addListener(this);
        mNavMode = mNavigationModeController.addListener(this);
        mNavigationModeController.addListener(this);
        mNavigationModeController.addListener(this);
        mTaskbarDelegate = new TaskbarDelegate(mOverviewProxyService,
        mTaskbarDelegate = taskbarDelegate;
        mTaskbarDelegate.setOverviewProxyService(overviewProxyService,
                navigationBarA11yHelper, mSysUiFlagsContainer);
                navigationBarA11yHelper, mSysUiFlagsContainer);
        mIsTablet = isTablet(mContext.getResources().getConfiguration());
        mIsTablet = isTablet(mContext.getResources().getConfiguration());
    }
    }
+11 −4
Original line number Original line Diff line number Diff line
@@ -33,19 +33,26 @@ import com.android.systemui.recents.OverviewProxyService;
import com.android.systemui.shared.recents.utilities.Utilities;
import com.android.systemui.shared.recents.utilities.Utilities;
import com.android.systemui.statusbar.CommandQueue;
import com.android.systemui.statusbar.CommandQueue;


import javax.inject.Inject;
import javax.inject.Singleton;

@Singleton
public class TaskbarDelegate implements CommandQueue.Callbacks {
public class TaskbarDelegate implements CommandQueue.Callbacks {


    private final OverviewProxyService mOverviewProxyService;
    private OverviewProxyService mOverviewProxyService;
    private final NavigationBarA11yHelper mNavigationBarA11yHelper;
    private NavigationBarA11yHelper mNavigationBarA11yHelper;
    private final SysUiState mSysUiState;
    private SysUiState mSysUiState;
    private int mDisplayId;
    private int mDisplayId;
    private int mNavigationIconHints;
    private int mNavigationIconHints;
    private final NavigationBarA11yHelper.NavA11yEventListener mNavA11yEventListener =
    private final NavigationBarA11yHelper.NavA11yEventListener mNavA11yEventListener =
            this::updateSysuiFlags;
            this::updateSysuiFlags;
    @Inject
    public TaskbarDelegate() { /* no-op */ }


    public TaskbarDelegate(OverviewProxyService overviewProxyService,
    public void setOverviewProxyService(OverviewProxyService overviewProxyService,
            NavigationBarA11yHelper navigationBarA11yHelper,
            NavigationBarA11yHelper navigationBarA11yHelper,
            SysUiState sysUiState) {
            SysUiState sysUiState) {
        // TODO: adding this in the ctor results in a dagger dependency cycle :(
        mOverviewProxyService = overviewProxyService;
        mOverviewProxyService = overviewProxyService;
        mNavigationBarA11yHelper = navigationBarA11yHelper;
        mNavigationBarA11yHelper = navigationBarA11yHelper;
        mSysUiState = sysUiState;
        mSysUiState = sysUiState;
Loading