Merge "Pass config changes through to TaskbarDelegate" into tm-qpr-dev
This commit is contained in:
@@ -142,6 +142,9 @@ public class NavigationBarController implements
|
|||||||
boolean isOldConfigTablet = mIsTablet;
|
boolean isOldConfigTablet = mIsTablet;
|
||||||
mIsTablet = isTablet(mContext);
|
mIsTablet = isTablet(mContext);
|
||||||
boolean largeScreenChanged = mIsTablet != isOldConfigTablet;
|
boolean largeScreenChanged = mIsTablet != isOldConfigTablet;
|
||||||
|
if (mTaskbarDelegate.isInitialized()) {
|
||||||
|
mTaskbarDelegate.onConfigurationChanged(newConfig);
|
||||||
|
}
|
||||||
// If we folded/unfolded while in 3 button, show navbar in folded state, hide in unfolded
|
// If we folded/unfolded while in 3 button, show navbar in folded state, hide in unfolded
|
||||||
if (largeScreenChanged && updateNavbarForTaskbar()) {
|
if (largeScreenChanged && updateNavbarForTaskbar()) {
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -40,7 +40,6 @@ import static com.android.systemui.statusbar.phone.BarTransitions.TransitionMode
|
|||||||
|
|
||||||
import android.app.StatusBarManager;
|
import android.app.StatusBarManager;
|
||||||
import android.app.StatusBarManager.WindowVisibleState;
|
import android.app.StatusBarManager.WindowVisibleState;
|
||||||
import android.content.ComponentCallbacks;
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.res.Configuration;
|
import android.content.res.Configuration;
|
||||||
import android.graphics.Rect;
|
import android.graphics.Rect;
|
||||||
@@ -87,7 +86,7 @@ import javax.inject.Inject;
|
|||||||
@SysUISingleton
|
@SysUISingleton
|
||||||
public class TaskbarDelegate implements CommandQueue.Callbacks,
|
public class TaskbarDelegate implements CommandQueue.Callbacks,
|
||||||
OverviewProxyService.OverviewProxyListener, NavigationModeController.ModeChangedListener,
|
OverviewProxyService.OverviewProxyListener, NavigationModeController.ModeChangedListener,
|
||||||
ComponentCallbacks, Dumpable {
|
Dumpable {
|
||||||
private static final String TAG = TaskbarDelegate.class.getSimpleName();
|
private static final String TAG = TaskbarDelegate.class.getSimpleName();
|
||||||
|
|
||||||
private final EdgeBackGestureHandler mEdgeBackGestureHandler;
|
private final EdgeBackGestureHandler mEdgeBackGestureHandler;
|
||||||
@@ -225,7 +224,6 @@ public class TaskbarDelegate implements CommandQueue.Callbacks,
|
|||||||
// Initialize component callback
|
// Initialize component callback
|
||||||
Display display = mDisplayManager.getDisplay(displayId);
|
Display display = mDisplayManager.getDisplay(displayId);
|
||||||
mWindowContext = mContext.createWindowContext(display, TYPE_APPLICATION, null);
|
mWindowContext = mContext.createWindowContext(display, TYPE_APPLICATION, null);
|
||||||
mWindowContext.registerComponentCallbacks(this);
|
|
||||||
mScreenPinningNotify = new ScreenPinningNotify(mWindowContext);
|
mScreenPinningNotify = new ScreenPinningNotify(mWindowContext);
|
||||||
// Set initial state for any listeners
|
// Set initial state for any listeners
|
||||||
updateSysuiFlags();
|
updateSysuiFlags();
|
||||||
@@ -233,6 +231,7 @@ public class TaskbarDelegate implements CommandQueue.Callbacks,
|
|||||||
mLightBarController.setNavigationBar(mLightBarTransitionsController);
|
mLightBarController.setNavigationBar(mLightBarTransitionsController);
|
||||||
mPipOptional.ifPresent(this::addPipExclusionBoundsChangeListener);
|
mPipOptional.ifPresent(this::addPipExclusionBoundsChangeListener);
|
||||||
mEdgeBackGestureHandler.setBackAnimation(mBackAnimation);
|
mEdgeBackGestureHandler.setBackAnimation(mBackAnimation);
|
||||||
|
mEdgeBackGestureHandler.onConfigurationChanged(mContext.getResources().getConfiguration());
|
||||||
mInitialized = true;
|
mInitialized = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -247,10 +246,7 @@ public class TaskbarDelegate implements CommandQueue.Callbacks,
|
|||||||
mNavBarHelper.destroy();
|
mNavBarHelper.destroy();
|
||||||
mEdgeBackGestureHandler.onNavBarDetached();
|
mEdgeBackGestureHandler.onNavBarDetached();
|
||||||
mScreenPinningNotify = null;
|
mScreenPinningNotify = null;
|
||||||
if (mWindowContext != null) {
|
mWindowContext = null;
|
||||||
mWindowContext.unregisterComponentCallbacks(this);
|
|
||||||
mWindowContext = null;
|
|
||||||
}
|
|
||||||
mAutoHideController.setNavigationBar(null);
|
mAutoHideController.setNavigationBar(null);
|
||||||
mLightBarTransitionsController.destroy();
|
mLightBarTransitionsController.destroy();
|
||||||
mLightBarController.setNavigationBar(null);
|
mLightBarController.setNavigationBar(null);
|
||||||
@@ -267,8 +263,9 @@ public class TaskbarDelegate implements CommandQueue.Callbacks,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns {@code true} if this taskBar is {@link #init(int)}. Returns {@code false} if this
|
* Returns {@code true} if this taskBar is {@link #init(int)}.
|
||||||
* taskbar has not yet been {@link #init(int)} or has been {@link #destroy()}.
|
* Returns {@code false} if this taskbar has not yet been {@link #init(int)}
|
||||||
|
* or has been {@link #destroy()}.
|
||||||
*/
|
*/
|
||||||
public boolean isInitialized() {
|
public boolean isInitialized() {
|
||||||
return mInitialized;
|
return mInitialized;
|
||||||
@@ -460,14 +457,10 @@ public class TaskbarDelegate implements CommandQueue.Callbacks,
|
|||||||
return mBehavior == BEHAVIOR_SHOW_TRANSIENT_BARS_BY_SWIPE;
|
return mBehavior == BEHAVIOR_SHOW_TRANSIENT_BARS_BY_SWIPE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onConfigurationChanged(Configuration configuration) {
|
public void onConfigurationChanged(Configuration configuration) {
|
||||||
mEdgeBackGestureHandler.onConfigurationChanged(configuration);
|
mEdgeBackGestureHandler.onConfigurationChanged(configuration);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onLowMemory() {}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void showPinningEnterExitToast(boolean entering) {
|
public void showPinningEnterExitToast(boolean entering) {
|
||||||
updateSysuiFlags();
|
updateSysuiFlags();
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ import static android.view.WindowManager.LayoutParams.PRIVATE_FLAG_EXCLUDE_FROM_
|
|||||||
|
|
||||||
import static com.android.systemui.classifier.Classifier.BACK_GESTURE;
|
import static com.android.systemui.classifier.Classifier.BACK_GESTURE;
|
||||||
|
|
||||||
|
import android.annotation.NonNull;
|
||||||
import android.app.ActivityManager;
|
import android.app.ActivityManager;
|
||||||
import android.content.ComponentName;
|
import android.content.ComponentName;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
@@ -955,7 +956,7 @@ public class EdgeBackGestureHandler extends CurrentUserTracker
|
|||||||
mStartingQuickstepRotation != rotation;
|
mStartingQuickstepRotation != rotation;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onConfigurationChanged(Configuration newConfig) {
|
public void onConfigurationChanged(@NonNull Configuration newConfig) {
|
||||||
if (mStartingQuickstepRotation > -1) {
|
if (mStartingQuickstepRotation > -1) {
|
||||||
updateDisabledForQuickstep(newConfig);
|
updateDisabledForQuickstep(newConfig);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user