Merge "Pass START_ACTIVITIES_FROM_BACKGROUND permission to instrumentation test." into rvc-dev am: 7afd9b9af7 am: a6baa49614

Change-Id: Id8346628cf2157f67138a91910180f9af6d8c343
This commit is contained in:
Automerger Merge Worker
2020-02-26 20:12:37 +00:00

View File

@@ -4869,6 +4869,19 @@ public final class ActiveServices {
return true;
}
if (r.app != null) {
ActiveInstrumentation instr = r.app.getActiveInstrumentation();
if (instr != null && instr.mHasBackgroundActivityStartsPermission) {
return true;
}
}
final boolean hasAllowBackgroundActivityStartsToken = r.app != null
? !r.app.mAllowBackgroundActivityStartsTokens.isEmpty() : false;
if (hasAllowBackgroundActivityStartsToken) {
return true;
}
if (mAm.checkPermission(START_ACTIVITIES_FROM_BACKGROUND, callingPid, callingUid)
== PERMISSION_GRANTED) {
return true;