diff options
author | Yorke Lee <yorkelee@google.com> | 2015-09-16 17:45:49 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-09-16 17:45:49 +0000 |
commit | 8871121168d8bd7012b829f382d474b04f78ca45 (patch) | |
tree | 59b341d6c640271851e22d344b33f192b1efaaf5 /InCallUI | |
parent | ebe298041c7d3e1c47da3b775b1851df586c3d4b (diff) | |
parent | a749c526178aee1168cedac0194ace2add8ce6c1 (diff) |
Merge "Populate call initiation type log state" into ub-contactsdialer-a-dev
Diffstat (limited to 'InCallUI')
-rw-r--r-- | InCallUI/src/com/android/incallui/Call.java | 61 | ||||
-rw-r--r-- | InCallUI/src/com/android/incallui/CallList.java | 2 |
2 files changed, 59 insertions, 4 deletions
diff --git a/InCallUI/src/com/android/incallui/Call.java b/InCallUI/src/com/android/incallui/Call.java index e1ca45d50..1d6c2455f 100644 --- a/InCallUI/src/com/android/incallui/Call.java +++ b/InCallUI/src/com/android/incallui/Call.java @@ -18,6 +18,8 @@ package com.android.incallui; import com.android.contacts.common.CallUtil; import com.android.contacts.common.testing.NeededForTesting; +import com.android.dialer.util.IntentUtil; +import com.android.incallui.Call.LogState; import android.content.Context; import android.hardware.camera2.CameraCharacteristics; @@ -181,6 +183,10 @@ public class Call { * logging variables will interface with/and affect call logic. */ public static class LogState { + + // Contact lookup type constants + // Unknown lookup result (lookup not completed yet?) + public static final int LOOKUP_UNKNOWN = 0; public static final int LOOKUP_NOT_FOUND = 1; public static final int LOOKUP_LOCAL_CONTACT = 2; public static final int LOOKUP_LOCAL_CACHE = 3; @@ -188,11 +194,24 @@ public class Call { public static final int LOOKUP_EMERGENCY = 5; public static final int LOOKUP_VOICEMAIL = 6; + // Call initiation type constants + public static final int INITIATION_UNKNOWN = 0; + public static final int INITIATION_INCOMING = 1; + public static final int INITIATION_DIALPAD = 2; + public static final int INITIATION_SPEED_DIAL = 3; + public static final int INITIATION_NEARBY_PLACES = 4; + public static final int INITIATION_SMART_DIAL = 5; + public static final int INITIATION_REGULAR_SEARCH = 6; + public static final int INITIATION_CALL_LOG = 7; + public static final int INITIATION_CALL_LOG_FILTER = 8; + public static final int INITIATION_VOICEMAIL_LOG = 9; + public static final int INITIATION_CALL_DETAILS = 10; + public static final int INITIATION_QUICK_CONTACTS = 11; + public DisconnectCause disconnectCause; public boolean isIncoming = false; - public int contactLookupResult = LOOKUP_NOT_FOUND; - // TODO: Populate this field by passing in extras from Dialer - public int callInitiationMethod; + public int contactLookupResult = LOOKUP_UNKNOWN; + public int callInitiationMethod = INITIATION_UNKNOWN; public long duration = 0; @Override @@ -207,7 +226,7 @@ public class Call { disconnectCause, isIncoming, lookupToString(contactLookupResult), - callInitiationMethod, + initiationToString(callInitiationMethod), duration); } @@ -227,6 +246,27 @@ public class Call { return "Not found"; } } + + private static String initiationToString(int initiationType) { + switch (initiationType) { + case INITIATION_INCOMING: + return "Incoming"; + case INITIATION_DIALPAD: + return "Dialpad"; + case INITIATION_SPEED_DIAL: + return "Speed Dial"; + case INITIATION_NEARBY_PLACES: + return "Nearby Places"; + case INITIATION_CALL_LOG: + return "Call Log"; + case INITIATION_CALL_LOG_FILTER: + return "Call Log Filter"; + case INITIATION_VOICEMAIL_LOG: + return "Voicemail Log"; + default: + return "Unknown"; + } + } } @@ -726,6 +766,19 @@ public class Call { return mLogState; } + /** + * Logging utility methods + */ + public void logCallInitiationType() { + if (getState() == State.INCOMING) { + getLogState().callInitiationMethod = LogState.INITIATION_INCOMING; + } else if (getIntentExtras() != null) { + getLogState().callInitiationMethod = + getIntentExtras().getInt(IntentUtil.EXTRA_CALL_INITIATION_TYPE, + LogState.INITIATION_UNKNOWN); + } + } + @Override public String toString() { if (mTelecomCall == null) { diff --git a/InCallUI/src/com/android/incallui/CallList.java b/InCallUI/src/com/android/incallui/CallList.java index 3b2f94dd2..018ac10ca 100644 --- a/InCallUI/src/com/android/incallui/CallList.java +++ b/InCallUI/src/com/android/incallui/CallList.java @@ -131,6 +131,8 @@ public class CallList { } else { onUpdate(call); } + + call.logCallInitiationType(); } public void onCallRemoved(android.telecom.Call telecomCall) { |