Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
LatinIME
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
keyboard
LatinIME
Commits
05ee6ad8
Commit
05ee6ad8
authored
12 years ago
by
Kurt Partridge
Browse files
Options
Downloads
Patches
Plain Diff
[Rlog58b] Log user pauses
Change-Id: I7802f07192a4cba4f3cfb5c08ce6d5d2d85a46c1
parent
75e69753
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
java/src/com/android/inputmethod/research/ResearchLogger.java
+18
-4
18 additions, 4 deletions
.../src/com/android/inputmethod/research/ResearchLogger.java
java/src/com/android/inputmethod/research/Statistics.java
+36
-20
36 additions, 20 deletions
java/src/com/android/inputmethod/research/Statistics.java
with
54 additions
and
24 deletions
java/src/com/android/inputmethod/research/ResearchLogger.java
+
18
−
4
View file @
05ee6ad8
...
...
@@ -1153,7 +1153,7 @@ public class ResearchLogger implements SharedPreferences.OnSharedPreferenceChang
suggestion
==
null
?
null
:
scrubbedWord
,
Constants
.
SUGGESTION_STRIP_COORDINATE
,
Constants
.
SUGGESTION_STRIP_COORDINATE
);
researchLogger
.
commitCurrentLogUnitAsWord
(
scrubbedWord
,
Long
.
MAX_VALUE
,
isBatchMode
);
researchLogger
.
mStatistics
.
recordManualSuggestion
();
researchLogger
.
mStatistics
.
recordManualSuggestion
(
SystemClock
.
uptimeMillis
()
);
}
/**
...
...
@@ -1281,7 +1281,7 @@ public class ResearchLogger implements SharedPreferences.OnSharedPreferenceChang
}
researchLogger
.
enqueueEvent
(
logUnit
!=
null
?
logUnit
:
researchLogger
.
mCurrentLogUnit
,
LOGSTATEMENT_LATINIME_REVERTCOMMIT
,
committedWord
,
originallyTypedWord
);
researchLogger
.
mStatistics
.
recordRevertCommit
();
researchLogger
.
mStatistics
.
recordRevertCommit
(
SystemClock
.
uptimeMillis
()
);
researchLogger
.
commitCurrentLogUnitAsWord
(
originallyTypedWord
,
Long
.
MAX_VALUE
,
isBatchMode
);
}
...
...
@@ -1611,7 +1611,8 @@ public class ResearchLogger implements SharedPreferences.OnSharedPreferenceChang
final
ResearchLogger
researchLogger
=
getInstance
();
researchLogger
.
enqueueEvent
(
LOGSTATEMENT_LATINIME_ONENDBATCHINPUT
,
enteredText
,
enteredWordPos
);
researchLogger
.
mStatistics
.
recordGestureInput
(
enteredText
.
length
());
researchLogger
.
mStatistics
.
recordGestureInput
(
enteredText
.
length
(),
SystemClock
.
uptimeMillis
());
}
/**
...
...
@@ -1624,7 +1625,20 @@ public class ResearchLogger implements SharedPreferences.OnSharedPreferenceChang
public
static
void
latinIME_handleBackspace_batch
(
final
CharSequence
deletedText
)
{
final
ResearchLogger
researchLogger
=
getInstance
();
researchLogger
.
enqueueEvent
(
LOGSTATEMENT_LATINIME_HANDLEBACKSPACE_BATCH
,
deletedText
);
researchLogger
.
mStatistics
.
recordGestureDelete
();
researchLogger
.
mStatistics
.
recordGestureDelete
(
deletedText
.
length
(),
SystemClock
.
uptimeMillis
());
}
/**
* Log a long interval between user operation.
*
* UserInput: The user has not done anything for a while.
*/
private
static
final
LogStatement
LOGSTATEMENT_ONUSERPAUSE
=
new
LogStatement
(
"OnUserPause"
,
false
,
false
,
"intervalInMs"
);
public
static
void
onUserPause
(
final
long
interval
)
{
final
ResearchLogger
researchLogger
=
getInstance
();
researchLogger
.
enqueueEvent
(
LOGSTATEMENT_ONUSERPAUSE
,
interval
);
}
/**
...
...
This diff is collapsed.
Click to expand it.
java/src/com/android/inputmethod/research/Statistics.java
+
36
−
20
View file @
05ee6ad8
...
...
@@ -134,17 +134,9 @@ public class Statistics {
if
(
DEBUG
)
{
Log
.
d
(
TAG
,
"recordChar() called"
);
}
final
long
delta
=
time
-
mLastTapTime
;
if
(
codePoint
==
Constants
.
CODE_DELETE
)
{
mDeleteKeyCount
++;
if
(
delta
<
MIN_DELETION_INTERMISSION
)
{
if
(
mIsLastKeyDeleteKey
)
{
mDuringRepeatedDeleteKeysCounter
.
add
(
delta
);
}
else
{
mBeforeDeleteKeyCounter
.
add
(
delta
);
}
}
mIsLastKeyDeleteKey
=
true
;
recordUserAction
(
time
,
true
/* isDeletion */
);
}
else
{
mCharCount
++;
if
(
Character
.
isDigit
(
codePoint
))
{
...
...
@@ -156,14 +148,8 @@ public class Statistics {
if
(
Character
.
isSpaceChar
(
codePoint
))
{
mSpaceCount
++;
}
if
(
mIsLastKeyDeleteKey
&&
delta
<
MIN_DELETION_INTERMISSION
)
{
mAfterDeleteKeyCounter
.
add
(
delta
);
}
else
if
(!
mIsLastKeyDeleteKey
&&
delta
<
MIN_TYPING_INTERMISSION
)
{
mKeyCounter
.
add
(
delta
);
}
mIsLastKeyDeleteKey
=
false
;
recordUserAction
(
time
,
false
/* isDeletion */
);
}
mLastTapTime
=
time
;
}
public
void
recordWordEntered
(
final
boolean
isDictionaryWord
)
{
...
...
@@ -177,9 +163,10 @@ public class Statistics {
mSplitWordsCount
++;
}
public
void
recordGestureInput
(
final
int
numCharsEntered
)
{
public
void
recordGestureInput
(
final
int
numCharsEntered
,
final
long
time
)
{
mGesturesInputCount
++;
mGesturesCharsCount
+=
numCharsEntered
;
recordUserAction
(
time
,
false
/* isDeletion */
);
}
public
void
setIsEmptyUponStarting
(
final
boolean
isEmpty
)
{
...
...
@@ -187,14 +174,43 @@ public class Statistics {
mIsEmptinessStateKnown
=
true
;
}
public
void
recordGestureDelete
()
{
public
void
recordGestureDelete
(
final
int
length
,
final
long
time
)
{
mGesturesDeletedCount
++;
recordUserAction
(
time
,
true
/* isDeletion */
);
}
public
void
recordManualSuggestion
()
{
public
void
recordManualSuggestion
(
final
long
time
)
{
mManualSuggestionsCount
++;
recordUserAction
(
time
,
false
/* isDeletion */
);
}
public
void
recordRevertCommit
()
{
public
void
recordRevertCommit
(
final
long
time
)
{
mRevertCommitsCount
++;
recordUserAction
(
time
,
true
/* isDeletion */
);
}
private
void
recordUserAction
(
final
long
time
,
final
boolean
isDeletion
)
{
final
long
delta
=
time
-
mLastTapTime
;
if
(
isDeletion
)
{
if
(
delta
<
MIN_DELETION_INTERMISSION
)
{
if
(
mIsLastKeyDeleteKey
)
{
mDuringRepeatedDeleteKeysCounter
.
add
(
delta
);
}
else
{
mBeforeDeleteKeyCounter
.
add
(
delta
);
}
}
else
{
ResearchLogger
.
onUserPause
(
delta
);
}
}
else
{
if
(
mIsLastKeyDeleteKey
&&
delta
<
MIN_DELETION_INTERMISSION
)
{
mAfterDeleteKeyCounter
.
add
(
delta
);
}
else
if
(!
mIsLastKeyDeleteKey
&&
delta
<
MIN_TYPING_INTERMISSION
)
{
mKeyCounter
.
add
(
delta
);
}
else
{
ResearchLogger
.
onUserPause
(
delta
);
}
}
mIsLastKeyDeleteKey
=
isDeletion
;
mLastTapTime
=
time
;
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment