Messaging: Remove compatibility for old android versions
Change-Id: Id9065d60525a509271a0e64c0e349e857cb998e2
This commit is contained in:
@@ -41,7 +41,6 @@ import com.android.messaging.ui.mediapicker.PausableChronometer;
|
||||
import com.android.messaging.util.Assert;
|
||||
import com.android.messaging.util.ContentType;
|
||||
import com.android.messaging.util.LogUtil;
|
||||
import com.android.messaging.util.MediaUtil;
|
||||
import com.android.messaging.util.UiUtils;
|
||||
|
||||
/**
|
||||
@@ -79,9 +78,6 @@ public class AudioAttachmentView extends LinearLayout {
|
||||
private int mThemeColor;
|
||||
|
||||
private boolean mStartPlayAfterPrepare;
|
||||
// should the MediaPlayer be prepared lazily when the user chooses to play the audio (as
|
||||
// opposed to preparing it early, on bind)
|
||||
private boolean mPrepareOnPlayback;
|
||||
private boolean mPrepared;
|
||||
private boolean mPlaybackFinished; // Was the audio played all the way to the end
|
||||
private final int mMode;
|
||||
@@ -148,12 +144,7 @@ public class AudioAttachmentView extends LinearLayout {
|
||||
return;
|
||||
}
|
||||
|
||||
if (mPrepareOnPlayback) {
|
||||
// For lazy preparation, the chronometer will only be shown during playback
|
||||
mChronometer.setVisibility(playing ? View.VISIBLE : View.INVISIBLE);
|
||||
} else {
|
||||
mChronometer.setVisibility(View.VISIBLE);
|
||||
}
|
||||
mChronometer.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -180,7 +171,6 @@ public class AudioAttachmentView extends LinearLayout {
|
||||
|
||||
mUseIncomingStyle = useIncomingStyle;
|
||||
mThemeColor = themeColor;
|
||||
mPrepareOnPlayback = incoming && !MediaUtil.canAutoAccessIncomingMedia();
|
||||
|
||||
if (!TextUtils.equals(currentUriString, newUriString)) {
|
||||
mDataSourceUri = dataSourceUri;
|
||||
@@ -216,7 +206,7 @@ public class AudioAttachmentView extends LinearLayout {
|
||||
}
|
||||
|
||||
/**
|
||||
* Prepare the MediaPlayer, and if mPrepareOnPlayback, start playing the audio
|
||||
* Prepare the MediaPlayer and start playing the audio
|
||||
*/
|
||||
private void setupMediaPlayer() {
|
||||
Assert.notNull(mDataSourceUri);
|
||||
@@ -332,7 +322,7 @@ public class AudioAttachmentView extends LinearLayout {
|
||||
updateVisualStyle();
|
||||
updateChronometerVisibility(false /* playing */);
|
||||
|
||||
if (mDataSourceUri != null && !mPrepareOnPlayback) {
|
||||
if (mDataSourceUri != null) {
|
||||
// Prepare the media player, so we can read the duration of the audio.
|
||||
setupMediaPlayer();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user