diff options
author | Treehugger Robot <treehugger-gerrit@google.com> | 2018-05-21 23:59:04 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2018-05-21 23:59:04 +0000 |
commit | 0b3147aa505c524fd393920758bd1a7b0aff573f (patch) | |
tree | 54fc635c82ff6fb2b127c0eb4f672a3e2f99d956 /java/com/android/dialer/voicemail/listui/error/VoicemailStatus.java | |
parent | 992ade71deb950dc70b197409829c0403562c237 (diff) | |
parent | 0a41f3c3f1cefcd71cbdd79299fba3482e23a5e2 (diff) |
Merge changes Ifedddd2b,Iaeeae900,I1f8348fb,Iff042966
* changes:
Check for WRITE_CALL_LOG permission in CallLogNotificationsQueryHelper.
Ignore dialer OMTP VVM error if VVM is disabled
Bump version codes and name to v22
Adds alternative spam words for non-english speaking countries.
Diffstat (limited to 'java/com/android/dialer/voicemail/listui/error/VoicemailStatus.java')
-rw-r--r-- | java/com/android/dialer/voicemail/listui/error/VoicemailStatus.java | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/java/com/android/dialer/voicemail/listui/error/VoicemailStatus.java b/java/com/android/dialer/voicemail/listui/error/VoicemailStatus.java index 4f4dbbbe8..ebda0e658 100644 --- a/java/com/android/dialer/voicemail/listui/error/VoicemailStatus.java +++ b/java/com/android/dialer/voicemail/listui/error/VoicemailStatus.java @@ -34,6 +34,8 @@ import android.telephony.TelephonyManager; import android.text.TextUtils; import com.android.dialer.common.LogUtil; import com.android.dialer.voicemailstatus.VoicemailStatusQuery; +import com.android.voicemail.VoicemailClient; +import com.android.voicemail.VoicemailComponent; /** Structured data from {@link android.provider.VoicemailContract.Status} */ public class VoicemailStatus { @@ -232,7 +234,22 @@ public class VoicemailStatus { } } - public boolean isActive() { + public boolean isActive(Context context) { + VoicemailClient voicemailClient = VoicemailComponent.get(context).getVoicemailClient(); + if (context.getPackageName().equals(sourcePackage)) { + if (!voicemailClient.isVoicemailModuleEnabled()) { + LogUtil.i("VoicemailStatus.isActive", "module disabled"); + return false; + } + if (!voicemailClient.hasCarrierSupport(context, getPhoneAccountHandle())) { + LogUtil.i("VoicemailStatus.isActive", "carrier not supported"); + return false; + } + if (!voicemailClient.isVoicemailEnabled(context, getPhoneAccountHandle())) { + LogUtil.i("VoicemailStatus.isActive", "VVM disabled"); + return false; + } + } switch (configurationState) { case Status.CONFIGURATION_STATE_NOT_CONFIGURED: case Status.CONFIGURATION_STATE_DISABLED: |