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

Commit 21d71a4c authored by isaid's avatar isaid
Browse files

Redundant/duplicate method to close Streams

Fixes: 62304559
Test: the code compiles which mean polymorphism works. No additional
tests necessary
Change-Id: I3d366f12c1f176213979da6b050957bc2adb2938
parent 28f6dc95
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.