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

Commit 6118745b authored by Lajos Molnar's avatar Lajos Molnar Committed by Android Git Automerger
Browse files

am ab62870c: Merge "MediaFormat: add getInteger with default value convenience method" into klp-dev

* commit 'ab62870c':
  MediaFormat: add getInteger with default value convenience method
parents 4895ec3d ab62870c
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -272,6 +272,20 @@ public final class MediaFormat {
        return ((Integer)mMap.get(name)).intValue();
    }

    /**
     * Returns the value of an integer key, or the default value if the
     * key is missing or is for another type value.
     * @hide
     */
    public final int getInteger(String name, int defaultValue) {
        try {
            return getInteger(name);
        }
        catch (NullPointerException  e) { /* no such field */ }
        catch (ClassCastException e) { /* field of different type */ }
        return defaultValue;
    }

    /**
     * Returns the value of a long key.
     */