codec2: a workaround to solve backward compatibility issue

As framework change depends on HAL change . In those platforms only
have framework change, the empty work couldn't be handled properly.
Then the result C2_NOT_FOUND will be returned and framework will report
a fatal error to client. We have to avoid such dependency issue

CRs-Fixed: 2916108

Change-Id: I5270f5e2bd1922b84fb34364bb4cb8522ff389ec
diff --git a/media/codec2/sfplugin/CCodecBufferChannel.cpp b/media/codec2/sfplugin/CCodecBufferChannel.cpp
index d67a876..81f68cd 100644
--- a/media/codec2/sfplugin/CCodecBufferChannel.cpp
+++ b/media/codec2/sfplugin/CCodecBufferChannel.cpp
@@ -2409,6 +2409,12 @@
     if (work->result == C2_OK){
         notifyClient = true;
     } else if (work->result == C2_NOT_FOUND) {
+        if (work->input.flags & C2FrameData::FLAG_DROP_FRAME) {
+            // NOTE: This is to solve backward compatibility issue of queueDummyWork. If no HAL fix,
+            //       we will receive C2_NOT_FOUND here and then issue fatal error to MediaCodec
+            ALOGV("[%s] empty work returned; omitted.", mName);
+            return false; // omitted
+        }
         ALOGD("[%s] flushed work; ignored.", mName);
     } else {
         // C2_OK and C2_NOT_FOUND are the only results that we accept for processing