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

Commit e9a8ffd9 authored by Jing Ji's avatar Jing Ji Committed by Android (Google) Code Review
Browse files

Merge "Move the boot_completed FGS check" into main

parents 3f6fad2a 9f27842a
Loading
Loading
Loading
Loading
+6 −5
Original line number Diff line number Diff line
@@ -2118,11 +2118,6 @@ public final class ActiveServices {
                // anyway, so we just remove the SHORT_SERVICE type.
                foregroundServiceType &= ~FOREGROUND_SERVICE_TYPE_SHORT_SERVICE;
            }
            if (!shouldAllowBootCompletedStart(r, foregroundServiceType)) {
                throw new ForegroundServiceStartNotAllowedException("FGS type "
                        + ServiceInfo.foregroundServiceTypeToLabel(foregroundServiceType)
                        + " not allowed to start from BOOT_COMPLETED!");
            }

            boolean alreadyStartedOp = false;
            boolean stopProcStatsOp = false;
@@ -2137,6 +2132,12 @@ public final class ActiveServices {
                mServiceFGAnrTimer.cancel(r);
            }

            if (!shouldAllowBootCompletedStart(r, foregroundServiceType)) {
                throw new ForegroundServiceStartNotAllowedException("FGS type "
                        + ServiceInfo.foregroundServiceTypeToLabel(foregroundServiceType)
                        + " not allowed to start from BOOT_COMPLETED!");
            }

            final ProcessServiceRecord psr = r.app.mServices;
            try {
                boolean ignoreForeground = false;