Fix TextClassifier logging.
No logs were being sent via the TextClassificationManagerService to the TextClassifierService. Also, SelectionEvent.getSessionId() is nullable. Handle appropriately. Bug: 79418429 Test: manual - manually tested via a debugger. Auto tests coming soon. Test: bit CtsViewTestCases:android.view.textclassifier.cts.TextClassificationManagerTest Change-Id: I196885d9b03c0c11cae7686a5835d14791065e78
This commit is contained in:
@@ -86,8 +86,10 @@ public final class SelectionSessionLogger {
|
||||
.addTaggedData(SMART_START, event.getSmartStart())
|
||||
.addTaggedData(SMART_END, event.getSmartEnd())
|
||||
.addTaggedData(EVENT_START, event.getStart())
|
||||
.addTaggedData(EVENT_END, event.getEnd())
|
||||
.addTaggedData(SESSION_ID, event.getSessionId().flattenToString());
|
||||
.addTaggedData(EVENT_END, event.getEnd());
|
||||
if (event.getSessionId() != null) {
|
||||
log.addTaggedData(SESSION_ID, event.getSessionId().flattenToString());
|
||||
}
|
||||
mMetricsLogger.write(log);
|
||||
debugLog(log);
|
||||
}
|
||||
|
||||
@@ -129,6 +129,18 @@ public final class SystemTextClassifier implements TextClassifier {
|
||||
return mFallback.generateLinks(request);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSelectionEvent(SelectionEvent event) {
|
||||
Preconditions.checkNotNull(event);
|
||||
Utils.checkMainThread();
|
||||
|
||||
try {
|
||||
mManagerService.onSelectionEvent(mSessionId, event);
|
||||
} catch (RemoteException e) {
|
||||
Log.e(LOG_TAG, "Error reporting selection event.", e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user