Skip to content

Commit

Permalink
Merge pull request alibaba#1 from alibaba/feature_updateDoc
Browse files Browse the repository at this point in the history
1、update atlas-doc
2、fix bundle update bug:update failed and can't use bundle when meta was failed rename to bundle dir
  • Loading branch information
zjutyujf authored Mar 10, 2017
2 parents e554575 + ff9d40b commit 5a4c787
Show file tree
Hide file tree
Showing 26 changed files with 856 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ public final class BundleImpl implements Bundle {
context.bundle = this;
this.context = context;
this.bundleDir = bundleDir;

Framework.notifyBundleListeners(BundleEvent.BEFORE_INSTALL, this);
if (stream != null) {
this.archive = new BundleArchive(location,bundleDir, stream,version, dexPatchVersion);
} else if (file != null) {
Expand Down Expand Up @@ -363,6 +363,7 @@ public final class BundleImpl implements Bundle {
this.location = in.readUTF();
this.revisionNUM = in.readLong();
in.close();
Framework.notifyBundleListeners(BundleEvent.BEFORE_INSTALL, this);

bcontext.bundle = this;
this.context = bcontext;
Expand Down Expand Up @@ -562,7 +563,7 @@ public synchronized void startBundle() {
}
state = STARTING;
context.isValid = true;

Framework.notifyBundleListeners(BundleEvent.BEFORE_STARTED, this);
Framework.notifyBundleListeners(BundleEvent.STARTED, this);
if (Framework.DEBUG_BUNDLES) {
Log.i("Framework","Bundle " + toString() + " started.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -783,8 +783,9 @@ public boolean accept(File dir, String filename) {
targetDir.mkdirs();
result = newRevDir.renameTo(targetDir);
new File(walBundleDir,"meta").renameTo(meta);
if(!result || !targetDir.exists()){
if(!result || !targetDir.exists() || !meta.exists()){
BaselineInfoManager.instance().rollbackHardly();
android.os.Process.killProcess(android.os.Process.myPid());
}
}else{
//remove old bundles
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,19 +210,8 @@

import android.content.Context;

/**
* Created by guanjie on 2016/12/1.
*
* preLaunch Class 内import的所有class以及他们关联的所有class将无法参与动态部署和热修复,
* 请小心使用
*/

public interface AtlasPreLauncher {

/**
* 请注意不要引用到自己需要初始化的SDK之外的class,一旦依赖进来,会导致被依赖的class
* 无法参与动态部署和热修复
* @param context
*/
void initBeforeAtlas(final Context context);
}
3 changes: 3 additions & 0 deletions atlas-core/src/main/java/org/osgi/framework/BundleEvent.java
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ public class BundleEvent extends EventObject
*/
public final static int UNINSTALLED = 0x00000010;

public final static int BEFORE_INSTALL = 10086;
public final static int BEFORE_STARTED = 10087;

/**
* Creates a bundle event of the specified type.
*
Expand Down
23 changes: 14 additions & 9 deletions atlas-docs/SUMMARY.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
# [简介](README.md)
# Summary

* [Introduction](README.md)
* 原理解析
- [框架原理](principle-intro/Runtime_principle.md)
- [名词解释](principle-intro/Project_architectured.md)
- [APK结构](principle-intro/Apk_architecture.md)
- [运行期文件结构](principle-intro/File_architecture_runtime.md)
* [框架原理](principle-intro/Runtime_principle.md)
* [名词解释](principle-intro/Project_architectured.md)
* [APK结构](principle-intro/Apk_architecture.md)
* [运行期文件结构](principle-intro/File_architecture_runtime.md)
* [接入指引](guide-for-use/README.md)
- [容器接入](guide-for-use/guide_for_build.md)
- [bundle拆分|新建](guide-for-use/guide_for_bundle.md)
* [容器接入](guide-for-use/guide_for_build.md)
* [bundle拆分|新建](guide-for-use/guide_for_bundle.md)
* [动态部署](update/README.md)
- [技术原理](update/principle.md)
- [一些限制](update/guide.md)
* [技术原理](update/principle.md)
* [一些限制](update/guide.md)
* FAQ
* [故障排查](faq/help.md)

Loading

0 comments on commit 5a4c787

Please sign in to comment.