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
fca71cfd
Commit
fca71cfd
authored
12 years ago
by
Tadashi G. Takaoka
Browse files
Options
Downloads
Patches
Plain Diff
Cleanup logging code
Change-Id: Ia604a4fcebfc5179bdbeaa982e052f7d3882ac6e
parent
2db1ea79
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
java/src/com/android/inputmethod/keyboard/MainKeyboardView.java
+41
-40
41 additions, 40 deletions
...rc/com/android/inputmethod/keyboard/MainKeyboardView.java
with
41 additions
and
40 deletions
java/src/com/android/inputmethod/keyboard/MainKeyboardView.java
+
41
−
40
View file @
fca71cfd
...
...
@@ -30,7 +30,6 @@ import android.graphics.Typeface;
import
android.graphics.drawable.Drawable
;
import
android.os.Message
;
import
android.preference.PreferenceManager
;
import
android.text.TextUtils
;
import
android.util.AttributeSet
;
import
android.util.Log
;
import
android.view.LayoutInflater
;
...
...
@@ -723,39 +722,15 @@ public final class MainKeyboardView extends KeyboardView implements PointerTrack
x
=
(
int
)
me
.
getX
(
index
);
y
=
(
int
)
me
.
getY
(
index
);
}
if
(
ENABLE_USABILITY_STUDY_LOG
)
{
final
String
eventTag
;
switch
(
action
)
{
case
MotionEvent
.
ACTION_UP
:
eventTag
=
"[Up]"
;
break
;
case
MotionEvent
.
ACTION_DOWN
:
eventTag
=
"[Down]"
;
break
;
case
MotionEvent
.
ACTION_POINTER_UP
:
eventTag
=
"[PointerUp]"
;
break
;
case
MotionEvent
.
ACTION_POINTER_DOWN
:
eventTag
=
"[PointerDown]"
;
break
;
case
MotionEvent
.
ACTION_MOVE
:
// Skip this as being logged below
eventTag
=
""
;
break
;
default
:
eventTag
=
"[Action"
+
action
+
"]"
;
break
;
}
if
(!
TextUtils
.
isEmpty
(
eventTag
))
{
final
float
size
=
me
.
getSize
(
index
);
final
float
pressure
=
me
.
getPressure
(
index
);
UsabilityStudyLogUtils
.
getInstance
().
write
(
eventTag
+
eventTime
+
","
+
id
+
","
+
x
+
","
+
y
+
","
+
size
+
","
+
pressure
);
}
// TODO: This might be moved to the tracker.processMotionEvent() call below.
if
(
ENABLE_USABILITY_STUDY_LOG
&&
action
!=
MotionEvent
.
ACTION_MOVE
)
{
writeUsabilityStudyLog
(
me
,
action
,
eventTime
,
index
,
id
,
x
,
y
);
}
// TODO: This should be moved to the tracker.processMotionEvent() call below.
// Currently the same "move" event is being logged twice.
if
(
ProductionFlag
.
IS_EXPERIMENTAL
)
{
ResearchLogger
.
mainKeyboardView_processMotionEvent
(
me
,
action
,
eventTime
,
index
,
id
,
x
,
y
);
ResearchLogger
.
mainKeyboardView_processMotionEvent
(
me
,
action
,
eventTime
,
index
,
id
,
x
,
y
);
}
if
(
mKeyTimerHandler
.
isInKeyRepeat
())
{
...
...
@@ -781,8 +756,9 @@ public final class MainKeyboardView extends KeyboardView implements PointerTrack
final
Key
newKey
=
tracker
.
getKeyOn
(
x
,
y
);
if
(
mOldKey
!=
newKey
)
{
tracker
.
onDownEvent
(
x
,
y
,
eventTime
,
this
);
if
(
action
==
MotionEvent
.
ACTION_UP
)
if
(
action
==
MotionEvent
.
ACTION_UP
)
{
tracker
.
onUpEvent
(
x
,
y
,
eventTime
);
}
}
}
else
if
(
pointerCount
==
2
&&
oldPointerCount
==
1
)
{
// Single-touch to multi-touch transition.
...
...
@@ -819,15 +795,11 @@ public final class MainKeyboardView extends KeyboardView implements PointerTrack
}
tracker
.
onMoveEvent
(
px
,
py
,
eventTime
,
motionEvent
);
if
(
ENABLE_USABILITY_STUDY_LOG
)
{
final
float
pointerSize
=
me
.
getSize
(
i
);
final
float
pointerPressure
=
me
.
getPressure
(
i
);
UsabilityStudyLogUtils
.
getInstance
().
write
(
"[Move]"
+
eventTime
+
","
+
pointerId
+
","
+
px
+
","
+
py
+
","
+
pointerSize
+
","
+
pointerPressure
);
writeUsabilityStudyLog
(
me
,
action
,
eventTime
,
i
,
pointerId
,
px
,
py
);
}
if
(
ProductionFlag
.
IS_EXPERIMENTAL
)
{
ResearchLogger
.
mainKeyboardView_processMotionEvent
(
me
,
action
,
eventTime
,
i
,
pointerId
,
px
,
py
);
ResearchLogger
.
mainKeyboardView_processMotionEvent
(
me
,
action
,
eventTime
,
i
,
pointerId
,
px
,
py
);
}
}
}
else
{
...
...
@@ -838,6 +810,35 @@ public final class MainKeyboardView extends KeyboardView implements PointerTrack
return
true
;
}
private
static
void
writeUsabilityStudyLog
(
final
MotionEvent
me
,
final
int
action
,
final
long
eventTime
,
final
int
index
,
final
int
id
,
final
int
x
,
final
int
y
)
{
final
String
eventTag
;
switch
(
action
)
{
case
MotionEvent
.
ACTION_UP
:
eventTag
=
"[Up]"
;
break
;
case
MotionEvent
.
ACTION_DOWN
:
eventTag
=
"[Down]"
;
break
;
case
MotionEvent
.
ACTION_POINTER_UP
:
eventTag
=
"[PointerUp]"
;
break
;
case
MotionEvent
.
ACTION_POINTER_DOWN
:
eventTag
=
"[PointerDown]"
;
break
;
case
MotionEvent
.
ACTION_MOVE
:
eventTag
=
"[Move]"
;
break
;
default
:
eventTag
=
"[Action"
+
action
+
"]"
;
break
;
}
final
float
size
=
me
.
getSize
(
index
);
final
float
pressure
=
me
.
getPressure
(
index
);
UsabilityStudyLogUtils
.
getInstance
().
write
(
eventTag
+
eventTime
+
","
+
id
+
","
+
x
+
","
+
y
+
","
+
size
+
","
+
pressure
);
}
@Override
public
void
closing
()
{
super
.
closing
();
...
...
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