diff options
author | maxwelb <maxwelb@google.com> | 2018-05-03 11:51:02 -0700 |
---|---|---|
committer | Copybara-Service <copybara-piper@google.com> | 2018-05-04 15:56:10 -0700 |
commit | c1401221314601a479a7ad293cc382416f2304f3 (patch) | |
tree | f7ba4bac52516fe47bc51b010afc61778da82e58 /java/com/android/incallui/call/DialerCall.java | |
parent | 89e3d1bb7941993206861fe9115778f816262c07 (diff) |
Add spam status tests for CallList#onCallAdded
There are some upcoming changes to CallList#onCallAdded, so this CL adds the
tests needed to verify that behavior doesn't regress. This became something of a
rabbit hole because:
1) CallListTest needed to use a FakeSpam so spam status could be changed
2) FakeSpam needed updates so it wouldn't crash when CallList calls it. This was
implemented as a no-op for simplicity. It also needed to support the single
number lookup method.
3) FakeCall needed updates to support setting the details' extras (needed tests)
4) ShadowCall needed updates to support setting the details' extras
5) DetailsProperty needed a new value
6) There was an old TODO to use a string that's now visible in the SDK
7) SharedPrefConfigProvider needed a new method to set the emergency call window
long.
Bug: 33779976,79171382
Test: Tap
PiperOrigin-RevId: 195287258
Change-Id: Ib8b9fde35263183393e9bcbdcf73eeada24f28eb
Diffstat (limited to 'java/com/android/incallui/call/DialerCall.java')
-rw-r--r-- | java/com/android/incallui/call/DialerCall.java | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/java/com/android/incallui/call/DialerCall.java b/java/com/android/incallui/call/DialerCall.java index 70678dbac..9e1e17e2a 100644 --- a/java/com/android/incallui/call/DialerCall.java +++ b/java/com/android/incallui/call/DialerCall.java @@ -50,7 +50,6 @@ import android.telecom.VideoProfile; import android.text.TextUtils; import android.widget.Toast; 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; @@ -117,8 +116,11 @@ public class DialerCall implements VideoTechListener, StateChangedListener, Capa public static final int PROPERTY_CODEC_KNOWN = 0x04000000; private static final String ID_PREFIX = "DialerCall_"; - private static final String CONFIG_EMERGENCY_CALLBACK_WINDOW_MILLIS = + + @VisibleForTesting + public static final String CONFIG_EMERGENCY_CALLBACK_WINDOW_MILLIS = "emergency_callback_window_millis"; + private static int idCounter = 0; /** @@ -821,10 +823,9 @@ public class DialerCall implements VideoTechListener, StateChangedListener, Capa // We want to treat any incoming call that arrives a short time after an outgoing emergency call // as a potential emergency callback. if (getExtras() != null - && getExtras().getLong(TelecomManagerCompat.EXTRA_LAST_EMERGENCY_CALLBACK_TIME_MILLIS, 0) - > 0) { + && getExtras().getLong(Call.EXTRA_LAST_EMERGENCY_CALLBACK_TIME_MILLIS, 0) > 0) { long lastEmergencyCallMillis = - getExtras().getLong(TelecomManagerCompat.EXTRA_LAST_EMERGENCY_CALLBACK_TIME_MILLIS, 0); + getExtras().getLong(Call.EXTRA_LAST_EMERGENCY_CALLBACK_TIME_MILLIS, 0); if (isInEmergencyCallbackWindow(lastEmergencyCallMillis)) { return true; } |