diff options
author | Ronghua Wu <ronghuawu@google.com> | 2015-07-07 16:47:42 -0700 |
---|---|---|
committer | Ronghua Wu <ronghuawu@google.com> | 2015-07-13 15:18:12 -0700 |
commit | 05d89f1c6452b2fce0b9f1315240f8cace69a88d (patch) | |
tree | 32ceb479a4e3f113bf8a08d564535cb4f09383b0 /services/mediaresourcemanager/ResourceManagerService.h | |
parent | dfad5454e0caf46f8732f1415d3b9a76f2a1242e (diff) | |
download | frameworks_av-05d89f1c6452b2fce0b9f1315240f8cace69a88d.zip frameworks_av-05d89f1c6452b2fce0b9f1315240f8cace69a88d.tar.gz frameworks_av-05d89f1c6452b2fce0b9f1315240f8cace69a88d.tar.bz2 |
mediaresourcemanager: handle the case when there's no client holding resource with the same type
Bug: 21171205
Change-Id: Id4aa6ccc7ee7daba25fd295399235c5b463ccd83
Diffstat (limited to 'services/mediaresourcemanager/ResourceManagerService.h')
-rw-r--r-- | services/mediaresourcemanager/ResourceManagerService.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/services/mediaresourcemanager/ResourceManagerService.h b/services/mediaresourcemanager/ResourceManagerService.h index 0d9d878..ca218fc 100644 --- a/services/mediaresourcemanager/ResourceManagerService.h +++ b/services/mediaresourcemanager/ResourceManagerService.h @@ -65,6 +65,9 @@ public: virtual void removeResource(int64_t clientId); + // Tries to reclaim resource from processes with lower priority than the calling process + // according to the requested resources. + // Returns true if any resource has been reclaimed, otherwise returns false. virtual bool reclaimResource(int callingPid, const Vector<MediaResource> &resources); protected: @@ -95,6 +98,11 @@ private: bool isCallingPriorityHigher_l(int callingPid, int pid); + // A helper function basically calls getLowestPriorityBiggestClient_l and add the result client + // to the given Vector. + void getClientForResource_l( + int callingPid, const MediaResource *res, Vector<sp<IResourceManagerClient>> *clients); + mutable Mutex mLock; sp<ProcessInfoInterface> mProcessInfo; sp<ServiceLog> mServiceLog; |