Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f081672f authored by Yorke Lee's avatar Yorke Lee Committed by Android Git Automerger
Browse files

am 0bb059d6: Don\'t auto expand next voicemail after deleting

* commit '0bb059d6':
  Don't auto expand next voicemail after deleting
parents 61f048a4 0bb059d6
Loading
Loading
Loading
Loading
+12 −1
Original line number Diff line number Diff line
@@ -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 {
@@ -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(
@@ -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.
+1 −0
Original line number Diff line number Diff line
@@ -185,6 +185,7 @@ public class VoicemailPlaybackLayout extends LinearLayout
            }
            mPresenter.pausePlayback();
            CallLogAsyncTaskUtil.deleteVoicemail(mContext, mVoicemailUri, null);
            mPresenter.onVoicemailDeleted();
        }
    };

+17 −0
Original line number Diff line number Diff line
@@ -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,
@@ -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.
@@ -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);