Dianne Hackborn | a06de0f | 2012-12-11 16:34:47 -0800 | [diff] [blame] | 1 | /* |
Dianne Hackborn | c229302 | 2013-02-06 23:14:49 -0800 | [diff] [blame] | 2 | * Copyright (C) 2013 The Android Open Source Project |
Dianne Hackborn | a06de0f | 2012-12-11 16:34:47 -0800 | [diff] [blame] | 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 | package com.android.internal.app; |
| 18 | |
Dianne Hackborn | 35654b6 | 2013-01-14 17:38:02 -0800 | [diff] [blame] | 19 | import android.app.AppOpsManager; |
Jason Monk | 6206299 | 2014-05-06 09:55:28 -0400 | [diff] [blame] | 20 | import android.os.Bundle; |
Dianne Hackborn | c229302 | 2013-02-06 23:14:49 -0800 | [diff] [blame] | 21 | import com.android.internal.app.IAppOpsCallback; |
Dianne Hackborn | 35654b6 | 2013-01-14 17:38:02 -0800 | [diff] [blame] | 22 | |
Dianne Hackborn | a06de0f | 2012-12-11 16:34:47 -0800 | [diff] [blame] | 23 | interface IAppOpsService { |
Dianne Hackborn | d7d28e6 | 2013-02-12 14:59:53 -0800 | [diff] [blame] | 24 | // These first methods are also called by native code, so must |
| 25 | // be kept in sync with frameworks/native/include/binder/IAppOpsService.h |
Dianne Hackborn | 35654b6 | 2013-01-14 17:38:02 -0800 | [diff] [blame] | 26 | int checkOperation(int code, int uid, String packageName); |
Dianne Hackborn | a06de0f | 2012-12-11 16:34:47 -0800 | [diff] [blame] | 27 | int noteOperation(int code, int uid, String packageName); |
Dianne Hackborn | e98f5db | 2013-07-17 17:23:25 -0700 | [diff] [blame] | 28 | int startOperation(IBinder token, int code, int uid, String packageName); |
| 29 | void finishOperation(IBinder token, int code, int uid, String packageName); |
Dianne Hackborn | c229302 | 2013-02-06 23:14:49 -0800 | [diff] [blame] | 30 | void startWatchingMode(int op, String packageName, IAppOpsCallback callback); |
| 31 | void stopWatchingMode(IAppOpsCallback callback); |
Dianne Hackborn | e98f5db | 2013-07-17 17:23:25 -0700 | [diff] [blame] | 32 | IBinder getToken(IBinder clientToken); |
Svet Ganov | b9d71a6 | 2015-04-30 10:38:13 -0700 | [diff] [blame] | 33 | int permissionToOpCode(String permission); |
Svet Ganov | 85be0c4 | 2015-07-03 16:22:26 -0700 | [diff] [blame] | 34 | int noteProxyOperation(int code, String proxyPackageName, |
| 35 | int callingUid, String callingPackageName); |
Dianne Hackborn | d7d28e6 | 2013-02-12 14:59:53 -0800 | [diff] [blame] | 36 | |
| 37 | // Remaining methods are only used in Java. |
Dianne Hackborn | d4a8b9d | 2013-09-06 13:36:57 -0700 | [diff] [blame] | 38 | int checkPackage(int uid, String packageName); |
Dianne Hackborn | d7d28e6 | 2013-02-12 14:59:53 -0800 | [diff] [blame] | 39 | List<AppOpsManager.PackageOps> getPackagesForOps(in int[] ops); |
| 40 | List<AppOpsManager.PackageOps> getOpsForPackage(int uid, String packageName, in int[] ops); |
Dianne Hackborn | c7214a3 | 2017-04-11 13:32:47 -0700 | [diff] [blame] | 41 | List<AppOpsManager.PackageOps> getUidOps(int uid, in int[] ops); |
Svet Ganov | 2af5708 | 2015-07-30 08:44:20 -0700 | [diff] [blame] | 42 | void setUidMode(int code, int uid, int mode); |
Dianne Hackborn | d7d28e6 | 2013-02-12 14:59:53 -0800 | [diff] [blame] | 43 | void setMode(int code, int uid, String packageName, int mode); |
Dianne Hackborn | 7b7c58b | 2014-12-02 18:32:20 -0800 | [diff] [blame] | 44 | void resetAllModes(int reqUserId, String reqPackageName); |
John Spurlock | 7b41467 | 2014-07-18 13:02:39 -0400 | [diff] [blame] | 45 | int checkAudioOperation(int code, int usage, int uid, String packageName); |
| 46 | void setAudioRestriction(int code, int usage, int uid, int mode, in String[] exceptionPackages); |
Jason Monk | 6206299 | 2014-05-06 09:55:28 -0400 | [diff] [blame] | 47 | |
Svet Ganov | 9cea80cd | 2016-02-16 11:47:00 -0800 | [diff] [blame] | 48 | void setUserRestrictions(in Bundle restrictions, IBinder token, int userHandle); |
Ruben Brunk | 29931bc | 2016-03-11 00:24:26 -0800 | [diff] [blame] | 49 | void setUserRestriction(int code, boolean restricted, IBinder token, int userHandle, in String[] exceptionPackages); |
Jason Monk | 6206299 | 2014-05-06 09:55:28 -0400 | [diff] [blame] | 50 | void removeUser(int userHandle); |
Dianne Hackborn | a06de0f | 2012-12-11 16:34:47 -0800 | [diff] [blame] | 51 | } |