diff options
Diffstat (limited to 'InCallUI/src/com/android/incallui/CallButtonPresenter.java')
-rw-r--r-- | InCallUI/src/com/android/incallui/CallButtonPresenter.java | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/InCallUI/src/com/android/incallui/CallButtonPresenter.java b/InCallUI/src/com/android/incallui/CallButtonPresenter.java index 2e83e321d..35410261d 100644 --- a/InCallUI/src/com/android/incallui/CallButtonPresenter.java +++ b/InCallUI/src/com/android/incallui/CallButtonPresenter.java @@ -17,10 +17,10 @@ package com.android.incallui; import android.content.Context; +import android.os.Bundle; import android.telecom.AudioState; import android.telecom.InCallService.VideoCall; import android.telecom.PhoneCapabilities; -import android.telecom.TelecomManager; import android.telecom.VideoProfile; import com.android.incallui.AudioModeProvider.AudioModeListener; @@ -30,8 +30,6 @@ import com.android.incallui.InCallPresenter.InCallStateListener; import com.android.incallui.InCallPresenter.IncomingCallListener; import com.android.incallui.InCallPresenter.InCallDetailsListener; -import android.telephony.PhoneNumberUtils; - import java.util.Objects; /** @@ -41,6 +39,9 @@ public class CallButtonPresenter extends Presenter<CallButtonPresenter.CallButto implements InCallStateListener, AudioModeListener, IncomingCallListener, InCallDetailsListener, CanAddCallListener { + private static final String KEY_AUTOMATICALLY_MUTED = "incall_key_automatically_muted"; + private static final String KEY_PREVIOUS_MUTE_STATE = "incall_key_previous_mute_state"; + private Call mCall; private boolean mAutomaticallyMuted = false; private boolean mPreviousMuteState = false; @@ -232,7 +233,6 @@ public class CallButtonPresenter extends Presenter<CallButtonPresenter.CallButto mPreviousMuteState = AudioModeProvider.getInstance().getMute(); // Simulate a click on the mute button muteClicked(true); - TelecomAdapter.getInstance().addCall(); } @@ -468,6 +468,22 @@ public class CallButtonPresenter extends Presenter<CallButtonPresenter.CallButto mAutomaticallyMuted = false; } + @Override + public void onSaveInstanceState(Bundle outState) { + super.onSaveInstanceState(outState); + outState.putBoolean(KEY_AUTOMATICALLY_MUTED, mAutomaticallyMuted); + outState.putBoolean(KEY_PREVIOUS_MUTE_STATE, mPreviousMuteState); + } + + @Override + public void onRestoreInstanceState(Bundle savedInstanceState) { + mAutomaticallyMuted = + savedInstanceState.getBoolean(KEY_AUTOMATICALLY_MUTED, mAutomaticallyMuted); + mPreviousMuteState = + savedInstanceState.getBoolean(KEY_PREVIOUS_MUTE_STATE, mPreviousMuteState); + super.onRestoreInstanceState(savedInstanceState); + } + public interface CallButtonUi extends Ui { void setEnabled(boolean on); void setMute(boolean on); |