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

Commit fa3566b7 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Make some minor improvements to MediaFormat" into rvc-dev am: 7c33cc55 am: 9f8f7a2a

Change-Id: I6d8e48d52cf7b9a42d65b393d971f7a7d3fff2bb
parents 68330b39 9f8f7a2a
Loading
Loading
Loading
Loading
+5 −9
Original line number Diff line number Diff line
@@ -1312,7 +1312,7 @@ public final class MediaFormat {
    }

    /**
     * Returns the value of an long key, or the default value if the key is missing.
     * Returns the value of a long key, or the default value if the key is missing.
     *
     * @return defaultValue if the key does not exist or the stored value for the key is null
     * @throws ClassCastException if the stored value for the key is int, float, ByteBuffer or
@@ -1340,19 +1340,15 @@ public final class MediaFormat {
    }

    /**
     * Returns the value of an float key, or the default value if the key is missing.
     * Returns the value of a float key, or the default value if the key is missing.
     *
     * @return defaultValue if the key does not exist or the stored value for the key is null
     * @throws ClassCastException if the stored value for the key is int, long, ByteBuffer or
     *         String
     */
    public final float getFloat(@NonNull String name, float defaultValue) {
        try {
            return getFloat(name);
        } catch (NullPointerException  e) {
            /* no such field or field is null */
            return defaultValue;
        }
        Object value = mMap.get(name);
        return value != null ? (float) value : defaultValue;
    }

    /**
@@ -1366,7 +1362,7 @@ public final class MediaFormat {
    }

    /**
     * Returns the value of an string key, or the default value if the key is missing.
     * Returns the value of a string key, or the default value if the key is missing.
     *
     * @return defaultValue if the key does not exist or the stored value for the key is null
     * @throws ClassCastException if the stored value for the key is int, long, float or ByteBuffer