Hai Zhang | b777668 | 2018-09-25 15:10:57 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2018 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 | package android.app.role; |
| 18 | |
Hai Zhang | 31d06ba | 2018-12-06 18:14:42 -0800 | [diff] [blame^] | 19 | import android.app.role.IOnRoleHoldersChangedListener; |
Hai Zhang | b777668 | 2018-09-25 15:10:57 -0700 | [diff] [blame] | 20 | import android.app.role.IRoleManagerCallback; |
| 21 | |
| 22 | /** |
| 23 | * @hide |
| 24 | */ |
| 25 | interface IRoleManager { |
| 26 | |
| 27 | boolean isRoleAvailable(in String roleName); |
| 28 | |
| 29 | boolean isRoleHeld(in String roleName, in String packageName); |
| 30 | |
| 31 | List<String> getRoleHoldersAsUser(in String roleName, int userId); |
| 32 | |
| 33 | void addRoleHolderAsUser(in String roleName, in String packageName, int userId, |
| 34 | in IRoleManagerCallback callback); |
| 35 | |
| 36 | void removeRoleHolderAsUser(in String roleName, in String packageName, int userId, |
| 37 | in IRoleManagerCallback callback); |
| 38 | |
| 39 | void clearRoleHoldersAsUser(in String roleName, int userId, in IRoleManagerCallback callback); |
Hai Zhang | 87ed09a | 2018-10-22 10:43:31 -0700 | [diff] [blame] | 40 | |
Hai Zhang | 31d06ba | 2018-12-06 18:14:42 -0800 | [diff] [blame^] | 41 | void addOnRoleHoldersChangedListenerAsUser(IOnRoleHoldersChangedListener listener, int userId); |
| 42 | |
| 43 | void removeOnRoleHoldersChangedListenerAsUser(IOnRoleHoldersChangedListener listener, |
| 44 | int userId); |
| 45 | |
Hai Zhang | 8e60a8f | 2018-11-20 11:21:09 -0800 | [diff] [blame] | 46 | void setRoleNamesFromController(in List<String> roleNames); |
| 47 | |
Hai Zhang | 87ed09a | 2018-10-22 10:43:31 -0700 | [diff] [blame] | 48 | boolean addRoleHolderFromController(in String roleName, in String packageName); |
| 49 | |
| 50 | boolean removeRoleHolderFromController(in String roleName, in String packageName); |
Hai Zhang | b777668 | 2018-09-25 15:10:57 -0700 | [diff] [blame] | 51 | } |