forked from organicmaps/organicmaps
[android] Attempted to fixed crash in download adapter
This commit is contained in:
parent
240b6705b3
commit
07bbcbeaf8
1 changed files with 2 additions and 28 deletions
|
@ -16,7 +16,6 @@ import android.support.v7.widget.RecyclerView;
|
|||
import android.text.SpannableStringBuilder;
|
||||
import android.text.Spanned;
|
||||
import android.text.style.StyleSpan;
|
||||
import android.util.Log;
|
||||
import android.util.SparseArray;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
|
@ -24,7 +23,6 @@ import android.view.ViewGroup;
|
|||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.crashlytics.android.Crashlytics;
|
||||
import com.mapswithme.maps.MwmActivity;
|
||||
import com.mapswithme.maps.MwmApplication;
|
||||
import com.mapswithme.maps.R;
|
||||
|
@ -628,38 +626,14 @@ class DownloaderAdapter extends RecyclerView.Adapter<DownloaderAdapter.ViewHolde
|
|||
}
|
||||
else
|
||||
{
|
||||
// TODO: remove this debug 'if' if the crash is gone in next (6.5.3) release
|
||||
// - https://www.fabric.io/mapsme/android/apps/com.mapswithme.maps.pro/issues/58249a350aeb16625bb4d0a7,
|
||||
// otherwise the logged information should help to pinpoint the 'IndexOutOfBounds' bug.
|
||||
if (position >= mItems.size())
|
||||
logIndexOutOfBoundsErrorInfoToCrashlytics(position);
|
||||
|
||||
if (position > mNearMeCount)
|
||||
position -= getAdsCount();
|
||||
CountryItem ci = mItems.get(position);
|
||||
mTitle.setText(mHeaders.get(ci.headerId));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void logIndexOutOfBoundsErrorInfoToCrashlytics(int position)
|
||||
{
|
||||
String tag = DownloaderAdapter.class.getSimpleName();
|
||||
int itemSize = mItems.size();
|
||||
Crashlytics.log(Log.ERROR, tag, "Index " + position + " is out of bounds, mItem.size = "
|
||||
+ itemSize + ", current thread = " + Thread.currentThread() +
|
||||
" mNearMeCount = " + mNearMeCount + ", ads count = " + mAds.size()
|
||||
+ ", showAds = " + mShowAds + ", mAdsLoaded = " + mAdsLoaded
|
||||
+ ", mAdsLoading = " + mAdsLoading +
|
||||
" mSearchResultsMode = " + mSearchResultsMode
|
||||
+ ", mSearchQuery = " + mSearchQuery +
|
||||
" mHeaders.size = " + mHeaders.size()
|
||||
+ " mHeaders = " + mHeaders);
|
||||
if (itemSize > 0)
|
||||
{
|
||||
CountryItem lastCi = mItems.get(--itemSize);
|
||||
Crashlytics.log(Log.INFO, tag, "last county item in position = " + itemSize + " = " + lastCi);
|
||||
}
|
||||
}
|
||||
|
||||
private class AdViewHolder extends BaseInnerViewHolder<NativeAppwallBanner>
|
||||
{
|
||||
private final ImageView mIcon;
|
||||
|
|
Loading…
Add table
Reference in a new issue