diff options
author | Andreas Huber <andih@google.com> | 2011-06-30 15:47:02 -0700 |
---|---|---|
committer | Andreas Huber <andih@google.com> | 2011-07-01 13:18:43 -0700 |
commit | 9b80c2bdb205bc143104f54d0743b6eedd67b14e (patch) | |
tree | 7a035b1bbc67096fa775d41544f420a5eb6e0487 /media/libstagefright/AwesomePlayer.cpp | |
parent | cebcdaef5b559f4db2a9d8b305d9d7da03525b62 (diff) | |
download | frameworks_av-9b80c2bdb205bc143104f54d0743b6eedd67b14e.zip frameworks_av-9b80c2bdb205bc143104f54d0743b6eedd67b14e.tar.gz frameworks_av-9b80c2bdb205bc143104f54d0743b6eedd67b14e.tar.bz2 |
Charge network traffic to the uid of the process using the MediaPlayer.
Change-Id: I2bcb54b8232afd3fc7ee16289f37c7a7b3f23067
related-to-bug: 4517282
Diffstat (limited to 'media/libstagefright/AwesomePlayer.cpp')
-rw-r--r-- | media/libstagefright/AwesomePlayer.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/media/libstagefright/AwesomePlayer.cpp b/media/libstagefright/AwesomePlayer.cpp index aa7edcc..56b28a2 100644 --- a/media/libstagefright/AwesomePlayer.cpp +++ b/media/libstagefright/AwesomePlayer.cpp @@ -180,6 +180,7 @@ void addBatteryData(uint32_t params) { //////////////////////////////////////////////////////////////////////////////// AwesomePlayer::AwesomePlayer() : mQueueStarted(false), + mUIDValid(false), mTimeSource(NULL), mVideoRendererIsPreview(false), mAudioPlayer(NULL), @@ -243,6 +244,13 @@ void AwesomePlayer::setListener(const wp<MediaPlayerBase> &listener) { mListener = listener; } +void AwesomePlayer::setUID(uid_t uid) { + LOGI("AwesomePlayer running on behalf of uid %d", uid); + + mUID = uid; + mUIDValid = true; +} + status_t AwesomePlayer::setDataSource( const char *uri, const KeyedVector<String8, String8> *headers) { Mutex::Autolock autoLock(mLock); @@ -1928,6 +1936,10 @@ status_t AwesomePlayer::finishSetDataSource_l() { ? HTTPBase::kFlagIncognito : 0); + if (mUIDValid) { + mConnectingDataSource->setUID(mUID); + } + mLock.unlock(); status_t err = mConnectingDataSource->connect(mUri, &mUriHeaders); mLock.lock(); @@ -2009,6 +2021,10 @@ status_t AwesomePlayer::finishSetDataSource_l() { mRTSPController = new ARTSPController(mLooper); mConnectingRTSPController = mRTSPController; + if (mUIDValid) { + mConnectingRTSPController->setUID(mUID); + } + mLock.unlock(); status_t err = mRTSPController->connect(mUri.string()); mLock.lock(); |