diff options
3 files changed, 8 insertions, 18 deletions
diff --git a/services/core/java/com/android/server/am/ActiveServices.java b/services/core/java/com/android/server/am/ActiveServices.java index 41b4cbd9e074..6cca7d16842a 100644 --- a/services/core/java/com/android/server/am/ActiveServices.java +++ b/services/core/java/com/android/server/am/ActiveServices.java @@ -8950,18 +8950,12 @@ public final class ActiveServices { if (!mAm.mConstants.mFgsStartRestrictionCheckCallerTargetSdk) { return true; // In this case, we only check the service's target SDK level. } - final int callingUid; - if (Flags.newFgsRestrictionLogic()) { - // We always consider SYSTEM_UID to target S+, so just enable the restrictions. - if (actualCallingUid == Process.SYSTEM_UID) { - return true; - } - callingUid = actualCallingUid; - } else { - // Legacy logic used mRecentCallingUid. - callingUid = r.mRecentCallingUid; + // We always consider SYSTEM_UID to target S+, so just enable the restrictions. + if (actualCallingUid == Process.SYSTEM_UID) { + return true; } - if (!CompatChanges.isChangeEnabled(FGS_BG_START_RESTRICTION_CHANGE_ID, callingUid)) { + if (!CompatChanges.isChangeEnabled(FGS_BG_START_RESTRICTION_CHANGE_ID, + actualCallingUid)) { return false; // If the caller targets < S, then we still disable the restrictions. } diff --git a/services/core/java/com/android/server/am/ServiceRecord.java b/services/core/java/com/android/server/am/ServiceRecord.java index 92d33c9eae56..ca34a13c55b1 100644 --- a/services/core/java/com/android/server/am/ServiceRecord.java +++ b/services/core/java/com/android/server/am/ServiceRecord.java @@ -278,24 +278,21 @@ final class ServiceRecord extends Binder implements ComponentName.WithComponentN * Whether to use the new "while-in-use permission" logic for FGS start */ private boolean useNewWiuLogic_forStart() { - return Flags.newFgsRestrictionLogic() // This flag should only be set on V+ - && CompatChanges.isChangeEnabled(USE_NEW_WIU_LOGIC_FOR_START, appInfo.uid); + return CompatChanges.isChangeEnabled(USE_NEW_WIU_LOGIC_FOR_START, appInfo.uid); } /** * Whether to use the new "while-in-use permission" logic for capabilities */ private boolean useNewWiuLogic_forCapabilities() { - return Flags.newFgsRestrictionLogic() // This flag should only be set on V+ - && CompatChanges.isChangeEnabled(USE_NEW_WIU_LOGIC_FOR_CAPABILITIES, appInfo.uid); + return CompatChanges.isChangeEnabled(USE_NEW_WIU_LOGIC_FOR_CAPABILITIES, appInfo.uid); } /** * Whether to use the new "FGS BG start exemption" logic. */ private boolean useNewBfslLogic() { - return Flags.newFgsRestrictionLogic() // This flag should only be set on V+ - && CompatChanges.isChangeEnabled(USE_NEW_BFSL_LOGIC, appInfo.uid); + return CompatChanges.isChangeEnabled(USE_NEW_BFSL_LOGIC, appInfo.uid); } diff --git a/services/tests/mockingservicestests/src/com/android/server/am/MockingOomAdjusterTests.java b/services/tests/mockingservicestests/src/com/android/server/am/MockingOomAdjusterTests.java index 9e96800ca2e9..4a09802fc822 100644 --- a/services/tests/mockingservicestests/src/com/android/server/am/MockingOomAdjusterTests.java +++ b/services/tests/mockingservicestests/src/com/android/server/am/MockingOomAdjusterTests.java @@ -258,7 +258,6 @@ public class MockingOomAdjusterTests { mService.mOomAdjuster = mService.mProcessStateController.getOomAdjuster(); mService.mOomAdjuster.mAdjSeq = 10000; mService.mWakefulness = new AtomicInteger(PowerManagerInternal.WAKEFULNESS_AWAKE); - mSetFlagsRule.enableFlags(Flags.FLAG_NEW_FGS_RESTRICTION_LOGIC); mUiTierSize = mService.mConstants.TIERED_CACHED_ADJ_UI_TIER_SIZE; mFirstNonUiCachedAdj = sFirstUiCachedAdj + mUiTierSize; |