Build: Fix GetLocales lint f0b15d275a
This commit is contained in:
parent
77cef2fec3
commit
f897156c31
3 changed files with 27 additions and 5 deletions
|
|
@ -16,6 +16,8 @@
|
||||||
|
|
||||||
package org.microg.gms.common;
|
package org.microg.gms.common;
|
||||||
|
|
||||||
|
import android.annotation.SuppressLint;
|
||||||
|
|
||||||
import android.app.ActivityManager;
|
import android.app.ActivityManager;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.pm.ConfigurationInfo;
|
import android.content.pm.ConfigurationInfo;
|
||||||
|
|
@ -90,17 +92,24 @@ public class DeviceConfiguration {
|
||||||
this.nativePlatforms = getNativePlatforms();
|
this.nativePlatforms = getNativePlatforms();
|
||||||
widthPixels = displayMetrics.widthPixels;
|
widthPixels = displayMetrics.widthPixels;
|
||||||
heightPixels = displayMetrics.heightPixels;
|
heightPixels = displayMetrics.heightPixels;
|
||||||
locales = new ArrayList<>(Arrays.asList(context.getAssets().getLocales()));
|
locales = getLocales(context);
|
||||||
for (int i = 0; i < locales.size(); i++) {
|
|
||||||
locales.set(i, locales.get(i).replace("-", "_"));
|
|
||||||
}
|
|
||||||
Collections.sort(locales);
|
|
||||||
Set<String> glExtensions = new HashSet<>();
|
Set<String> glExtensions = new HashSet<>();
|
||||||
addEglExtensions(glExtensions);
|
addEglExtensions(glExtensions);
|
||||||
this.glExtensions = new ArrayList<>(glExtensions);
|
this.glExtensions = new ArrayList<>(glExtensions);
|
||||||
Collections.sort(this.glExtensions);
|
Collections.sort(this.glExtensions);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressLint("GetLocales")
|
||||||
|
private static List<String> getLocales(Context context) {
|
||||||
|
List<String> locales = new ArrayList<String>();
|
||||||
|
locales.addAll(Arrays.asList(context.getAssets().getLocales()));
|
||||||
|
for (int i = 0; i < locales.size(); i++) {
|
||||||
|
locales.set(i, locales.get(i).replace("-", "_"));
|
||||||
|
}
|
||||||
|
Collections.sort(locales);
|
||||||
|
return locales;
|
||||||
|
}
|
||||||
|
|
||||||
@SuppressWarnings({"InlinedApi"})
|
@SuppressWarnings({"InlinedApi"})
|
||||||
private static List<String> getNativePlatforms() {
|
private static List<String> getNativePlatforms() {
|
||||||
<<<<<<< HEAD
|
<<<<<<< HEAD
|
||||||
|
|
|
||||||
|
|
@ -97,6 +97,12 @@ android {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
<<<<<<< HEAD
|
||||||
|
=======
|
||||||
|
lintOptions {
|
||||||
|
disable 'MissingTranslation', 'GetLocales', 'BatteryLife', 'ImpliedQuantity', 'MissingQuantity', 'InvalidWakeLockTag', 'Range'
|
||||||
|
}
|
||||||
|
>>>>>>> a907c391 (Build: Fix GetLocales lint https://github.com/microg/GmsCore/commit/f0b15d275a0c4ec3625033d651414d396e368320)
|
||||||
|
|
||||||
buildTypes {
|
buildTypes {
|
||||||
release {
|
release {
|
||||||
|
|
|
||||||
|
|
@ -31,8 +31,15 @@ android {
|
||||||
sourceCompatibility = 11
|
sourceCompatibility = 11
|
||||||
targetCompatibility = 11
|
targetCompatibility = 11
|
||||||
}
|
}
|
||||||
|
<<<<<<< HEAD
|
||||||
lint {
|
lint {
|
||||||
disable 'MissingTranslation'
|
disable 'MissingTranslation'
|
||||||
|
=======
|
||||||
|
|
||||||
|
lintOptions {
|
||||||
|
// TODO: Remove MissingTranslation once we have stable strings and proper translations.
|
||||||
|
disable 'MissingTranslation', 'GetLocales'
|
||||||
|
>>>>>>> a907c391 (Build: Fix GetLocales lint https://github.com/microg/GmsCore/commit/f0b15d275a0c4ec3625033d651414d396e368320)
|
||||||
}
|
}
|
||||||
namespace 'org.microg.tools.ui'
|
namespace 'org.microg.tools.ui'
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue