diff options
-rw-r--r-- | java/com/android/dialer/precall/impl/CallingAccountSelector.java | 2 | ||||
-rw-r--r-- | java/com/android/dialer/preferredsim/suggestion/SuggestionProvider.java | 2 | ||||
-rw-r--r-- | java/com/android/incallui/CallCardPresenter.java | 7 | ||||
-rw-r--r-- | java/com/android/incallui/InCallServiceImpl.java | 8 | ||||
-rw-r--r-- | java/com/android/incallui/call/DialerCall.java | 12 | ||||
-rw-r--r-- | packages.mk | 1 |
6 files changed, 23 insertions, 9 deletions
diff --git a/java/com/android/dialer/precall/impl/CallingAccountSelector.java b/java/com/android/dialer/precall/impl/CallingAccountSelector.java index e92832947..8d7d75952 100644 --- a/java/com/android/dialer/precall/impl/CallingAccountSelector.java +++ b/java/com/android/dialer/precall/impl/CallingAccountSelector.java @@ -266,7 +266,7 @@ public class CallingAccountSelector implements PreCallAction { hints.add(context.getString(R.string.pre_call_select_phone_account_hint_frequent)); break; default: - throw Assert.createAssertionFailException("unexpected reason " + suggestion.reason); + LogUtil.w("CallingAccountSelector.buildHint", "unhandled reason " + suggestion.reason); } } return hints; diff --git a/java/com/android/dialer/preferredsim/suggestion/SuggestionProvider.java b/java/com/android/dialer/preferredsim/suggestion/SuggestionProvider.java index bb50889ec..abb6e980a 100644 --- a/java/com/android/dialer/preferredsim/suggestion/SuggestionProvider.java +++ b/java/com/android/dialer/preferredsim/suggestion/SuggestionProvider.java @@ -36,6 +36,8 @@ public interface SuggestionProvider { // The user has select the SIM for this category of calls (contacts from certain accounts, // etc.). USER_SET, + // The user has selected the SIM for all contacts on the account. + ACCOUNT, } /** The suggestion. */ diff --git a/java/com/android/incallui/CallCardPresenter.java b/java/com/android/incallui/CallCardPresenter.java index bdbbe8f7c..da5d1a8dd 100644 --- a/java/com/android/incallui/CallCardPresenter.java +++ b/java/com/android/incallui/CallCardPresenter.java @@ -48,7 +48,6 @@ import com.android.dialer.common.Assert; import com.android.dialer.common.LogUtil; import com.android.dialer.compat.ActivityCompat; import com.android.dialer.configprovider.ConfigProviderBindings; -import com.android.dialer.feedback.FeedbackComponent; import com.android.dialer.logging.DialerImpression; import com.android.dialer.logging.Logger; import com.android.dialer.multimedia.MultimediaData; @@ -154,11 +153,6 @@ public class CallCardPresenter return !TextUtils.isEmpty(call.getCallSubject()); } - private void addCallFeedbackListener(Context context) { - LogUtil.d("CallCardPresenter.addCallFeedbackListener", "Adding call feedback listener"); - CallList.getInstance().addListener(FeedbackComponent.get(context).getCallFeedbackListener()); - } - @Override public void onInCallScreenDelegateInit(InCallScreen inCallScreen) { Assert.isNotNull(inCallScreen); @@ -173,7 +167,6 @@ public class CallCardPresenter this.inCallScreen.showNoteSentToast(); } call.addListener(this); - addCallFeedbackListener(context); // start processing lookups right away. if (!call.isConferenceCall()) { startContactInfoSearch(call, true, call.getState() == DialerCall.State.INCOMING); diff --git a/java/com/android/incallui/InCallServiceImpl.java b/java/com/android/incallui/InCallServiceImpl.java index 539dba8dd..1cb6c478e 100644 --- a/java/com/android/incallui/InCallServiceImpl.java +++ b/java/com/android/incallui/InCallServiceImpl.java @@ -24,6 +24,7 @@ import android.telecom.Call; import android.telecom.CallAudioState; import android.telecom.InCallService; import com.android.dialer.blocking.FilteredNumberAsyncQueryHandler; +import com.android.dialer.feedback.FeedbackComponent; import com.android.incallui.audiomode.AudioModeProvider; import com.android.incallui.call.CallList; import com.android.incallui.call.ExternalCallList; @@ -39,6 +40,7 @@ public class InCallServiceImpl extends InCallService { private ReturnToCallController returnToCallController; private NewReturnToCallController newReturnToCallController; + private CallList.Listener feedbackListener; @Override public void onCallAudioStateChanged(CallAudioState audioState) { @@ -102,6 +104,8 @@ public class InCallServiceImpl extends InCallService { newReturnToCallController = new NewReturnToCallController(this, ContactInfoCache.getInstance(context)); } + feedbackListener = FeedbackComponent.get(context).getCallFeedbackListener(); + CallList.getInstance().addListener(feedbackListener); IBinder iBinder = super.onBind(intent); Trace.endSection(); @@ -134,6 +138,10 @@ public class InCallServiceImpl extends InCallService { newReturnToCallController.tearDown(); newReturnToCallController = null; } + if (feedbackListener != null) { + CallList.getInstance().removeListener(feedbackListener); + feedbackListener = null; + } Trace.endSection(); } } diff --git a/java/com/android/incallui/call/DialerCall.java b/java/com/android/incallui/call/DialerCall.java index e581ba3b0..1785eceb4 100644 --- a/java/com/android/incallui/call/DialerCall.java +++ b/java/com/android/incallui/call/DialerCall.java @@ -173,6 +173,8 @@ public class DialerCall implements VideoTechListener, StateChangedListener, Capa private List<PhoneAccountHandle> callCapableAccounts; private String countryIso; + private volatile boolean feedbackRequested = false; + public static String getNumberFromHandle(Uri handle) { return handle == null ? "" : handle.getSchemeSpecificPart(); } @@ -438,7 +440,7 @@ public class DialerCall implements VideoTechListener, StateChangedListener, Capa /* package-private */ Call getTelecomCall() { return telecomCall; } - + public StatusHints getStatusHints() { return telecomCall.getDetails().getStatusHints(); } @@ -1450,6 +1452,14 @@ public class DialerCall implements VideoTechListener, StateChangedListener, Capa return selectedAvailableVideoTechType; } + public void markFeedbackRequested() { + feedbackRequested = true; + } + + public boolean isFeedbackRequested() { + return feedbackRequested; + } + /** * Specifies whether a number is in the call history or not. {@link #CALL_HISTORY_STATUS_UNKNOWN} * means there is no result. diff --git a/packages.mk b/packages.mk index 40e4d02b7..70707225a 100644 --- a/packages.mk +++ b/packages.mk @@ -32,6 +32,7 @@ LOCAL_AAPT_FLAGS := \ com.android.dialer.databasepopulator \ com.android.dialer.dialpadview \ com.android.dialer.enrichedcall.simulator \ + com.android.dialer.feedback \ com.android.dialer.interactions \ com.android.dialer.lettertile \ com.android.dialer.location \ |