Messaging: Remove VisibleForTesting
Since we removed all tests, no need to keep those flags around either Change-Id: Icaf71832c459cecbcbddc75f552c60e48ae95189
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
# Copyright (C) 2015 The Android Open Source Project
|
# Copyright (C) 2015 The Android Open Source Project
|
||||||
|
# Copyright (C) 2024 The LineageOS Project
|
||||||
#
|
#
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# you may not use this file except in compliance with the License.
|
# you may not use this file except in compliance with the License.
|
||||||
@@ -16,11 +17,6 @@
|
|||||||
-renamesourcefileattribute SourceFile
|
-renamesourcefileattribute SourceFile
|
||||||
-keepattributes SourceFile,LineNumberTable,*Annotation*
|
-keepattributes SourceFile,LineNumberTable,*Annotation*
|
||||||
|
|
||||||
# Keep classes and methods that have the guava @VisibleForTesting annotation
|
|
||||||
-keep @com.google.common.annotations.VisibleForTesting class *
|
|
||||||
-keepclassmembers class * {
|
|
||||||
@com.google.common.annotations.VisibleForTesting *;
|
|
||||||
}
|
|
||||||
-keep class com.android.messaging.* { *; }
|
-keep class com.android.messaging.* { *; }
|
||||||
-keep class com.android.messaging.*.* { *; }
|
-keep class com.android.messaging.*.* { *; }
|
||||||
-keep class com.android.messaging.*.*.* { *; }
|
-keep class com.android.messaging.*.*.* { *; }
|
||||||
|
|||||||
@@ -30,16 +30,13 @@ import com.android.messaging.util.Assert;
|
|||||||
import com.android.messaging.util.BuglePrefs;
|
import com.android.messaging.util.BuglePrefs;
|
||||||
import com.android.messaging.util.MediaUtil;
|
import com.android.messaging.util.MediaUtil;
|
||||||
import com.android.messaging.util.PhoneUtils;
|
import com.android.messaging.util.PhoneUtils;
|
||||||
import com.google.common.annotations.VisibleForTesting;
|
|
||||||
|
|
||||||
public abstract class Factory {
|
public abstract class Factory {
|
||||||
|
|
||||||
// Making this volatile because on the unit tests, setInstance is called from a unit test
|
// Making this volatile because on the unit tests, setInstance is called from a unit test
|
||||||
// thread, and then it's read on the UI thread.
|
// thread, and then it's read on the UI thread.
|
||||||
private static volatile Factory sInstance;
|
private static volatile Factory sInstance;
|
||||||
@VisibleForTesting
|
|
||||||
protected static boolean sRegistered;
|
protected static boolean sRegistered;
|
||||||
@VisibleForTesting
|
|
||||||
protected static boolean sInitialized;
|
protected static boolean sInitialized;
|
||||||
|
|
||||||
public static Factory get() {
|
public static Factory get() {
|
||||||
|
|||||||
@@ -50,7 +50,6 @@ import com.android.messaging.util.LogUtil;
|
|||||||
import com.android.messaging.util.PhoneUtils;
|
import com.android.messaging.util.PhoneUtils;
|
||||||
import com.android.messaging.util.UriUtil;
|
import com.android.messaging.util.UriUtil;
|
||||||
import com.android.messaging.widget.WidgetConversationProvider;
|
import com.android.messaging.widget.WidgetConversationProvider;
|
||||||
import com.google.common.annotations.VisibleForTesting;
|
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@@ -245,7 +244,6 @@ public class BugleDatabaseOperations {
|
|||||||
* @param senderBlocked Flag whether sender of message is in blocked people list
|
* @param senderBlocked Flag whether sender of message is in blocked people list
|
||||||
* @return The existing conversation id or null
|
* @return The existing conversation id or null
|
||||||
*/
|
*/
|
||||||
@VisibleForTesting
|
|
||||||
@DoesNotRunOnMainThread
|
@DoesNotRunOnMainThread
|
||||||
public static String getExistingConversation(final DatabaseWrapper dbWrapper,
|
public static String getExistingConversation(final DatabaseWrapper dbWrapper,
|
||||||
final long threadId, final boolean senderBlocked) {
|
final long threadId, final boolean senderBlocked) {
|
||||||
@@ -898,7 +896,6 @@ public class BugleDatabaseOperations {
|
|||||||
return ParticipantData.DEFAULT_SELF_SUB_ID;
|
return ParticipantData.DEFAULT_SELF_SUB_ID;
|
||||||
}
|
}
|
||||||
|
|
||||||
@VisibleForTesting
|
|
||||||
@DoesNotRunOnMainThread
|
@DoesNotRunOnMainThread
|
||||||
public static ArrayList<ParticipantData> getParticipantsForConversation(
|
public static ArrayList<ParticipantData> getParticipantsForConversation(
|
||||||
final DatabaseWrapper dbWrapper, final String conversationId) {
|
final DatabaseWrapper dbWrapper, final String conversationId) {
|
||||||
@@ -1505,7 +1502,6 @@ public class BugleDatabaseOperations {
|
|||||||
* @return If the participant is available in our cache, or the DB, this returns the
|
* @return If the participant is available in our cache, or the DB, this returns the
|
||||||
* participant id for the given subid/phone number. Otherwise it returns null.
|
* participant id for the given subid/phone number. Otherwise it returns null.
|
||||||
*/
|
*/
|
||||||
@VisibleForTesting
|
|
||||||
private static String getParticipantId(final DatabaseWrapper dbWrapper,
|
private static String getParticipantId(final DatabaseWrapper dbWrapper,
|
||||||
final int subId, final String canonicalRecipient) {
|
final int subId, final String canonicalRecipient) {
|
||||||
// First check our memory cache for the participant Id
|
// First check our memory cache for the participant Id
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2015 The Android Open Source Project
|
* Copyright (C) 2015 The Android Open Source Project
|
||||||
|
* Copyright (C) 2024 The LineageOS Project
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@@ -20,7 +21,6 @@ import android.database.Cursor;
|
|||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
|
|
||||||
import com.android.messaging.util.Assert;
|
import com.android.messaging.util.Assert;
|
||||||
import com.google.common.annotations.VisibleForTesting;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds parameters and data (such as content URI) for performing queries on the content provider.
|
* Holds parameters and data (such as content URI) for performing queries on the content provider.
|
||||||
@@ -67,11 +67,6 @@ public class CursorQueryData {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@VisibleForTesting
|
|
||||||
public Uri getUri() {
|
|
||||||
return mUri;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Representation of an invalid query. {@link #performSynchronousQuery} will return
|
* Representation of an invalid query. {@link #performSynchronousQuery} will return
|
||||||
* a null Cursor.
|
* a null Cursor.
|
||||||
|
|||||||
@@ -32,7 +32,6 @@ import android.text.TextUtils;
|
|||||||
import com.android.messaging.Factory;
|
import com.android.messaging.Factory;
|
||||||
import com.android.messaging.util.Assert;
|
import com.android.messaging.util.Assert;
|
||||||
import com.android.messaging.util.LogUtil;
|
import com.android.messaging.util.LogUtil;
|
||||||
import com.google.common.annotations.VisibleForTesting;
|
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
@@ -46,7 +45,6 @@ public class MediaScratchFileProvider extends FileProvider {
|
|||||||
|
|
||||||
private static final SimpleArrayMap<Uri, String> sUriToDisplayNameMap = new SimpleArrayMap<>();
|
private static final SimpleArrayMap<Uri, String> sUriToDisplayNameMap = new SimpleArrayMap<>();
|
||||||
|
|
||||||
@VisibleForTesting
|
|
||||||
public static final String AUTHORITY =
|
public static final String AUTHORITY =
|
||||||
"com.android.messaging.datamodel.MediaScratchFileProvider";
|
"com.android.messaging.datamodel.MediaScratchFileProvider";
|
||||||
private static final String MEDIA_SCRATCH_SPACE_DIR = "mediascratchspace";
|
private static final String MEDIA_SCRATCH_SPACE_DIR = "mediascratchspace";
|
||||||
|
|||||||
@@ -41,7 +41,6 @@ import com.android.messaging.util.LogUtil;
|
|||||||
import com.android.messaging.util.PhoneUtils;
|
import com.android.messaging.util.PhoneUtils;
|
||||||
import com.android.messaging.widget.BugleWidgetProvider;
|
import com.android.messaging.widget.BugleWidgetProvider;
|
||||||
import com.android.messaging.widget.WidgetConversationProvider;
|
import com.android.messaging.widget.WidgetConversationProvider;
|
||||||
import com.google.common.annotations.VisibleForTesting;
|
|
||||||
|
|
||||||
import java.io.FileDescriptor;
|
import java.io.FileDescriptor;
|
||||||
import java.io.FileNotFoundException;
|
import java.io.FileNotFoundException;
|
||||||
@@ -53,7 +52,6 @@ import java.io.PrintWriter;
|
|||||||
public class MessagingContentProvider extends ContentProvider {
|
public class MessagingContentProvider extends ContentProvider {
|
||||||
private static final String TAG = LogUtil.BUGLE_TAG;
|
private static final String TAG = LogUtil.BUGLE_TAG;
|
||||||
|
|
||||||
@VisibleForTesting
|
|
||||||
public static final String AUTHORITY =
|
public static final String AUTHORITY =
|
||||||
"com.android.messaging.datamodel.MessagingContentProvider";
|
"com.android.messaging.datamodel.MessagingContentProvider";
|
||||||
private static final String CONTENT_AUTHORITY = "content://" + AUTHORITY + '/';
|
private static final String CONTENT_AUTHORITY = "content://" + AUTHORITY + '/';
|
||||||
|
|||||||
@@ -22,7 +22,6 @@ import android.net.Uri;
|
|||||||
|
|
||||||
import com.android.messaging.Factory;
|
import com.android.messaging.Factory;
|
||||||
import com.android.messaging.util.LogUtil;
|
import com.android.messaging.util.LogUtil;
|
||||||
import com.google.common.annotations.VisibleForTesting;
|
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
@@ -33,7 +32,6 @@ import java.io.IOException;
|
|||||||
public class MmsFileProvider extends FileProvider {
|
public class MmsFileProvider extends FileProvider {
|
||||||
private static final String TAG = LogUtil.BUGLE_TAG;
|
private static final String TAG = LogUtil.BUGLE_TAG;
|
||||||
|
|
||||||
@VisibleForTesting
|
|
||||||
static final String AUTHORITY = "com.android.messaging.datamodel.MmsFileProvider";
|
static final String AUTHORITY = "com.android.messaging.datamodel.MmsFileProvider";
|
||||||
private static final String RAW_MMS_DIR = "rawmms";
|
private static final String RAW_MMS_DIR = "rawmms";
|
||||||
|
|
||||||
|
|||||||
@@ -40,7 +40,6 @@ import com.android.messaging.util.LogUtil;
|
|||||||
import com.android.messaging.util.OsUtil;
|
import com.android.messaging.util.OsUtil;
|
||||||
import com.android.messaging.util.PhoneUtils;
|
import com.android.messaging.util.PhoneUtils;
|
||||||
import com.android.messaging.util.SafeAsyncTask;
|
import com.android.messaging.util.SafeAsyncTask;
|
||||||
import com.google.common.annotations.VisibleForTesting;
|
|
||||||
import com.google.common.base.Joiner;
|
import com.google.common.base.Joiner;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@@ -61,7 +60,6 @@ import java.util.concurrent.atomic.AtomicBoolean;
|
|||||||
* 2. Partial refresh, this is triggered when a participant is added to a conversation. This
|
* 2. Partial refresh, this is triggered when a participant is added to a conversation. This
|
||||||
* normally happens during SMS sync.
|
* normally happens during SMS sync.
|
||||||
*/
|
*/
|
||||||
@VisibleForTesting
|
|
||||||
public class ParticipantRefresh {
|
public class ParticipantRefresh {
|
||||||
private static final String TAG = LogUtil.BUGLE_DATAMODEL_TAG;
|
private static final String TAG = LogUtil.BUGLE_DATAMODEL_TAG;
|
||||||
|
|
||||||
@@ -200,7 +198,6 @@ public class ParticipantRefresh {
|
|||||||
* @param refreshMode the refresh mode desired. See {@link #REFRESH_MODE_FULL},
|
* @param refreshMode the refresh mode desired. See {@link #REFRESH_MODE_FULL},
|
||||||
* {@link #REFRESH_MODE_INCREMENTAL}, and {@link #REFRESH_MODE_SELF_ONLY}
|
* {@link #REFRESH_MODE_INCREMENTAL}, and {@link #REFRESH_MODE_SELF_ONLY}
|
||||||
*/
|
*/
|
||||||
@VisibleForTesting
|
|
||||||
static void refreshParticipants(final int refreshMode) {
|
static void refreshParticipants(final int refreshMode) {
|
||||||
Assert.inRange(refreshMode, REFRESH_MODE_FULL, REFRESH_MODE_SELF_ONLY);
|
Assert.inRange(refreshMode, REFRESH_MODE_FULL, REFRESH_MODE_SELF_ONLY);
|
||||||
if (LogUtil.isLoggable(TAG, LogUtil.VERBOSE)) {
|
if (LogUtil.isLoggable(TAG, LogUtil.VERBOSE)) {
|
||||||
|
|||||||
@@ -25,7 +25,6 @@ import com.android.messaging.util.Assert.RunsOnAnyThread;
|
|||||||
import com.android.messaging.util.Assert.RunsOnMainThread;
|
import com.android.messaging.util.Assert.RunsOnMainThread;
|
||||||
import com.android.messaging.util.LogUtil;
|
import com.android.messaging.util.LogUtil;
|
||||||
import com.android.messaging.util.ThreadUtil;
|
import com.android.messaging.util.ThreadUtil;
|
||||||
import com.google.common.annotations.VisibleForTesting;
|
|
||||||
|
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
@@ -126,7 +125,6 @@ public class ActionMonitor {
|
|||||||
/**
|
/**
|
||||||
* Current state of action
|
* Current state of action
|
||||||
*/
|
*/
|
||||||
@VisibleForTesting
|
|
||||||
protected int mState;
|
protected int mState;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -238,7 +236,6 @@ public class ActionMonitor {
|
|||||||
* @param expectedOldState - expected existing state of action (can be UNKNOWN)
|
* @param expectedOldState - expected existing state of action (can be UNKNOWN)
|
||||||
* @param newState - new state which will be set
|
* @param newState - new state which will be set
|
||||||
*/
|
*/
|
||||||
@VisibleForTesting
|
|
||||||
protected void updateState(final Action action, final int expectedOldState,
|
protected void updateState(final Action action, final int expectedOldState,
|
||||||
final int newState) {
|
final int newState) {
|
||||||
ActionStateChangedListener listener = null;
|
ActionStateChangedListener listener = null;
|
||||||
@@ -412,7 +409,6 @@ public class ActionMonitor {
|
|||||||
/**
|
/**
|
||||||
* Map of action monitors indexed by actionKey
|
* Map of action monitors indexed by actionKey
|
||||||
*/
|
*/
|
||||||
@VisibleForTesting
|
|
||||||
static final SimpleArrayMap<String, ActionMonitor> sActionMonitors = new SimpleArrayMap<>();
|
static final SimpleArrayMap<String, ActionMonitor> sActionMonitors = new SimpleArrayMap<>();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -443,19 +439,6 @@ public class ActionMonitor {
|
|||||||
return monitor;
|
return monitor;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Remove monitor from map
|
|
||||||
*/
|
|
||||||
@VisibleForTesting
|
|
||||||
static void unregisterActionMonitor(final String actionKey,
|
|
||||||
final ActionMonitor monitor) {
|
|
||||||
if (monitor != null) {
|
|
||||||
synchronized (sActionMonitors) {
|
|
||||||
sActionMonitors.remove(actionKey);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Remove monitor from map if the action is complete
|
* Remove monitor from map if the action is complete
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -32,7 +32,6 @@ import com.android.messaging.Factory;
|
|||||||
import com.android.messaging.datamodel.DataModel;
|
import com.android.messaging.datamodel.DataModel;
|
||||||
import com.android.messaging.util.LogUtil;
|
import com.android.messaging.util.LogUtil;
|
||||||
import com.android.messaging.util.LoggingTimer;
|
import com.android.messaging.util.LoggingTimer;
|
||||||
import com.google.common.annotations.VisibleForTesting;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ActionService used to perform background processing for data model
|
* ActionService used to perform background processing for data model
|
||||||
@@ -111,25 +110,16 @@ public class ActionServiceImpl extends JobIntentService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ops
|
// ops
|
||||||
@VisibleForTesting
|
|
||||||
protected static final int OP_START_ACTION = 200;
|
protected static final int OP_START_ACTION = 200;
|
||||||
@VisibleForTesting
|
|
||||||
protected static final int OP_RECEIVE_BACKGROUND_RESPONSE = 201;
|
protected static final int OP_RECEIVE_BACKGROUND_RESPONSE = 201;
|
||||||
@VisibleForTesting
|
|
||||||
protected static final int OP_RECEIVE_BACKGROUND_FAILURE = 202;
|
protected static final int OP_RECEIVE_BACKGROUND_FAILURE = 202;
|
||||||
|
|
||||||
// extras
|
// extras
|
||||||
@VisibleForTesting
|
|
||||||
protected static final String EXTRA_OP_CODE = "op";
|
protected static final String EXTRA_OP_CODE = "op";
|
||||||
@VisibleForTesting
|
|
||||||
protected static final String EXTRA_ACTION_BUNDLE = "datamodel_action_bundle";
|
protected static final String EXTRA_ACTION_BUNDLE = "datamodel_action_bundle";
|
||||||
@VisibleForTesting
|
|
||||||
protected static final String EXTRA_WORKER_EXCEPTION = "worker_exception";
|
protected static final String EXTRA_WORKER_EXCEPTION = "worker_exception";
|
||||||
@VisibleForTesting
|
|
||||||
protected static final String EXTRA_WORKER_RESPONSE = "worker_response";
|
protected static final String EXTRA_WORKER_RESPONSE = "worker_response";
|
||||||
@VisibleForTesting
|
|
||||||
protected static final String EXTRA_WORKER_UPDATE = "worker_update";
|
protected static final String EXTRA_WORKER_UPDATE = "worker_update";
|
||||||
@VisibleForTesting
|
|
||||||
protected static final String BUNDLE_ACTION = "bundle_action";
|
protected static final String BUNDLE_ACTION = "bundle_action";
|
||||||
|
|
||||||
private BackgroundWorker mBackgroundWorker;
|
private BackgroundWorker mBackgroundWorker;
|
||||||
|
|||||||
@@ -29,7 +29,6 @@ import com.android.messaging.datamodel.DataModel;
|
|||||||
import com.android.messaging.util.Assert;
|
import com.android.messaging.util.Assert;
|
||||||
import com.android.messaging.util.LogUtil;
|
import com.android.messaging.util.LogUtil;
|
||||||
import com.android.messaging.util.LoggingTimer;
|
import com.android.messaging.util.LoggingTimer;
|
||||||
import com.google.common.annotations.VisibleForTesting;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -64,15 +63,11 @@ public class BackgroundWorkerService extends JobIntentService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ops
|
// ops
|
||||||
@VisibleForTesting
|
|
||||||
protected static final int OP_PROCESS_REQUEST = 400;
|
protected static final int OP_PROCESS_REQUEST = 400;
|
||||||
|
|
||||||
// extras
|
// extras
|
||||||
@VisibleForTesting
|
|
||||||
protected static final String EXTRA_OP_CODE = "op";
|
protected static final String EXTRA_OP_CODE = "op";
|
||||||
@VisibleForTesting
|
|
||||||
protected static final String EXTRA_ACTION = "action";
|
protected static final String EXTRA_ACTION = "action";
|
||||||
@VisibleForTesting
|
|
||||||
protected static final String EXTRA_ATTEMPT = "retry_attempt";
|
protected static final String EXTRA_ATTEMPT = "retry_attempt";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -31,7 +31,6 @@ import com.android.messaging.datamodel.data.MessageData;
|
|||||||
import com.android.messaging.util.Assert;
|
import com.android.messaging.util.Assert;
|
||||||
import com.android.messaging.util.Assert.RunsOnMainThread;
|
import com.android.messaging.util.Assert.RunsOnMainThread;
|
||||||
import com.android.messaging.util.LogUtil;
|
import com.android.messaging.util.LogUtil;
|
||||||
import com.google.common.annotations.VisibleForTesting;
|
|
||||||
|
|
||||||
public class ReadDraftDataAction extends Action implements Parcelable {
|
public class ReadDraftDataAction extends Action implements Parcelable {
|
||||||
|
|
||||||
@@ -71,7 +70,6 @@ public class ReadDraftDataAction extends Action implements Parcelable {
|
|||||||
actionParameters.putParcelable(KEY_INCOMING_DRAFT, incomingDraft);
|
actionParameters.putParcelable(KEY_INCOMING_DRAFT, incomingDraft);
|
||||||
}
|
}
|
||||||
|
|
||||||
@VisibleForTesting
|
|
||||||
class DraftData {
|
class DraftData {
|
||||||
public final MessageData message;
|
public final MessageData message;
|
||||||
public final ConversationListItemData conversation;
|
public final ConversationListItemData conversation;
|
||||||
|
|||||||
@@ -34,7 +34,6 @@ import com.android.messaging.util.BugleGservicesKeys;
|
|||||||
import com.android.messaging.util.ContentType;
|
import com.android.messaging.util.ContentType;
|
||||||
import com.android.messaging.util.Dates;
|
import com.android.messaging.util.Dates;
|
||||||
import com.android.messaging.util.LogUtil;
|
import com.android.messaging.util.LogUtil;
|
||||||
import com.google.common.annotations.VisibleForTesting;
|
|
||||||
import com.google.common.base.Predicate;
|
import com.google.common.base.Predicate;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@@ -176,7 +175,6 @@ public class ConversationMessageData {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@VisibleForTesting
|
|
||||||
static String[] splitUnquotedString(final String inputString) {
|
static String[] splitUnquotedString(final String inputString) {
|
||||||
if (TextUtils.isEmpty(inputString)) {
|
if (TextUtils.isEmpty(inputString)) {
|
||||||
return new String[0];
|
return new String[0];
|
||||||
@@ -204,7 +202,6 @@ public class ConversationMessageData {
|
|||||||
*
|
*
|
||||||
* @return array of constituent strings
|
* @return array of constituent strings
|
||||||
*/
|
*/
|
||||||
@VisibleForTesting
|
|
||||||
static String[] splitQuotedString(final String inputString) {
|
static String[] splitQuotedString(final String inputString) {
|
||||||
if (TextUtils.isEmpty(inputString)) {
|
if (TextUtils.isEmpty(inputString)) {
|
||||||
return new String[0];
|
return new String[0];
|
||||||
@@ -270,7 +267,6 @@ public class ConversationMessageData {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@VisibleForTesting
|
|
||||||
static List<MessagePartData> makeParts(
|
static List<MessagePartData> makeParts(
|
||||||
final String rawIds,
|
final String rawIds,
|
||||||
final String rawContentTypes,
|
final String rawContentTypes,
|
||||||
@@ -305,7 +301,6 @@ public class ConversationMessageData {
|
|||||||
return parts;
|
return parts;
|
||||||
}
|
}
|
||||||
|
|
||||||
@VisibleForTesting
|
|
||||||
static void unpackMessageParts(
|
static void unpackMessageParts(
|
||||||
final List<MessagePartData> parts,
|
final List<MessagePartData> parts,
|
||||||
final String[] ids,
|
final String[] ids,
|
||||||
|
|||||||
@@ -24,8 +24,6 @@ import androidx.collection.SimpleArrayMap;
|
|||||||
|
|
||||||
import com.android.messaging.util.Assert;
|
import com.android.messaging.util.Assert;
|
||||||
|
|
||||||
import com.google.common.annotations.VisibleForTesting;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.NoSuchElementException;
|
import java.util.NoSuchElementException;
|
||||||
@@ -59,11 +57,6 @@ public class ConversationParticipantsData implements Iterable<ParticipantData> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@VisibleForTesting
|
|
||||||
ParticipantData getParticipantById(final String participantId) {
|
|
||||||
return mConversationParticipantsMap.get(participantId);
|
|
||||||
}
|
|
||||||
|
|
||||||
ArrayList<ParticipantData> getParticipantListExcludingSelf() {
|
ArrayList<ParticipantData> getParticipantListExcludingSelf() {
|
||||||
final ArrayList<ParticipantData> retList =
|
final ArrayList<ParticipantData> retList =
|
||||||
new ArrayList<>(mConversationParticipantsMap.size());
|
new ArrayList<>(mConversationParticipantsMap.size());
|
||||||
|
|||||||
@@ -22,7 +22,6 @@ import com.android.messaging.Factory;
|
|||||||
import com.android.messaging.util.Assert;
|
import com.android.messaging.util.Assert;
|
||||||
import com.android.messaging.util.Assert.RunsOnAnyThread;
|
import com.android.messaging.util.Assert.RunsOnAnyThread;
|
||||||
import com.android.messaging.util.LogUtil;
|
import com.android.messaging.util.LogUtil;
|
||||||
import com.google.common.annotations.VisibleForTesting;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -279,7 +278,6 @@ public class MediaResourceManager {
|
|||||||
mediaLoadingTask.executeOnExecutor(executor, (Void) null);
|
mediaLoadingTask.executeOnExecutor(executor, (Void) null);
|
||||||
}
|
}
|
||||||
|
|
||||||
@VisibleForTesting
|
|
||||||
@RunsOnAnyThread
|
@RunsOnAnyThread
|
||||||
<T extends RefCountedMediaResource> void addResourceToMemoryCache(
|
<T extends RefCountedMediaResource> void addResourceToMemoryCache(
|
||||||
final MediaRequest<T> mediaRequest, final T mediaResource) {
|
final MediaRequest<T> mediaRequest, final T mediaResource) {
|
||||||
|
|||||||
@@ -47,7 +47,6 @@ import com.android.messaging.util.Assert;
|
|||||||
import com.android.messaging.util.LogUtil;
|
import com.android.messaging.util.LogUtil;
|
||||||
import com.android.messaging.util.ThreadUtil;
|
import com.android.messaging.util.ThreadUtil;
|
||||||
import com.android.messaging.util.UiUtils;
|
import com.android.messaging.util.UiUtils;
|
||||||
import com.google.common.annotations.VisibleForTesting;
|
|
||||||
|
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
|
|
||||||
@@ -65,7 +64,6 @@ public class AsyncImageView extends ImageView implements MediaResourceLoadListen
|
|||||||
// issues, so that when the image is loaded, the ImageRequest (which extends BindableData)
|
// issues, so that when the image is loaded, the ImageRequest (which extends BindableData)
|
||||||
// will be able to figure out whether the binding is still valid and whether the loaded image
|
// will be able to figure out whether the binding is still valid and whether the loaded image
|
||||||
// should be delivered to the AsyncImageView via onMediaResourceLoaded() callback.
|
// should be delivered to the AsyncImageView via onMediaResourceLoaded() callback.
|
||||||
@VisibleForTesting
|
|
||||||
public final Binding<BindableMediaRequest<ImageResource>> mImageRequestBinding;
|
public final Binding<BindableMediaRequest<ImageResource>> mImageRequestBinding;
|
||||||
|
|
||||||
/** True if we want the image to fade in when it loads */
|
/** True if we want the image to fade in when it loads */
|
||||||
|
|||||||
@@ -27,7 +27,6 @@ import android.view.ViewGroup;
|
|||||||
import com.android.messaging.Factory;
|
import com.android.messaging.Factory;
|
||||||
import com.android.messaging.util.Assert;
|
import com.android.messaging.util.Assert;
|
||||||
import com.android.messaging.util.UiUtils;
|
import com.android.messaging.util.UiUtils;
|
||||||
import com.google.common.annotations.VisibleForTesting;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A PagerAdapter that provides a fixed number of paged Views provided by a fixed set of
|
* A PagerAdapter that provides a fixed number of paged Views provided by a fixed set of
|
||||||
@@ -79,7 +78,6 @@ public class FixedViewPagerAdapter<T extends PagerViewHolder> extends PagerAdapt
|
|||||||
return getViewHolder(i, true /* rtlAware */);
|
return getViewHolder(i, true /* rtlAware */);
|
||||||
}
|
}
|
||||||
|
|
||||||
@VisibleForTesting
|
|
||||||
public T getViewHolder(final int i, final boolean rtlAware) {
|
public T getViewHolder(final int i, final boolean rtlAware) {
|
||||||
return mViewHolders[rtlAware ? getRtlPosition(i) : i];
|
return mViewHolders[rtlAware ? getRtlPosition(i) : i];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -43,7 +43,6 @@ import com.android.messaging.datamodel.data.MessagePartData;
|
|||||||
import com.android.messaging.ui.BugleActionBarActivity;
|
import com.android.messaging.ui.BugleActionBarActivity;
|
||||||
import com.android.messaging.ui.UIIntents;
|
import com.android.messaging.ui.UIIntents;
|
||||||
import com.android.messaging.ui.attachmentchooser.AttachmentGridView.AttachmentGridHost;
|
import com.android.messaging.ui.attachmentchooser.AttachmentGridView.AttachmentGridHost;
|
||||||
import com.google.common.annotations.VisibleForTesting;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -58,7 +57,6 @@ public class AttachmentChooserFragment extends Fragment implements DraftMessageD
|
|||||||
private AttachmentGridAdapter mAdapter;
|
private AttachmentGridAdapter mAdapter;
|
||||||
private AttachmentChooserFragmentHost mHost;
|
private AttachmentChooserFragmentHost mHost;
|
||||||
|
|
||||||
@VisibleForTesting
|
|
||||||
final Binding<DraftMessageData> mBinding = BindingBase.createBinding(this);
|
final Binding<DraftMessageData> mBinding = BindingBase.createBinding(this);
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -94,7 +92,6 @@ public class AttachmentChooserFragment extends Fragment implements DraftMessageD
|
|||||||
return super.onOptionsItemSelected(item);
|
return super.onOptionsItemSelected(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
@VisibleForTesting
|
|
||||||
void confirmSelection() {
|
void confirmSelection() {
|
||||||
if (mBinding.isBound()) {
|
if (mBinding.isBound()) {
|
||||||
mBinding.getData().removeExistingAttachments(
|
mBinding.getData().removeExistingAttachments(
|
||||||
|
|||||||
@@ -29,7 +29,6 @@ import com.android.messaging.R;
|
|||||||
import com.android.messaging.datamodel.data.MessagePartData;
|
import com.android.messaging.datamodel.data.MessagePartData;
|
||||||
import com.android.messaging.ui.AttachmentPreviewFactory;
|
import com.android.messaging.ui.AttachmentPreviewFactory;
|
||||||
import com.android.messaging.util.Assert;
|
import com.android.messaging.util.Assert;
|
||||||
import com.google.common.annotations.VisibleForTesting;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Shows an item in the attachment picker grid.
|
* Shows an item in the attachment picker grid.
|
||||||
@@ -41,7 +40,6 @@ public class AttachmentGridItemView extends FrameLayout {
|
|||||||
void onItemClicked(AttachmentGridItemView view, MessagePartData attachment);
|
void onItemClicked(AttachmentGridItemView view, MessagePartData attachment);
|
||||||
}
|
}
|
||||||
|
|
||||||
@VisibleForTesting
|
|
||||||
MessagePartData mAttachmentData;
|
MessagePartData mAttachmentData;
|
||||||
private FrameLayout mAttachmentViewContainer;
|
private FrameLayout mAttachmentViewContainer;
|
||||||
private CheckBox mCheckBox;
|
private CheckBox mCheckBox;
|
||||||
@@ -89,11 +87,6 @@ public class AttachmentGridItemView extends FrameLayout {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@VisibleForTesting
|
|
||||||
HostInterface testGetHostInterface() {
|
|
||||||
return mHostInterface;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void updateSelectedState() {
|
public void updateSelectedState() {
|
||||||
mCheckBox.setChecked(mHostInterface.isItemSelected(mAttachmentData));
|
mCheckBox.setChecked(mHostInterface.isItemSelected(mAttachmentData));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,7 +35,6 @@ import com.android.messaging.datamodel.data.ParticipantData;
|
|||||||
import com.android.messaging.ui.ContactIconView;
|
import com.android.messaging.ui.ContactIconView;
|
||||||
import com.android.messaging.util.Assert;
|
import com.android.messaging.util.Assert;
|
||||||
import com.android.messaging.util.AvatarUriUtil;
|
import com.android.messaging.util.AvatarUriUtil;
|
||||||
import com.google.common.annotations.VisibleForTesting;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The view for a single entry in a contact list.
|
* The view for a single entry in a contact list.
|
||||||
@@ -46,7 +45,6 @@ public class ContactListItemView extends LinearLayout implements OnClickListener
|
|||||||
boolean isContactSelected(ContactListItemData item);
|
boolean isContactSelected(ContactListItemData item);
|
||||||
}
|
}
|
||||||
|
|
||||||
@VisibleForTesting
|
|
||||||
final ContactListItemData mData;
|
final ContactListItemData mData;
|
||||||
private TextView mContactNameTextView;
|
private TextView mContactNameTextView;
|
||||||
private TextView mContactDetailsTextView;
|
private TextView mContactDetailsTextView;
|
||||||
|
|||||||
@@ -66,7 +66,6 @@ import com.android.messaging.util.ImeUtil;
|
|||||||
import com.android.messaging.util.LogUtil;
|
import com.android.messaging.util.LogUtil;
|
||||||
import com.android.messaging.util.PhoneUtils;
|
import com.android.messaging.util.PhoneUtils;
|
||||||
import com.android.messaging.util.UiUtils;
|
import com.android.messaging.util.UiUtils;
|
||||||
import com.google.common.annotations.VisibleForTesting;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
@@ -105,7 +104,6 @@ public class ContactPickerFragment extends Fragment implements ContactPickerData
|
|||||||
void invalidateActionBar();
|
void invalidateActionBar();
|
||||||
}
|
}
|
||||||
|
|
||||||
@VisibleForTesting
|
|
||||||
final Binding<ContactPickerData> mBinding = BindingBase.createBinding(this);
|
final Binding<ContactPickerData> mBinding = BindingBase.createBinding(this);
|
||||||
|
|
||||||
private ContactPickerFragmentHost mHost;
|
private ContactPickerFragmentHost mHost;
|
||||||
|
|||||||
@@ -23,7 +23,6 @@ import androidx.annotation.NonNull;
|
|||||||
|
|
||||||
import com.android.messaging.ui.contact.ContactPickerFragment;
|
import com.android.messaging.ui.contact.ContactPickerFragment;
|
||||||
import com.android.messaging.util.Assert;
|
import com.android.messaging.util.Assert;
|
||||||
import com.google.common.annotations.VisibleForTesting;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Keeps track of the different UI states that the ConversationActivity may be in. This acts as
|
* Keeps track of the different UI states that the ConversationActivity may be in. This acts as
|
||||||
@@ -299,12 +298,4 @@ public class ConversationActivityUiState implements Parcelable, Cloneable {
|
|||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* allows for overridding the internal UI state. Should never be called except by test code.
|
|
||||||
*/
|
|
||||||
@VisibleForTesting
|
|
||||||
void testSetUiState(final int uiState) {
|
|
||||||
mConversationContactUiState = uiState;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -110,7 +110,6 @@ import com.android.messaging.util.SafeAsyncTask;
|
|||||||
import com.android.messaging.util.TextUtil;
|
import com.android.messaging.util.TextUtil;
|
||||||
import com.android.messaging.util.UiUtils;
|
import com.android.messaging.util.UiUtils;
|
||||||
import com.android.messaging.util.UriUtil;
|
import com.android.messaging.util.UriUtil;
|
||||||
import com.google.common.annotations.VisibleForTesting;
|
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@@ -160,7 +159,6 @@ public class ConversationFragment extends Fragment implements ConversationDataLi
|
|||||||
// This binding keeps track of our associated ConversationData instance
|
// This binding keeps track of our associated ConversationData instance
|
||||||
// A binding should have the lifetime of the owning component,
|
// A binding should have the lifetime of the owning component,
|
||||||
// don't recreate, unbind and bind if you need new data
|
// don't recreate, unbind and bind if you need new data
|
||||||
@VisibleForTesting
|
|
||||||
final Binding<ConversationData> mBinding = BindingBase.createBinding(this);
|
final Binding<ConversationData> mBinding = BindingBase.createBinding(this);
|
||||||
|
|
||||||
// Saved Instance State Data - only for temporal data which is nice to maintain but not
|
// Saved Instance State Data - only for temporal data which is nice to maintain but not
|
||||||
|
|||||||
@@ -58,7 +58,6 @@ import com.android.messaging.util.ImeUtil;
|
|||||||
import com.android.messaging.util.LogUtil;
|
import com.android.messaging.util.LogUtil;
|
||||||
import com.android.messaging.util.UiUtils;
|
import com.android.messaging.util.UiUtils;
|
||||||
import com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton;
|
import com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton;
|
||||||
import com.google.common.annotations.VisibleForTesting;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -101,7 +100,6 @@ public class ConversationListFragment extends Fragment implements ConversationLi
|
|||||||
"conversationListViewState";
|
"conversationListViewState";
|
||||||
private Parcelable mListState;
|
private Parcelable mListState;
|
||||||
|
|
||||||
@VisibleForTesting
|
|
||||||
final Binding<ConversationListData> mListBinding = BindingBase.createBinding(this);
|
final Binding<ConversationListData> mListBinding = BindingBase.createBinding(this);
|
||||||
|
|
||||||
public static ConversationListFragment createArchivedConversationListFragment() {
|
public static ConversationListFragment createArchivedConversationListFragment() {
|
||||||
|
|||||||
@@ -49,7 +49,6 @@ import com.android.messaging.util.MediaUtil.OnCompletionListener;
|
|||||||
import com.android.messaging.util.SafeAsyncTask;
|
import com.android.messaging.util.SafeAsyncTask;
|
||||||
import com.android.messaging.util.ThreadUtil;
|
import com.android.messaging.util.ThreadUtil;
|
||||||
import com.android.messaging.util.UiUtils;
|
import com.android.messaging.util.UiUtils;
|
||||||
import com.google.common.annotations.VisibleForTesting;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Hosts an audio recorder with tap and hold to record functionality.
|
* Hosts an audio recorder with tap and hold to record functionality.
|
||||||
@@ -236,7 +235,6 @@ public class AudioRecordView extends FrameLayout implements
|
|||||||
mRecordButtonVisual.setBackground(backgroundDrawable);
|
mRecordButtonVisual.setBackground(backgroundDrawable);
|
||||||
}
|
}
|
||||||
|
|
||||||
@VisibleForTesting
|
|
||||||
void onRecordButtonTouchDown() {
|
void onRecordButtonTouchDown() {
|
||||||
if (!mMediaRecorder.isRecording() && mCurrentMode == MODE_IDLE) {
|
if (!mMediaRecorder.isRecording() && mCurrentMode == MODE_IDLE) {
|
||||||
setMode(MODE_STARTING);
|
setMode(MODE_STARTING);
|
||||||
@@ -255,7 +253,6 @@ public class AudioRecordView extends FrameLayout implements
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@VisibleForTesting
|
|
||||||
boolean onRecordButtonTouchUp() {
|
boolean onRecordButtonTouchUp() {
|
||||||
if (System.currentTimeMillis() - mAudioRecordStartTimeMillis <
|
if (System.currentTimeMillis() - mAudioRecordStartTimeMillis <
|
||||||
AUDIO_RECORD_MINIMUM_DURATION_MILLIS) {
|
AUDIO_RECORD_MINIMUM_DURATION_MILLIS) {
|
||||||
|
|||||||
@@ -52,7 +52,6 @@ import com.android.messaging.ui.FixedViewPagerAdapter;
|
|||||||
import com.android.messaging.util.AccessibilityUtil;
|
import com.android.messaging.util.AccessibilityUtil;
|
||||||
import com.android.messaging.util.Assert;
|
import com.android.messaging.util.Assert;
|
||||||
import com.android.messaging.util.UiUtils;
|
import com.android.messaging.util.UiUtils;
|
||||||
import com.google.common.annotations.VisibleForTesting;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
@@ -156,7 +155,6 @@ public class MediaPicker extends Fragment implements DraftMessageSubscriptionDat
|
|||||||
/** The theme color to use to make the media picker match the rest of the UI */
|
/** The theme color to use to make the media picker match the rest of the UI */
|
||||||
private int mThemeColor;
|
private int mThemeColor;
|
||||||
|
|
||||||
@VisibleForTesting
|
|
||||||
final Binding<MediaPickerData> mBinding = BindingBase.createBinding(this);
|
final Binding<MediaPickerData> mBinding = BindingBase.createBinding(this);
|
||||||
|
|
||||||
/** Provides subscription-related data to access per-subscription configurations. */
|
/** Provides subscription-related data to access per-subscription configurations. */
|
||||||
|
|||||||
@@ -39,12 +39,10 @@ import com.android.messaging.datamodel.FrequentContactsCursorQueryData;
|
|||||||
import com.android.messaging.datamodel.data.ParticipantData;
|
import com.android.messaging.datamodel.data.ParticipantData;
|
||||||
import com.android.messaging.sms.MmsSmsUtils;
|
import com.android.messaging.sms.MmsSmsUtils;
|
||||||
import com.android.messaging.ui.contact.AddContactsConfirmationDialog;
|
import com.android.messaging.ui.contact.AddContactsConfirmationDialog;
|
||||||
import com.google.common.annotations.VisibleForTesting;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Utility class including logic to list, filter, and lookup phone and emails in CP2.
|
* Utility class including logic to list, filter, and lookup phone and emails in CP2.
|
||||||
*/
|
*/
|
||||||
@VisibleForTesting
|
|
||||||
public class ContactUtil {
|
public class ContactUtil {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -208,7 +206,6 @@ public class ContactUtil {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@VisibleForTesting
|
|
||||||
public static CursorQueryData getSelf(final Context context) {
|
public static CursorQueryData getSelf(final Context context) {
|
||||||
if (!ContactUtil.hasReadContactsPermission()) {
|
if (!ContactUtil.hasReadContactsPermission()) {
|
||||||
return CursorQueryData.getEmptyQueryData();
|
return CursorQueryData.getEmptyQueryData();
|
||||||
@@ -221,7 +218,6 @@ public class ContactUtil {
|
|||||||
* Get a list of phones sorted by contact name. One contact may have multiple phones.
|
* Get a list of phones sorted by contact name. One contact may have multiple phones.
|
||||||
* In that case, each phone will be returned as a separate record in the result cursor.
|
* In that case, each phone will be returned as a separate record in the result cursor.
|
||||||
*/
|
*/
|
||||||
@VisibleForTesting
|
|
||||||
public static CursorQueryData getPhones(final Context context) {
|
public static CursorQueryData getPhones(final Context context) {
|
||||||
if (!ContactUtil.hasReadContactsPermission()) {
|
if (!ContactUtil.hasReadContactsPermission()) {
|
||||||
return CursorQueryData.getEmptyQueryData();
|
return CursorQueryData.getEmptyQueryData();
|
||||||
@@ -291,7 +287,6 @@ public class ContactUtil {
|
|||||||
* NOTE: This is visible for testing only, clients should only call filterDestination() since
|
* NOTE: This is visible for testing only, clients should only call filterDestination() since
|
||||||
* we support email addresses as well.
|
* we support email addresses as well.
|
||||||
*/
|
*/
|
||||||
@VisibleForTesting
|
|
||||||
public static CursorQueryData filterPhones(final Context context, final String query) {
|
public static CursorQueryData filterPhones(final Context context, final String query) {
|
||||||
return filterPhonesInternal(context, Phone.CONTENT_FILTER_URI, query, Directory.DEFAULT);
|
return filterPhonesInternal(context, Phone.CONTENT_FILTER_URI, query, Directory.DEFAULT);
|
||||||
}
|
}
|
||||||
@@ -323,7 +318,6 @@ public class ContactUtil {
|
|||||||
* NOTE: This is visible for testing only, clients should only call lookupDestination() since
|
* NOTE: This is visible for testing only, clients should only call lookupDestination() since
|
||||||
* we support email addresses as well.
|
* we support email addresses as well.
|
||||||
*/
|
*/
|
||||||
@VisibleForTesting
|
|
||||||
public static CursorQueryData lookupPhone(final Context context, final String phone) {
|
public static CursorQueryData lookupPhone(final Context context, final String phone) {
|
||||||
if (!ContactUtil.hasReadContactsPermission()) {
|
if (!ContactUtil.hasReadContactsPermission()) {
|
||||||
return CursorQueryData.getEmptyQueryData();
|
return CursorQueryData.getEmptyQueryData();
|
||||||
@@ -355,7 +349,6 @@ public class ContactUtil {
|
|||||||
* NOTE: This is visible for testing only, clients should only call filterDestination() since
|
* NOTE: This is visible for testing only, clients should only call filterDestination() since
|
||||||
* we support email addresses as well.
|
* we support email addresses as well.
|
||||||
*/
|
*/
|
||||||
@VisibleForTesting
|
|
||||||
public static CursorQueryData filterEmails(final Context context, final String query) {
|
public static CursorQueryData filterEmails(final Context context, final String query) {
|
||||||
return filterEmailsInternal(context, Email.CONTENT_FILTER_URI, query, Directory.DEFAULT);
|
return filterEmailsInternal(context, Email.CONTENT_FILTER_URI, query, Directory.DEFAULT);
|
||||||
}
|
}
|
||||||
@@ -388,7 +381,6 @@ public class ContactUtil {
|
|||||||
* NOTE: This is visible for testing only, clients should only call lookupDestination() since
|
* NOTE: This is visible for testing only, clients should only call lookupDestination() since
|
||||||
* we support email addresses as well.
|
* we support email addresses as well.
|
||||||
*/
|
*/
|
||||||
@VisibleForTesting
|
|
||||||
public static CursorQueryData lookupEmail(final Context context, final String email) {
|
public static CursorQueryData lookupEmail(final Context context, final String email) {
|
||||||
if (!ContactUtil.hasReadContactsPermission()) {
|
if (!ContactUtil.hasReadContactsPermission()) {
|
||||||
return CursorQueryData.getEmptyQueryData();
|
return CursorQueryData.getEmptyQueryData();
|
||||||
|
|||||||
@@ -22,7 +22,6 @@ import android.text.format.DateUtils;
|
|||||||
|
|
||||||
import com.android.messaging.Factory;
|
import com.android.messaging.Factory;
|
||||||
import com.android.messaging.R;
|
import com.android.messaging.R;
|
||||||
import com.google.common.annotations.VisibleForTesting;
|
|
||||||
|
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.time.Instant;
|
import java.time.Instant;
|
||||||
@@ -46,9 +45,9 @@ public class Dates {
|
|||||||
// Callers of methods in this class should never have to specify these; this is really
|
// Callers of methods in this class should never have to specify these; this is really
|
||||||
// intended only for unit tests.
|
// intended only for unit tests.
|
||||||
@SuppressWarnings("deprecation")
|
@SuppressWarnings("deprecation")
|
||||||
@VisibleForTesting public static final int FORCE_12_HOUR = DateUtils.FORMAT_12HOUR;
|
public static final int FORCE_12_HOUR = DateUtils.FORMAT_12HOUR;
|
||||||
@SuppressWarnings("deprecation")
|
@SuppressWarnings("deprecation")
|
||||||
@VisibleForTesting public static final int FORCE_24_HOUR = DateUtils.FORMAT_24HOUR;
|
public static final int FORCE_24_HOUR = DateUtils.FORMAT_24HOUR;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Private default constructor
|
* Private default constructor
|
||||||
@@ -128,7 +127,6 @@ public class Dates {
|
|||||||
minPeriodToday);
|
minPeriodToday);
|
||||||
}
|
}
|
||||||
|
|
||||||
@VisibleForTesting
|
|
||||||
public static CharSequence getTimestamp(final long time, final long now,
|
public static CharSequence getTimestamp(final long time, final long now,
|
||||||
final boolean abbreviated, final Locale locale, final int flags,
|
final boolean abbreviated, final Locale locale, final int flags,
|
||||||
final boolean minPeriodToday) {
|
final boolean minPeriodToday) {
|
||||||
|
|||||||
@@ -43,7 +43,6 @@ import com.android.messaging.datamodel.MessagingContentProvider;
|
|||||||
import com.android.messaging.datamodel.media.ImageRequest;
|
import com.android.messaging.datamodel.media.ImageRequest;
|
||||||
import com.android.messaging.util.Assert.DoesNotRunOnMainThread;
|
import com.android.messaging.util.Assert.DoesNotRunOnMainThread;
|
||||||
import com.android.messaging.util.exif.ExifInterface;
|
import com.android.messaging.util.exif.ExifInterface;
|
||||||
import com.google.common.annotations.VisibleForTesting;
|
|
||||||
import com.google.common.io.Files;
|
import com.google.common.io.Files;
|
||||||
|
|
||||||
import java.io.ByteArrayOutputStream;
|
import java.io.ByteArrayOutputStream;
|
||||||
@@ -78,7 +77,6 @@ public class ImageUtils {
|
|||||||
return sInstance;
|
return sInstance;
|
||||||
}
|
}
|
||||||
|
|
||||||
@VisibleForTesting
|
|
||||||
public static void set(final ImageUtils imageUtils) {
|
public static void set(final ImageUtils imageUtils) {
|
||||||
sInstance = imageUtils;
|
sInstance = imageUtils;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2015 The Android Open Source Project
|
* Copyright (C) 2015 The Android Open Source Project
|
||||||
|
* Copyright (C) 2024 The LineageOS Project
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@@ -20,8 +21,6 @@ import androidx.annotation.NonNull;
|
|||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.inputmethod.InputMethodManager;
|
import android.view.inputmethod.InputMethodManager;
|
||||||
|
|
||||||
import com.google.common.annotations.VisibleForTesting;
|
|
||||||
|
|
||||||
public class ImeUtil {
|
public class ImeUtil {
|
||||||
public interface ImeStateObserver {
|
public interface ImeStateObserver {
|
||||||
void onImeStateChanged(boolean imeOpen);
|
void onImeStateChanged(boolean imeOpen);
|
||||||
@@ -52,7 +51,6 @@ public class ImeUtil {
|
|||||||
return sInstance;
|
return sInstance;
|
||||||
}
|
}
|
||||||
|
|
||||||
@VisibleForTesting
|
|
||||||
public static void set(final ImeUtil imeUtil) {
|
public static void set(final ImeUtil imeUtil) {
|
||||||
sInstance = imeUtil;
|
sInstance = imeUtil;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2015 The Android Open Source Project
|
* Copyright (C) 2015 The Android Open Source Project
|
||||||
|
* Copyright (C) 2024 The LineageOS Project
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@@ -22,8 +23,6 @@ import android.os.Debug;
|
|||||||
import android.os.PowerManager;
|
import android.os.PowerManager;
|
||||||
import android.os.Process;
|
import android.os.Process;
|
||||||
|
|
||||||
import com.google.common.annotations.VisibleForTesting;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Helper class used to manage wakelock state
|
* Helper class used to manage wakelock state
|
||||||
*/
|
*/
|
||||||
@@ -31,7 +30,6 @@ public class WakeLockHelper {
|
|||||||
private static final String TAG = LogUtil.BUGLE_DATAMODEL_TAG;
|
private static final String TAG = LogUtil.BUGLE_DATAMODEL_TAG;
|
||||||
private static final boolean VERBOSE = false;
|
private static final boolean VERBOSE = false;
|
||||||
|
|
||||||
@VisibleForTesting
|
|
||||||
public static final String EXTRA_CALLING_PID = "pid";
|
public static final String EXTRA_CALLING_PID = "pid";
|
||||||
|
|
||||||
private final Object mLock = new Object();
|
private final Object mLock = new Object();
|
||||||
|
|||||||
Reference in New Issue
Block a user