Commit Graph

21 Commits

Author SHA1 Message Date
cuiziwei 19cbf65aa7 ALOG: Fixed the issue that disable ALOG will print ANDROID_LOG_VERBOSE level logs by default.
Signed-off-by: cuiziwei <cuiziwei@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
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
xujianhang 951a1ecccc frameworks/utils: adjust the code style of log_radio.h to WebKit
Signed-off-by: xujianhang <xujianhang@xiaomi.com>
2026-04-20 14:50:36 +08:00
xujianhang 021e02c741 frameworks/utils: allow printing non-debug logs
Signed-off-by: xujianhang <xujianhang@xiaomi.com>
2026-04-20 14:50:36 +08:00
xujianhang 5dad5e6bb4 frameworks/utils: add a switch for ril log
Signed-off-by: xujianhang <xujianhang@xiaomi.com>
2026-04-20 14:50:36 +08:00
cuiziwei 98e706006d frameworks/utils:fix build warning.
binder/Binder.cpp: In member function ‘android::status_t android::BBinder::setRpcClientDebug(android::base::unique_fd, const android::sp<android::IBinder>&)’:
binder/Binder.cpp:529:15: warning: unused variable ‘socketFdForPrint’ [-Wunused-variable]
  529 |     const int socketFdForPrint = socketFd.get();
      |               ^~~~~~~~~~~~~~~~
binder/BpBinder.cpp: In member function ‘void android::BpBinder::ObjectManager::kill()’:
binder/BpBinder.cpp:103:18: warning: unused variable ‘N’ [-Wunused-variable]
  103 |     const size_t N = mObjects.size();
      |                  ^
CC:  vfs/fs_timerfd.c binder/IMemory.cpp: In member function ‘void android::HeapCache::dump_heaps()’:
binder/IMemory.cpp:508:29: warning: unused variable ‘h’ [-Wunused-variable]
  508 |         BpMemoryHeap const* h(static_cast<BpMemoryHeap const *>(info.heap.get()));
      |                             ^
binder/RpcServer.cpp: In static member function ‘static void android::RpcServer::establishConnection(android::sp<android::RpcServer>&&, android::base::unique_fd, sockaddr_storage, socklen_t)’:
binder/RpcServer.cpp:286:9: warning: unused variable ‘clientFdForLog’ [-Wunused-variable]
  286 |     int clientFdForLog = clientFd.get();
      |         ^~~~~~~~~~~~~~
