Loading packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBarController.java +3 −5 Original line number Original line Diff line number Diff line Loading @@ -191,8 +191,8 @@ public class NavigationBarController implements Callbacks, mNavMode = mNavigationModeController.addListener(this); mNavMode = mNavigationModeController.addListener(this); mNavigationModeController.addListener(this); mNavigationModeController.addListener(this); mTaskbarDelegate = taskbarDelegate; mTaskbarDelegate = taskbarDelegate; mTaskbarDelegate.setOverviewProxyService(overviewProxyService, mTaskbarDelegate.setOverviewProxyService(commandQueue, overviewProxyService, navigationBarA11yHelper, mSysUiFlagsContainer); navigationBarA11yHelper, navigationModeController, sysUiFlagsContainer); mIsTablet = isTablet(mContext); mIsTablet = isTablet(mContext); mUserTracker = userTracker; mUserTracker = userTracker; } } Loading Loading @@ -252,12 +252,10 @@ public class NavigationBarController implements Callbacks, /** @return {@code true} if taskbar is enabled, false otherwise */ /** @return {@code true} if taskbar is enabled, false otherwise */ private boolean initializeTaskbarIfNecessary() { private boolean initializeTaskbarIfNecessary() { if (mIsTablet) { if (mIsTablet) { // Remove navigation bar when taskbar is showing, currently only for 3 button mode // Remove navigation bar when taskbar is showing removeNavigationBar(mContext.getDisplayId()); removeNavigationBar(mContext.getDisplayId()); mCommandQueue.addCallback(mTaskbarDelegate); mTaskbarDelegate.init(mContext.getDisplayId()); mTaskbarDelegate.init(mContext.getDisplayId()); } else { } else { mCommandQueue.removeCallback(mTaskbarDelegate); mTaskbarDelegate.destroy(); mTaskbarDelegate.destroy(); } } return mIsTablet; return mIsTablet; Loading packages/SystemUI/src/com/android/systemui/navigationbar/TaskbarDelegate.java +38 −3 Original line number Original line Diff line number Diff line Loading @@ -27,13 +27,16 @@ import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_I import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_IME_SWITCHER_SHOWING; import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_IME_SWITCHER_SHOWING; import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_OVERVIEW_DISABLED; import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_OVERVIEW_DISABLED; import android.content.Context; import android.inputmethodservice.InputMethodService; import android.inputmethodservice.InputMethodService; import android.os.IBinder; import android.os.IBinder; import android.view.InsetsVisibilities; import android.view.InsetsVisibilities; import android.view.View; import android.view.View; import com.android.internal.view.AppearanceRegion; import com.android.internal.view.AppearanceRegion; import com.android.systemui.Dependency; import com.android.systemui.model.SysUiState; import com.android.systemui.model.SysUiState; import com.android.systemui.navigationbar.gestural.EdgeBackGestureHandler; import com.android.systemui.recents.OverviewProxyService; 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; Loading @@ -42,10 +45,15 @@ import javax.inject.Inject; import javax.inject.Singleton; import javax.inject.Singleton; @Singleton @Singleton public class TaskbarDelegate implements CommandQueue.Callbacks { public class TaskbarDelegate implements CommandQueue.Callbacks, OverviewProxyService.OverviewProxyListener, NavigationModeController.ModeChangedListener { private final EdgeBackGestureHandler mEdgeBackGestureHandler; private CommandQueue mCommandQueue; private OverviewProxyService mOverviewProxyService; private OverviewProxyService mOverviewProxyService; private NavigationBarA11yHelper mNavigationBarA11yHelper; private NavigationBarA11yHelper mNavigationBarA11yHelper; private NavigationModeController mNavigationModeController; private SysUiState mSysUiState; private SysUiState mSysUiState; private int mDisplayId; private int mDisplayId; private int mNavigationIconHints; private int mNavigationIconHints; Loading @@ -54,23 +62,36 @@ public class TaskbarDelegate implements CommandQueue.Callbacks { private int mDisabledFlags; private int mDisabledFlags; @Inject @Inject public TaskbarDelegate() { /* no-op */ } public TaskbarDelegate(Context context) { mEdgeBackGestureHandler = Dependency.get(EdgeBackGestureHandler.Factory.class) .create(context); } public void setOverviewProxyService(OverviewProxyService overviewProxyService, public void setOverviewProxyService(CommandQueue commandQueue, OverviewProxyService overviewProxyService, NavigationBarA11yHelper navigationBarA11yHelper, NavigationBarA11yHelper navigationBarA11yHelper, NavigationModeController navigationModeController, SysUiState sysUiState) { SysUiState sysUiState) { // TODO: adding this in the ctor results in a dagger dependency cycle :( // TODO: adding this in the ctor results in a dagger dependency cycle :( mCommandQueue = commandQueue; mOverviewProxyService = overviewProxyService; mOverviewProxyService = overviewProxyService; mNavigationBarA11yHelper = navigationBarA11yHelper; mNavigationBarA11yHelper = navigationBarA11yHelper; mNavigationModeController = navigationModeController; mSysUiState = sysUiState; mSysUiState = sysUiState; } } public void destroy() { public void destroy() { mCommandQueue.removeCallback(this); mOverviewProxyService.removeCallback(this); mNavigationModeController.removeListener(this); mNavigationBarA11yHelper.removeA11yEventListener(mNavA11yEventListener); mNavigationBarA11yHelper.removeA11yEventListener(mNavA11yEventListener); } } public void init(int displayId) { public void init(int displayId) { mDisplayId = displayId; mDisplayId = displayId; mCommandQueue.addCallback(this); mOverviewProxyService.addCallback(this); mNavigationModeController.addListener(this); mNavigationBarA11yHelper.registerA11yEventListener(mNavA11yEventListener); mNavigationBarA11yHelper.registerA11yEventListener(mNavA11yEventListener); // Set initial state for any listeners // Set initial state for any listeners updateSysuiFlags(); updateSysuiFlags(); Loading Loading @@ -126,4 +147,18 @@ public class TaskbarDelegate implements CommandQueue.Callbacks { InsetsVisibilities requestedVisibilities, String packageName) { InsetsVisibilities requestedVisibilities, String packageName) { mOverviewProxyService.onSystemBarAttributesChanged(displayId, behavior); mOverviewProxyService.onSystemBarAttributesChanged(displayId, behavior); } } @Override public void onTaskbarStatusUpdated(boolean visible, boolean stashed) { if (visible) { mEdgeBackGestureHandler.onNavBarAttached(); } else { mEdgeBackGestureHandler.onNavBarDetached(); } } @Override public void onNavigationModeChanged(int mode) { mEdgeBackGestureHandler.onNavigationModeChanged(mode); } } } Loading
packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBarController.java +3 −5 Original line number Original line Diff line number Diff line Loading @@ -191,8 +191,8 @@ public class NavigationBarController implements Callbacks, mNavMode = mNavigationModeController.addListener(this); mNavMode = mNavigationModeController.addListener(this); mNavigationModeController.addListener(this); mNavigationModeController.addListener(this); mTaskbarDelegate = taskbarDelegate; mTaskbarDelegate = taskbarDelegate; mTaskbarDelegate.setOverviewProxyService(overviewProxyService, mTaskbarDelegate.setOverviewProxyService(commandQueue, overviewProxyService, navigationBarA11yHelper, mSysUiFlagsContainer); navigationBarA11yHelper, navigationModeController, sysUiFlagsContainer); mIsTablet = isTablet(mContext); mIsTablet = isTablet(mContext); mUserTracker = userTracker; mUserTracker = userTracker; } } Loading Loading @@ -252,12 +252,10 @@ public class NavigationBarController implements Callbacks, /** @return {@code true} if taskbar is enabled, false otherwise */ /** @return {@code true} if taskbar is enabled, false otherwise */ private boolean initializeTaskbarIfNecessary() { private boolean initializeTaskbarIfNecessary() { if (mIsTablet) { if (mIsTablet) { // Remove navigation bar when taskbar is showing, currently only for 3 button mode // Remove navigation bar when taskbar is showing removeNavigationBar(mContext.getDisplayId()); removeNavigationBar(mContext.getDisplayId()); mCommandQueue.addCallback(mTaskbarDelegate); mTaskbarDelegate.init(mContext.getDisplayId()); mTaskbarDelegate.init(mContext.getDisplayId()); } else { } else { mCommandQueue.removeCallback(mTaskbarDelegate); mTaskbarDelegate.destroy(); mTaskbarDelegate.destroy(); } } return mIsTablet; return mIsTablet; Loading
packages/SystemUI/src/com/android/systemui/navigationbar/TaskbarDelegate.java +38 −3 Original line number Original line Diff line number Diff line Loading @@ -27,13 +27,16 @@ import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_I import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_IME_SWITCHER_SHOWING; import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_IME_SWITCHER_SHOWING; import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_OVERVIEW_DISABLED; import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_OVERVIEW_DISABLED; import android.content.Context; import android.inputmethodservice.InputMethodService; import android.inputmethodservice.InputMethodService; import android.os.IBinder; import android.os.IBinder; import android.view.InsetsVisibilities; import android.view.InsetsVisibilities; import android.view.View; import android.view.View; import com.android.internal.view.AppearanceRegion; import com.android.internal.view.AppearanceRegion; import com.android.systemui.Dependency; import com.android.systemui.model.SysUiState; import com.android.systemui.model.SysUiState; import com.android.systemui.navigationbar.gestural.EdgeBackGestureHandler; import com.android.systemui.recents.OverviewProxyService; 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; Loading @@ -42,10 +45,15 @@ import javax.inject.Inject; import javax.inject.Singleton; import javax.inject.Singleton; @Singleton @Singleton public class TaskbarDelegate implements CommandQueue.Callbacks { public class TaskbarDelegate implements CommandQueue.Callbacks, OverviewProxyService.OverviewProxyListener, NavigationModeController.ModeChangedListener { private final EdgeBackGestureHandler mEdgeBackGestureHandler; private CommandQueue mCommandQueue; private OverviewProxyService mOverviewProxyService; private OverviewProxyService mOverviewProxyService; private NavigationBarA11yHelper mNavigationBarA11yHelper; private NavigationBarA11yHelper mNavigationBarA11yHelper; private NavigationModeController mNavigationModeController; private SysUiState mSysUiState; private SysUiState mSysUiState; private int mDisplayId; private int mDisplayId; private int mNavigationIconHints; private int mNavigationIconHints; Loading @@ -54,23 +62,36 @@ public class TaskbarDelegate implements CommandQueue.Callbacks { private int mDisabledFlags; private int mDisabledFlags; @Inject @Inject public TaskbarDelegate() { /* no-op */ } public TaskbarDelegate(Context context) { mEdgeBackGestureHandler = Dependency.get(EdgeBackGestureHandler.Factory.class) .create(context); } public void setOverviewProxyService(OverviewProxyService overviewProxyService, public void setOverviewProxyService(CommandQueue commandQueue, OverviewProxyService overviewProxyService, NavigationBarA11yHelper navigationBarA11yHelper, NavigationBarA11yHelper navigationBarA11yHelper, NavigationModeController navigationModeController, SysUiState sysUiState) { SysUiState sysUiState) { // TODO: adding this in the ctor results in a dagger dependency cycle :( // TODO: adding this in the ctor results in a dagger dependency cycle :( mCommandQueue = commandQueue; mOverviewProxyService = overviewProxyService; mOverviewProxyService = overviewProxyService; mNavigationBarA11yHelper = navigationBarA11yHelper; mNavigationBarA11yHelper = navigationBarA11yHelper; mNavigationModeController = navigationModeController; mSysUiState = sysUiState; mSysUiState = sysUiState; } } public void destroy() { public void destroy() { mCommandQueue.removeCallback(this); mOverviewProxyService.removeCallback(this); mNavigationModeController.removeListener(this); mNavigationBarA11yHelper.removeA11yEventListener(mNavA11yEventListener); mNavigationBarA11yHelper.removeA11yEventListener(mNavA11yEventListener); } } public void init(int displayId) { public void init(int displayId) { mDisplayId = displayId; mDisplayId = displayId; mCommandQueue.addCallback(this); mOverviewProxyService.addCallback(this); mNavigationModeController.addListener(this); mNavigationBarA11yHelper.registerA11yEventListener(mNavA11yEventListener); mNavigationBarA11yHelper.registerA11yEventListener(mNavA11yEventListener); // Set initial state for any listeners // Set initial state for any listeners updateSysuiFlags(); updateSysuiFlags(); Loading Loading @@ -126,4 +147,18 @@ public class TaskbarDelegate implements CommandQueue.Callbacks { InsetsVisibilities requestedVisibilities, String packageName) { InsetsVisibilities requestedVisibilities, String packageName) { mOverviewProxyService.onSystemBarAttributesChanged(displayId, behavior); mOverviewProxyService.onSystemBarAttributesChanged(displayId, behavior); } } @Override public void onTaskbarStatusUpdated(boolean visible, boolean stashed) { if (visible) { mEdgeBackGestureHandler.onNavBarAttached(); } else { mEdgeBackGestureHandler.onNavBarDetached(); } } @Override public void onNavigationModeChanged(int mode) { mEdgeBackGestureHandler.onNavigationModeChanged(mode); } } }