/** * Sets the {@link AudioAttributes} for this ringtone. * * @param attributes the non-null attributes characterizing this ringtone. */ public void setAudioAttributes(AudioAttributes attributes) throws IllegalArgumentException { if (attributes == null) { throw new IllegalArgumentException("Invalid null AudioAttributes for Ringtone"); } mAudioAttributes = attributes; // The audio attributes have to be set before the media player is prepared. // Re-initialize it. setUri(mUri); }