protected synchronized void save ( ) { try { JSONArray jsonArray = new JSONArray ( ) ; for ( Job job : mQueue ) { if ( ! ( job instanceof InternalJob ) ) continue ; InternalJob internalJob = ( InternalJob ) job ; jsonArray . put ( internalJob . toJSON ( ) ) ; } SharedPreferences prefs = WonderPushConfiguration . getSharedPreferences ( ) ; SharedPreferences . Editor editor = prefs . edit ( ) ; editor . putString ( getPrefName ( ) , jsonArray . toString ( ) ) ; editor . apply ( ) ; } catch ( JSONException e ) { Log . e ( TAG , "Could not save job queue" , e ) ; } catch ( Exception e ) { Log . e ( TAG , "Could not save job queue" , e ) ; } }
Saves the job queue on disk .