diff options
author | twyen <twyen@google.com> | 2017-12-14 17:41:53 -0800 |
---|---|---|
committer | Copybara-Service <copybara-piper@google.com> | 2017-12-15 12:12:16 -0800 |
commit | 0f47b8b7b33a39b1bc49ac86b82e3949296ef9f0 (patch) | |
tree | 8b46917b9ae3d5764742976ee6db9f9fbf03ebfa | |
parent | a3a6876eb7bcbce46fcac68051f16ac2b1ee2914 (diff) |
Remove voicemail settings if missing permission
Bug: 70282673
Test: DialerSettingsActivityTest
PiperOrigin-RevId: 179124385
Change-Id: I9a7f8edc4ae8df44891f551a8aa561bd81922f66
-rw-r--r-- | java/com/android/dialer/app/settings/DialerSettingsActivity.java | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/java/com/android/dialer/app/settings/DialerSettingsActivity.java b/java/com/android/dialer/app/settings/DialerSettingsActivity.java index 641095512..fc56fa7e0 100644 --- a/java/com/android/dialer/app/settings/DialerSettingsActivity.java +++ b/java/com/android/dialer/app/settings/DialerSettingsActivity.java @@ -40,6 +40,7 @@ import com.android.dialer.common.LogUtil; import com.android.dialer.compat.telephony.TelephonyManagerCompat; import com.android.dialer.configprovider.ConfigProviderBindings; import com.android.dialer.proguard.UsedByReflection; +import com.android.dialer.util.PermissionsUtil; import com.android.dialer.voicemail.settings.VoicemailSettingsFragment; import com.android.voicemail.VoicemailClient; import java.util.List; @@ -194,6 +195,11 @@ public class DialerSettingsActivity extends AppCompatPreferenceActivity { return; } + if (!PermissionsUtil.hasReadPhoneStatePermissions(this)) { + LogUtil.i("DialerSettingsActivity.addVoicemailSettings", "Missing READ_PHONE_STATE"); + return; + } + LogUtil.i("DialerSettingsActivity.addVoicemailSettings", "adding voicemail settings"); Header voicemailSettings = new Header(); voicemailSettings.titleRes = R.string.voicemail_settings_label; |