diff options
author | Eric Erfanian <erfanian@google.com> | 2017-05-05 15:23:13 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2017-05-05 15:23:13 +0000 |
commit | 300a8683b9c28424fb0f0c571a0abe128c461f69 (patch) | |
tree | 3a325b0effac02fbd228b8ddf2f96589e5df72cd /java/com/android/incallui/InCallPresenter.java | |
parent | d67f1627521b174f12e0c247f154c7c93c5e408e (diff) | |
parent | 10b34a5ebf12e97ecba0caf3c8e30b476b038a96 (diff) |
Update Dialer to V10 RC16
am: 10b34a5ebf
Change-Id: Iea3e96ccdeaf1fa796ceca702cace82ca20f298c
Diffstat (limited to 'java/com/android/incallui/InCallPresenter.java')
-rw-r--r-- | java/com/android/incallui/InCallPresenter.java | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/java/com/android/incallui/InCallPresenter.java b/java/com/android/incallui/InCallPresenter.java index a1643d67c..a5ba31c50 100644 --- a/java/com/android/incallui/InCallPresenter.java +++ b/java/com/android/incallui/InCallPresenter.java @@ -34,13 +34,13 @@ import android.telephony.PhoneStateListener; import android.telephony.TelephonyManager; import android.view.Window; import android.view.WindowManager; -import com.android.contacts.common.GeoUtil; import com.android.contacts.common.compat.CallCompat; import com.android.dialer.blocking.FilteredNumberAsyncQueryHandler; import com.android.dialer.blocking.FilteredNumberAsyncQueryHandler.OnCheckBlockedListener; import com.android.dialer.blocking.FilteredNumbersUtil; import com.android.dialer.common.LogUtil; import com.android.dialer.enrichedcall.EnrichedCallComponent; +import com.android.dialer.location.GeoUtil; import com.android.dialer.logging.InteractionEvent; import com.android.dialer.logging.Logger; import com.android.dialer.postcall.PostCall; @@ -249,7 +249,7 @@ public class InCallPresenter implements CallList.Listener { private VideoSurfaceTexture mLocalVideoSurfaceTexture; private VideoSurfaceTexture mRemoteVideoSurfaceTexture; - /** Inaccessible constructor. Must use getInstance() to get this singleton. */ + /** Inaccessible constructor. Must use getRunningInstance() to get this singleton. */ @VisibleForTesting InCallPresenter() {} @@ -260,6 +260,11 @@ public class InCallPresenter implements CallList.Listener { return sInCallPresenter; } + @VisibleForTesting + public static synchronized void setInstanceForTesting(InCallPresenter inCallPresenter) { + sInCallPresenter = inCallPresenter; + } + /** * Determines whether or not a call has no valid phone accounts that can be used to make the call * with. Emergency calls do not require a phone account. @@ -762,11 +767,17 @@ public class InCallPresenter implements CallList.Listener { if (!mCallList.hasLiveCall() && !call.getLogState().isIncoming + && !isSecretCode(call.getNumber()) && !CallerInfoUtils.isVoiceMailNumber(mContext, call)) { - PostCall.onCallDisconnected(mContext, call.getNumber(), call.getTimeAddedMs()); + PostCall.onCallDisconnected(mContext, call.getNumber(), call.getConnectTimeMillis()); } } + private boolean isSecretCode(@Nullable String number) { + return number != null + && (number.length() <= 8 || number.startsWith("*#*#") || number.endsWith("#*#*")); + } + /** Given the call list, return the state in which the in-call screen should be. */ public InCallState getPotentialStateFromCallList(CallList callList) { |