From 267e9ebd056ec4973c4b37c38f949e863de4f24c Mon Sep 17 00:00:00 2001 From: Andrew Lee Date: Tue, 2 Jun 2015 16:43:01 -0700 Subject: Move VM playback from details to call log. - Delete voicemail playback in the CallDetailActivity. + Add voicemail playback to the call log list items. + Move the VoicemailPlaybackPresenter to the CallLogFragment. + Fix some retaining state for both call log (expanded items), and preserve rotation/state functionality for voicemail playback. This included some changes to the Presenter logic. + Fix some tests. Bug: 21471763 Bug: 21170557 Change-Id: I30aae3a52c5bbf74a5075a9666343c337b1fc0df --- src/com/android/dialer/CallDetailActivity.java | 58 -------------------------- 1 file changed, 58 deletions(-) (limited to 'src/com/android/dialer/CallDetailActivity.java') diff --git a/src/com/android/dialer/CallDetailActivity.java b/src/com/android/dialer/CallDetailActivity.java index ce29049d3..6da7c798c 100644 --- a/src/com/android/dialer/CallDetailActivity.java +++ b/src/com/android/dialer/CallDetailActivity.java @@ -61,8 +61,6 @@ import com.android.dialer.calllog.PhoneNumberUtilsWrapper; import com.android.dialer.util.IntentUtil; import com.android.dialer.util.DialerUtils; import com.android.dialer.util.TelecomUtil; -import com.android.dialer.voicemail.VoicemailPlaybackLayout; -import com.android.dialer.voicemail.VoicemailPlaybackPresenter; import java.util.List; @@ -218,8 +216,6 @@ public class CallDetailActivity extends Activity { /** Helper to load contact photos. */ private ContactPhotoManager mContactPhotoManager; - private VoicemailPlaybackPresenter mVoicemailPlaybackPresenter; - private Uri mVoicemailUri; private BidiFormatter mBidiFormatter = BidiFormatter.getInstance(); @@ -255,8 +251,6 @@ public class CallDetailActivity extends Activity { mContactInfoHelper = new ContactInfoHelper(this, GeoUtil.getCurrentCountryIso(this)); getActionBar().setDisplayHomeAsUpEnabled(true); - optionallyHandleVoicemail(); - if (getIntent().getBooleanExtra(EXTRA_FROM_NOTIFICATION, false)) { closeSystemDialogs(); } @@ -269,58 +263,6 @@ public class CallDetailActivity extends Activity { CallLogAsyncTaskUtil.getCallDetails(this, getCallLogEntryUris(), mCallLogAsyncTaskListener); } - @Override - public void onPause() { - if (mVoicemailPlaybackPresenter != null) { - mVoicemailPlaybackPresenter.onPause(isFinishing()); - } - super.onPause(); - } - - @Override - public void onDestroy() { - if (mVoicemailPlaybackPresenter != null) { - mVoicemailPlaybackPresenter.onDestroy(isFinishing()); - } - super.onDestroy(); - } - - @Override - public void onSaveInstanceState(Bundle outState) { - super.onSaveInstanceState(outState); - if (mVoicemailPlaybackPresenter != null) { - mVoicemailPlaybackPresenter.onSaveInstanceState(outState); - } - } - - @Override - public void onRestoreInstanceState(Bundle savedInstanceState) { - if (mVoicemailPlaybackPresenter != null) { - mVoicemailPlaybackPresenter.onRestoreInstanceState(savedInstanceState); - } - super.onRestoreInstanceState(savedInstanceState); - } - - /** - * Handle voicemail playback or hide voicemail ui. - *

- * If the Intent used to start this Activity contains the suitable extras, then start voicemail - * playback. If it doesn't, then don't inflate the voicemail ui. - */ - private void optionallyHandleVoicemail() { - if (hasVoicemail()) { - VoicemailPlaybackLayout voicemailPlaybackLayout = - (VoicemailPlaybackLayout) findViewById(R.id.voicemail_playback_layout); - - mVoicemailPlaybackPresenter = new VoicemailPlaybackPresenter(this); - mVoicemailPlaybackPresenter.setPlaybackView( - voicemailPlaybackLayout, mVoicemailUri, false /* startPlayingImmediately */); - - voicemailPlaybackLayout.setVisibility(View.VISIBLE); - CallLogAsyncTaskUtil.markVoicemailAsRead(this, mVoicemailUri); - } - } - private boolean hasVoicemail() { return mVoicemailUri != null; } -- cgit v1.2.3