diff options
author | Treehugger Robot <treehugger-gerrit@google.com> | 2018-05-11 20:18:46 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2018-05-11 20:18:46 +0000 |
commit | 14ceb5d6cee235b772f5f3dba38802665f12ab66 (patch) | |
tree | 4e43dc9a6d507693e68e9fe32eba0201b843888b /java/com/android/incallui | |
parent | ced93f2d22bffce3b4cfb9c3bfce862b385537dd (diff) | |
parent | ef5c101361fc4cf23c12aa7ef24d027155b7554a (diff) |
Merge changes Ie424d231,Ied6072ca,I1902e527,Ie649a9fb,I11fc1a02, ...
* changes:
Use old BottomSheetBehavior.
Use listeners to drive fragment lifecycles.
Add SpamMetadata to SpamStatus
Prevent showDialpad from adding multiple instances of fragments
Update logging in incallactivity.
Revert null check on dialpadHint
Add @InstallIn and @IncludeInDialerRoot to dagger modules in dialer codebase.
Add RTT after call promo bottomsheet.
Diffstat (limited to 'java/com/android/incallui')
8 files changed, 47 insertions, 8 deletions
diff --git a/java/com/android/incallui/AnswerScreenPresenter.java b/java/com/android/incallui/AnswerScreenPresenter.java index e41bac606..8b789f317 100644 --- a/java/com/android/incallui/AnswerScreenPresenter.java +++ b/java/com/android/incallui/AnswerScreenPresenter.java @@ -176,9 +176,6 @@ public class AnswerScreenPresenter return; } incomingCall.setIsSpeakEasyCall(true); - InCallActivity inCallActivity = - (InCallActivity) answerScreen.getAnswerScreenFragment().getActivity(); - inCallActivity.onPrimaryCallStateChanged(); } @Override diff --git a/java/com/android/incallui/InCallActivity.java b/java/com/android/incallui/InCallActivity.java index 98f001925..70ba71ba1 100644 --- a/java/com/android/incallui/InCallActivity.java +++ b/java/com/android/incallui/InCallActivity.java @@ -1247,13 +1247,13 @@ public class InCallActivity extends TransactionSafeFragmentActivity ShouldShowUiResult shouldShowSpeakEasyUi = getShouldShowSpeakEasyUi(); LogUtil.i( "InCallActivity.showMainInCallFragment", - "shouldShowAnswerUi: %b, shouldShowRttUi: %b, shouldShowVideoUi: %b " - + "didShowAnswerScreen: %b, didShowInCallScreen: %b, didShowRttCallScreen: %b, " - + "didShowVideoCallScreen: %b" - + "didShowSpeakEasyScreen: %b", + "shouldShowAnswerUi: %b, shouldShowRttUi: %b, shouldShowVideoUi: %b, " + + "shouldShowSpeakEasyUi: %b, didShowAnswerScreen: %b, didShowInCallScreen: %b, " + + "didShowRttCallScreen: %b, didShowVideoCallScreen: %b, didShowSpeakEasyScreen: %b", shouldShowAnswerUi.shouldShow, shouldShowRttUi.shouldShow, shouldShowVideoUi.shouldShow, + shouldShowSpeakEasyUi.shouldShow, didShowAnswerScreen, didShowInCallScreen, didShowRttCallScreen, diff --git a/java/com/android/incallui/InCallPresenter.java b/java/com/android/incallui/InCallPresenter.java index ccc564806..da5d20fa3 100644 --- a/java/com/android/incallui/InCallPresenter.java +++ b/java/com/android/incallui/InCallPresenter.java @@ -990,6 +990,13 @@ public class InCallPresenter implements CallList.Listener, AudioModeProvider.Aud } @Override + public void onSpeakEasyStateChange() { + if (inCallActivity != null) { + inCallActivity.onPrimaryCallStateChanged(); + } + } + + @Override public void onSessionModificationStateChange(DialerCall call) { int newState = call.getVideoTech().getSessionModificationState(); LogUtil.i("InCallPresenter.onSessionModificationStateChange", "state: %d", newState); diff --git a/java/com/android/incallui/call/CallList.java b/java/com/android/incallui/call/CallList.java index 0e89ac75d..13be252dd 100644 --- a/java/com/android/incallui/call/CallList.java +++ b/java/com/android/incallui/call/CallList.java @@ -39,6 +39,7 @@ import com.android.dialer.logging.DialerImpression; import com.android.dialer.logging.Logger; import com.android.dialer.metrics.Metrics; import com.android.dialer.metrics.MetricsComponent; +import com.android.dialer.promotion.RttPromotion; import com.android.dialer.shortcuts.ShortcutUsageReporter; import com.android.dialer.spam.Spam; import com.android.dialer.spam.SpamComponent; @@ -226,6 +227,9 @@ public class CallList implements DialerCallDelegate { if (call.getState() == DialerCallState.INCOMING || call.getState() == DialerCallState.CALL_WAITING) { if (call.isActiveRttCall()) { + if (!call.isPhoneAccountRttCapable()) { + new RttPromotion(context).setShouldShow(true); + } Logger.get(context) .logCallImpression( DialerImpression.Type.INCOMING_RTT_CALL, @@ -816,6 +820,9 @@ public class CallList implements DialerCallDelegate { */ default void onUpgradeToRtt(DialerCall call, int rttRequestId) {} + /** Called when the SpeakEasy state of a Dialer call is mutated. */ + default void onSpeakEasyStateChange() {} + /** Called when the session modification state of a call changes. */ void onSessionModificationStateChange(DialerCall call); @@ -894,6 +901,13 @@ public class CallList implements DialerCallDelegate { } @Override + public void onDialerCallSpeakEasyStateChange() { + for (Listener listener : listeners) { + listener.onSpeakEasyStateChange(); + } + } + + @Override public void onDialerCallUpgradeToVideo() { for (Listener listener : listeners) { listener.onUpgradeToVideo(call); diff --git a/java/com/android/incallui/call/DialerCall.java b/java/com/android/incallui/call/DialerCall.java index 77e2ea30b..431634a0c 100644 --- a/java/com/android/incallui/call/DialerCall.java +++ b/java/com/android/incallui/call/DialerCall.java @@ -1067,7 +1067,7 @@ public class DialerCall implements VideoTechListener, StateChangedListener, Capa } @TargetApi(28) - public boolean canUpgradeToRttCall() { + public boolean isPhoneAccountRttCapable() { PhoneAccount phoneAccount = getPhoneAccount(); if (phoneAccount == null) { return false; @@ -1075,6 +1075,14 @@ public class DialerCall implements VideoTechListener, StateChangedListener, Capa if (!phoneAccount.hasCapabilities(PhoneAccount.CAPABILITY_RTT)) { return false; } + return true; + } + + @TargetApi(28) + public boolean canUpgradeToRttCall() { + if (!isPhoneAccountRttCapable()) { + return false; + } if (isActiveRttCall()) { return false; } @@ -1718,6 +1726,11 @@ public class DialerCall implements VideoTechListener, StateChangedListener, Capa /** Sets the user preference for SpeakEasy */ public void setIsSpeakEasyCall(boolean isSpeakEasyCall) { this.isSpeakEasyCall = isSpeakEasyCall; + if (listeners != null) { + for (DialerCallListener listener : listeners) { + listener.onDialerCallSpeakEasyStateChange(); + } + } } /** diff --git a/java/com/android/incallui/call/DialerCallListener.java b/java/com/android/incallui/call/DialerCallListener.java index 37c30d30c..a42ccbd66 100644 --- a/java/com/android/incallui/call/DialerCallListener.java +++ b/java/com/android/incallui/call/DialerCallListener.java @@ -31,6 +31,8 @@ public interface DialerCallListener { default void onDialerCallUpgradeToRtt(int rttRequestId) {} + default void onDialerCallSpeakEasyStateChange() {} + void onDialerCallSessionModificationStateChange(); void onWiFiToLteHandover(); diff --git a/java/com/android/incallui/calllocation/stub/StubCallLocationModule.java b/java/com/android/incallui/calllocation/stub/StubCallLocationModule.java index 20460699a..c60663bff 100644 --- a/java/com/android/incallui/calllocation/stub/StubCallLocationModule.java +++ b/java/com/android/incallui/calllocation/stub/StubCallLocationModule.java @@ -20,12 +20,15 @@ import android.content.Context; import android.support.annotation.NonNull; import android.support.v4.app.Fragment; import com.android.dialer.common.Assert; +import com.android.dialer.inject.DialerVariant; +import com.android.dialer.inject.InstallIn; import com.android.incallui.calllocation.CallLocation; import dagger.Binds; import dagger.Module; import javax.inject.Inject; /** This module provides an instance of call location. */ +@InstallIn(variants = {DialerVariant.DIALER_TEST}) @Module public abstract class StubCallLocationModule { diff --git a/java/com/android/incallui/speakeasy/StubSpeakEasyModule.java b/java/com/android/incallui/speakeasy/StubSpeakEasyModule.java index 960692b20..d5f644372 100644 --- a/java/com/android/incallui/speakeasy/StubSpeakEasyModule.java +++ b/java/com/android/incallui/speakeasy/StubSpeakEasyModule.java @@ -17,12 +17,15 @@ package com.android.incallui.speakeasy; import android.support.v4.app.Fragment; +import com.android.dialer.inject.DialerVariant; +import com.android.dialer.inject.InstallIn; import com.google.common.base.Optional; import dagger.Binds; import dagger.Module; import dagger.Provides; /** Module which binds {@link SpeakEasyCallManagerStub}. */ +@InstallIn(variants = {DialerVariant.DIALER_TEST}) @Module public abstract class StubSpeakEasyModule { |