[DO NOT MERGE] Catch a missed case when adding a toast
We allow a single toast window per UID. It is possible that the UID had another toast window that is going away and this CL adds a missed check for when a window is scheduled to be removed. bug:31340854 Change-Id: I0621516019542c85fe7121f7fe61659e4d4eb672
This commit is contained in:
@@ -28,15 +28,11 @@ import static com.android.server.wm.WindowManagerDebugConfig.TAG_WM;
|
|||||||
import static com.android.server.wm.WindowState.RESIZE_HANDLE_WIDTH_IN_DP;
|
import static com.android.server.wm.WindowState.RESIZE_HANDLE_WIDTH_IN_DP;
|
||||||
|
|
||||||
import android.app.ActivityManager.StackId;
|
import android.app.ActivityManager.StackId;
|
||||||
import android.content.pm.ApplicationInfo;
|
|
||||||
import android.content.pm.PackageManager;
|
|
||||||
import android.graphics.Matrix;
|
import android.graphics.Matrix;
|
||||||
import android.graphics.Rect;
|
import android.graphics.Rect;
|
||||||
import android.graphics.RectF;
|
import android.graphics.RectF;
|
||||||
import android.graphics.Region;
|
import android.graphics.Region;
|
||||||
import android.graphics.Region.Op;
|
import android.graphics.Region.Op;
|
||||||
import android.os.Build;
|
|
||||||
import android.os.UserHandle;
|
|
||||||
import android.util.DisplayMetrics;
|
import android.util.DisplayMetrics;
|
||||||
import android.util.Slog;
|
import android.util.Slog;
|
||||||
import android.view.Display;
|
import android.view.Display;
|
||||||
@@ -728,8 +724,7 @@ class DisplayContent {
|
|||||||
for (int i = 0; i < windowCount; i++) {
|
for (int i = 0; i < windowCount; i++) {
|
||||||
WindowState window = windows.get(i);
|
WindowState window = windows.get(i);
|
||||||
if (window.mAttrs.type == TYPE_TOAST && window.mOwnerUid == uid
|
if (window.mAttrs.type == TYPE_TOAST && window.mOwnerUid == uid
|
||||||
&& !window.mPermanentlyHidden && !window.mAnimatingExit
|
&& !window.isRemovedOrHidden()) {
|
||||||
&& !window.mRemoveOnExit) {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2961,4 +2961,10 @@ final class WindowState implements WindowManagerPolicy.WindowState {
|
|||||||
public boolean isRtl() {
|
public boolean isRtl() {
|
||||||
return mMergedConfiguration.getLayoutDirection() == View.LAYOUT_DIRECTION_RTL;
|
return mMergedConfiguration.getLayoutDirection() == View.LAYOUT_DIRECTION_RTL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isRemovedOrHidden() {
|
||||||
|
return mPermanentlyHidden || mAnimatingExit
|
||||||
|
|| mRemoveOnExit || mWindowRemovalAllowed
|
||||||
|
|| mViewVisibility == View.GONE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user