Don't use DownloadManager on Android 2.3
Fixes apk downloads crashing on 2.3 devices as spotted in the comments at issue #421.
This commit is contained in:
		
							parent
							
								
									9b3ede7a81
								
							
						
					
					
						commit
						d77fce9d80
					
				@ -72,9 +72,12 @@ public class DownloaderFactory {
 | 
			
		||||
    /**
 | 
			
		||||
     * Tests to see if we can use Android's DownloadManager to download the APK, instead of
 | 
			
		||||
     * a downloader returned from DownloadFactory.
 | 
			
		||||
     *
 | 
			
		||||
     * We require ICE_CREAM_SANDWICH (4.0). The DownloadManager does exist on
 | 
			
		||||
     * 2.3.X, but it lacks HTTPS support.
 | 
			
		||||
     */
 | 
			
		||||
    private static boolean canUseDownloadManager(URL url) {
 | 
			
		||||
        return Build.VERSION.SDK_INT > Build.VERSION_CODES.FROYO && !isOnionAddress(url);
 | 
			
		||||
        return Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH && !isOnionAddress(url);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user