summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Alex Johnston <acjohnston@google.com> 2021-04-26 11:28:03 +0100
committer Alex Johnston <acjohnston@google.com> 2021-04-26 11:28:03 +0100
commit3eadf0dbc96a673dd736fb6a294287740ca8187f (patch)
treeb45f57035ffa4fd8012c597c4c3d2bbb86cbe3eb
parent6309cca5d93757ce1e916a519382b5e3ba2ddcf2 (diff)
DISALLOW_USB_FILE_TRANSFER update user restrictions
Background * On an org-owned device with a managed profile, the admin can apply some user restrictions on the personal profile (incl DISALLOW_USB_FILE_TRANSFER) * When the admin applied DISALLOW_USB_FILE_TRANSFER, the device should stop the existing 'File transfer' mode USB connnection. Change * The broadcast recevier in UsbService should pick up receive broadcast intents for all users. Manual testing * Set up device in COPE mode * Turn on USB 'File transfer' via Settings * Open internal storage on computer connected via USB and browse some files on the device * Apply DISALLOW_USB_FILE_TRANSFER * Verify device no longer shows up in internal storage Bug: 175757373 Test: manual testing atest UsbBackendTest Change-Id: I8d47e728a26ba99dc3b5223d0d7d29085484f8f0
-rw-r--r--services/usb/java/com/android/server/usb/UsbService.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/services/usb/java/com/android/server/usb/UsbService.java b/services/usb/java/com/android/server/usb/UsbService.java
index ac6b8fe0b970..3d3538d7ae49 100644
--- a/services/usb/java/com/android/server/usb/UsbService.java
+++ b/services/usb/java/com/android/server/usb/UsbService.java
@@ -200,7 +200,7 @@ public class UsbService extends IUsbManager.Stub {
final IntentFilter filter = new IntentFilter();
filter.setPriority(IntentFilter.SYSTEM_HIGH_PRIORITY);
filter.addAction(DevicePolicyManager.ACTION_DEVICE_POLICY_MANAGER_STATE_CHANGED);
- mContext.registerReceiver(receiver, filter, null, null);
+ mContext.registerReceiverAsUser(receiver, UserHandle.ALL, filter, null, null);
}
/**