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

Commit b846e83f authored by Satakshi's avatar Satakshi
Browse files

Assert only one bitmap is provided to ContentSuggestionsService.

Test: Took a screenshot and verified that AiAi gets invoked and the screenshot notification
shows smart actions.
Long press in Overview shows smart actions.
Bug: 141634285

Change-Id: I1e82f8bb837b8b032e6d25032642e47f492eb495
parent 7f9474cb
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -64,6 +64,10 @@ public abstract class ContentSuggestionsService extends Service {
        @Override
        public void provideContextImage(int taskId, GraphicBuffer contextImage,
                int colorSpaceId, Bundle imageContextRequestExtras) {
            if (imageContextRequestExtras.containsKey(ContentSuggestionsManager.EXTRA_BITMAP)
                    && contextImage != null) {
                throw new IllegalArgumentException("Two bitmaps provided; expected one.");
            }

            Bitmap wrappedBuffer = null;
            if (imageContextRequestExtras.containsKey(ContentSuggestionsManager.EXTRA_BITMAP)) {