diff options
author | Treehugger Robot <treehugger-gerrit@google.com> | 2017-10-30 17:19:04 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2017-10-30 17:19:04 +0000 |
commit | 1823bbbedc2ff08d2121a5e7e0e624a8dc2b4935 (patch) | |
tree | 91eb0d0c0a0a58f09e5aa348cdf706f6c89e71e8 /java/com/android/incallui/InCallPresenter.java | |
parent | cde445645e34e8a6a4b2cba48565c221a6596e85 (diff) | |
parent | 77cb8e5d86ebca9763cd06b5263dc02203576f40 (diff) |
Merge changes Iefdc2d0e,Ibccc610c
* changes:
Let InCallPresenter instead of StatusBarNotifier implement AudioModeListener.
Clear cached requested video state
Diffstat (limited to 'java/com/android/incallui/InCallPresenter.java')
-rw-r--r-- | java/com/android/incallui/InCallPresenter.java | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/java/com/android/incallui/InCallPresenter.java b/java/com/android/incallui/InCallPresenter.java index ed7b2c290..6c1c13027 100644 --- a/java/com/android/incallui/InCallPresenter.java +++ b/java/com/android/incallui/InCallPresenter.java @@ -28,6 +28,7 @@ import android.support.annotation.Nullable; import android.support.annotation.VisibleForTesting; import android.support.v4.os.UserManagerCompat; import android.telecom.Call.Details; +import android.telecom.CallAudioState; import android.telecom.DisconnectCause; import android.telecom.PhoneAccount; import android.telecom.PhoneAccountHandle; @@ -55,6 +56,7 @@ import com.android.dialer.telecom.TelecomUtil; import com.android.dialer.util.TouchPointManager; import com.android.incallui.InCallOrientationEventListener.ScreenOrientation; import com.android.incallui.answerproximitysensor.PseudoScreenState; +import com.android.incallui.audiomode.AudioModeProvider; import com.android.incallui.call.CallList; import com.android.incallui.call.DialerCall; import com.android.incallui.call.ExternalCallList; @@ -83,7 +85,7 @@ import java.util.concurrent.atomic.AtomicBoolean; * presenters that want to listen in on the in-call state changes. TODO: This class has become more * of a state machine at this point. Consider renaming. */ -public class InCallPresenter implements CallList.Listener { +public class InCallPresenter implements CallList.Listener, AudioModeProvider.AudioModeListener { private static final String PIXEL2017_SYSTEM_FEATURE = "com.google.android.feature.PIXEL_2017_EXPERIENCE"; private static final String EXTRA_FIRST_TIME_SHOWN = @@ -387,6 +389,8 @@ public class InCallPresenter implements CallList.Listener { .getSystemService(TelephonyManager.class) .listen(mPhoneStateListener, PhoneStateListener.LISTEN_CALL_STATE); + AudioModeProvider.getInstance().addListener(this); + LogUtil.d("InCallPresenter.setUp", "Finished InCallPresenter.setUp"); Trace.endSection(); } @@ -410,6 +414,7 @@ public class InCallPresenter implements CallList.Listener { attemptCleanup(); VideoPauseController.getInstance().tearDown(); + AudioModeProvider.getInstance().removeListener(this); } private void attemptFinishActivity() { @@ -1720,6 +1725,13 @@ public class InCallPresenter implements CallList.Listener { } } + @Override + public void onAudioStateChanged(CallAudioState audioState) { + if (mStatusBarNotifier != null) { + mStatusBarNotifier.updateNotification(); + } + } + /** All the main states of InCallActivity. */ public enum InCallState { // InCall Screen is off and there are no calls |