summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Hongwei Wang <hwwang@google.com> 2019-06-26 20:08:31 -0700
committer android-build-merger <android-build-merger@google.com> 2019-06-26 20:08:31 -0700
commite041e62324a2b0139e94e22ef352f5464df3434e (patch)
tree77562479ee9c192ee144ca1322f7dca2945113c7
parent8335a75238a361d5943c10e570bd895652017099 (diff)
parent50ab7b076d1382ecec51d20a8054d35b38b473d4 (diff)
Merge "Comparing dimension and rotation instead of DisplayInfo" into qt-dev
am: 50ab7b076d Change-Id: Icea4c88dfd08f9c8bc9b80a6fdfcbaea49c92313
-rw-r--r--services/core/java/com/android/server/wm/PinnedStackController.java15
1 files changed, 13 insertions, 2 deletions
diff --git a/services/core/java/com/android/server/wm/PinnedStackController.java b/services/core/java/com/android/server/wm/PinnedStackController.java
index ba2325877075..af729317392b 100644
--- a/services/core/java/com/android/server/wm/PinnedStackController.java
+++ b/services/core/java/com/android/server/wm/PinnedStackController.java
@@ -25,6 +25,7 @@ import static com.android.server.wm.PinnedStackControllerProto.MOVEMENT_BOUNDS;
import static com.android.server.wm.WindowManagerDebugConfig.TAG_WITH_CLASS_NAME;
import static com.android.server.wm.WindowManagerDebugConfig.TAG_WM;
+import android.annotation.NonNull;
import android.app.RemoteAction;
import android.content.pm.ParceledListSlice;
import android.content.res.Resources;
@@ -45,6 +46,7 @@ import android.view.IPinnedStackController;
import android.view.IPinnedStackListener;
import com.android.internal.policy.PipSnapAlgorithm;
+import com.android.internal.util.Preconditions;
import com.android.server.UiThread;
import java.io.PrintWriter;
@@ -326,8 +328,8 @@ class PinnedStackController {
boolean onTaskStackBoundsChanged(Rect targetBounds, Rect outBounds) {
synchronized (mService.mGlobalLock) {
final DisplayInfo displayInfo = mDisplayContent.getDisplayInfo();
- if (mDisplayInfo.equals(displayInfo)) {
- // We are already in the right orientation, ignore
+ if (isSameDimensionAndRotation(mDisplayInfo, displayInfo)) {
+ // No dimension/rotation change, ignore
outBounds.setEmpty();
return false;
} else if (targetBounds.isEmpty()) {
@@ -427,6 +429,15 @@ class PinnedStackController {
notifyActionsChanged(mActions);
}
+ private boolean isSameDimensionAndRotation(@NonNull DisplayInfo display1,
+ @NonNull DisplayInfo display2) {
+ Preconditions.checkNotNull(display1);
+ Preconditions.checkNotNull(display2);
+ return ((display1.rotation == display2.rotation)
+ && (display1.logicalWidth == display2.logicalWidth)
+ && (display1.logicalHeight == display2.logicalHeight));
+ }
+
/**
* Notifies listeners that the PIP needs to be adjusted for the IME.
*/