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

Commit 8bf0ed9c authored by Steve Kondik's avatar Steve Kondik Committed by Gerrit Code Review
Browse files

Merge "Fix exception in legacy USB support" into gingerbread

parents 120107b0 7dacc69c
Loading
Loading
Loading
Loading
+10 −5
Original line number Diff line number Diff line
@@ -378,9 +378,9 @@ public class UsbService extends IUsbManager.Stub {
    /* returns true if USB is in accessory mode */
    private boolean initFunctions(File dir, boolean useEnableFiles, char[] buffer) {
        boolean inAccessoryMode = false;
        try {
        File[] files = dir.listFiles();
        for (int i = 0; i < files.length; i++) {
            try {
                File file = useEnableFiles ? new File(files[i], "enable") : files[i];
                FileReader reader = new FileReader(file);
                int len = reader.read(buffer, 0, 1024);
@@ -402,9 +402,14 @@ public class UsbService extends IUsbManager.Stub {
                    mDisabledFunctions.add(functionName);
                }
            }
        } catch (Exception e) {
            catch(NumberFormatException nfe) {
                Slog.d(TAG, files[i].getName()+" contains non-numeric data");
            }
            catch (Exception e) {
                Slog.e(TAG, "" , e);
            }

        }
        return inAccessoryMode;
    }