Revert "Upgrade logging for UsbDeviceManager to narrow down bugs."
This reverts commit c889b4f4eb.
Merged-In: I74306bacad2a61471a9b8c9fd881229b22b6975e
Change-Id: I74306bacad2a61471a9b8c9fd881229b22b6975e
This commit is contained in:
@@ -63,7 +63,6 @@ import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.Random;
|
||||
import java.util.Scanner;
|
||||
import java.util.Set;
|
||||
|
||||
@@ -538,7 +537,6 @@ public class UsbDeviceManager {
|
||||
oldFunctions = UsbManager.USB_FUNCTION_NONE;
|
||||
}
|
||||
|
||||
Slog.i(TAG, "Setting adb to " + String.valueOf(enable));
|
||||
setEnabledFunctions(oldFunctions, true, mUsbDataUnlocked);
|
||||
updateAdbNotification();
|
||||
}
|
||||
@@ -766,16 +764,15 @@ public class UsbDeviceManager {
|
||||
|
||||
// send broadcast intent only if the USB state has changed
|
||||
if (!isUsbStateChanged(intent)) {
|
||||
Slog.i(TAG, "skip broadcasting " + intent + " extras: " + intent.getExtras());
|
||||
if (DEBUG) {
|
||||
Slog.d(TAG, "skip broadcasting " + intent + " extras: " + intent.getExtras());
|
||||
}
|
||||
return;
|
||||
}
|
||||
mBroadcastedIntent = intent;
|
||||
|
||||
Random rand = new Random();
|
||||
intent.putExtra("random_tag", rand.nextInt(1000));
|
||||
Slog.i(TAG, "broadcasting " + intent + " extras: " + intent.getExtras());
|
||||
if (DEBUG) Slog.d(TAG, "broadcasting " + intent + " extras: " + intent.getExtras());
|
||||
mContext.sendStickyBroadcastAsUser(intent, UserHandle.ALL);
|
||||
intent.removeExtra("random_tag");
|
||||
mBroadcastedIntent = intent;
|
||||
}
|
||||
|
||||
private void updateUsbFunctions() {
|
||||
@@ -844,7 +841,6 @@ public class UsbDeviceManager {
|
||||
updateUsbNotification();
|
||||
updateAdbNotification();
|
||||
if (mBootCompleted) {
|
||||
Slog.i(TAG, "update state " + mConnected + " " + mConfigured);
|
||||
updateUsbStateBroadcastIfNeeded(false);
|
||||
}
|
||||
if (UsbManager.containsFunction(mCurrentFunctions,
|
||||
@@ -854,7 +850,6 @@ public class UsbDeviceManager {
|
||||
if (mBootCompleted) {
|
||||
if (!mConnected) {
|
||||
// restore defaults when USB is disconnected
|
||||
Slog.i(TAG, "Disconnect, setting usb functions to null");
|
||||
setEnabledFunctions(null, !mAdbEnabled, false);
|
||||
}
|
||||
updateUsbFunctions();
|
||||
@@ -887,7 +882,6 @@ public class UsbDeviceManager {
|
||||
break;
|
||||
case MSG_SET_CURRENT_FUNCTIONS:
|
||||
String functions = (String) msg.obj;
|
||||
Slog.i(TAG, "Getting setFunction command for " + functions);
|
||||
setEnabledFunctions(functions, false, msg.arg1 == 1);
|
||||
break;
|
||||
case MSG_UPDATE_USER_RESTRICTIONS:
|
||||
@@ -895,8 +889,6 @@ public class UsbDeviceManager {
|
||||
final boolean forceRestart = mUsbDataUnlocked
|
||||
&& isUsbDataTransferActive()
|
||||
&& !isUsbTransferAllowed();
|
||||
Slog.i(TAG, "Updating user restrictions, force restart is "
|
||||
+ String.valueOf(forceRestart));
|
||||
setEnabledFunctions(
|
||||
mCurrentFunctions, forceRestart, mUsbDataUnlocked && !forceRestart);
|
||||
break;
|
||||
@@ -911,7 +903,6 @@ public class UsbDeviceManager {
|
||||
updateUsbStateBroadcastIfNeeded(false);
|
||||
mPendingBootBroadcast = false;
|
||||
}
|
||||
Slog.i(TAG, "Boot complete, setting default functions");
|
||||
setEnabledFunctions(null, false, false);
|
||||
if (mCurrentAccessory != null) {
|
||||
getCurrentSettings().accessoryAttached(mCurrentAccessory);
|
||||
@@ -929,7 +920,6 @@ 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
|
||||
Slog.i(TAG, "User Switched, kicking usb stack");
|
||||
setEnabledFunctions(mCurrentFunctions, true, false);
|
||||
}
|
||||
mCurrentUser = msg.arg1;
|
||||
|
||||
Reference in New Issue
Block a user