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

Commit b843a7a6 authored by Makoto Onuki's avatar Makoto Onuki Committed by Android (Google) Code Review
Browse files

Merge "Remove the new FGS logic flag." into main

parents 3a1e47dc 6ba069c9
Loading
Loading
Loading
Loading
+5 −11
Original line number Diff line number Diff line
@@ -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;
        }
        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.
        }

+3 −6
Original line number Diff line number Diff line
@@ -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);
    }


+0 −1
Original line number Diff line number Diff line
@@ -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;