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

Commit f8deb81e authored by Jeff Chang's avatar Jeff Chang
Browse files

Client may use the out of date display ID when add the window token.

Add the null pointer checking when getDisplayContent.

Bug: 80001975
Test: atest WindowManagerSmokeTest ActivityManagerMultiDisplayTests
Change-Id: I1f5e4b11762a43b1a363c4c8974e08068d938023
parent 94763e19
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -2341,6 +2341,12 @@ public class WindowManagerService extends IWindowManager.Stub

        synchronized(mWindowMap) {
            final DisplayContent dc = mRoot.getDisplayContent(displayId);
            if (dc == null) {
                Slog.w(TAG_WM, "addWindowToken: Attempted to add token: " + binder
                        + " for non-exiting displayId=" + displayId);
                return;
            }

            WindowToken token = dc.getWindowToken(binder);
            if (token != null) {
                Slog.w(TAG_WM, "addWindowToken: Attempted to add binder token: " + binder