diff options
author | Jeff Tinker <jtinker@google.com> | 2013-08-30 23:05:00 +0000 |
---|---|---|
committer | Jeff Tinker <jtinker@google.com> | 2013-09-03 10:15:01 -0700 |
commit | 4585e8f0ff47580fdb81ed8652bde32db1770050 (patch) | |
tree | 6aa5196aef1b75edc79199065ad825c26da64533 /drm/common | |
parent | e45a767e13fe3396185c9d378a70f7f11eb881d0 (diff) | |
download | frameworks_av-4585e8f0ff47580fdb81ed8652bde32db1770050.zip frameworks_av-4585e8f0ff47580fdb81ed8652bde32db1770050.tar.gz frameworks_av-4585e8f0ff47580fdb81ed8652bde32db1770050.tar.bz2 |
Revert "Enhancement for OnInfo callback on DRM Framework"
This reverts commit 5ff7836da0220b3097f36c8a5e82111816ebca62.
Fixes Fatal signal 6 (SIGABRT)" when playing or downloading a video
bug: 10542864
Change-Id: I7f81a41c3acdbeb571a514b3f65e7ba37d403cca
Diffstat (limited to 'drm/common')
-rw-r--r-- | drm/common/DrmInfoEvent.cpp | 92 | ||||
-rw-r--r-- | drm/common/IDrmServiceListener.cpp | 32 |
2 files changed, 2 insertions, 122 deletions
diff --git a/drm/common/DrmInfoEvent.cpp b/drm/common/DrmInfoEvent.cpp index 2315aa9..27a5a2d 100644 --- a/drm/common/DrmInfoEvent.cpp +++ b/drm/common/DrmInfoEvent.cpp @@ -16,29 +16,16 @@ #include <utils/String8.h> #include <drm/DrmInfoEvent.h> -#include <stdlib.h> using namespace android; DrmInfoEvent::DrmInfoEvent(int uniqueId, int infoType, const String8 message) : mUniqueId(uniqueId), mInfoType(infoType), - mMessage(message), - mDrmBuffer() { + mMessage(message) { } -DrmInfoEvent::DrmInfoEvent(int uniqueId, int infoType, const String8 message, - const DrmBuffer& drmBuffer) - : mUniqueId(uniqueId), mInfoType(infoType), mMessage(message), mDrmBuffer() { - setData(drmBuffer); -} - -DrmInfoEvent::~DrmInfoEvent() { - delete [] mDrmBuffer.data; -} - - int DrmInfoEvent::getUniqueId() const { return mUniqueId; } @@ -51,80 +38,3 @@ const String8 DrmInfoEvent::getMessage() const { return mMessage; } -int DrmInfoEvent::getCount() const { - return mAttributes.size(); -} - -status_t DrmInfoEvent::put(const String8& key, String8& value) { - mAttributes.add(key, value); - return DRM_NO_ERROR; -} - -const String8 DrmInfoEvent::get(const String8& key) const { - if (mAttributes.indexOfKey(key) != NAME_NOT_FOUND) { - return mAttributes.valueFor(key); - } - return String8(""); -} - -const DrmBuffer& DrmInfoEvent::getData() const { - return mDrmBuffer; -} - -void DrmInfoEvent::setData(const DrmBuffer& drmBuffer) { - delete [] mDrmBuffer.data; - mDrmBuffer.data = new char[drmBuffer.length];; - mDrmBuffer.length = drmBuffer.length; - memcpy(mDrmBuffer.data, drmBuffer.data, drmBuffer.length); -} - -DrmInfoEvent::KeyIterator DrmInfoEvent::keyIterator() const { - return KeyIterator(this); -} - -DrmInfoEvent::Iterator DrmInfoEvent::iterator() const { - return Iterator(this); -} - -// KeyIterator implementation -DrmInfoEvent::KeyIterator::KeyIterator(const DrmInfoEvent::KeyIterator& keyIterator) - : mDrmInfoEvent(keyIterator.mDrmInfoEvent), mIndex(keyIterator.mIndex) { -} - -bool DrmInfoEvent::KeyIterator::hasNext() { - return (mIndex < mDrmInfoEvent->mAttributes.size()); -} - -const String8& DrmInfoEvent::KeyIterator::next() { - const String8& key = mDrmInfoEvent->mAttributes.keyAt(mIndex); - mIndex++; - return key; -} - -DrmInfoEvent::KeyIterator& DrmInfoEvent::KeyIterator::operator=( - const DrmInfoEvent::KeyIterator& keyIterator) { - mDrmInfoEvent = keyIterator.mDrmInfoEvent; - mIndex = keyIterator.mIndex; - return *this; -} - -// Iterator implementation -DrmInfoEvent::Iterator::Iterator(const DrmInfoEvent::Iterator& iterator) - : mDrmInfoEvent(iterator.mDrmInfoEvent), mIndex(iterator.mIndex) { -} - -DrmInfoEvent::Iterator& DrmInfoEvent::Iterator::operator=(const DrmInfoEvent::Iterator& iterator) { - mDrmInfoEvent = iterator.mDrmInfoEvent; - mIndex = iterator.mIndex; - return *this; -} - -bool DrmInfoEvent::Iterator::hasNext() { - return mIndex < mDrmInfoEvent->mAttributes.size(); -} - -const String8& DrmInfoEvent::Iterator::next() { - const String8& value = mDrmInfoEvent->mAttributes.editValueAt(mIndex); - mIndex++; - return value; -} diff --git a/drm/common/IDrmServiceListener.cpp b/drm/common/IDrmServiceListener.cpp index d825afb..6eeea40 100644 --- a/drm/common/IDrmServiceListener.cpp +++ b/drm/common/IDrmServiceListener.cpp @@ -32,19 +32,6 @@ status_t BpDrmServiceListener::notify(const DrmInfoEvent& event) { data.writeInt32(event.getType()); data.writeString8(event.getMessage()); - data.writeInt32(event.getCount()); - DrmInfoEvent::KeyIterator keyIt = event.keyIterator(); - while (keyIt.hasNext()) { - String8 key = keyIt.next(); - data.writeString8(key); - data.writeString8(event.get(key)); - } - const DrmBuffer& value = event.getData(); - data.writeInt32(value.length); - if (value.length > 0) { - data.write(value.data, value.length); - } - remote()->transact(NOTIFY, data, &reply); return reply.readInt32(); } @@ -62,24 +49,7 @@ status_t BnDrmServiceListener::onTransact( int type = data.readInt32(); const String8& message = data.readString8(); - DrmInfoEvent event(uniqueId, type, message); - int size = data.readInt32(); - for (int index = 0; index < size; index++) { - String8 key(data.readString8()); - String8 value(data.readString8()); - event.put(key, value); - } - int valueSize = data.readInt32(); - if (valueSize > 0) { - char* valueData = new char[valueSize]; - data.read(valueData, valueSize); - DrmBuffer drmBuffer(valueData, valueSize); - event.setData(drmBuffer); - delete[] valueData; - } - - status_t status = notify(event); - + status_t status = notify(DrmInfoEvent(uniqueId, type, message)); reply->writeInt32(status); return DRM_NO_ERROR; |