Code example for DrmManagerClient

Methods: canHandlegetOriginalMimeType

0
     * @return The original mime type of the file if DRM protected else the 
     *         currentMime 
     */ 
    public static String getOriginalMimeType(Context context, String path, String containingMime) {
        String result = containingMime;
        DrmManagerClient drmClient = new DrmManagerClient(context);
        try { 
            if (drmClient.canHandle(path, null)) {
                result = drmClient.getOriginalMimeType(path);
            } 
        } catch (IllegalArgumentException ex) {
            Log.w(TAG,
                    "Can't get original mime type since path is null or empty string."); 
        } catch (IllegalStateException ex) {
            Log.w(TAG, "DrmManagerClient didn't initialize properly.");
        } 
        return result;
    } 
}