Merge "Refactors logging into its own function" into qt-r1-dev
am: ab6d79eefd
Change-Id: I27052fa2790eaf161e1e76dd7763ec0da1b05285
This commit is contained in:
@@ -259,11 +259,7 @@ public class AssistManager implements ConfigurationChangedReceiver {
|
|||||||
int phoneState = mPhoneStateMonitor.getPhoneState();
|
int phoneState = mPhoneStateMonitor.getPhoneState();
|
||||||
args.putInt(INVOCATION_PHONE_STATE_KEY, phoneState);
|
args.putInt(INVOCATION_PHONE_STATE_KEY, phoneState);
|
||||||
args.putLong(INVOCATION_TIME_MS_KEY, SystemClock.uptimeMillis());
|
args.putLong(INVOCATION_TIME_MS_KEY, SystemClock.uptimeMillis());
|
||||||
// Logs assistant start with invocation type.
|
logStartAssist(invocationType, phoneState);
|
||||||
MetricsLogger.action(
|
|
||||||
new LogMaker(MetricsEvent.ASSISTANT)
|
|
||||||
.setType(MetricsEvent.TYPE_OPEN)
|
|
||||||
.setSubtype(toLoggingSubType(invocationType, phoneState)));
|
|
||||||
startAssistInternal(args, assistComponent, isService);
|
startAssistInternal(args, assistComponent, isService);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -449,7 +445,14 @@ public class AssistManager implements ConfigurationChangedReceiver {
|
|||||||
return toLoggingSubType(invocationType, mPhoneStateMonitor.getPhoneState());
|
return toLoggingSubType(invocationType, mPhoneStateMonitor.getPhoneState());
|
||||||
}
|
}
|
||||||
|
|
||||||
private int toLoggingSubType(int invocationType, int phoneState) {
|
protected void logStartAssist(int invocationType, int phoneState) {
|
||||||
|
MetricsLogger.action(
|
||||||
|
new LogMaker(MetricsEvent.ASSISTANT)
|
||||||
|
.setType(MetricsEvent.TYPE_OPEN)
|
||||||
|
.setSubtype(toLoggingSubType(invocationType, phoneState)));
|
||||||
|
}
|
||||||
|
|
||||||
|
protected final int toLoggingSubType(int invocationType, int phoneState) {
|
||||||
// Note that this logic will break if the number of Assistant invocation types exceeds 7.
|
// Note that this logic will break if the number of Assistant invocation types exceeds 7.
|
||||||
// There are currently 5 invocation types, but we will be migrating to the new logging
|
// There are currently 5 invocation types, but we will be migrating to the new logging
|
||||||
// framework in the next update.
|
// framework in the next update.
|
||||||
|
|||||||
Reference in New Issue
Block a user