Reset functions to null when user changes.
When MTP or PTP is in the config and user changes, it clears dataUnlocked but sets the functions to mCurrentFunctions which will leave MTP or PTP in the config. If dataUnlocked is false, we want to remove MTP/PTP from the config when adb is enabled, and leave them in otherwise. This is done automatically by setting functions to null. Bug: 64822515 Test: Change users while adb / mtp connected. Change-Id: I82561f82e06f247c967438a473b08b5098d39ccb
This commit is contained in:
@@ -1017,7 +1017,7 @@ public class UsbDeviceManager {
|
||||
Slog.v(TAG, "Current user switched to " + msg.arg1
|
||||
+ "; resetting USB host stack for MTP or PTP");
|
||||
// avoid leaking sensitive data from previous user
|
||||
setEnabledFunctions(mCurrentFunctions, true, false);
|
||||
setEnabledFunctions(null, true, false);
|
||||
}
|
||||
mCurrentUser = msg.arg1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user