From: hcj <1224667075@qq.com> Date: Tue, 2 Apr 2024 07:01:58 +0000 (+0800) Subject: 修复产测死机 X-Git-Tag: release_V1.2.70_20241020_135402~1237^2^2 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=c3d66f305521b4333ab80e0d7e56cde5231bba07;p=mirrors%2FFD230.git 修复产测死机 --- diff --git a/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testPresenter.h b/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testPresenter.h index d714525af..f9d538c99 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testPresenter.h +++ b/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testPresenter.h @@ -56,7 +56,7 @@ namespace OHOS virtual ~testPresenter(); void OnStart() override; - + void OnPause() override; void OnResume() override; void OnStop() override; diff --git a/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testPresenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testPresenter.cpp index 75b74da11..b71341d60 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testPresenter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testPresenter.cpp @@ -90,6 +90,12 @@ namespace OHOS Presenter::OnStart(); } + void testPresenter::OnPause(void) + { + + Presenter::OnPause(); + } + bool testPresenter::OnPress(UIView &view, const PressEvent &event) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemPresenter::"); @@ -277,7 +283,6 @@ namespace OHOS else testbuttonView::GetInstance()-> Changbutton(1,false); - // uint16_t preSlice = NativeAbility::GetInstance().GetPreSliceId(); // NativeAbility::GetInstance().ChangeSlice(VIEW_APPLIST); } diff --git a/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testTP.cpp b/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testTP.cpp index 82706d75c..2623c695f 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testTP.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testTP.cpp @@ -42,7 +42,6 @@ namespace OHOS button[i]=NULL; } } - if(labelButton_next) { delete labelButton_next; diff --git a/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testView.cpp b/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testView.cpp index cfdd0a47a..3927316ef 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testView.cpp @@ -82,35 +82,88 @@ namespace OHOS button[i]=NULL; } } - delete test_about_view; - test_about_view = nullptr; - delete test_LCD_view; + if(test_about_view) + { + delete test_about_view; //1 + test_about_view = nullptr; + } + + if(test_LCD_view) + { + delete test_LCD_view; //2 test_LCD_view = nullptr; - delete test_TP_view; + } + if(test_TP_view) + { + delete test_TP_view; //3 test_TP_view = nullptr; - delete test_lum_view; + } + if(test_lum_view) + { + delete test_lum_view;//4 test_lum_view = nullptr; - delete test_charging_view; + } + if(test_charging_view) + { + delete test_charging_view;//5 test_charging_view = nullptr; - delete test_speak_view; + } + if(test_speak_view) + { + delete test_speak_view;//6 test_speak_view = nullptr; - delete test_motor_view; + } + if(test_motor_view) + { + delete test_motor_view;//7 test_motor_view = nullptr; - delete test_cat1_view; + } + if(test_cat1_view) + { + delete test_cat1_view;//8 test_cat1_view = nullptr; - delete test_KEY_view; + } + if(test_KEY_view) + { + delete test_KEY_view;//9 test_KEY_view = nullptr; - delete test_MG_view; + } + if(test_MG_view) + { + delete test_MG_view;//10 test_MG_view = nullptr; - delete test_hr_view; + } + if(test_hr_view) + { + delete test_hr_view;//11 test_hr_view = nullptr; - delete test_MP_view; + } + if(test_MP_view) + { + delete test_MP_view;//12 test_MP_view = nullptr; + } + if(test_G_view) + { + delete test_G_view;//13 + test_G_view= nullptr; + } + // delete test_G_view;//13 + // test_G_view= nullptr; + delete SystemLabel; SystemLabel = nullptr; - - delete SystemScrollView[TESTVIEW]; - SystemScrollView[TESTVIEW] = nullptr; + if(SystemScrollView[TESTVIEW]) + { + delete SystemScrollView[TESTVIEW]; + SystemScrollView[TESTVIEW] = nullptr; + } + for(int i=1;i<13;i++) + { + if(SystemScrollView[i]) + SystemScrollView[i] = nullptr; + } + } } @@ -637,11 +690,11 @@ namespace OHOS //InitIView(); initView_ext(43,120,380,100,120,"/user/res/SETTING_NEXT.bin"); const power_display_svr_api_t *display_api = power_display_svr_get_api(); - if (display_api->get_screen_state() != SCREEN_ON) - { - display_api->turn_on_screen(); - } - display_api->set_screen_set_keepon_timeout(-1); + // if (display_api->get_screen_state() != SCREEN_ON) + // { + // display_api->turn_on_screen(); + // } + // display_api->set_screen_set_keepon_timeout(-1); } void testView::OnSetUpView() diff --git a/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testabout.cpp b/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testabout.cpp index 1214d7bde..9f1f029b9 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testabout.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testabout.cpp @@ -17,7 +17,7 @@ namespace OHOS { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemAboutTheWatchView::~SystemAboutTheWatchView"); ClearAll(); - g_pSystemAboutTheWatchView = nullptr; + //g_pSystemAboutTheWatchView = nullptr; } testAboutView *testAboutView::GetInstance() @@ -102,10 +102,11 @@ namespace OHOS // label->SetPosition(x, y); // widget's left position and top position // label->Resize(135, 88); // widget's width and height label->SetPosition(x, y); // widget's left position and top position - label->Resize(460, 62); + label->Resize(200, 62); // Set additional property label->SetText(view_text); label->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30); + label->SetLineBreakMode(UILabel::LINE_BREAK_ADAPT); label->SetVisible(true); return label; diff --git a/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testbutton.cpp b/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testbutton.cpp index 7c3bb28cf..6494868dd 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testbutton.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testbutton.cpp @@ -57,7 +57,8 @@ namespace OHOS delete Title; Title=nullptr; } - + RootView::GetInstance()->ClearOnKeyActListener(); + delete testBUTTONScrollView; testBUTTONScrollView=nullptr; } diff --git a/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testold.cpp b/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testold.cpp index 14e0b710f..22edd87ab 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testold.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testold.cpp @@ -32,7 +32,7 @@ namespace OHOS uint16_t angle_value= (int16_t)mag_service_get_fAzimuth(); char buf[16]={0}; sprintf(buf,"angle:%d",angle_value); - if( testoldView::GetInstance()->x) + if( testoldView::GetInstance()->x && AGING_task_falg) { testoldView::GetInstance()->x->SetText(buf); RootView::GetInstance()->Invalidate(); @@ -52,7 +52,7 @@ namespace OHOS uint16 y_t=t.y; uint16 z_t=t.z; sprintf(buf,"gsensor:\nX:%d\nY:%d\nZ:%d",x_t,y_t,z_t); - if(testoldView::GetInstance()->x) + if(testoldView::GetInstance()->x && AGING_task_falg) { testoldView::GetInstance()->x->SetText(buf); RootView::GetInstance()->Invalidate(); diff --git a/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testspeak.cpp b/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testspeak.cpp index 508a2319e..5608cdccc 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testspeak.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testspeak.cpp @@ -113,6 +113,7 @@ namespace OHOS { //开始 AlarmClockModel::GetInstance()->AlarmPlayerStart(); + speakfalg=true; // if(speak_TEST_timer!=NULL) // osTimerDelete(speak_TEST_timer);