Change InputWindowInfo::isTrustedOverlay() to be permission and flag based.

Add private flag to WindowManager.LayoutParams. If the flag is set,
check if caller has INTERNAL_SYSTEM_WINDOW permission.

Bug: 155781676
Test: atest WindowManagerServiceTests
Change-Id: I58cf9f38c496e0ae8b2193dca45c0805e831bc9e
diff --git a/services/inputflinger/dispatcher/InputDispatcher.cpp b/services/inputflinger/dispatcher/InputDispatcher.cpp
index 1d5870a..6d8f036 100644
--- a/services/inputflinger/dispatcher/InputDispatcher.cpp
+++ b/services/inputflinger/dispatcher/InputDispatcher.cpp
@@ -1969,7 +1969,7 @@
       // windows with an input channel from the same PID as occluding, and so we
       // preserve this behavior with the getToken() == null check.
         return false;
-    } else if (otherInfo->isTrustedOverlay()) {
+    } else if (otherInfo->trustedOverlay) {
         return false;
     } else if (otherInfo->displayId != info->displayId) {
         return false;