Merge AppWindowToken into ActivityRecord

This change kept AppWindowTokenTests as it's originally based on top of
WindowTestBase, and merging that into ActivityRecordTests needs to
change the base class to ActivityTestBase, which requires additional
work and may change test behaviors. Therefore delay that to
follow-up CL.

Bug: 80414790
Test: Existing tests pass.
Change-Id: I6d73975ee77be9817c41b297f067de2d92a68499
diff --git a/services/core/java/com/android/server/wm/WindowContainer.java b/services/core/java/com/android/server/wm/WindowContainer.java
index a4ab66a..037edf1 100644
--- a/services/core/java/com/android/server/wm/WindowContainer.java
+++ b/services/core/java/com/android/server/wm/WindowContainer.java
@@ -947,9 +947,9 @@
         wrapper.release();
     }
 
-    void forAllAppWindows(Consumer<AppWindowToken> callback) {
+    void forAllActivities(Consumer<ActivityRecord> callback) {
         for (int i = mChildren.size() - 1; i >= 0; --i) {
-            mChildren.get(i).forAllAppWindows(callback);
+            mChildren.get(i).forAllActivities(callback);
         }
     }
 
@@ -1446,7 +1446,7 @@
         final WindowManagerPolicy policy = mWmService.mPolicy;
         forAllWindows(w -> {
             final boolean keyguard = policy.isKeyguardHostWindow(w.mAttrs);
-            if (w.isVisibleLw() && (w.mAppToken != null || keyguard)) {
+            if (w.isVisibleLw() && (w.mActivityRecord != null || keyguard)) {
                 w.mWinAnimator.mDrawState = DRAW_PENDING;
                 // Force add to mResizingWindows.
                 w.resetLastContentInsets();