#include <string>
#include <cstring>
#include <cstdint>
-
+#include "displaybrightness/include/DisplayBrightnessModel.h"
namespace OHOS
{
/**************************************************************************************************** */
debugOutputItemInfo[index++] = {index, "heart_rate_data"};
// 弹窗日志
debugOutputItemInfo[index++] = {index, "popup_windows_log"};
+ //当前系统亮屏时长
+ debugOutputItemInfo[index++] = {index, "current_screen_time"};
usedLen = index;
/* -------------------------------- Add data -------------------------------- */
for (uint8_t i = 0; i < usedLen; i++)
return str.str(); // 返回拼接后的字符串
}
+ std::string DebugOutputViewEventListener::get_system_screen_time(void)
+ {
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "DebugOutputViewEventListener::get_system_screen_time");
+
+ std::ostringstream str;
+ str << "当前系统亮屏时长:";
+ std::string timestr = std::to_string(DisplayBrightnessModel::GetInstance()->GetScreenDurationTime() / 1000)+ "秒";
+ str<<"["<<timestr<<"]\n";
+ str<<"系统是否处于长亮屏状态:";
+ str<<"["<<std::to_string(uapi_dev_runtime_get_screen_always_on_status())<<"]\n";
+ return str.str();
+ }
bool DebugOutputViewEventListener::OnClick(OHOS::UIView &view, const OHOS::ClickEvent &event)
{
std::string viewId = view.GetViewId();
case 11:
str = get_popup_windows_log();
break;
+ case 12:
+ str = get_system_screen_time();
+ break;
default:
str = "--";
break;
DebugScrollView[0]->SetTouchable(true);
DebugScrollView[0]->SetThrowDrag(true);
DebugScrollView[0]->SetScrollBlankSize(70);
- DebugScrollView[0]->SetReboundSize(30);
+ // DebugScrollView[0]->SetReboundSize(30);
DebugGroupView->Add(DebugScrollView[0]);
/* -------------------------------------------------------------------------- */
if (debugOutputAdapter == nullptr)
return nullptr;
}
}
- debugOutputList->SetPosition(0, 120, HORIZONTAL_RESOLUTION, VERTICAL_RESOLUTION);
+ debugOutputList->SetPosition(0, 120, HORIZONTAL_RESOLUTION, VERTICAL_RESOLUTION - 120);
debugOutputList->SetStyle(STYLE_BACKGROUND_COLOR, 0xff000000);
+ debugOutputList->SetThrowDrag(true);
debugOutputList->EnableAutoAlign(true); // 设置此列表的自动对齐状态。当滚动停止时,子视图被选中,其位置自动与预设位置对齐
- debugOutputList->SetThrowDrag(true); // 设置手指抬起屏幕后是否继续滚动。
- debugOutputList->SetMaxScrollDistance(1000); // 设置手指抬起屏幕后的最大滚动距离。
- debugOutputList->SetSwipeACCLevel(200); /*设置手指抬起屏幕后的补偿距离。*/
+ // debugOutputList->SetThrowDrag(true); // 设置手指抬起屏幕后是否继续滚动。
+ // debugOutputList->SetMaxScrollDistance(1000); // 设置手指抬起屏幕后的最大滚动距离。
+ // debugOutputList->SetSwipeACCLevel(200); /*设置手指抬起屏幕后的补偿距离。*/
debugOutputList->SetAdapter(debugOutputAdapter);
debugOutputList->RefreshList();
// debugOutputList->SetReboundSize(30);
debugOutputbleServiceLabelButton->SetFont(DEFAULT_VECTOR_FONT_FILENAME_EN, 30);
debugOutputbleServiceLabelButton->SetStyleForState(STYLE_BACKGROUND_COLOR, 0xff000000, UIButton::PRESSED);
debugOutputbleServiceLabelButton->SetOnClickListener(clickListener);
- DebugScrollView[0]->Add(debugOutputbleServiceLabelButton);
+ debugOutputbleServiceLabelButton->SetVisible(false);
+ // DebugScrollView[0]->Add(debugOutputbleServiceLabelButton);
/* -------------------------------------------------------------------------- */
NotificationManager::GetInstance()->RegisterNotifyCleanupFunction(FreeDebugOutputMainView);
/* -------------------------------------------------------------------------- */