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

Commit 05b4949e authored by Varun Shah's avatar Varun Shah
Browse files

Extend FGS ANR timeout for failure-to-post-notification.

Ensure that we consider the amount of time the process was in a
runnable-but-waiting state before ANRing the app. However, only
allow this grace period as a one time courtesy.

Bug: 296651128
Test: atest ServiceTest
Flag: EXEMPT bugfix
Change-Id: I6bf54c09dbd1e3b9c0b0cf848a166969f3e06e64
parent 168fc188
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -790,7 +790,7 @@ public final class ActiveServices {
                "SHORT_FGS_TIMEOUT");
        this.mServiceFGAnrTimer = new ServiceAnrTimer(service,
                ActivityManagerService.SERVICE_FOREGROUND_TIMEOUT_MSG,
                "SERVICE_FOREGROUND_TIMEOUT");
                "SERVICE_FOREGROUND_TIMEOUT", new AnrTimer.Args().extend(true));
    }

    void systemServicesReady() {
@@ -7702,6 +7702,11 @@ public final class ActiveServices {
            super(Objects.requireNonNull(am).mHandler, msg, label);
        }

        ServiceAnrTimer(ActivityManagerService am, int msg, String label,
                @NonNull AnrTimer.Args args) {
            super(Objects.requireNonNull(am).mHandler, msg, label, args);
        }

        @Override
        public int getPid(@NonNull ServiceRecord service) {
            return (service.app != null) ? service.app.getPid() : 0;