Revert "Use RECEIVER_NOT_EXPORTED in CarrierPrivilegeAuthenticator."
This reverts commit 7569d51446.
Reason for revert: ag/17318348 moved the declaration of the protected-broadcasts from the telephony package to the platform's manifest, so a flag is no longer required when registering for these. In addition, ag/17307852 is syncing the behavior of unexported runtime receivers with that of manifest receivers by limiting the UIDs that can broadcast to these receivers to the root and system UIDs; with the RECEIVER_NOT_EXPORTED flag from this commit, these receivers would no longer be able to receive these broadcasts when sent from the telephony UID.
Bug: 225999840
Change-Id: Ifb15506434edabdfacf84c302881d0cf97d3add8
This commit is contained in:
@@ -69,8 +69,6 @@ import java.util.List;
|
||||
@RunWith(DevSdkIgnoreRunner.class)
|
||||
@IgnoreUpTo(SC_V2) // TODO: Use to Build.VERSION_CODES.SC_V2 when available
|
||||
public class CarrierPrivilegeAuthenticatorTest {
|
||||
// TODO : use ConstantsShim.RECEIVER_NOT_EXPORTED when it's available in tests.
|
||||
private static final int RECEIVER_NOT_EXPORTED = 4;
|
||||
private static final int SUBSCRIPTION_COUNT = 2;
|
||||
private static final int TEST_SUBSCRIPTION_ID = 1;
|
||||
|
||||
@@ -117,7 +115,7 @@ public class CarrierPrivilegeAuthenticatorTest {
|
||||
|
||||
private IntentFilter getIntentFilter() {
|
||||
final ArgumentCaptor<IntentFilter> captor = ArgumentCaptor.forClass(IntentFilter.class);
|
||||
verify(mContext).registerReceiver(any(), captor.capture(), any(), any(), anyInt());
|
||||
verify(mContext).registerReceiver(any(), captor.capture(), any(), any());
|
||||
return captor.getValue();
|
||||
}
|
||||
|
||||
@@ -140,11 +138,10 @@ public class CarrierPrivilegeAuthenticatorTest {
|
||||
@Test
|
||||
public void testConstructor() throws Exception {
|
||||
verify(mContext).registerReceiver(
|
||||
eq(mCarrierPrivilegeAuthenticator),
|
||||
any(IntentFilter.class),
|
||||
any(),
|
||||
any(),
|
||||
eq(RECEIVER_NOT_EXPORTED));
|
||||
eq(mCarrierPrivilegeAuthenticator),
|
||||
any(IntentFilter.class),
|
||||
any(),
|
||||
any());
|
||||
final IntentFilter filter = getIntentFilter();
|
||||
assertEquals(1, filter.countActions());
|
||||
assertTrue(filter.hasAction(ACTION_MULTI_SIM_CONFIG_CHANGED));
|
||||
|
||||
Reference in New Issue
Block a user