Eric Erfanian | d5e47f6 | 2017-03-15 14:41:07 -0700 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright (C) 2017 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License |
| 15 | */ |
| 16 | |
| 17 | package com.android.voicemail; |
| 18 | |
| 19 | import android.content.Context; |
| 20 | import android.provider.VoicemailContract.Voicemails; |
| 21 | import android.support.annotation.Nullable; |
| 22 | import android.telecom.PhoneAccountHandle; |
| 23 | import android.telephony.TelephonyManager; |
| 24 | import java.util.List; |
| 25 | |
| 26 | /** Public interface for the voicemail module */ |
| 27 | public interface VoicemailClient { |
| 28 | |
| 29 | /** |
| 30 | * Broadcast to tell the client to upload local database changes to the server. Since the dialer |
| 31 | * UI and the client are in the same package, the {@link |
| 32 | * android.content.Intent#ACTION_PROVIDER_CHANGED} will always be a self-change even if the UI is |
| 33 | * external to the client. |
| 34 | */ |
| 35 | String ACTION_UPLOAD = "com.android.voicemailomtp.VoicemailClient.ACTION_UPLOAD"; |
| 36 | |
| 37 | /** |
| 38 | * Appends the selection to ignore voicemails from non-active OMTP voicemail package. In OC there |
| 39 | * can be multiple packages handling OMTP voicemails which represents the same source of truth. |
| 40 | * These packages should mark their voicemails as {@link Voicemails#IS_OMTP_VOICEMAIL} and only |
| 41 | * the voicemails from {@link TelephonyManager#getVisualVoicemailPackageName()} should be shown. |
| 42 | * For example, the user synced voicemails with DialerA, and then switched to DialerB, voicemails |
| 43 | * from DialerA should be ignored as they are no longer current. Voicemails from {@link |
| 44 | * #OMTP_VOICEMAIL_BLACKLIST} will also be ignored as they are voicemail source only valid pre-OC. |
| 45 | */ |
| 46 | void appendOmtpVoicemailSelectionClause( |
| 47 | Context context, StringBuilder where, List<String> selectionArgs); |
| 48 | /** |
| 49 | * @return the class name of the {@link android.preference.PreferenceFragment} for voicemail |
| 50 | * settings, or {@code null} if dialer cannot control voicemail settings. Always return {@code |
| 51 | * null} before OC. |
| 52 | */ |
| 53 | @Nullable |
| 54 | String getSettingsFragment(); |
| 55 | |
| 56 | boolean isVoicemailArchiveEnabled(Context context, PhoneAccountHandle phoneAccountHandle); |
| 57 | |
| 58 | void setVoicemailArchiveEnabled( |
| 59 | Context context, PhoneAccountHandle phoneAccountHandle, boolean value); |
| 60 | } |