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 import android.telephony.IFinancialSmsCallback; 23 24 /** 25 * @hide 26 */ 27 interface IRoleManager { 28 isRoleAvailable(in String roleName)29 boolean isRoleAvailable(in String roleName); 30 isRoleHeld(in String roleName, in String packageName)31 boolean isRoleHeld(in String roleName, in String packageName); 32 getRoleHoldersAsUser(in String roleName, int userId)33 List<String> getRoleHoldersAsUser(in String roleName, int userId); 34 addRoleHolderAsUser(in String roleName, in String packageName, int flags, int userId, in RemoteCallback callback)35 void addRoleHolderAsUser(in String roleName, in String packageName, int flags, int userId, 36 in RemoteCallback callback); 37 removeRoleHolderAsUser(in String roleName, in String packageName, int flags, int userId, in RemoteCallback callback)38 void removeRoleHolderAsUser(in String roleName, in String packageName, int flags, int userId, 39 in RemoteCallback callback); 40 clearRoleHoldersAsUser(in String roleName, int flags, int userId, in RemoteCallback callback)41 void clearRoleHoldersAsUser(in String roleName, int flags, int userId, 42 in RemoteCallback callback); 43 addOnRoleHoldersChangedListenerAsUser(IOnRoleHoldersChangedListener listener, int userId)44 void addOnRoleHoldersChangedListenerAsUser(IOnRoleHoldersChangedListener listener, int userId); 45 removeOnRoleHoldersChangedListenerAsUser(IOnRoleHoldersChangedListener listener, int userId)46 void removeOnRoleHoldersChangedListenerAsUser(IOnRoleHoldersChangedListener listener, 47 int userId); 48 setRoleNamesFromController(in List<String> roleNames)49 void setRoleNamesFromController(in List<String> roleNames); 50 addRoleHolderFromController(in String roleName, in String packageName)51 boolean addRoleHolderFromController(in String roleName, in String packageName); 52 removeRoleHolderFromController(in String roleName, in String packageName)53 boolean removeRoleHolderFromController(in String roleName, in String packageName); 54 getHeldRolesFromController(in String packageName)55 List<String> getHeldRolesFromController(in String packageName); 56 getDefaultSmsPackage(int userId)57 String getDefaultSmsPackage(int userId); 58 59 /** 60 * Get filtered SMS messages for financial app. 61 */ getSmsMessagesForFinancialApp(in String callingPkg, in Bundle params, in IFinancialSmsCallback callback)62 void getSmsMessagesForFinancialApp(in String callingPkg, in Bundle params, in IFinancialSmsCallback callback); 63 } 64