替换黑夜模式的背景,bugly bugfix

This commit is contained in:
wangcongtao
2020-09-16 13:40:04 +08:00
parent c8adf5cef0
commit 8744a12486
9 changed files with 13 additions and 6 deletions

View File

@@ -25,7 +25,7 @@ import java.util.concurrent.atomic.AtomicBoolean;
* 加载并保存 app 列表
*/
public class AppsModel {
private static final String TAG = "AppsModel";
private static volatile AppsModel sInstance;
@@ -57,7 +57,6 @@ public class AppsModel {
if ( mPagedApps != null ) {
mPagedApps.clear();
}
mPagedApps = null;
mContext = null;
mAppFilter = null;
sInstance = null;
@@ -116,9 +115,12 @@ public class AppsModel {
if ( TextUtils.isEmpty( packageName ) ) {
return;
}
if ( mPagedApps.isEmpty() ) {
if ( mPagedApps == null || mPagedApps.isEmpty() ) {
return;
}
if ( mAppFilter == null ) {
mAppFilter = new AppFilterImpl( mContext );
}
try {
final PackageManager packageManager = mContext.getPackageManager();
PackageInfo packageInfo = packageManager.getPackageInfo( packageName, 0 );
@@ -183,6 +185,9 @@ public class AppsModel {
if ( TextUtils.isEmpty( packageName ) ) {
return;
}
if ( mPagedApps == null || mPagedApps.isEmpty() ) {
return;
}
try {
int pageIndex = getPageIndex( packageName, false );
if ( pageIndex == -1 ) {