Don't repopulate app lists if no repos were changed on update (much faster)
This commit is contained in:
		
							parent
							
								
									dc88ba57e2
								
							
						
					
					
						commit
						154b0bda45
					
				| @ -269,9 +269,11 @@ public class FDroid extends FragmentActivity { | |||||||
|             if (resultCode == UpdateService.STATUS_ERROR) { |             if (resultCode == UpdateService.STATUS_ERROR) { | ||||||
|                 Toast.makeText(FDroid.this, message, Toast.LENGTH_LONG).show(); |                 Toast.makeText(FDroid.this, message, Toast.LENGTH_LONG).show(); | ||||||
|                 finished = true; |                 finished = true; | ||||||
|             } else if (resultCode == UpdateService.STATUS_COMPLETE) { |             } else if (resultCode == UpdateService.STATUS_CHANGES) { | ||||||
|                 repopulateViews(); |                 repopulateViews(); | ||||||
|                 finished = true; |                 finished = true; | ||||||
|  |             } else if (resultCode == UpdateService.STATUS_SAME) { | ||||||
|  |                 finished = true; | ||||||
|             } else if (resultCode == UpdateService.STATUS_INFO) { |             } else if (resultCode == UpdateService.STATUS_INFO) { | ||||||
|                 pd.setMessage(message); |                 pd.setMessage(message); | ||||||
|             } |             } | ||||||
|  | |||||||
| @ -45,9 +45,10 @@ import android.support.v4.app.TaskStackBuilder; | |||||||
| public class UpdateService extends IntentService implements ProgressListener { | public class UpdateService extends IntentService implements ProgressListener { | ||||||
| 
 | 
 | ||||||
|     public static final String RESULT_MESSAGE = "msg"; |     public static final String RESULT_MESSAGE = "msg"; | ||||||
|     public static final int STATUS_COMPLETE = 0; |     public static final int STATUS_CHANGES = 0; | ||||||
|     public static final int STATUS_ERROR = 1; |     public static final int STATUS_SAME = 1; | ||||||
|     public static final int STATUS_INFO = 2; |     public static final int STATUS_ERROR = 2; | ||||||
|  |     public static final int STATUS_INFO = 3; | ||||||
| 
 | 
 | ||||||
|     private ResultReceiver receiver = null; |     private ResultReceiver receiver = null; | ||||||
| 
 | 
 | ||||||
| @ -314,10 +315,14 @@ public class UpdateService extends IntentService implements ProgressListener { | |||||||
|                     errmsg = "Unknown error"; |                     errmsg = "Unknown error"; | ||||||
|                 sendStatus(STATUS_ERROR, errmsg); |                 sendStatus(STATUS_ERROR, errmsg); | ||||||
|             } else { |             } else { | ||||||
|                 sendStatus(STATUS_COMPLETE); |  | ||||||
|                 Editor e = prefs.edit(); |                 Editor e = prefs.edit(); | ||||||
|                 e.putLong("lastUpdateCheck", System.currentTimeMillis()); |                 e.putLong("lastUpdateCheck", System.currentTimeMillis()); | ||||||
|                 e.commit(); |                 e.commit(); | ||||||
|  |                 if (changes) { | ||||||
|  |                     sendStatus(STATUS_CHANGES); | ||||||
|  |                 } else { | ||||||
|  |                     sendStatus(STATUS_SAME); | ||||||
|  |                 } | ||||||
|             } |             } | ||||||
| 
 | 
 | ||||||
|         } catch (Exception e) { |         } catch (Exception e) { | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Daniel Martí
						Daniel Martí