Loading services/core/java/com/android/server/am/BroadcastFilter.java +2 −2 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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)) { Loading services/core/java/com/android/server/am/BroadcastRecord.java +2 −2 Original line number Diff line number Diff line Loading @@ -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 Loading Loading @@ -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; Loading services/tests/mockingservicestests/src/com/android/server/am/BaseBroadcastQueueTest.java +2 −2 Original line number Diff line number Diff line Loading @@ -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 { Loading services/tests/mockingservicestests/src/com/android/server/am/BroadcastFilterTest.java +4 −4 Original line number Diff line number Diff line Loading @@ -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} Loading Loading @@ -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} Loading Loading @@ -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} Loading Loading @@ -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} Loading services/tests/mockingservicestests/src/com/android/server/am/BroadcastQueueModernImplTest.java +4 −4 Original line number Diff line number Diff line Loading @@ -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), Loading Loading @@ -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); Loading Loading @@ -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)); Loading Loading @@ -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 Loading
services/core/java/com/android/server/am/BroadcastFilter.java +2 −2 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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)) { Loading
services/core/java/com/android/server/am/BroadcastRecord.java +2 −2 Original line number Diff line number Diff line Loading @@ -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 Loading Loading @@ -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; Loading
services/tests/mockingservicestests/src/com/android/server/am/BaseBroadcastQueueTest.java +2 −2 Original line number Diff line number Diff line Loading @@ -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 { Loading
services/tests/mockingservicestests/src/com/android/server/am/BroadcastFilterTest.java +4 −4 Original line number Diff line number Diff line Loading @@ -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} Loading Loading @@ -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} Loading Loading @@ -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} Loading Loading @@ -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} Loading
services/tests/mockingservicestests/src/com/android/server/am/BroadcastQueueModernImplTest.java +4 −4 Original line number Diff line number Diff line Loading @@ -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), Loading Loading @@ -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); Loading Loading @@ -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)); Loading Loading @@ -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