2 * Copyright (C) 2013 The Android Open Source Project
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 #ifndef ANDROID_APP_OPS_MANAGER_H
18 #define ANDROID_APP_OPS_MANAGER_H
20 #include <binder/IAppOpsService.h>
22 #include <utils/threads.h>
24 // ---------------------------------------------------------------------------
31 MODE_ALLOWED = IAppOpsService::MODE_ALLOWED,
32 MODE_IGNORED = IAppOpsService::MODE_IGNORED,
33 MODE_ERRORED = IAppOpsService::MODE_ERRORED
38 OP_COARSE_LOCATION = 0,
43 OP_WRITE_CONTACTS = 5,
45 OP_WRITE_CALL_LOG = 7,
47 OP_WRITE_CALENDAR = 9,
49 OP_POST_NOTIFICATION = 11,
50 OP_NEIGHBORING_CELLS = 12,
55 OP_RECEIVE_EMERGECY_SMS = 17,
57 OP_RECEIVE_WAP_PUSH = 19,
60 OP_WRITE_ICC_SMS = 22,
61 OP_WRITE_SETTINGS = 23,
62 OP_SYSTEM_ALERT_WINDOW = 24,
63 OP_ACCESS_NOTIFICATIONS = 25,
71 int32_t checkOp(int32_t op, int32_t uid, const String16& callingPackage);
72 int32_t noteOp(int32_t op, int32_t uid, const String16& callingPackage);
73 int32_t startOp(int32_t op, int32_t uid, const String16& callingPackage);
74 void finishOp(int32_t op, int32_t uid, const String16& callingPackage);
75 void startWatchingMode(int32_t op, const String16& packageName,
76 const sp<IAppOpsCallback>& callback);
77 void stopWatchingMode(const sp<IAppOpsCallback>& callback);
81 sp<IAppOpsService> mService;
83 sp<IAppOpsService> getService();
87 }; // namespace android
88 // ---------------------------------------------------------------------------
89 #endif // ANDROID_APP_OPS_MANAGER_H