summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--media/libstagefright/HTTPDataSource.cpp16
1 files changed, 11 insertions, 5 deletions
diff --git a/media/libstagefright/HTTPDataSource.cpp b/media/libstagefright/HTTPDataSource.cpp
index bf020e9..d79c1bd 100644
--- a/media/libstagefright/HTTPDataSource.cpp
+++ b/media/libstagefright/HTTPDataSource.cpp
@@ -23,13 +23,12 @@
#include <stdlib.h>
+#include <cutils/properties.h>
#include <media/stagefright/HTTPDataSource.h>
#include <media/stagefright/MediaDebug.h>
namespace android {
-static const char *kUserAgent = "stagefright-http";
-
// Given a connected HTTPStream, determine if the given path redirects
// somewhere else, if so, disconnect the stream, update host path and port
// accordingly and return true, otherwise return false and leave the stream
@@ -341,9 +340,16 @@ void HTTPDataSource::initHeaders(
const KeyedVector<String8, String8> *overrides) {
mHeaders = String8();
- mHeaders.append("User-Agent: ");
- mHeaders.append(kUserAgent);
- mHeaders.append("\r\n");
+ mHeaders.append("User-Agent: stagefright/1.0 (Linux;Android ");
+
+#if (PROPERTY_VALUE_MAX < 8)
+#error "PROPERTY_VALUE_MAX must be at least 8"
+#endif
+
+ char value[PROPERTY_VALUE_MAX];
+ property_get("ro.build.version.release", value, "Unknown");
+ mHeaders.append(value);
+ mHeaders.append(")\r\n");
if (overrides == NULL) {
return;