Merge "Add logcat message for background started FGS." into rvc-dev am: 274ce4442a am: 6e4f802c62

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

Change-Id: If2fe5525038ef87ca0d5b8c2b78f2f49b60e2fd9
This commit is contained in:
Hui Yu
2020-07-16 21:05:21 +00:00
committed by Automerger Merge Worker

View File

@@ -18,7 +18,6 @@ package com.android.server.am;
import static android.Manifest.permission.START_ACTIVITIES_FROM_BACKGROUND; import static android.Manifest.permission.START_ACTIVITIES_FROM_BACKGROUND;
import static android.content.pm.PackageManager.PERMISSION_GRANTED; import static android.content.pm.PackageManager.PERMISSION_GRANTED;
import static android.content.pm.ServiceInfo.FOREGROUND_SERVICE_TYPE_LOCATION;
import static android.content.pm.ServiceInfo.FOREGROUND_SERVICE_TYPE_MANIFEST; import static android.content.pm.ServiceInfo.FOREGROUND_SERVICE_TYPE_MANIFEST;
import static android.os.Process.NFC_UID; import static android.os.Process.NFC_UID;
import static android.os.Process.ROOT_UID; import static android.os.Process.ROOT_UID;
@@ -1361,13 +1360,12 @@ 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 ((foregroundServiceType & FOREGROUND_SERVICE_TYPE_LOCATION) != 0 // If the foreground service is not started from TOP process, do not allow it to
&& !r.mAllowWhileInUsePermissionInFgs) { // have while-in-use location/camera/microphone access.
// If the foreground service is not started from TOP process, do not allow it to if (!r.mAllowWhileInUsePermissionInFgs) {
// have location capability, this prevents BG started FGS to have while-in-use
// location permission.
Slog.w(TAG, Slog.w(TAG,
"BG started FGS can not have location capability: service " "Foreground service started from background can not have "
+ "location/camera/microphone access: service "
+ r.shortInstanceName); + r.shortInstanceName);
} }
} }