Merge branch 'hotfix-v4.5.2-252-crash' into 'release'

处理一些数组越界闪退

See merge request halo/assistant-android!51
This commit is contained in:
juntao
2020-12-23 10:58:40 +08:00
5 changed files with 6 additions and 10 deletions

View File

@ -33,7 +33,7 @@ object SimulatorGameManager {
@JvmStatic
fun deleteLocalGames(names: List<String>) {
val downloadEntityList = DownloadDao.getInstance(HaloApp.getInstance().application).all
val downloadEntityList = DownloadManager.getInstance(HaloApp.getInstance().application).allDownloadEntity
names.forEach { name ->
val downloadEntity = downloadEntityList.find { it.name == name }
if (downloadEntity != null) {
@ -48,7 +48,7 @@ object SimulatorGameManager {
@JvmStatic
fun deleteLocalGame(name: String) {
val downloadEntityList = DownloadDao.getInstance(HaloApp.getInstance().application).all
val downloadEntityList = DownloadManager.getInstance(HaloApp.getInstance().application).allDownloadEntity
val downloadEntity = downloadEntityList.find { it.name == name }
if (downloadEntity != null) {
val file = File(downloadEntity.path)

View File

@ -66,10 +66,6 @@ public class DataUtils {
});
Sentry.configureScope(scope -> {
User user = new User();
user.setId(HaloApp.getInstance().getGid());
scope.setUser(user);
if (BuildConfig.BUILD_TIME != 0L) {
scope.setTag("alias", "内测版" + BuildConfig.VERSION_NAME + "_" + BuildConfig.BUILD_TIME);
} else {

View File

@ -543,7 +543,7 @@ public class DownloadManager implements DownloadStatusListener {
}
public List<DownloadEntity> getAllSimulatorDownloadEntity() {
List<DownloadEntity> downloadEntityList = mDownloadDao.getAll();
List<DownloadEntity> downloadEntityList = getAllDownloadEntity();
ArrayList<DownloadEntity> filteredDownloadEntityList = new ArrayList<>();
for (DownloadEntity downloadEntity : downloadEntityList) {
if (ExtensionsKt.isSimulatorGame(downloadEntity) && downloadEntity.getStatus() == DownloadStatus.done) {
@ -560,7 +560,7 @@ public class DownloadManager implements DownloadStatusListener {
if (CommonDebug.IS_DEBUG) {
CommonDebug.logMethodName(this);
}
List<DownloadEntity> all = mDownloadDao.getAll();
List<DownloadEntity> all = getAllDownloadEntity();
return filterSilentDownloadTask(all);
}

View File

@ -122,7 +122,7 @@ class SimulatorGameFragment : NormalFragment() {
MtaHelper.onEvent("我的光环_新", "模拟器游戏", "点击${mTypeAliasList[it]}")
if (mCurrentPage != it) {
(mFragmentsList[mCurrentPage] as SimulatorGameListFragment).resetPage()
(mFragmentsList.safelyGetInRelease(mCurrentPage) as? SimulatorGameListFragment)?.resetPage()
mCurrentPage = it
}
}

View File

@ -243,7 +243,7 @@ class VideoDetailContainerFragment : BaseLazyFragment(), OnBackPressedListener {
}
override fun onPageRelease(isNext: Boolean, position: Int) {
val video = mViewModel.videoList.value?.get(position)
val video = mViewModel.videoList.value?.safelyGetInRelease(position)
video?.let {
ExoCacheManager.cancel(video.url)