Respect channel mask in ACodec and NuPlayer.

Refactor conversion from MetaData into AMessage while we're at it.

Change-Id: I5479129836ea4316e8de28cf1b472bf19e3ac4ab
related-to-bug: 6439076
diff --git a/include/media/stagefright/ACodec.h b/include/media/stagefright/ACodec.h
index 72827c1..7536d10 100644
--- a/include/media/stagefright/ACodec.h
+++ b/include/media/stagefright/ACodec.h
@@ -121,8 +121,6 @@
     sp<ExecutingToIdleState> mExecutingToIdleState;
     sp<IdleToLoadedState> mIdleToLoadedState;
     sp<FlushingState> mFlushingState;
-    int32_t mEncoderDelay;
-    int32_t mEncoderPadding;
     sp<SkipCutBuffer> mSkipCutBuffer;
 
     AString mComponentName;
@@ -149,6 +147,12 @@
     // and do not release the component instance.
     bool mKeepComponentAllocated;
 
+    int32_t mEncoderDelay;
+    int32_t mEncoderPadding;
+
+    bool mChannelMaskPresent;
+    int32_t mChannelMask;
+
     status_t allocateBuffersOnPort(OMX_U32 portIndex);
     status_t freeBuffersOnPort(OMX_U32 portIndex);
     status_t freeBuffer(OMX_U32 portIndex, size_t i);
diff --git a/include/media/stagefright/Utils.h b/include/media/stagefright/Utils.h
index 498b525..d87902e 100644
--- a/include/media/stagefright/Utils.h
+++ b/include/media/stagefright/Utils.h
@@ -19,6 +19,8 @@
 #define UTILS_H_
 
 #include <stdint.h>
+#include <utils/Errors.h>
+#include <utils/RefBase.h>
 
 namespace android {
 
@@ -36,6 +38,11 @@
 uint64_t ntoh64(uint64_t x);
 uint64_t hton64(uint64_t x);
 
+struct MetaData;
+struct AMessage;
+status_t convertMetaDataToMessage(
+        const sp<MetaData> &meta, sp<AMessage> *format);
+
 }  // namespace android
 
 #endif  // UTILS_H_
diff --git a/media/libmediaplayerservice/nuplayer/NuPlayer.cpp b/media/libmediaplayerservice/nuplayer/NuPlayer.cpp
index 2a770cd..86e122f 100644
--- a/media/libmediaplayerservice/nuplayer/NuPlayer.cpp
+++ b/media/libmediaplayerservice/nuplayer/NuPlayer.cpp
@@ -375,10 +375,15 @@
                         flags = AUDIO_OUTPUT_FLAG_NONE;
                     }
 
