Remove SDK 16 support completely

Android 4.1 init miss several significant features Magisk reply on,
so the final decision is to forget about it in the future.

Pull minSdkVersion of Magisk Manager back to 17 and remove some
unnecessary adjustments done for SDK 16
This commit is contained in:
topjohnwu
2019-02-12 16:58:05 -05:00
parent 0f55fcafe8
commit c137f2de4f
26 changed files with 65 additions and 114 deletions

View File

@@ -100,13 +100,9 @@ public class LocaleManager {
}
public static Context getLocaleContext(Context context, Locale locale) {
if (Build.VERSION.SDK_INT >= 17) {
Configuration config = new Configuration(context.getResources().getConfiguration());
config.setLocale(locale);
return context.createConfigurationContext(config);
} else {
return context;
}
Configuration config = new Configuration(context.getResources().getConfiguration());
config.setLocale(locale);
return context.createConfigurationContext(config);
}
public static Context getLocaleContext(Locale locale) {
@@ -118,8 +114,6 @@ public class LocaleManager {
}
public static void loadAvailableLocales(@StringRes int compareId) {
if (Build.VERSION.SDK_INT < 17)
return;
Shell.EXECUTOR.execute(() -> {
locales = new ArrayList<>();
HashSet<String> set = new HashSet<>();

View File

@@ -77,7 +77,7 @@ public class Utils {
public static String getAppLabel(ApplicationInfo info, PackageManager pm) {
try {
if (info.labelRes > 0 && Build.VERSION.SDK_INT >= 17) {
if (info.labelRes > 0) {
Resources res = pm.getResourcesForApplication(info);
Configuration config = new Configuration();
config.setLocale(LocaleManager.locale);