处理 SonarQube 问题:
双重检查锁方式实现的单例,改为使用静态内部类方式
This commit is contained in:
@ -188,10 +188,10 @@ public class SplashScreenActivity extends BaseActivity {
|
||||
|
||||
// 删除更新后的光环助手包
|
||||
private void cancelPreviousUpdateTask() {
|
||||
List<DownloadEntity> all = DownloadManager.getInstance(this).getAllDownloadEntity();
|
||||
List<DownloadEntity> all = DownloadManager.getInstance().getAllDownloadEntity();
|
||||
for (DownloadEntity downloadEntity : all) {
|
||||
if (downloadEntity.getPackageName().equals(getPackageName())) {
|
||||
DownloadManager.getInstance(this).cancel(downloadEntity.getUrl(), true, true);
|
||||
DownloadManager.getInstance().cancel(downloadEntity.getUrl(), true, true);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -205,7 +205,7 @@ public class SplashScreenActivity extends BaseActivity {
|
||||
|
||||
@SuppressLint("CheckResult")
|
||||
private void deviceDialogSetting() {
|
||||
RetrofitManager.getInstance(HaloApp.getInstance().getApplication())
|
||||
RetrofitManager.getInstance()
|
||||
.getApi().deviceDialogs()
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
@ -221,7 +221,7 @@ public class SplashScreenActivity extends BaseActivity {
|
||||
|
||||
@SuppressLint("CheckResult")
|
||||
private void getRegulationTestStatus() {
|
||||
RetrofitManager.getInstance(HaloApp.getInstance().getApplication())
|
||||
RetrofitManager.getInstance()
|
||||
.getApi().getRegulationTestStatus()
|
||||
.subscribe(new BiResponse<ResponseBody>() {
|
||||
@Override
|
||||
@ -237,7 +237,7 @@ public class SplashScreenActivity extends BaseActivity {
|
||||
}
|
||||
|
||||
private void getFilterDetailTags() {
|
||||
RetrofitManager.getInstance(HaloApp.getInstance().getApplication())
|
||||
RetrofitManager.getInstance()
|
||||
.getApi().getFilterDetailTags()
|
||||
.subscribe(new Response<ArrayList<String>>() {
|
||||
@Override
|
||||
@ -249,7 +249,7 @@ public class SplashScreenActivity extends BaseActivity {
|
||||
}
|
||||
|
||||
private void getAuthDialog() {
|
||||
RetrofitManager.getInstance(HaloApp.getInstance().getApplication())
|
||||
RetrofitManager.getInstance()
|
||||
.getApi()
|
||||
.authDialog()
|
||||
.subscribe(new Response<List<AuthDialogEntity>>() {
|
||||
@ -269,7 +269,7 @@ public class SplashScreenActivity extends BaseActivity {
|
||||
return;
|
||||
}
|
||||
|
||||
RetrofitManager.getInstance(HaloApp.getInstance().getApplication())
|
||||
RetrofitManager.getInstance()
|
||||
.getApi()
|
||||
.getMark()
|
||||
.subscribe(new BiResponse<ResponseBody>() {
|
||||
@ -287,7 +287,7 @@ public class SplashScreenActivity extends BaseActivity {
|
||||
|
||||
@SuppressLint("CheckResult")
|
||||
private void showPrivacyPolicy(SimpleCallback<Boolean> callback) {
|
||||
RetrofitManager.getInstance(this).getApi()
|
||||
RetrofitManager.getInstance().getApi()
|
||||
.getPrivacyPolicy()
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
|
||||
Reference in New Issue
Block a user