File tree Expand file tree Collapse file tree 1 file changed +12
-5
lines changed
updatepluginlib/src/main/java/org/lzh/framework/updatepluginlib/strategy Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -72,11 +72,18 @@ protected void exitIfForceUpdate(Update update) {
72
72
if (!update .isForced ()) {
73
73
return ;
74
74
}
75
- // 释放Activity资源。避免进程被杀后导致自动重启
76
- ActivityManager .get ().finishAll ();
77
- // 两种kill进程方式一起使用。双管齐下!
78
- Process .killProcess (Process .myPid ());
79
- System .exit (0 );
75
+ // 延迟强制更新时的退出操作。因为部分机型上安装程序读取安装包的时机有延迟。
76
+ Utils .getMainHandler ().postDelayed (new Runnable () {
77
+ @ Override
78
+ public void run () {
79
+ // 释放Activity资源。避免进程被杀后导致自动重启
80
+ ActivityManager .get ().finishAll ();
81
+ // 两种kill进程方式一起使用。双管齐下!
82
+ Process .killProcess (Process .myPid ());
83
+ System .exit (0 );
84
+ }
85
+ }, 1500 );
86
+
80
87
}
81
88
82
89
private String getAuthor (Context context ) {
You can’t perform that action at this time.
0 commit comments