处理 SonarQube 问题:

双重检查锁方式实现的单例,改为使用静态内部类方式
This commit is contained in:
lyr
2021-12-21 16:51:44 +08:00
parent 27f14ac914
commit 9feb4e774a
330 changed files with 828 additions and 885 deletions

View File

@ -465,7 +465,7 @@ public class BindingAdapters {
case INSTALL_PLUGIN:
case INSTALL_NORMAL:
if (gameEntity.getApk().size() == 1) {
DownloadEntity downloadEntity = DownloadManager.getInstance(progressBar.getContext()).getDownloadEntitySnapshotByUrl(gameEntity.getApk().get(0).getUrl());
DownloadEntity downloadEntity = DownloadManager.getInstance().getDownloadEntitySnapshotByUrl(gameEntity.getApk().get(0).getUrl());
if (downloadEntity != null) {
PackageInstaller.install(v.getContext(), downloadEntity);
}
@ -574,7 +574,7 @@ public class BindingAdapters {
// 显示下载过程状态
if (gameEntity.getApk().size() == 1) {
DownloadEntity downloadEntity = DownloadManager.getInstance(progressBar.getContext()).getDownloadEntitySnapshotByUrl(gameEntity.getApk().get(0).getUrl());
DownloadEntity downloadEntity = DownloadManager.getInstance().getDownloadEntitySnapshotByUrl(gameEntity.getApk().get(0).getUrl());
if (downloadEntity != null) {
progressBar.setProgress((int) (downloadEntity.getPercent() * 10));
switch (downloadEntity.getStatus()) {