Skip to content

Commit

Permalink
[atlas-update] 每次收到awo的请求都重新启动
Browse files Browse the repository at this point in the history
  • Loading branch information
chenzhong.cz committed Jun 21, 2017
1 parent f6bfbd6 commit 54d9c89
Showing 1 changed file with 7 additions and 25 deletions.
Original file line number Diff line number Diff line change
@@ -1,40 +1,22 @@
package com.taobao.atlas.update;

import java.io.File;
import java.io.FileInputStream;
import java.io.FilenameFilter;
import java.io.IOException;
import java.util.List;

import android.app.ActivityManager;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.os.AsyncTask;
import android.os.Handler;
import android.os.Looper;
import android.taobao.atlas.framework.Framework;
import android.taobao.atlas.runtime.RuntimeVariables;
import android.taobao.atlas.util.ApkUtils;
import android.taobao.atlas.versionInfo.BaselineInfoManager;
import android.text.TextUtils;
import android.util.Log;
import android.widget.Toast;
import com.taobao.atlas.update.exception.MergeException;
import com.taobao.atlas.update.model.UpdateInfo;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import org.osgi.framework.BundleException;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.FilenameFilter;
import java.io.IOException;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.List;
import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;

/**
* Created by guanjie on 2017/1/23.
Expand Down Expand Up @@ -66,6 +48,7 @@ public void onReceive(Context context, Intent intent) {
if (intent.getAction().equals(PATCH_ACTION)) {
Toast.makeText(context.getApplicationContext(), "DebugPatch安装中,请稍后...", Toast.LENGTH_LONG).show();
doPatch();
restart();
}else if (intent.getAction().equals(ROLLBACK_ACTION)) {
Toast.makeText(context.getApplicationContext(), "动态部署回滚,请稍后...", Toast.LENGTH_LONG).show();
}
Expand Down Expand Up @@ -105,7 +88,6 @@ public boolean accept(File dir, String filename) {
}
}
}
restart();
}catch(Throwable e){
e.printStackTrace();
}
Expand Down

0 comments on commit 54d9c89

Please sign in to comment.