blob: a9da86376153115eff4dc0189aa9d0f93995f3c9 [file] [log] [blame]
Dianne Hackborna06de0f2012-12-11 16:34:47 -08001/*
Dianne Hackbornc2293022013-02-06 23:14:49 -08002 * Copyright (C) 2013 The Android Open Source Project
Dianne Hackborna06de0f2012-12-11 16:34:47 -08003 *
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
17package com.android.internal.app;
18
Dianne Hackborn35654b62013-01-14 17:38:02 -080019import android.app.AppOpsManager;
Dianne Hackbornc2293022013-02-06 23:14:49 -080020import com.android.internal.app.IAppOpsCallback;
Dianne Hackborn35654b62013-01-14 17:38:02 -080021
Dianne Hackborna06de0f2012-12-11 16:34:47 -080022interface IAppOpsService {
Dianne Hackbornd7d28e62013-02-12 14:59:53 -080023 // These first methods are also called by native code, so must
24 // be kept in sync with frameworks/native/include/binder/IAppOpsService.h
Dianne Hackborn35654b62013-01-14 17:38:02 -080025 int checkOperation(int code, int uid, String packageName);
Dianne Hackborna06de0f2012-12-11 16:34:47 -080026 int noteOperation(int code, int uid, String packageName);
27 int startOperation(int code, int uid, String packageName);
28 void finishOperation(int code, int uid, String packageName);
Dianne Hackbornc2293022013-02-06 23:14:49 -080029 void startWatchingMode(int op, String packageName, IAppOpsCallback callback);
30 void stopWatchingMode(IAppOpsCallback callback);
Dianne Hackbornd7d28e62013-02-12 14:59:53 -080031
32 // Remaining methods are only used in Java.
33 List<AppOpsManager.PackageOps> getPackagesForOps(in int[] ops);
34 List<AppOpsManager.PackageOps> getOpsForPackage(int uid, String packageName, in int[] ops);
35 void setMode(int code, int uid, String packageName, int mode);
Dianne Hackborna06de0f2012-12-11 16:34:47 -080036}