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

Commit 8698d8e9 authored by Makoto Onuki's avatar Makoto Onuki Committed by Automerger Merge Worker
Browse files

Merge "A few changes around SHORT_SERVICE" into udc-dev am: 77c8b4f0

parents 331a0b8d 77c8b4f0
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -439,6 +439,7 @@ message ServiceRecordProto {

        optional int32 id = 1;
        optional .android.app.NotificationProto notification = 2;
        optional int32 foregroundServiceType = 3;
    }
    optional Foreground foreground = 13;

+11 −0
Original line number Diff line number Diff line
@@ -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
+2 −0
Original line number Diff line number Diff line
@@ -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);