diff options
author | twyen <twyen@google.com> | 2017-07-07 17:14:39 -0700 |
---|---|---|
committer | Eric Erfanian <erfanian@google.com> | 2017-07-10 10:47:41 -0700 |
commit | 7700db2520f995519996ab515658c87353b98804 (patch) | |
tree | a69bf52053493f9802d792567c7b7f9ee641ef72 /java/com | |
parent | 8cf48a5fd9728ba3f3be15a52e2056a6bbcf549b (diff) |
Guard VoicemailClientReceiver when VVM module is disabled
The dialer voicemail UI will send the broadcast even below O.
Ideally all receiver for system and external broadcasts should be moved out of impl/ since they will not be disabled with the module, but at this point changes should be kept at minimal.
Bug: 63437675
Test: VoicemailClientReceiverTest
PiperOrigin-RevId: 161264508
Change-Id: I99476bb27ce3da9396f3b7205c98cb847bfff9b7
Diffstat (limited to 'java/com')
-rw-r--r-- | java/com/android/voicemail/impl/VoicemailClientReceiver.java | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/java/com/android/voicemail/impl/VoicemailClientReceiver.java b/java/com/android/voicemail/impl/VoicemailClientReceiver.java index 49a55a41b..688636e6c 100644 --- a/java/com/android/voicemail/impl/VoicemailClientReceiver.java +++ b/java/com/android/voicemail/impl/VoicemailClientReceiver.java @@ -23,6 +23,7 @@ import android.telecom.PhoneAccountHandle; import com.android.dialer.common.Assert; import com.android.dialer.common.LogUtil; import com.android.voicemail.VoicemailClient; +import com.android.voicemail.VoicemailComponent; import com.android.voicemail.impl.sync.UploadTask; import com.android.voicemail.impl.sync.VvmAccountManager; @@ -31,6 +32,11 @@ public class VoicemailClientReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { + if (!VoicemailComponent.get(context).getVoicemailClient().isVoicemailModuleEnabled()) { + LogUtil.i( + "VoicemailClientReceiver.onReceive", "module disabled, ignoring " + intent.getAction()); + return; + } switch (intent.getAction()) { case VoicemailClient.ACTION_UPLOAD: doUpload(context); |