From 310125a2f94506b7e68e91765e6a928d33219a64 Mon Sep 17 00:00:00 2001 From: Ming-Shin Lu Date: Wed, 26 Aug 2020 22:42:29 +0800 Subject: [PATCH] Correct displayId info in log when WMS#addWindow returned ADD_INVALID_DISPLAY As in WMS#addWindow will check if the application is accessible to add window, if not, will print displayId value that application didn't have access right on it. Since getDisplayContentOrCreate(displayId, token) will return the display of window token when the token exists, if the displayId value is not same as the token display, the error message may confuse the reader. Bug: 163333691 Test: manual Change-Id: Ic887fde9ab2e1f2b57a0c9241809287e193dcf48 --- .../core/java/com/android/server/wm/WindowManagerService.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/services/core/java/com/android/server/wm/WindowManagerService.java b/services/core/java/com/android/server/wm/WindowManagerService.java index 2ce16b2fdd796..2ec98b5c36624 100644 --- a/services/core/java/com/android/server/wm/WindowManagerService.java +++ b/services/core/java/com/android/server/wm/WindowManagerService.java @@ -1407,7 +1407,8 @@ public class WindowManagerService extends IWindowManager.Stub if (!displayContent.hasAccess(session.mUid)) { ProtoLog.w(WM_ERROR, "Attempted to add window to a display for which the application " - + "does not have access: %d. Aborting.", displayId); + + "does not have access: %d. Aborting.", + displayContent.getDisplayId()); return WindowManagerGlobal.ADD_INVALID_DISPLAY; }