diff options
author | Andrew Lee <anwlee@google.com> | 2015-06-17 19:40:19 -0700 |
---|---|---|
committer | Andrew Lee <anwlee@google.com> | 2015-06-18 11:43:30 -0700 |
commit | efd863ad7b84562155e08435a0fd7adfe456b5cb (patch) | |
tree | bc861a47931ff462d764d8da65c66f6ba623dcfa /src/com/android | |
parent | e445ae79d87f70f207c1a16a3585c03f577b901f (diff) |
Pass activity into VoicemailPlaybackPresenter.
We will use it to set windows flags to help make playback behaviors
reasonable.
Bug: 21856243
Change-Id: I7c1ecb9e225a507ea8956ccc31d667361a4b6824
Diffstat (limited to 'src/com/android')
-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); |