summaryrefslogtreecommitdiff
path: root/services/print
diff options
context:
space:
mode:
authorVladislav Kuzkokov <vkuzkokov@google.com>2018-02-23 17:45:21 +0100
committerVladislav Kuzkokov <vkuzkokov@google.com>2018-02-23 17:49:14 +0100
commitbc630497b490de679b6856801521dc4a36416325 (patch)
treecd4e4f862ad5d0dc84118071e31b0e88d4e249bd /services/print
parent427ef56c0f6f36fbf2f1e5902037a28f4cae09e0 (diff)
Check printing restriction for correct user.
Work profile uses the same instance of PrintManager and DPM as the primary user. We have to explicitly check restriction for calling user. Bug: 73768054 Test: Set restriction in Work profile, check that it applies only in work profile. Change-Id: Iaa63ce000fc84b7d0ee2bd0ff008f1c0f7272a87
Diffstat (limited to 'services/print')
-rw-r--r--services/print/java/com/android/server/print/PrintManagerService.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/services/print/java/com/android/server/print/PrintManagerService.java b/services/print/java/com/android/server/print/PrintManagerService.java
index e8620edc9d5e..83a125d1fc36 100644
--- a/services/print/java/com/android/server/print/PrintManagerService.java
+++ b/services/print/java/com/android/server/print/PrintManagerService.java
@@ -718,7 +718,8 @@ public final class PrintManagerService extends SystemService {
}
private boolean isPrintingEnabled() {
- return !mUserManager.hasUserRestriction(UserManager.DISALLOW_PRINTING);
+ return !mUserManager.hasUserRestriction(UserManager.DISALLOW_PRINTING,
+ Binder.getCallingUserHandle());
}
private void dump(@NonNull DualDumpOutputStream dumpStream,