diff options
| author | 2017-02-02 09:57:18 +0000 | |
|---|---|---|
| committer | 2017-02-06 17:19:21 +0000 | |
| commit | b4f33df8911e1b2804714fc4e78e8172d2eadd46 (patch) | |
| tree | a8365056eda2dc776ee7f266759942b4716824b8 /include/binder | |
| parent | 2c2759221d8ec64fb8cd0178d4e00b8effe4b0e9 (diff) | |
ProcessInfoService: Add support for oom score query
An additional query for the process oom score also
needs to be supported.
BUG: 34701266
Test: Manual testing + run cts -m Camera --abi armeabi-v7a --disable-reboot
Change-Id: I3e7de82c4d14d4b3b7faa86f4c7208deb376b6c4
Diffstat (limited to 'include/binder')
| -rw-r--r-- | include/binder/ProcessInfoService.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/include/binder/ProcessInfoService.h b/include/binder/ProcessInfoService.h index c5ead20676..0da61ee3cb 100644 --- a/include/binder/ProcessInfoService.h +++ b/include/binder/ProcessInfoService.h @@ -35,6 +35,8 @@ class ProcessInfoService : public Singleton<ProcessInfoService> { ProcessInfoService(); status_t getProcessStatesImpl(size_t length, /*in*/ int32_t* pids, /*out*/ int32_t* states); + status_t getProcessStatesScoresImpl(size_t length, /*in*/ int32_t* pids, + /*out*/ int32_t* states, /*out*/ int32_t *scores); void updateBinderLocked(); static const int BINDER_ATTEMPT_LIMIT = 5; @@ -55,6 +57,21 @@ public: /*out*/ states); } + /** + * For each PID in the given "pids" input array, write the current process state + * for that process into the "states" output array, or + * ActivityManager.PROCESS_STATE_NONEXISTENT * to indicate that no process with the given PID + * exists. OoM scores will also be written in the "scores" output array. + * Please also note that clients calling this method need to have + * "GET_PROCESS_STATE_AND_OOM_SCORE" permission. + * + * Returns NO_ERROR if this operation was successful, or a negative error code otherwise. + */ + static status_t getProcessStatesScoresFromPids(size_t length, /*in*/ int32_t* pids, + /*out*/ int32_t* states, /*out*/ int32_t *scores) { + return ProcessInfoService::getInstance().getProcessStatesScoresImpl( + length, /*in*/ pids, /*out*/ states, /*out*/ scores); + } }; // ---------------------------------------------------------------------- |