Skip to content
This repository has been archived by the owner on Jul 30, 2022. It is now read-only.

Commit

Permalink
RIO-6947: Retrieve PLATFORM from system properties for user agent str…
Browse files Browse the repository at this point in the history
…ing.
  • Loading branch information
Jianhong Jiang committed Jul 8, 2009
1 parent e347172 commit 6db6388
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion android/playerdriver.cpp
Expand Up @@ -701,7 +701,20 @@ void PlayerDriver::handleInit(PlayerInit* command)

int error = 0;
iKVPSetAsync.key = _STRLIT_CHAR("x-pvmf/net/user-agent;valtype=wchar*");
OSCL_wHeapString<OsclMemAllocator> userAgent = _STRLIT_WCHAR("CORE/6.506.4.1 OpenCORE/2.02 (Linux;Android 2.0)(AndroidMediaPlayer 2.0)");
OSCL_wHeapString<OsclMemAllocator> userAgent = _STRLIT_WCHAR("CORE/6.506.4.1 OpenCORE/2.02 (Linux;Android ");

#if (PROPERTY_VALUE_MAX < 8)
#error "PROPERTY_VALUE_MAX must be at least 8"
#endif
char value[PROPERTY_VALUE_MAX];
int len = property_get("ro.build.version.release", value, "Unknown");
if (len) {
LOGV("release string is %s len %d", value, len);
oscl_wchar output[len+ 1];
oscl_UTF8ToUnicode(value, len, output, len+1);
userAgent += output;
}
userAgent += _STRLIT_WCHAR(")");
iKVPSetAsync.value.pWChar_value=userAgent.get_str();
iErrorKVP=NULL;
OSCL_TRY(error, mPlayerCapConfig->setParametersSync(NULL, &iKVPSetAsync, 1, iErrorKVP));
Expand Down

0 comments on commit 6db6388

Please sign in to comment.