Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 62c6955c authored by Michael Groover's avatar Michael Groover
Browse files

Revert "Explicitly mark receivers as RECEIVER_NOT_EXPORTED"

This reverts commit 2e0cba87.

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: I86489db999cf8256519fdae13e1b107f2d465edf
parent 2e0cba87
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -73,8 +73,7 @@ public class DataConnectionStats extends BroadcastReceiver {

        IntentFilter filter = new IntentFilter();
        filter.addAction(Intent.ACTION_SIM_STATE_CHANGED);
        mContext.registerReceiver(this, filter, null /* broadcastPermission */, mListenerHandler,
                Context.RECEIVER_NOT_EXPORTED);
        mContext.registerReceiver(this, filter, null /* broadcastPermission */, mListenerHandler);
    }

    @Override
+1 −1
Original line number Diff line number Diff line
@@ -146,7 +146,7 @@ public class TelephonySubscriptionTracker extends BroadcastReceiver {
        filter.addAction(ACTION_CARRIER_CONFIG_CHANGED);
        filter.addAction(ACTION_MULTI_SIM_CONFIG_CHANGED);

        mContext.registerReceiver(this, filter, null, mHandler, Context.RECEIVER_NOT_EXPORTED);
        mContext.registerReceiver(this, filter, null, mHandler);
        mSubscriptionManager.addOnSubscriptionsChangedListener(
                executor, mSubscriptionChangedListener);
        mTelephonyManager.registerTelephonyCallback(executor, mActiveDataSubIdListener);
+2 −3
Original line number Diff line number Diff line
@@ -174,7 +174,7 @@ public class TelephonySubscriptionTrackerTest {

    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();
    }
@@ -258,8 +258,7 @@ public class TelephonySubscriptionTrackerTest {
                        eq(mTelephonySubscriptionTracker),
                        any(IntentFilter.class),
                        any(),
                        eq(mHandler),
                        eq(Context.RECEIVER_NOT_EXPORTED));
                        eq(mHandler));
        final IntentFilter filter = getIntentFilter();
        assertEquals(2, filter.countActions());
        assertTrue(filter.hasAction(ACTION_CARRIER_CONFIG_CHANGED));