|
@@ -1,6 +1,7 @@
|
|
|
#pragma once
|
|
|
#include "uart/ProtocolSender.h"
|
|
|
|
|
|
+#include <sys/sysinfo.h>
|
|
|
#include "manager/ConfigManager.h"
|
|
|
#include "net/NetManager.h"
|
|
|
#include "core/update_assistant.h"
|
|
@@ -114,7 +115,25 @@ void NavibarDialog1ClickOk() {
|
|
|
//EASYUICONTEXT->hideNaviBar();
|
|
|
}
|
|
|
|
|
|
+struct sysinfo info2;
|
|
|
+
|
|
|
void updateDevice(){
|
|
|
+
|
|
|
+ sysinfo(&info2);
|
|
|
+ LOGD("关闭页面前,totalram == %ld", info2.totalram);
|
|
|
+ LOGD("关闭页面前,freeram == %ld", info2.freeram);
|
|
|
+
|
|
|
+ EASYUICONTEXT->closeActivity("mianActivity");
|
|
|
+ EASYUICONTEXT->closeActivity("callActivity");
|
|
|
+ EASYUICONTEXT->closeActivity("settingActivity");
|
|
|
+ EASYUICONTEXT->closeActivity("sipTestActivity");
|
|
|
+ EASYUICONTEXT->closeActivity("ui3Activity");
|
|
|
+ EASYUICONTEXT->closeActivity("warnActivity");
|
|
|
+
|
|
|
+ sysinfo(&info2);
|
|
|
+ LOGD("关闭页面后,存在延迟,totalram == %ld", info2.totalram);
|
|
|
+ LOGD("关闭页面后,存在延迟,freeram == %ld", info2.freeram);
|
|
|
+
|
|
|
PopupService::Show([](PopupService* srv){
|
|
|
|
|
|
base::HttpClient client;
|
|
@@ -124,6 +143,10 @@ void updateDevice(){
|
|
|
std::string url = getHttpGateway() + "/" + info.url.c_str();
|
|
|
LOGD("请求更新文件的url: %s", url.c_str());
|
|
|
|
|
|
+ sysinfo(&info2);
|
|
|
+ LOGD("进行下载前,totalram == %ld", info2.totalram);
|
|
|
+ LOGD("进行下载前,freeram == %ld", info2.freeram);
|
|
|
+
|
|
|
base::HttpRequest req("GET", url, ""); // 去获取文件
|
|
|
const char* tmp_file = "/tmp/update.img";
|
|
|
base::HttpResponse response =
|
|
@@ -184,6 +207,10 @@ static void onUI_init(){
|
|
|
* 当切换到该界面时触发
|
|
|
*/
|
|
|
static void onUI_intent(const Intent *intentPtr) {
|
|
|
+ sysinfo(&info2);
|
|
|
+ LOGD("跳转到升级页面,totalram == %ld", info2.totalram);
|
|
|
+ LOGD("跳转到升级页面,freeram == %ld", info2.freeram);
|
|
|
+
|
|
|
if (intentPtr != NULL) {
|
|
|
std::string _appUpdate = intentPtr->getExtra(appUpdate);
|
|
|
if (_appUpdate == "true") {
|
|
@@ -194,6 +221,9 @@ static void onUI_intent(const Intent *intentPtr) {
|
|
|
if (currentVersionNo < info.versionNo) {
|
|
|
updateDevice();
|
|
|
}
|
|
|
+ else {
|
|
|
+ EASYUICONTEXT->closeActivity("updateActivity");
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|