|
|
@ -406,6 +406,7 @@ public class AppMaster {
|
|
|
|
String cmd = jsonObject.optString("cmd", "");
|
|
|
|
String cmd = jsonObject.optString("cmd", "");
|
|
|
|
|
|
|
|
|
|
|
|
if (TextUtils.equals(cmd, CMD_REBOOT_DEV)) {
|
|
|
|
if (TextUtils.equals(cmd, CMD_REBOOT_DEV)) {
|
|
|
|
|
|
|
|
mService.logger.warning("Recv Reset Cmd");
|
|
|
|
SysApi.reboot(mService.getApplicationContext());
|
|
|
|
SysApi.reboot(mService.getApplicationContext());
|
|
|
|
} else if (TextUtils.equals(cmd, CMD_UPLOAD_LOGS)) {
|
|
|
|
} else if (TextUtils.equals(cmd, CMD_UPLOAD_LOGS)) {
|
|
|
|
String url = jsonObject.optString("url", null);
|
|
|
|
String url = jsonObject.optString("url", null);
|
|
|
@ -414,10 +415,12 @@ public class AppMaster {
|
|
|
|
} else if (TextUtils.equals(cmd, CMD_SET_CMA)) {
|
|
|
|
} else if (TextUtils.equals(cmd, CMD_SET_CMA)) {
|
|
|
|
String ip = jsonObject.optString("value_str", null);
|
|
|
|
String ip = jsonObject.optString("value_str", null);
|
|
|
|
int port = jsonObject.optInt("value_int", 0);
|
|
|
|
int port = jsonObject.optInt("value_int", 0);
|
|
|
|
|
|
|
|
mService.logger.warning("Recv Set CMA Cmd: " + (TextUtils.isEmpty(ip) ? "" : ip) + " port=" + Integer.toString(port));
|
|
|
|
updateCma(ip, port);
|
|
|
|
updateCma(ip, port);
|
|
|
|
} else if (TextUtils.equals(cmd, CMD_SET_MNTN)) {
|
|
|
|
} else if (TextUtils.equals(cmd, CMD_SET_MNTN)) {
|
|
|
|
String ip = jsonObject.optString("value_str", null);
|
|
|
|
String ip = jsonObject.optString("value_str", null);
|
|
|
|
int port = jsonObject.optInt("value_int", 0);
|
|
|
|
int port = jsonObject.optInt("value_int", 0);
|
|
|
|
|
|
|
|
mService.logger.warning("Recv Set Mntn Cmd: " + (TextUtils.isEmpty(ip) ? "" : ip) + " port=" + Integer.toString(port));
|
|
|
|
String newUrl = buildMntnServer(ip, port);
|
|
|
|
String newUrl = buildMntnServer(ip, port);
|
|
|
|
if (newUrl != null) {
|
|
|
|
if (newUrl != null) {
|
|
|
|
mService.updateMntn(newUrl);
|
|
|
|
mService.updateMntn(newUrl);
|
|
|
@ -659,6 +662,8 @@ public class AppMaster {
|
|
|
|
|
|
|
|
|
|
|
|
private void upgradeApp(long cid, String action, String url) {
|
|
|
|
private void upgradeApp(long cid, String action, String url) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
mService.logger.warning("Recv Upgrade Cmd: url=" + url);
|
|
|
|
|
|
|
|
|
|
|
|
FileDownloader dl = new FileDownloader();
|
|
|
|
FileDownloader dl = new FileDownloader();
|
|
|
|
File path = new File(MicroPhotoContext.buildAppDir(mService.getApplicationContext()), "packages");
|
|
|
|
File path = new File(MicroPhotoContext.buildAppDir(mService.getApplicationContext()), "packages");
|
|
|
|
if (!path.exists()) {
|
|
|
|
if (!path.exists()) {
|
|
|
|