Ronghua Wu | 231c3d1 | 2015-03-11 15:10:32 -0700 | [diff] [blame] | 1 | /* |
| 2 | ** |
| 3 | ** Copyright 2015, The Android Open Source Project |
| 4 | ** |
| 5 | ** Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | ** you may not use this file except in compliance with the License. |
| 7 | ** You may obtain a copy of the License at |
| 8 | ** |
| 9 | ** http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | ** |
| 11 | ** Unless required by applicable law or agreed to in writing, software |
| 12 | ** distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | ** See the License for the specific language governing permissions and |
| 15 | ** limitations under the License. |
| 16 | */ |
| 17 | |
Chong Zhang | 181e695 | 2019-10-09 13:23:39 -0700 | [diff] [blame] | 18 | #ifndef ANDROID_MEDIA_RESOURCEMANAGERSERVICE_H |
| 19 | #define ANDROID_MEDIA_RESOURCEMANAGERSERVICE_H |
Ronghua Wu | 231c3d1 | 2015-03-11 15:10:32 -0700 | [diff] [blame] | 20 | |
Wonsik Kim | d20e936 | 2020-04-28 10:42:57 -0700 | [diff] [blame] | 21 | #include <map> |
Girish | 9128e24 | 2022-11-23 20:52:29 +0000 | [diff] [blame] | 22 | #include <set> |
Chong Zhang | 97d367b | 2020-09-16 12:53:14 -0700 | [diff] [blame] | 23 | #include <mutex> |
Girish | 9128e24 | 2022-11-23 20:52:29 +0000 | [diff] [blame] | 24 | #include <string> |
Girish | 434b4d8 | 2023-07-11 23:24:54 +0000 | [diff] [blame] | 25 | #include <vector> |
Wonsik Kim | d20e936 | 2020-04-28 10:42:57 -0700 | [diff] [blame] | 26 | |
Chong Zhang | fdd512a | 2019-11-22 11:03:14 -0800 | [diff] [blame] | 27 | #include <aidl/android/media/BnResourceManagerService.h> |
Chong Zhang | 181e695 | 2019-10-09 13:23:39 -0700 | [diff] [blame] | 28 | #include <media/MediaResource.h> |
Ronghua Wu | 231c3d1 | 2015-03-11 15:10:32 -0700 | [diff] [blame] | 29 | #include <utils/Errors.h> |
Ronghua Wu | 231c3d1 | 2015-03-11 15:10:32 -0700 | [diff] [blame] | 30 | #include <utils/String8.h> |
| 31 | #include <utils/threads.h> |
Ronghua Wu | 231c3d1 | 2015-03-11 15:10:32 -0700 | [diff] [blame] | 32 | |
Girish | ab17b0f | 2023-11-20 06:00:44 +0000 | [diff] [blame] | 33 | #include "ResourceManagerServiceUtils.h" |
| 34 | |
Ronghua Wu | 231c3d1 | 2015-03-11 15:10:32 -0700 | [diff] [blame] | 35 | namespace android { |
| 36 | |
Chong Zhang | a9d45c7 | 2020-09-09 12:41:17 -0700 | [diff] [blame] | 37 | class ResourceObserverService; |
Ronghua Wu | a8ec8fc | 2015-05-07 13:58:22 -0700 | [diff] [blame] | 38 | class ServiceLog; |
Ronghua Wu | 231c3d1 | 2015-03-11 15:10:32 -0700 | [diff] [blame] | 39 | struct ProcessInfoInterface; |
Girish | 1f002cf | 2023-02-17 00:36:29 +0000 | [diff] [blame] | 40 | class ResourceManagerMetrics; |
Ronghua Wu | 231c3d1 | 2015-03-11 15:10:32 -0700 | [diff] [blame] | 41 | |
Chong Zhang | fdd512a | 2019-11-22 11:03:14 -0800 | [diff] [blame] | 42 | using Status = ::ndk::ScopedAStatus; |
| 43 | using ::aidl::android::media::IResourceManagerClient; |
| 44 | using ::aidl::android::media::BnResourceManagerService; |
| 45 | using ::aidl::android::media::MediaResourceParcel; |
| 46 | using ::aidl::android::media::MediaResourcePolicyParcel; |
Girish | 9128e24 | 2022-11-23 20:52:29 +0000 | [diff] [blame] | 47 | using ::aidl::android::media::ClientInfoParcel; |
Girish | 1f002cf | 2023-02-17 00:36:29 +0000 | [diff] [blame] | 48 | using ::aidl::android::media::ClientConfigParcel; |
Chong Zhang | 181e695 | 2019-10-09 13:23:39 -0700 | [diff] [blame] | 49 | |
Chong Zhang | fdd512a | 2019-11-22 11:03:14 -0800 | [diff] [blame] | 50 | class ResourceManagerService : public BnResourceManagerService { |
Ronghua Wu | 231c3d1 | 2015-03-11 15:10:32 -0700 | [diff] [blame] | 51 | public: |
Chong Zhang | dd72680 | 2019-08-21 17:24:13 -0700 | [diff] [blame] | 52 | struct SystemCallbackInterface : public RefBase { |
| 53 | virtual void noteStartVideo(int uid) = 0; |
| 54 | virtual void noteStopVideo(int uid) = 0; |
| 55 | virtual void noteResetVideo() = 0; |
Chong Zhang | fdd512a | 2019-11-22 11:03:14 -0800 | [diff] [blame] | 56 | virtual bool requestCpusetBoost(bool enable) = 0; |
Chong Zhang | dd72680 | 2019-08-21 17:24:13 -0700 | [diff] [blame] | 57 | }; |
| 58 | |
Ronghua Wu | 231c3d1 | 2015-03-11 15:10:32 -0700 | [diff] [blame] | 59 | static char const *getServiceName() { return "media.resource_manager"; } |
Chong Zhang | fdd512a | 2019-11-22 11:03:14 -0800 | [diff] [blame] | 60 | static void instantiate(); |
Ronghua Wu | 231c3d1 | 2015-03-11 15:10:32 -0700 | [diff] [blame] | 61 | |
Girish | ab17b0f | 2023-11-20 06:00:44 +0000 | [diff] [blame] | 62 | // Static creation methods. |
| 63 | static std::shared_ptr<ResourceManagerService> Create(); |
| 64 | static std::shared_ptr<ResourceManagerService> Create( |
| 65 | const sp<ProcessInfoInterface>& processInfo, |
| 66 | const sp<SystemCallbackInterface>& systemResource); |
| 67 | |
| 68 | virtual binder_status_t dump( |
Chong Zhang | fdd512a | 2019-11-22 11:03:14 -0800 | [diff] [blame] | 69 | int /*fd*/, const char** /*args*/, uint32_t /*numArgs*/); |
Ronghua Wu | 8f9dd87 | 2015-04-23 15:24:25 -0700 | [diff] [blame] | 70 | |
Ronghua Wu | 231c3d1 | 2015-03-11 15:10:32 -0700 | [diff] [blame] | 71 | ResourceManagerService(); |
Brian Lindahl | 64ee945 | 2022-01-14 13:31:16 +0100 | [diff] [blame] | 72 | explicit ResourceManagerService(const sp<ProcessInfoInterface> &processInfo, |
Chong Zhang | dd72680 | 2019-08-21 17:24:13 -0700 | [diff] [blame] | 73 | const sp<SystemCallbackInterface> &systemResource); |
Chong Zhang | fdd512a | 2019-11-22 11:03:14 -0800 | [diff] [blame] | 74 | virtual ~ResourceManagerService(); |
Girish | ab17b0f | 2023-11-20 06:00:44 +0000 | [diff] [blame] | 75 | |
Girish | 6a6044d | 2023-11-22 21:23:14 +0000 | [diff] [blame] | 76 | virtual void setObserverService( |
| 77 | const std::shared_ptr<ResourceObserverService>& observerService); |
Ronghua Wu | 231c3d1 | 2015-03-11 15:10:32 -0700 | [diff] [blame] | 78 | |
| 79 | // IResourceManagerService interface |
Chong Zhang | 181e695 | 2019-10-09 13:23:39 -0700 | [diff] [blame] | 80 | Status config(const std::vector<MediaResourcePolicyParcel>& policies) override; |
Ronghua Wu | 231c3d1 | 2015-03-11 15:10:32 -0700 | [diff] [blame] | 81 | |
Girish | 9128e24 | 2022-11-23 20:52:29 +0000 | [diff] [blame] | 82 | Status addResource(const ClientInfoParcel& clientInfo, |
| 83 | const std::shared_ptr<IResourceManagerClient>& client, |
| 84 | const std::vector<MediaResourceParcel>& resources) override; |
Ronghua Wu | 231c3d1 | 2015-03-11 15:10:32 -0700 | [diff] [blame] | 85 | |
Girish | 9128e24 | 2022-11-23 20:52:29 +0000 | [diff] [blame] | 86 | Status removeResource(const ClientInfoParcel& clientInfo, |
| 87 | const std::vector<MediaResourceParcel>& resources) override; |
Chong Zhang | fb092d3 | 2019-08-12 09:45:44 -0700 | [diff] [blame] | 88 | |
Girish | 9128e24 | 2022-11-23 20:52:29 +0000 | [diff] [blame] | 89 | Status removeClient(const ClientInfoParcel& clientInfo) override; |
Ronghua Wu | 231c3d1 | 2015-03-11 15:10:32 -0700 | [diff] [blame] | 90 | |
Ronghua Wu | 05d89f1 | 2015-07-07 16:47:42 -0700 | [diff] [blame] | 91 | // Tries to reclaim resource from processes with lower priority than the calling process |
| 92 | // according to the requested resources. |
| 93 | // Returns true if any resource has been reclaimed, otherwise returns false. |
Girish | 9128e24 | 2022-11-23 20:52:29 +0000 | [diff] [blame] | 94 | Status reclaimResource(const ClientInfoParcel& clientInfo, |
| 95 | const std::vector<MediaResourceParcel>& resources, |
| 96 | bool* _aidl_return) override; |
Ronghua Wu | 231c3d1 | 2015-03-11 15:10:32 -0700 | [diff] [blame] | 97 | |
Girish | 9128e24 | 2022-11-23 20:52:29 +0000 | [diff] [blame] | 98 | Status overridePid(int32_t originalPid, int32_t newPid) override; |
Henry Fang | 3276292 | 2020-01-28 18:40:39 -0800 | [diff] [blame] | 99 | |
Girish | 9128e24 | 2022-11-23 20:52:29 +0000 | [diff] [blame] | 100 | Status overrideProcessInfo(const std::shared_ptr<IResourceManagerClient>& client, |
| 101 | int32_t pid, int32_t procState, int32_t oomScore) override; |
Chong Zhang | 97d367b | 2020-09-16 12:53:14 -0700 | [diff] [blame] | 102 | |
Girish | 9128e24 | 2022-11-23 20:52:29 +0000 | [diff] [blame] | 103 | Status markClientForPendingRemoval(const ClientInfoParcel& clientInfo) override; |
Wonsik Kim | d20e936 | 2020-04-28 10:42:57 -0700 | [diff] [blame] | 104 | |
Wonsik Kim | 271429d | 2020-10-01 10:12:56 -0700 | [diff] [blame] | 105 | Status reclaimResourcesFromClientsPendingRemoval(int32_t pid) override; |
| 106 | |
Girish | 1f002cf | 2023-02-17 00:36:29 +0000 | [diff] [blame] | 107 | Status notifyClientCreated(const ClientInfoParcel& clientInfo) override; |
| 108 | |
| 109 | Status notifyClientStarted(const ClientConfigParcel& clientConfig) override; |
| 110 | |
| 111 | Status notifyClientStopped(const ClientConfigParcel& clientConfig) override; |
| 112 | |
Girish | de8eb59 | 2023-04-13 18:49:17 +0000 | [diff] [blame] | 113 | Status notifyClientConfigChanged(const ClientConfigParcel& clientConfig) override; |
| 114 | |
Girish | 6a6044d | 2023-11-22 21:23:14 +0000 | [diff] [blame] | 115 | protected: |
| 116 | // To get notifications when a resource is added for the first time. |
| 117 | void onFirstAdded(const MediaResourceParcel& res, uid_t uid); |
| 118 | // To get notifications when a resource has been removed at last. |
| 119 | void onLastRemoved(const MediaResourceParcel& res, uid_t uid); |
| 120 | |
| 121 | // Reclaims resources from |clients|. Returns true if reclaim succeeded |
| 122 | // for all clients. |
| 123 | bool reclaimUnconditionallyFrom(const std::vector<ClientInfo>& targetClients); |
| 124 | |
| 125 | // A helper function that returns true if the callingPid has higher priority than pid. |
| 126 | // Returns false otherwise. |
| 127 | bool isCallingPriorityHigher_l(int callingPid, int pid); |
| 128 | |
| 129 | // To notify the metrics about client being released. |
| 130 | void notifyClientReleased(const ClientInfoParcel& clientInfo); |
| 131 | |
| 132 | virtual Status removeResource(const ClientInfoParcel& clientInfo, bool checkValid); |
| 133 | |
Ronghua Wu | 231c3d1 | 2015-03-11 15:10:32 -0700 | [diff] [blame] | 134 | private: |
| 135 | friend class ResourceManagerServiceTest; |
Girish | ab17b0f | 2023-11-20 06:00:44 +0000 | [diff] [blame] | 136 | friend class ResourceManagerServiceTestBase; |
Chong Zhang | 97d367b | 2020-09-16 12:53:14 -0700 | [diff] [blame] | 137 | friend class DeathNotifier; |
| 138 | friend class OverrideProcessInfoDeathNotifier; |
Ronghua Wu | 231c3d1 | 2015-03-11 15:10:32 -0700 | [diff] [blame] | 139 | |
Girish | 0ac5c21 | 2023-11-23 09:14:03 +0000 | [diff] [blame] | 140 | // Gets the client who owns biggest piece of specified resource type from pid. |
| 141 | // Returns false with no change to client if there are no clients holding resources of this |
| 142 | // type. |
| 143 | bool getBiggestClient_l(int pid, MediaResource::Type type, |
| 144 | MediaResource::SubType subType, |
| 145 | ClientInfo& clientsInfo, |
| 146 | bool pendingRemovalOnly = false); |
Ronghua Wu | 231c3d1 | 2015-03-11 15:10:32 -0700 | [diff] [blame] | 147 | |
Girish | 0ac5c21 | 2023-11-23 09:14:03 +0000 | [diff] [blame] | 148 | // A helper function that gets the biggest clients of the process pid that |
| 149 | // is marked to be (pending) removed and has the needed resources. |
Brian Lindahl | 64ee945 | 2022-01-14 13:31:16 +0100 | [diff] [blame] | 150 | bool getBiggestClientPendingRemoval_l(int pid, MediaResource::Type type, |
Girish | ab17b0f | 2023-11-20 06:00:44 +0000 | [diff] [blame] | 151 | MediaResource::SubType subType, |
| 152 | ClientInfo& clientsInfo); |
Ronghua Wu | 231c3d1 | 2015-03-11 15:10:32 -0700 | [diff] [blame] | 153 | |
Girish | 0ac5c21 | 2023-11-23 09:14:03 +0000 | [diff] [blame] | 154 | // From the list of clients, pick/select client(s) based on the reclaim policy. |
Girish | 56fda31 | 2023-10-12 21:32:35 +0000 | [diff] [blame] | 155 | void getClientForResource_l(const ResourceRequestInfo& resourceRequestInfo, |
| 156 | std::vector<ClientInfo>& clientsInfo); |
Girish | 0ac5c21 | 2023-11-23 09:14:03 +0000 | [diff] [blame] | 157 | // A helper function that pushes Reclaim Atom (for metric collection). |
| 158 | void pushReclaimAtom(const ClientInfoParcel& clientInfo, |
| 159 | const std::vector<ClientInfo>& targetClients, |
| 160 | bool reclaimed); |
| 161 | |
| 162 | // Remove the override info for the given process |
| 163 | void removeProcessInfoOverride_l(int pid); |
Ronghua Wu | 05d89f1 | 2015-07-07 16:47:42 -0700 | [diff] [blame] | 164 | |
Girish | 6a6044d | 2023-11-22 21:23:14 +0000 | [diff] [blame] | 165 | // Eventually we want to phase out this implementation of IResourceManagerService |
| 166 | // (ResourceManagerService) and replace that with the newer implementation |
| 167 | // (ResourceManagerServiceNew). |
| 168 | // So, marking the following methods as private virtual and for the newer implementation |
| 169 | // to override is the easiest way to maintain both implementation. |
| 170 | |
| 171 | // Initializes the internal state of the ResourceManagerService |
| 172 | virtual void init(); |
| 173 | |
Girish | 0ac5c21 | 2023-11-23 09:14:03 +0000 | [diff] [blame] | 174 | // Gets the list of all the clients who own the list of specified resource type |
| 175 | // and satisfy the resource model and the reclaim policy. |
| 176 | virtual bool getTargetClients( |
Girish | 88a8350 | 2023-11-23 11:23:07 +0000 | [diff] [blame] | 177 | const ClientInfoParcel& clientInfo, |
Girish | 0ac5c21 | 2023-11-23 09:14:03 +0000 | [diff] [blame] | 178 | const std::vector<MediaResourceParcel>& resources, |
| 179 | std::vector<ClientInfo>& targetClients); |
| 180 | |
Girish | 6a6044d | 2023-11-22 21:23:14 +0000 | [diff] [blame] | 181 | // Gets the list of all the clients who own the specified resource type. |
| 182 | // Returns false if any client belongs to a process with higher priority than the |
| 183 | // calling process. The clients will remain unchanged if returns false. |
| 184 | virtual bool getAllClients_l(const ResourceRequestInfo& resourceRequestInfo, |
| 185 | std::vector<ClientInfo>& clientsInfo); |
| 186 | |
Girish | 0ac5c21 | 2023-11-23 09:14:03 +0000 | [diff] [blame] | 187 | // Gets the client who owns specified resource type from lowest possible priority process. |
| 188 | // Returns false if the calling process priority is not higher than the lowest process |
| 189 | // priority. The client will remain unchanged if returns false. |
| 190 | virtual bool getLowestPriorityBiggestClient_l( |
| 191 | const ResourceRequestInfo& resourceRequestInfo, |
| 192 | ClientInfo& clientInfo); |
Girish | 6a6044d | 2023-11-22 21:23:14 +0000 | [diff] [blame] | 193 | |
Girish | 0ac5c21 | 2023-11-23 09:14:03 +0000 | [diff] [blame] | 194 | // override the pid of given process |
Girish | 6a6044d | 2023-11-22 21:23:14 +0000 | [diff] [blame] | 195 | virtual bool overridePid_l(int32_t originalPid, int32_t newPid); |
| 196 | |
Girish | 0ac5c21 | 2023-11-23 09:14:03 +0000 | [diff] [blame] | 197 | // override the process info of given process |
Girish | 6a6044d | 2023-11-22 21:23:14 +0000 | [diff] [blame] | 198 | virtual bool overrideProcessInfo_l(const std::shared_ptr<IResourceManagerClient>& client, |
| 199 | int pid, int procState, int oomScore); |
Robert Shih | c3af31b | 2019-09-20 21:45:01 -0700 | [diff] [blame] | 200 | |
Henry Fang | 3276292 | 2020-01-28 18:40:39 -0800 | [diff] [blame] | 201 | // Get priority from process's pid |
Girish | 6a6044d | 2023-11-22 21:23:14 +0000 | [diff] [blame] | 202 | virtual bool getPriority_l(int pid, int* priority) const; |
Henry Fang | 3276292 | 2020-01-28 18:40:39 -0800 | [diff] [blame] | 203 | |
Girish | 6a6044d | 2023-11-22 21:23:14 +0000 | [diff] [blame] | 204 | // Gets lowest priority process that has the specified resource type. |
| 205 | // Returns false if failed. The output parameters will remain unchanged if failed. |
| 206 | virtual bool getLowestPriorityPid_l(MediaResource::Type type, MediaResource::SubType subType, |
| 207 | int* lowestPriorityPid, int* lowestPriority); |
| 208 | |
| 209 | // Removes the pid from the override map. |
| 210 | virtual void removeProcessInfoOverride(int pid); |
| 211 | |
| 212 | // Get the client for given pid and the clientId from the map |
Girish | e830527 | 2023-12-18 19:17:58 +0000 | [diff] [blame] | 213 | virtual std::shared_ptr<IResourceManagerClient> getClient_l( |
Girish | 6a6044d | 2023-11-22 21:23:14 +0000 | [diff] [blame] | 214 | int pid, const int64_t& clientId) const; |
| 215 | |
| 216 | // Remove the client for given pid and the clientId from the map |
Girish | e830527 | 2023-12-18 19:17:58 +0000 | [diff] [blame] | 217 | virtual bool removeClient_l(int pid, const int64_t& clientId); |
Girish | 6a6044d | 2023-11-22 21:23:14 +0000 | [diff] [blame] | 218 | |
| 219 | // Get all the resource status for dump |
| 220 | virtual void getResourceDump(std::string& resourceLog) const; |
Chong Zhang | 97d367b | 2020-09-16 12:53:14 -0700 | [diff] [blame] | 221 | |
Girish | 56fda31 | 2023-10-12 21:32:35 +0000 | [diff] [blame] | 222 | // The following utility functions are used only for testing by ResourceManagerServiceTest |
Girish | 0ac5c21 | 2023-11-23 09:14:03 +0000 | [diff] [blame] | 223 | // START: TEST only functions |
Girish | 1f002cf | 2023-02-17 00:36:29 +0000 | [diff] [blame] | 224 | // Get the peak concurrent pixel count (associated with the video codecs) for the process. |
| 225 | long getPeakConcurrentPixelCount(int pid) const; |
| 226 | // Get the current concurrent pixel count (associated with the video codecs) for the process. |
| 227 | long getCurrentConcurrentPixelCount(int pid) const; |
Girish | 1484e5d | 2023-11-20 06:00:44 +0000 | [diff] [blame] | 228 | // To create object of type ResourceManagerServiceNew |
| 229 | static std::shared_ptr<ResourceManagerService> CreateNew( |
| 230 | const sp<ProcessInfoInterface>& processInfo, |
| 231 | const sp<SystemCallbackInterface>& systemResource); |
Girish | 6a6044d | 2023-11-22 21:23:14 +0000 | [diff] [blame] | 232 | // Returns a unmodifiable reference to the internal resource state as a map |
| 233 | virtual const std::map<int, ResourceInfos>& getResourceMap() const { |
| 234 | return mMap; |
| 235 | } |
Girish | 88a8350 | 2023-11-23 11:23:07 +0000 | [diff] [blame] | 236 | // enable/disable process priority based reclaim and client importance based reclaim |
| 237 | virtual void setReclaimPolicy(bool processPriority, bool clientImportance) { |
| 238 | // Implemented by the refactored/new RMService |
| 239 | (void)processPriority; |
| 240 | (void)clientImportance; |
| 241 | } |
Girish | 0ac5c21 | 2023-11-23 09:14:03 +0000 | [diff] [blame] | 242 | // END: TEST only functions |
Girish | 1f002cf | 2023-02-17 00:36:29 +0000 | [diff] [blame] | 243 | |
Girish | 6a6044d | 2023-11-22 21:23:14 +0000 | [diff] [blame] | 244 | protected: |
Girish | 434b4d8 | 2023-07-11 23:24:54 +0000 | [diff] [blame] | 245 | mutable std::mutex mLock; |
Ronghua Wu | 231c3d1 | 2015-03-11 15:10:32 -0700 | [diff] [blame] | 246 | sp<ProcessInfoInterface> mProcessInfo; |
Chong Zhang | dd72680 | 2019-08-21 17:24:13 -0700 | [diff] [blame] | 247 | sp<SystemCallbackInterface> mSystemCB; |
Ronghua Wu | a8ec8fc | 2015-05-07 13:58:22 -0700 | [diff] [blame] | 248 | sp<ServiceLog> mServiceLog; |
Ronghua Wu | 231c3d1 | 2015-03-11 15:10:32 -0700 | [diff] [blame] | 249 | bool mSupportsMultipleSecureCodecs; |
| 250 | bool mSupportsSecureWithNonSecureCodec; |
Chong Zhang | 79d2b28 | 2018-04-17 14:14:31 -0700 | [diff] [blame] | 251 | int32_t mCpuBoostCount; |
Girish | 6a6044d | 2023-11-22 21:23:14 +0000 | [diff] [blame] | 252 | |
| 253 | private: |
| 254 | PidResourceInfosMap mMap; |
Chong Zhang | 97d367b | 2020-09-16 12:53:14 -0700 | [diff] [blame] | 255 | struct ProcessInfoOverride { |
Girish | f1d166c | 2023-07-20 22:35:29 +0000 | [diff] [blame] | 256 | std::shared_ptr<DeathNotifier> deathNotifier = nullptr; |
Chong Zhang | 97d367b | 2020-09-16 12:53:14 -0700 | [diff] [blame] | 257 | std::shared_ptr<IResourceManagerClient> client; |
| 258 | }; |
Henry Fang | 3276292 | 2020-01-28 18:40:39 -0800 | [diff] [blame] | 259 | std::map<int, int> mOverridePidMap; |
Chong Zhang | 97d367b | 2020-09-16 12:53:14 -0700 | [diff] [blame] | 260 | std::map<pid_t, ProcessInfoOverride> mProcessInfoOverrideMap; |
Chong Zhang | a9d45c7 | 2020-09-09 12:41:17 -0700 | [diff] [blame] | 261 | std::shared_ptr<ResourceObserverService> mObserverService; |
Girish | 1f002cf | 2023-02-17 00:36:29 +0000 | [diff] [blame] | 262 | std::unique_ptr<ResourceManagerMetrics> mResourceManagerMetrics; |
Ronghua Wu | 231c3d1 | 2015-03-11 15:10:32 -0700 | [diff] [blame] | 263 | }; |
| 264 | |
| 265 | // ---------------------------------------------------------------------------- |
Chong Zhang | 181e695 | 2019-10-09 13:23:39 -0700 | [diff] [blame] | 266 | } // namespace android |
Ronghua Wu | 231c3d1 | 2015-03-11 15:10:32 -0700 | [diff] [blame] | 267 | |
Chong Zhang | 181e695 | 2019-10-09 13:23:39 -0700 | [diff] [blame] | 268 | #endif // ANDROID_MEDIA_RESOURCEMANAGERSERVICE_H |