Commit Graph

180 Commits (5fdea4775e18f09e2705f8043a2a9554c4fa3f92)

Author SHA1 Message Date
Kurt Partridge 5fdea4775e Merge "Always record word boundaries" 2013-05-22 03:04:35 +00:00
Kurt Partridge 450d78b030 Always record word boundaries
Word boundaries are currently logged, but only if all the
details of a word pass the privacy filter and are logged.

This change records when a word is committed in all cases,
but does not disclose the word contents or any data used in
its construction.

Addresses b/9070768

Change-Id: I573679d0685c088aca65af99e46337a2f429f816
2013-05-21 16:08:54 -07:00
Kurt Partridge 74a6196c6b Modify isAllowedToLog
Currently isAllowedToLog only checks the state of the
ResearchLogger, and does not consider which log the data is
going to.  This causes problems with the logs for Feedback.
The Feedback log should inhibit normal logging procedures,
but the system needs to be able to write specific data
directly to it.

This change renames to isAllowedToLogTo and adds the
destination ResearchLog as a parameter.  A FeedbackLog is also
added as a new class so it can be distinguished from other
ResearchLogs.

Change-Id: I5a1eea05bb040c26bf816b89179f44b3024fa2ad
2013-05-21 14:09:04 -07:00
Kurt Partridge 500dea6ad4 Fix punctuation logging
Punctuation is currently put into the same LogUnit as the
following word.  This is counter-intuitive and makes
post-processing more complicated.

This change causes punctuation to be put into its own
LogUnit.

A tricky case is the phantom space.  A phantom space is
inserted right before other text, whose MotionEvents have
already been collected and inserted into mCurrentLogBuffer.
Phantom spaces are handled by creating their own LogUnit and
inserting it into the LogBuffer right before
mCurrentLogBuffer is shifted in.

Change-Id: I102d7cd93982ad37ba0abb6c1ac0f66b85b5f95d
2013-05-17 09:47:40 -07:00
Kurt Partridge 993acbaaa2 Remove unnecessary commit/uncommit
When the user reverts a commit, this causes the committed
word to be changed. The user usually then goes back to edit
that word.  Going back to edit causes an uncommit, so that
the editing actions are added onto the LogUnit containing
the operations used to construct the word.

But currently, reverting also involves its own
commit/uncommit pair, with the caller performing the
uncommit, and the commit happening inside the revert
command.  This may have been necessary in the past, when
revert was called in different situations, but is
unnecessary now.  Furthermore, the guarding conditions are
currently such that the uncommit doesn't always undo the
effects of the commit, corrupting the log output.

Change-Id: I74af41f4f1db2fcabfa496dcc4a2d7bd0af19b3a
2013-05-14 12:20:27 -07:00
Kurt Partridge 6fefc142cf Remove FeedbackLog instance variables.
For a while, the ResearchLogger supported comprehensive recording of the
last few words in case the user wished to upload this data to give
developers feedback.  However, this mechanism was not implemented well
(keeping a separate copy of the data), did not make the collected data
clear to the user, and was not working properly in the latest build (NPEs).
The mechanism in fact was deprecated in favor of the "userRecording"
mechanism in which the user explicitly turned on comprehensive recording,
demonstrated the issue they were experiencing, and then turned it off.

This change removes the vestiges of the FeedbackLogging mechanism.
A feedback log is still used to hold the user's message, but it is created
in a local variable as-needed, and not persisted in ResearchLogger.

