Support API 33 feature detection (Cheogram)

This commit is contained in:
Arne 2023-05-22 19:22:26 +02:00
parent 2b853060b8
commit 19c25a8106
3 changed files with 12 additions and 1 deletions

View file

@ -125,7 +125,7 @@ def tags = grgit.tag.list().findAll { it.dateTime != null }.sort { it.dateTime }
android {
namespace 'eu.siacs.conversations'
//noinspection GradleCompatible
compileSdkVersion 32
compileSdkVersion 33
defaultConfig {
minSdkVersion 21

View file

@ -731,6 +731,12 @@ public class Contact implements ListItem, Blockable {
// This Contact is a gateway to use for voice calls, register it with OS
public void registerAsPhoneAccount(XmppConnectionService ctx) {
if (Build.VERSION.SDK_INT < 23) return;
if (Build.VERSION.SDK_INT >= 33) {
if (!ctx.getPackageManager().hasSystemFeature(PackageManager.FEATURE_TELECOM)) return;
} else {
if (!ctx.getPackageManager().hasSystemFeature(PackageManager.FEATURE_CONNECTION_SERVICE)) return;
}
if (!ctx.getPackageManager().hasSystemFeature(PackageManager.FEATURE_CONNECTION_SERVICE)) return;
TelecomManager telecomManager = ctx.getSystemService(TelecomManager.class);

View file

@ -1980,6 +1980,11 @@ public class FileBackend {
} catch (Exception e) {
width = -1;
}
try {
metadataRetriever.release();
} catch (final IOException e) {
throw new NotAVideoFile();
}
metadataRetriever.release();
Log.d(Config.LOGTAG, "extracted video dims " + width + "x" + height);
return rotated ? new Dimensions(width, height) : new Dimensions(height, width);