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

Commit a86557c0 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Shell: move foreground service exit after triggering the local notification" into main

parents 5c45ce22 b54afde3
Loading
Loading
Loading
Loading
+8 −5
Original line number Diff line number Diff line
@@ -1220,11 +1220,6 @@ public final class BugreportProgressService extends Service {
                + " and shareDescription: " + info.shareDescription);
        info.finished.set(true);

        synchronized (mLock) {
            // Stop running on foreground, otherwise share notification cannot be dismissed.
            stopForegroundWhenDoneLocked(info.id);
        }

        File bugreportFile = info.bugreportLocationInfo.mBugreportFile;
        if (!info.bugreportLocationInfo.isValidBugreportResult()) {
            Log.e(TAG, "Could not read bugreport file " + bugreportFile);
@@ -1236,6 +1231,14 @@ public final class BugreportProgressService extends Service {
        }

        triggerLocalNotification(info);
        // b/425350942: Stop running on foreground after triggering the local notification.
        // AM re-sends the notification when the service is removed from the foreground.
        // This way, we increase the chances of final notiifcation being sent via AM,
        // rather than the progress one.
        synchronized (mLock) {
            // Stop running on foreground, otherwise share notification cannot be dismissed.
            stopForegroundWhenDoneLocked(info.id);
        }
    }

    /**