blob: 2883e38421550cff0b3d746f96c934ca8a3f3e56 [file] [log] [blame]
Dianne Hackborn5da5ca52013-02-12 15:12:21 -08001/*
2 * Copyright (C) 2013 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//
18#ifndef ANDROID_IAPP_OPS_SERVICE_H
19#define ANDROID_IAPP_OPS_SERVICE_H
20
21#include <binder/IAppOpsCallback.h>
22#include <binder/IInterface.h>
23
24namespace android {
25
26// ----------------------------------------------------------------------
27
28class IAppOpsService : public IInterface
29{
30public:
31 DECLARE_META_INTERFACE(AppOpsService);
32
33 virtual int32_t checkOperation(int32_t code, int32_t uid, const String16& packageName) = 0;
34 virtual int32_t noteOperation(int32_t code, int32_t uid, const String16& packageName) = 0;
35 virtual int32_t startOperation(int32_t code, int32_t uid, const String16& packageName) = 0;
36 virtual void finishOperation(int32_t code, int32_t uid, const String16& packageName) = 0;
37 virtual void startWatchingMode(int32_t op, const String16& packageName,
38 const sp<IAppOpsCallback>& callback) = 0;
39 virtual void stopWatchingMode(const sp<IAppOpsCallback>& callback) = 0;
40
41 enum {
42 CHECK_OPERATION_TRANSACTION = IBinder::FIRST_CALL_TRANSACTION,
43 NOTE_OPERATION_TRANSACTION = IBinder::FIRST_CALL_TRANSACTION+1,
44 START_OPERATION_TRANSACTION = IBinder::FIRST_CALL_TRANSACTION+2,
45 FINISH_OPERATION_TRANSACTION = IBinder::FIRST_CALL_TRANSACTION+3,
46 START_WATCHING_MODE_TRANSACTION = IBinder::FIRST_CALL_TRANSACTION+4,
47 STOP_WATCHING_MODE_TRANSACTION = IBinder::FIRST_CALL_TRANSACTION+5
48 };
49};
50
51// ----------------------------------------------------------------------
52
53class BnAppOpsService : public BnInterface<IAppOpsService>
54{
55public:
56 virtual status_t onTransact( uint32_t code,
57 const Parcel& data,
58 Parcel* reply,
59 uint32_t flags = 0);
60};
61
62// ----------------------------------------------------------------------
63
64}; // namespace android
65
66#endif // ANDROID_IAPP_OPS_SERVICE_H
67