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

Commit 34d8bc7c authored by Varun Shah's avatar Varun Shah Committed by Android (Google) Code Review
Browse files

Merge "Update new onTimeout to be called for SHORT_SERVICE." into main

parents d4b83a5e 769668e8
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -1135,6 +1135,9 @@ public abstract class Service extends ContextWrapper implements ComponentCallbac
        } catch (RemoteException ex) {
        }
        onTimeout(startId);
        if (Flags.introduceNewServiceOntimeoutCallback()) {
            onTimeout(startId, ServiceInfo.FOREGROUND_SERVICE_TYPE_SHORT_SERVICE);
        }
    }

    /**
@@ -1146,6 +1149,12 @@ public abstract class Service extends ContextWrapper implements ComponentCallbac
     * doesn't finish even after it's timed out,
     * the app will be declared an ANR after a short grace period of several seconds.
     *
     * <p>Starting from Android version {@link android.os.Build.VERSION_CODES#VANILLA_ICE_CREAM},
     * {@link #onTimeout(int, int)} will also be called when a foreground service of type
     * {@link ServiceInfo#FOREGROUND_SERVICE_TYPE_SHORT_SERVICE} times out.
     * Developers do not need to implement both of the callbacks on
     * {@link android.os.Build.VERSION_CODES#VANILLA_ICE_CREAM} and onwards.
     *
     * <p>Note, even though
     * {@link ServiceInfo#FOREGROUND_SERVICE_TYPE_SHORT_SERVICE}
     * was added