Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AndroidSystemCore
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Werner Sembach
AndroidSystemCore
Commits
205cdb88
Commit
205cdb88
authored
9 years ago
by
Alex Deymo
Committed by
Gerrit Code Review
9 years ago
Browse files
Options
Downloads
Plain Diff
Merge "metricsd: Create a brillo::MessageLoop."
parents
42a53e0c
f1bf9e5f
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
metricsd/uploader/metricsd_service_runner.cc
+5
-2
5 additions, 2 deletions
metricsd/uploader/metricsd_service_runner.cc
metricsd/uploader/metricsd_service_runner.h
+2
-0
2 additions, 0 deletions
metricsd/uploader/metricsd_service_runner.h
with
7 additions
and
2 deletions
metricsd/uploader/metricsd_service_runner.cc
+
5
−
2
View file @
205cdb88
...
...
@@ -20,6 +20,7 @@
#include
<binder/IServiceManager.h>
#include
<brillo/binder_watcher.h>
#include
<brillo/message_loops/base_message_loop.h>
#include
<utils/Errors.h>
#include
"uploader/bn_metricsd_impl.h"
...
...
@@ -40,15 +41,17 @@ void MetricsdServiceRunner::Run() {
CHECK
(
status
==
android
::
OK
)
<<
"Metricsd service registration failed"
;
message_loop_for_io_
.
reset
(
new
base
::
MessageLoopForIO
);
message_loop_
.
reset
(
new
brillo
::
BaseMessageLoop
(
message_loop_for_io_
.
get
()));
brillo
::
BinderWatcher
watcher
;
brillo
::
BinderWatcher
watcher
(
message_loop_
.
get
())
;
CHECK
(
watcher
.
Init
())
<<
"failed to initialize the binder file descriptor "
<<
"watcher"
;
message_loop_
for_io_
->
Run
();
message_loop_
->
Run
();
// Delete the message loop here as it needs to be deconstructed in the thread
// it is attached to.
message_loop_
.
reset
();
message_loop_for_io_
.
reset
();
}
...
...
This diff is collapsed.
Click to expand it.
metricsd/uploader/metricsd_service_runner.h
+
2
−
0
View file @
205cdb88
...
...
@@ -21,6 +21,7 @@
#include
<thread>
#include
<base/message_loop/message_loop.h>
#include
<brillo/message_loops/message_loop.h>
#include
"uploader/crash_counters.h"
...
...
@@ -39,6 +40,7 @@ class MetricsdServiceRunner {
void
Run
();
std
::
unique_ptr
<
base
::
MessageLoopForIO
>
message_loop_for_io_
;
std
::
unique_ptr
<
brillo
::
MessageLoop
>
message_loop_
;
std
::
unique_ptr
<
std
::
thread
>
thread_
;
std
::
shared_ptr
<
CrashCounters
>
counters_
;
...
...
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