Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 310125a2 authored by Ming-Shin Lu's avatar Ming-Shin Lu
Browse files

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
parent d2e2eda8
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -1407,7 +1407,8 @@ public class WindowManagerService extends IWindowManager.Stub
            if (!displayContent.hasAccess(session.mUid)) {
            if (!displayContent.hasAccess(session.mUid)) {
                ProtoLog.w(WM_ERROR,
                ProtoLog.w(WM_ERROR,
                        "Attempted to add window to a display for which the application "
                        "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;
                return WindowManagerGlobal.ADD_INVALID_DISPLAY;
            }
            }