diff options
author | Andrew Lee <anwlee@google.com> | 2015-06-18 18:56:21 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-06-18 18:56:22 +0000 |
commit | a6d65d510e9ca65b165c9ac41e8261abadb5536e (patch) | |
tree | 393db2a09742b6aea3c74f91cd8cb0de409cf47e /src | |
parent | e76e55547246f00563c865fe566e86f60fd4af54 (diff) | |
parent | efd863ad7b84562155e08435a0fd7adfe456b5cb (diff) |
Merge "Pass activity into VoicemailPlaybackPresenter." into mnc-dev
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/dialer/calllog/CallLogFragment.java | 1 | ||||
-rw-r--r-- | src/com/android/dialer/voicemail/VoicemailPlaybackPresenter.java | 8 |
2 files changed, 6 insertions, 3 deletions
diff --git a/src/com/android/dialer/calllog/CallLogFragment.java b/src/com/android/dialer/calllog/CallLogFragment.java index 6f9767c41..0f19f1491 100644 --- a/src/com/android/dialer/calllog/CallLogFragment.java +++ b/src/com/android/dialer/calllog/CallLogFragment.java @@ -188,7 +188,6 @@ public class CallLogFragment extends Fragment setHasOptionsMenu(true); mVoicemailPlaybackPresenter = new VoicemailPlaybackPresenter(activity, state); - activity.setVolumeControlStream(VoicemailPlaybackPresenter.PLAYBACK_STREAM); } /** Called by the CallLogQueryHandler when the list of calls has been fetched or updated. */ diff --git a/src/com/android/dialer/voicemail/VoicemailPlaybackPresenter.java b/src/com/android/dialer/voicemail/VoicemailPlaybackPresenter.java index cc6437627..60425e484 100644 --- a/src/com/android/dialer/voicemail/VoicemailPlaybackPresenter.java +++ b/src/com/android/dialer/voicemail/VoicemailPlaybackPresenter.java @@ -121,6 +121,7 @@ public class VoicemailPlaybackPresenter */ private final AtomicInteger mDuration = new AtomicInteger(0); + private Activity mActivity; private Context mContext; private PlaybackView mView; private static MediaPlayer mMediaPlayer; @@ -147,11 +148,14 @@ public class VoicemailPlaybackPresenter private PowerManager.WakeLock mProximityWakeLock; private AudioManager mAudioManager; - public VoicemailPlaybackPresenter(Context context, Bundle savedInstanceState) { - mContext = context; + public VoicemailPlaybackPresenter(Activity activity, Bundle savedInstanceState) { + mActivity = activity; + mContext = activity; mAsyncTaskExecutor = AsyncTaskExecutors.createAsyncTaskExecutor(); mAudioManager = (AudioManager) mContext.getSystemService(Context.AUDIO_SERVICE); + mActivity.setVolumeControlStream(VoicemailPlaybackPresenter.PLAYBACK_STREAM); + if (savedInstanceState != null) { // Restores playback state when activity is recreated, such as after rotation. mVoicemailUri = (Uri) savedInstanceState.getParcelable(VOICEMAIL_URI_KEY); |