#include "RebootModel.h"
#include "drag_event.h"
#include "wearable_log.h"
-
+#include "custom_utils.h"
namespace OHOS {
static RebootPresenter *g_pRebootPresenter = nullptr;
void RebootPresenter::OnStop(void) {}
-extern "C" {
- uint32_t mcu_os_sys_reset(uint8_t *para, uint32_t para_len);
- void uapi_sys_shipmode(uint32_t arg);
-}
+
bool RebootPresenter::OnClick(UIView& view, const ClickEvent& event)
{
UNUSED(event);
} else if (strcmp(view.GetViewId(), REBOOTDEVICE_BUTTON) == 0) {
// 重启
WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "REBOOTDEVICE_BUTTON OnClick");
- mcu_os_sys_reset(NULL,NULL);
+ uapi_reboot_device();
} else if (strcmp(view.GetViewId(), SHUTDOWNDEVICE_BUTTON) == 0) {
// 关机
WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "SHUTDOWNDEVICE_BUTTON OnClick");
// GetPMSDefaultInterface()->ShutDownDevice(NULL, NULL);
- uapi_sys_shipmode(0);
+ uapi_poweroff_device();
}
return true;
static constexpr const char *PNG_APPLIST_SETTING_IMAGE = APP_RES_PATH"/APPLIST_SETTING.bin"; // 设置
static constexpr const char *PNG_APPLIST_TEMP_IMAGE = APP_RES_PATH"/TEMP_IMAGE.bin"; // 体温
- static constexpr const char *PNG_APPLIST_ALIPAY_IMAGE = APP_RES_PATH"/alipay_logo.bin"; // 支付宝
+ static constexpr const char *PNG_APPLIST_ALIPAY_IMAGE = APP_RES_PATH"/alipay/alipay_logo.bin"; // 支付宝
static constexpr const char *PNG_ALIPAY_BIND_FAILURE = APP_RES_PATH"/ALIPAY_BIND_FAILURE.bin";
static constexpr const char *PNG_ALIPAY_BIND_SUCCESS = APP_RES_PATH"/ALIPAY_BIND_SUCCESS.bin";
static constexpr const char *PNG_ALIPAY_LIST_PAY = APP_RES_PATH"/ALIPAY_LIST_PAY.bin";
#include "graphic_hardware_config.h"
#include "graphic_service.h"
#include "common/graphic_startup.h"
-#include "font/font_global_manager.h"
#ifdef SUPPORT_ALIPAY_SEC
#include "AlipayMainView.h"
#include "AlipayPresenter.h"
#endif
-
namespace OHOS {
-static const char* BIN_LANG_EN = RES_PATH"font/en.lang";
-static const char* BIN_LANG_ZH = RES_PATH"font/zh.lang";
struct AppViewMapper
{
AppViewId id;
void NativeLauncher::InitNativeLauncher() {
GraphicStartUp::InitFontEngine(MEM_POOL_UI_FONT, MEM_POOL_UI_FONT_SIZE, OHOS::VECTOR_FONT_DIR, DEFAULT_VECTOR_FONT_FILENAME);
WEARABLE_LOGI(WEARABLE_LOG_MODULE_LAUNCHER_FWK, "NativeLauncher::InitNativeLauncher");
-
- const char* resFiles[] = {BIN_LANG_ZH, BIN_LANG_EN};
- FontGlobalManager::GetInstance()->RegisterLanguageInfo(resFiles, (sizeof(resFiles) / sizeof(char*)), 1);
-
// 初始化所有预加载slice
InitBtHeadsetEvent(); // 蓝牙ct和tg适配初始化
InitAllNativeSlices();
#include "ScreenModels.h"
#include "SettingModel.h"
#include "ui_resource_image.h"
-#include "components/ui_label_ext.h"
-#include "ui_resource_string.h"
namespace OHOS {
void PullUpDownView::InitViewLable(void)
{
- dnotDisturbLable = new UILabelExt();
+ dnotDisturbLable = new UILabel();
if (dnotDisturbLable == nullptr) {
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "dnotDisturbLable new fail");
return;
}
dnotDisturbLable->SetPosition(DISTURB_LABEL_X, DISTURB_LABEL_Y, TEXT_WIDTH, TEXT_HEIGHT);
- dnotDisturbLable->SetTextId(9);
+ dnotDisturbLable->SetText("勿扰");
dnotDisturbLable->SetFont(DEFAULT_VECTOR_FONT_FILENAME, FONT_DEFAULT_SIZE);
dnotDisturbLable->SetStyle(STYLE_BACKGROUND_COLOR, OPA_TRANSPARENT);
- briScreenLable = new UILabelExt();
+ briScreenLable = new UILabel();
if (briScreenLable == nullptr) {
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "briScreenLable new fail");
return;
}
briScreenLable->SetPosition(SCREEN_LABEL_X, SCREEN_LABEL_Y, TEXT_WIDTH, TEXT_HEIGHT);
- briScreenLable->SetTextId(10);
+ briScreenLable->SetText("亮屏");
briScreenLable->SetFont(DEFAULT_VECTOR_FONT_FILENAME, FONT_DEFAULT_SIZE);
briScreenLable->SetStyle(STYLE_BACKGROUND_COLOR, OPA_TRANSPARENT);
- finPhoneLable = new UILabelExt();
+ finPhoneLable = new UILabel();
if (finPhoneLable == nullptr) {
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "finPhoneLable new fail");
return;
}
finPhoneLable->SetPosition(PHONE_LABEL_X, PHONE_LABEL_Y, TEXT_WIDTH, TEXT_HEIGHT);
- finPhoneLable->SetTextId(11);
+ finPhoneLable->SetText("找手机");
finPhoneLable->SetFont(DEFAULT_VECTOR_FONT_FILENAME, FONT_DEFAULT_SIZE);
finPhoneLable->SetStyle(STYLE_BACKGROUND_COLOR, OPA_TRANSPARENT);
- droAlarmLable = new UILabelExt();
+ droAlarmLable = new UILabel();
if (finPhoneLable == nullptr) {
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "finPhoneLable new fail");
return;
}
droAlarmLable->SetPosition(ALARM_LABEL_X, ALARM_LABEL_Y, TEXT_WIDTH, TEXT_HEIGHT);
- droAlarmLable->SetTextId(12);
+ droAlarmLable->SetText("闹钟");
droAlarmLable->SetFont(DEFAULT_VECTOR_FONT_FILENAME, FONT_DEFAULT_SIZE);
droAlarmLable->SetStyle(STYLE_BACKGROUND_COLOR, OPA_TRANSPARENT);
- droSettingLable = new UILabelExt();
+ droSettingLable = new UILabel();
if (droSettingLable == nullptr) {
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "droSettingLable new fail");
return;
}
droSettingLable->SetPosition(SETTING_LABEL_X, SETTING_LABEL_Y, TEXT_WIDTH, TEXT_HEIGHT);
- droSettingLable->SetTextId(13);
+ droSettingLable->SetText("设置");
droSettingLable->SetFont(DEFAULT_VECTOR_FONT_FILENAME, FONT_DEFAULT_SIZE);
droSettingLable->SetStyle(STYLE_BACKGROUND_COLOR, OPA_TRANSPARENT);
}
#include "RebootModel.h"
#include "drag_event.h"
#include "wearable_log.h"
-
+#include "custom_utils.h"
namespace OHOS {
static RebootPresenter *g_pRebootPresenter = nullptr;
// 重启
WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "REBOOTDEVICE_BUTTON OnClick");
//GetPMSDefaultInterface()->RebootDevice(NULL, NULL);
+ uapi_reboot_device();
} else if (strcmp(view.GetViewId(), SHUTDOWNDEVICE_BUTTON) == 0) {
// 关机
WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "SHUTDOWNDEVICE_BUTTON OnClick");
//GetPMSDefaultInterface()->ShutDownDevice(NULL, NULL);
+ uapi_poweroff_device();
}
return true;
}
type = strtoul(ptr, NULL, 0);\r
pos++;\r
timeout = strtoul(pos, NULL, 0);\r
- wstp_print("app set screen off: type = %u, timeut = %u.\r\n", type, timeout);\r
+ wstp_print("app set screen off: type = %u,%s, timeut = %u.\r\n", type,type==0?"autooff_time":"keepon_time",timeout);\r
const power_display_svr_api_t *display_api = power_display_svr_get_api();\r
if (type == 0) {\r
ret = display_api->set_screen_auto_off_timeout(timeout);\r
#endif
return nvRet;
}
+// extern "C" {
+ uint32_t mcu_os_sys_reset(uint8_t *para, uint32_t para_len);
+ void uapi_sys_shipmode(uint32_t arg);
+// }
+
+void uapi_poweroff_device(void)
+{
+ uapi_sys_shipmode(0);
+}
+void uapi_reboot_device(void)
+{
+ mcu_os_sys_reset(NULL,NULL);
+}
+
#if 0
#define PM_SLEEP_SOFT_RESET_FORCE_WKUP_REG 0x57000014
uint32_t zh_get_sn(uint8_t *buf_sn, uint32_t *len_sn);
uint32_t zh_set_sn(uint8_t *buf_sn, uint32_t len_sn);
-
+void uapi_poweroff_device(void);
+void uapi_reboot_device(void);
/**
* @}
-\r
/*\r
* Copyright (c) 2022 CompanyNameMagicTag.\r
* Licensed under the Apache License, Version 2.0 (the "License");\r
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
* See the License for the specific language governing permissions and\r
* limitations under the License.\r
-#include "ui_label_ext.h"\r
*/\r
\r
#ifndef PULL_UP_DOWN_VIEW_H\r
#include "components/ui_image_view.h"\r
#include "components/ui_label.h"\r
#include "components/ui_label_button.h"\r
-#include "components/ui_label_ext.h"\r
\r
namespace OHOS {\r
class PullUpDownView : public AppGroupView {\r
UIImageView *finPhone{nullptr};\r
UIImageView *droAlarm{nullptr};\r
UIImageView *droSetting{nullptr};\r
-\r
- UILabelExt *dnotDisturbLable{nullptr};\r
- UILabelExt *briScreenLable{nullptr};\r
- UILabelExt *finPhoneLable{nullptr};\r
- UILabelExt *droAlarmLable{nullptr};\r
- UILabelExt *droSettingLable{nullptr};\r
- \r
+ UILabel *dnotDisturbLable{nullptr};\r
+ UILabel *briScreenLable{nullptr};\r
+ UILabel *finPhoneLable{nullptr};\r
+ UILabel *droAlarmLable{nullptr};\r
+ UILabel *droSettingLable{nullptr};\r
UIImageView *bluetooth{nullptr};\r
UIImageView *battery{nullptr};\r
UILabel *batteryLable{nullptr};\r
std::string uri("/user/video/demo_pure_video_loop.mp4");
videoPlay_ = new MediaVideoPlay(surface, nullptr, uri, true);
#ifdef SUPPORT_AT_OHOSFWK
- g_videoPlay = videoPlayer_;
+ g_videoPlay = videoPlay_;
registerNotifyScreenStatus(ScreenStatusNotify);
#endif
}
languageinfo="en"
fontName="DroidSansFallback.ttf"
direct="ltf"
->
+ >
<lanstr
id="STR_IMAGE"
value="Image"
- size="21"
+ size = "21"
direct="rtl"
- />
+ />
<lanstr
id="STR_PROGRESSBAR"
value="ProgressBar"
direct="mixed"
- />
+ />
<lanstr
id="STR_SLIDEUNLOCK"
value="SlideUnlock"
- />
+ />
<lanstr
id="STR_LISTBOX"
value="ListBox"
- />
+ />
<lanstr
id="STR_BUTTON"
value="Button"
- />
+ />
<lanstr
id="STR_SCROLLVIEW"
value="ScrollView"
- />
+ />
<lanstr
id="STR_SCROLLGRID"
value="ScrollGrid"
- />
+ />
<lanstr
id="STR_CLOCK"
value="Clock"
- />
+ />
<lanstr
- size="21"
+ size = "21"
direct="ltr"
id="STR_11"
value="Clock1"
- />
- <lanstr
- id="GLIDE_DISTURBANCE"
- value="Disturbance"
- />
- <lanstr
- id="GLIDE_BRIGHT"
- value="Bright"
- />
- <lanstr
- id="GLIDE_PHONE"
- value="Phone"
- />
- <lanstr
- id="GLIDE_ALARM"
- value="Alarm"
- />
- <lanstr
- id="GLIDE_SYSTEMSETTING"
- value="SystemSetting"
- />
- <lanstr
- id="SYSTEM_LANGAGE"
- value="Language"
- />
-</language>
\ No newline at end of file
+ />
+</language>
value="图片"
size="32"
direct="rtl"
- />
+ />
<lanstr
id="STR_PROGRESSBAR"
value="进度条"
direct="mixed"
- />
+ />
<lanstr
id="STR_SLIDEUNLOCK"
value="滑动解锁"
- />
+ />
<lanstr
id="STR_LISTBOX"
value="列表"
- />
+ />
<lanstr
id="STR_BUTTON"
value="按钮"
- />
+ />
<lanstr
id="STR_SCROLLVIEW"
value="滚动视图"
- />
+ />
<lanstr
id="STR_SCROLLGRID"
value="滚动网格"
- />
+ />
<lanstr
id="STR_CLOCK"
value="时钟"
- />
+ />
<lanstr
id="STR_22"
value="时钟"
- />
- <lanstr
- id="GLIDE_DISTURBANCE"
- value="勿扰"
- />
- <lanstr
- id="GLIDE_BRIGHT"
- value="亮屏"
- />
- <lanstr
- id="GLIDE_PHONE"
- value="找手机"
- />
- <lanstr
- id="GLIDE_ALARM"
- value="闹钟"
- />
- <lanstr
- id="GLIDE_SYSTEM"
- value="设置"
- />
- <lanstr
- id="SYSTEM_LANGAGE"
- value="语言"
- />
-</language>
\ No newline at end of file
+ />
+</language>
int result;
uint8_t version[8] = {0};
result = csi_get_fw_version(version);
-
+ printf("csi_get_fw_version version - %s \n",version);
YUNIT_ASSERT_MSG_QA(result == 0 && version[0] != 0, "the test_alipay_get_fw_version is %d", result, "GET_FW_VERSION");
}
void api_record_test_entry(yunit_test_suite_t *suite)
{
- // yunit_add_test_case(suite, "test_get_compile_timestamp", case_test_get_compile_timestamp);
- // yunit_add_test_case(suite, "test_get_productmodel", case_test_get_productmodel);
- // yunit_add_test_case(suite, "test_memory_align", case_test_memory_align);
- // yunit_add_test_case(suite, "test_libc_function", case_test_libc_function);
- // yunit_add_test_case(suite, "test_int_endian", case_test_int_endian);
- // yunit_add_test_case(suite, "hal_get_credential", case_test_get_credential);
- // yunit_add_test_case(suite, "hal_compat_check", case_test_compat_check);
- // yunit_add_test_case(suite, "hal_suid_update", case_test_hal_suid_update);
- // yunit_add_test_case(suite, "hal_suid_remove", case_test_hal_suid_remove);
- // yunit_add_test_case(suite, "hal_mem", case_test_hal_mem);
- // yunit_add_test_case(suite, "hal_sha", case_test_hal_sha);
- // yunit_add_test_case(suite, "hal_aes", case_test_hal_aes);
- // yunit_add_test_case(suite, "hal_asset", case_test_hal_asset);
- // yunit_add_test_case(suite, "hal_random_pressure", case_test_hal_random_pressure);
- // yunit_add_test_case(suite, "hal_mcu_pressure", case_test_hal_mcu_pressure);
- // yunit_add_test_case(suite, "hal_random", case_test_hal_random);
- // yunit_add_test_case(suite, "hal_uuid", case_test_hal_uuid);
+ yunit_add_test_case(suite, "test_get_compile_timestamp", case_test_get_compile_timestamp);
+ yunit_add_test_case(suite, "test_get_productmodel", case_test_get_productmodel);
+ yunit_add_test_case(suite, "test_memory_align", case_test_memory_align);
+ yunit_add_test_case(suite, "test_libc_function", case_test_libc_function);
+ yunit_add_test_case(suite, "test_int_endian", case_test_int_endian);
+ yunit_add_test_case(suite, "hal_get_credential", case_test_get_credential);
+ yunit_add_test_case(suite, "hal_compat_check", case_test_compat_check);
+ yunit_add_test_case(suite, "hal_suid_update", case_test_hal_suid_update);
+ yunit_add_test_case(suite, "hal_suid_remove", case_test_hal_suid_remove);
+ yunit_add_test_case(suite, "hal_mem", case_test_hal_mem);
+ yunit_add_test_case(suite, "hal_sha", case_test_hal_sha);
+ yunit_add_test_case(suite, "hal_aes", case_test_hal_aes);
+ yunit_add_test_case(suite, "hal_asset", case_test_hal_asset);
+ yunit_add_test_case(suite, "hal_random_pressure", case_test_hal_random_pressure);
+ yunit_add_test_case(suite, "hal_mcu_pressure", case_test_hal_mcu_pressure);
+ yunit_add_test_case(suite, "hal_random", case_test_hal_random);
+ yunit_add_test_case(suite, "hal_uuid", case_test_hal_uuid);
yunit_add_test_case(suite, "hal_sn", case_test_hal_sn);
yunit_add_test_case(suite, "hal_deviceid", case_test_hal_deviceid);
- // yunit_add_test_case(suite, "get_fw_version", case_test_get_fw_version);
- // yunit_add_test_case(suite, "hal_companyname", case_test_hal_companyname);
- // yunit_add_test_case(suite, "hal_timestamp", case_test_hal_timestamp);
- // yunit_add_test_case(suite, "hal_prototype", case_test_hal_protoctype);
+ yunit_add_test_case(suite, "get_fw_version", case_test_get_fw_version);
+ yunit_add_test_case(suite, "hal_companyname", case_test_hal_companyname);
+ yunit_add_test_case(suite, "hal_timestamp", case_test_hal_timestamp);
+ yunit_add_test_case(suite, "hal_prototype", case_test_hal_protoctype);
}