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

Commit 4f64bd56 authored by Isai Damier's avatar Isai Damier Committed by Android (Google) Code Review
Browse files

Merge "Redundant/duplicate method to close Streams Fixes: 62304559 Test: the...

Merge "Redundant/duplicate method to close Streams Fixes: 62304559 Test: the code compiles which mean polymorphism works. No additional tests necessary Change-Id: I3d366f12c1f176213979da6b050957bc2adb2938"
parents 18c44c5b 21d71a4c
Loading
Loading
Loading
Loading
+4 −13
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
package android.drm;

import java.io.BufferedInputStream;
import java.io.Closeable;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
@@ -79,26 +80,16 @@ public class DrmUtils {
        file.delete();
    }

    private static void quietlyDispose(InputStream stream) {
    private static void quietlyDispose(Closeable closable) {
        try {
            if (null != stream) {
                stream.close();
            if (null != closable) {
                closable.close();
            }
        } catch (IOException e) {
            // no need to care, at least as of now
        }
    }

    private static void quietlyDispose(OutputStream stream) {
        try {
            if (null != stream) {
                stream.close();
            }
        } catch (IOException e) {
            // no need to care
        }
    }

    /**
     * Gets an instance of {@link DrmUtils.ExtendedMetadataParser}, which can be used to parse
     * extended metadata embedded in DRM constraint information.