Starting with the first build of QPR2 (2024030600), on Pixel 7Pro, we started seeing a foreground service stop working. The foreground service in question maintains an SSE connection to an instance of Nextcloud, and waits for "push" notifications. Prior to QPR2, the process worked perfectly, it would sit there indefinitely waiting for messages, and execute the appropriate responses to incoming messages (notifications mainly). After QPR2, it would only work for the first few seconds after the service was started, and repeatedly throw ANR's up on the screen.

I was able to isolate the failure to an android log message "ActivityManager: freezing (pid) application:service", which hits after 40 seconds.

Documentation (https://source.android.com/docs/core/perf/cached-apps-freezer) indicates that it applies to cached application, and that a foreground service is not cached, so it shouldn't be hitting this service at all. Even worse though, is that once the application has been "frozen", there is nothing at all that can be done to wake it back up, including running startForegroundService on it.

This is the foreground service; https://gitlab.com/Nextcloud-Push/nextcloud-push-notifier/-/blob/master/app/src/main/java/tk/aprax/pushreceiver/NotificationService.java?ref_type=heads

Worked around it by setting use_freezer to false as per the documentation link above, but this should definitely NOT be necessary.

I can't tell if this is an upstream bug or something introduced by GrapheneOS, since I don't have anything running upstream QPR2 to test against.

Anybody else seen anything like this?