Commit 8728e6c1 authored by qinmin's avatar qinmin Committed by Commit bot

Check null intent when launching DownloadNotificationService

When onStartCommand() is called, it is possible that the intent is null.
According to the SDK page, service must take care of the null check.

BUG=587399

Review URL: https://codereview.chromium.org/1708913002

Cr-Commit-Position: refs/heads/master@{#376048}
parent 070923b1
...@@ -387,6 +387,7 @@ public class DownloadNotificationService extends Service { ...@@ -387,6 +387,7 @@ public class DownloadNotificationService extends Service {
* @return true if the intent requires actions, or false otherwise. * @return true if the intent requires actions, or false otherwise.
*/ */
static boolean isDownloadOperationIntent(Intent intent) { static boolean isDownloadOperationIntent(Intent intent) {
if (intent == null) return false;
if (!ACTION_DOWNLOAD_CANCEL.equals(intent.getAction()) if (!ACTION_DOWNLOAD_CANCEL.equals(intent.getAction())
&& !ACTION_DOWNLOAD_RESUME.equals(intent.getAction()) && !ACTION_DOWNLOAD_RESUME.equals(intent.getAction())
&& !ACTION_DOWNLOAD_PAUSE.equals(intent.getAction())) { && !ACTION_DOWNLOAD_PAUSE.equals(intent.getAction())) {
......
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