#include "battery_service.h"
#include "NativeAbility.h"
#include "custom_utils.h"
+#include "cmsis_os2.h"
+#include "linux/delay.h"
namespace OHOS
{
UIImageView *imageCharge = nullptr;
UIViewGroup *group=nullptr;
UIImageAnimatorView *ShutDownImageAnimatorView=nullptr;
static constexpr char *ShutDownPaths = "/user/res/RebootAndShutDown/ShutDown/"; //关机图片路径
- static constexpr int16_t SHUTDOWN_IMAGE_ANIMATOR_VIEW_NUM_FRAMES = 30; // 图片帧数
- static constexpr int16_t SHUTDOWN_IMAGE_ANIMATOR_TIME = 150; // 图片更新间隔
- ImageAnimatorInfo ShutDownImageInfo[SHUTDOWN_IMAGE_ANIMATOR_VIEW_NUM_FRAMES]; // 关机图像的信息
+ #define SHUTDOWN_IMAGE_ANIMATOR_VIEW_NUM_FRAMES 30 // 图片帧数
+ static int16_t SHUTDOWN_IMAGE_ANIMATOR_TIME = 130; // 图片更新间隔
+
static constexpr int16_t SHUTDOWN_IMAGE_ANIMATOR_VIEW_X = 0;
static constexpr int16_t SHUTDOWN_IMAGE_ANIMATOR_VIEW_Y = 0;
static constexpr int16_t SHUTDOWN_IMAGE_ANIMATOR_VIEW_W = 466;
static constexpr int16_t SHUTDOWN_IMAGE_ANIMATOR_VIEW_H = 466;
const char **ShutDownPathsArray{nullptr}; // 关机图片路径数组
-
+ ImageAnimatorInfo ShutDownImageInfo[SHUTDOWN_IMAGE_ANIMATOR_VIEW_NUM_FRAMES]; // 关机图像的信息
#define LOW_POWER_BUTTON "LOW_POWER_BUTTON"
// UIViewGroup *ChargingStatuShow()
// {
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "BluetoothEarPhoneView new ShutDownImageAnimatorView fail");
return ;
}
+
for (uint8_t i = 0; i < SHUTDOWN_IMAGE_ANIMATOR_VIEW_NUM_FRAMES; i++)
{
ShutDownImageInfo[i].imagePath = (ShutDownPathsArray[i]);
ShutDownImageAnimatorView->SetPosition(SHUTDOWN_IMAGE_ANIMATOR_VIEW_X, SHUTDOWN_IMAGE_ANIMATOR_VIEW_Y, SHUTDOWN_IMAGE_ANIMATOR_VIEW_W, SHUTDOWN_IMAGE_ANIMATOR_VIEW_H);
ShutDownImageAnimatorView->SetStyle(STYLE_BACKGROUND_COLOR, 0xffffffff);
ShutDownImageAnimatorView->SetStyle(STYLE_BACKGROUND_OPA, 0xff);
- ShutDownImageAnimatorView->SetImageAnimatorSrc(ShutDownImageInfo, SHUTDOWN_IMAGE_ANIMATOR_VIEW_NUM_FRAMES, 100);
+ ShutDownImageAnimatorView->SetImageAnimatorSrc(ShutDownImageInfo, SHUTDOWN_IMAGE_ANIMATOR_VIEW_NUM_FRAMES, SHUTDOWN_IMAGE_ANIMATOR_TIME);
ShutDownImageAnimatorView->SetRepeat(false);
ShutDownImageAnimatorView->SetRepeatTimes(1);
if(group)
{
group->RemoveAll();
+ ShutDownImageAnimatorView->Stop();
if(ShutDownImageAnimatorView)
{
delete ShutDownImageAnimatorView;
void lowppowrAnimatorStopListener::OnAnimatorStop(UIView &view)
{
//UNUSED(view);
- WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "xxxxxxxxxxxxxxxxxxxxOnAnimatorStop");
-
NotificationManager::GetInstance()->StopNotify();
+ msleep(500);
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "xxxxxxxxxxxxxxxxxxxxOnAnimatorStop");
if(battery_falg==4)
uapi_reboot_device();