Break direct calls to UserController object in AMS from activity classes (12/n)

Make calls from activity classes go through ActivityManagerInternal
interface to case UserController instead of calling AMS.mUserController
object directly. Note that calls to UserController should not hold the
AMS lock.

Bug: 80414790
Test: Existing tests pass
Change-Id: Ie56f08d10b62d609e9b5e31f45b5f0d6eed3a9d4
diff --git a/services/core/java/com/android/server/am/ProcessRecord.java b/services/core/java/com/android/server/am/ProcessRecord.java
index 5a44ab6..5bf8bcc 100644
--- a/services/core/java/com/android/server/am/ProcessRecord.java
+++ b/services/core/java/com/android/server/am/ProcessRecord.java
@@ -999,4 +999,11 @@
         }
     }
 
+    /**
+     * Returns the total time (in milliseconds) spent executing in both user and system code.
+     * Safe to call without lock held.
+     */
+    public long getCpuTime() {
+        return mService.mProcessCpuTracker.getCpuTimeForPid(pid);
+    }
 }