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

Commit 3f1a2f87 authored by Song Hu's avatar Song Hu
Browse files

Pass Intent as additional parameter in...

Pass Intent as additional parameter in ContentSuggestionsServiceClient#notifyAction. This allows QuickShareProcessor to report share event in notifyInteraction. SystemUI side change.

Test: test on local device
Bug: 185423664
Change-Id: I40d9dd159694c1e03569f77a2d1090b4b42502da
parent 0ec65b00
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -88,7 +88,7 @@ public class ActionProxyReceiver extends BroadcastReceiver {
                    ? ACTION_TYPE_EDIT
                    ? ACTION_TYPE_EDIT
                    : ACTION_TYPE_SHARE;
                    : ACTION_TYPE_SHARE;
            mScreenshotSmartActions.notifyScreenshotAction(
            mScreenshotSmartActions.notifyScreenshotAction(
                    context, intent.getStringExtra(EXTRA_ID), actionType, false);
                    context, intent.getStringExtra(EXTRA_ID), actionType, false, null);
        }
        }
    }
    }
}
}
+1 −1
Original line number Original line Diff line number Diff line
@@ -62,7 +62,7 @@ public class DeleteScreenshotReceiver extends BroadcastReceiver {
        });
        });
        if (intent.getBooleanExtra(EXTRA_SMART_ACTIONS_ENABLED, false)) {
        if (intent.getBooleanExtra(EXTRA_SMART_ACTIONS_ENABLED, false)) {
            mScreenshotSmartActions.notifyScreenshotAction(
            mScreenshotSmartActions.notifyScreenshotAction(
                    context, intent.getStringExtra(EXTRA_ID), ACTION_TYPE_DELETE, false);
                    context, intent.getStringExtra(EXTRA_ID), ACTION_TYPE_DELETE, false, null);
        }
        }
    }
    }
}
}
+3 −1
Original line number Original line Diff line number Diff line
@@ -21,6 +21,7 @@ import static com.android.systemui.screenshot.LogConfig.logTag;


import android.app.Notification;
import android.app.Notification;
import android.content.ComponentName;
import android.content.ComponentName;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.Bitmap;
import android.net.Uri;
import android.net.Uri;
import android.os.UserHandle;
import android.os.UserHandle;
@@ -107,7 +108,8 @@ public class ScreenshotNotificationSmartActionsProvider {
     * @param action        type of notification action invoked.
     * @param action        type of notification action invoked.
     * @param isSmartAction whether action invoked was a smart action.
     * @param isSmartAction whether action invoked was a smart action.
     */
     */
    public void notifyAction(String screenshotId, String action, boolean isSmartAction) {
    public void notifyAction(String screenshotId, String action, boolean isSmartAction,
            Intent intent) {
        if (DEBUG_ACTIONS) {
        if (DEBUG_ACTIONS) {
            Log.d(TAG, "SmartActions: notifyAction: return without notify");
            Log.d(TAG, "SmartActions: notifyAction: return without notify");
        }
        }
+3 −2
Original line number Original line Diff line number Diff line
@@ -26,6 +26,7 @@ import android.app.ActivityManager;
import android.app.Notification;
import android.app.Notification;
import android.content.ComponentName;
import android.content.ComponentName;
import android.content.Context;
import android.content.Context;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.Bitmap;
import android.net.Uri;
import android.net.Uri;
import android.os.Handler;
import android.os.Handler;
@@ -165,7 +166,7 @@ public class ScreenshotSmartActions {
    }
    }


    void notifyScreenshotAction(Context context, String screenshotId, String action,
    void notifyScreenshotAction(Context context, String screenshotId, String action,
            boolean isSmartAction) {
            boolean isSmartAction, Intent intent) {
        try {
        try {
            ScreenshotNotificationSmartActionsProvider provider =
            ScreenshotNotificationSmartActionsProvider provider =
                    SystemUIFactory.getInstance().createScreenshotNotificationSmartActionsProvider(
                    SystemUIFactory.getInstance().createScreenshotNotificationSmartActionsProvider(
@@ -174,7 +175,7 @@ public class ScreenshotSmartActions {
                Log.d(TAG, String.format("%s notifyAction: %s id=%s, isSmartAction=%b",
                Log.d(TAG, String.format("%s notifyAction: %s id=%s, isSmartAction=%b",
                        provider.getClass(), action, screenshotId, isSmartAction));
                        provider.getClass(), action, screenshotId, isSmartAction));
            }
            }
            provider.notifyAction(screenshotId, action, isSmartAction);
            provider.notifyAction(screenshotId, action, isSmartAction, intent);
        } catch (Throwable e) {
        } catch (Throwable e) {
            Log.e(TAG, "Error in notifyScreenshotAction: ", e);
            Log.e(TAG, "Error in notifyScreenshotAction: ", e);
        }
        }
+2 −1
Original line number Original line Diff line number Diff line
@@ -60,6 +60,7 @@ public class SmartActionsReceiver extends BroadcastReceiver {
        }
        }


        mScreenshotSmartActions.notifyScreenshotAction(
        mScreenshotSmartActions.notifyScreenshotAction(
                context, intent.getStringExtra(EXTRA_ID), actionType, true);
                context, intent.getStringExtra(EXTRA_ID), actionType, true,
                pendingIntent.getIntent());
    }
    }
}
}
Loading