Merge "Hook up emergency metrics"

This commit is contained in:
Hall Liu 2018-09-11 18:33:46 +00:00 committed by Gerrit Code Review
commit b1b1c64f22
2 changed files with 13 additions and 2 deletions

View File

@ -160,6 +160,9 @@ public class Analytics {
public void setCallIsAdditional(boolean isAdditional) { public void setCallIsAdditional(boolean isAdditional) {
} }
public void setCallIsEmergency(boolean isEmergency) {
}
public void setCallIsInterrupted(boolean isInterrupted) { public void setCallIsInterrupted(boolean isInterrupted) {
} }
@ -294,6 +297,12 @@ public class Analytics {
this.callTechnologies |= callTechnology; this.callTechnologies |= callTechnology;
} }
@Override
public void setCallIsEmergency(boolean isEmergency) {
Log.d(TAG, "setting call as emergency: " + isEmergency);
this.isEmergency = isEmergency;
}
@Override @Override
public void setCallDisconnectCause(DisconnectCause disconnectCause) { public void setCallDisconnectCause(DisconnectCause disconnectCause) {
Log.d(TAG, "setting disconnectCause for call " + callId + " to " + disconnectCause); Log.d(TAG, "setting disconnectCause for call " + callId + " to " + disconnectCause);
@ -361,6 +370,7 @@ public class Analytics {
+ " direction: " + getCallDirectionString() + '\n' + " direction: " + getCallDirectionString() + '\n'
+ " isAdditionalCall: " + isAdditionalCall + '\n' + " isAdditionalCall: " + isAdditionalCall + '\n'
+ " isInterrupted: " + isInterrupted + '\n' + " isInterrupted: " + isInterrupted + '\n'
+ " isEmergency: " + isEmergency + '\n'
+ " callTechnologies: " + getCallTechnologiesAsString() + '\n' + " callTechnologies: " + getCallTechnologiesAsString() + '\n'
+ " callTerminationReason: " + getCallDisconnectReasonString() + '\n' + " callTerminationReason: " + getCallDisconnectReasonString() + '\n'
+ " connectionService: " + connectionService + '\n' + " connectionService: " + connectionService + '\n'

View File

@ -414,7 +414,7 @@ public class Call implements CreateConnectionResponse, EventManager.Loggable,
private final TelecomSystem.SyncRoot mLock; private final TelecomSystem.SyncRoot mLock;
private final String mId; private final String mId;
private String mConnectionId; private String mConnectionId;
private Analytics.CallInfo mAnalytics; private Analytics.CallInfo mAnalytics = new Analytics.CallInfo();
private char mPlayingDtmfTone; private char mPlayingDtmfTone;
private boolean mWasConferencePreviouslyMerged = false; private boolean mWasConferencePreviouslyMerged = false;
@ -580,7 +580,6 @@ public class Call implements CreateConnectionResponse, EventManager.Loggable,
mShouldAttachToExistingConnection = shouldAttachToExistingConnection mShouldAttachToExistingConnection = shouldAttachToExistingConnection
|| callDirection == CALL_DIRECTION_INCOMING; || callDirection == CALL_DIRECTION_INCOMING;
maybeLoadCannedSmsResponses(); maybeLoadCannedSmsResponses();
mAnalytics = new Analytics.CallInfo();
mClockProxy = clockProxy; mClockProxy = clockProxy;
mCreationTimeMillis = mClockProxy.currentTimeMillis(); mCreationTimeMillis = mClockProxy.currentTimeMillis();
} }
@ -657,6 +656,7 @@ public class Call implements CreateConnectionResponse, EventManager.Loggable,
analyticsDirection = Analytics.UNKNOWN_DIRECTION; analyticsDirection = Analytics.UNKNOWN_DIRECTION;
} }
mAnalytics = Analytics.initiateCallAnalytics(mId, analyticsDirection); mAnalytics = Analytics.initiateCallAnalytics(mId, analyticsDirection);
mAnalytics.setCallIsEmergency(mIsEmergencyCall);
Log.addEvent(this, LogUtils.Events.CREATED); Log.addEvent(this, LogUtils.Events.CREATED);
} }
@ -1033,6 +1033,7 @@ public class Call implements CreateConnectionResponse, EventManager.Loggable,
mIsEmergencyCall = mHandle != null && mIsEmergencyCall = mHandle != null &&
mPhoneNumberUtilsAdapter.isLocalEmergencyNumber(mContext, mPhoneNumberUtilsAdapter.isLocalEmergencyNumber(mContext,
mHandle.getSchemeSpecificPart()); mHandle.getSchemeSpecificPart());
mAnalytics.setCallIsEmergency(mIsEmergencyCall);
} }
startCallerInfoLookup(); startCallerInfoLookup();
for (Listener l : mListeners) { for (Listener l : mListeners) {