blob: 4ce0f318bad55c569911bfb1a3ed957d8c541a98 [file] [log] [blame]
Hai Zhangb7776682018-09-25 15:10:57 -07001/*
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
17package android.app.role;
18
Hai Zhang31d06ba2018-12-06 18:14:42 -080019import android.app.role.IOnRoleHoldersChangedListener;
Hai Zhangb7776682018-09-25 15:10:57 -070020import android.app.role.IRoleManagerCallback;
21
22/**
23 * @hide
24 */
25interface 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 Zhang87ed09a2018-10-22 10:43:31 -070040
Hai Zhang31d06ba2018-12-06 18:14:42 -080041 void addOnRoleHoldersChangedListenerAsUser(IOnRoleHoldersChangedListener listener, int userId);
42
43 void removeOnRoleHoldersChangedListenerAsUser(IOnRoleHoldersChangedListener listener,
44 int userId);
45
Hai Zhang8e60a8f2018-11-20 11:21:09 -080046 void setRoleNamesFromController(in List<String> roleNames);
47
Hai Zhang87ed09a2018-10-22 10:43:31 -070048 boolean addRoleHolderFromController(in String roleName, in String packageName);
49
50 boolean removeRoleHolderFromController(in String roleName, in String packageName);
Hai Zhangb7776682018-09-25 15:10:57 -070051}