blob: d8cea2860aa84c0e4803812d1c5132886df6b130 [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;
Hongming Jin08496b02019-01-25 13:41:52 -080020import android.os.Bundle;
Hai Zhangf5e8ccd2019-03-06 20:12:24 -080021import android.os.RemoteCallback;
Hongming Jin08496b02019-01-25 13:41:52 -080022import android.telephony.IFinancialSmsCallback;
Hai Zhangb7776682018-09-25 15:10:57 -070023
24/**
25 * @hide
26 */
27interface IRoleManager {
28
29 boolean isRoleAvailable(in String roleName);
30
31 boolean isRoleHeld(in String roleName, in String packageName);
32
33 List<String> getRoleHoldersAsUser(in String roleName, int userId);
34
Hai Zhang71d70362019-02-04 16:17:38 -080035 void addRoleHolderAsUser(in String roleName, in String packageName, int flags, int userId,
Hai Zhangf5e8ccd2019-03-06 20:12:24 -080036 in RemoteCallback callback);
Hai Zhangb7776682018-09-25 15:10:57 -070037
Hai Zhang71d70362019-02-04 16:17:38 -080038 void removeRoleHolderAsUser(in String roleName, in String packageName, int flags, int userId,
Hai Zhangf5e8ccd2019-03-06 20:12:24 -080039 in RemoteCallback callback);
Hai Zhangb7776682018-09-25 15:10:57 -070040
Hai Zhang71d70362019-02-04 16:17:38 -080041 void clearRoleHoldersAsUser(in String roleName, int flags, int userId,
Hai Zhangf5e8ccd2019-03-06 20:12:24 -080042 in RemoteCallback callback);
Hai Zhang87ed09a2018-10-22 10:43:31 -070043
Hai Zhang31d06ba2018-12-06 18:14:42 -080044 void addOnRoleHoldersChangedListenerAsUser(IOnRoleHoldersChangedListener listener, int userId);
45
46 void removeOnRoleHoldersChangedListenerAsUser(IOnRoleHoldersChangedListener listener,
47 int userId);
48
Hai Zhang8e60a8f2018-11-20 11:21:09 -080049 void setRoleNamesFromController(in List<String> roleNames);
50
Hai Zhang87ed09a2018-10-22 10:43:31 -070051 boolean addRoleHolderFromController(in String roleName, in String packageName);
52
53 boolean removeRoleHolderFromController(in String roleName, in String packageName);
Eugene Suslaa2a80322018-12-12 17:09:38 -080054
55 List<String> getHeldRolesFromController(in String packageName);
Eugene Susla4ab95112018-12-17 14:45:11 -080056
57 String getDefaultSmsPackage(int userId);
Hai Zhangf5e8ccd2019-03-06 20:12:24 -080058
Hongming Jin08496b02019-01-25 13:41:52 -080059 /**
60 * Get filtered SMS messages for financial app.
61 */
62 void getSmsMessagesForFinancialApp(in String callingPkg, in Bundle params, in IFinancialSmsCallback callback);
Hai Zhangb7776682018-09-25 15:10:57 -070063}