@DSComment("Private Method") @DSBan(DSCat.PRIVATE_METHOD) @DSGenerator( tool_name = "Doppelganger", tool_version = "2.0", generated_on = "2013-12-30 12:28:26.967 -0500", hash_original_method = "3D9FD67EE5212878A40EB00FDD255FB4", hash_generated_method = "64022A1AA54923F2F5BCB6D43B903CE2") private void openMediaPlayer() throws IOException { if (mAudio != null) { mAudio.release(); } mAudio = new MediaPlayer(); if (mUri != null) { mAudio.setDataSource(mContext, mUri); } else if (mFileDescriptor != null) { mAudio.setDataSource(mFileDescriptor); } else if (mAssetFileDescriptor != null) { // Note: using getDeclaredLength so that our behavior is the same // as previous versions when the content provider is returning // a full file. if (mAssetFileDescriptor.getDeclaredLength() < 0) { mAudio.setDataSource(mAssetFileDescriptor.getFileDescriptor()); } else { mAudio.setDataSource( mAssetFileDescriptor.getFileDescriptor(), mAssetFileDescriptor.getStartOffset(), mAssetFileDescriptor.getDeclaredLength()); } } else { throw new IOException("No data source set."); } mAudio.setAudioStreamType(mStreamType); mAudio.prepare(); }
/** Stops a playing ringtone. */ @DSGenerator( tool_name = "Doppelganger", tool_version = "2.0", generated_on = "2013-12-30 12:28:26.979 -0500", hash_original_method = "25B57E3869C6FCC0565FBD24EEAB9FA0", hash_generated_method = "D54276E98CE38A3B15A1D16585CD8968") public void stop() { if (mAudio != null) { mAudio.reset(); mAudio.release(); mAudio = null; } }