Change-Id: I6a09d0ed36e1eddb6e57895e7428d22107f75f49
2013-05-13 20:37:15 -07:00
Kurt Partridge 7d72ca0b20 Avoid JsonWriter multi-write error
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
2013-05-10 18:21:08 -07:00
Kurt Partridge 260df84197 Merge "Remove unused code" 2013-05-10 22:12:11 +00:00
Kurt Partridge bb17034f64 Merge "Remove ref to LatinImeLogger preference." 2013-05-10 20:41:52 +00:00
Kurt Partridge a68cace7d1 Avoid NPE by fixing ResearchLogger initialization
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
2013-05-09 18:38:32 -07:00
Kurt Partridge 011634163c Remove unused code
Change-Id: I192c67e9e8de44f073abc70ec85ebcdb36356c2e
2013-05-09 14:36:40 -07:00
Kurt Partridge ef5d760ca4 Remove ref to LatinImeLogger preference.
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
2013-05-09 14:36:40 -07:00
Kurt Partridge e92b5e145f Allow LogUnits to hold >1 word
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
2013-04-19 08:55:39 -07:00
Kurt Partridge b903f10393 Merge "Label logUnits after LatinImeOnEndBatchInput" 2013-04-17 21:30:47 +00:00
Kurt Partridge a5bfac5bec Merge "Fix NPE" 2013-04-17 20:33:26 +00:00
Kurt Partridge e9e4fe5227 Merge "Fix logic error" 2013-04-17 18:57:18 +00:00
Kurt Partridge dac3ee49ae Merge "Small dot in corner was not visible" 2013-04-17 17:18:35 +00:00
Kurt Partridge fe0529714e Label logUnits after LatinImeOnEndBatchInput
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
2013-04-17 01:14:36 -07:00
Kurt Partridge 4ac28ded28 Fix NPE
Change-Id: I8a091fb63dab12a0d2ba69e2fe393249bc68d103
2013-04-16 20:39:47 -07:00
Kurt Partridge cd39368c21 Fix logic error
Change-Id: Ia36660c66504ba2fbb7f125704926a08726df87a
2013-04-16 20:39:47 -07:00
Kurt Partridge 2d9d4390fd Small dot in corner was not visible
Framework change perhaps?  Even if not, this makes it more visible

Change-Id: Ib6d36b5a30136c4516adac666bdff36d1cd9b337
2013-04-16 20:39:47 -07:00
Kurt Partridge 125f22dc58 Include nanoTime in filename
System is fast enough that sometimes SystemClock.currentTimeMillis() is duplicated
when used to make a unique filename.

Change-Id: I9454fbb5e10265d36b8e17cba183a1591d52cc7b
2013-04-16 20:29:42 -07:00
Kurt Partridge ededdc6a8b Merge "Avoid NPE" 2013-04-12 18:10:49 +00:00
Jean Chalard 6a114fa700 Restart suggestions when the cursor moves.
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
2013-04-12 20:49:03 +09:00
Kurt Partridge 6108624a00 Better isolate ResearchLogging data
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
2013-04-10 11:53:38 -07:00
Kurt Partridge dfa5628cd3 Better release build reporting
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
2013-04-10 11:52:37 -07:00
Kurt Partridge 09ab6495a2 Merge "[FileEncap18] Clean up uploading scheduling" 2013-04-09 19:08:40 +00:00
Kurt Partridge 1f70a4d681 Merge "Allow logging while replaying" 2013-04-09 02:33:09 +00:00
Kurt Partridge 30772c3758 Allow logging while replaying
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
2013-04-01 16:49:39 -07:00
Kurt Partridge 5779bc91e6 Merge "Split LogUnits differently." 2013-04-01 23:08:21 +00:00
Kurt Partridge 39cb0334d9 Avoid NPE
Initialize FeedbackLog earlier to avoid NPE

