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

Commit 1fefc3c7 authored by Mikhail Naganov's avatar Mikhail Naganov Committed by Android (Google) Code Review
Browse files

Merge "MIDI: fix building of properties for the native side"

parents d67b4f53 33603ae9
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
@@ -20,6 +20,8 @@ import android.os.Bundle;
import android.os.Parcel;
import android.os.Parcelable;

import android.util.Log;

/**
 * This class contains information to describe a MIDI device.
 * For now we only have information that can be retrieved easily for USB devices,
@@ -352,9 +354,15 @@ public final class MidiDeviceInfo implements Parcelable {
    private Bundle getBasicProperties(String[] keys) {
        Bundle basicProperties = new Bundle();
        for (String key : keys) {
            String val = mProperties.getString(key);
            Object val = mProperties.get(key);
            if (val != null) {
                basicProperties.putString(key, val);
                if (val instanceof String) {
                    basicProperties.putString(key, (String) val);
                } else if (val instanceof Integer) {
                    basicProperties.putInt(key, (Integer) val);
                } else {
                    Log.w(TAG, "Unsupported property type: " + val.getClass().getName());
                }
            }
        }
        return basicProperties;