Todd Poynor | 10b235e | 2013-08-07 15:25:14 -0700 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright (C) 2013 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | #ifndef _HEALTHD_H_ |
| 18 | #define _HEALTHD_H_ |
| 19 | |
| 20 | #include <batteryservice/BatteryService.h> |
| 21 | |
| 22 | // The following are implemented in libhealthd_board to handle board-specific |
| 23 | // behavior. |
| 24 | // |
| 25 | // Set periodic poll intervals in seconds. |
| 26 | // |
| 27 | // fast_interval is used while the device is not in suspend, or in suspend and |
| 28 | // connected to a charger (to watch for battery overheat due to charging). |
| 29 | // The default value is 60 (1 minute). Value -1 turns off fast_interval |
| 30 | // polling. |
| 31 | // |
| 32 | // slow_interval is used when the device is in suspend and not connected to a |
| 33 | // charger (to watch for a battery drained to zero remaining capacity). The |
| 34 | // default value is 600 (10 minutes). Value -1 tuns off slow interval |
| 35 | // polling. |
| 36 | // |
| 37 | // To use the default values, this function can simply return without |
| 38 | // modifying the parameters. |
| 39 | |
| 40 | void healthd_board_poll_intervals(int *fast_interval, int *slow_interval); |
| 41 | |
| 42 | // Process updated battery property values. This function is called when |
| 43 | // the kernel sends updated battery status via a uevent from the power_supply |
| 44 | // subsystem, or when updated values are polled by healthd, as for periodic |
| 45 | // poll of battery state. |
| 46 | // |
| 47 | // props are the battery properties read from the kernel. These values may |
| 48 | // be modified in this call, prior to sending the modified values to the |
| 49 | // Android runtime. |
| 50 | // |
| 51 | // Return 0 to indicate the usual kernel log battery status heartbeat message |
| 52 | // is to be logged, or non-zero to prevent logging this information. |
| 53 | |
| 54 | int healthd_board_battery_update(struct android::BatteryProperties *props); |
| 55 | |
| 56 | #endif /* _HEALTHD_H_ */ |