diff --git a/frameworks/native/source/system_ability_manager_proxy.cpp b/frameworks/native/source/system_ability_manager_proxy.cpp index 7be2e6c821ba2d498fd47452385fa35a42f6decf..abd76e4a0f7d9221fb3bb3ff7216d3d9ffa9e57e 100644 --- a/frameworks/native/source/system_ability_manager_proxy.cpp +++ b/frameworks/native/source/system_ability_manager_proxy.cpp @@ -890,7 +890,8 @@ int32_t SystemAbilityManagerProxy::GetLruIdleSystemAbilityProc(std::vectorSendRequest( - static_cast(SamgrInterfaceCode::GET_LRU_IDLE_SYSTEM_ABILITY_PROCESS_TRANSACTION), data, reply, option); + static_cast(SamgrInterfaceCode::GET_LRU_IDLE_SYSTEM_ABILITY_PROCESS_TRANSACTION), + data, reply, option); if (err != ERR_NONE) { HILOGE("GetLruIdleSystempAbilityProc SendRequest error:%{public}d", err); return err; diff --git a/services/samgr/native/source/schedule/system_ability_state_scheduler.cpp b/services/samgr/native/source/schedule/system_ability_state_scheduler.cpp index 62071a78fe7e756f9ca6b2c7396143644107aa9a..d7bdd978029286096099abc9fd207c96157b315a 100644 --- a/services/samgr/native/source/schedule/system_ability_state_scheduler.cpp +++ b/services/samgr/native/source/schedule/system_ability_state_scheduler.cpp @@ -1432,8 +1432,8 @@ int64_t SystemAbilityStateScheduler::GetSystemAbilityIdleTime(int32_t systemAbil return abilityContext->lastIdleTime; } -bool SystemAbilityStateScheduler::GetLruIdleSystemAbilityInfo(int32_t systemAbilityId, std::u16string& processName, int64_t& lastStopTime, - int32_t& pid) +bool SystemAbilityStateScheduler::GetLruIdleSystemAbilityInfo(int32_t systemAbilityId, + std::u16string& processName, int64_t& lastStopTime, int32_t& pid) { std::shared_ptr abilityContext; if (!GetSystemAbilityContext(systemAbilityId, abilityContext)) { diff --git a/services/samgr/native/source/system_ability_manager.cpp b/services/samgr/native/source/system_ability_manager.cpp index d49bf9fba8007bbc96576949e9547c7143721a75..4dc5a7c9073b4db005ad6e6a11a37c39637c54d9 100644 --- a/services/samgr/native/source/system_ability_manager.cpp +++ b/services/samgr/native/source/system_ability_manager.cpp @@ -84,7 +84,7 @@ constexpr int64_t CHECK_LOADED_DELAY_TIME = 4 * 1000; // ms #endif constexpr int32_t SOFTBUS_SERVER_SA_ID = 4700; constexpr int32_t FIRST_DUMP_INDEX = 0; -constexpr int64_t TWO_MINUTES_SECONDS = 120 *1000; // ms +constexpr int64_t TWO_MINUTES_SECONDS = 120 * 1000; // ms } std::mutex SystemAbilityManager::instanceLock; @@ -1783,7 +1783,7 @@ int32_t SystemAbilityManager::GetLruIdleSystemAbilityProc(std::vector mockDirFiles; void InitSaMgr(sptr& saMgr) @@ -64,7 +63,7 @@ void GetDirFiles(const char* path, std::vector& files) CfgFiles* GetCfgFiles(const char* path) { - return mockCfgFiles; + return g_mockCfgFiles; } void SamgrUtilTest::SetUpTestCase() @@ -82,7 +81,7 @@ void SamgrUtilTest::SetUp() SamMockPermission::MockPermission(); system::mockValue = ""; mockDirFiles.clear(); - mockCfgFiles = nullptr; + g_mockCfgFiles = nullptr; DTEST_LOG << "SetUp" << std::endl; } @@ -434,12 +433,12 @@ HWTEST_F(SamgrUtilTest, TestGetFilesByPriority001, TestSize.Level3) HWTEST_F(SamgrUtilTest, TestGetFilesByPriority002, TestSize.Level3) { system::mockValue = ""; - mockCfgFiles = new CfgFiles(); + g_mockCfgFiles = new CfgFiles(); std::vector result; SamgrUtil::GetFilesByPriority("test_path", result); ASSERT_TRUE(result.empty()); - delete mockCfgFiles; + delete g_mockCfgFiles; } } \ No newline at end of file diff --git a/services/samgr/native/test/unittest/src/system_ability_state_scheduler_test.cpp b/services/samgr/native/test/unittest/src/system_ability_state_scheduler_test.cpp index e28f5ae43891541d960eff792946ecc840bc73a2..3796038f7e46202ddb8a6f1912fc0cd9aeb8cc4e 100644 --- a/services/samgr/native/test/unittest/src/system_ability_state_scheduler_test.cpp +++ b/services/samgr/native/test/unittest/src/system_ability_state_scheduler_test.cpp @@ -1941,7 +1941,6 @@ HWTEST_F(SystemAbilityStateSchedulerTest, GetLruIdleSystemAbilityInfo001, TestSi bool ret = systemAbilityStateScheduler->GetLruIdleSystemAbilityInfo(invalidSaid, processName, lastStopTime, pid); EXPECT_EQ(ret, false); DTEST_LOG<<"GetLruIdleSystemAbilityInfo001 END"<