diff --git a/bundle.json b/bundle.json index e3faa5d471b8b12e172e6b1699d87c7539c3ab9f..a8802331ab88adc98fc78ea8b18bb5ff4ccd3d62 100755 --- a/bundle.json +++ b/bundle.json @@ -34,7 +34,7 @@ "samgr", "eventhandler", "hicollie", - "window_manager" + "init" ], "third_party": [] }, diff --git a/services/BUILD.gn b/services/BUILD.gn index 44f81a118ab3e182b658fbc946b0511decb6cff6..a2b7bc27682e9806844aabd52f76ccfe709c12b0 100644 --- a/services/BUILD.gn +++ b/services/BUILD.gn @@ -73,10 +73,10 @@ ohos_shared_library("libsensor_service") { "access_token:libtokenid_sdk", "c_utils:utils", "hilog:libhilog", + "init:libbegetutil", "ipc:ipc_single", "safwk:system_ability_fwk", "samgr:samgr_proxy", - "window_manager:libdm", ] if (sensor_memmgr_enable) { @@ -191,10 +191,10 @@ ohos_static_library("libsensor_service_static") { "access_token:libtokenid_sdk", "c_utils:utils", "hilog:libhilog", + "init:libbegetutil", "ipc:ipc_single", "safwk:system_ability_fwk", "samgr:samgr_proxy", - "window_manager:libdm", ] if (sensor_memmgr_enable) { diff --git a/services/src/sensor_service.cpp b/services/src/sensor_service.cpp index 6364091a9ab503f0ab00126b6d116bcbd8085661..997e8158fb80986e891a4bf7162890f33019244d 100644 --- a/services/src/sensor_service.cpp +++ b/services/src/sensor_service.cpp @@ -19,7 +19,6 @@ #include #include -#include "display_manager.h" #ifdef HIVIEWDFX_HISYSEVENT_ENABLE #include "hisysevent.h" #endif // HIVIEWDFX_HISYSEVENT_ENABLE @@ -29,6 +28,7 @@ #include "motion_plugin.h" #include "ipc_skeleton.h" #include "permission_util.h" +#include "parameters.h" #include "print_sensor_data.h" #include "sensor_dump.h" @@ -63,6 +63,11 @@ void SensorService::OnDump() SEN_HILOGI("OnDump"); } +std::string GetDmsDeviceStatus() +{ + return OHOS::system::GetParameter("persist.dms.set.device.status", "0"); +} + void SensorService::OnAddSystemAbility(int32_t systemAbilityId, const std::string &deviceId) { SEN_HILOGI("OnAddSystemAbility systemAbilityId:%{public}d", systemAbilityId); @@ -85,7 +90,7 @@ void SensorService::OnAddSystemAbility(int32_t systemAbilityId, const std::strin } #endif // MSDP_MOTION_ENABLE if (systemAbilityId == DISPLAY_MANAGER_SERVICE_SA_ID) { - uint32_t status = Rosen::DisplayManager::GetInstance().GetDeviceStatus(); + uint32_t status = static_cast(std::stoi(GetDmsDeviceStatus())); clientInfo_.SetDeviceStatus(status); SEN_HILOGI("GetDeviceStatus, deviceStatus:%{public}d", status); }