Messaging: Replace explicit types

Change-Id: I2165b3dec73973a2a82d8b3c7c364b5f011e597d
This commit is contained in:
Michael W
2024-12-26 15:54:37 +01:00
parent 9538179c75
commit 0069df879a
124 changed files with 278 additions and 277 deletions
@@ -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.
@@ -103,7 +104,7 @@ public class AvatarUriUtil {
}
final int numParticipants = Math.min(participants.size(), MAX_GROUP_PARTICIPANTS);
final ArrayList<Uri> avatarUris = new ArrayList<Uri>(numParticipants);
final ArrayList<Uri> avatarUris = new ArrayList<>(numParticipants);
for (int i = 0; i < numParticipants; i++) {
avatarUris.add(createAvatarUri(participants.get(i)));
}
@@ -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.
@@ -54,13 +55,13 @@ public class FallbackStrategies<Input, Output> {
private final List<Strategy<Input, Output>> mChainedStrategies;
private FallbackStrategies(final Strategy<Input, Output> primaryStrategy) {
mChainedStrategies = new ArrayList<Strategy<Input, Output>>();
mChainedStrategies = new ArrayList<>();
mChainedStrategies.add(primaryStrategy);
}
public static <Input, Output> FallbackStrategies<Input, Output> startWith(
final Strategy<Input, Output> primaryStrategy) {
return new FallbackStrategies<Input, Output>(primaryStrategy);
return new FallbackStrategies<>(primaryStrategy);
}
public FallbackStrategies<Input, Output> thenTry(final Strategy<Input, Output> strategy) {
@@ -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.
@@ -23,7 +24,7 @@ import androidx.collection.LongSparseArray;
*/
public class LongSparseSet {
private static final Object THE_ONLY_VALID_VALUE = new Object();
private final LongSparseArray<Object> mSet = new LongSparseArray<Object>();
private final LongSparseArray<Object> mSet = new LongSparseArray<>();
public LongSparseSet() {
}
@@ -64,7 +64,7 @@ public class NotificationPlayer implements OnCompletionListener {
}
}
private final LinkedList<Command> mCmdQueue = new LinkedList<Command>();
private final LinkedList<Command> mCmdQueue = new LinkedList<>();
private Looper mLooper;
+2 -2
View File
@@ -77,7 +77,7 @@ public class OsUtil {
return null;
}
private static final Hashtable<String, Integer> sPermissions = new Hashtable<String, Integer>();
private static final Hashtable<String, Integer> sPermissions = new Hashtable<>();
/**
* Check if the app has the specified permission. If it does not, the app needs to use
@@ -139,7 +139,7 @@ public class OsUtil {
* again, and its up to the app to only request permissions that are missing.
*/
public static String[] getMissingPermissions(final String[] permissions) {
final ArrayList<String> missingList = new ArrayList<String>();
final ArrayList<String> missingList = new ArrayList<>();
for (final String permission : permissions) {
if (!hasPermission(permission)) {
missingList.add(permission);
+2 -2
View File
@@ -48,13 +48,13 @@ public class UriUtil {
private static final String SCHEME_SMSTO = "smsto";
private static final String SCHEME_MMS = "mms";
private static final String SCHEME_MMSTO = "smsto";
public static final HashSet<String> SMS_MMS_SCHEMES = new HashSet<String>(
public static final HashSet<String> SMS_MMS_SCHEMES = new HashSet<>(
Arrays.asList(SCHEME_SMS, SCHEME_MMS, SCHEME_SMSTO, SCHEME_MMSTO));
private static final String SCHEME_HTTP = "http";
private static final String SCHEME_HTTPS = "https";
public static final String SCHEME_BUGLE = "bugle";
public static final HashSet<String> SUPPORTED_SCHEME = new HashSet<String>(
public static final HashSet<String> SUPPORTED_SCHEME = new HashSet<>(
Arrays.asList(ContentResolver.SCHEME_ANDROID_RESOURCE,
ContentResolver.SCHEME_CONTENT,
ContentResolver.SCHEME_FILE,
@@ -48,7 +48,7 @@ class ExifData {
private final IfdData[] mIfdDatas = new IfdData[IfdId.TYPE_IFD_COUNT];
private byte[] mThumbnail;
private final ArrayList<byte[]> mStripBytes = new ArrayList<byte[]>();
private final ArrayList<byte[]> mStripBytes = new ArrayList<>();
private final ByteOrder mByteOrder;
ExifData(ByteOrder order) {
@@ -256,7 +256,7 @@ class ExifData {
* are none.
*/
protected List<ExifTag> getAllTags() {
ArrayList<ExifTag> ret = new ArrayList<ExifTag>();
ArrayList<ExifTag> ret = new ArrayList<>();
for (IfdData d : mIfdDatas) {
if (d != null) {
ExifTag[] tags = d.getAllTags();
@@ -286,7 +286,7 @@ class ExifData {
if (tags == null) {
return null;
}
ArrayList<ExifTag> ret = new ArrayList<ExifTag>(tags.length);
ArrayList<ExifTag> ret = new ArrayList<>(tags.length);
for (ExifTag t : tags) {
ret.add(t);
}
@@ -301,7 +301,7 @@ class ExifData {
* are none.
*/
protected List<ExifTag> getAllTagsForTagId(short tag) {
ArrayList<ExifTag> ret = new ArrayList<ExifTag>();
ArrayList<ExifTag> ret = new ArrayList<>();
for (IfdData d : mIfdDatas) {
if (d != null) {
ExifTag t = d.getTag(tag);
@@ -323,7 +323,7 @@ public class ExifInterface {
* Tags that contain offset markers. These are included in the banned
* defines.
*/
private static final HashSet<Short> sOffsetTags = new HashSet<Short>();
private static final HashSet<Short> sOffsetTags = new HashSet<>();
static {
sOffsetTags.add(getTrueTagKey(TAG_GPS_IFD));
sOffsetTags.add(getTrueTagKey(TAG_EXIF_IFD));
@@ -335,7 +335,7 @@ public class ExifInterface {
/**
* Tags with definitions that cannot be overridden (banned defines).
*/
protected static final HashSet<Short> sBannedDefines = new HashSet<Short>(sOffsetTags);
protected static final HashSet<Short> sBannedDefines = new HashSet<>(sOffsetTags);
static {
sBannedDefines.add(getTrueTagKey(TAG_NULL));
sBannedDefines.add(getTrueTagKey(TAG_JPEG_INTERCHANGE_FORMAT_LENGTH));
@@ -2392,7 +2392,7 @@ public class ExifInterface {
protected static int[] getAllowedIfdsFromInfo(int info) {
int ifdFlags = getAllowedIfdFlagsFromInfo(info);
int[] ifds = IfdData.getIfds();
ArrayList<Integer> l = new ArrayList<Integer>();
ArrayList<Integer> l = new ArrayList<>();
for (int i = 0; i < IfdId.TYPE_IFD_COUNT; i++) {
int flag = (ifdFlags >> i) & 1;
if (flag == 1) {
@@ -1,5 +1,6 @@
/*
* Copyright (C) 2012 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.
@@ -31,7 +32,7 @@ class ExifModifier {
public static final boolean DEBUG = false;
private final ByteBuffer mByteBuffer;
private final ExifData mTagToModified;
private final List<TagOffset> mTagOffsets = new ArrayList<TagOffset>();
private final List<TagOffset> mTagOffsets = new ArrayList<>();
private final ExifInterface mInterface;
private int mOffsetBase;
@@ -243,7 +243,7 @@ class ExifOutputStream extends FilterOutputStream {
}
private ArrayList<ExifTag> stripNullValueTags(ExifData data) {
ArrayList<ExifTag> nullTags = new ArrayList<ExifTag>();
ArrayList<ExifTag> nullTags = new ArrayList<>();
if (data.getAllTags() == null) {
return nullTags;
}
@@ -179,7 +179,7 @@ public class ExifParser {
private static final short TAG_STRIP_BYTE_COUNTS = ExifInterface
.getTrueTagKey(ExifInterface.TAG_STRIP_BYTE_COUNTS);
private final TreeMap<Integer, Object> mCorrespondingEvent = new TreeMap<Integer, Object>();
private final TreeMap<Integer, Object> mCorrespondingEvent = new TreeMap<>();
private boolean isIfdRequested(int ifdType) {
switch (ifdType) {
@@ -1,5 +1,6 @@
/*
* Copyright (C) 2012 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.
@@ -28,7 +29,7 @@ import java.util.Map;
class IfdData {
private final int mIfdId;
private final Map<Short, ExifTag> mExifTags = new HashMap<Short, ExifTag>();
private final Map<Short, ExifTag> mExifTags = new HashMap<>();
private int mOffsetToNextIfd = 0;
private static final int[] sIfds = {
IfdId.TYPE_IFD_0, IfdId.TYPE_IFD_1, IfdId.TYPE_IFD_EXIF,