summaryrefslogtreecommitdiff
path: root/services/usb/java
diff options
context:
space:
mode:
author Jerry Zhang <zhangjerry@google.com> 2017-08-22 17:37:09 -0700
committer Jerry Zhang <zhangjerry@google.com> 2017-08-23 11:10:44 -0700
commite537a8313987bd10208281c4fa5c6834b4fd1d15 (patch)
treece90d5768625db645a01cbd873cda36d6d57b65c /services/usb/java
parent07168bf44b97f3d9d6b80b615d983f0eba84254b (diff)
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
Diffstat (limited to 'services/usb/java')
-rw-r--r--services/usb/java/com/android/server/usb/UsbDeviceManager.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/services/usb/java/com/android/server/usb/UsbDeviceManager.java b/services/usb/java/com/android/server/usb/UsbDeviceManager.java
index 774bf438995c..7437332a05ed 100644
--- a/services/usb/java/com/android/server/usb/UsbDeviceManager.java
+++ b/services/usb/java/com/android/server/usb/UsbDeviceManager.java
@@ -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;
}