修复点击取消安装后依然收到安装通知的Bug,删除安装完成自动删除安装包 默认安装后不删除安装包
This commit is contained in:
@ -7,8 +7,11 @@ import android.content.pm.PackageInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.os.Handler;
|
||||
import android.os.Message;
|
||||
import android.text.TextUtils;
|
||||
|
||||
import com.gh.download.DownloadManager;
|
||||
import com.gh.gamecenter.eventbus.EBPackage;
|
||||
import com.lightgame.download.DownloadEntity;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
|
||||
@ -59,7 +62,11 @@ public class InstallUtils {
|
||||
keys.add(packageName);
|
||||
} else if (list.contains(packageName)) {
|
||||
keys.add(packageName);
|
||||
EventBus.getDefault().post(new EBPackage("安装", packageName));
|
||||
|
||||
DownloadEntity downloadEntity = DownloadManager.getInstance(context).getDownloadEntityByPackageName(packageName);
|
||||
String installVersion = PackageUtils.getVersionByPackage(context, packageName);
|
||||
if (!TextUtils.isEmpty(installVersion) && installVersion.equals(downloadEntity.getVersionName()))
|
||||
EventBus.getDefault().post(new EBPackage("安装", packageName));
|
||||
}
|
||||
}
|
||||
for (String key : keys) {
|
||||
|
||||
Reference in New Issue
Block a user