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
d633106d
Commit
d633106d
authored
Feb 22, 2016
by
Yabin Cui
Committed by
Gerrit Code Review
Feb 22, 2016
Browse files
Options
Downloads
Plain Diff
Merge "healthd: support reading charge status from BatteryMonitor."
parents
0fc00668
aedf6038
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
healthd/BatteryMonitor.cpp
+11
-0
11 additions, 0 deletions
healthd/BatteryMonitor.cpp
healthd/include/healthd/BatteryMonitor.h
+1
-0
1 addition, 0 deletions
healthd/include/healthd/BatteryMonitor.h
with
12 additions
and
0 deletions
healthd/BatteryMonitor.cpp
+
11
−
0
View file @
d633106d
...
...
@@ -341,6 +341,17 @@ bool BatteryMonitor::update(void) {
props
.
chargerWirelessOnline
;
}
int
BatteryMonitor
::
getChargeStatus
()
{
int
result
=
BATTERY_STATUS_UNKNOWN
;
if
(
!
mHealthdConfig
->
batteryStatusPath
.
isEmpty
())
{
char
buf
[
128
];
if
(
readFromFile
(
mHealthdConfig
->
batteryStatusPath
,
buf
,
sizeof
(
buf
))
>
0
)
{
result
=
getBatteryStatus
(
buf
);
}
}
return
result
;
}
status_t
BatteryMonitor
::
getProperty
(
int
id
,
struct
BatteryProperty
*
val
)
{
status_t
ret
=
BAD_VALUE
;
...
...
This diff is collapsed.
Click to expand it.
healthd/include/healthd/BatteryMonitor.h
+
1
−
0
View file @
d633106d
...
...
@@ -40,6 +40,7 @@ class BatteryMonitor {
BatteryMonitor
();
void
init
(
struct
healthd_config
*
hc
);
bool
update
(
void
);
int
getChargeStatus
();
status_t
getProperty
(
int
id
,
struct
BatteryProperty
*
val
);
void
dumpState
(
int
fd
);
...
...
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