|
|
|
@ -50,6 +50,7 @@ public class AppMaster {
|
|
|
|
|
private MpMasterService mService;
|
|
|
|
|
private String mMasterUrl;
|
|
|
|
|
private String mCmdid;
|
|
|
|
|
private boolean mBundleWithMpApp;
|
|
|
|
|
private PowerManager.WakeLock mWakelock;
|
|
|
|
|
|
|
|
|
|
public static final String CMD_REBOOT_APP = "cmd_reboot_app";
|
|
|
|
@ -70,13 +71,18 @@ public class AppMaster {
|
|
|
|
|
|
|
|
|
|
public static final String CMD_IMPORT_PUB_KEY = "imp_pub_key";
|
|
|
|
|
|
|
|
|
|
public AppMaster(MpMasterService service, String masterUrl, String cmdid) {
|
|
|
|
|
public AppMaster(MpMasterService service, String masterUrl, String cmdid, boolean bundleWithMpApp) {
|
|
|
|
|
|
|
|
|
|
mService = service;
|
|
|
|
|
mMasterUrl = masterUrl;
|
|
|
|
|
mCmdid = cmdid;
|
|
|
|
|
mBundleWithMpApp = bundleWithMpApp;
|
|
|
|
|
mWakelock = null;
|
|
|
|
|
|
|
|
|
|
if (!mBundleWithMpApp) {
|
|
|
|
|
int aa = 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
PowerManager powerManager = (PowerManager) service.getSystemService(Context.POWER_SERVICE);
|
|
|
|
|
mWakelock = powerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK | PowerManager.ON_AFTER_RELEASE, "com.xypower.mpmaster:MpMaster");
|
|
|
|
@ -204,6 +210,9 @@ public class AppMaster {
|
|
|
|
|
List<Pair<String, String>> postParams = new ArrayList<>();
|
|
|
|
|
postParams.add(new Pair<String, String>("id", mCmdid));
|
|
|
|
|
postParams.add(new Pair<String, String>("XyDev", "1"));
|
|
|
|
|
if (mBundleWithMpApp) {
|
|
|
|
|
postParams.add(new Pair<String, String>("bundled", "1"));
|
|
|
|
|
}
|
|
|
|
|
postParams.add(new Pair<String, String>("bootTime", Long.toString(getBootTime())));
|
|
|
|
|
postParams.add(new Pair<String, String>("i1Version", mService.getMpAppVersion()));
|
|
|
|
|
postParams.add(new Pair<String, String>("oid", mService.getSerialNo()));
|
|
|
|
|