From d2e7567a911eec1ed26d6a341637129aa35a2e4c Mon Sep 17 00:00:00 2001 From: houdisheng Date: Tue, 22 Feb 2022 20:39:15 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9said?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: houdisheng --- BUILD.gn | 2 +- interfaces/innerkits/src/bundle_active_client.cpp | 4 ++-- sa_profile/{1906.xml => 1907.xml} | 2 +- services/src/bundle_active_service.cpp | 6 +++--- 4 files changed, 7 insertions(+), 7 deletions(-) rename sa_profile/{1906.xml => 1907.xml} (97%) diff --git a/BUILD.gn b/BUILD.gn index ff06df6..7ff3305 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -15,7 +15,7 @@ import("//build/ohos/sa_profile/sa_profile.gni") import("device_usage_statistics.gni") ohos_sa_profile("bundleactive_sa_profile") { - sources = [ "sa_profile/1906.xml" ] + sources = [ "sa_profile/1907.xml" ] part_name = "device_usage_statistics" } diff --git a/interfaces/innerkits/src/bundle_active_client.cpp b/interfaces/innerkits/src/bundle_active_client.cpp index eb90b0f..b7d0fab 100644 --- a/interfaces/innerkits/src/bundle_active_client.cpp +++ b/interfaces/innerkits/src/bundle_active_client.cpp @@ -31,9 +31,9 @@ bool BundleActiveClient::GetBundleActiveProxy() return false; } - sptr object = samgr->GetSystemAbility(BUNDLE_ACTIVE_SYS_ABILITY_ID); + sptr object = samgr->GetSystemAbility(DEVICE_UASAGE_STATISTICS_SYS_ABILITY_ID); if (object == nullptr) { - BUNDLE_ACTIVE_LOGE("Failed to get SystemAbility[1906] ."); + BUNDLE_ACTIVE_LOGE("Failed to get SystemAbility[1907] ."); return false; } diff --git a/sa_profile/1906.xml b/sa_profile/1907.xml similarity index 97% rename from sa_profile/1906.xml rename to sa_profile/1907.xml index 60c148a..39fd343 100644 --- a/sa_profile/1906.xml +++ b/sa_profile/1907.xml @@ -16,7 +16,7 @@ bundleactive_service - 1906 + 1907 libbundleactiveservice.z.so true false diff --git a/services/src/bundle_active_service.cpp b/services/src/bundle_active_service.cpp index 5673d57..fa62e36 100644 --- a/services/src/bundle_active_service.cpp +++ b/services/src/bundle_active_service.cpp @@ -17,16 +17,16 @@ namespace OHOS { namespace BundleActive { -REGISTER_SYSTEM_ABILITY_BY_ID(BundleActiveService, BUNDLE_ACTIVE_SYS_ABILITY_ID, true); +REGISTER_SYSTEM_ABILITY_BY_ID(BundleActiveService, DEVICE_UASAGE_STATISTICS_SYS_ABILITY_ID, true); void BundleActiveService::OnStart() { int ret = Publish(this); if (!ret) { - BUNDLE_ACTIVE_LOGE("[Server] OnStart, Register SystemAbility[1906] FAIL."); + BUNDLE_ACTIVE_LOGE("[Server] OnStart, Register SystemAbility[1907] FAIL."); return; } - BUNDLE_ACTIVE_LOGI("[Server] OnStart, Register SystemAbility[1906] SUCCESS."); + BUNDLE_ACTIVE_LOGI("[Server] OnStart, Register SystemAbility[1907] SUCCESS."); } void BundleActiveService::OnStop() -- Gitee From a78dcb70d1cd76911bd069988f7ec20877d8ad38 Mon Sep 17 00:00:00 2001 From: houdisheng Date: Tue, 22 Feb 2022 20:50:44 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=8B=BC=E5=86=99?= =?UTF-8?q?=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: houdisheng --- interfaces/innerkits/src/bundle_active_client.cpp | 2 +- services/src/bundle_active_service.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/interfaces/innerkits/src/bundle_active_client.cpp b/interfaces/innerkits/src/bundle_active_client.cpp index b7d0fab..fb255ff 100644 --- a/interfaces/innerkits/src/bundle_active_client.cpp +++ b/interfaces/innerkits/src/bundle_active_client.cpp @@ -31,7 +31,7 @@ bool BundleActiveClient::GetBundleActiveProxy() return false; } - sptr object = samgr->GetSystemAbility(DEVICE_UASAGE_STATISTICS_SYS_ABILITY_ID); + sptr object = samgr->GetSystemAbility(DEVICE_USAGE_STATISTICS_SYS_ABILITY_ID); if (object == nullptr) { BUNDLE_ACTIVE_LOGE("Failed to get SystemAbility[1907] ."); return false; diff --git a/services/src/bundle_active_service.cpp b/services/src/bundle_active_service.cpp index fa62e36..6b5fd08 100644 --- a/services/src/bundle_active_service.cpp +++ b/services/src/bundle_active_service.cpp @@ -17,7 +17,7 @@ namespace OHOS { namespace BundleActive { -REGISTER_SYSTEM_ABILITY_BY_ID(BundleActiveService, DEVICE_UASAGE_STATISTICS_SYS_ABILITY_ID, true); +REGISTER_SYSTEM_ABILITY_BY_ID(BundleActiveService, DEVICE_USAGE_STATISTICS_SYS_ABILITY_ID, true); void BundleActiveService::OnStart() { -- Gitee