Implement launch bounds logic in Android (3/3)

This CL introduces persistence to launch bounds logic. It also wires up
the following state changes and persister:
1) freeform resizing;
2) windowing mode change;
3) display change;
4) task closing.

We may still need to persist immersive mode, but that needs further
discussion.

Changed launch bounds modifier a bit so that it won't launch tasks that
are completely out of the new display or conflict to existing tasks.

Bug: 113252871
Test: Manual tests on that freeform launch bounds are persisted across
reboots.
atest WmTests:LaunchParamsPersisterTests
atest WmTests:LaunchParamsControllerTests
atest WmTests:PersisterQueueTests
Change-Id: I20f3056735253c668c7f09c6eb5204e6a5990b1c
diff --git a/services/core/java/com/android/server/wm/ActivityTaskManagerService.java b/services/core/java/com/android/server/wm/ActivityTaskManagerService.java
index 433c05a..1d3b336 100644
--- a/services/core/java/com/android/server/wm/ActivityTaskManagerService.java
+++ b/services/core/java/com/android/server/wm/ActivityTaskManagerService.java
@@ -628,6 +628,7 @@
             mAssistUtils = new AssistUtils(mContext);
             mVrController.onSystemReady();
             mRecentTasks.onSystemReadyLocked();
+            mStackSupervisor.onSystemReady();
         }
     }
 
@@ -887,6 +888,20 @@
             mService.start();
         }
 
+        @Override
+        public void onUnlockUser(int userId) {
+            synchronized (mService.getGlobalLock()) {
+                mService.mStackSupervisor.mLaunchParamsPersister.onUnlockUser(userId);
+            }
+        }
+
+        @Override
+        public void onCleanupUser(int userId) {
+            synchronized (mService.getGlobalLock()) {
+                mService.mStackSupervisor.mLaunchParamsPersister.onCleanupUser(userId);
+            }
+        }
+
         public ActivityTaskManagerService getService() {
             return mService;
         }