summaryrefslogtreecommitdiff
path: root/PermissionController/role-controller/java/com/android/role/controller/behavior/CompanionDeviceAppStreamingRoleBehavior.java
diff options
context:
space:
mode:
Diffstat (limited to 'PermissionController/role-controller/java/com/android/role/controller/behavior/CompanionDeviceAppStreamingRoleBehavior.java')
-rw-r--r--PermissionController/role-controller/java/com/android/role/controller/behavior/CompanionDeviceAppStreamingRoleBehavior.java16
1 files changed, 12 insertions, 4 deletions
diff --git a/PermissionController/role-controller/java/com/android/role/controller/behavior/CompanionDeviceAppStreamingRoleBehavior.java b/PermissionController/role-controller/java/com/android/role/controller/behavior/CompanionDeviceAppStreamingRoleBehavior.java
index 131690fd7..c164de3d8 100644
--- a/PermissionController/role-controller/java/com/android/role/controller/behavior/CompanionDeviceAppStreamingRoleBehavior.java
+++ b/PermissionController/role-controller/java/com/android/role/controller/behavior/CompanionDeviceAppStreamingRoleBehavior.java
@@ -17,12 +17,14 @@
package com.android.role.controller.behavior;
import android.content.Context;
+import android.os.UserHandle;
import androidx.annotation.NonNull;
import com.android.role.controller.model.Role;
import com.android.role.controller.model.RoleBehavior;
import com.android.role.controller.util.NotificationUtils;
+import com.android.role.controller.util.UserUtils;
/**
* Class for behavior of the "App Streaming" Companion device profile role.
@@ -30,12 +32,18 @@ import com.android.role.controller.util.NotificationUtils;
public class CompanionDeviceAppStreamingRoleBehavior implements RoleBehavior {
@Override
- public void grant(@NonNull Role role, @NonNull String packageName, @NonNull Context context) {
- NotificationUtils.grantNotificationAccessForPackage(context, packageName);
+ public void grantAsUser(@NonNull Role role, @NonNull String packageName,
+ @NonNull UserHandle user, @NonNull Context context) {
+ if (!UserUtils.isManagedProfile(user, context)) {
+ NotificationUtils.grantNotificationAccessForPackageAsUser(packageName, user, context);
+ }
}
@Override
- public void revoke(@NonNull Role role, @NonNull String packageName, @NonNull Context context) {
- NotificationUtils.revokeNotificationAccessForPackage(context, packageName);
+ public void revokeAsUser(@NonNull Role role, @NonNull String packageName,
+ @NonNull UserHandle user, @NonNull Context context) {
+ if (!UserUtils.isManagedProfile(user, context)) {
+ NotificationUtils.revokeNotificationAccessForPackageAsUser(packageName, user, context);
+ }
}
}