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

Commit 5371fce3 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "When importing contacts was interrupted, clear notification." am:...

Merge "When importing contacts was interrupted, clear notification." am: c32f5d52 am: a85e3283 am: 6cb75eb9

Original change: https://android-review.googlesource.com/c/platform/packages/apps/Contacts/+/1341995



Change-Id: I47796958087759a8f58f93db9f5ae025f9849ade
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 988beaa3 6cb75eb9
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@
package com.android.contacts.vcard;

import android.app.Notification;
import android.app.NotificationManager;
import android.app.Service;
import android.content.Intent;
import android.media.MediaScannerConnection;
@@ -129,6 +130,10 @@ public class VCardService extends Service {
                    VCardCommonArguments.ARG_CALLING_ACTIVITY);
        } else {
            mCallingActivity = null;
            // The intent will be null if the service is restarted after the app
            // is killed but the notification may still exist so remove it.
            NotificationManager nm = getSystemService(NotificationManager.class);
            nm.cancelAll();
        }
        return START_STICKY;
    }
@@ -255,6 +260,9 @@ public class VCardService extends Service {
                }
            }
        } else {
            // In case notification of import is still present and app is killed remove it
            NotificationManager nm = getSystemService(NotificationManager.class);
            nm.cancel(NotificationImportExportListener.DEFAULT_NOTIFICATION_TAG, jobId);
            Log.w(LOG_TAG, String.format("Tried to remove unknown job (id: %d)", jobId));
        }
        stopServiceIfAppropriate();