Commit 1be8a3ba authored by Xing Liu's avatar Xing Liu Committed by Commit Bot

Download notification: Fix a crash that startForeground is not called.

If stopForeground is called between startForegroundService and
startForeground. startForeground will not be called since we clear the
cached service object. This will lead to a crash on O_MR1+.

Android can reuse the service binder object when this happens.

Bug: 1121096
Change-Id: Ic4088af174ca9561714442b29c2e6162995ddc51
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2429635Reviewed-by: default avatarDavid Trainor <dtrainor@chromium.org>
Commit-Queue: Xing Liu <xingliu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#810857}
parent 94bbe3a7
...@@ -276,7 +276,6 @@ public class DownloadForegroundServiceManager { ...@@ -276,7 +276,6 @@ public class DownloadForegroundServiceManager {
stopAndUnbindServiceInternal( stopAndUnbindServiceInternal(
stopForegroundNotification, mPinnedNotificationId, oldNotification); stopForegroundNotification, mPinnedNotificationId, oldNotification);
mBoundService = null;
mPinnedNotificationId = INVALID_NOTIFICATION_ID; mPinnedNotificationId = INVALID_NOTIFICATION_ID;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment