summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrew Lee <anwlee@google.com>2015-06-09 18:15:02 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2015-06-09 18:15:02 +0000
commit70486a1cc4ee0028a726d7b7777ee0a2fb6cd145 (patch)
tree6076ef79aec247ddfce1d7643d616ddfa8a8e56a /src
parenta61fa721b7194b6aee5dec4a441e8952b919f019 (diff)
parent6a86690a2ad8f6c5068d901e6cbc368598e13ddc (diff)
Merge "Fix some more unit tests..." into mnc-dev
Diffstat (limited to 'src')
-rw-r--r--src/com/android/dialer/calllog/CallLogFragment.java1
-rw-r--r--src/com/android/dialer/voicemail/VoicemailPlaybackPresenter.java12
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;
+ }
}