private static void updateRetryCounter(WeakReference<Context> weakContext,String filename,int maxRetryAttempts){
  if (maxRetryAttempts == -1) {
    return;
  }
  Context context=null;
  if (weakContext != null) {
    context=weakContext.get();
    if (context != null) {
      SharedPreferences preferences=context.getSharedPreferences(ARTISAN_SDK,Context.MODE_PRIVATE);
      SharedPreferences.Editor editor=preferences.edit();
      int retryCounter=preferences.getInt("RETRY_COUNT: " + filename,0);
      ArtisanLogUtil.debugLog("current retry count is " + retryCounter);
      if (retryCounter >= maxRetryAttempts) {
        ArtisanLogUtil.debugLog("retry count beyond max " + maxRetryAttempts);
        deleteStackTrace(weakContext,filename);
        deleteRetryCounter(weakContext,filename,maxRetryAttempts);
      }
 else {
        editor.putInt("RETRY_COUNT: " + filename,retryCounter + 1);
        editor.apply();
      }
    }
  }
}

private static void updateRetryCounter ( WeakReference < Context > weakContext , String filename , int maxRetryAttempts ) { if ( maxRetryAttempts == - 1 ) { return ; } Context context = null ; if ( weakContext != null ) { context = weakContext . get ( ) ; if ( context != null ) { SharedPreferences preferences = context . getSharedPreferences ( ARTISAN_SDK , Context . MODE_PRIVATE ) ; SharedPreferences . Editor editor = preferences . edit ( ) ; int retryCounter = preferences . getInt ( "RETRY_COUNT: " + filename , 0 ) ; ArtisanLogUtil . debugLog ( "current retry count is " + retryCounter ) ; if ( retryCounter >= maxRetryAttempts ) { ArtisanLogUtil . debugLog ( "retry count beyond max " + maxRetryAttempts ) ; deleteStackTrace ( weakContext , filename ) ; deleteRetryCounter ( weakContext , filename , maxRetryAttempts ) ; } else { editor . putInt ( "RETRY_COUNT: " + filename , retryCounter + 1 ) ; editor . apply ( ) ; } } } }
update the retry attempts count for this crash stacktrace .
