Merge "Actually count explicit broadcasts as usage" into sc-dev

This commit is contained in:
Kevin Han
2021-07-02 19:02:45 +00:00
committed by Android (Google) Code Review

View File

@@ -1652,7 +1652,7 @@ public final class BroadcastQueue {
maybeScheduleTempAllowlistLocked(receiverUid, r, brOptions); maybeScheduleTempAllowlistLocked(receiverUid, r, brOptions);
// Report that a component is used for explicit broadcasts. // Report that a component is used for explicit broadcasts.
if (!r.intent.isExcludingStopped() && r.curComponent != null if (r.intent.getComponent() != null && r.curComponent != null
&& !TextUtils.equals(r.curComponent.getPackageName(), r.callerPackage)) { && !TextUtils.equals(r.curComponent.getPackageName(), r.callerPackage)) {
mService.mUsageStatsService.reportEvent( mService.mUsageStatsService.reportEvent(
r.curComponent.getPackageName(), r.userId, Event.APP_COMPONENT_USED); r.curComponent.getPackageName(), r.userId, Event.APP_COMPONENT_USED);