diff options
author | Treehugger Robot <treehugger-gerrit@google.com> | 2017-12-22 18:44:31 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2017-12-22 18:44:31 +0000 |
commit | 88518503c1351ba86f503ebd8742d6b292928ddd (patch) | |
tree | 97c6b6429cd3a0276ece3bba0ce022e4c6b92866 /java/com/android/incallui | |
parent | e2da6ef8a56bd9f7eedfa1c6d89e968590e0c09b (diff) | |
parent | 1e8275f3e6f57f285900ce35946064e0550b174a (diff) |
Merge changes I66342431,I5e579f11,I927711aa,Idd4cc115,If8cdbdfa, ...
* changes:
Automated rollback of changelist 179615699
Automated rollback of changelist 179847039
Differentiate read/unread voicemails in the NUI Voicemail by bolding.
Use CHAR_TO_KEY_MAPS in DialpadCharMappings in SmartDialMaps.
Reorganize classes related to smart dial.
Use the orientation obtained in onFinishInflate as the truth in DialpadView.
Added context menu for favorite contacts in new speed dial.
Update assisted dialing extras in preparation for platform implementation.
Quick fix for bugs on simulator voice call.
Fixed crash in UiListener when launching activity with screen off.
Handle contacts which have been disassociated with a number in Cp2PhoneLookup.
Fixed crash in PinnedShortcuts.
Bug: 70402588
Added copySubMessage method to PhoneLookup interface.
Bubble v2 changes.
Always have hardware acceration enabled for InCallActivity
Include inserted calls for consideration in PhoneLookupDataSource.
Don't use phone number in spam call notifications
Register content observer when voicemail table changes.
Add SmartDialMaps for the Bulgarian alphabet and the Ukrainian alphabet.
Remove voicemail from UI only after delete request.
Bubble v2 RTL language fixes.
Implemented SpeedDialEntry Room Database.
Diffstat (limited to 'java/com/android/incallui')
5 files changed, 62 insertions, 31 deletions
diff --git a/java/com/android/incallui/AndroidManifest.xml b/java/com/android/incallui/AndroidManifest.xml index b9d481b31..a98cc91d2 100644 --- a/java/com/android/incallui/AndroidManifest.xml +++ b/java/com/android/incallui/AndroidManifest.xml @@ -47,10 +47,13 @@ android:name="android.telephony.hide_voicemail_settings_menu" android:value="true"/> + <!-- Go variants need hardware acceleration for IMS video calls even though it is disabled at + the application level --> <activity android:directBootAware="true" android:excludeFromRecents="true" android:exported="false" + android:hardwareAccelerated="true" android:label="@string/phoneAppLabel" android:launchMode="singleInstance" android:name="com.android.incallui.InCallActivity" diff --git a/java/com/android/incallui/NewReturnToCallController.java b/java/com/android/incallui/NewReturnToCallController.java index ad49d6828..ca60a52c1 100644 --- a/java/com/android/incallui/NewReturnToCallController.java +++ b/java/com/android/incallui/NewReturnToCallController.java @@ -101,7 +101,7 @@ public class NewReturnToCallController implements InCallUiListener, Listener, Au if (showing) { hide(); } else { - if (TelecomUtil.isInManagedCall(context)) { + if (getCall() != null) { show(); } } @@ -157,22 +157,15 @@ public class NewReturnToCallController implements InCallUiListener, Listener, Au @Override public void onDisconnect(DialerCall call) { - if (call.wasParentCall()) { - // It's disconnected after the last child call is disconnected, and we already did everything - // for the last child. - LogUtil.i( - "ReturnToCallController.onDisconnect", "being called for a parent call and do nothing"); - return; - } - if (bubble != null - && bubble.isVisible() - && (!TelecomUtil.isInManagedCall(context) - || CallList.getInstance().getActiveOrBackgroundCall() != null)) { - bubble.showText(context.getText(R.string.incall_call_ended)); - } - // For conference call, we should hideAndReset for the last disconnected child call while the - // parent call is still there. - if (!CallList.getInstance().hasNonParentActiveOrBackgroundCall()) { + LogUtil.enterBlock("ReturnToCallController.onDisconnect"); + if (bubble != null && bubble.isVisible() && (getCall() == null)) { + // Show "Call ended" and hide bubble when there is no outgoing, active or background call + LogUtil.i("ReturnToCallController.onDisconnect", "show call ended and hide bubble"); + // Don't show text if it's Duo upgrade + // It doesn't work for Duo fallback upgrade since we're not considered in call + if (!TelecomUtil.isInCall(context) || CallList.getInstance().getIncomingCall() != null) { + bubble.showText(context.getText(R.string.incall_call_ended)); + } hideAndReset(); } else { startContactInfoSearch(); @@ -197,19 +190,21 @@ public class NewReturnToCallController implements InCallUiListener, Listener, Au } private void startContactInfoSearch() { - DialerCall dialerCall = CallList.getInstance().getIncomingCall(); - if (dialerCall == null) { - dialerCall = CallList.getInstance().getOutgoingCall(); - } - if (dialerCall == null) { - dialerCall = CallList.getInstance().getActiveOrBackgroundCall(); - } + DialerCall dialerCall = getCall(); if (dialerCall != null) { contactInfoCache.findInfo( dialerCall, false /* isIncoming */, new ReturnToCallContactInfoCacheCallback(this)); } } + private DialerCall getCall() { + DialerCall dialerCall = CallList.getInstance().getOutgoingCall(); + if (dialerCall == null) { + dialerCall = CallList.getInstance().getActiveOrBackgroundCall(); + } + return dialerCall; + } + private void onPhotoAvatarReceived(@NonNull Drawable photo) { if (bubble != null) { bubble.updatePhotoAvatar(photo); diff --git a/java/com/android/incallui/call/DialerCall.java b/java/com/android/incallui/call/DialerCall.java index 812024904..94c79e904 100644 --- a/java/com/android/incallui/call/DialerCall.java +++ b/java/com/android/incallui/call/DialerCall.java @@ -20,6 +20,7 @@ import android.Manifest.permission; import android.content.Context; import android.hardware.camera2.CameraCharacteristics; import android.net.Uri; +import android.os.Build; import android.os.Build.VERSION; import android.os.Build.VERSION_CODES; import android.os.Bundle; @@ -43,6 +44,7 @@ import android.telecom.VideoProfile; import android.text.TextUtils; import com.android.contacts.common.compat.CallCompat; import com.android.contacts.common.compat.telecom.TelecomManagerCompat; +import com.android.dialer.assisteddialing.ConcreteCreator; import com.android.dialer.assisteddialing.TransformationInfo; import com.android.dialer.callintent.CallInitiationType; import com.android.dialer.callintent.CallIntentParser; @@ -1073,19 +1075,50 @@ public class DialerCall implements VideoTechListener, StateChangedListener, Capa return mLogState.isIncoming; } + /** + * Try and determine if the call used assisted dialing. + * + * <p>We will not be able to verify a call underwent assisted dialing until the Platform + * implmentation is complete in P+. + * + * @return a boolean indicating assisted dialing may have been performed + */ public boolean isAssistedDialed() { if (getIntentExtras() != null) { - return getIntentExtras().getBoolean(TelephonyManagerCompat.IS_ASSISTED_DIALED, false); + // O_MR1 and below uses the existence of USE_ASSISTED_DIALING to indicate assisted dialing + // was used. The Dialer client is responsible for performing assisted dialing before + // placing the outgoing call. + // + // The existence of the assisted dialing extras indicates that assisted dialing took place. + if (getIntentExtras().getBoolean(TelephonyManagerCompat.USE_ASSISTED_DIALING, false) + && getAssistedDialingExtras() != null + && Build.VERSION.SDK_INT <= ConcreteCreator.BUILD_CODE_CEILING) { + return true; + } + } + + // Starting in P+ USE_ASSISTED_DIALING indicates that the client requested the platform + // perform assisted dialing. PROPERTY_ASSISTED_DIALING_USED indicates assisted dialing took + // place. + if (hasProperty(TelephonyManagerCompat.PROPERTY_ASSISTED_DIALING_USED) + && Build.VERSION.SDK_INT > ConcreteCreator.BUILD_CODE_CEILING) { + return true; } return false; } + @Nullable public TransformationInfo getAssistedDialingExtras() { - if (isAssistedDialed()) { - return TransformationInfo.newInstanceFromBundle( - getIntentExtras().getBundle(TelephonyManagerCompat.ASSISTED_DIALING_EXTRAS)); + if (getIntentExtras() == null) { + return null; } - return null; + + if (getIntentExtras().getBundle(TelephonyManagerCompat.ASSISTED_DIALING_EXTRAS) == null) { + return null; + } + + return TransformationInfo.newInstanceFromBundle( + getIntentExtras().getBundle(TelephonyManagerCompat.ASSISTED_DIALING_EXTRAS)); } public LatencyReport getLatencyReport() { diff --git a/java/com/android/incallui/contactgrid/TopRow.java b/java/com/android/incallui/contactgrid/TopRow.java index f8a485519..556b11ba0 100644 --- a/java/com/android/incallui/contactgrid/TopRow.java +++ b/java/com/android/incallui/contactgrid/TopRow.java @@ -175,7 +175,7 @@ public class TopRow { } } - if (state.isAssistedDialed) { + if (state.isAssistedDialed && state.assistedDialingExtras != null) { LogUtil.i("TopRow.getLabelForDialing", "using assisted dialing label."); String countryCode = String.valueOf(state.assistedDialingExtras.transformedNumberCountryCallingCode()); diff --git a/java/com/android/incallui/spam/SpamCallListListener.java b/java/com/android/incallui/spam/SpamCallListListener.java index fa3dd6e01..e7603f041 100644 --- a/java/com/android/incallui/spam/SpamCallListListener.java +++ b/java/com/android/incallui/spam/SpamCallListListener.java @@ -455,6 +455,6 @@ public class SpamCallListListener implements CallList.Listener { } static String getNotificationTagForCall(@NonNull DialerCall call) { - return NOTIFICATION_TAG_PREFIX + call.getNumber(); + return NOTIFICATION_TAG_PREFIX + call.getUniqueCallId(); } } |