Messaging: Allow deletion of messages without a sim inserted

* Currently there is a check in place checking for the presence of a
  preferred sim card
* For deletion of a conversation and message this is unnecessary and
  deleting a conversation from the main view does also not have that check
  already, so replace the check with just checking for being the default
  messaging app

Fixes: https://gitlab.com/LineageOS/issues/android/-/issues/5974
Test: Try deleting a single message or conversation from within
 conversation before and after
Change-Id: Icd47882eb29e16a17ad57a79ea5e0c0f7855ffc6
This commit is contained in:
Michael W
2024-06-16 13:44:19 +02:00
committed by Michael Bestas
parent 37b7f1a539
commit b11039ed8c
2 changed files with 19 additions and 3 deletions

View File

@@ -349,6 +349,18 @@ public class UiUtils {
phoneUtils.isDefaultSmsApp();
}
/**
* Called to check if a message or conversation can be deleted - it needs to be the default
* sms app
* @return true if all conditions are nominal and we're ready to delete a message
*/
public static boolean isReadyForDeleteAction() {
final PhoneUtils phoneUtils = PhoneUtils.getDefault();
// Is the default sms app?
return phoneUtils.isDefaultSmsApp();
}
/*
* Removes all html markup from the text and replaces links with the the text and a text version
* of the href.