diff options
author | twyen <twyen@google.com> | 2017-08-01 11:24:45 -0700 |
---|---|---|
committer | Eric Erfanian <erfanian@google.com> | 2017-08-01 15:13:56 -0700 |
commit | 6adbdbe32d0aa6b0d71c2034dda427452c7b0b8b (patch) | |
tree | 803346bb0d681d4f455243c3e5965a5bec394577 /java/com/android/dialer/voicemailstatus/VisualVoicemailEnabledChecker.java | |
parent | d2035dc3bfabc3a885f9d0016a5d5846645dae94 (diff) |
Handle null in voicemail config status
The VVM tab is shown when there are more then one "active" voicemail sources in the voicemail status table. A configuration status of 0 is active, and 1 is inactive. If the configuration state is null, getInt() will return 0 which maps to active, and incorrectly showing the VVM tab.
In this CL, null is checked first. The helper class is also made static.
Bug: 64122858
Test: VoicemailStatusHelperTest
PiperOrigin-RevId: 163858350
Change-Id: I3fca52aaca92492f1969092e2d9f443677cb3b8d
Diffstat (limited to 'java/com/android/dialer/voicemailstatus/VisualVoicemailEnabledChecker.java')
-rw-r--r-- | java/com/android/dialer/voicemailstatus/VisualVoicemailEnabledChecker.java | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/java/com/android/dialer/voicemailstatus/VisualVoicemailEnabledChecker.java b/java/com/android/dialer/voicemailstatus/VisualVoicemailEnabledChecker.java index a1fc29edf..3f519ad82 100644 --- a/java/com/android/dialer/voicemailstatus/VisualVoicemailEnabledChecker.java +++ b/java/com/android/dialer/voicemailstatus/VisualVoicemailEnabledChecker.java @@ -45,7 +45,6 @@ public class VisualVoicemailEnabledChecker implements CallLogQueryHandler.Listen private SharedPreferences mPrefs; private boolean mHasActiveVoicemailProvider; private CallLogQueryHandler mCallLogQueryHandler; - private VoicemailStatusHelper mVoicemailStatusHelper; private Context mContext; private Callback mCallback; @@ -53,7 +52,6 @@ public class VisualVoicemailEnabledChecker implements CallLogQueryHandler.Listen mContext = context; mCallback = callback; mPrefs = PreferenceManager.getDefaultSharedPreferences(mContext); - mVoicemailStatusHelper = new VoicemailStatusHelper(); mHasActiveVoicemailProvider = mPrefs.getBoolean(PREF_KEY_HAS_ACTIVE_VOICEMAIL_PROVIDER, false); } @@ -77,7 +75,7 @@ public class VisualVoicemailEnabledChecker implements CallLogQueryHandler.Listen @Override public void onVoicemailStatusFetched(Cursor statusCursor) { boolean hasActiveVoicemailProvider = - mVoicemailStatusHelper.getNumberActivityVoicemailSources(statusCursor) > 0; + VoicemailStatusHelper.getNumberActivityVoicemailSources(statusCursor) > 0; if (hasActiveVoicemailProvider != mHasActiveVoicemailProvider) { mHasActiveVoicemailProvider = hasActiveVoicemailProvider; mPrefs |