Example usage for android.drm DrmManagerClient release

List of usage examples for android.drm DrmManagerClient release

Introduction

In this page you can find the example usage for android.drm DrmManagerClient release.

Prototype

@Deprecated
public void release() 

Source Link

Usage

From source file:Main.java

/**
 * Return the original MIME type of the given file, using the DRM framework
 * if the file is protected content./*ww w  .  ja  v a2 s  .  c o m*/
 */
public static String getOriginalMimeType(Context context, File file, String currentMime) {
    final DrmManagerClient client = new DrmManagerClient(context);
    try {
        final String rawFile = file.toString();
        if (client.canHandle(rawFile, null)) {
            return client.getOriginalMimeType(rawFile);
        } else {
            return currentMime;
        }
    } finally {
        client.release();
    }
}