public static DrmConvertSession open(Context context,String mimeType){
  DrmManagerClient drmClient=null;
  int convertSessionId=-1;
  if (context != null && mimeType != null && !mimeType.equals("")) {
    try {
      drmClient=new DrmManagerClient(context);
      try {
        convertSessionId=drmClient.openConvertSession(mimeType);
      }
 catch (      IllegalArgumentException e) {
        Log.w(TAG,"Conversion of Mimetype: " + mimeType + " is not supported.",e);
      }
catch (      IllegalStateException e) {
        Log.w(TAG,"Could not access Open DrmFramework.",e);
      }
    }
 catch (    IllegalArgumentException e) {
      Log.w(TAG,"DrmManagerClient instance could not be created, context is Illegal.");
    }
catch (    IllegalStateException e) {
      Log.w(TAG,"DrmManagerClient didn't initialize properly.");
    }
  }
  if (drmClient == null || convertSessionId < 0) {
    return null;
  }
 else {
    return new DrmConvertSession(drmClient,convertSessionId);
  }
}

public static DrmConvertSession open ( Context context , String mimeType ) { DrmManagerClient drmClient = null ; int convertSessionId = - 1 ; if ( context != null && mimeType != null && ! mimeType . equals ( "" ) ) { try { drmClient = new DrmManagerClient ( context ) ; try { convertSessionId = drmClient . openConvertSession ( mimeType ) ; } catch ( IllegalArgumentException e ) { Log . w ( TAG , "Conversion of Mimetype: " + mimeType + " is not supported." , e ) ; } catch ( IllegalStateException e ) { Log . w ( TAG , "Could not access Open DrmFramework." , e ) ; } } catch ( IllegalArgumentException e ) { Log . w ( TAG , "DrmManagerClient instance could not be created, context is Illegal." ) ; } catch ( IllegalStateException e ) { Log . w ( TAG , "DrmManagerClient didn't initialize properly." ) ; } } if ( drmClient == null || convertSessionId < 0 ) { return null ; } else { return new DrmConvertSession ( drmClient , convertSessionId ) ; } }
start of converting a file .
