blob: 8992f8bc1553caddc203e33a56d33be0567db5a8 [file] [log] [blame]
Ronghua Wu231c3d12015-03-11 15:10:32 -07001/*
2 * Copyright 2015 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#ifndef ANDROID_IRESOURCEMANAGERSERVICE_H
18#define ANDROID_IRESOURCEMANAGERSERVICE_H
19
20#include <utils/Errors.h> // for status_t
21#include <utils/KeyedVector.h>
22#include <utils/RefBase.h>
23#include <utils/String8.h>
24#include <binder/IInterface.h>
25#include <binder/Parcel.h>
26
27#include <media/IResourceManagerClient.h>
28#include <media/MediaResource.h>
29#include <media/MediaResourcePolicy.h>
30
31namespace android {
32
33class IResourceManagerService: public IInterface
34{
35public:
36 DECLARE_META_INTERFACE(ResourceManagerService);
37
38 virtual void config(const Vector<MediaResourcePolicy> &policies) = 0;
39
40 virtual void addResource(
41 int pid,
Chong Zhangee33d642019-08-08 14:26:43 -070042 int uid,
Ronghua Wu231c3d12015-03-11 15:10:32 -070043 int64_t clientId,
44 const sp<IResourceManagerClient> client,
45 const Vector<MediaResource> &resources) = 0;
46
Chong Zhangfb092d32019-08-12 09:45:44 -070047 virtual void removeResource(int pid, int64_t clientId,
48 const Vector<MediaResource> &resources) = 0;
49
50 virtual void removeClient(int pid, int64_t clientId) = 0;
Ronghua Wu231c3d12015-03-11 15:10:32 -070051
52 virtual bool reclaimResource(
53 int callingPid,
54 const Vector<MediaResource> &resources) = 0;
55};
56
57// ----------------------------------------------------------------------------
58
59class BnResourceManagerService: public BnInterface<IResourceManagerService>
60{
61public:
62 virtual status_t onTransact(uint32_t code,
63 const Parcel &data,
64 Parcel *reply,
65 uint32_t flags = 0);
66};
67
68}; // namespace android
69
70#endif // ANDROID_IRESOURCEMANAGERSERVICE_H