Loading src/com/android/dialer/calllog/CallLogAdapter.java +12 −1 Original line number Diff line number Diff line Loading @@ -65,7 +65,9 @@ import java.util.HashMap; * Adapter class to fill in data for the Call Log. */ public class CallLogAdapter extends GroupingListAdapter implements ViewTreeObserver.OnPreDrawListener, CallLogGroupBuilder.GroupCreator { implements ViewTreeObserver.OnPreDrawListener, CallLogGroupBuilder.GroupCreator, VoicemailPlaybackPresenter.OnVoicemailDeletedListener { /** Interface used to initiate a refresh of the content. */ public interface CallFetcher { Loading Loading @@ -314,6 +316,9 @@ public class CallLogAdapter extends GroupingListAdapter mCallFetcher = callFetcher; mContactInfoHelper = contactInfoHelper; mVoicemailPlaybackPresenter = voicemailPlaybackPresenter; if (mVoicemailPlaybackPresenter != null) { mVoicemailPlaybackPresenter.setOnVoicemailDeletedListener(this); } mIsShowingRecentsTab = isShowingRecentsTab; mContactInfoCache = new ContactInfoCache( Loading Loading @@ -619,6 +624,12 @@ public class CallLogAdapter extends GroupingListAdapter return mIsShowingRecentsTab; } @Override public void onVoicemailDeleted(Uri uri) { mCurrentlyExpandedRowId = NO_EXPANDED_LIST_ITEM; mCurrentlyExpandedPosition = RecyclerView.NO_POSITION; } /** * Retrieves the day group of the previous call in the call log. Used to determine if the day * group has changed and to trigger display of the day group text. Loading src/com/android/dialer/voicemail/VoicemailPlaybackLayout.java +1 −0 Original line number Diff line number Diff line Loading @@ -185,6 +185,7 @@ public class VoicemailPlaybackLayout extends LinearLayout } mPresenter.pausePlayback(); CallLogAsyncTaskUtil.deleteVoicemail(mContext, mVoicemailUri, null); mPresenter.onVoicemailDeleted(); } }; Loading src/com/android/dialer/voicemail/VoicemailPlaybackPresenter.java +17 −0 Original line number Diff line number Diff line Loading @@ -92,6 +92,10 @@ public class VoicemailPlaybackPresenter void setPresenter(VoicemailPlaybackPresenter presenter, Uri voicemailUri); } public interface OnVoicemailDeletedListener { void onVoicemailDeleted(Uri uri); } /** The enumeration of {@link AsyncTask} objects we use in this class. */ public enum Tasks { CHECK_FOR_CONTENT, Loading Loading @@ -155,6 +159,8 @@ public class VoicemailPlaybackPresenter private PowerManager.WakeLock mProximityWakeLock; private AudioManager mAudioManager; private OnVoicemailDeletedListener mOnVoicemailDeletedListener; /** * Obtain singleton instance of this class. Use a single instance to provide a consistent * listener to the AudioManager when requesting and abandoning audio focus. Loading Loading @@ -708,10 +714,21 @@ public class VoicemailPlaybackPresenter return mAudioManager.isSpeakerphoneOn(); } public void setOnVoicemailDeletedListener(OnVoicemailDeletedListener listener) { mOnVoicemailDeletedListener = listener; } public int getMediaPlayerPosition() { return mIsPrepared && mMediaPlayer != null ? mMediaPlayer.getCurrentPosition() : 0; } /* package */ void onVoicemailDeleted() { // Trampoline the event notification to the interested listener if (mOnVoicemailDeletedListener != null) { mOnVoicemailDeletedListener.onVoicemailDeleted(mVoicemailUri); } } private static synchronized ScheduledExecutorService getScheduledExecutorServiceInstance() { if (mScheduledExecutorService == null) { mScheduledExecutorService = Executors.newScheduledThreadPool(NUMBER_OF_THREADS_IN_POOL); Loading Loading
src/com/android/dialer/calllog/CallLogAdapter.java +12 −1 Original line number Diff line number Diff line Loading @@ -65,7 +65,9 @@ import java.util.HashMap; * Adapter class to fill in data for the Call Log. */ public class CallLogAdapter extends GroupingListAdapter implements ViewTreeObserver.OnPreDrawListener, CallLogGroupBuilder.GroupCreator { implements ViewTreeObserver.OnPreDrawListener, CallLogGroupBuilder.GroupCreator, VoicemailPlaybackPresenter.OnVoicemailDeletedListener { /** Interface used to initiate a refresh of the content. */ public interface CallFetcher { Loading Loading @@ -314,6 +316,9 @@ public class CallLogAdapter extends GroupingListAdapter mCallFetcher = callFetcher; mContactInfoHelper = contactInfoHelper; mVoicemailPlaybackPresenter = voicemailPlaybackPresenter; if (mVoicemailPlaybackPresenter != null) { mVoicemailPlaybackPresenter.setOnVoicemailDeletedListener(this); } mIsShowingRecentsTab = isShowingRecentsTab; mContactInfoCache = new ContactInfoCache( Loading Loading @@ -619,6 +624,12 @@ public class CallLogAdapter extends GroupingListAdapter return mIsShowingRecentsTab; } @Override public void onVoicemailDeleted(Uri uri) { mCurrentlyExpandedRowId = NO_EXPANDED_LIST_ITEM; mCurrentlyExpandedPosition = RecyclerView.NO_POSITION; } /** * Retrieves the day group of the previous call in the call log. Used to determine if the day * group has changed and to trigger display of the day group text. Loading
src/com/android/dialer/voicemail/VoicemailPlaybackLayout.java +1 −0 Original line number Diff line number Diff line Loading @@ -185,6 +185,7 @@ public class VoicemailPlaybackLayout extends LinearLayout } mPresenter.pausePlayback(); CallLogAsyncTaskUtil.deleteVoicemail(mContext, mVoicemailUri, null); mPresenter.onVoicemailDeleted(); } }; Loading
src/com/android/dialer/voicemail/VoicemailPlaybackPresenter.java +17 −0 Original line number Diff line number Diff line Loading @@ -92,6 +92,10 @@ public class VoicemailPlaybackPresenter void setPresenter(VoicemailPlaybackPresenter presenter, Uri voicemailUri); } public interface OnVoicemailDeletedListener { void onVoicemailDeleted(Uri uri); } /** The enumeration of {@link AsyncTask} objects we use in this class. */ public enum Tasks { CHECK_FOR_CONTENT, Loading Loading @@ -155,6 +159,8 @@ public class VoicemailPlaybackPresenter private PowerManager.WakeLock mProximityWakeLock; private AudioManager mAudioManager; private OnVoicemailDeletedListener mOnVoicemailDeletedListener; /** * Obtain singleton instance of this class. Use a single instance to provide a consistent * listener to the AudioManager when requesting and abandoning audio focus. Loading Loading @@ -708,10 +714,21 @@ public class VoicemailPlaybackPresenter return mAudioManager.isSpeakerphoneOn(); } public void setOnVoicemailDeletedListener(OnVoicemailDeletedListener listener) { mOnVoicemailDeletedListener = listener; } public int getMediaPlayerPosition() { return mIsPrepared && mMediaPlayer != null ? mMediaPlayer.getCurrentPosition() : 0; } /* package */ void onVoicemailDeleted() { // Trampoline the event notification to the interested listener if (mOnVoicemailDeletedListener != null) { mOnVoicemailDeletedListener.onVoicemailDeleted(mVoicemailUri); } } private static synchronized ScheduledExecutorService getScheduledExecutorServiceInstance() { if (mScheduledExecutorService == null) { mScheduledExecutorService = Executors.newScheduledThreadPool(NUMBER_OF_THREADS_IN_POOL); Loading