exclude all realme devices up to Android 11

This commit is contained in:
Daniel Gultsch 2024-04-26 09:43:00 +02:00
parent b185b75242
commit 8856c048d6
No known key found for this signature in database
GPG key ID: F43D18AD2A0982C2

View file

@ -38,15 +38,8 @@ public class CallIntegration extends Connection {
private static final List<String> BROKEN_DEVICE_MODELS = private static final List<String> BROKEN_DEVICE_MODELS =
Arrays.asList( Arrays.asList(
"OnePlus6", // OnePlus 6 (Android 8.1-11) Device is buggy and always starts the "OnePlus6" // OnePlus 6 (Android 8.1-11) Device is buggy and always starts the
// operating system call screen even though we want to be self // OS call screen even though we want to be self managed
// managed
"RMX1921", // Realme XT (Android 9-10) shows "Call not sent" dialog
"RMX1971", // Realme 5 Pro (Android 9-11), show "Call not sent" dialog
"RMX1973", // Realme 5 Pro (see above),
"RMX2071", // Realme X50 Pro 5G (Call not sent)
"RMX2075L1", // Realme X50 Pro 5G
"RMX2076" // Realme X50 Pro 5G
); );
public static final int DEFAULT_TONE_VOLUME = 60; public static final int DEFAULT_TONE_VOLUME = 60;
@ -491,7 +484,7 @@ public class CallIntegration extends Connection {
public static boolean selfManaged(final Context context) { public static boolean selfManaged(final Context context) {
return Build.VERSION.SDK_INT >= Build.VERSION_CODES.O return Build.VERSION.SDK_INT >= Build.VERSION_CODES.O
&& hasSystemFeature(context) && hasSystemFeature(context)
&& !BROKEN_DEVICE_MODELS.contains(Build.DEVICE); && isDeviceModelSupported();
} }
public static boolean hasSystemFeature(final Context context) { public static boolean hasSystemFeature(final Context context) {
@ -504,6 +497,18 @@ public class CallIntegration extends Connection {
} }
} }
private static boolean isDeviceModelSupported() {
if (BROKEN_DEVICE_MODELS.contains(Build.DEVICE)) {
return false;
}
// all Realme devices at least up to and including Android 11 are broken
if ("realme".equalsIgnoreCase(Build.MANUFACTURER)
&& Build.VERSION.SDK_INT <= Build.VERSION_CODES.R) {
return false;
}
return true;
}
public static boolean notSelfManaged(final Context context) { public static boolean notSelfManaged(final Context context) {
return !selfManaged(context); return !selfManaged(context);
} }