diff --git a/bundle.json b/bundle.json index 61eae12808d9dd1cde00c7251fcd67871e51bdda..161cc70dc772eaca5b2d911d0616dedda916f38d 100755 --- a/bundle.json +++ b/bundle.json @@ -22,6 +22,9 @@ "adapted_system_type": [ "standard" ], "rom": "1024KB", "ram": "2048KB", + "hisysevent_config": [ + "//base/powermgr/display_manager/displaymanager.yaml" + ], "deps": { "components": [ "appexecfwk_standard", diff --git a/displaymanager.yaml b/displaymanager.yaml new file mode 100644 index 0000000000000000000000000000000000000000..0ac8fecaf2133a2290732b5cbb319fb6e0e429df --- /dev/null +++ b/displaymanager.yaml @@ -0,0 +1,33 @@ +# Copyright (c) 2022 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +domain: DISPLAY + +SCREEN_STATE: + __BASE: {type: STATISTIC, level: MINOR, tag: PowerStats, desc: screen state} + STATE: {type: INT32, desc: screen_state} + +BRIGHTNESS_NIT: + __BASE: {type: STATISTIC, level: MINOR, tag: PowerStats, desc: lcd brightness } + BRIGHTNESS: {type: INT32, desc: brightness} + REASON: {type: STRING, desc: brightness reason} + NIT: {type: INT32, desc: brightness nit} + +BACKLIGHT_DISCOUNT: + __BASE: {type: STATISTIC, level: MINOR, tag: PowerStats, desc: backlight discount} + RATIO: {type: INT32, desc: ratio} + +AMBIENT_LIGHT: + __BASE: {type: STATISTIC, level: MINOR, tag: PowerStats, desc: ambient light} + TYPE: {type: INT32, desc: type} + LEVEL: {type: INT32, desc: level} diff --git a/service/native/src/display_power_mgr_service.cpp b/service/native/src/display_power_mgr_service.cpp index 8d95734a223c4c65f226caf7a2fa11f16c86990a..cbc8b80ab8e60f55f589ded8e07d6210ff33d055 100644 --- a/service/native/src/display_power_mgr_service.cpp +++ b/service/native/src/display_power_mgr_service.cpp @@ -405,7 +405,7 @@ void DisplayPowerMgrService::AmbientLightCallback(SensorEvent *event) pms->AdjustBrightness(mainDispId, brightness, AUTO_ADJUST_BRIGHTNESS_DURATION); } // Notify ambient brightness change event to battery statistics - HiviewDFX::HiSysEvent::Write(HiviewDFX::HiSysEvent::Domain::POWERMGR, "AMBIENT_LIGHT", + HiviewDFX::HiSysEvent::Write("DISPLAY", "AMBIENT_LIGHT", HiviewDFX::HiSysEvent::EventType::STATISTIC, "LEVEL", brightness); } diff --git a/service/native/src/screen_action.cpp b/service/native/src/screen_action.cpp index 7e47c10ad300c2736ab0be1bd2f49640c1a2958b..c827edab290ad76db0b8fa7537ec48f04a0096fb 100644 --- a/service/native/src/screen_action.cpp +++ b/service/native/src/screen_action.cpp @@ -114,7 +114,7 @@ bool ScreenAction::SetDisplayState(DisplayState state, const std::function(state)); DISPLAY_HILOGI(COMP_SVC, "SetDisplayState:%{public}d", ret); return ret; @@ -160,7 +160,7 @@ bool ScreenAction::SetBrightness(uint32_t value) { DISPLAY_HILOGI(FEAT_BRIGHTNESS, "displayId=%{public}u, brightness=%{public}u", displayId_, value); // Notify screen brightness change event to battery statistics - HiviewDFX::HiSysEvent::Write(HiviewDFX::HiSysEvent::Domain::POWERMGR, "BRIGHTNESS_NIT", + HiviewDFX::HiSysEvent::Write("DISPLAY", "BRIGHTNESS_NIT", HiviewDFX::HiSysEvent::EventType::STATISTIC, "BRIGHTNESS", value); bool isSucc = Rosen::DisplayManager::GetInstance().SetScreenBrightness(displayId_, value); brightness_ = isSucc ? value : brightness_;