diff options
author | Michael W <baddaemon87@gmail.com> | 2022-03-18 20:23:26 +0100 |
---|---|---|
committer | Michael W <baddaemon87@gmail.com> | 2022-04-18 10:03:08 +0200 |
commit | fa6047db25729eebf26826f738d4a4ab2327a512 (patch) | |
tree | e94535bf44d25673adbf26f9262c5a56413f8280 /src/com/android/deskclock/AsyncRingtonePlayer.java | |
parent | 23d7064d1abf2feb41d3d1a1812038a26e836181 (diff) |
DeskClock: Remove compatibility to old APIsHEADsugisawa-mr1
* We never build on these, so the code and annotations are useless
Change-Id: I791370b531ecadcbddb63ca04d5c4c51aafe1bc1
Diffstat (limited to 'src/com/android/deskclock/AsyncRingtonePlayer.java')
-rw-r--r-- | src/com/android/deskclock/AsyncRingtonePlayer.java | 32 |
1 files changed, 11 insertions, 21 deletions
diff --git a/src/com/android/deskclock/AsyncRingtonePlayer.java b/src/com/android/deskclock/AsyncRingtonePlayer.java index afb46d664..09fb1ef64 100644 --- a/src/com/android/deskclock/AsyncRingtonePlayer.java +++ b/src/com/android/deskclock/AsyncRingtonePlayer.java @@ -220,15 +220,9 @@ public final class AsyncRingtonePlayer { checkAsyncRingtonePlayerThread(); if (mPlaybackDelegate == null) { - if (Utils.isMOrLater()) { - // Use the newer Ringtone-based playback delegate because it does not require - // any permissions to read from the SD card. (M+) - mPlaybackDelegate = new RingtonePlaybackDelegate(); - } else { - // Fall back to the older MediaPlayer-based playback delegate because it is the only - // way to force the looping of the ringtone before M. (pre M) - mPlaybackDelegate = new MediaPlayerPlaybackDelegate(); - } + // Use the newer Ringtone-based playback delegate because it does not require + // any permissions to read from the SD card. (M+) + mPlaybackDelegate = new RingtonePlaybackDelegate(); } return mPlaybackDelegate; @@ -345,12 +339,10 @@ public final class AsyncRingtonePlayer { } // Indicate the ringtone should be played via the alarm stream. - if (Utils.isLOrLater()) { - mMediaPlayer.setAudioAttributes(new AudioAttributes.Builder() - .setUsage(AudioAttributes.USAGE_ALARM) - .setContentType(AudioAttributes.CONTENT_TYPE_SONIFICATION) - .build()); - } + mMediaPlayer.setAudioAttributes(new AudioAttributes.Builder() + .setUsage(AudioAttributes.USAGE_ALARM) + .setContentType(AudioAttributes.CONTENT_TYPE_SONIFICATION) + .build()); // Check if we are in a call. If we are, use the in-call alarm resource at a low volume // to not disrupt the call. @@ -541,12 +533,10 @@ public final class AsyncRingtonePlayer { */ private boolean startPlayback(boolean inTelephoneCall) { // Indicate the ringtone should be played via the alarm stream. - if (Utils.isLOrLater()) { - mRingtone.setAudioAttributes(new AudioAttributes.Builder() - .setUsage(AudioAttributes.USAGE_ALARM) - .setContentType(AudioAttributes.CONTENT_TYPE_SONIFICATION) - .build()); - } + mRingtone.setAudioAttributes(new AudioAttributes.Builder() + .setUsage(AudioAttributes.USAGE_ALARM) + .setContentType(AudioAttributes.CONTENT_TYPE_SONIFICATION) + .build()); // Attempt to adjust the ringtone volume if the user is in a telephone call. boolean scheduleVolumeAdjustment = false; |