Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Startup Init Lite
提交
30ee3f14
S
Startup Init Lite
项目概览
OpenHarmony
/
Startup Init Lite
大约 1 年 前同步成功
通知
3
Star
37
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
Startup Init Lite
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
30ee3f14
编写于
12月 29, 2021
作者:
T
toutes
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix animation and battery event
Signed-off-by:
N
toutes
<
zhaoruiyuan2@huawei.com
>
上级
c4bb8408
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
24 addition
and
1 deletion
+24
-1
services/include/init_utils.h
services/include/init_utils.h
+3
-0
services/init/include/init_jobs_internal.h
services/init/include/init_jobs_internal.h
+1
-0
services/init/init_config.c
services/init/init_config.c
+4
-1
services/param/service/param_service.c
services/param/service/param_service.c
+1
-0
services/utils/init_utils.c
services/utils/init_utils.c
+15
-0
未找到文件。
services/include/init_utils.h
浏览文件 @
30ee3f14
...
...
@@ -30,6 +30,8 @@ extern "C" {
#define DECIMAL_BASE 10
#define WAIT_MAX_COUNT 10
#define MAX_BUFFER_LEN 256
#define CMDLINE_VALUE_LEN_MAX 512
#define PARAM_CMD_LINE "/proc/cmdline"
#define ARRAY_LENGTH(array) (sizeof((array)) / sizeof((array)[0]))
uid_t
DecodeUid
(
const
char
*
name
);
char
*
ReadFileToBuf
(
const
char
*
configFile
);
...
...
@@ -48,6 +50,7 @@ int ReadFileInDir(const char *dirPath, const char *includeExt,
char
**
SplitStringExt
(
char
*
buffer
,
const
char
*
del
,
int
*
returnCount
,
int
maxItemCount
);
void
FreeStringVector
(
char
**
vector
,
int
count
);
int
InUpdaterMode
(
void
);
int
InChargerMode
(
void
);
int
StringReplaceChr
(
char
*
strl
,
char
oldChr
,
char
newChr
);
#ifdef __cplusplus
...
...
services/init/include/init_jobs_internal.h
浏览文件 @
30ee3f14
...
...
@@ -42,6 +42,7 @@ void DumpAllJobs(void);
#define INIT_CONFIGURATION_FILE "/etc/init.without_two_stages.cfg"
#endif
#define OTHER_CFG_PATH "/system/etc/init"
#define OTHER_CHARGE_PATH "/system/etc/charge"
#define MAX_PATH_ARGS_CNT 20
void
ReadConfig
(
void
);
...
...
services/init/init_config.c
浏览文件 @
30ee3f14
...
...
@@ -85,7 +85,10 @@ static void ParseAllImports(const cJSON *root)
void
ReadConfig
(
void
)
{
// parse cfg
if
(
InUpdaterMode
()
==
0
)
{
if
(
InChargerMode
()
==
1
)
{
ParseInitCfg
(
INIT_CONFIGURATION_FILE
,
NULL
);
ReadFileInDir
(
OTHER_CHARGE_PATH
,
".cfg"
,
ParseInitCfg
,
NULL
);
}
else
if
(
InUpdaterMode
()
==
0
)
{
ParseInitCfg
(
INIT_CONFIGURATION_FILE
,
NULL
);
ReadFileInDir
(
OTHER_CFG_PATH
,
".cfg"
,
ParseInitCfg
,
NULL
);
}
else
{
...
...
services/param/service/param_service.c
浏览文件 @
30ee3f14
...
...
@@ -533,6 +533,7 @@ static int LoadParamFromCmdLine(void)
{
static
const
char
*
cmdLines
[]
=
{
OHOS_BOOT
"hardware"
,
OHOS_BOOT
"reboot_reason"
,
#ifdef STARTUP_INIT_TEST
OHOS_BOOT
"mem"
,
OHOS_BOOT
"console"
,
...
...
services/utils/init_utils.c
浏览文件 @
30ee3f14
...
...
@@ -410,6 +410,21 @@ int InUpdaterMode(void)
}
}
int
InChargerMode
(
void
)
{
char
*
data
=
ReadFileData
(
PARAM_CMD_LINE
);
char
value
[
CMDLINE_VALUE_LEN_MAX
];
int
ret
=
0
;
if
((
GetProcCmdlineValue
(
"reboot_reason"
,
data
,
value
,
CMDLINE_VALUE_LEN_MAX
)
==
0
)
&&
(
strcmp
(
value
,
"poweroff_charge"
)
==
0
))
{
ret
=
1
;
}
INIT_LOGE
(
"GetProcCmdlineValue():reboot_reason=%s
\n
"
,
value
);
free
(
data
);
return
ret
;
}
int
StringReplaceChr
(
char
*
strl
,
char
oldChr
,
char
newChr
)
{
INIT_ERROR_CHECK
(
strl
!=
NULL
,
return
-
1
,
"Invalid parament"
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录