@Test public void givenNoSecureMessagesSentNoSecureMessagesReceivedNotSharingAndNotSystemContact_whenIsRecipientMessageRequestAccepted_thenIExpectTrue() { when(mockMmsSmsDatabase.getSecureConversationCount(anyLong())).thenReturn(0); boolean result = RecipientUtil.isMessageRequestAccepted(context, recipient); assertTrue(result); }
@WorkerThread public static boolean isMessageRequestAccepted(@NonNull Context context, long threadId) { if (threadId < 0) { return true; } ThreadDatabase threadDatabase = DatabaseFactory.getThreadDatabase(context); Recipient threadRecipient = threadDatabase.getRecipientForThreadId(threadId); if (threadRecipient == null) { return true; } return isMessageRequestAccepted(context, threadId, threadRecipient); }
RecipientUtil { @WorkerThread public static boolean isMessageRequestAccepted(@NonNull Context context, long threadId) { if (threadId < 0) { return true; } ThreadDatabase threadDatabase = DatabaseFactory.getThreadDatabase(context); Recipient threadRecipient = threadDatabase.getRecipientForThreadId(threadId); if (threadRecipient == null) { return true; } return isMessageRequestAccepted(context, threadId, threadRecipient); } }
RecipientUtil { @WorkerThread public static boolean isMessageRequestAccepted(@NonNull Context context, long threadId) { if (threadId < 0) { return true; } ThreadDatabase threadDatabase = DatabaseFactory.getThreadDatabase(context); Recipient threadRecipient = threadDatabase.getRecipientForThreadId(threadId); if (threadRecipient == null) { return true; } return isMessageRequestAccepted(context, threadId, threadRecipient); }  }
RecipientUtil { @WorkerThread public static boolean isMessageRequestAccepted(@NonNull Context context, long threadId) { if (threadId < 0) { return true; } ThreadDatabase threadDatabase = DatabaseFactory.getThreadDatabase(context); Recipient threadRecipient = threadDatabase.getRecipientForThreadId(threadId); if (threadRecipient == null) { return true; } return isMessageRequestAccepted(context, threadId, threadRecipient); }  @WorkerThread static @NonNull SignalServiceAddress toSignalServiceAddressBestEffort(@NonNull Context context, @NonNull Recipient recipient); @WorkerThread static @NonNull SignalServiceAddress toSignalServiceAddress(@NonNull Context context, @NonNull Recipient recipient); static @NonNull List<SignalServiceAddress> toSignalServiceAddresses(@NonNull Context context, @NonNull List<RecipientId> recipients); static @NonNull List<SignalServiceAddress> toSignalServiceAddressesFromResolved(@NonNull Context context, @NonNull List<Recipient> recipients); static void ensureUuidsAreAvailable(@NonNull Context context, @NonNull Collection<Recipient> recipients); static boolean isBlockable(@NonNull Recipient recipient); static List<Recipient> getEligibleForSending(@NonNull List<Recipient> recipients); @WorkerThread static void blockNonGroup(@NonNull Context context, @NonNull Recipient recipient); @WorkerThread static void block(@NonNull Context context, @NonNull Recipient recipient); @WorkerThread static void unblock(@NonNull Context context, @NonNull Recipient recipient); @WorkerThread static boolean isMessageRequestAccepted(@NonNull Context context, long threadId); @WorkerThread static boolean isMessageRequestAccepted(@NonNull Context context, @Nullable Recipient threadRecipient); @WorkerThread static boolean isCallRequestAccepted(@NonNull Context context, @Nullable Recipient threadRecipient); @WorkerThread static boolean isPreMessageRequestThread(@NonNull Context context, long threadId); @WorkerThread static void shareProfileIfFirstSecureMessage(@NonNull Context context, @NonNull Recipient recipient); static boolean isLegacyProfileSharingAccepted(@NonNull Recipient threadRecipient); }
RecipientUtil { @WorkerThread public static boolean isMessageRequestAccepted(@NonNull Context context, long threadId) { if (threadId < 0) { return true; } ThreadDatabase threadDatabase = DatabaseFactory.getThreadDatabase(context); Recipient threadRecipient = threadDatabase.getRecipientForThreadId(threadId); if (threadRecipient == null) { return true; } return isMessageRequestAccepted(context, threadId, threadRecipient); }  @WorkerThread static @NonNull SignalServiceAddress toSignalServiceAddressBestEffort(@NonNull Context context, @NonNull Recipient recipient); @WorkerThread static @NonNull SignalServiceAddress toSignalServiceAddress(@NonNull Context context, @NonNull Recipient recipient); static @NonNull List<SignalServiceAddress> toSignalServiceAddresses(@NonNull Context context, @NonNull List<RecipientId> recipients); static @NonNull List<SignalServiceAddress> toSignalServiceAddressesFromResolved(@NonNull Context context, @NonNull List<Recipient> recipients); static void ensureUuidsAreAvailable(@NonNull Context context, @NonNull Collection<Recipient> recipients); static boolean isBlockable(@NonNull Recipient recipient); static List<Recipient> getEligibleForSending(@NonNull List<Recipient> recipients); @WorkerThread static void blockNonGroup(@NonNull Context context, @NonNull Recipient recipient); @WorkerThread static void block(@NonNull Context context, @NonNull Recipient recipient); @WorkerThread static void unblock(@NonNull Context context, @NonNull Recipient recipient); @WorkerThread static boolean isMessageRequestAccepted(@NonNull Context context, long threadId); @WorkerThread static boolean isMessageRequestAccepted(@NonNull Context context, @Nullable Recipient threadRecipient); @WorkerThread static boolean isCallRequestAccepted(@NonNull Context context, @Nullable Recipient threadRecipient); @WorkerThread static boolean isPreMessageRequestThread(@NonNull Context context, long threadId); @WorkerThread static void shareProfileIfFirstSecureMessage(@NonNull Context context, @NonNull Recipient recipient); static boolean isLegacyProfileSharingAccepted(@NonNull Recipient threadRecipient);  }