summaryrefslogtreecommitdiffstats
path: root/services/mediaresourcemanager/ResourceManagerService.h
diff options
context:
space:
mode:
Diffstat (limited to 'services/mediaresourcemanager/ResourceManagerService.h')
-rw-r--r--services/mediaresourcemanager/ResourceManagerService.h8
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;