summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGloria Wang <gwang@google.com>2011-03-17 15:02:34 -0700
committerGloria Wang <gwang@google.com>2011-03-17 15:02:34 -0700
commit79cbc13ede26d08ab6633a042843a9d154c3c166 (patch)
treea8b76f1d3645ae4ca581415b9f4b34b8e0aa2765
parentc901f74404435cc1cf2717016e2b0092b6dcea24 (diff)
downloadframeworks_av-79cbc13ede26d08ab6633a042843a9d154c3c166.zip
frameworks_av-79cbc13ede26d08ab6633a042843a9d154c3c166.tar.gz
frameworks_av-79cbc13ede26d08ab6633a042843a9d154c3c166.tar.bz2
Fix for bug 4126103.
mMessage in DrmInfoEvent is a reference to the message string, so the temporary message created in the plugin was going out of scope and being destructed while the message was being sent. Changed DrmInfoEvent's mMessage to be const String8 instead of const String8& Change-Id: I174197ad24f3df997d3bc1f897658cfc53862636
-rw-r--r--drm/common/DrmInfoEvent.cpp4
-rw-r--r--include/drm/DrmInfoEvent.h6
2 files changed, 5 insertions, 5 deletions
diff --git a/drm/common/DrmInfoEvent.cpp b/drm/common/DrmInfoEvent.cpp
index 8d115a8..27a5a2d 100644
--- a/drm/common/DrmInfoEvent.cpp
+++ b/drm/common/DrmInfoEvent.cpp
@@ -19,7 +19,7 @@
using namespace android;
-DrmInfoEvent::DrmInfoEvent(int uniqueId, int infoType, const String8& message)
+DrmInfoEvent::DrmInfoEvent(int uniqueId, int infoType, const String8 message)
: mUniqueId(uniqueId),
mInfoType(infoType),
mMessage(message) {
@@ -34,7 +34,7 @@ int DrmInfoEvent::getType() const {
return mInfoType;
}
-const String8& DrmInfoEvent::getMessage() const {
+const String8 DrmInfoEvent::getMessage() const {
return mMessage;
}
diff --git a/include/drm/DrmInfoEvent.h b/include/drm/DrmInfoEvent.h
index add33d3..dfca228 100644
--- a/include/drm/DrmInfoEvent.h
+++ b/include/drm/DrmInfoEvent.h
@@ -77,7 +77,7 @@ public:
* @param[in] infoType Type of information
* @param[in] message Message description
*/
- DrmInfoEvent(int uniqueId, int infoType, const String8& message);
+ DrmInfoEvent(int uniqueId, int infoType, const String8 message);
/**
* Destructor for DrmInfoEvent
@@ -104,12 +104,12 @@ public:
*
* @return Message description
*/
- const String8& getMessage() const;
+ const String8 getMessage() const;
private:
int mUniqueId;
int mInfoType;
- const String8& mMessage;
+ const String8 mMessage;
};
};