Commit Graph

42 Commits

Author SHA1 Message Date
zhangbo56 ebe4be95a5 kvdb: Add more apis for kvdb handle error case
Signed-off-by: zhangbo56 <zhangbo56@xiaomi.com>
Signed-off-by: zhangbo56 <zhangbo56@xiaomi.com>
2026-04-20 14:50:41 +08:00
yukangzhi e269a22a01 frameworks/system/utils: Resolve compilation warnings
clang-format the file include/cutils/trace.h

"/home/mi/workspace_vela/nuttx/../apps/frameworks/
system/utils/include/cutils/trace.h", line 154: warning #1731-D:
          function must be declared at file scope
          void atrace_begin_body(const char*);
               ^
"/home/mi/workspace_vela/nuttx/../apps/frameworks/
system/utils/include/cutils/trace.h", line 167: warning #1731-D:
          function must be declared at file scope
          void atrace_end_body(void);
               ^
"/home/mi/workspace_vela/nuttx/../apps/frameworks/
system/utils/include/cutils/trace.h", line 185: warning #1731-D:
          function must be declared at file scope
          void atrace_async_begin_body(const char*, int32_t);
               ^
"/home/mi/workspace_vela/nuttx/../apps/frameworks/
system/utils/include/cutils/trace.h", line 198: warning #1731-D:
          function must be declared at file scope
          void atrace_async_end_body(const char*, int32_t);
               ^

Signed-off-by: yukangzhi <yukangzhi@xiaomi.com>
2026-04-20 14:50:41 +08:00
wangmingrong1 95568fc7a2 Open source transformation
Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2026-04-20 14:50:39 +08:00
guoshichao 88318136df framework/utils: add the intro doc and api doc
Signed-off-by: guoshichao <guoshichao@xiaomi.com>
2026-04-20 14:50:37 +08:00
cuiziwei 52e14dd060 Revert "trace: Add atrace_is_ready like android"
This reverts commit 95f13f779aab601f9bc6c857d35bea55b38d146e.

Reason for revert: <CC:  spawn/lib_psa_getstackaddr.c trace/trace.c:25:6: error: conflicting type qualifiers for ‘atrace_is_ready’
   25 | bool atrace_is_ready = true;
      |      ^~~~~~~~~~~~~~~>
2026-04-20 14:50:33 +08:00
Xiang Xiao c8ebfe9c27 trace: Add atrace_is_ready like android
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2026-04-20 14:50:32 +08:00
yinshengkai 4f919d272f cutils/trace: update trace.h
Be consistent with external/android/libcutils/libcutils/include/cutils/trace.h

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2026-04-20 14:50:32 +08:00
yinshengkai 4c71a8fb14 cutils/properties: remove __has_include in properties.h
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2026-04-20 14:50:32 +08:00
yinshengkai dfdab75ade cutils/trace: remove stdatomic.h in trace.h
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2026-04-20 14:50:32 +08:00
yinshengkai 1c997b788b cutils/trace: remove CC_UNLIKELY in trace.h
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2026-04-20 14:50:31 +08:00
yinshengkai c8230f5b01 utils/trace: fix compile warnings
warning: function declaration isn't a prototype [-Wstrict-prototypes]
  141 | void atrace_init();

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2026-04-20 14:50:31 +08:00
wangbowen6 10ecac13d6 log/log_write: add android log system wrapper layer
Signed-off-by: wangbowen6 <wangbowen6@xiaomi.com>
2026-04-20 14:50:30 +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
Xiang Xiao d65190c6b2 Move NuttX special funcion to kvdb.h
and sync properties.h with Android 13

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2026-04-20 14:50:29 +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
Xiang Xiao c905cb1b4f utils: Add the basic android header files
include/android/log.h:
include/log/:
include/private/android_logger.h
  system/logging/

include/android/set_abort_message.h:
  bionic/libc/include/android/set_abort_message.h

include/cutils/trace.h:
  system/core/libcutils/include/cutils/trace.h

Signed-off-by: Xiang Xiao <xiaoxiang@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
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
wangbowen6 6f6ec08dc4 kvdb: add kvdb monitor support
Signed-off-by: wangbowen6 <wangbowen6@xiaomi.com>
2026-04-20 14:50:15 +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
Xiang Xiao 2c5088ae8a frameworks/kvdb: add property_set_buffer and property_get_buffer
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2026-04-20 14:50:14 +08:00
ptr_b d1f8aded61 frameworks/kvdb: update desc to doxygen style
Signed-off-by: ptr_b <bijunda1@xiaomi.com>
2026-04-20 14:50:14 +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
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
chentao9 4931343027 feature: kvdb: add initial value reload support
if the initial value file has been modified,use api 'propprop_reload' to refresh initial value of kvdb

Signed-off-by: chentao9 <chentao9@xiaomi.com>
2026-04-20 14:50:13 +08:00
Xiang Xiao e8a0c61ef1 kvdb: extend the length of name and value to 127 and 255
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2026-04-20 14:50:12 +08:00
openvela-robot b7ac203e11 frameworks/kvdb: fix recv() logic in property_list
Fix handling logic when local socket pipe is full, server is
blocked and client does not receive the whole message. The client now
waits for the whole message to be received instead of discarding it and
continue, which will break the communication afterwards.

Signed-off-by: Peter Bee <bijunda1@xiaomi.com>
2026-04-20 14:50:12 +08:00
openvela-robot 559bde43f4 Initial empty repository 2026-04-20 14:50:12 +08:00
Xiang Xiao 08f29383cf frameworks/kvdb: Add Android compatible header file
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2026-04-20 14:50:12 +08:00