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

Commit 47b581d4 authored by Zak Cohen's avatar Zak Cohen
Browse files

ContentSuggetionsService, don't try and wrap a null graphics buffer.

Test: Ran CTS test
Change-Id: I93143f752e8d0b8a79fdbee038785dd20d26896d
parent 5a9da780
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -60,11 +60,17 @@ public abstract class ContentSuggestionsService extends Service {
        @Override
        public void provideContextImage(int taskId, GraphicBuffer contextImage,
                Bundle imageContextRequestExtras) {

            Bitmap wrappedBuffer = null;
            if (contextImage != null) {
                wrappedBuffer = Bitmap.wrapHardwareBuffer(
                        HardwareBuffer.createFromGraphicBuffer(contextImage), null);
            }

            mHandler.sendMessage(
                    obtainMessage(ContentSuggestionsService::processContextImage,
                            ContentSuggestionsService.this, taskId,
                            Bitmap.wrapHardwareBuffer(
                                    HardwareBuffer.createFromGraphicBuffer(contextImage), null),
                            wrappedBuffer,
                            imageContextRequestExtras));
        }