修复bug

serial
BlueMatthew 1 year ago
parent 91f987fd99
commit a842da9b33

@ -90,7 +90,7 @@ public class AppMaster {
} }
private long getBootTime() { private long getBootTime() {
return (System.currentTimeMillis() - SystemClock.elapsedRealtimeNanos() / 1000000) / 1000000; return (System.currentTimeMillis() - SystemClock.elapsedRealtimeNanos() / 1000000) / 1000;
} }
public void start() { public void start() {
@ -195,7 +195,7 @@ public class AppMaster {
} }
private void sendResult(long cid, int result, String action) { private void sendResult(long cid, int result, String action, String content) {
String url = mMasterUrl; String url = mMasterUrl;
try { try {
if (!url.endsWith("/")) { if (!url.endsWith("/")) {
@ -204,7 +204,8 @@ public class AppMaster {
url += "status/?"; url += "status/?";
url += MicroPhotoContext.MASTER_URL_CMDID + "=" + URLEncoder.encode(mCmdid, "UTF-8") + url += MicroPhotoContext.MASTER_URL_CMDID + "=" + URLEncoder.encode(mCmdid, "UTF-8") +
"&cid=" + Long.toString(cid) + "&cid=" + Long.toString(cid) +
"&res=" + Integer.toString(result) + "&act=" + URLEncoder.encode(action, "UTF-8"); "&res=" + Integer.toString(result) + "&act=" + URLEncoder.encode(action, "UTF-8") +
"&content=" + URLEncoder.encode(content, "UTF-8");
HttpRequest.get(url); HttpRequest.get(url);
} catch (Exception ex) { } catch (Exception ex) {
ex.printStackTrace(); ex.printStackTrace();
@ -394,7 +395,7 @@ public class AppMaster {
} }
String apkPath = file.getAbsolutePath(); String apkPath = file.getAbsolutePath();
if (dl.download(url, apkPath)) { if (dl.download(url, apkPath)) {
sendResult(cid, 1, action); sendResult(cid, 1, action, action + ":" + mCmdid);
Context context = mService.getApplicationContext(); Context context = mService.getApplicationContext();
SysApi.installApk(context, apkPath, context.getPackageName(), true); SysApi.installApk(context, apkPath, context.getPackageName(), true);
} }

Loading…
Cancel
Save