Lines Matching defs:ringtone

17 package com.android.deskclock.ringtone;
64 import static com.android.deskclock.ringtone.AddCustomRingtoneViewHolder.VIEW_TYPE_ADD_NEW;
65 import static com.android.deskclock.ringtone.HeaderViewHolder.VIEW_TYPE_ITEM_HEADER;
66 import static com.android.deskclock.ringtone.RingtoneViewHolder.VIEW_TYPE_CUSTOM_SOUND;
67 import static com.android.deskclock.ringtone.RingtoneViewHolder.VIEW_TYPE_SYSTEM_SOUND;
73 * <li>a ringtone representing pure silence</li>
74 * <li>a ringtone representing a default ringtone</li>
84 /** Key to an extra that identifies the alarm to which the selected ringtone is attached. */
87 /** Key to an extra that identifies the selected ringtone. */
90 /** Key to an extra that defines the uri representing the default ringtone. */
93 /** Key to an extra that defines the name of the default ringtone. */
96 /** Key to an instance state value indicating if the selected ringtone is currently playing. */
111 /** The title of the default ringtone. */
114 /** The uri of the default ringtone. */
117 /** The uri of the ringtone to select after data is loaded. */
123 /** Identifies the alarm to receive the selected ringtone; -1 indicates there is no alarm. */
126 /** The location of the custom ringtone to be removed. */
130 * @return an intent that launches the ringtone picker to edit the ringtone of the given
143 * @return an intent that launches the ringtone picker to edit the ringtone of all timers
233 // Start a background task to fetch the alarm whose ringtone must be updated.
246 // Update the default ringtone for future new alarms.
307 // Attempt to select the requested ringtone.
314 // Start playing the ringtone if indicated.
346 // Start a task to fetch the display name of the audio content and add the custom ringtone.
352 // Find the ringtone to be removed.
383 * The given {@code ringtone} will be selected as a side-effect of playing the ringtone.
385 * @param ringtone the ringtone to be played
387 private void startPlayingRingtone(RingtoneHolder ringtone) {
388 if (!ringtone.isPlaying() && !ringtone.isSilent()) {
389 RingtonePreviewKlaxon.start(getApplicationContext(), ringtone.getUri());
390 ringtone.setPlaying(true);
393 if (!ringtone.isSelected()) {
394 ringtone.setSelected(true);
395 mSelectedRingtoneUri = ringtone.getUri();
397 ringtone.notifyItemChanged();
401 * @param ringtone the ringtone to stop playing
402 * @param deselect {@code true} indicates the ringtone should also be deselected;
405 private void stopPlayingRingtone(RingtoneHolder ringtone, boolean deselect) {
406 if (ringtone == null) {
410 if (ringtone.isPlaying()) {
412 ringtone.setPlaying(false);
415 if (deselect && ringtone.isSelected()) {
416 ringtone.setSelected(false);
419 ringtone.notifyItemChanged();
423 * Proceeds with removing the custom ringtone with the given uri.
425 * @param toRemove identifies the custom ringtone to be removed
432 * This DialogFragment informs the user of the side-effects of removing a custom ringtone while
503 // Tapping the existing selection toggles playback of the ringtone.
531 * the audio content. It adds a custom ringtone using the uri and title on the main thread.
569 LogUtils.e("No ringtone for uri: %s", mUri);
572 LogUtils.e("Unable to locate title for custom ringtone: " + mUri, e);
580 // Add the new custom ringtone to the data model.
583 // When the loader completes, it must play the new ringtone.
594 * Removes a custom ringtone with the given uri. Taking this action has side-effects because
595 * all alarms that use the custom ringtone are reassigned to the Android system default alarm
596 * ringtone. If the application's default alarm ringtone is being removed, it is reset to the
597 * Android system default alarm ringtone. If the application's timer ringtone is being removed,
598 * it is reset to the application's default timer ringtone.
613 // Update all alarms that use the custom ringtone to use the system default.
639 // Reset the default alarm ringtone if it was just removed.
644 // Reset the timer ringtone if it was just removed.
650 // Remove the corresponding custom ringtone.
653 // Find the ringtone to be removed from the adapter.
659 // If the ringtone to remove is also the selected ringtone, adjust the selection.
670 // Remove the ringtone from the adapter.