CC:  netdb/lib_dnsbind.c binder/RpcState.cpp: In member function ‘void android::RpcState::dumpLocked()’:
binder/RpcState.cpp:269:21: warning: variable ‘desc’ set but not used [-Wunused-but-set-variable]
  269 |         const char* desc;
      |                     ^~~~

Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
2026-04-20 14:50:33 +08:00
cuiziwei 0e521cf8ee frameworks/utils:modify the macro definition of LOG_ALWAYS_FATAL_IF.
when close the LOG_ALWAYS_FATAL_IF, retain the conditional statement judgment in LOG_ALWAYS_FATAL_IF.

Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
2026-04-20 14:50:33 +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
cuiziwei 1c4c6b03a4 framworks/utils:fix clang-format warning.
log_main.h:67:40: warning: code should be clang-formatted [-Wclang-format-violations]
constexpr int __fake_use_va_args(Ts...) {
                                       ^
log_main.h:67:42: warning: code should be clang-formatted [-Wclang-format-violations]
constexpr int __fake_use_va_args(Ts...) {
                                         ^
log_main.h:85:41: warning: code should be clang-formatted [-Wclang-format-violations]
                                        ^
log_main.h:88:48: warning: code should be clang-formatted [-Wclang-format-violations]
                                               ^
log_main.h:102:45: warning: code should be clang-formatted [-Wclang-format-violations]
                                            ^
log_main.h:123:44: warning: code should be clang-formatted [-Wclang-format-violations]
                                           ^
log_main.h:124:34: warning: code should be clang-formatted [-Wclang-format-violations]
  __android_log_assert(cond, tag,                               \
                                 ^
log_main.h:125:64: warning: code should be clang-formatted [-Wclang-format-violations]
                       _android_second(0, ##VA_ARGS_, NULL) \
                                                               ^
log_main.h:135:39: warning: code should be clang-formatted [-Wclang-format-violations]
                                      ^
log_main.h:136:63: warning: code should be clang-formatted [-Wclang-format-violations]
  ((_predict_false(cond)) ? (FAKE_USE_VA_ARGS(VA_ARGS_),                            \
                                                              ^
log_main.h:137:90: warning: code should be clang-formatted [-Wclang-format-violations]
                              ((void)android_printAssert(#cond, LOG_TAG, ##_VA_ARGS_))) \
                                                                                         ^
log_main.h:142:30: warning: code should be clang-formatted [-Wclang-format-violations]
                             ^
log_main.h:201:19: warning: code should be clang-formatted [-Wclang-format-violations]
                  ^
log_main.h:202:7: warning: code should be clang-formatted [-Wclang-format-violations]
  do {                               \
      ^
log_main.h:203:37: warning: code should be clang-formatted [-Wclang-format-violations]
    _FAKE_USE_VA_ARGS(VA_ARGS_); \
                                    ^
log_main.h:204:17: warning: code should be clang-formatted [-Wclang-format-violations]
    if (false)

{                     \                 ^ log_main.h:205:28: warning: code should be clang-formatted [-Wclang-format-violations]       __ALOGV(__VA_ARGS__);          \                            ^ log_main.h:206:6: warning: code should be clang-formatted [-Wclang-format-violations]     }
                               \
     ^
log_main.h:217:28: warning: code should be clang-formatted [-Wclang-format-violations]
                           ^
log_main.h:218:27: warning: code should be clang-formatted [-Wclang-format-violations]
  ((__predict_false(cond))                                                                \
                          ^
log_main.h:219:90: warning: code should be clang-formatted [-Wclang-format-violations]
       ? (_FAKE_USE_VA_ARGS(VA_ARGS), (void)ALOG(LOG_VERBOSE, LOG_TAG, __VA_ARGS_)) \
                                                                                         ^
log_main.h:232:28: warning: code should be clang-formatted [-Wclang-format-violations]
                           ^
log_main.h:233:27: warning: code should be clang-formatted [-Wclang-format-violations]
  ((__predict_false(cond))                                                              \
                          ^
log_main.h:234:88: warning: code should be clang-formatted [-Wclang-format-violations]
       ? (_FAKE_USE_VA_ARGS(VA_ARGS), (void)ALOG(LOG_DEBUG, LOG_TAG, __VA_ARGS_)) \
                                                                                       ^
log_main.h:246:28: warning: code should be clang-formatted [-Wclang-format-violations]
                           ^
log_main.h:247:27: warning: code should be clang-formatted [-Wclang-format-violations]
  ((__predict_false(cond))                                                             \
                          ^
log_main.h:248:87: warning: code should be clang-formatted [-Wclang-format-violations]
       ? (_FAKE_USE_VA_ARGS(VA_ARGS), (void)ALOG(LOG_INFO, LOG_TAG, __VA_ARGS_)) \
                                                                                      ^
log_main.h:260:28: warning: code should be clang-formatted [-Wclang-format-violations]
                           ^
log_main.h:261:27: warning: code should be clang-formatted [-Wclang-format-violations]
  ((__predict_false(cond))                                                             \
                          ^
log_main.h:262:87: warning: code should be clang-formatted [-Wclang-format-violations]
       ? (_FAKE_USE_VA_ARGS(VA_ARGS), (void)ALOG(LOG_WARN, LOG_TAG, __VA_ARGS_)) \
                                                                                      ^
log_main.h:274:28: warning: code should be clang-formatted [-Wclang-format-violations]
                           ^
log_main.h:275:27: warning: code should be clang-formatted [-Wclang-format-violations]
  ((__predict_false(cond))                                                              \
                          ^
log_main.h:276:88: warning: code should be clang-formatted [-Wclang-format-violations]
       ? (_FAKE_USE_VA_ARGS(VA_ARGS), (void)ALOG(LOG_ERROR, LOG_TAG, __VA_ARGS_)) \
                                                                                       ^
log_main.h:368:35: warning: code should be clang-formatted [-Wclang-format-violations]
                                  ^
log_main.h:371:35: warning: code should be clang-formatted [-Wclang-format-violations]
                                  ^

Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
2026-04-20 14:50:33 +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
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
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