diff options
| author | Po Lu | 2023-03-10 09:40:41 +0800 |
|---|---|---|
| committer | Po Lu | 2023-03-10 09:40:41 +0800 |
| commit | 488a75f2e2b73038ff341f3484a8cf8584633eff (patch) | |
| tree | 4871fe49e7009816a004f96d59fcb3b945c294d8 /src/android.h | |
| parent | 4392423cb6df5a8af9a0520da04378e189fd387e (diff) | |
| download | emacs-488a75f2e2b73038ff341f3484a8cf8584633eff.tar.gz emacs-488a75f2e2b73038ff341f3484a8cf8584633eff.zip | |
Port Android battery status to Android 4.4 and earlier
* java/org/gnu/emacs/EmacsService.java (EmacsService)
(queryBattery19): New function.
(queryBattery): Call it on old systems. Also, return AC line
status and temperature.
* lisp/battery.el (battery-android): Implement more format
directives.
* src/android.c (android_query_battery): Handle new status
fields.
* src/android.h (struct android_battery_state): Add `plugged'
and `temperature'.
* src/androidfns.c (Fandroid_query_battery): Return new fields.
Diffstat (limited to 'src/android.h')
| -rw-r--r-- | src/android.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/android.h b/src/android.h index ed0089ad94e..450f3859df9 100644 --- a/src/android.h +++ b/src/android.h | |||
| @@ -160,6 +160,18 @@ struct android_battery_state | |||
| 160 | but is not charging either. | 160 | but is not charging either. |
| 161 | 1, if the battery state is unknown. */ | 161 | 1, if the battery state is unknown. */ |
| 162 | int status; | 162 | int status; |
| 163 | |||
| 164 | /* The power source of the battery. Value is: | ||
| 165 | |||
| 166 | 0, if on battery power. | ||
| 167 | 1, for line power. | ||
| 168 | 8, for dock power. | ||
| 169 | 2, for USB power. | ||
| 170 | 4, for wireless power. */ | ||
| 171 | int plugged; | ||
| 172 | |||
| 173 | /* The temperature of the battery in 10 * degrees centigrade. */ | ||
| 174 | int temperature; | ||
| 163 | }; | 175 | }; |
| 164 | 176 | ||
| 165 | extern Lisp_Object android_browse_url (Lisp_Object); | 177 | extern Lisp_Object android_browse_url (Lisp_Object); |