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 
19 import android.app.role.IOnRoleHoldersChangedListener;
20 import android.os.Bundle;
21 import android.os.RemoteCallback;
22 
23 /**
24  * @hide
25  */
26 interface IRoleManager {
27 
28     boolean isRoleAvailable(in String roleName);
29 
30     boolean isRoleHeld(in String roleName, in String packageName);
31 
32     List<String> getRoleHoldersAsUser(in String roleName, int userId);
33 
34     void addRoleHolderAsUser(in String roleName, in String packageName, int flags, int userId,
35             in RemoteCallback callback);
36 
37     void removeRoleHolderAsUser(in String roleName, in String packageName, int flags, int userId,
38             in RemoteCallback callback);
39 
40     void clearRoleHoldersAsUser(in String roleName, int flags, int userId,
41             in RemoteCallback callback);
42 
43     void addOnRoleHoldersChangedListenerAsUser(IOnRoleHoldersChangedListener listener, int userId);
44 
45     void removeOnRoleHoldersChangedListenerAsUser(IOnRoleHoldersChangedListener listener,
46             int userId);
47 
48     boolean isBypassingRoleQualification();
49 
50     void setBypassingRoleQualification(boolean bypassRoleQualification);
51 
52     void setRoleNamesFromController(in List<String> roleNames);
53 
54     boolean addRoleHolderFromController(in String roleName, in String packageName);
55 
56     boolean removeRoleHolderFromController(in String roleName, in String packageName);
57 
58     List<String> getHeldRolesFromController(in String packageName);
59 
60     String getBrowserRoleHolder(int userId);
61 
62     boolean setBrowserRoleHolder(String packageName, int userId);
63 
64     String getSmsRoleHolder(int userId);
65 }
66