Merge branch 'fix-1014' into 'master'
force all Android 5.0 devices to use the old index v0 XML format Closes #1014, #1202, and #1208 See merge request fdroid/fdroidclient!602
This commit is contained in:
		
						commit
						7e767d0f44
					
				| @ -285,6 +285,15 @@ public class FDroidApp extends Application { | |||||||
|         curTheme = Preferences.get().getTheme(); |         curTheme = Preferences.get().getTheme(); | ||||||
|         Preferences.get().configureProxy(); |         Preferences.get().configureProxy(); | ||||||
| 
 | 
 | ||||||
|  |         // bug specific to exactly 5.0 makes it only work with the old index | ||||||
|  |         // which includes an ugly, hacky workaround | ||||||
|  |         // https://gitlab.com/fdroid/fdroidclient/issues/1014 | ||||||
|  |         if (Build.VERSION.SDK_INT == 21) { | ||||||
|  |             Preferences p = Preferences.get(); | ||||||
|  |             p.setExpertMode(true); | ||||||
|  |             p.setForceOldIndex(true); | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|         InstalledAppProviderService.compareToPackageManager(this); |         InstalledAppProviderService.compareToPackageManager(this); | ||||||
|         AppUpdateStatusService.scanDownloadedApks(this); |         AppUpdateStatusService.scanDownloadedApks(this); | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -120,6 +120,10 @@ public final class Preferences implements SharedPreferences.OnSharedPreferenceCh | |||||||
|         return preferences.getBoolean(PREF_FORCE_OLD_INDEX, DEFAULT_FORCE_OLD_INDEX); |         return preferences.getBoolean(PREF_FORCE_OLD_INDEX, DEFAULT_FORCE_OLD_INDEX); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  |     public void setForceOldIndex(boolean flag) { | ||||||
|  |         preferences.edit().putBoolean(PREF_FORCE_OLD_INDEX, flag).apply(); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|     /** |     /** | ||||||
|      * Whether to use the Privileged Installer, based on if it is installed.  Only the disabled |      * Whether to use the Privileged Installer, based on if it is installed.  Only the disabled | ||||||
|      * state is stored as a preference since the enabled state is based entirely on the presence |      * state is stored as a preference since the enabled state is based entirely on the presence | ||||||
| @ -225,6 +229,10 @@ public final class Preferences implements SharedPreferences.OnSharedPreferenceCh | |||||||
|         return preferences.getBoolean(PREF_EXPERT, DEFAULT_EXPERT); |         return preferences.getBoolean(PREF_EXPERT, DEFAULT_EXPERT); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  |     public void setExpertMode(boolean flag) { | ||||||
|  |         preferences.edit().putBoolean(PREF_EXPERT, flag).apply(); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|     public Theme getTheme() { |     public Theme getTheme() { | ||||||
|         return Theme.valueOf(preferences.getString(Preferences.PREF_THEME, Preferences.DEFAULT_THEME)); |         return Theme.valueOf(preferences.getString(Preferences.PREF_THEME, Preferences.DEFAULT_THEME)); | ||||||
|     } |     } | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Marcus
						Marcus