JsonWriter requires that its clients pass it only a single top-level object.
The existing implementation tries to make code cleaner by having mJsonWriter
never be null, and instead use a global static "NULL_JSON_WRITER" that just
discards data. But because JsonWriter complains if more than one top-level
object is passed, making this a global object does not work. This change
instead copes with mJsonWriter being null.
Change-Id: Ia37ccfc8646e91f11a64713dd92d2846eb86ac54
Previously, mMainResearchLog and mMainLogBuffer were set up
when the user moved to a new TextView, and set to null when
the user left the TextView. This change causes
mMainResearchLog, mMainLogBuffer, mFeedbackLog, and
mFeedbackLogBuffer to be non-null forever after init() is
called. start() no longer sets up these fields; instead
they are cleared and reset every time stop() is called.
Checks for null values are now removed.
The earlier code just didn't initialize these variables if
the user disabled logging, but since the new version
invariantly keeps these variables valid, we add a check for
whether the user has enabled logging in publishLogUnits().
Change-Id: Ifde3517f1cf924cfa33cda95fec24529b52b3c08
This is a bug; the ResearchLogger uses ResearchSettings.readResearchLoggerEnabledFlag() instead,
which the user cannot change. (We assume they will just switch to a different keyboard.)
Change-Id: Ib5731c9eeb2bc29d9cf8608033326674f5eb6f7b
LogUnits have been annotated with the autocorrected words, but
until now this was assumed to be a single word without spaces.
But spaceless typing can result in spaces in the LogUnit label. With this
change, the LogUnit inspects the autocorrected text to determine how many
words were inserted, and counts them accurately.
This change corrects a privacy problem, which was that if the word sampling
algorithm chose a LogUnit that actually contained multiple words, then more
than two successive words would be included in the log.
Change-Id: I7c01c3dd3ac33d7e96c00836256bae9c14b124ed
Previously only a commitText would cause a LogUnit to be
labeled with the word that the data generates. In the case
of gestured text, this information is available when
LatinIME#onEndBatchInput is called. Labeling the LogUnit
at this time means that the Log will have labeled words even
if stop() is called before commit.
Change-Id: Idb2f99a9c159a1b1aa00448a2ecddeca6c351c3e
System is fast enough that sometimes SystemClock.currentTimeMillis() is duplicated
when used to make a unique filename.
Change-Id: I9454fbb5e10265d36b8e17cba183a1591d52cc7b
This uses the old suggestions. It does not try to recompute
new suggestions if there are no old suggestions yet: this is
coming in a later change.
If there are no suggestions, this shows the word itself
as a suggestion.
Bug: 8084810
Change-Id: I4c2e25df0ff3673be1825f57a0c19a9d23d47a48
Calls to LatinIME#onStartInputViewInternal log important information
about the context in which an IME is used. This is reported as a
single LogStatement. Previously, this was not placed into a separate
LogUnit, and was mixed in with general word data. This change wraps
this LogStatement in its own LogUnit.
Change-Id: I0fecd41c8a1de622a764cc4b5d6902336697046c
The ResearchLogger reports whether a build is a release build or not
to avoid polluting data with IME debugging work by developers.
Previously this was done by checking a constant flag, which was also
serving the dual purpose of masking out debug code in release builds.
This change introduces a heuristic to determine whether a build was
created by a developer (using the package versionName), and annotating
the data sent to the server appropriately.
Change-Id: Icbad17c66b703cabf6d23d05e2c7c41bcceaae45
Previously logging was disabled during replay. This makes it impossible to use logged data as a
regression test, since the new log was unavailable. This change corrects this problem.
Change-Id: I19dc31def2f2f87fd219dc561c739d18e4ab9c9c
Previously an autocorrection caused a new LogUnit to be started,
splitting off the previous LogUnit right at the autocorrection method
time. This change causes the split to happen before the MotionEvents
that led to the autocorrection being called.
Change-Id: I2504df8eb47ee77e5f46bac34a8450636c03fd9f
- Move scheduling logic from ResearchLogger.java to
UploaderService.java
- Switch to a one-shot timer. Previously the uploader was scheduled
on an inexact repeating schedule. It's better to reschedule the
next upload after the current one is finished to reduce the chances
of multiple uploads happening at the same time.
- Avoid double-execution
- Previously a scheduled upload might run right after an explicit
one if they occured at the same time. This change reduces the
chances of this.
- Some method extraction and naming
Change-Id: I9efda11be77d334c7f61bd40a36d65f0421ebde4
Previously, ResearchLogger#stop() was called both in
LatinIME#onFinishInputView() and in LatinIME#onWindowHidden(). This
resulted in multiple logs being written.
Since onFinishInputView is the more reliable of the two (it is called
in InputMethodService#onDestroy; onWindowHidden is not), the code now
uses onFinishInputView as a stopping signal.
Change-Id: Iae4b8c3bdab226027624eeab19b3737367e4a108
- Make ResearchSetting for whether the user has seen the splash screen
- Inline #setLoggingAllowed, which is short and is now only called by
onUserLoggingConsent
Change-Id: Icdf4592777b80643807b6ccf1d3896459c503e02
- Refer to a common default value in DebugSettings
- Make PREF_USABILITY_STUDY_MODE independent of the ResearchLogger
- ResearchLogger uses its own preference through ResearchSettings
multi-project commit with Ie0df836c9d779eba484b522666ec357f4e234823
Change-Id: I88547a2f619db6e7364abbbec12f9f76855dd11a
The method in LogUnit for publishing a LogStatement to a JsonWriter doesn't
depend on anything in the LogUnit.
multi-project commit with Id1d6ff4851148bba0e6b5a1ec6eec2b842d9c707
Change-Id: I323cec239d6ea1cee602c2ecf9b13713791e9283
The feedback string is used as a channel name in internal builds. Add a flag
that lets it be saved between calls to make it easier to generate test data.
Change-Id: I5c6149b1e68239cd968b6852d03cc240ddde99ca