UsbDeviceManager: set mUsbDataUnlocked=false on user switch

Make sure access to MTP data is relocked when a user switch occurs.

Bug: 25288494
Change-Id: I69dafc7f51b847f4dba1993a85fb1a51df1a5e37
This commit is contained in:
Nick Kralevich
2015-10-29 12:45:23 -07:00
parent c3cd7b1585
commit 5701321701

View File

@@ -715,6 +715,8 @@ public class UsbDeviceManager {
if (active && mCurrentUser != UserHandle.USER_NULL) {
Slog.v(TAG, "Current user switched to " + mCurrentUser
+ "; resetting USB host stack for MTP or PTP");
// avoid leaking sensitive data from previous user
mUsbDataUnlocked = false;
setEnabledFunctions(mCurrentFunctions, true);
}
mCurrentUser = msg.arg1;