Commit Graph

56 Commits

Author SHA1 Message Date
jingfei 685ee48a5e kvdb: optimize property_connect() for BMP/AMP scenarios
Instead of trying all socket types (local + rpmsg), select the
correct one based on the net type. And use getsockname() at runtime
to decide when both net_local and net_rpmsg are enabled, if on
the same core as KVDB server, use local socket; otherwise use rpmsg socket.

Increase KVDB_BACKLOG_CONNS to 256

Signed-off-by: jingfei <jingfei@xiaomi.com>
2026-04-20 14:51:00 +08:00
Bowen Wang 2bc0ee4043 utils/kvdb: change the default timeout from 0.5s to 5s
500ms is too short

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2026-04-20 14:51:00 +08:00
dongjiuzhu1 269482a578 kvdb/connect: add default timeout for kvdb connect
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2026-04-20 14:50:59 +08:00
dongjiuzhu1 7c122154fc bmp/kvdb: try net local and net rpmsg for kvdb client to compitable bmp mode
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2026-04-20 14:50:59 +08:00
yintao cc42dd74ae kvdb: Set the maximum listening count for kvdb separately
kvdbd is single threaded.
If CP calls property_list, AP'S kvdbd will continue to send to cp,
then accept will not be executed.
If another thread at CP loops to call property_set,
the AP server-side's pending queue will be full and reject next connection.

Bluetooth now loops through 15 times to call 'property_set',
So to avoid rejecting the connection,
set a macro to separately manage the listening count of kvdb

Signed-off-by: yintao <yintao@xiaomi.com>
2026-04-20 14:50:43 +08:00
huangcaihua b20cb7e892 gdbus:Add new gdbus config with depend on uv-ext
Signed-off-by: huangcaihua <huangcaihua@xiaomi.com>
2026-04-20 14:50:42 +08:00
hongfengchen 788cbf7a19 utils:KVDB_NVS should depend on MTD_CONFIG_NAMED
KVDB_NVS should depend on MTD_CONFIG_NAMED. If choose
select MTD_CONFIG_NAMED and CONFIG_MTD is not set, it
will lead to compile error like:

dev-system/nuttx/include/nuttx/mtd/configdata.h:79:20: error: 'CONFIG_MTD_CONFIG_NAME_LEN' undeclared here (not in a function); did you mean 'CONFIG_MTD_CONFIG_NAMED'?
   79 |   char        name[CONFIG_MTD_CONFIG_NAME_LEN];
      |                    ^~~~~~~~~~~~~~~~~~~~~~~~~~
      |                    CONFIG_MTD_CONFIG_NAMED

Signed-off-by: hongfengchen <hongfengchen@xiaomi.com>
2026-04-20 14:50:41 +08:00
zhaoxingyu1 00f8a002ea framework/kvdb: modify kvdb depends on !MTD_CONFIG_NONE
Signed-off-by: zhaoxingyu1 <zhaoxingyu1@xiaomi.com>
2026-04-20 14:50:41 +08:00
zhangshoukui 697f762467 KVDB_NVS: modify depends on
Signed-off-by: zhangshoukui <zhangshoukui@xiaomi.com>
2026-04-20 14:50:39 +08:00
cuiziwei 05d63e122b apps/frameworks: Add ALOG to select LIBC_PRINT_EXTENSION to print log.
cause ALOG will print log with syslog(g_logprimap[prio], "[%s] %pV\n", tag, &vaf);

Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
2026-04-20 14:50:39 +08:00
buxiasen aacdcf4247 kvdb: use filekv over tmpfs as no-persist kv backend
Persist NVS KVDB and rammtd temporary is not a good case,
Unqlite over tmpfs is much slower than tmpfs.

Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2026-04-20 14:50:39 +08:00
xuxin19 dfe7551c97 utils(build):refactor frameworks system build
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2026-04-20 14:50:38 +08:00
Shanmin Zhang 64cdbb0082 goldfish: add qemu-props for passing boot properties.
Signed-off-by: Shanmin Zhang <zhangshanmin@xiaomi.com>
2026-04-20 14:50:37 +08:00
chenrun1 54d51b4cf7 kvdb/file: Add new optional kvdb backend filekv
Summary:
  Added filekv backend,We need to configure the persist storage location (folder directory) and tmp storage location (folder directory) if we need
  next:Put the file behavior in common so that other backends can use it

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2026-04-20 14:50:37 +08:00
guohao15 8385a1c0e4 kvdb:add new Kconfig to minimize code size
Signed-off-by: guohao15 <guohao15@xiaomi.com>
Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2026-04-20 14:50:37 +08:00
haopengxiang c3e49a53e7 utils/kvdb/Kconfig: simplify KVDB_UNQLITE depends on
FS_LOCK_BUCKET_SIZE has been added required in config UNQLITE

config UNQLITE
	bool "UnQLite Database"
	depends on TLS_TASK_NELEM > 0
	depends on FS_LOCK_BUCKET_SIZE > 0
	default n

