Revert "base: Fixup! SystemUI: screenshot: Add delete action chip intent"

This reverts commit 7b65467b93cad13e2dea5737a5839b98d97e7a77.

prepare for a15 QPR1

Change-Id: Icac0e095a9e92cf07d2d276ab443c04a6fbe9341
diff --git a/packages/SystemUI/src/com/android/systemui/screenshot/SaveImageInBackgroundTask.java b/packages/SystemUI/src/com/android/systemui/screenshot/SaveImageInBackgroundTask.java
index 6a21b92..4914409 100644
--- a/packages/SystemUI/src/com/android/systemui/screenshot/SaveImageInBackgroundTask.java
+++ b/packages/SystemUI/src/com/android/systemui/screenshot/SaveImageInBackgroundTask.java
@@ -28,7 +28,6 @@
 import android.content.Context;
 import android.content.Intent;
 import android.graphics.Bitmap;
-import android.graphics.drawable.Icon;
 import android.net.Uri;
 import android.os.AsyncTask;
 import android.os.Bundle;
@@ -40,7 +39,6 @@
 import com.android.internal.annotations.VisibleForTesting;
 import com.android.internal.config.sysui.SystemUiDeviceConfigFlags;
 import com.android.systemui.flags.FeatureFlags;
-import com.android.systemui.res.R;
 
 import com.google.common.util.concurrent.ListenableFuture;
 
@@ -166,7 +164,6 @@
             mImageData.quickShareAction = createQuickShareAction(
                     mQuickShareData.quickShareAction, mScreenshotId, uri, mImageTime, image,
                     mParams.owner);
-            mImageData.deleteAction = createDeleteAction(uri, smartActionsEnabled);
             mImageData.subject = getSubjectString(mImageTime);
             mImageData.imageTime = mImageTime;
 
@@ -289,29 +286,6 @@
                 .build();
     }
 
-    @VisibleForTesting
-    Notification.Action createDeleteAction(Uri uri, boolean smartActionsEnabled) {
-        // Make sure pending intents for the system user are still unique across users
-        // by setting the (otherwise unused) request code to the current user id.
-        int requestCode = mContext.getUserId();
-
-        // Create a delete action for the notification
-        Intent wrappedIntent = new Intent(mContext, DeleteScreenshotReceiver.class)
-                       .putExtra(ScreenshotController.SCREENSHOT_URI_ID, uri.toString())
-                       .putExtra(ScreenshotController.EXTRA_ID, mScreenshotId)
-                       .putExtra(ScreenshotController.EXTRA_SMART_ACTIONS_ENABLED,
-                               smartActionsEnabled)
-                       .addFlags(Intent.FLAG_RECEIVER_FOREGROUND);
-        PendingIntent deleteAction = PendingIntent.getBroadcast(mContext, requestCode, wrappedIntent,
-               PendingIntent.FLAG_CANCEL_CURRENT
-                       | PendingIntent.FLAG_ONE_SHOT
-                       | PendingIntent.FLAG_IMMUTABLE);
-        Notification.Action.Builder deleteActionBuilder = new Notification.Action.Builder(
-               Icon.createWithResource(mContext.getResources(), R.drawable.ic_screenshot_delete),
-               mContext.getResources().getString(com.android.internal.R.string.delete), deleteAction);
-        return deleteActionBuilder.build();
-    }
-
     private Intent createFillInIntent(Uri uri, long imageTime) {
         Intent fillIn = new Intent();
         fillIn.setType("image/png");
diff --git a/packages/SystemUI/src/com/android/systemui/screenshot/ScreenshotController.java b/packages/SystemUI/src/com/android/systemui/screenshot/ScreenshotController.java
index 9799abe..c87b1f5 100644
--- a/packages/SystemUI/src/com/android/systemui/screenshot/ScreenshotController.java
+++ b/packages/SystemUI/src/com/android/systemui/screenshot/ScreenshotController.java
@@ -126,7 +126,6 @@
     public static class SavedImageData {
         public Uri uri;
         public List<Notification.Action> smartActions;
-        public Notification.Action deleteAction;
         public Notification.Action quickShareAction;
         public UserHandle owner;
         public String subject;  // Title for sharing
@@ -139,7 +138,6 @@
             uri = null;
             smartActions = null;
             quickShareAction = null;
-            deleteAction = null;
             subject = null;
             imageTime = null;
         }
diff --git a/packages/SystemUI/src/com/android/systemui/screenshot/ScreenshotView.java b/packages/SystemUI/src/com/android/systemui/screenshot/ScreenshotView.java
index 31ca5bb..e8a5a44 100644
--- a/packages/SystemUI/src/com/android/systemui/screenshot/ScreenshotView.java
+++ b/packages/SystemUI/src/com/android/systemui/screenshot/ScreenshotView.java
@@ -812,12 +812,10 @@
                     ActionIntentCreator.INSTANCE.createEdit(imageData.uri, mContext),
                     imageData.owner, true);
         });
-        if (imageData.deleteAction != null) {
-            mDeleteChip.setPendingIntent(imageData.deleteAction.actionIntent, () -> {
-                mUiEventLogger.log(ScreenshotEvent.SCREENSHOT_DELETE_TAPPED);
-                animateDismissal();
-            });
-        }
+        mDeleteChip.setPendingIntent(imageData.deleteAction.actionIntent, () -> {
+            mUiEventLogger.log(ScreenshotEvent.SCREENSHOT_DELETE_TAPPED);
+            animateDismissal();
+        });
         mScreenshotPreview.setOnClickListener(v -> {
             mUiEventLogger.log(ScreenshotEvent.SCREENSHOT_PREVIEW_TAPPED, 0, mPackageName);
             prepareSharedTransition();