@@ -1075,9 +1075,18 @@ final void processNextBroadcast(boolean fromMsg) {
1075
1075
}
1076
1076
}
1077
1077
1078
+ // This is safe to do even if we are skipping the broadcast, and we need
1079
+ // this information now to evaluate whether it is going to be allowed to run.
1080
+ final int receiverUid = info .activityInfo .applicationInfo .uid ;
1081
+ // If it's a singleton, it needs to be the same app or a special app
1082
+ if (r .callingUid != Process .SYSTEM_UID && isSingleton
1083
+ && mService .isValidSingletonCall (r .callingUid , receiverUid )) {
1084
+ info .activityInfo = mService .getActivityInfoForUser (info .activityInfo , 0 );
1085
+ }
1078
1086
String targetProcess = info .activityInfo .processName ;
1079
1087
ProcessRecord app = mService .getProcessRecordLocked (targetProcess ,
1080
1088
info .activityInfo .applicationInfo .uid , false );
1089
+
1081
1090
if (!skip ) {
1082
1091
final int allowed = mService .checkAllowBackgroundLocked (
1083
1092
info .activityInfo .applicationInfo .uid , info .activityInfo .packageName , -1 );
@@ -1118,12 +1127,6 @@ final void processNextBroadcast(boolean fromMsg) {
1118
1127
1119
1128
r .state = BroadcastRecord .APP_RECEIVE ;
1120
1129
r .curComponent = component ;
1121
- final int receiverUid = info .activityInfo .applicationInfo .uid ;
1122
- // If it's a singleton, it needs to be the same app or a special app
1123
- if (r .callingUid != Process .SYSTEM_UID && isSingleton
1124
- && mService .isValidSingletonCall (r .callingUid , receiverUid )) {
1125
- info .activityInfo = mService .getActivityInfoForUser (info .activityInfo , 0 );
1126
- }
1127
1130
r .curReceiver = info .activityInfo ;
1128
1131
if (DEBUG_MU && r .callingUid > UserHandle .PER_USER_RANGE ) {
1129
1132
Slog .v (TAG_MU , "Updated broadcast record activity info for secondary user, "
0 commit comments