Home
last modified time | relevance | path

Searched refs:role (Results 1 – 25 of 135) sorted by relevance

123456

/packages/apps/PermissionController/src/com/android/packageinstaller/role/service/
DRoleControllerServiceImpl.java17 package com.android.packageinstaller.role.service;
19 import android.app.role.RoleControllerService;
20 import android.app.role.RoleManager;
34 import com.android.packageinstaller.role.model.Role;
35 import com.android.packageinstaller.role.model.Roles;
36 import com.android.packageinstaller.role.utils.PackageUtils;
74 Role role = roleMap.valueAt(i); in onGrantDefaultRoles() local
76 if (!role.isAvailable(this)) { in onGrantDefaultRoles()
79 roles.add(role); in onGrantDefaultRoles()
80 String roleName = role.getName(); in onGrantDefaultRoles()
[all …]
DRoleSearchIndexablesProvider.java17 package com.android.packageinstaller.role.service;
29 import com.android.packageinstaller.role.model.Role;
30 import com.android.packageinstaller.role.model.Roles;
52 Role role = roles.valueAt(i); in queryRawData() local
56 if (!role.isAvailable(context) || !role.isVisible(context)) { in queryRawData()
63 String label = context.getString(role.getLabelResource()); in queryRawData()
64 boolean isExclusive = role.isExclusive(); in queryRawData()
73 role.getName(), context)) in queryRawData()
/packages/apps/PermissionController/src/com/android/packageinstaller/role/model/
DRoleBehavior.java17 package com.android.packageinstaller.role.model;
28 import com.android.packageinstaller.role.ui.TwoTargetPreference;
41 default void onRoleAdded(@NonNull Role role, @NonNull Context context) {} in onRoleAdded() argument
46 default boolean isAvailableAsUser(@NonNull Role role, @NonNull UserHandle user, in isAvailableAsUser() argument
55 default List<String> getDefaultHolders(@NonNull Role role, @NonNull Context context) { in getDefaultHolders() argument
63 default String getFallbackHolder(@NonNull Role role, @NonNull Context context) { in getFallbackHolder() argument
70 default boolean isVisibleAsUser(@NonNull Role role, @NonNull UserHandle user, in isVisibleAsUser() argument
79 default Intent getManageIntentAsUser(@NonNull Role role, @NonNull UserHandle user, in getManageIntentAsUser() argument
87 default void preparePreferenceAsUser(@NonNull Role role, in preparePreferenceAsUser() argument
94 default boolean isApplicationVisibleAsUser(@NonNull Role role, in isApplicationVisibleAsUser() argument
[all …]
DSmsRoleBehavior.java17 package com.android.packageinstaller.role.model;
29 import com.android.packageinstaller.role.utils.UserUtils;
44 public boolean isAvailableAsUser(@NonNull Role role, @NonNull UserHandle user, in isAvailableAsUser() argument
56 && getDefaultHolder(role, context) == null) { in isAvailableAsUser()
64 public String getFallbackHolder(@NonNull Role role, @NonNull Context context) { in getFallbackHolder() argument
65 String defaultPackageName = getDefaultHolder(role, context); in getFallbackHolder()
73 List<String> qualifyingPackageNames = role.getQualifyingPackagesAsUser( in getFallbackHolder()
79 private static String getDefaultHolder(@NonNull Role role, @NonNull Context context) { in getDefaultHolder() argument
80 return ExclusiveDefaultHolderMixin.getDefaultHolder(role, "config_defaultSms", context); in getDefaultHolder()
85 public CharSequence getConfirmationMessage(@NonNull Role role, @NonNull String packageName, in getConfirmationMessage() argument
[all …]
DAssistantRoleBehavior.java17 package com.android.packageinstaller.role.model;
21 import android.app.role.RoleManager;
42 import com.android.packageinstaller.role.utils.UserUtils;
64 public void onRoleAdded(@NonNull Role role, @NonNull Context context) { in onRoleAdded() argument
68 List<String> packageNames = roleManager.getRoleHolders(role.getName()); in onRoleAdded()
72 role.onNoneHolderSelectedAsUser(Process.myUserHandle(), context); in onRoleAdded()
78 public boolean isAvailableAsUser(@NonNull Role role, @NonNull UserHandle user, in isAvailableAsUser() argument
85 public String getFallbackHolder(@NonNull Role role, @NonNull Context context) { in getFallbackHolder() argument
86 return ExclusiveDefaultHolderMixin.getDefaultHolder(role, "config_defaultAssistant", in getFallbackHolder()
91 public boolean isVisibleAsUser(@NonNull Role role, @NonNull UserHandle user, in isVisibleAsUser() argument
[all …]
DHomeRoleBehavior.java17 package com.android.packageinstaller.role.model;
19 import android.app.role.RoleManager;
37 import com.android.packageinstaller.role.ui.TwoTargetPreference;
38 import com.android.packageinstaller.role.utils.UserUtils;
56 public boolean isAvailableAsUser(@NonNull Role role, @NonNull UserHandle user, in isAvailableAsUser() argument
66 public String getFallbackHolder(@NonNull Role role, @NonNull Context context) { in getFallbackHolder() argument
68 Intent intent = role.getRequiredComponents().get(0).getIntentFilterData().createIntent(); in getFallbackHolder()
96 public boolean isVisibleAsUser(@NonNull Role role, @NonNull UserHandle user, in isVisibleAsUser() argument
102 public void preparePreferenceAsUser(@NonNull Role role, @NonNull TwoTargetPreference preference, in preparePreferenceAsUser() argument
107 role.getName(), user)); in preparePreferenceAsUser()
[all …]
DBrowserRoleBehavior.java17 package com.android.packageinstaller.role.model;
31 import com.android.packageinstaller.role.utils.UserUtils;
54 public List<String> getDefaultHolders(@NonNull Role role, @NonNull Context context) { in getDefaultHolders() argument
55 return ExclusiveDefaultHolderMixin.getDefaultHolders(role, "config_defaultBrowser", in getDefaultHolders()
61 public String getFallbackHolder(@NonNull Role role, @NonNull Context context) { in getFallbackHolder() argument
62 List<String> packageNames = role.getQualifyingPackagesAsUser(Process.myUserHandle(), in getFallbackHolder()
75 public List<String> getQualifyingPackagesAsUser(@NonNull Role role, @NonNull UserHandle user, in getQualifyingPackagesAsUser() argument
82 public Boolean isPackageQualified(@NonNull Role role, @NonNull String packageName, in isPackageQualified() argument
117 public boolean isVisibleAsUser(@NonNull Role role, @NonNull UserHandle user, in isVisibleAsUser() argument
DDialerRoleBehavior.java17 package com.android.packageinstaller.role.model;
43 public boolean isAvailableAsUser(@NonNull Role role, @NonNull UserHandle user, in isAvailableAsUser() argument
50 public void prepareApplicationPreferenceAsUser(@NonNull Role role, in prepareApplicationPreferenceAsUser() argument
64 public CharSequence getConfirmationMessage(@NonNull Role role, @NonNull String packageName, in getConfirmationMessage() argument
66 return EncryptionUnawareConfirmationMixin.getConfirmationMessage(role, packageName, in getConfirmationMessage()
72 public String getFallbackHolder(@NonNull Role role, @NonNull Context context) { in getFallbackHolder() argument
73 return ExclusiveDefaultHolderMixin.getDefaultHolder(role, "config_defaultDialer", context); in getFallbackHolder()
77 public boolean isVisibleAsUser(@NonNull Role role, @NonNull UserHandle user, in isVisibleAsUser() argument
DEmergencyRoleBehavior.java17 package com.android.packageinstaller.role.model;
28 import com.android.packageinstaller.role.utils.PackageUtils;
42 public boolean isAvailableAsUser(@NonNull Role role, @NonNull UserHandle user, in isAvailableAsUser() argument
50 public String getFallbackHolder(@NonNull Role role, @NonNull Context context) { in getFallbackHolder() argument
51 List<String> packageNames = role.getQualifyingPackagesAsUser(Process.myUserHandle(), in getFallbackHolder()
71 public boolean isVisibleAsUser(@NonNull Role role, @NonNull UserHandle user, in isVisibleAsUser() argument
78 public CharSequence getConfirmationMessage(@NonNull Role role, @NonNull String packageName, in getConfirmationMessage() argument
80 return EncryptionUnawareConfirmationMixin.getConfirmationMessage(role, packageName, in getConfirmationMessage()
DExclusiveDefaultHolderMixin.java17 package com.android.packageinstaller.role.model;
29 import com.android.packageinstaller.role.utils.PackageUtils;
47 public static List<String> getDefaultHolders(@NonNull Role role, @NonNull String resourceName, in getDefaultHolders() argument
49 return CollectionUtils.singletonOrEmpty(getDefaultHolder(role, resourceName, context)); in getDefaultHolders()
56 public static String getDefaultHolder(@NonNull Role role, @NonNull String resourceName, in getDefaultHolder() argument
87 if (!role.isPackageQualified(packageName, context)) { in getDefaultHolder()
/packages/apps/PermissionController/src/com/android/packageinstaller/role/ui/
DRoleListLiveData.java17 package com.android.packageinstaller.role.ui;
19 import android.app.role.OnRoleHoldersChangedListener;
20 import android.app.role.RoleManager;
32 import com.android.packageinstaller.role.model.Role;
33 import com.android.packageinstaller.role.model.Roles;
34 import com.android.packageinstaller.role.utils.PackageUtils;
89 Role role = roles.valueAt(rolesIndex); in loadValueInBackground() local
91 if (role.isExclusive() != mExclusive) { in loadValueInBackground()
95 if (!role.isAvailableAsUser(mUser, mContext)) { in loadValueInBackground()
99 if (!role.isVisibleAsUser(mUser, mContext)) { in loadValueInBackground()
[all …]
DRequestRoleActivity.java17 package com.android.packageinstaller.role.ui;
19 import android.app.role.RoleManager;
37 import com.android.packageinstaller.role.model.Role;
38 import com.android.packageinstaller.role.model.Roles;
39 import com.android.packageinstaller.role.model.UserDeniedManager;
40 import com.android.packageinstaller.role.utils.PackageUtils;
95 Role role = Roles.get(this).get(mRoleName); in onCreate() local
96 if (role == null) { in onCreate()
104 if (!role.isAvailable(this)) { in onCreate()
112 if (!role.isVisible(this)) { in onCreate()
[all …]
DSpecialAppAccessActivity.java17 package com.android.packageinstaller.role.ui;
31 import com.android.packageinstaller.role.model.Role;
32 import com.android.packageinstaller.role.model.Roles;
33 import com.android.packageinstaller.role.ui.auto.AutoSpecialAppAccessFragment;
34 import com.android.packageinstaller.role.ui.handheld.HandheldSpecialAppAccessFragment;
71 Role role = Roles.get(this).get(roleName); in onCreate() local
72 if (role == null) { in onCreate()
77 if (!role.isAvailable(this)) { in onCreate()
82 if (!role.isVisible(this)) { in onCreate()
DSpecialAppAccessListChildFragment.java17 package com.android.packageinstaller.role.ui;
35 import com.android.packageinstaller.role.model.Role;
36 import com.android.packageinstaller.role.model.Roles;
98 Role role = roleItem.getRole(); in onRoleListChanged() local
100 role.getName()); in onRoleListChanged()
103 preference.setKey(role.getName()); in onRoleListChanged()
105 preference.setTitle(role.getShortLabelResource()); in onRoleListChanged()
110 role.preparePreferenceAsUser(preference, Process.myUserHandle(), context); in onRoleListChanged()
122 Role role = Roles.get(context).get(roleName); in onPreferenceClick() local
124 Intent intent = role.getManageIntentAsUser(user, context); in onPreferenceClick()
DDefaultAppActivity.java17 package com.android.packageinstaller.role.ui;
33 import com.android.packageinstaller.role.model.Role;
34 import com.android.packageinstaller.role.model.Roles;
35 import com.android.packageinstaller.role.ui.auto.AutoDefaultAppFragment;
36 import com.android.packageinstaller.role.ui.handheld.HandheldDefaultAppFragment;
83 Role role = Roles.get(this).get(roleName); in onCreate() local
84 if (role == null) { in onCreate()
89 if (!role.isAvailableAsUser(user, this)) { in onCreate()
94 if (!role.isVisibleAsUser(user, this)) { in onCreate()
DSpecialAppAccessViewModel.java17 package com.android.packageinstaller.role.ui;
35 import com.android.packageinstaller.role.model.Role;
36 import com.android.packageinstaller.role.utils.UserUtils;
57 public SpecialAppAccessViewModel(@NonNull Role role, @NonNull Application application) { in SpecialAppAccessViewModel() argument
60 mRole = role; in SpecialAppAccessViewModel()
63 RoleLiveData roleLiveData = new RoleLiveData(role, user, application); in SpecialAppAccessViewModel()
69 RoleLiveData workRoleLiveData = new RoleLiveData(role, workProfile, application); in SpecialAppAccessViewModel()
169 public Factory(@NonNull Role role, @NonNull Application application) { in Factory() argument
170 mRole = role; in Factory()
DRequestRoleViewModel.java17 package com.android.packageinstaller.role.ui;
26 import com.android.packageinstaller.role.model.Role;
33 public RequestRoleViewModel(@NonNull Role role, @NonNull Application application) { in RequestRoleViewModel() argument
34 super(role, Process.myUserHandle(), application); in RequestRoleViewModel()
48 public Factory(@NonNull Role role, @NonNull Application application) { in Factory() argument
49 mRole = role; in Factory()
DRoleLiveData.java17 package com.android.packageinstaller.role.ui;
19 import android.app.role.OnRoleHoldersChangedListener;
20 import android.app.role.RoleManager;
32 import com.android.packageinstaller.role.model.Role;
33 import com.android.packageinstaller.role.utils.PackageUtils;
53 public RoleLiveData(@NonNull Role role, @NonNull UserHandle user, @NonNull Context context) { in RoleLiveData() argument
54 mRole = role; in RoleLiveData()
DDefaultAppListChildFragment.java17 package com.android.packageinstaller.role.ui;
41 import com.android.packageinstaller.role.model.Role;
42 import com.android.packageinstaller.role.model.Roles;
164 Role role = roleItem.getRole(); in addPreferences() local
166 role.getName()); in addPreferences()
169 preference.setKey(role.getName()); in addPreferences()
171 preference.setTitle(role.getShortLabelResource()); in addPreferences()
186 role.preparePreferenceAsUser(preference, user, context); in addPreferences()
196 Role role = Roles.get(context).get(roleName); in onPreferenceClick() local
198 Intent intent = role.getManageIntentAsUser(user, context); in onPreferenceClick()
DDefaultAppViewModel.java17 package com.android.packageinstaller.role.ui;
33 import com.android.packageinstaller.role.model.Role;
56 public DefaultAppViewModel(@NonNull Role role, @NonNull UserHandle user, in DefaultAppViewModel() argument
60 mRole = role; in DefaultAppViewModel()
118 public Factory(@NonNull Role role, @NonNull UserHandle user, in Factory() argument
120 mRole = role; in Factory()
DRoleSortFunction.java17 package com.android.packageinstaller.role.ui;
47 Comparator<Pair<ApplicationInfo, Boolean>> labelComparator = Comparator.comparing(role -> in RoleSortFunction()
48 Utils.getAppLabel(role.first, context), collator); in RoleSortFunction()
49 Comparator<Pair<ApplicationInfo, Boolean>> userIdComparator = Comparator.comparingInt(role in RoleSortFunction()
50 -> UserHandle.getUserHandleForUid(role.first.uid).getIdentifier()); in RoleSortFunction()
DRoleItem.java17 package com.android.packageinstaller.role.ui;
23 import com.android.packageinstaller.role.model.Role;
44 public RoleItem(@NonNull Role role, @NonNull List<ApplicationInfo> holderApplicationInfos) { in RoleItem() argument
45 mRole = role; in RoleItem()
/packages/services/Car/tests/CarDeveloperOptions/src/com/android/car/developeroptions/connecteddevice/usb/
DUsbBackend.java116 public void setPowerRole(int role) { in setPowerRole() argument
119 switch (role) { in setPowerRole()
131 mPort.setRoles(role, newDataRole); in setPowerRole()
135 public void setDataRole(int role) { in setDataRole() argument
138 switch (role) { in setDataRole()
150 mPort.setRoles(newPowerRole, role); in setDataRole()
172 public static String dataRoleToString(int role) { in dataRoleToString() argument
173 return Integer.toString(role); in dataRoleToString()
176 public static int dataRoleFromString(String role) { in dataRoleFromString() argument
177 return Integer.parseInt(role); in dataRoleFromString()
/packages/apps/Settings/src/com/android/settings/connecteddevice/usb/
DUsbBackend.java116 public void setPowerRole(int role) { in setPowerRole() argument
119 switch (role) { in setPowerRole()
131 mPort.setRoles(role, newDataRole); in setPowerRole()
135 public void setDataRole(int role) { in setDataRole() argument
138 switch (role) { in setDataRole()
150 mPort.setRoles(newPowerRole, role); in setDataRole()
172 public static String dataRoleToString(int role) { in dataRoleToString() argument
173 return Integer.toString(role); in dataRoleToString()
176 public static int dataRoleFromString(String role) { in dataRoleFromString() argument
177 return Integer.parseInt(role); in dataRoleFromString()
/packages/apps/PermissionController/src/com/android/packageinstaller/
DPackageInstallerApplication.java25 import com.android.packageinstaller.role.model.Role;
26 import com.android.packageinstaller.role.model.Roles;
27 import com.android.packageinstaller.role.ui.SpecialAppAccessListActivity;
44 Role role = roles.valueAt(i); in updateSpecialAppAccessListActivityEnabledState() local
46 if (!role.isAvailable(this) || !role.isVisible(this)) { in updateSpecialAppAccessListActivityEnabledState()
49 if (!role.isExclusive()) { in updateSpecialAppAccessListActivityEnabledState()

123456