Merge "Move FGS while-in-use log message." into sc-dev am: ac769c4d7d am: 9d06f57436

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14709457

Change-Id: Id23766b2ee4afee1999b685f8e50e151868e355a
This commit is contained in:
TreeHugger Robot
2021-05-25 18:41:43 +00:00
committed by Automerger Merge Worker

View File

@@ -1706,14 +1706,6 @@ public final class ActiveServices {
+ String.format("0x%08X", manifestType) + String.format("0x%08X", manifestType)
+ " in service element of manifest file"); + " in service element of manifest file");
} }
// If the foreground service is not started from TOP process, do not allow it to
// have while-in-use location/camera/microphone access.
if (!r.mAllowWhileInUsePermissionInFgs) {
Slog.w(TAG,
"Foreground service started from background can not have "
+ "location/camera/microphone access: service "
+ r.shortInstanceName);
}
} }
boolean alreadyStartedOp = false; boolean alreadyStartedOp = false;
@@ -1802,6 +1794,14 @@ public final class ActiveServices {
r.appInfo.uid, r.intent.getIntent(), r, r.userId,false); r.appInfo.uid, r.intent.getIntent(), r, r.userId,false);
} }
} }
// If the foreground service is not started from TOP process, do not allow it to
// have while-in-use location/camera/microphone access.
if (!r.mAllowWhileInUsePermissionInFgs) {
Slog.w(TAG,
"Foreground service started from background can not have "
+ "location/camera/microphone access: service "
+ r.shortInstanceName);
}
logFgsBackgroundStart(r); logFgsBackgroundStart(r);
if (r.mAllowStartForeground == REASON_DENIED && isBgFgsRestrictionEnabled(r)) { if (r.mAllowStartForeground == REASON_DENIED && isBgFgsRestrictionEnabled(r)) {
final String msg = "Service.startForeground() not allowed due to " final String msg = "Service.startForeground() not allowed due to "