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

Commit ee061534 authored by Sudheer Shanka's avatar Sudheer Shanka
Browse files

Rename changeIds to follow best practices.

Bug: 371309185
Bug: 371307720
Test: n/a
Flag: NONE mechanical rename with no functional change
Change-Id: I22c8c6d6b3792e6f8f6835e9e4829a19766ecafc
parent ae45633f
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -40,7 +40,7 @@ public final class BroadcastFilter extends IntentFilter {
    @ChangeId
    @EnabledSince(targetSdkVersion = android.os.Build.VERSION_CODES.BASE)
    @VisibleForTesting
    static final long CHANGE_RESTRICT_PRIORITY_VALUES = 371309185L;
    static final long RESTRICT_PRIORITY_VALUES = 371309185L;

    // Back-pointer to the list this filter is in.
    final ReceiverList receiverList;
@@ -130,7 +130,7 @@ public final class BroadcastFilter extends IntentFilter {
            return priority;
        }
        if (!platformCompat.isChangeEnabledByUidInternalNoLogging(
                CHANGE_RESTRICT_PRIORITY_VALUES, owningUid)) {
                RESTRICT_PRIORITY_VALUES, owningUid)) {
            return priority;
        }
        if (!UserHandle.isCore(owningUid)) {
+2 −2
Original line number Diff line number Diff line
@@ -88,7 +88,7 @@ final class BroadcastRecord extends Binder {
    @ChangeId
    @EnabledSince(targetSdkVersion = android.os.Build.VERSION_CODES.BASE)
    @VisibleForTesting
    static final long CHANGE_LIMIT_PRIORITY_SCOPE = 371307720L;
    static final long LIMIT_PRIORITY_SCOPE = 371307720L;

    final @NonNull Intent intent;    // the original intent that generated us
    final @Nullable ComponentName targetComp; // original component name set on the intent
@@ -781,7 +781,7 @@ final class BroadcastRecord extends Binder {
        } else {
            if (Flags.limitPriorityScope()) {
                final boolean[] changeEnabled = calculateChangeStateForReceivers(
                        receivers, CHANGE_LIMIT_PRIORITY_SCOPE, platformCompat);
                        receivers, LIMIT_PRIORITY_SCOPE, platformCompat);

                // Priority of the previous tranche
                int lastTranchePriority = 0;
+2 −2
Original line number Diff line number Diff line
@@ -186,9 +186,9 @@ public abstract class BaseBroadcastQueueTest {
        doReturn(mAppStartInfoTracker).when(mProcessList).getAppStartInfoTracker();

        doReturn(true).when(mPlatformCompat).isChangeEnabledByUidInternalNoLogging(
                eq(BroadcastFilter.CHANGE_RESTRICT_PRIORITY_VALUES), anyInt());
                eq(BroadcastFilter.RESTRICT_PRIORITY_VALUES), anyInt());
        doReturn(true).when(mPlatformCompat).isChangeEnabledByUidInternalNoLogging(
                eq(BroadcastRecord.CHANGE_LIMIT_PRIORITY_SCOPE), anyInt());
                eq(BroadcastRecord.LIMIT_PRIORITY_SCOPE), anyInt());
    }

    public void tearDown() throws Exception {
+4 −4
Original line number Diff line number Diff line
@@ -59,7 +59,7 @@ public class BroadcastFilterTest {
    @EnableFlags(Flags.FLAG_RESTRICT_PRIORITY_VALUES)
    public void testCalculateAdjustedPriority() {
        doReturn(true).when(mPlatformCompat).isChangeEnabledByUidInternalNoLogging(
                eq(BroadcastFilter.CHANGE_RESTRICT_PRIORITY_VALUES), anyInt());
                eq(BroadcastFilter.RESTRICT_PRIORITY_VALUES), anyInt());

        {
            // Pairs of {initial-priority, expected-adjusted-priority}
@@ -96,7 +96,7 @@ public class BroadcastFilterTest {
    @EnableFlags(Flags.FLAG_RESTRICT_PRIORITY_VALUES)
    public void testCalculateAdjustedPriority_withChangeIdDisabled() {
        doReturn(false).when(mPlatformCompat).isChangeEnabledByUidInternalNoLogging(
                eq(BroadcastFilter.CHANGE_RESTRICT_PRIORITY_VALUES), anyInt());
                eq(BroadcastFilter.RESTRICT_PRIORITY_VALUES), anyInt());

        {
            // Pairs of {initial-priority, expected-adjusted-priority}
@@ -133,7 +133,7 @@ public class BroadcastFilterTest {
    @DisableFlags(Flags.FLAG_RESTRICT_PRIORITY_VALUES)
    public void testCalculateAdjustedPriority_withFlagDisabled() {
        doReturn(true).when(mPlatformCompat).isChangeEnabledByUidInternalNoLogging(
                eq(BroadcastFilter.CHANGE_RESTRICT_PRIORITY_VALUES), anyInt());
                eq(BroadcastFilter.RESTRICT_PRIORITY_VALUES), anyInt());

        {
            // Pairs of {initial-priority, expected-adjusted-priority}
@@ -170,7 +170,7 @@ public class BroadcastFilterTest {
    @DisableFlags(Flags.FLAG_RESTRICT_PRIORITY_VALUES)
    public void testCalculateAdjustedPriority_withFlagDisabled_withChangeIdDisabled() {
        doReturn(false).when(mPlatformCompat).isChangeEnabledByUidInternalNoLogging(
                eq(BroadcastFilter.CHANGE_RESTRICT_PRIORITY_VALUES), anyInt());
                eq(BroadcastFilter.RESTRICT_PRIORITY_VALUES), anyInt());

        {
            // Pairs of {initial-priority, expected-adjusted-priority}
+4 −4
Original line number Diff line number Diff line
@@ -717,7 +717,7 @@ public final class BroadcastQueueModernImplTest extends BaseBroadcastQueueTest {
    @Test
    public void testRunnableAt_Cached_Prioritized_NonDeferrable_changeIdDisabled() {
        doReturn(false).when(mPlatformCompat).isChangeEnabledByUidInternalNoLogging(
                eq(BroadcastRecord.CHANGE_LIMIT_PRIORITY_SCOPE),
                eq(BroadcastRecord.LIMIT_PRIORITY_SCOPE),
                eq(getUidForPackage(PACKAGE_GREEN)));
        final List receivers = List.of(
                withPriority(makeManifestReceiver(PACKAGE_RED, PACKAGE_RED), 10),
@@ -1289,7 +1289,7 @@ public final class BroadcastQueueModernImplTest extends BaseBroadcastQueueTest {
    @Test
    public void testDeliveryGroupPolicy_prioritized_diffReceivers_changeIdDisabled() {
        doReturn(false).when(mPlatformCompat).isChangeEnabledByUidInternalNoLogging(
                eq(BroadcastRecord.CHANGE_LIMIT_PRIORITY_SCOPE),
                eq(BroadcastRecord.LIMIT_PRIORITY_SCOPE),
                eq(getUidForPackage(PACKAGE_GREEN)));

        final Intent screenOn = new Intent(Intent.ACTION_SCREEN_ON);
@@ -1824,7 +1824,7 @@ public final class BroadcastQueueModernImplTest extends BaseBroadcastQueueTest {
    @Test
    public void testDeliveryDeferredForCached_changeIdDisabled() throws Exception {
        doReturn(false).when(mPlatformCompat).isChangeEnabledByUidInternalNoLogging(
                eq(BroadcastRecord.CHANGE_LIMIT_PRIORITY_SCOPE),
                eq(BroadcastRecord.LIMIT_PRIORITY_SCOPE),
                eq(getUidForPackage(PACKAGE_GREEN)));

        final ProcessRecord greenProcess = makeProcessRecord(makeApplicationInfo(PACKAGE_GREEN));
@@ -2028,7 +2028,7 @@ public final class BroadcastQueueModernImplTest extends BaseBroadcastQueueTest {
    public void testDeliveryDeferredForCached_withInfiniteDeferred_changeIdDisabled()
            throws Exception {
        doReturn(false).when(mPlatformCompat).isChangeEnabledByUidInternalNoLogging(
                eq(BroadcastRecord.CHANGE_LIMIT_PRIORITY_SCOPE),
                eq(BroadcastRecord.LIMIT_PRIORITY_SCOPE),
                eq(getUidForPackage(PACKAGE_GREEN)));
        final ProcessRecord greenProcess = makeProcessRecord(makeApplicationInfo(PACKAGE_GREEN));
        final ProcessRecord redProcess = makeProcessRecord(makeApplicationInfo(PACKAGE_RED));
Loading