Merge "A few changes around SHORT_SERVICE" into udc-dev
This commit is contained in:
@@ -439,6 +439,7 @@ message ServiceRecordProto {
|
||||
|
||||
optional int32 id = 1;
|
||||
optional .android.app.NotificationProto notification = 2;
|
||||
optional int32 foregroundServiceType = 3;
|
||||
}
|
||||
optional Foreground foreground = 13;
|
||||
|
||||
|
||||
@@ -2092,6 +2092,17 @@ public final class ActiveServices {
|
||||
r.appInfo.uid, r.intent.getIntent(), r, r.userId,
|
||||
BackgroundStartPrivileges.NONE,
|
||||
false /* isBindService */);
|
||||
if (r.mAllowStartForeground == REASON_DENIED) {
|
||||
Slog.w(TAG_SERVICE, "FGS type change to/from SHORT_SERVICE: "
|
||||
+ " BFSL DENIED.");
|
||||
} else {
|
||||
if (DEBUG_SHORT_SERVICE) {
|
||||
Slog.w(TAG_SERVICE, "FGS type change to/from SHORT_SERVICE: "
|
||||
+ " BFSL Allowed: "
|
||||
+ PowerExemptionManager.reasonCodeToString(
|
||||
r.mAllowStartForeground));
|
||||
}
|
||||
}
|
||||
|
||||
final boolean fgsStartAllowed =
|
||||
!isBgFgsRestrictionEnabledForService
|
||||
|
||||
@@ -468,6 +468,8 @@ final class ServiceRecord extends Binder implements ComponentName.WithComponentN
|
||||
long fgToken = proto.start(ServiceRecordProto.FOREGROUND);
|
||||
proto.write(ServiceRecordProto.Foreground.ID, foregroundId);
|
||||
foregroundNoti.dumpDebug(proto, ServiceRecordProto.Foreground.NOTIFICATION);
|
||||
proto.write(ServiceRecordProto.Foreground.FOREGROUND_SERVICE_TYPE,
|
||||
foregroundServiceType);
|
||||
proto.end(fgToken);
|
||||
}
|
||||
ProtoUtils.toDuration(proto, ServiceRecordProto.CREATE_REAL_TIME, createRealTime, nowReal);
|
||||
|
||||
Reference in New Issue
Block a user