Loading services/usb/java/com/android/server/usb/UsbDeviceManager.java +72 −57 Original line number Diff line number Diff line Loading @@ -169,6 +169,7 @@ public class UsbDeviceManager { public AdbSettingsObserver() { super(null); } @Override public void onChange(boolean selfChange) { boolean enable = (Settings.Global.getInt(mContentResolver, Loading Loading @@ -262,7 +263,8 @@ public class UsbDeviceManager { mNotificationManager.createNotificationChannel( new NotificationChannel(ADB_NOTIFICATION_CHANNEL_ID_TV, mContext.getString( com.android.internal.R.string.adb_debugging_notification_channel_tv), com.android.internal.R.string .adb_debugging_notification_channel_tv), NotificationManager.IMPORTANCE_HIGH)); } Loading Loading @@ -529,8 +531,10 @@ public class UsbDeviceManager { */ private void setEnabledFunctions(String functions, boolean forceRestart, boolean usbDataUnlocked) { if (DEBUG) Slog.d(TAG, "setEnabledFunctions functions=" + functions + ", " if (DEBUG) { Slog.d(TAG, "setEnabledFunctions functions=" + functions + ", " + "forceRestart=" + forceRestart); } if (usbDataUnlocked != mUsbDataUnlocked) { mUsbDataUnlocked = usbDataUnlocked; Loading Loading @@ -697,7 +701,8 @@ public class UsbDeviceManager { intent.putExtra(UsbManager.USB_CONNECTED, mConnected); intent.putExtra(UsbManager.USB_HOST_CONNECTED, mHostConnected); intent.putExtra(UsbManager.USB_CONFIGURED, mConfigured); intent.putExtra(UsbManager.USB_DATA_UNLOCKED, isUsbTransferAllowed() && mUsbDataUnlocked); intent.putExtra(UsbManager.USB_DATA_UNLOCKED, isUsbTransferAllowed() && mUsbDataUnlocked); intent.putExtra(UsbManager.USB_CONFIG_CHANGED, configChanged); if (mCurrentFunctions != null) { Loading Loading @@ -885,7 +890,9 @@ public class UsbDeviceManager { private void updateUsbNotification() { if (mNotificationManager == null || !mUseUsbNotification || ("0".equals(SystemProperties.get("persist.charging.notify")))) return; || ("0".equals(SystemProperties.get("persist.charging.notify")))) { return; } int id = 0; Resources r = mContext.getResources(); if (mConnected) { Loading Loading @@ -943,7 +950,8 @@ public class UsbDeviceManager { .setTicker(title) .setDefaults(0) // please be quiet .setColor(mContext.getColor( com.android.internal.R.color.system_notification_accent_color)) com.android.internal.R.color .system_notification_accent_color)) .setContentTitle(title) .setContentText(message) .setContentIntent(pi) Loading Loading @@ -982,7 +990,8 @@ public class UsbDeviceManager { .setTicker(title) .setDefaults(0) // please be quiet .setColor(mContext.getColor( com.android.internal.R.color.system_notification_accent_color)) com.android.internal.R.color .system_notification_accent_color)) .setContentTitle(title) .setContentText(message) .setContentIntent(pi) Loading Loading @@ -1038,7 +1047,8 @@ public class UsbDeviceManager { } /* opens the currently attached USB accessory */ public ParcelFileDescriptor openAccessory(UsbAccessory accessory, UsbUserSettingsManager settings) { public ParcelFileDescriptor openAccessory(UsbAccessory accessory, UsbUserSettingsManager settings) { UsbAccessory currentAccessory = mHandler.getCurrentAccessory(); if (currentAccessory == null) { throw new IllegalArgumentException("no accessory attached"); Loading @@ -1058,8 +1068,10 @@ public class UsbDeviceManager { } public void setCurrentFunctions(String functions, boolean usbDataUnlocked) { if (DEBUG) Slog.d(TAG, "setCurrentFunctions(" + functions + ", " + if (DEBUG) { Slog.d(TAG, "setCurrentFunctions(" + functions + ", " + usbDataUnlocked + ")"); } mHandler.sendMessage(MSG_SET_CURRENT_FUNCTIONS, functions, usbDataUnlocked); } Loading Loading @@ -1134,7 +1146,10 @@ public class UsbDeviceManager { } private native String[] nativeGetAccessoryStrings(); private native ParcelFileDescriptor nativeOpenAccessory(); private native boolean nativeIsStartRequested(); private native int nativeGetAudioMode(); } Loading
services/usb/java/com/android/server/usb/UsbDeviceManager.java +72 −57 Original line number Diff line number Diff line Loading @@ -169,6 +169,7 @@ public class UsbDeviceManager { public AdbSettingsObserver() { super(null); } @Override public void onChange(boolean selfChange) { boolean enable = (Settings.Global.getInt(mContentResolver, Loading Loading @@ -262,7 +263,8 @@ public class UsbDeviceManager { mNotificationManager.createNotificationChannel( new NotificationChannel(ADB_NOTIFICATION_CHANNEL_ID_TV, mContext.getString( com.android.internal.R.string.adb_debugging_notification_channel_tv), com.android.internal.R.string .adb_debugging_notification_channel_tv), NotificationManager.IMPORTANCE_HIGH)); } Loading Loading @@ -529,8 +531,10 @@ public class UsbDeviceManager { */ private void setEnabledFunctions(String functions, boolean forceRestart, boolean usbDataUnlocked) { if (DEBUG) Slog.d(TAG, "setEnabledFunctions functions=" + functions + ", " if (DEBUG) { Slog.d(TAG, "setEnabledFunctions functions=" + functions + ", " + "forceRestart=" + forceRestart); } if (usbDataUnlocked != mUsbDataUnlocked) { mUsbDataUnlocked = usbDataUnlocked; Loading Loading @@ -697,7 +701,8 @@ public class UsbDeviceManager { intent.putExtra(UsbManager.USB_CONNECTED, mConnected); intent.putExtra(UsbManager.USB_HOST_CONNECTED, mHostConnected); intent.putExtra(UsbManager.USB_CONFIGURED, mConfigured); intent.putExtra(UsbManager.USB_DATA_UNLOCKED, isUsbTransferAllowed() && mUsbDataUnlocked); intent.putExtra(UsbManager.USB_DATA_UNLOCKED, isUsbTransferAllowed() && mUsbDataUnlocked); intent.putExtra(UsbManager.USB_CONFIG_CHANGED, configChanged); if (mCurrentFunctions != null) { Loading Loading @@ -885,7 +890,9 @@ public class UsbDeviceManager { private void updateUsbNotification() { if (mNotificationManager == null || !mUseUsbNotification || ("0".equals(SystemProperties.get("persist.charging.notify")))) return; || ("0".equals(SystemProperties.get("persist.charging.notify")))) { return; } int id = 0; Resources r = mContext.getResources(); if (mConnected) { Loading Loading @@ -943,7 +950,8 @@ public class UsbDeviceManager { .setTicker(title) .setDefaults(0) // please be quiet .setColor(mContext.getColor( com.android.internal.R.color.system_notification_accent_color)) com.android.internal.R.color .system_notification_accent_color)) .setContentTitle(title) .setContentText(message) .setContentIntent(pi) Loading Loading @@ -982,7 +990,8 @@ public class UsbDeviceManager { .setTicker(title) .setDefaults(0) // please be quiet .setColor(mContext.getColor( com.android.internal.R.color.system_notification_accent_color)) com.android.internal.R.color .system_notification_accent_color)) .setContentTitle(title) .setContentText(message) .setContentIntent(pi) Loading Loading @@ -1038,7 +1047,8 @@ public class UsbDeviceManager { } /* opens the currently attached USB accessory */ public ParcelFileDescriptor openAccessory(UsbAccessory accessory, UsbUserSettingsManager settings) { public ParcelFileDescriptor openAccessory(UsbAccessory accessory, UsbUserSettingsManager settings) { UsbAccessory currentAccessory = mHandler.getCurrentAccessory(); if (currentAccessory == null) { throw new IllegalArgumentException("no accessory attached"); Loading @@ -1058,8 +1068,10 @@ public class UsbDeviceManager { } public void setCurrentFunctions(String functions, boolean usbDataUnlocked) { if (DEBUG) Slog.d(TAG, "setCurrentFunctions(" + functions + ", " + if (DEBUG) { Slog.d(TAG, "setCurrentFunctions(" + functions + ", " + usbDataUnlocked + ")"); } mHandler.sendMessage(MSG_SET_CURRENT_FUNCTIONS, functions, usbDataUnlocked); } Loading Loading @@ -1134,7 +1146,10 @@ public class UsbDeviceManager { } private native String[] nativeGetAccessoryStrings(); private native ParcelFileDescriptor nativeOpenAccessory(); private native boolean nativeIsStartRequested(); private native int nativeGetAudioMode(); }