Change-Id: I646944c68a7d092345def16060b2a4edd8c7dbef
2013-03-26 16:46:43 -07:00
Kurt Partridge 189be5196a Split LogUnits differently.
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
2013-03-26 16:46:43 -07:00
Kurt Partridge 6d71d238e2 [FileEncap18] Clean up uploading scheduling
- 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
2013-03-25 17:50:26 -07:00
Kurt Partridge 87bc3a4a62 Close ResearchLogger upon onFinishInputView
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
2013-03-25 17:31:25 -07:00
Tadashi G. Takaoka 841c295f3c resolved conflicts for merge of 5b048292 to master
Change-Id: I67ebab46954cd7b8e3e79e7fed523bafb15f8835
2013-03-19 10:48:10 +09:00
Ken Wakasa 9c3860ce46 Rename ProductionFlag.IS_EXPERIMENTAL to USES_DEVELOPMENT_ONLY_DIAGNOSTICS
bug: 8393568
Change-Id: Ie5edf44a3627aca9416145aff56bf05bbf2a05f3
2013-03-18 23:15:47 +09:00
Kurt Partridge f33f1cab2f [FileEncap9] Extract ResearchLogDirectory class
Previously used a monotonically increasing int.  Now uses uuid and nanoseconds.

squashed in:
    [FileEncap11] Read preference from ResearchSettings
    Change-Id: Ic779e0a69db6b16e92c6f4b63dbe7b7add566ab6

    [FileEncap12] Simplify directory cleanup invocation
    Change-Id: I688047409c0343d32b11447fb625dfb726c731ec

    [FileEncap14] Change log filename syntax
    Change-Id: I9243b20b2eb392f81ab8c5c3d19315211240e0bc

Change-Id: I5c9d70e0cb7b0965158e17dd71dfab796bd9a440
2013-03-14 06:37:56 -07:00
Jean Chalard 7423005b96 [Lazy1] Switch to blocking log closures
Change-Id: I4daec20b7b47b0d71c5aab6e17cd660015e19e71
2013-03-12 17:09:08 -07:00
Kurt Partridge 84bc16af3e Little cleanups
Change-Id: I2ded3d0a29610941fac27c9b26168dd6c06ceccc
2013-03-05 18:37:44 -08:00
Kurt Partridge 4eeb90cd72 Clean up initialization ordering
This change is based on an earlier one that got stuck in Gerrit: Iab77504b

Change-Id: I27ad9dfb1bbb2300bd1e61d881a6ea0e116db066
2013-03-05 18:37:00 -08:00
Kurt Partridge 157c00145b Clean up logic in onUserLoggingConsent
- 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
2013-03-04 12:05:03 -08:00
Kurt Partridge 75e6fb68e9 Clean up PREF_USABILITY_STUDY_MODE
- 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
2013-03-04 12:05:03 -08:00
Kurt Partridge 788dc55662 Merge "Remove MainLogBuffer#setSuggest()" 2013-03-04 15:10:31 +00:00
Kurt Partridge a8e668c81e Merge "Move UUID preference reading to ResearchSettings.java" 2013-03-02 01:50:03 +00:00
Kurt Partridge b094372bd6 Remove MainLogBuffer#setSuggest()
multi-project commit with Ia98b1406fc2ee11a96893c77ea58d800fece7624

Change-Id: I8bc3d07b83dbe7d8fc56a618de07dade7f510b13
2013-03-01 13:32:11 -08:00
Kurt Partridge 00ed4704f9 Move UUID preference reading to ResearchSettings.java
Change-Id: I8157249259cf8c3218c5c82a5729f4cbc1fb4eeb
2013-02-28 19:54:21 -08:00
Kurt Partridge 59912837b3 [TestPrep22] Make variable package-private for testing
Change-Id: I902a6a40df1c672c611672f34d2f3237b0d1821b
2013-02-28 06:45:35 -08:00
Kurt Partridge 7e2c1e69bf Ensure Preference listener is unregistered
Change-Id: I1a4d1e7bc45fc30cb1b63ea6020f0eee6e804333
2013-02-26 18:40:34 -08:00
Kurt Partridge ab0bda1499 [TestPrep5] Parameterize MainLogBuffer
Change-Id: I6d84f490922cd1f40e44ca4f95c9d950fba38290
2013-02-20 19:37:12 -08:00
Kurt Partridge 8d429bf1a8 [TestPrep1] Move MotionEvent.Action strings to LoggingUtils
Change-Id: I7b9ed800552f2fd546ed21e9dc06ea1ff5798337
2013-02-20 17:12:56 -08:00