/packages/modules/Permission/PermissionController/role-controller/java/com/android/role/controller/service/ |
D | RoleControllerServiceImpl.java | 97 String roleName = role.getName(); in onGrantDefaultRoles() local 98 roleNames.add(roleName); in onGrantDefaultRoles() 99 if (!mUserRoleManager.isRoleAvailable(roleName)) { in onGrantDefaultRoles() 100 addedRoleNames.add(roleName); in onGrantDefaultRoles() 111 String roleName = addedRoleNames.valueAt(i); in onGrantDefaultRoles() local 113 Role role = roleMap.get(roleName); in onGrantDefaultRoles() 122 String roleName = role.getName(); in onGrantDefaultRoles() local 126 List<String> currentPackageNames = mUserRoleManager.getRoleHolders(roleName); in onGrantDefaultRoles() 142 + " package: " + packageName + ", role: " + roleName); in onGrantDefaultRoles() 149 currentPackageNames = mUserRoleManager.getRoleHolders(roleName); in onGrantDefaultRoles() [all …]
|
/packages/modules/Permission/service/java/com/android/role/ |
D | RoleUserState.java | 214 public boolean isFallbackEnabled(@NonNull String roleName) { in isFallbackEnabled() argument 216 return mFallbackEnabledRoles.contains(roleName); in isFallbackEnabled() 220 public void setFallbackEnabled(@NonNull String roleName, boolean fallbackEnabled) { in setFallbackEnabled() argument 222 if (!mRoles.containsKey(roleName)) { in setFallbackEnabled() 223 Log.e(LOG_TAG, "Cannot set fallback enabled for unknown role, role: " + roleName in setFallbackEnabled() 227 if (mFallbackEnabledRoles.contains(roleName) == fallbackEnabled) { in setFallbackEnabled() 231 mFallbackEnabledRoles.add(roleName); in setFallbackEnabled() 233 mFallbackEnabledRoles.remove(roleName); in setFallbackEnabled() 248 String roleName = legacyFallbackDisabledRoles.get(i); in upgradeVersion() local 249 mFallbackEnabledRoles.remove(roleName); in upgradeVersion() [all …]
|
D | RoleService.java | 426 public void onRoleHoldersChanged(@NonNull String roleName, @UserIdInt int userId) { in onRoleHoldersChanged() argument 427 mListenerHandler.post(() -> notifyRoleHoldersChanged(roleName, userId)); in onRoleHoldersChanged() 431 private void notifyRoleHoldersChanged(@NonNull String roleName, @UserIdInt int userId) { in notifyRoleHoldersChanged() argument 434 notifyRoleHoldersChangedForListeners(listeners, roleName, userId); in notifyRoleHoldersChanged() 440 notifyRoleHoldersChangedForListeners(allUsersListeners, roleName, userId); in notifyRoleHoldersChanged() 447 @NonNull String roleName, @UserIdInt int userId) { in notifyRoleHoldersChangedForListeners() argument 453 listener.onRoleHoldersChanged(roleName, userId); in notifyRoleHoldersChangedForListeners() 466 public boolean isRoleAvailableAsUser(@NonNull String roleName, @UserIdInt int userId) { in isRoleAvailableAsUser() argument 474 Preconditions.checkStringNotEmpty(roleName, "roleName cannot be null or empty"); in isRoleAvailableAsUser() 476 return getOrCreateUserState(userId).isRoleAvailable(roleName); in isRoleAvailableAsUser() [all …]
|
D | LocalRoleController.java | 62 public void onAddRoleHolder(@NonNull String roleName, @NonNull String packageName, in onAddRoleHolder() argument 65 boolean successful = mService.onAddRoleHolder(roleName, packageName, flags); in onAddRoleHolder() 71 public void onRemoveRoleHolder(@NonNull String roleName, @NonNull String packageName, in onRemoveRoleHolder() argument 74 boolean successful = mService.onRemoveRoleHolder(roleName, packageName, flags); in onRemoveRoleHolder() 80 public void onClearRoleHolders(@NonNull String roleName, in onClearRoleHolders() argument 83 boolean successful = mService.onClearRoleHolders(roleName, flags); in onClearRoleHolders() 89 public boolean isRoleVisible(@NonNull String roleName) { in isRoleVisible() argument 90 return mService.onIsRoleVisible(roleName); in isRoleVisible() 94 public boolean isApplicationVisibleForRole(@NonNull String roleName, in isApplicationVisibleForRole() argument 96 return mService.onIsApplicationVisibleForRole(roleName, packageName); in isApplicationVisibleForRole()
|
D | RemoteRoleController.java | 51 public void onAddRoleHolder(@NonNull String roleName, @NonNull String packageName, in onAddRoleHolder() argument 53 mRoleControllerManager.onAddRoleHolder(roleName, packageName, flags, callback); in onAddRoleHolder() 57 public void onRemoveRoleHolder(@NonNull String roleName, @NonNull String packageName, in onRemoveRoleHolder() argument 59 mRoleControllerManager.onRemoveRoleHolder(roleName, packageName, flags, callback); in onRemoveRoleHolder() 63 public void onClearRoleHolders(@NonNull String roleName, in onClearRoleHolders() argument 65 mRoleControllerManager.onClearRoleHolders(roleName, flags, callback); in onClearRoleHolders() 69 public boolean isRoleVisible(@NonNull String roleName) { in isRoleVisible() argument 74 public boolean isApplicationVisibleForRole(@NonNull String roleName, in isApplicationVisibleForRole() argument
|
D | RoleShellCommand.java | 118 String roleName = getNextArgRequired(); in runGetRoleHolders() local 120 List<String> roleHolders = mRoleManager.getRoleHoldersAsUser(roleName, userId); in runGetRoleHolders() 127 String roleName = getNextArgRequired(); in runAddRoleHolder() local 132 mRoleManager.addRoleHolderAsUser(roleName, packageName, flags, userId, in runAddRoleHolder() 139 String roleName = getNextArgRequired(); in runRemoveRoleHolder() local 144 mRoleManager.removeRoleHolderAsUser(roleName, packageName, flags, userId, in runRemoveRoleHolder() 151 String roleName = getNextArgRequired(); in runClearRoleHolders() local 155 mRoleManager.clearRoleHoldersAsUser(roleName, flags, userId, future.createCallback()); in runClearRoleHolders()
|
D | RoleController.java | 38 void onAddRoleHolder(@NonNull String roleName, @NonNull String packageName, in onAddRoleHolder() argument 44 void onRemoveRoleHolder(@NonNull String roleName, @NonNull String packageName, in onRemoveRoleHolder() argument 50 void onClearRoleHolders(@NonNull String roleName, in onClearRoleHolders() argument 56 boolean isRoleVisible(@NonNull String roleName); in isRoleVisible() argument 61 boolean isApplicationVisibleForRole(@NonNull String roleName, @NonNull String packageName); in isApplicationVisibleForRole() argument
|
/packages/modules/Permission/framework-s/java/android/app/role/ |
D | RoleControllerService.java | 100 public void onAddRoleHolder(String roleName, String packageName, int flags, in onBind() argument 105 mWorkerHandler.post(() -> RoleControllerService.this.onAddRoleHolder(roleName, in onBind() 110 public void onRemoveRoleHolder(String roleName, String packageName, int flags, in onBind() argument 115 mWorkerHandler.post(() -> RoleControllerService.this.onRemoveRoleHolder(roleName, in onBind() 120 public void onClearRoleHolders(String roleName, int flags, RemoteCallback callback) { in onBind() argument 124 mWorkerHandler.post(() -> RoleControllerService.this.onClearRoleHolders(roleName, in onBind() 136 public void isApplicationQualifiedForRole(String roleName, String packageName, in onBind() argument 143 Preconditions.checkStringNotEmpty(roleName, "roleName cannot be null or empty"); in onBind() 146 boolean qualified = onIsApplicationQualifiedForRole(roleName, packageName); in onBind() 155 public void isApplicationVisibleForRole(String roleName, String packageName, in onBind() argument [all …]
|
D | RoleManager.java | 301 public Intent createRequestRoleIntent(@NonNull String roleName) { in createRequestRoleIntent() argument 302 Preconditions.checkStringNotEmpty(roleName, "roleName cannot be null or empty"); in createRequestRoleIntent() 305 intent.putExtra(Intent.EXTRA_ROLE_NAME, roleName); in createRequestRoleIntent() 317 public boolean isRoleAvailable(@NonNull String roleName) { in isRoleAvailable() argument 318 Preconditions.checkStringNotEmpty(roleName, "roleName cannot be null or empty"); in isRoleAvailable() 321 return mService.isRoleAvailableAsUser(roleName, user.getIdentifier()); in isRoleAvailable() 335 public boolean isRoleHeld(@NonNull String roleName) { in isRoleHeld() argument 336 Preconditions.checkStringNotEmpty(roleName, "roleName cannot be null or empty"); in isRoleHeld() 339 return mService.isRoleHeldAsUser(roleName, mContext.getPackageName(), in isRoleHeld() 364 public List<String> getRoleHolders(@NonNull String roleName) { in getRoleHolders() argument [all …]
|
D | IRoleManager.aidl | 28 boolean isRoleAvailableAsUser(in String roleName, int userId); in isRoleAvailableAsUser() argument 30 boolean isRoleHeldAsUser(in String roleName, in String packageName, int userId); in isRoleHeldAsUser() argument 32 List<String> getRoleHoldersAsUser(in String roleName, int userId); in getRoleHoldersAsUser() argument 34 void addRoleHolderAsUser(in String roleName, in String packageName, int flags, int userId, in addRoleHolderAsUser() argument 37 void removeRoleHolderAsUser(in String roleName, in String packageName, int flags, int userId, in removeRoleHolderAsUser() argument 40 void clearRoleHoldersAsUser(in String roleName, int flags, int userId, in clearRoleHoldersAsUser() argument 43 String getDefaultApplicationAsUser(in String roleName, int userId); in getDefaultApplicationAsUser() argument 45 void setDefaultApplicationAsUser(in String roleName, in String packageName, int flags, in setDefaultApplicationAsUser() argument 57 boolean isRoleFallbackEnabledAsUser(in String roleName, int userId); in isRoleFallbackEnabledAsUser() argument 59 void setRoleFallbackEnabledAsUser(in String roleName, boolean fallbackEnabled, int userId); in setRoleFallbackEnabledAsUser() argument [all …]
|
D | IRoleController.aidl | 28 void onAddRoleHolder(in String roleName, in String packageName, int flags, in onAddRoleHolder() argument 31 void onRemoveRoleHolder(in String roleName, in String packageName, int flags, in onRemoveRoleHolder() argument 34 void onClearRoleHolders(in String roleName, int flags, in RemoteCallback callback); in onClearRoleHolders() argument 36 void isApplicationQualifiedForRole(in String roleName, in String packageName, in isApplicationQualifiedForRole() argument 39 void isApplicationVisibleForRole(in String roleName, in String packageName, in isApplicationVisibleForRole() argument 42 void isRoleVisible(in String roleName, in RemoteCallback callback); in isRoleVisible() argument
|
D | RoleControllerManager.java | 166 public void onAddRoleHolder(@NonNull String roleName, @NonNull String packageName, in onAddRoleHolder() argument 170 service.onAddRoleHolder(roleName, packageName, flags, in onAddRoleHolder() 182 public void onRemoveRoleHolder(@NonNull String roleName, @NonNull String packageName, in onRemoveRoleHolder() argument 186 service.onRemoveRoleHolder(roleName, packageName, flags, in onRemoveRoleHolder() 198 public void onClearRoleHolders(@NonNull String roleName, in onClearRoleHolders() argument 202 service.onClearRoleHolders(roleName, flags, createBooleanRemoteCallback(future)); in onClearRoleHolders() 214 public void isApplicationVisibleForRole(@NonNull String roleName, @NonNull String packageName, in isApplicationVisibleForRole() argument 218 service.isApplicationVisibleForRole(roleName, packageName, in isApplicationVisibleForRole() 231 public void isRoleVisible(@NonNull String roleName, in isRoleVisible() argument 235 service.isRoleVisible(roleName, createBooleanRemoteCallback(future)); in isRoleVisible()
|
/packages/modules/Permission/PermissionController/src/com/android/permissioncontroller/role/model/ |
D | UserDeniedManager.java | 70 public boolean isDeniedOnce(@NonNull String roleName, @NonNull String packageName) { in isDeniedOnce() argument 71 return isDenied(roleName, packageName, false); in isDeniedOnce() 80 public void setDeniedOnce(@NonNull String roleName, @NonNull String packageName) { in setDeniedOnce() argument 81 setDenied(roleName, packageName, false, true); in setDeniedOnce() 92 public boolean isDeniedAlways(@NonNull String roleName, @NonNull String packageName) { in isDeniedAlways() argument 93 return isDenied(roleName, packageName, true); in isDeniedAlways() 102 public void setDeniedAlways(@NonNull String roleName, @NonNull String packageName) { in setDeniedAlways() argument 103 setDenied(roleName, packageName, true, true); in setDeniedAlways() 112 public void clearDenied(@NonNull String roleName, @NonNull String packageName) { in clearDenied() argument 113 setDenied(roleName, packageName, false, false); in clearDenied() [all …]
|
/packages/modules/Permission/PermissionController/src/com/android/permissioncontroller/role/ui/wear/ |
D | WearRequestRoleFragment.kt | 48 private lateinit var roleName: String in <lambda>() variable in com.android.permissioncontroller.role.ui.wear.WearRequestRoleFragment 61 roleName = arguments?.getString(Intent.EXTRA_ROLE_NAME) ?: "" in <lambda>() 66 Roles.get(context)[roleName] in <lambda>() 68 Log.e(TAG, "Unknown role: $roleName") in <lambda>() 73 context.getSystemService(RoleManager::class.java)!!.getRoleHolders(roleName) in <lambda>() 77 "Application is already a role holder, role: $roleName, package: $packageName" in <lambda>() 117 roleName, in <lambda>() 128 "Request denied with don't ask again, role: $roleName" + in <lambda>() 143 Log.i(TAG, "Dialog cancelled, role: $roleName , package: $packageName") in <lambda>() 171 "Application added as a role holder, role: $roleName, package: " + in <lambda>() [all …]
|
D | WearDefaultAppFragment.kt | 51 val roleName = arguments?.getString(Intent.EXTRA_ROLE_NAME) ?: "" in onCreateView() constant 60 Roles.get(activity)[roleName] in onCreateView() 62 Log.e(TAG, "Unknown role: $roleName") in onCreateView() 111 fun newInstance(roleName: String, user: UserHandle): WearDefaultAppFragment { in newInstance() 115 putString(Intent.EXTRA_ROLE_NAME, roleName) in newInstance()
|
/packages/modules/Permission/PermissionController/src/com/android/permissioncontroller/role/ui/ |
D | ManageRoleHolderStateLiveData.java | 66 public void setRoleHolderAsUser(@NonNull String roleName, @NonNull String packageName, in setRoleHolderAsUser() argument 69 Log.e(LOG_TAG, "Already (tried) managing role holders, requested role: " + roleName in setRoleHolderAsUser() 75 + roleName + ", package: " + packageName); in setRoleHolderAsUser() 89 + " as role holder, role: " + roleName + ", package: " + packageName); in setRoleHolderAsUser() 95 + " package as role holder, role: " + roleName + ", package: " in setRoleHolderAsUser() 102 roleManager.addRoleHolderAsUser(roleName, packageName, flags, user, executor, callback); in setRoleHolderAsUser() 104 roleManager.removeRoleHolderAsUser(roleName, packageName, flags, user, executor, in setRoleHolderAsUser() 118 public void clearRoleHoldersAsUser(@NonNull String roleName, int flags, in clearRoleHoldersAsUser() argument 121 Log.e(LOG_TAG, "Already (tried) managing role holders, requested role: " + roleName); in clearRoleHoldersAsUser() 125 Log.i(LOG_TAG, "Clearing role holders, role: " + roleName); in clearRoleHoldersAsUser() [all …]
|
D | DefaultAppActivity.java | 55 public static Intent createIntent(@NonNull String roleName, @NonNull UserHandle user, in createIntent() argument 58 .putExtra(Intent.EXTRA_ROLE_NAME, roleName) in createIntent() 72 String roleName = intent.getStringExtra(Intent.EXTRA_ROLE_NAME); in onCreate() local 79 Role role = Roles.get(this).get(roleName); in onCreate() 81 Log.e(LOG_TAG, "Unknown role: " + roleName); in onCreate() 86 Log.e(LOG_TAG, "Role is unavailable: " + roleName); in onCreate() 92 Log.e(LOG_TAG, "Role is invisible: " + roleName); in onCreate() 100 fragment = AutoDefaultAppFragment.newInstance(roleName, user); in onCreate() 102 fragment = WearDefaultAppFragment.Companion.newInstance(roleName, user); in onCreate() 104 fragment = HandheldDefaultAppFragment.newInstance(roleName, user); in onCreate()
|
/packages/modules/Permission/PermissionController/src/com/android/permissioncontroller/permission/data/ |
D | RoleListenerMultiplexer.kt | 39 override fun onRoleHoldersChanged(roleName: String, user: UserHandle) { in <lambda>() 41 synchronized(lock) { callbacksCopy = callbacks[user]?.get(roleName)?.toList() } in <lambda>() 45 fun addCallback(roleName: String, user: UserHandle, callback: RoleHoldersChangeCallback) { in <lambda>() 51 userCallbacks.getOrPut(roleName, { mutableListOf() }).add(callback) in <lambda>() 59 fun removeCallback(roleName: String, user: UserHandle, callback: RoleHoldersChangeCallback) { in <lambda>() 63 if (!userCallbacks.contains(roleName)) { in <lambda>() 67 if (!userCallbacks[roleName]!!.remove(callback)) { in <lambda>() 71 if (userCallbacks[roleName]!!.isEmpty()) { in <lambda>() 72 userCallbacks.remove(roleName) in <lambda>()
|
D | RoleHoldersLiveData.kt | 35 private val roleName: String, constant in com.android.permissioncontroller.permission.data.RoleHoldersLiveData 43 RoleListenerMultiplexer.addCallback(roleName, user, this) in onActive() 48 RoleListenerMultiplexer.removeCallback(roleName, user, this) in onInactive() 52 postValue(roleManager.getRoleHoldersAsUser(roleName, user)) in loadDataAndPostValue()
|
/packages/apps/Car/SystemUI/src/com/android/systemui/car/systembar/ |
D | ButtonRoleHolderController.java | 79 String roleName = button.getRoleName(); in addAllButtonsWithRoleName() local 80 if (roleName != null && button.isDefaultAppIconForRoleEnabled()) { in addAllButtonsWithRoleName() 81 addButtonWithRoleName(button, roleName); in addAllButtonsWithRoleName() 91 private void addButtonWithRoleName(CarSystemBarButton button, String roleName) { in addButtonWithRoleName() argument 92 mButtonMap.put(roleName, button); in addButtonWithRoleName() 93 updateIcon(roleName); in addButtonWithRoleName() 110 void onRoleChanged(String roleName, UserHandle user) { in onRoleChanged() argument 111 if (RoleManager.ROLE_ASSISTANT.equals(roleName) in onRoleChanged() 113 updateIcon(roleName); in onRoleChanged() 117 private void updateIcon(String roleName) { in updateIcon() argument [all …]
|
/packages/modules/Permission/PermissionController/src/com/android/permissioncontroller/role/ui/specialappaccess/ |
D | SpecialAppAccessActivity.java | 52 public static Intent createIntent(@NonNull String roleName, @NonNull Context context) { in createIntent() argument 54 .putExtra(Intent.EXTRA_ROLE_NAME, roleName); in createIntent() 66 String roleName = getIntent().getStringExtra(Intent.EXTRA_ROLE_NAME); in onCreate() local 68 Role role = Roles.get(this).get(roleName); in onCreate() 70 Log.e(LOG_TAG, "Unknown role: " + roleName); in onCreate() 75 Log.e(LOG_TAG, "Role is unavailable: " + roleName); in onCreate() 81 Log.e(LOG_TAG, "Role is invisible: " + roleName); in onCreate() 89 fragment = AutoSpecialAppAccessFragment.newInstance(roleName); in onCreate() 91 fragment = HandheldSpecialAppAccessFragment.newInstance(roleName); in onCreate()
|
/packages/apps/Settings/src/com/android/settings/spa/app/appinfo/ |
D | DefaultAppShortcutPreference.kt | 48 val roleName: String, in <lambda>() constant in com.android.settings.spa.app.appinfo.DefaultAppShortcut 55 val presenter = remember(shortcut.roleName, app) { in <lambda>() 56 DefaultAppShortcutPresenter(context, shortcut.roleName, app) in <lambda>() 73 private val roleName: String, constant in com.android.settings.spa.app.appinfo.DefaultAppShortcutPresenter 91 roleManager.isRoleVisible(roleName, executor) { in isRoleVisible() 98 roleManager.isApplicationVisibleForRole(roleName, app.packageName, executor) { in isApplicationVisibleForRole() 106 val defaultApp = roleManager.getRoleHoldersAsUser(roleName, app.userHandle).firstOrNull() in getSummary() 114 putExtra(Intent.EXTRA_ROLE_NAME, roleName) in startActivity()
|
/packages/modules/Permission/PermissionController/role-controller/java/com/android/role/controller/util/ |
D | LegacyRoleFallbackEnabledUtils.java | 77 String roleName = key.substring(IS_NONE_ROLE_HOLDER_SELECTED_KEY.length()); in getFallbackDisabledRoles() local 78 fallbackDisabledRoles.add(roleName); in getFallbackDisabledRoles() 89 public static boolean isRoleFallbackEnabledAsUser(@NonNull String roleName, in isRoleFallbackEnabledAsUser() argument 92 .getBoolean(IS_NONE_ROLE_HOLDER_SELECTED_KEY + roleName, false); in isRoleFallbackEnabledAsUser() 98 public static void setRoleFallbackEnabledAsUser(@NonNull String roleName, in setRoleFallbackEnabledAsUser() argument 100 String key = IS_NONE_ROLE_HOLDER_SELECTED_KEY + roleName; in setRoleFallbackEnabledAsUser()
|
/packages/modules/Permission/tests/cts/role/src/android/app/role/cts/ |
D | RoleManagerTest.java | 443 private void requestRole(@NonNull String roleName) { in requestRole() argument 446 .putExtra(Intent.EXTRA_ROLE_NAME, roleName); in requestRole() 952 private void assertRoleIsHeld(@NonNull String roleName, boolean isHeld) in assertRoleIsHeld() argument 956 .putExtra(Intent.EXTRA_ROLE_NAME, roleName); in assertRoleIsHeld() 1339 private List<String> getRoleHolders(@NonNull String roleName) throws Exception { in getRoleHolders() argument 1340 return callWithShellPermissionIdentity(() -> sRoleManager.getRoleHolders(roleName)); in getRoleHolders() 1344 private List<String> getRoleHoldersAsUser(@NonNull String roleName, UserHandle userHandle) in getRoleHoldersAsUser() argument 1347 () -> sRoleManager.getRoleHoldersAsUser(roleName, userHandle)); in getRoleHoldersAsUser() 1350 private void assertIsRoleHolder(@NonNull String roleName, @NonNull String packageName, in assertIsRoleHolder() argument 1352 List<String> packageNames = getRoleHolders(roleName); in assertIsRoleHolder() [all …]
|
/packages/modules/Permission/tests/cts/role/CtsRoleTestApp/src/android/app/role/cts/app/ |
D | IsRoleHeldActivity.java | 36 String roleName = getIntent().getStringExtra(Intent.EXTRA_ROLE_NAME); in onCreate() local 37 if (TextUtils.isEmpty(roleName)) { in onCreate() 43 .putExtra(EXTRA_IS_ROLE_HELD, roleManager.isRoleHeld(roleName))); in onCreate()
|