Merge "Add unaudited exported flag to exposed runtime receivers"

This commit is contained in:
Michael Groover
2022-01-04 21:24:02 +00:00
committed by Android (Google) Code Review
2 changed files with 4 additions and 2 deletions

View File

@@ -341,7 +341,8 @@ public final class CommunalManagerService extends SystemService {
UserHandle.SYSTEM,
mIntentFilter,
/* broadcastPermission= */null,
/* scheduler= */ null);
/* scheduler= */ null,
Context.RECEIVER_EXPORTED_UNAUDITED);
}
private void unregister() {

View File

@@ -29,6 +29,7 @@ import static com.android.server.wm.ActivityInterceptorCallback.COMMUNAL_MODE_OR
import static com.google.common.truth.Truth.assertThat;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.anyInt;
import static org.mockito.ArgumentMatchers.anyString;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.spy;
@@ -138,7 +139,7 @@ public class CommunalManagerServiceTest {
ArgumentCaptor<BroadcastReceiver> packageReceiverCaptor =
ArgumentCaptor.forClass(BroadcastReceiver.class);
verify(mContextSpy).registerReceiverAsUser(packageReceiverCaptor.capture(),
eq(UserHandle.SYSTEM), any(), any(), any());
eq(UserHandle.SYSTEM), any(), any(), any(), anyInt());
mPackageReceiver = packageReceiverCaptor.getValue();
mBinder = mService.getBinderServiceInstance();