add system parmas for renderservice with bootevent.

Signed-off-by: SuellaSun <sunyang34@huawei.com>
This commit is contained in:
SuellaSun 2024-06-17 22:20:46 +08:00
parent 80e1a3f44b
commit 570a67c9d2
3 changed files with 13 additions and 0 deletions

View File

@ -19,3 +19,4 @@ persist.rosen.sethgmrefreshratemode.enabled = graphics:graphics:0775
persist.graphic.bootsound.enabled = graphics:servicectrl:0775
rosen.dirtyregiondebug.enabled = graphics:servicectrl:0775
rosen.drawingCache.enabledDfx = graphics:servicectrl:0775
bootevent.renderservice.ready = graphics:graphics:0777

View File

@ -29,6 +29,9 @@
"uid" : "graphics",
"gid" : ["system", "tp_host"],
"caps" : ["SYS_NICE"],
"bootevents": [
"bootevent.renderservice.ready"
],
"permission" : [
"ohos.permission.REPORT_RESOURCE_SCHEDULE_EVENT"
],

View File

@ -17,7 +17,9 @@
#include <iservice_registry.h>
#include <malloc.h>
#include <parameters.h>
#include <platform/common/rs_log.h>
#include "platform/common/rs_system_properties.h"
#include <string>
#include <system_ability_definition.h>
#include <unistd.h>
@ -44,6 +46,7 @@ namespace OHOS {
namespace Rosen {
namespace {
constexpr uint32_t UNI_RENDER_VSYNC_OFFSET = 5000000;
const std::string BOOTEVENT_RENDER_SERVICE_READY = "bootevent.renderservice.ready";
}
RSRenderService::RSRenderService() {}
@ -121,6 +124,12 @@ bool RSRenderService::Init()
samgr->AddSystemAbility(RENDER_SERVICE, this);
RS_PROFILER_INIT(this);
if (!system::GetBoolParameter(BOOTEVENT_RENDER_SERVICE_READY.c_str(), false)) {
system::SetParameter(BOOTEVENT_RENDER_SERVICE_READY.c_str(), "true");
RS_LOGI("set boot render service started true");
}
return true;
}