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 
isRoleAvailable(in String roleName)28     boolean isRoleAvailable(in String roleName);
29 
isRoleHeld(in String roleName, in String packageName)30     boolean isRoleHeld(in String roleName, in String packageName);
31 
getRoleHoldersAsUser(in String roleName, int userId)32     List<String> getRoleHoldersAsUser(in String roleName, int userId);
33 
addRoleHolderAsUser(in String roleName, in String packageName, int flags, int userId, in RemoteCallback callback)34     void addRoleHolderAsUser(in String roleName, in String packageName, int flags, int userId,
35             in RemoteCallback callback);
36 
removeRoleHolderAsUser(in String roleName, in String packageName, int flags, int userId, in RemoteCallback callback)37     void removeRoleHolderAsUser(in String roleName, in String packageName, int flags, int userId,
38             in RemoteCallback callback);
39 
clearRoleHoldersAsUser(in String roleName, int flags, int userId, in RemoteCallback callback)40     void clearRoleHoldersAsUser(in String roleName, int flags, int userId,
41             in RemoteCallback callback);
42 
addOnRoleHoldersChangedListenerAsUser(IOnRoleHoldersChangedListener listener, int userId)43     void addOnRoleHoldersChangedListenerAsUser(IOnRoleHoldersChangedListener listener, int userId);
44 
removeOnRoleHoldersChangedListenerAsUser(IOnRoleHoldersChangedListener listener, int userId)45     void removeOnRoleHoldersChangedListenerAsUser(IOnRoleHoldersChangedListener listener,
46             int userId);
47 
setRoleNamesFromController(in List<String> roleNames)48     void setRoleNamesFromController(in List<String> roleNames);
49 
addRoleHolderFromController(in String roleName, in String packageName)50     boolean addRoleHolderFromController(in String roleName, in String packageName);
51 
removeRoleHolderFromController(in String roleName, in String packageName)52     boolean removeRoleHolderFromController(in String roleName, in String packageName);
53 
getHeldRolesFromController(in String packageName)54     List<String> getHeldRolesFromController(in String packageName);
55 
getDefaultSmsPackage(int userId)56     String getDefaultSmsPackage(int userId);
57 }
58