diff options
author | Andrew Lee <anwlee@google.com> | 2015-06-08 18:16:42 -0700 |
---|---|---|
committer | Andrew Lee <anwlee@google.com> | 2015-06-09 11:10:22 -0700 |
commit | 6a86690a2ad8f6c5068d901e6cbc368598e13ddc (patch) | |
tree | 41ba4aad764ec325e534c50a6c3cf417abcab512 /src/com/android/dialer | |
parent | 02db755505920f55d4f25a3a4d226795823e9b6a (diff) |
Fix some more unit tests...
+ Pull out voicemail playback tests into their own test class.
+ Fix CallDetailActivity unit tests.
+ Some minor tweaks to functional code to facilitate.
Bug: 21471763
Change-Id: I0f1747ab7ad6eba7dd2a7f6f8cfd060b409771bc
Diffstat (limited to 'src/com/android/dialer')
-rw-r--r-- | src/com/android/dialer/calllog/CallLogFragment.java | 1 | ||||
-rw-r--r-- | src/com/android/dialer/voicemail/VoicemailPlaybackPresenter.java | 12 |
2 files changed, 8 insertions, 5 deletions
diff --git a/src/com/android/dialer/calllog/CallLogFragment.java b/src/com/android/dialer/calllog/CallLogFragment.java index 845f91108..d57d87a81 100644 --- a/src/com/android/dialer/calllog/CallLogFragment.java +++ b/src/com/android/dialer/calllog/CallLogFragment.java @@ -191,6 +191,7 @@ 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 f06840139..da2a29cf7 100644 --- a/src/com/android/dialer/voicemail/VoicemailPlaybackPresenter.java +++ b/src/com/android/dialer/voicemail/VoicemailPlaybackPresenter.java @@ -98,7 +98,7 @@ public class VoicemailPlaybackPresenter VoicemailContract.Voicemails.HAS_CONTENT, }; - private static final int PLAYBACK_STREAM = AudioManager.STREAM_VOICE_CALL; + public static final int PLAYBACK_STREAM = AudioManager.STREAM_VOICE_CALL; private static final int NUMBER_OF_THREADS_IN_POOL = 2; // Time to wait for content to be fetched before timing out. private static final long FETCH_CONTENT_TIMEOUT_MS = 20000; @@ -145,8 +145,8 @@ public class VoicemailPlaybackPresenter private PowerManager.WakeLock mProximityWakeLock; private AudioManager mAudioManager; - public VoicemailPlaybackPresenter(Activity activity, Bundle savedInstanceState) { - mContext = activity; + public VoicemailPlaybackPresenter(Context context, Bundle savedInstanceState) { + mContext = context; mAsyncTaskExecutor = AsyncTaskExecutors.createAsyncTaskExecutor(); mAudioManager = (AudioManager) mContext.getSystemService(Context.AUDIO_SERVICE); @@ -174,8 +174,6 @@ public class VoicemailPlaybackPresenter mMediaPlayer.setOnPreparedListener(this); mMediaPlayer.setOnErrorListener(this); mMediaPlayer.setOnCompletionListener(this); - - activity.setVolumeControlStream(PLAYBACK_STREAM); } /** @@ -574,4 +572,8 @@ public class VoicemailPlaybackPresenter return mScheduledExecutorService; } + @VisibleForTesting + public boolean isPlaying() { + return mIsPlaying; + } } |