Create .nomedia in icons directory for old Androids
This commit is contained in:
		
							parent
							
								
									cf0576a717
								
							
						
					
					
						commit
						cd0234b4e8
					
				@ -265,6 +265,20 @@ public class UpdateService extends IntentService implements ProgressListener {
 | 
			
		||||
                    toDownloadIcons = acceptedapps;
 | 
			
		||||
                }
 | 
			
		||||
                if (toDownloadIcons != null) {
 | 
			
		||||
 | 
			
		||||
                    // Create a .nomedia file in the icons directory. For
 | 
			
		||||
                    // recent Android versions this isn't necessary, because
 | 
			
		||||
                    // they recognise the cache location. Older versions don't
 | 
			
		||||
                    // though.
 | 
			
		||||
                    File f = new File(d, ".nomedia");
 | 
			
		||||
                    if (!f.exists()) {
 | 
			
		||||
                        try {
 | 
			
		||||
                            f.createNewFile();
 | 
			
		||||
                        } catch (Exception e) {
 | 
			
		||||
                            Log.d("FDroid", "Failed to create .nomedia");
 | 
			
		||||
                        }
 | 
			
		||||
                    }
 | 
			
		||||
 | 
			
		||||
                    sendStatus(STATUS_INFO,
 | 
			
		||||
                            getString(R.string.status_downloading_icons));
 | 
			
		||||
                    for (DB.App app : toDownloadIcons)
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user