Update AOSP Dialer source from internal google3 repository at
cl/158012278.
Test: make, treehugger
This CL updates the AOSP Dialer source with all the changes that have
gone into the private google3 repository. This includes all the
changes from cl/152373142 (4/06/2017) to cl/158012278 (6/05/2017).
This goal of these drops is to keep the AOSP source in sync with the
internal google3 repository. Currently these sync are done by hand
with very minor modifications to the internal source code.
See the Android.mk file for list of modifications.
Our current goal is to do frequent drops (daily if possible) and
eventually switched to an automated process.
Change-Id: I4d3f14b5140e2e51bead9497bc118a205b3ebe76
diff --git a/java/com/android/incallui/CallCardPresenter.java b/java/com/android/incallui/CallCardPresenter.java
index c2b99c1..cd06793 100644
--- a/java/com/android/incallui/CallCardPresenter.java
+++ b/java/com/android/incallui/CallCardPresenter.java
@@ -47,9 +47,6 @@
import com.android.dialer.common.ConfigProviderBindings;
import com.android.dialer.common.LogUtil;
import com.android.dialer.compat.ActivityCompat;
-import com.android.dialer.enrichedcall.EnrichedCallComponent;
-import com.android.dialer.enrichedcall.EnrichedCallManager;
-import com.android.dialer.enrichedcall.Session;
import com.android.dialer.logging.DialerImpression;
import com.android.dialer.logging.Logger;
import com.android.dialer.multimedia.MultimediaData;
@@ -85,8 +82,7 @@
InCallDetailsListener,
InCallEventListener,
InCallScreenDelegate,
- DialerCallListener,
- EnrichedCallManager.StateChangedListener {
+ DialerCallListener {
/**
* Amount of time to wait before sending an announcement via the accessibility manager. When the
@@ -376,6 +372,11 @@
@Override
public void onInternationalCallOnWifi() {}
+ @Override
+ public void onEnrichedCallSessionUpdate() {
+ updatePrimaryDisplayInfo();
+ }
+
/** Handles a change to the child number by refreshing the primary call info. */
@Override
public void onDialerCallChildNumberChange() {
@@ -418,12 +419,6 @@
updatePrimaryCallState();
}
- @Override
- public void onEnrichedCallStateChanged() {
- LogUtil.enterBlock("CallCardPresenter.onEnrichedCallStateChanged");
- updatePrimaryDisplayInfo();
- }
-
private boolean shouldRefreshPrimaryInfo(boolean primaryChanged) {
if (mPrimary == null) {
return false;
@@ -475,7 +470,8 @@
mPrimary.getConnectTimeMillis(),
CallerInfoUtils.isVoiceMailNumber(mContext, mPrimary),
mPrimary.isRemotelyHeld(),
- isBusiness));
+ isBusiness,
+ supports2ndCallOnHold()));
InCallActivity activity =
(InCallActivity) (mInCallScreen.getInCallScreenFragment().getActivity());
@@ -505,6 +501,15 @@
&& !mIsFullscreen;
}
+ private boolean supports2ndCallOnHold() {
+ DialerCall firstCall = CallList.getInstance().getActiveOrBackgroundCall();
+ DialerCall incomingCall = CallList.getInstance().getIncomingCall();
+ if (firstCall != null && incomingCall != null && firstCall != incomingCall) {
+ return incomingCall.can(Details.CAPABILITY_HOLD);
+ }
+ return true;
+ }
+
@Override
public void onCallStateButtonClicked() {
Intent broadcastIntent = Bindings.get(mContext).getCallStateButtonBroadcastIntent(mContext);
@@ -666,26 +671,8 @@
boolean hasWorkCallProperty = mPrimary.hasProperty(PROPERTY_ENTERPRISE_CALL);
MultimediaData multimediaData = null;
- if (mPrimary.getNumber() != null) {
- EnrichedCallManager manager = EnrichedCallComponent.get(mContext).getEnrichedCallManager();
-
- EnrichedCallManager.Filter filter;
- if (mPrimary.isIncoming()) {
- filter = manager.createIncomingCallComposerFilter();
- } else {
- filter = manager.createOutgoingCallComposerFilter();
- }
-
- Session enrichedCallSession =
- manager.getSession(mPrimary.getUniqueCallId(), mPrimary.getNumber(), filter);
-
- mPrimary.setEnrichedCallSession(enrichedCallSession);
- mPrimary.setEnrichedCallCapabilities(manager.getCapabilities(mPrimary.getNumber()));
-
- if (enrichedCallSession != null) {
- enrichedCallSession.setUniqueDialerCallId(mPrimary.getUniqueCallId());
- multimediaData = enrichedCallSession.getMultimediaData();
- }
+ if (mPrimary.getEnrichedCallSession() != null) {
+ multimediaData = mPrimary.getEnrichedCallSession().getMultimediaData();
}
if (mPrimary.isConferenceCall()) {
@@ -696,7 +683,8 @@
mInCallScreen.setPrimary(
new PrimaryInfo(
null /* number */,
- getConferenceString(mPrimary),
+ CallerInfoUtils.getConferenceString(
+ mContext, mPrimary.hasProperty(Details.PROPERTY_GENERIC_CONFERENCE)),
false /* nameIsNumber */,
null /* location */,
null /* label */,
@@ -880,7 +868,8 @@
mInCallScreen.setSecondary(
new SecondaryInfo(
true /* show */,
- getConferenceString(mSecondary),
+ CallerInfoUtils.getConferenceString(
+ mContext, mSecondary.hasProperty(Details.PROPERTY_GENERIC_CONFERENCE)),
false /* nameIsNumber */,
null /* label */,
mSecondary.getCallProviderLabel(),
@@ -972,7 +961,7 @@
}
/** Gets the name to display for the call. */
- String getNameForCall(ContactCacheEntry contactInfo) {
+ private String getNameForCall(ContactCacheEntry contactInfo) {
String preferredName =
ContactDisplayUtils.getPreferredDisplayName(
contactInfo.namePrimary, contactInfo.nameAlternative, mContactsPreferences);
@@ -982,19 +971,6 @@
return preferredName;
}
- /** Gets the number to display for a call. */
- String getNumberForCall(ContactCacheEntry contactInfo) {
- // If the name is empty, we use the number for the name...so don't show a second
- // number in the number field
- String preferredName =
- ContactDisplayUtils.getPreferredDisplayName(
- contactInfo.namePrimary, contactInfo.nameAlternative, mContactsPreferences);
- if (TextUtils.isEmpty(preferredName)) {
- return contactInfo.location;
- }
- return contactInfo.number;
- }
-
@Override
public void onSecondaryInfoClicked() {
if (mSecondary == null) {
@@ -1035,15 +1011,6 @@
return mPrimary != null && mPrimary.getState() == DialerCall.State.ACTIVE;
}
- private String getConferenceString(DialerCall call) {
- boolean isGenericConference = call.hasProperty(Details.PROPERTY_GENERIC_CONFERENCE);
- LogUtil.v("CallCardPresenter.getConferenceString", "" + isGenericConference);
-
- final int resId =
- isGenericConference ? R.string.generic_conference_call_name : R.string.conference_call_name;
- return mContext.getResources().getString(resId);
- }
-
private boolean shouldShowEndCallButton(DialerCall primary, int callState) {
if (primary == null) {
return false;
@@ -1063,7 +1030,6 @@
@Override
public void onInCallScreenResumed() {
- EnrichedCallComponent.get(mContext).getEnrichedCallManager().registerStateChangedListener(this);
updatePrimaryDisplayInfo();
if (shouldSendAccessibilityEvent) {
@@ -1072,11 +1038,7 @@
}
@Override
- public void onInCallScreenPaused() {
- EnrichedCallComponent.get(mContext)
- .getEnrichedCallManager()
- .unregisterStateChangedListener(this);
- }
+ public void onInCallScreenPaused() {}
static boolean sendAccessibilityEvent(Context context, InCallScreen inCallScreen) {
AccessibilityManager am =