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
fe05b881
Commit
fe05b881
authored
12 years ago
by
Kurt Partridge
Browse files
Options
Downloads
Patches
Plain Diff
add logging code
Change-Id: I0abb4a1ad67666162ab6703ffdb33c5e0675be93
parent
59691147
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/ResearchLog.java
+7
-0
7 additions, 0 deletions
java/src/com/android/inputmethod/research/ResearchLog.java
java/src/com/android/inputmethod/research/ResearchLogger.java
+23
-0
23 additions, 0 deletions
.../src/com/android/inputmethod/research/ResearchLogger.java
with
30 additions
and
0 deletions
java/src/com/android/inputmethod/research/ResearchLog.java
+
7
−
0
View file @
fe05b881
...
...
@@ -102,7 +102,14 @@ public class ResearchLog {
mJsonWriter
.
endArray
();
mJsonWriter
.
flush
();
mJsonWriter
.
close
();
if
(
DEBUG
)
{
Log
.
d
(
TAG
,
"wrote log to "
+
mFile
);
}
mHasWrittenData
=
false
;
}
else
{
if
(
DEBUG
)
{
Log
.
d
(
TAG
,
"close() called, but no data, not outputting"
);
}
}
}
catch
(
Exception
e
)
{
Log
.
d
(
TAG
,
"error when closing ResearchLog:"
);
...
...
This diff is collapsed.
Click to expand it.
java/src/com/android/inputmethod/research/ResearchLogger.java
+
23
−
0
View file @
fe05b881
...
...
@@ -84,6 +84,7 @@ import java.util.UUID;
*/
public
class
ResearchLogger
implements
SharedPreferences
.
OnSharedPreferenceChangeListener
{
private
static
final
String
TAG
=
ResearchLogger
.
class
.
getSimpleName
();
private
static
final
boolean
DEBUG
=
false
;
private
static
final
boolean
OUTPUT_ENTIRE_BUFFER
=
false
;
// true may disclose private info
public
static
final
boolean
DEFAULT_USABILITY_STUDY_MODE
=
false
;
/* package */
static
boolean
sIsLogging
=
false
;
...
...
@@ -344,6 +345,9 @@ public class ResearchLogger implements SharedPreferences.OnSharedPreferenceChang
}
private
void
start
()
{
if
(
DEBUG
)
{
Log
.
d
(
TAG
,
"start called"
);
}
maybeShowSplashScreen
();
updateSuspendedState
();
requestIndicatorRedraw
();
...
...
@@ -371,6 +375,9 @@ public class ResearchLogger implements SharedPreferences.OnSharedPreferenceChang
}
/* package */
void
stop
()
{
if
(
DEBUG
)
{
Log
.
d
(
TAG
,
"stop called"
);
}
logStatistics
();
commitCurrentLogUnit
();
...
...
@@ -386,6 +393,9 @@ public class ResearchLogger implements SharedPreferences.OnSharedPreferenceChang
}
public
boolean
abort
()
{
if
(
DEBUG
)
{
Log
.
d
(
TAG
,
"abort called"
);
}
boolean
didAbortMainLog
=
false
;
if
(
mMainLogBuffer
!=
null
)
{
mMainLogBuffer
.
clear
();
...
...
@@ -559,6 +569,9 @@ public class ResearchLogger implements SharedPreferences.OnSharedPreferenceChang
}
public
void
uploadNow
()
{
if
(
DEBUG
)
{
Log
.
d
(
TAG
,
"calling uploadNow()"
);
}
mInputMethodService
.
startService
(
mUploadIntent
);
}
...
...
@@ -578,6 +591,13 @@ public class ResearchLogger implements SharedPreferences.OnSharedPreferenceChang
}
private
boolean
isAllowedToLog
()
{
if
(
DEBUG
)
{
Log
.
d
(
TAG
,
"iatl: "
+
"mipw="
+
mIsPasswordView
+
", mils="
+
mIsLoggingSuspended
+
", sil="
+
sIsLogging
+
", mInFeedbackDialog="
+
mInFeedbackDialog
);
}
return
!
mIsPasswordView
&&
!
mIsLoggingSuspended
&&
sIsLogging
&&
!
mInFeedbackDialog
;
}
...
...
@@ -666,6 +686,9 @@ public class ResearchLogger implements SharedPreferences.OnSharedPreferenceChang
}
/* package for test */
void
commitCurrentLogUnit
()
{
if
(
DEBUG
)
{
Log
.
d
(
TAG
,
"commitCurrentLogUnit"
);
}
if
(!
mCurrentLogUnit
.
isEmpty
())
{
if
(
mMainLogBuffer
!=
null
)
{
mMainLogBuffer
.
shiftIn
(
mCurrentLogUnit
);
...
...
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