Loading services/core/java/com/android/server/am/ActiveServices.java +12 −12 Original line number Diff line number Diff line Loading @@ -1033,8 +1033,9 @@ public final class ActiveServices { } if (fgRequired) { logFgsBackgroundStart(r); if (!r.isFgsAllowedStart() && isBgFgsRestrictionEnabled(r, callingUid)) { boolean isBgFgsRestrictionEnabledForService = isBgFgsRestrictionEnabled(r, callingUid); logFgsBackgroundStart(r, isBgFgsRestrictionEnabledForService); if (!r.isFgsAllowedStart() && isBgFgsRestrictionEnabledForService) { String msg = "startForegroundService() not allowed due to " + "mAllowStartForeground false: service " + r.shortInstanceName; Loading Loading @@ -2292,8 +2293,10 @@ public final class ActiveServices { } // Whether FGS-BG-start restriction is enabled for this service. final boolean isBgFgsRestrictionEnabledForService = isBgFgsRestrictionEnabled(r, callingUidIfStart); // Valid only if not system initiated tranistion. final boolean isBgFgsRestrictionEnabledForService = (!systemRequestedTransition && isBgFgsRestrictionEnabled(r, callingUidIfStart)); // Whether to extend the SHORT_SERVICE time out. boolean extendShortServiceTimeout = false; Loading Loading @@ -2549,7 +2552,7 @@ public final class ActiveServices { } r.maybeLogFgsLogicChange(); if (!bypassBfslCheck) { logFgsBackgroundStart(r); logFgsBackgroundStart(r, isBgFgsRestrictionEnabledForService); if (!r.isFgsAllowedStart() && isBgFgsRestrictionEnabledForService) { final String msg = "Service.startForeground() not allowed due to " Loading Loading @@ -8984,7 +8987,7 @@ public final class ActiveServices { return true; } private void logFgsBackgroundStart(ServiceRecord r) { private void logFgsBackgroundStart(ServiceRecord r, boolean isBgFgsRestrictedForService) { /* // Only log if FGS is started from background. if (!isFgsBgStart(r.mAllowStartForeground)) { Loading @@ -8993,7 +8996,8 @@ public final class ActiveServices { */ if (!r.mLoggedInfoAllowStartForeground) { final String msg = "Background started FGS: " + (r.isFgsAllowedStart() ? "Allowed " : "Disallowed ") + (r.isFgsAllowedStart() || !isBgFgsRestrictedForService ? "Allowed " : "Disallowed ") + r.mInfoAllowStartForeground + (r.isShortFgs() ? " (Called on SHORT_SERVICE)" : ""); if (r.isFgsAllowedStart()) { Loading @@ -9003,11 +9007,7 @@ public final class ActiveServices { } Slog.i(TAG, msg); } else { //if (ActivityManagerUtils.shouldSamplePackageForAtom(r.packageName, // mAm.mConstants.mFgsStartDeniedLogSampleRate)) { Slog.wtfQuiet(TAG, msg); //} Slog.w(TAG, msg); Slog.wtf(TAG, msg); } r.mLoggedInfoAllowStartForeground = true; } Loading Loading
services/core/java/com/android/server/am/ActiveServices.java +12 −12 Original line number Diff line number Diff line Loading @@ -1033,8 +1033,9 @@ public final class ActiveServices { } if (fgRequired) { logFgsBackgroundStart(r); if (!r.isFgsAllowedStart() && isBgFgsRestrictionEnabled(r, callingUid)) { boolean isBgFgsRestrictionEnabledForService = isBgFgsRestrictionEnabled(r, callingUid); logFgsBackgroundStart(r, isBgFgsRestrictionEnabledForService); if (!r.isFgsAllowedStart() && isBgFgsRestrictionEnabledForService) { String msg = "startForegroundService() not allowed due to " + "mAllowStartForeground false: service " + r.shortInstanceName; Loading Loading @@ -2292,8 +2293,10 @@ public final class ActiveServices { } // Whether FGS-BG-start restriction is enabled for this service. final boolean isBgFgsRestrictionEnabledForService = isBgFgsRestrictionEnabled(r, callingUidIfStart); // Valid only if not system initiated tranistion. final boolean isBgFgsRestrictionEnabledForService = (!systemRequestedTransition && isBgFgsRestrictionEnabled(r, callingUidIfStart)); // Whether to extend the SHORT_SERVICE time out. boolean extendShortServiceTimeout = false; Loading Loading @@ -2549,7 +2552,7 @@ public final class ActiveServices { } r.maybeLogFgsLogicChange(); if (!bypassBfslCheck) { logFgsBackgroundStart(r); logFgsBackgroundStart(r, isBgFgsRestrictionEnabledForService); if (!r.isFgsAllowedStart() && isBgFgsRestrictionEnabledForService) { final String msg = "Service.startForeground() not allowed due to " Loading Loading @@ -8984,7 +8987,7 @@ public final class ActiveServices { return true; } private void logFgsBackgroundStart(ServiceRecord r) { private void logFgsBackgroundStart(ServiceRecord r, boolean isBgFgsRestrictedForService) { /* // Only log if FGS is started from background. if (!isFgsBgStart(r.mAllowStartForeground)) { Loading @@ -8993,7 +8996,8 @@ public final class ActiveServices { */ if (!r.mLoggedInfoAllowStartForeground) { final String msg = "Background started FGS: " + (r.isFgsAllowedStart() ? "Allowed " : "Disallowed ") + (r.isFgsAllowedStart() || !isBgFgsRestrictedForService ? "Allowed " : "Disallowed ") + r.mInfoAllowStartForeground + (r.isShortFgs() ? " (Called on SHORT_SERVICE)" : ""); if (r.isFgsAllowedStart()) { Loading @@ -9003,11 +9007,7 @@ public final class ActiveServices { } Slog.i(TAG, msg); } else { //if (ActivityManagerUtils.shouldSamplePackageForAtom(r.packageName, // mAm.mConstants.mFgsStartDeniedLogSampleRate)) { Slog.wtfQuiet(TAG, msg); //} Slog.w(TAG, msg); Slog.wtf(TAG, msg); } r.mLoggedInfoAllowStartForeground = true; } Loading