Unify Activity level of window hierarchy (50/n).

Make ActivityRecord extend AppWindowToken so we have a single object
for acitvities in the hierarchy.

Bug: 80414790
Test: Existing tests pass.
Change-Id: Ia7f52ef444cba88223f4e8a9586f6c12b1b5e4ea
diff --git a/services/core/java/com/android/server/wm/TaskRecord.java b/services/core/java/com/android/server/wm/TaskRecord.java
index 0ea108e..8b2ef7f 100644
--- a/services/core/java/com/android/server/wm/TaskRecord.java
+++ b/services/core/java/com/android/server/wm/TaskRecord.java
@@ -1251,7 +1251,7 @@
         mActivities.add(newTop);
 
         // Make sure window manager is aware of the position change.
-        mTask.positionChildAtTop(newTop.mAppWindowToken);
+        mTask.positionChildAtTop(newTop);
         updateEffectiveIntent();
     }
 
@@ -1283,7 +1283,7 @@
         r.setTask(this);
 
         // Remove r first, and if it wasn't already in the list and it's fullscreen, count it.
-        if (!mActivities.remove(r) && r.fullscreen) {
+        if (!mActivities.remove(r) && r.occludesParent()) {
             // Was not previously in list.
             numFullscreen++;
         }
@@ -1327,10 +1327,10 @@
             mService.notifyTaskPersisterLocked(this, false);
         }
 
-        if (r.mAppWindowToken != null) {
+        if (r.getParent() != null) {
             // Only attempt to move in WM if the child has a controller. It is possible we haven't
             // created controller for the activity we are starting yet.
-            mTask.positionChildAt(r.mAppWindowToken, index);
+            mTask.positionChildAt(r, index);
         }
 
         // Make sure the list of display UID whitelists is updated
@@ -1355,7 +1355,7 @@
 
         r.setTask(null /* task */, reparenting /* reparenting */);
 
-        if (mActivities.remove(r) && r.fullscreen) {
+        if (mActivities.remove(r) && r.occludesParent()) {
             // Was previously in list.
             numFullscreen--;
         }