diff options
Diffstat (limited to 'java/com/android/voicemail/impl/settings/VisualVoicemailSettingsUtil.java')
-rw-r--r-- | java/com/android/voicemail/impl/settings/VisualVoicemailSettingsUtil.java | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/java/com/android/voicemail/impl/settings/VisualVoicemailSettingsUtil.java b/java/com/android/voicemail/impl/settings/VisualVoicemailSettingsUtil.java index ae526d168..6694a5db8 100644 --- a/java/com/android/voicemail/impl/settings/VisualVoicemailSettingsUtil.java +++ b/java/com/android/voicemail/impl/settings/VisualVoicemailSettingsUtil.java @@ -57,6 +57,18 @@ public class VisualVoicemailSettingsUtil { .apply(); } + public static void setVoicemailDonationEnabled( + Context context, PhoneAccountHandle phoneAccount, boolean isEnabled) { + Assert.checkArgument( + VoicemailComponent.get(context) + .getVoicemailClient() + .isVoicemailTranscriptionAvailable(context)); + new VisualVoicemailPreferences(context, phoneAccount) + .edit() + .putBoolean(context.getString(R.string.voicemail_visual_voicemail_donation_key), isEnabled) + .apply(); + } + public static boolean isEnabled(Context context, PhoneAccountHandle phoneAccount) { if (phoneAccount == null) { return false; @@ -79,6 +91,15 @@ public class VisualVoicemailSettingsUtil { context.getString(R.string.voicemail_visual_voicemail_archive_key), false); } + public static boolean isVoicemailDonationEnabled( + Context context, PhoneAccountHandle phoneAccount) { + Assert.isNotNull(phoneAccount); + + VisualVoicemailPreferences prefs = new VisualVoicemailPreferences(context, phoneAccount); + return prefs.getBoolean( + context.getString(R.string.voicemail_visual_voicemail_donation_key), false); + } + /** * Whether the client enabled status is explicitly set by user or by default(Whether carrier VVM * app is installed). This is used to determine whether to disable the client when the carrier VVM |