Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit faf9613a authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Do not declare USB support in the Emulator"

parents 7658dbe8 9b5ee823
Loading
Loading
Loading
Loading
+19 −1
Original line number Diff line number Diff line
@@ -314,10 +314,13 @@ public class UsbManager {
     * @return HashMap containing all connected USB devices.
     */
    public HashMap<String,UsbDevice> getDeviceList() {
        HashMap<String,UsbDevice> result = new HashMap<String,UsbDevice>();
        if (mService == null) {
            return result;
        }
        Bundle bundle = new Bundle();
        try {
            mService.getDeviceList(bundle);
            HashMap<String,UsbDevice> result = new HashMap<String,UsbDevice>();
            for (String name : bundle.keySet()) {
                result.put(name, (UsbDevice)bundle.get(name));
            }
@@ -359,6 +362,9 @@ public class UsbManager {
     * @return list of USB accessories, or null if none are attached.
     */
    public UsbAccessory[] getAccessoryList() {
        if (mService == null) {
            return null;
        }
        try {
            UsbAccessory accessory = mService.getCurrentAccessory();
            if (accessory == null) {
@@ -395,6 +401,9 @@ public class UsbManager {
     * @return true if caller has permission
     */
    public boolean hasPermission(UsbDevice device) {
        if (mService == null) {
            return false;
        }
        try {
            return mService.hasDevicePermission(device);
        } catch (RemoteException e) {
@@ -412,6 +421,9 @@ public class UsbManager {
     * @return true if caller has permission
     */
    public boolean hasPermission(UsbAccessory accessory) {
        if (mService == null) {
            return false;
        }
        try {
            return mService.hasAccessoryPermission(accessory);
        } catch (RemoteException e) {
@@ -529,6 +541,9 @@ public class UsbManager {
     * {@hide}
     */
    public boolean isFunctionEnabled(String function) {
        if (mService == null) {
            return false;
        }
        try {
            return mService.isFunctionEnabled(function);
        } catch (RemoteException e) {
@@ -586,6 +601,9 @@ public class UsbManager {
     * @hide
     */
    public UsbPort[] getPorts() {
        if (mService == null) {
            return null;
        }
        try {
            return mService.getPorts();
        } catch (RemoteException e) {