Use new UsbManager#getPorts API

Test: - Looked as USB state in Settings
      - RunSettingsRoboTests
Bug: 115301401
Change-Id: I07ac20ac6a3f33d99e9edb6718318ede22681be1
This commit is contained in:
Philip P. Moltmann
2018-09-21 10:18:43 -07:00
parent 887fa5c646
commit 41061cb63e
13 changed files with 211 additions and 167 deletions

View File

@@ -16,6 +16,7 @@
package com.android.settings.connecteddevice.usb;
import static android.hardware.usb.UsbPortStatus.DATA_ROLE_DEVICE;
import static android.net.ConnectivityManager.TETHERING_USB;
import android.content.Context;
@@ -88,7 +89,7 @@ public class UsbDetailsFunctionsController extends UsbDetailsController
@Override
protected void refresh(boolean connected, long functions, int powerRole, int dataRole) {
if (!connected || dataRole != UsbPort.DATA_ROLE_DEVICE) {
if (!connected || dataRole != DATA_ROLE_DEVICE) {
mProfilesContainer.setEnabled(false);
} else {
// Functions are only available in device mode