Commit Graph

223 Commits (72e8d94288db591b60c5ababda465385339bbb8c)

Author SHA1 Message Date
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 56f35a10cd Merge "Fix bug in counting words between samples" 2013-04-18 04:23:29 +00:00
Kurt Partridge 7a1721753b Merge "Fix user recording dialog" 2013-04-18 02:07:16 +00:00
Kurt Partridge 0833b3cbae Merge "Fix alarm bug" 2013-04-18 01:01:48 +00: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 7da87f97b0 Merge "Clean up unnecessary log messages" 2013-04-17 20:18:19 +00:00
Kurt Partridge e9e4fe5227 Merge "Fix logic error" 2013-04-17 18:57:18 +00:00
Kurt Partridge 1f99e04bba Merge "Fix JsonWriter bug" 2013-04-17 18:20:34 +00:00
Kurt Partridge dac3ee49ae Merge "Small dot in corner was not visible" 2013-04-17 17:18:35 +00:00
Kurt Partridge bf62dc9460 Fix bug in counting words between samples
Previously MainLogBuffer#shiftOutWords() assumed it wouldn't be called if
mNumWordsUntilSafeToSample was 0.  This relaxes this assumption (which is in fact
false in the current code).

Change-Id: I8723248095e84a0d9d6f4639b4742cc7dda9716b
2013-04-17 08:44:06 -07:00
Kurt Partridge fdc90d4a58 Fix user recording dialog
Clicking the "include recording" checkbox in the user feedback dialog did nothing.
The code was relying on the state of the checkbox, rather than keeping its own state.
Fixing this addresses the bug.

Change-Id: I559d57a4e11f869f6e6f5e5de7878f765531a203
2013-04-17 08:42:20 -07:00
Kurt Partridge 9d3bbc82a0 Fix alarm bug
The AlarmManager takes absolute times as an argument, not durations.

Change-Id: I419434ba5908c5f4070608070bbecf753088ecc8
2013-04-17 08:39:49 -07:00
Kurt Partridge cd831fa285 Fix JsonWriter bug
JsonWriter requires that data be written to it, else close() will throw
an exception.

Change-Id: I596c5363e063cc75bcda55e0a506eefb3f17bd67
2013-04-17 01:26:52 -07: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 2edb4f22cb Clean up unnecessary log messages
Change-Id: I6c3252f3b31c5874ea2f909f636f58b579c06b8d
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 2927223edd Merge "Better isolate ResearchLogging data" 2013-04-11 21:56:01 +00:00
Kurt Partridge cdaee868a3 Merge "Preserve a class for testing" 2013-04-10 23:45:33 +00:00
Kurt Partridge 3684036eed Preserve a class for testing
Addresses b/8583091

Change-Id: I89605223784312d9572dfc7c8aaa7e5eba44c4f6
2013-04-10 16:40:17 -07: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
Kurt Partridge 7faa2caa80 Merge "[Lazy4] Remove useless debug code" 2013-03-14 13:13:57 +00:00
Jean Chalard 13a82d9530 [Lazy2] Pass a runnable to abort
Change-Id: I721afbf426099753aa876a55323eb806b08c24d6
2013-03-12 18:56:57 -07:00
Jean Chalard 7423005b96 [Lazy1] Switch to blocking log closures
Change-Id: I4daec20b7b47b0d71c5aab6e17cd660015e19e71
2013-03-12 17:09:08 -07:00
Jean Chalard 220b271dfa [Lazy4] Remove useless debug code
This code is cluttering readability and getting in the way
of future updates.
Future updates will make it much easier to debug and to
test this code, so this needs to disappear.

Change-Id: I32e28ec608587b6b7c07250a2692b13e8fc98465
2013-03-08 17:46:00 -08:00
Kurt Partridge bba39b9b67 [FileEncap8] Remove useless "success" variable
Change-Id: Icf76bc0b795b6a9221d9a6d61c38df31af54ab7b
2013-03-07 17:43:35 -08:00
Kurt Partridge ee3261ff55 [FileEncap7] Extract uploadContents method
Change-Id: I018b2726533042dbcb25713ea039aec41c148db2
2013-03-07 17:43:28 -08:00
Kurt Partridge 4436446e9b [FileEncap6] Extract Uploader class
Gerrit was stuck on original change I9ef4eb7450

Change-Id: I6d4ee686944074779aca5b09b018782c7033874d
2013-03-07 16:19:44 -08:00
Kurt Partridge 9283644c41 [FileEncap5] Move conditional logic to caller
Change-Id: I6599539059f86dc8902210d325439c08035b2e2a
2013-03-06 07:19:41 -08:00
Kurt Partridge 88f466678c [FileEncap4] Simplify logic
Change-Id: Ibb8660d12812b867856259d3e5c04a31e281027d
2013-03-06 07:19:41 -08:00
Kurt Partridge 7f7850d23a [FileEncap3] Extract isUploadingUnconditionally method
- remove isUploadingUnconditionally local variable

Change-Id: I69be8708c1f306568cbb9c5cbefc9e42a87df497
2013-03-06 07:19:41 -08:00
Kurt Partridge 466e665b3c [FileEncap2] Remove mCanUpload instance variable
Change-Id: I62a100c4d73bb64a14a7994f7dd9af7b6946d064
2013-03-06 07:19:41 -08:00
Kurt Partridge 347b2ebebf [FileEncap1] Extract hasUploadingPermisssions method
Change-Id: Ica1dabcf066cde6580035f12fa35a404cb32fb3f
2013-03-06 07:19:41 -08:00