Messaging: Replace ExifInterface with its androidx counterpart

Change-Id: I35ba14886b9f837d576f1cd385869614454c921f
This commit is contained in:
Michael W
2024-12-13 15:11:32 +01:00
parent d869533f6f
commit 3b7f05ba67
10 changed files with 26 additions and 11 deletions

View File

@@ -1,4 +1,5 @@
// Copyright (C) 2015 The Android Open Source Project
// Copyright (C) 2024 The LineageOS Project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -61,6 +62,7 @@ android_app {
"androidx.appcompat_appcompat",
"androidx.collection_collection",
"androidx.core_core",
"androidx.exifinterface_exifinterface",
"androidx.fragment_fragment",
"androidx.media_media",
"androidx.legacy_legacy-support-core-utils",

View File

@@ -1,5 +1,6 @@
/*
* Copyright (C) 2015 The Android Open Source Project
* Copyright (C) 2024 The LineageOS Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -24,11 +25,11 @@ import android.graphics.Paint;
import android.graphics.Rect;
import android.graphics.Typeface;
import android.graphics.drawable.VectorDrawable;
import android.media.ExifInterface;
import android.net.Uri;
import android.text.TextUtils;
import androidx.core.content.res.ResourcesCompat;
import androidx.exifinterface.media.ExifInterface;
import com.android.messaging.R;
import com.android.messaging.util.Assert;

View File

@@ -1,5 +1,6 @@
/*
* Copyright (C) 2015 The Android Open Source Project
* Copyright (C) 2024 The LineageOS Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -21,7 +22,8 @@ import android.graphics.Canvas;
import android.graphics.Matrix;
import android.graphics.Paint;
import android.graphics.RectF;
import android.media.ExifInterface;
import androidx.exifinterface.media.ExifInterface;
import com.android.messaging.util.Assert;
import com.android.messaging.util.ImageUtils;

View File

@@ -1,5 +1,6 @@
/*
* Copyright (C) 2015 The Android Open Source Project
* Copyright (C) 2024 The LineageOS Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -18,7 +19,8 @@ package com.android.messaging.datamodel.media;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.media.ExifInterface;
import androidx.exifinterface.media.ExifInterface;
import com.android.messaging.datamodel.media.PoolableImageCache.ReusableImageResourcePool;
import com.android.messaging.util.ImageUtils;

View File

@@ -1,5 +1,6 @@
/*
* Copyright (C) 2015 The Android Open Source Project
* Copyright (C) 2024 The LineageOS Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -20,7 +21,8 @@ import android.graphics.Bitmap;
import android.graphics.ImageDecoder;
import android.graphics.drawable.AnimatedImageDrawable;
import android.graphics.drawable.Drawable;
import android.media.ExifInterface;
import androidx.exifinterface.media.ExifInterface;
import com.android.messaging.util.Assert;
import com.android.messaging.util.LogUtil;

View File

@@ -1,5 +1,6 @@
/*
* Copyright (C) 2015 The Android Open Source Project
* Copyright (C) 2024 The LineageOS Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -39,7 +40,7 @@ public class NetworkUriImageRequest<D extends UriImageRequestDescriptor> extends
public NetworkUriImageRequest(Context context, D descriptor) {
super(context, descriptor);
mOrientation = android.media.ExifInterface.ORIENTATION_UNDEFINED;
mOrientation = androidx.exifinterface.media.ExifInterface.ORIENTATION_UNDEFINED;
}
@Override

View File

@@ -1,5 +1,6 @@
/*
* Copyright (C) 2015 The Android Open Source Project
* Copyright (C) 2024 The LineageOS Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -26,9 +27,10 @@ import android.graphics.PorterDuffColorFilter;
import android.graphics.Rect;
import android.graphics.Typeface;
import android.graphics.drawable.BitmapDrawable;
import android.media.ExifInterface;
import android.text.TextUtils;
import androidx.exifinterface.media.ExifInterface;
import com.android.messaging.R;
import com.android.messaging.util.Assert;
import com.android.messaging.util.AvatarUriUtil;

View File

@@ -1,5 +1,6 @@
/*
* Copyright (C) 2015 The Android Open Source Project
* Copyright (C) 2024 The LineageOS Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -488,8 +489,8 @@ public class MmsUtils {
if (imageSize <= maxPartSize &&
width <= widthLimit &&
height <= heightLimit &&
(orientation == android.media.ExifInterface.ORIENTATION_UNDEFINED ||
orientation == android.media.ExifInterface.ORIENTATION_NORMAL)) {
(orientation == androidx.exifinterface.media.ExifInterface.ORIENTATION_UNDEFINED ||
orientation == androidx.exifinterface.media.ExifInterface.ORIENTATION_NORMAL)) {
if (LogUtil.isLoggable(TAG, LogUtil.VERBOSE)) {
LogUtil.v(TAG, "addPicturePart - already sized");
}

View File

@@ -1,5 +1,6 @@
/*
* Copyright (C) 2015 The Android Open Source Project
* Copyright (C) 2024 The LineageOS Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -78,7 +79,7 @@ public class ImagePersistTask extends SafeAsyncTask<Void, Void, Void> {
outputStream =
mContext.getContentResolver().openOutputStream(mOutputUri);
if (mHeightPercent != 1.0f) {
int orientation = android.media.ExifInterface.ORIENTATION_UNDEFINED;
int orientation = androidx.exifinterface.media.ExifInterface.ORIENTATION_UNDEFINED;
final ExifInterface exifInterface = new ExifInterface();
try {
exifInterface.readExif(mBytes);

View File

@@ -1,5 +1,6 @@
/*
* Copyright (C) 2015 The Android Open Source Project
* Copyright (C) 2024 The LineageOS Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -254,7 +255,7 @@ public class ImageUtils {
} catch (FileNotFoundException e) {
LogUtil.e(TAG, "getOrientation couldn't open: " + uri, e);
}
return android.media.ExifInterface.ORIENTATION_UNDEFINED;
return androidx.exifinterface.media.ExifInterface.ORIENTATION_UNDEFINED;
}
/**
@@ -262,7 +263,7 @@ public class ImageUtils {
* @return The exif orientation value for the image in the specified stream
*/
public static int getOrientation(final InputStream inputStream) {
int orientation = android.media.ExifInterface.ORIENTATION_UNDEFINED;
int orientation = androidx.exifinterface.media.ExifInterface.ORIENTATION_UNDEFINED;
if (inputStream != null) {
try {
final ExifInterface exifInterface = new ExifInterface();