Fixed NPE in ProcessRecord.appNotResponding

Change-Id: Iaa779002c5b00d0bd6a0acad141ce5055c7b5612
Fixes: 117911958
Test: N/A
(cherry picked from commit 97b2b749b9b1390e13536a08f72454b93675a620)
diff --git a/services/core/java/com/android/server/am/ProcessRecord.java b/services/core/java/com/android/server/am/ProcessRecord.java
index 1aa538d..0eb535b 100644
--- a/services/core/java/com/android/server/am/ProcessRecord.java
+++ b/services/core/java/com/android/server/am/ProcessRecord.java
@@ -1353,9 +1353,10 @@
                 isInterestingToUserLocked()
                         ? StatsLog.ANROCCURRED__FOREGROUND_STATE__FOREGROUND
                         : StatsLog.ANROCCURRED__FOREGROUND_STATE__BACKGROUND);
+        final ProcessRecord parentPr = parentProcess != null
+                ? (ProcessRecord) parentProcess.mOwner : null;
         mService.addErrorToDropBox("anr", this, processName, activityShortComponentName,
-                parentShortComponentName, (ProcessRecord) parentProcess.mOwner, annotation,
-                cpuInfo, tracesFile, null);
+                parentShortComponentName, parentPr, annotation, cpuInfo, tracesFile, null);
 
         if (mService.mActivityTaskManager.mController != null) {
             try {