Merge "Only add divider when it need to show" into rvc-dev

This commit is contained in:
Tony Huang
2020-06-12 03:04:26 +00:00
committed by Android (Google) Code Review
3 changed files with 5 additions and 11 deletions

View File

@@ -41,7 +41,6 @@ public class WindowlessWindowManager implements IWindowSession {
private final static String TAG = "WindowlessWindowManager"; private final static String TAG = "WindowlessWindowManager";
private class State { private class State {
//TODO : b/150190730 we should create it when view show and release it when view invisible.
SurfaceControl mSurfaceControl; SurfaceControl mSurfaceControl;
WindowManager.LayoutParams mParams = new WindowManager.LayoutParams(); WindowManager.LayoutParams mParams = new WindowManager.LayoutParams();
int mDisplayId; int mDisplayId;

View File

@@ -253,8 +253,10 @@ public class Divider extends SystemUI implements DividerView.DividerCallbacks,
mSplitLayout.mSecondary = new Rect(mRotateSplitLayout.mSecondary); mSplitLayout.mSecondary = new Rect(mRotateSplitLayout.mSecondary);
mRotateSplitLayout = null; mRotateSplitLayout = null;
} }
if (isSplitActive()) {
update(newConfig); update(newConfig);
} }
}
Handler getHandler() { Handler getHandler() {
return mHandler; return mHandler;
@@ -328,11 +330,6 @@ public class Divider extends SystemUI implements DividerView.DividerCallbacks,
mHandler.post(this::removeDivider); mHandler.post(this::removeDivider);
} }
void onTasksReady() {
mHandler.post(() -> update(mDisplayController.getDisplayContext(
mContext.getDisplayId()).getResources().getConfiguration()));
}
private void updateVisibility(final boolean visible) { private void updateVisibility(final boolean visible) {
if (DEBUG) Slog.d(TAG, "Updating visibility " + mVisible + "->" + visible); if (DEBUG) Slog.d(TAG, "Updating visibility " + mVisible + "->" + visible);
if (mVisible != visible) { if (mVisible != visible) {
@@ -524,7 +521,7 @@ public class Divider extends SystemUI implements DividerView.DividerCallbacks,
void ensureMinimizedSplit() { void ensureMinimizedSplit() {
setHomeMinimized(true /* minimized */, mSplits.mSecondary.isResizable()); setHomeMinimized(true /* minimized */, mSplits.mSecondary.isResizable());
if (!isDividerVisible()) { if (mView != null && !isDividerVisible()) {
// Wasn't in split-mode yet, so enter now. // Wasn't in split-mode yet, so enter now.
if (DEBUG) { if (DEBUG) {
Slog.d(TAG, " entering split mode with minimized=true"); Slog.d(TAG, " entering split mode with minimized=true");
@@ -535,7 +532,7 @@ public class Divider extends SystemUI implements DividerView.DividerCallbacks,
void ensureNormalSplit() { void ensureNormalSplit() {
setHomeMinimized(false /* minimized */, mHomeStackResizable); setHomeMinimized(false /* minimized */, mHomeStackResizable);
if (!isDividerVisible()) { if (mView != null && !isDividerVisible()) {
// Wasn't in split-mode, so enter now. // Wasn't in split-mode, so enter now.
if (DEBUG) { if (DEBUG) {
Slog.d(TAG, " enter split mode unminimized "); Slog.d(TAG, " enter split mode unminimized ");

View File

@@ -113,8 +113,6 @@ class SplitScreenTaskOrganizer extends TaskOrganizer {
t.setColor(mSecondaryDim, new float[]{0f, 0f, 0f}); t.setColor(mSecondaryDim, new float[]{0f, 0f, 0f});
t.apply(); t.apply();
releaseTransaction(t); releaseTransaction(t);
mDivider.onTasksReady();
} }
} }
} }