Signed-off-by: haopengxiang <haopengxiang@xiaomi.com>
2026-04-20 14:50:36 +08:00
Shoukui Zhang 78d134c4c3 kvdb: Add kvdb depends and configuration help
Signed-off-by: Shoukui Zhang <zhangshoukui@xiaomi.com>
2026-04-20 14:50:35 +08:00
xucheng5 85051786bd kvdb: support config non-persist key-value
dependson:odm_473531 odm_474320

Signed-off-by: xucheng5 <xucheng5@xiaomi.com>
2026-04-20 14:50:34 +08:00
cuiziwei f1eb38cc42 framworks/utils:add CONFIG_ALOG to control log level.
Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
2026-04-20 14:50:33 +08:00
xucheng5 046d8d0f32 KVDB : support NVS
KVDB use unqlite by default. NVS will be another choice

dependson: 965665 965758 partner_22343 partner_22348 partner_22347 partner_22345 partner_22354 partner_22397

Signed-off-by: xucheng5 <xucheng5@xiaomi.com>
2026-04-20 14:50:33 +08:00
yuanchengcheng ef490af16e kvdb : kvdb supports the mode without server
In the case of a single core, there is no need to monitor the rpmsg socket, and the client can directly call the interface set and get attributes

Signed-off-by: yuanchengcheng <yuanchengcheng@xiaomi.com>
2026-04-20 14:50:33 +08:00
Xiang Xiao bf94deb0c7 kvdb: Rename CONFIG_KVDB_LOG_LEVEL_xxx to CONFIG_KVDB_LOG_xxx
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2026-04-20 14:50:33 +08:00
yinshengkai 67d367e922 cutils/trace: add atrace command
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2026-04-20 14:50:32 +08:00
wangbowen6 124a27e665 kvdb: move error log config to correct place and remove unused kconfig
Signed-off-by: wangbowen6 <wangbowen6@xiaomi.com>
2026-04-20 14:50:31 +08:00
Xiang Xiao ef75bc9ab5 Move kvdb from kvdb/ to utils/kvdb/
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2026-04-20 14:50:30 +08:00
openvela-robot d0206fcdb5 Merge branch 'dev' of kvdb into dev 2026-04-20 14:50:30 +08:00
openvela-robot 76f262a843 init kvdb
Signed-off-by: zhangning21 <zhangning21@xiaomi.com>
2026-04-20 14:50:30 +08:00
openvela-robot 4a71f2f23a Remove __INTRODUCED_IN from android/set_abort_message.h
since it is Android specific version not suitable for vela at all

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2026-04-20 14:50:30 +08:00
openvela-robot b4945489fa Move PROP_NAME_MAX and PROP_VALUE_MAX to system_properties.h
and sync system_properties.h with android 13

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2026-04-20 14:50:29 +08:00
openvela-robot 28798e0839 frameworks/gdbus: fix kasan report error because stack var overflow
When the type of basic value is double, can't using void *value as buffer to get value.

==3263760==ERROR: AddressSanitizer: stack-buffer-overflow on address 0xefe13c30 at pc 0x577c0356 bp 0xefe139b8 sp 0xefe139a8
WRITE of size 8 at 0xefe13c30 thread T0
    #0 0x577c0355 in _dbus_marshal_read_basic dbus/dbus/dbus-marshal-basic.c:581
    #1 0x5783bedb in _dbus_type_reader_read_basic dbus/dbus/dbus-marshal-recursive.c:879
    #2 0x5776ef72 in dbus_message_iter_get_basic dbus/dbus/dbus-message.c:2376
    #3 0x57e06daa in iter_append_iter gdbus/client.c:222
    #4 0x57e070b1 in prop_entry_update gdbus/client.c:265
    #5 0x57e07454 in prop_entry_new gdbus/client.c:286
    #6 0x57e0793a in add_property gdbus/client.c:322
    #7 0x57e09abd in properties_changed_non_standard gdbus/client.c:544
    #8 0x57df2e00 in signal_filter gdbus/watch.c:394
    #9 0x57df4d57 in message_filter gdbus/watch.c:544
    #10 0x57752dc6 in dbus_connection_dispatch dbus/dbus/dbus-connection.c:4703
    #11 0x57dde7d5 in message_dispatch gdbus/mainloop.c:59
    #12 0x5790e3b8 in g_idle_dispatch glib/glib/gmain.c:6157
    #13 0x57900a31 in g_main_dispatch glib/glib/gmain.c:3477
    #14 0x579080d3 in g_main_context_dispatch glib/glib/gmain.c:4195
    #15 0x57908bcc in g_main_context_iterate glib/glib/gmain.c:4271
    #16 0x57909e7f in g_main_loop_run glib/glib/gmain.c:4471
    #17 0x57dde5b7 in telephonytool_main /home/djz/workspace/test/sim/frameworks/telephony/telephony_tool.c:878
    #18 0x56ea66b5 in nxtask_startup sched/task_startup.c:70
    #19 0x56e541a8 in nxtask_start task/task_start.c:134

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2026-04-20 14:50:29 +08:00
openvela-robot 43f2e18ea9 system_properties: add android system property wrapper layer
There are still three fail test cases (android property test):
1. empty key test, reason: kvdb do not support empty key;
2. long key test, reason: (a) read only property value length can be
   arbitrarily-long in android, kvdb do not support; (b) read only
   property can be set if the property do not exist before, kvdb
   not allowed this action;
