mirror of
https://github.com/openharmony/ai_intelligent_voice_framework.git
synced 2026-07-01 20:24:01 -04:00
@@ -42,9 +42,9 @@ bool LoadStringFromFile(const string& filePath, string& content)
|
||||
}
|
||||
|
||||
file.seekg(0, ios::end);
|
||||
const long fileLength = file.tellg();
|
||||
int fileLength = file.tellg();
|
||||
if (fileLength > MAX_FILE_LENGTH) {
|
||||
UTILS_LOGD("invalid file length(%{public}ld)!", fileLength);
|
||||
UTILS_LOGD("invalid file length(%{public}d)", fileLength);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -96,7 +96,7 @@ bool LoadStringFromFd(int fd, string& content)
|
||||
|
||||
const long fileLength = lseek(fd, 0, SEEK_END);
|
||||
if (fileLength > MAX_FILE_LENGTH) {
|
||||
UTILS_LOGE("invalid file length(%{public}ld)!", fileLength);
|
||||
UTILS_LOGE("invalid file length");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -118,8 +118,7 @@ bool LoadStringFromFd(int fd, string& content)
|
||||
|
||||
const long len = read(fd, content.data(), fileLength);
|
||||
if (len != fileLength) {
|
||||
UTILS_LOGE("the length read from file is not equal to fileLength!len:%{public}ld,fileLen:%{public}ld",
|
||||
len, fileLength);
|
||||
UTILS_LOGE("the length read from file is not equal to fileLength");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -173,8 +172,7 @@ bool SaveStringToFd(int fd, const std::string& content)
|
||||
}
|
||||
|
||||
if (static_cast<unsigned long>(len) != content.length()) {
|
||||
UTILS_LOGE("the length write to file is not equal to fileLength!len:%{public}ld, fileLen:%{public}zu",
|
||||
len, content.length());
|
||||
UTILS_LOGE("the length write to file is not equal to fileLength");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -227,7 +225,7 @@ bool LoadBufferFromFile(const string& filePath, vector<char>& content)
|
||||
file.seekg(0, std::ios::end);
|
||||
const long fileLength = file.tellg();
|
||||
if (fileLength > MAX_FILE_LENGTH) {
|
||||
UTILS_LOGD("invalid file length(%{public}ld)!", fileLength);
|
||||
UTILS_LOGD("invalid file length");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From 4fa0f24361771089247fdfb63b78c64329b607f7 Mon Sep 17 00:00:00 2001
|
||||
From 4a9d29570c3263ff7f30b5d4178b0507f6b868b9 Mon Sep 17 00:00:00 2001
|
||||
From: lvqiang214 <lvqiang1@huawei.com>
|
||||
Date: Tue, 4 Jul 2023 22:21:44 +0800
|
||||
Subject: [PATCH] add intelligent voice service id
|
||||
@@ -9,17 +9,17 @@ Signed-off-by: lvqiang214 <lvqiang1@huawei.com>
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/interfaces/innerkits/samgr_proxy/include/system_ability_definition.h b/interfaces/innerkits/samgr_proxy/include/system_ability_definition.h
|
||||
index 9f20be1..5e95bad 100644
|
||||
index 9f20be1..681f4a8 100644
|
||||
--- a/interfaces/innerkits/samgr_proxy/include/system_ability_definition.h
|
||||
+++ b/interfaces/innerkits/samgr_proxy/include/system_ability_definition.h
|
||||
@@ -158,6 +158,7 @@ enum {
|
||||
IVIHARDWARE_ADAS_SA_ID = 2602,
|
||||
IVIHARDWARE_TBOX_SA_ID = 2603,
|
||||
IVIHARDWARE_CLUSTER_SA_ID = 2604,
|
||||
+ INTELL_VOICE_SERVICE_ID = 2688,
|
||||
SUBSYS_KERNEL_SYS_ABILITY_ID_BEGIN = 2700,
|
||||
SUBSYS_LOCATION_SYS_ABILITY_ID_BEGIN = 2800,
|
||||
LOCATION_GEO_CONVERT_SA_ID = 2801,
|
||||
@@ -41,6 +41,7 @@ enum {
|
||||
SUBSYS_AI_SYS_ABILITY_ID_BEGIN = 300,
|
||||
SUBSYS_AI_DS_SYS_ABILITY_ID = 310,
|
||||
AIDISPATCHER_ENGINE_SERVICE = 311,
|
||||
+ INTELL_VOICE_SERVICE_ID = 312,
|
||||
SUBSYS_APPEXECFWK_SYS_ABILITY_ID_BEGIN = 400,
|
||||
BUNDLE_MGR_SERVICE_SYS_ABILITY_ID = 401,
|
||||
DISTRIBUTED_BUNDLE_MGR_SERVICE_SYS_ABILITY_ID = 402,
|
||||
--
|
||||
2.34.1
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
<info>
|
||||
<process>intell_voice_service</process>
|
||||
<systemability>
|
||||
<name>2688</name>
|
||||
<name>312</name>
|
||||
<libpath>/system/lib64/libintell_voice_server.z.so</libpath>
|
||||
<run-on-create>true</run-on-create>
|
||||
<distributed>false</distributed>
|
||||
+1
-1
@@ -14,6 +14,6 @@
|
||||
import("//build/ohos/sa_profile/sa_profile.gni")
|
||||
|
||||
ohos_sa_profile("intell_voice_service_sa_profile") {
|
||||
sources = [ "2688.xml" ]
|
||||
sources = [ "312.xml" ]
|
||||
part_name = "intelligent_voice_framework"
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ void TriggerModel::Print()
|
||||
INTELL_VOICE_LOG_INFO("trigger model uuid:%{public}d", uuid_);
|
||||
INTELL_VOICE_LOG_INFO("trigger model vendor uuid:%{public}d", vendorUuid_);
|
||||
INTELL_VOICE_LOG_INFO("trigger model version:%{public}d", version_);
|
||||
INTELL_VOICE_LOG_INFO("trigger model data size:%{public}lu", data_.size());
|
||||
INTELL_VOICE_LOG_INFO("trigger model data size:%{public}zu", data_.size());
|
||||
}
|
||||
} // namespace IntellVoiceTrigger
|
||||
} // namespace OHOS
|
||||
Reference in New Issue
Block a user