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
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user