location-cache: add class to store cached location

This class allows to preserve cached position across ModemManager restarts.
Cached location can be used to improve time to first fix after device
start by injecting coarse position into location engine. Since there
wasn't any fix yet, position in ModemManager is unknown. To fix this
cached location is saved on disk (/var/lib/ModemManager/location.ini)
when location session is stopped or ModemManager is stopped and loaded
on the next start from the file.

install_emptydir is introduced in meson 0.60.

Distributions has to create directory to store cached location in
packaging, because ModemManager runs under systemd isolation with
limited rights and it can't create this directory by itself.

Signed-off-by: Andrey Skvortsov <andrej.skvortzov@gmail.com>
This commit is contained in:
Andrey Skvortsov
2026-01-10 02:04:10 +03:00
parent 81101b0147
commit 8ac3dfb955
4 changed files with 312 additions and 1 deletions
+3 -1
View File
@@ -10,7 +10,7 @@ project(
'c_std=gnu89',
'warning_level=2',
],
meson_version: '>= 0.53.0',
meson_version: '>= 0.60.0',
)
meson_version = meson.version()
@@ -31,11 +31,13 @@ mm_includedir = get_option('includedir')
mm_libdir = get_option('libdir')
mm_sbindir = get_option('sbindir')
mm_sysconfdir = get_option('sysconfdir')
mm_sharedstatedir = get_option('sharedstatedir')
mm_pkgdatadir = mm_datadir / mm_name
mm_pkgincludedir = mm_includedir / mm_name
mm_pkglibdir = mm_libdir / mm_name
mm_pkgsysconfdir = mm_sysconfdir / mm_name
mm_pkgsharedstatedir = mm_sharedstatedir / mm_name
mm_glib_name = 'libmm-glib'
mm_glib_pkgincludedir = mm_includedir / mm_glib_name