+                    int32_t channelMask;
+                    if (!codecRequest->findInt32("channel-mask", &channelMask)) {
+                        channelMask = CHANNEL_MASK_USE_CHANNEL_ORDER;
+                    }
+
                     CHECK_EQ(mAudioSink->open(
                                 sampleRate,
                                 numChannels,
-                                CHANNEL_MASK_USE_CHANNEL_ORDER,
+                                (audio_channel_mask_t)channelMask,
                                 AUDIO_FORMAT_PCM_16_BIT,
                                 8 /* bufferCount */,
                                 NULL,
diff --git a/media/libmediaplayerservice/nuplayer/NuPlayerDecoder.cpp b/media/libmediaplayerservice/nuplayer/NuPlayerDecoder.cpp
index d18d146..0e53662 100644
--- a/media/libmediaplayerservice/nuplayer/NuPlayerDecoder.cpp
+++ b/media/libmediaplayerservice/nuplayer/NuPlayerDecoder.cpp
@@ -103,157 +103,17 @@
 sp<AMessage> NuPlayer::Decoder::makeFormat(const sp<MetaData> &meta) {
     CHECK(mCSD.isEmpty());
 
-    const char *mime;
-    CHECK(meta->findCString(kKeyMIMEType, &mime));
-
-    sp<AMessage> msg = new AMessage;
-    msg->setString("mime", mime);
-
-    if (!strncasecmp("video/", mime, 6)) {
-        int32_t width, height;
-        CHECK(meta->findInt32(kKeyWidth, &width));
-        CHECK(meta->findInt32(kKeyHeight, &height));
-
-        msg->setInt32("width", width);
-        msg->setInt32("height", height);
-    } else if (!strncasecmp("audio/", mime, 6)) {
-        int32_t numChannels, sampleRate;
-        CHECK(meta->findInt32(kKeyChannelCount, &numChannels));
-        CHECK(meta->findInt32(kKeySampleRate, &sampleRate));
-
-        msg->setInt32("channel-count", numChannels);
-        msg->setInt32("sample-rate", sampleRate);
-
-        int32_t delay = 0;
-        if (meta->findInt32(kKeyEncoderDelay, &delay)) {
-            msg->setInt32("encoder-delay", delay);
-        }
-        int32_t padding = 0;
-        if (meta->findInt32(kKeyEncoderPadding, &padding)) {
-            msg->setInt32("encoder-padding", padding);
-        }
-
-        int32_t isADTS;
-        if (meta->findInt32(kKeyIsADTS, &isADTS) && isADTS != 0) {
-            msg->setInt32("is-adts", true);
-        }
-    }
-
-    int32_t maxInputSize;
-    if (meta->findInt32(kKeyMaxInputSize, &maxInputSize)) {
-        msg->setInt32("max-input-size", maxInputSize);
-    }
+    sp<AMessage> msg;
+    CHECK_EQ(convertMetaDataToMessage(meta, &msg), (status_t)OK);
 
     mCSDIndex = 0;
-
-    uint32_t type;
-    const void *data;
-    size_t size;
-    if (meta->findData(kKeyAVCC, &type, &data, &size)) {
-        // Parse the AVCDecoderConfigurationRecord
-
-        const uint8_t *ptr = (const uint8_t *)data;
-
-        CHECK(size >= 7);
-        CHECK_EQ((unsigned)ptr[0], 1u);  // configurationVersion == 1
-        uint8_t profile = ptr[1];
-        uint8_t level = ptr[3];
-
-        // There is decodable content out there that fails the following
-        // assertion, let's be lenient for now...
-        // CHECK((ptr[4] >> 2) == 0x3f);  // reserved
-
-        size_t lengthSize = 1 + (ptr[4] & 3);
-
-        // commented out check below as H264_QVGA_500_NO_AUDIO.3gp
-        // violates it...
-        // CHECK((ptr[5] >> 5) == 7);  // reserved
-
-        size_t numSeqParameterSets = ptr[5] & 31;
-
-        ptr += 6;
-        size -= 6;
-
-        sp<ABuffer> buffer = new ABuffer(1024);
-        buffer->setRange(0, 0);
-
-        for (size_t i = 0; i < numSeqParameterSets; ++i) {
-            CHECK(size >= 2);
-            size_t length = U16_AT(ptr);
-
-            ptr += 2;
-            size -= 2;
-
-            CHECK(size >= length);
-
-            memcpy(buffer->data() + buffer->size(), "\x00\x00\x00\x01", 4);
-            memcpy(buffer->data() + buffer->size() + 4, ptr, length);
-            buffer->setRange(0, buffer->size() + 4 + length);
-
-            ptr += length;
-            size -= length;
+    for (size_t i = 0;; ++i) {
+        sp<ABuffer> csd;
+        if (!msg->findBuffer(StringPrintf("csd-%d", i).c_str(), &csd)) {
+            break;
         }
 
-        buffer->meta()->setInt32("csd", true);
-        mCSD.push(buffer);
-
-        buffer = new ABuffer(1024);
-        buffer->setRange(0, 0);
-
-        CHECK(size >= 1);
-        size_t numPictureParameterSets = *ptr;
-        ++ptr;
-        --size;
-
-        for (size_t i = 0; i < numPictureParameterSets; ++i) {
-            CHECK(size >= 2);
-            size_t length = U16_AT(ptr);
-
-            ptr += 2;
-            size -= 2;
-
-            CHECK(size >= length);
-
-            memcpy(buffer->data() + buffer->size(), "\x00\x00\x00\x01", 4);
-            memcpy(buffer->data() + buffer->size() + 4, ptr, length);
-            buffer->setRange(0, buffer->size() + 4 + length);
-
-            ptr += length;
-            size -= length;
-        }
-
-        buffer->meta()->setInt32("csd", true);
-        mCSD.push(buffer);
-    } else if (meta->findData(kKeyESDS, &type, &data, &size)) {
-        ESDS esds((const char *)data, size);
-        CHECK_EQ(esds.InitCheck(), (status_t)OK);
-
-        const void *codec_specific_data;
-        size_t codec_specific_data_size;
-        esds.getCodecSpecificInfo(
-                &codec_specific_data, &codec_specific_data_size);
-
-        sp<ABuffer> buffer = new ABuffer(codec_specific_data_size);
-
-        memcpy(buffer->data(), codec_specific_data,
-               codec_specific_data_size);
-
-        buffer->meta()->setInt32("csd", true);
-        mCSD.push(buffer);
-    } else if (meta->findData(kKeyVorbisInfo, &type, &data, &size)) {
-        sp<ABuffer> buffer = new ABuffer(size);
-        memcpy(buffer->data(), data, size);
-
-        buffer->meta()->setInt32("csd", true);
-        mCSD.push(buffer);
-
-        CHECK(meta->findData(kKeyVorbisBooks, &type, &data, &size));
-
-        buffer = new ABuffer(size);
-        memcpy(buffer->data(), data, size);
-
-        buffer->meta()->setInt32("csd", true);
-        mCSD.push(buffer);
+        mCSD.push(csd);
     }
 
     return msg;
diff --git a/media/libstagefright/ACodec.cpp b/media/libstagefright/ACodec.cpp
index 0de2d0a..7d99064 100644
--- a/media/libstagefright/ACodec.cpp
+++ b/media/libstagefright/ACodec.cpp
@@ -333,7 +333,11 @@
       mNode(NULL),
       mSentFormat(false),
       mIsEncoder(false),
-      mShutdownInProgress(false) {
+      mShutdownInProgress(false),
+      mEncoderDelay(0),
+      mEncoderPadding(0),
+      mChannelMaskPresent(false),
+      mChannelMask(0) {
     mUninitializedState = new UninitializedState(this);
     mLoadedState = new LoadedState(this);
     mLoadedToIdleState = new LoadedToIdleState(this);
@@ -892,10 +896,17 @@
     if (!msg->findInt32("encoder-delay", &mEncoderDelay)) {
         mEncoderDelay = 0;
     }
+
     if (!msg->findInt32("encoder-padding", &mEncoderPadding)) {
         mEncoderPadding = 0;
     }
 
+    if (msg->findInt32("channel-mask", &mChannelMask)) {
+        mChannelMaskPresent = true;
+    } else {
+        mChannelMaskPresent = false;
+    }
+
     int32_t maxInputSize;
     if (msg->findInt32("max-input-size", &maxInputSize)) {
         err = setMinBufferSize(kPortIndexInput, (size_t)maxInputSize);
@@ -2021,6 +2032,11 @@
                 mSkipCutBuffer = new SkipCutBuffer(mEncoderDelay * frameSize,
                                                    mEncoderPadding * frameSize);
             }
+
+            if (mChannelMaskPresent) {
+                notify->setInt32("channel-mask", mChannelMask);
+            }
+
             break;
         }
 
diff --git a/media/libstagefright/NuMediaExtractor.cpp b/media/libstagefright/NuMediaExtractor.cpp
index d6075cd..cfe4773 100644
--- a/media/libstagefright/NuMediaExtractor.cpp
+++ b/media/libstagefright/NuMediaExtractor.cpp
@@ -193,174 +193,7 @@
     }
 
     sp<MetaData> meta = mImpl->getTrackMetaData(index);
-
-    const char *mime;
-    CHECK(meta->findCString(kKeyMIMEType, &mime));
-
-    sp<AMessage> msg = new AMessage;
-    msg->setString("mime", mime);
-
-    int64_t durationUs;
-    if (meta->findInt64(kKeyDuration, &durationUs)) {
-        msg->setInt64("durationUs", durationUs);
-    }
-
-    if (!strncasecmp("video/", mime, 6)) {
-        int32_t width, height;
-        CHECK(meta->findInt32(kKeyWidth, &width));
-        CHECK(meta->findInt32(kKeyHeight, &height));
-
-        msg->setInt32("width", width);
-        msg->setInt32("height", height);
-    } else if (!strncasecmp("audio/", mime, 6)) {
-        int32_t numChannels, sampleRate;
-        CHECK(meta->findInt32(kKeyChannelCount, &numChannels));
-        CHECK(meta->findInt32(kKeySampleRate, &sampleRate));
-
-        msg->setInt32("channel-count", numChannels);
-        msg->setInt32("sample-rate", sampleRate);
-
-        int32_t delay = 0;
-        if (meta->findInt32(kKeyEncoderDelay, &delay)) {
-            msg->setInt32("encoder-delay", delay);
-        }
-        int32_t padding = 0;
-        if (meta->findInt32(kKeyEncoderPadding, &padding)) {
-            msg->setInt32("encoder-padding", padding);
-        }
-
-        int32_t isADTS;
-        if (meta->findInt32(kKeyIsADTS, &isADTS)) {
-            msg->setInt32("is-adts", true);
-        }
-    }
-
-    int32_t maxInputSize;
-    if (meta->findInt32(kKeyMaxInputSize, &maxInputSize)) {
-        msg->setInt32("max-input-size", maxInputSize);
-    }
-
-    uint32_t type;
-    const void *data;
-    size_t size;
-    if (meta->findData(kKeyAVCC, &type, &data, &size)) {
-        // Parse the AVCDecoderConfigurationRecord
-
-        const uint8_t *ptr = (const uint8_t *)data;
-
-        CHECK(size >= 7);
-        CHECK_EQ((unsigned)ptr[0], 1u);  // configurationVersion == 1
-        uint8_t profile = ptr[1];
-        uint8_t level = ptr[3];
-
-        // There is decodable content out there that fails the following
-        // assertion, let's be lenient for now...
-        // CHECK((ptr[4] >> 2) == 0x3f);  // reserved
-
-        size_t lengthSize = 1 + (ptr[4] & 3);
-
-        // commented out check below as H264_QVGA_500_NO_AUDIO.3gp
-        // violates it...
-        // CHECK((ptr[5] >> 5) == 7);  // reserved
-
-        size_t numSeqParameterSets = ptr[5] & 31;
-
-        ptr += 6;
-        size -= 6;
-
-        sp<ABuffer> buffer = new ABuffer(1024);
-        buffer->setRange(0, 0);
-
-        for (size_t i = 0; i < numSeqParameterSets; ++i) {
-            CHECK(size >= 2);
-            size_t length = U16_AT(ptr);
-
-            ptr += 2;
-            size -= 2;
-
-            CHECK(size >= length);
-
-            memcpy(buffer->data() + buffer->size(), "\x00\x00\x00\x01", 4);
-            memcpy(buffer->data() + buffer->size() + 4, ptr, length);
-            buffer->setRange(0, buffer->size() + 4 + length);
-
-            ptr += length;
-            size -= length;
-        }
-
-        buffer->meta()->setInt32("csd", true);
-        buffer->meta()->setInt64("timeUs", 0);
-
-        msg->setBuffer("csd-0", buffer);
-
-        buffer = new ABuffer(1024);
-        buffer->setRange(0, 0);
-
-        CHECK(size >= 1);
-        size_t numPictureParameterSets = *ptr;
-        ++ptr;
-        --size;
-
-        for (size_t i = 0; i < numPictureParameterSets; ++i) {
-            CHECK(size >= 2);
-            size_t length = U16_AT(ptr);
-
-            ptr += 2;
-            size -= 2;
-
-            CHECK(size >= length);
-
-            memcpy(buffer->data() + buffer->size(), "\x00\x00\x00\x01", 4);
-            memcpy(buffer->data() + buffer->size() + 4, ptr, length);
-            buffer->setRange(0, buffer->size() + 4 + length);
-
-            ptr += length;
-            size -= length;
-        }
-
-        buffer->meta()->setInt32("csd", true);
-        buffer->meta()->setInt64("timeUs", 0);
-        msg->setBuffer("csd-1", buffer);
-    } else if (meta->findData(kKeyESDS, &type, &data, &size)) {
-        ESDS esds((const char *)data, size);
-        CHECK_EQ(esds.InitCheck(), (status_t)OK);
-
-        const void *codec_specific_data;
-        size_t codec_specific_data_size;
-        esds.getCodecSpecificInfo(
-                &codec_specific_data, &codec_specific_data_size);
-
-        sp<ABuffer> buffer = new ABuffer(codec_specific_data_size);
-
-        memcpy(buffer->data(), codec_specific_data,
-               codec_specific_data_size);
-
-        buffer->meta()->setInt32("csd", true);
-        buffer->meta()->setInt64("timeUs", 0);
-        msg->setBuffer("csd-0", buffer);
-    } else if (meta->findData(kKeyVorbisInfo, &type, &data, &size)) {
-        sp<ABuffer> buffer = new ABuffer(size);
-        memcpy(buffer->data(), data, size);
-
-        buffer->meta()->setInt32("csd", true);
-        buffer->meta()->setInt64("timeUs", 0);
-        msg->setBuffer("csd-0", buffer);
-
-        if (!meta->findData(kKeyVorbisBooks, &type, &data, &size)) {
-            return -EINVAL;
-        }
-
-        buffer = new ABuffer(size);
-        memcpy(buffer->data(), data, size);
-
-        buffer->meta()->setInt32("csd", true);
-        buffer->meta()->setInt64("timeUs", 0);
-        msg->setBuffer("csd-1", buffer);
-    }
-
-    *format = msg;
-
-    return OK;
+    return convertMetaDataToMessage(meta, format);
 }
 
 status_t NuMediaExtractor::selectTrack(size_t index) {
diff --git a/media/libstagefright/Utils.cpp b/media/libstagefright/Utils.cpp
index c563ce6..2a16f66 100644
--- a/media/libstagefright/Utils.cpp
+++ b/media/libstagefright/Utils.cpp
@@ -14,8 +14,18 @@
  * limitations under the License.
  */
 
+//#define LOG_NDEBUG 0
+#define LOG_TAG "Utils"
+#include <utils/Log.h>
+
+#include "include/ESDS.h"
+
 #include <arpa/inet.h>
 
+#include <media/stagefright/foundation/ABuffer.h>
+#include <media/stagefright/foundation/ADebug.h>
+#include <media/stagefright/foundation/AMessage.h>
+#include <media/stagefright/MetaData.h>
 #include <media/stagefright/Utils.h>
 
 namespace android {
@@ -53,5 +63,183 @@
     return ((uint64_t)htonl(x & 0xffffffff) << 32) | htonl(x >> 32);
 }
 
+status_t convertMetaDataToMessage(
+        const sp<MetaData> &meta, sp<AMessage> *format) {
+    format->clear();
+
+    const char *mime;
+    CHECK(meta->findCString(kKeyMIMEType, &mime));
+
+    sp<AMessage> msg = new AMessage;
+    msg->setString("mime", mime);
+
+    int64_t durationUs;
+    if (meta->findInt64(kKeyDuration, &durationUs)) {
+        msg->setInt64("durationUs", durationUs);
+    }
+
+    if (!strncasecmp("video/", mime, 6)) {
+        int32_t width, height;
+        CHECK(meta->findInt32(kKeyWidth, &width));
+        CHECK(meta->findInt32(kKeyHeight, &height));
+
+        msg->setInt32("width", width);
+        msg->setInt32("height", height);
+    } else if (!strncasecmp("audio/", mime, 6)) {
+        int32_t numChannels, sampleRate;
+        CHECK(meta->findInt32(kKeyChannelCount, &numChannels));
+        CHECK(meta->findInt32(kKeySampleRate, &sampleRate));
+
+        msg->setInt32("channel-count", numChannels);
+        msg->setInt32("sample-rate", sampleRate);
+
+        int32_t channelMask;
+        if (meta->findInt32(kKeyChannelMask, &channelMask)) {
+            msg->setInt32("channel-mask", channelMask);
+        }
+
+        int32_t delay = 0;
+        if (meta->findInt32(kKeyEncoderDelay, &delay)) {
+            msg->setInt32("encoder-delay", delay);
+        }
+        int32_t padding = 0;
+        if (meta->findInt32(kKeyEncoderPadding, &padding)) {
+            msg->setInt32("encoder-padding", padding);
+        }
+
+        int32_t isADTS;
+        if (meta->findInt32(kKeyIsADTS, &isADTS)) {
+            msg->setInt32("is-adts", true);
+        }
+    }
+
+    int32_t maxInputSize;
+    if (meta->findInt32(kKeyMaxInputSize, &maxInputSize)) {
+        msg->setInt32("max-input-size", maxInputSize);
+    }
+
+    uint32_t type;
+    const void *data;
+    size_t size;
+    if (meta->findData(kKeyAVCC, &type, &data, &size)) {
+        // Parse the AVCDecoderConfigurationRecord
+
+        const uint8_t *ptr = (const uint8_t *)data;
+
+        CHECK(size >= 7);
+        CHECK_EQ((unsigned)ptr[0], 1u);  // configurationVersion == 1
+        uint8_t profile = ptr[1];
+        uint8_t level = ptr[3];
+
+        // There is decodable content out there that fails the following
+        // assertion, let's be lenient for now...
+        // CHECK((ptr[4] >> 2) == 0x3f);  // reserved
+
+        size_t lengthSize = 1 + (ptr[4] & 3);
+
+        // commented out check below as H264_QVGA_500_NO_AUDIO.3gp
+        // violates it...
+        // CHECK((ptr[5] >> 5) == 7);  // reserved
+
+        size_t numSeqParameterSets = ptr[5] & 31;
+
+        ptr += 6;
+        size -= 6;
+
+        sp<ABuffer> buffer = new ABuffer(1024);
+        buffer->setRange(0, 0);
+
+        for (size_t i = 0; i < numSeqParameterSets; ++i) {
+            CHECK(size >= 2);
+            size_t length = U16_AT(ptr);
+
+            ptr += 2;
+            size -= 2;
+
+            CHECK(size >= length);
+
+            memcpy(buffer->data() + buffer->size(), "\x00\x00\x00\x01", 4);
+            memcpy(buffer->data() + buffer->size() + 4, ptr, length);
+            buffer->setRange(0, buffer->size() + 4 + length);
+
+            ptr += length;
+            size -= length;
+        }
+
+        buffer->meta()->setInt32("csd", true);
+        buffer->meta()->setInt64("timeUs", 0);
+
+        msg->setBuffer("csd-0", buffer);
+
+        buffer = new ABuffer(1024);
+        buffer->setRange(0, 0);
+
+        CHECK(size >= 1);
+        size_t numPictureParameterSets = *ptr;
+        ++ptr;
+        --size;
+
+        for (size_t i = 0; i < numPictureParameterSets; ++i) {
+            CHECK(size >= 2);
+            size_t length = U16_AT(ptr);
+
+            ptr += 2;
+            size -= 2;
+
+            CHECK(size >= length);
+
+            memcpy(buffer->data() + buffer->size(), "\x00\x00\x00\x01", 4);
+            memcpy(buffer->data() + buffer->size() + 4, ptr, length);
+            buffer->setRange(0, buffer->size() + 4 + length);
+
+            ptr += length;
+            size -= length;
+        }
+
+        buffer->meta()->setInt32("csd", true);
+        buffer->meta()->setInt64("timeUs", 0);
+        msg->setBuffer("csd-1", buffer);
+    } else if (meta->findData(kKeyESDS, &type, &data, &size)) {
+        ESDS esds((const char *)data, size);
+        CHECK_EQ(esds.InitCheck(), (status_t)OK);
+
+        const void *codec_specific_data;
+        size_t codec_specific_data_size;
+        esds.getCodecSpecificInfo(
+                &codec_specific_data, &codec_specific_data_size);
+
+        sp<ABuffer> buffer = new ABuffer(codec_specific_data_size);
+
+        memcpy(buffer->data(), codec_specific_data,
+               codec_specific_data_size);
+
+        buffer->meta()->setInt32("csd", true);
+        buffer->meta()->setInt64("timeUs", 0);
+        msg->setBuffer("csd-0", buffer);
+    } else if (meta->findData(kKeyVorbisInfo, &type, &data, &size)) {
+        sp<ABuffer> buffer = new ABuffer(size);
+        memcpy(buffer->data(), data, size);
+
+        buffer->meta()->setInt32("csd", true);
+        buffer->meta()->setInt64("timeUs", 0);
+        msg->setBuffer("csd-0", buffer);
+
+        if (!meta->findData(kKeyVorbisBooks, &type, &data, &size)) {
+            return -EINVAL;
+        }
+
+        buffer = new ABuffer(size);
+        memcpy(buffer->data(), data, size);
+
+        buffer->meta()->setInt32("csd", true);
+        buffer->meta()->setInt64("timeUs", 0);
+        msg->setBuffer("csd-1", buffer);
+    }
+
+    *format = msg;
+
+    return OK;
+}
+
 }  // namespace android