From a3cd8e092d6aa3c746708f72d0631c7e899a0b79 Mon Sep 17 00:00:00 2001 From: Bryce Lee Date: Tue, 9 Jan 2018 15:44:24 -0800 Subject: [PATCH] Make sure correct default values for ActivityStarter. Request#reset() used different default values for the calling uid and pid. Since reset is called before use, these the default values were incorrect. This changelist corrects this issue. Change-Id: I1a04ed443fb5d9d6b248bbb1b2031d87f83f9774 Fixes: 70507511 Test: atest OsHostTests#testNonExportedActivities --- .../java/com/android/server/am/ActivityStarter.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/services/core/java/com/android/server/am/ActivityStarter.java b/services/core/java/com/android/server/am/ActivityStarter.java index abdbfadf8d99e..c98e33727c9ee 100644 --- a/services/core/java/com/android/server/am/ActivityStarter.java +++ b/services/core/java/com/android/server/am/ActivityStarter.java @@ -317,6 +317,13 @@ class ActivityStarter { */ boolean mayWait; + /** + * Ensure constructed request matches reset instance. + */ + Request() { + reset(); + } + /** * Sets values back to the initial state, clearing any held references. */ @@ -332,8 +339,8 @@ class ActivityStarter { resultTo = null; resultWho = null; requestCode = 0; - callingPid = 0; - callingUid = 0; + callingPid = DEFAULT_CALLING_PID; + callingUid = DEFAULT_CALLING_UID; callingPackage = null; realCallingPid = 0; realCallingUid = 0;