Cancel dialog before stopping service.

Fixes: 30746086

Change-Id: Iea8a197a2785259dd80aa8130d79ded484562826
diff --git a/packages/Shell/src/com/android/shell/BugreportProgressService.java b/packages/Shell/src/com/android/shell/BugreportProgressService.java
index 5d23b07..18c7dbe 100644
--- a/packages/Shell/src/com/android/shell/BugreportProgressService.java
+++ b/packages/Shell/src/com/android/shell/BugreportProgressService.java
@@ -556,6 +556,7 @@
     private void cancel(int id) {
         MetricsLogger.action(this, MetricsEvent.ACTION_BUGREPORT_NOTIFICATION_ACTION_CANCEL);
         Log.v(TAG, "cancel: ID=" + id);
+        mInfoDialog.cancel();
         final BugreportInfo info = getInfo(id);
         if (info != null && !info.finished) {
             Log.i(TAG, "Cancelling bugreport service (ID=" + id + ") on user's request");
@@ -563,7 +564,6 @@
             deleteScreenshots(info);
         }
         stopProgress(id);
-        mInfoDialog.cancel();
     }
 
     /**