Add test to ProcessRecord ANR function

The test will cover ProcessRecord#appNotResponding. Status related to
the Process will be tested. It covers the code path related to parent
process to avoid possible NPE in future.

Necessary refactor is there to support the test.

Test: atest ProcessRecordTests
Bug: 117927743
Change-Id: I127020177be0db82158c20102323458f718d3c60
diff --git a/services/core/java/com/android/server/wm/ActivityTaskManagerService.java b/services/core/java/com/android/server/wm/ActivityTaskManagerService.java
index 258819f..4a9e41e 100644
--- a/services/core/java/com/android/server/wm/ActivityTaskManagerService.java
+++ b/services/core/java/com/android/server/wm/ActivityTaskManagerService.java
@@ -762,6 +762,12 @@
         return mGlobalLock;
     }
 
+    /** For test purpose only. */
+    @VisibleForTesting
+    public ActivityTaskManagerInternal getAtmInternal() {
+        return mInternal;
+    }
+
     public void initialize(IntentFirewall intentFirewall, PendingIntentController intentController,
             Looper looper) {
         mH = new H(looper);