3. cached property test, reason: (a) android cached property uses
   serial to judge the [key, value] changed, kvdb can't handle this
   very well; (b) android cached property return the value pointer
   from the shared memory directly for read only property, kvdb
   can't handle this well too.

Signed-off-by: wangbowen6 <wangbowen6@xiaomi.com>
2026-04-20 14:50:29 +08:00
openvela-robot 3118e9b294 3dde8c07998f0c9c7f9689495eb2690cc3f5a924
Signed-off-by: haopengxiang <haopengxiang@xiaomi.com>
2026-04-20 14:50:17 +08:00
openvela-robot bd246bdc0d kvdb/client: fix monitor fd leak
Signed-off-by: chao an <anchao@xiaomi.com>
2026-04-20 14:50:17 +08:00
jihandong 9b5e791570 frameworks: rm app_focus
dependson:888406

Signed-off-by: jihandong <jihandong@xiaomi.com>
2026-04-20 14:50:17 +08:00
openvela-robot d3797cfabd Add include to the public search path
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2026-04-20 14:50:16 +08:00
openvela-robot 34b0f44034 kvdb: add kvdb xx_oneway API
Signed-off-by: ligd <liguiding1@xiaomi.com>
2026-04-20 14:50:16 +08:00
dongjiuzhu1 3e914e6e2a framework/gdbus: using LIB_DBUS to replace DBUS_HELPER_LIBRARY
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2026-04-20 14:50:16 +08:00
openvela-robot 06fba030be framework/gdbus: initial version for D-Bus heleper library
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2026-04-20 14:50:16 +08:00
openvela-robot 10acc2daba kvdb: fix property_list exit early problem
when the kvdb has too many kv pairs, after kvdb_list_consume()
blocked in sendmsg (write buffer not enough), the domain socket
buffer layout may became:
[k0_len][v0_len][k0][v0]...[kn_len][vn_len][kn][vn][the last char]
so the client property_list will receive only one char (ret = 1)
after received [k0, v0] ~ [kn, vn], but actually the property list
is not terminated, property_list exit early problem happened.

this problem can be easily reproduced in 86panel by running kvdb
testcase twice.

Signed-off-by: wangbowen6 <wangbowen6@xiaomi.com>
2026-04-20 14:50:15 +08:00
openvela-robot db03739812 frameworks/utils: move bin path to apps/staging
Signed-off-by: haopengxiang <haopengxiang@xiaomi.com>
2026-04-20 14:50:15 +08:00
openvela-robot afe9d3f4f6 frameworks/kvdb: move bin path to apps/staging
Signed-off-by: haopengxiang <haopengxiang@xiaomi.com>
2026-04-20 14:50:15 +08:00
openvela-robot 46a3f495f9 frameworks/utils: create bin to current directory
Signed-off-by: haopengxiang <haopengxiang@xiaomi.com>
2026-04-20 14:50:15 +08:00
openvela-robot 91c62221bc frameworks/kvdb: create bin to current directory
Signed-off-by: haopengxiang <haopengxiang@xiaomi.com>
2026-04-20 14:50:15 +08:00
openvela-robot a17f736147 utils: build utils lib into vendor/bes/boards.. from source for m0
Signed-off-by: haopengxiang <haopengxiang@xiaomi.com>
2026-04-20 14:50:15 +08:00
openvela-robot 95016a64be fix: optimize default load multi kvdb source files
Signed-off-by: huxiandong <huxiandong@xiaomi.com>
2026-04-20 14:50:13 +08:00
haopengxiang 72175872a6 app focus: basic module for different focus frameworks
update config description and use list_node as head node

Signed-off-by: haopengxiang <haopengxiang@xiaomi.com>
2026-04-20 14:50:13 +08:00
haopengxiang 06b4f9cf2b Revert "app focus: use list_node as head node"
This reverts commit 6c4b115af4577cbae027b70d09be8af1214e4745.

Reason for revert: Kconfig needs to be updated
2026-04-20 14:50:13 +08:00
openvela-robot b73a2d4415 app focus: use list_node as head node
remove only interface app_focus_request for method simplification.

Signed-off-by: haopengxiang <haopengxiang@xiaomi.com>
2026-04-20 14:50:13 +08:00
liuhaitao 80f1be6f9d kvdb: increases kvdb default stack size from 2K to 4K
Kvdbd server should use 4K stack size to work.

Signed-off-by: liuhaitao <liuhaitao@xiaomi.com>
2026-04-20 14:50:13 +08:00
ligd 98bcbc1d86 kvdb: simplify KVDB marco in Kconfig
Signed-off-by: ligd <liguiding1@xiaomi.com>
2026-04-20 14:50:13 +08:00