Loading src/com/android/dialer/dialpad/DialpadFragment.java +33 −11 Original line number Diff line number Diff line Loading @@ -1724,11 +1724,15 @@ public class DialpadFragment extends Fragment * @see MSimTelephonyManager#getVoiceMailNumber() */ private boolean isVoicemailAvailable() { boolean promptEnabled = Settings.Global.getInt(getActivity().getContentResolver(), Settings.Global.MULTI_SIM_VOICE_PROMPT, 0) == 1; Log.d(TAG, "prompt enabled : "+ promptEnabled); if (promptEnabled) { return hasVMNumber(); } else { try { if (MSimTelephonyManager.getDefault().isMultiSimEnabled()) { mSubscription = MSimTelephonyManager.getDefault().getPreferredVoiceSubscription(); Log.d(TAG, "Voicemail preferred sub id = "+ mSubscription); if (MSimTelephonyManager.getDefault().isMultiSimEnabled()) { return (MSimTelephonyManager.getDefault(). getVoiceMailNumber(mSubscription) != null); } else { Loading @@ -1738,9 +1742,27 @@ public class DialpadFragment extends Fragment // Possibly no READ_PHONE_STATE privilege. Log.e(TAG, "SecurityException is thrown. Maybe privilege isn't sufficient."); } } return false; } private boolean hasVMNumber() { boolean hasVMNum = false; int phoneCount = MSimTelephonyManager.getDefault().getPhoneCount(); for (int i = 0; i < phoneCount; i++) { try { hasVMNum = MSimTelephonyManager.getDefault().getVoiceMailNumber(i) != null; } catch (SecurityException se) { // Possibly no READ_PHONE_STATE privilege. Log.e(TAG, "SecurityException is thrown. Maybe privilege isn't sufficient."); } if (hasVMNum) { break; } } return hasVMNum; } /** * Returns true of the newDigit parameter can be added at the current selection * point, otherwise returns false. Loading Loading
src/com/android/dialer/dialpad/DialpadFragment.java +33 −11 Original line number Diff line number Diff line Loading @@ -1724,11 +1724,15 @@ public class DialpadFragment extends Fragment * @see MSimTelephonyManager#getVoiceMailNumber() */ private boolean isVoicemailAvailable() { boolean promptEnabled = Settings.Global.getInt(getActivity().getContentResolver(), Settings.Global.MULTI_SIM_VOICE_PROMPT, 0) == 1; Log.d(TAG, "prompt enabled : "+ promptEnabled); if (promptEnabled) { return hasVMNumber(); } else { try { if (MSimTelephonyManager.getDefault().isMultiSimEnabled()) { mSubscription = MSimTelephonyManager.getDefault().getPreferredVoiceSubscription(); Log.d(TAG, "Voicemail preferred sub id = "+ mSubscription); if (MSimTelephonyManager.getDefault().isMultiSimEnabled()) { return (MSimTelephonyManager.getDefault(). getVoiceMailNumber(mSubscription) != null); } else { Loading @@ -1738,9 +1742,27 @@ public class DialpadFragment extends Fragment // Possibly no READ_PHONE_STATE privilege. Log.e(TAG, "SecurityException is thrown. Maybe privilege isn't sufficient."); } } return false; } private boolean hasVMNumber() { boolean hasVMNum = false; int phoneCount = MSimTelephonyManager.getDefault().getPhoneCount(); for (int i = 0; i < phoneCount; i++) { try { hasVMNum = MSimTelephonyManager.getDefault().getVoiceMailNumber(i) != null; } catch (SecurityException se) { // Possibly no READ_PHONE_STATE privilege. Log.e(TAG, "SecurityException is thrown. Maybe privilege isn't sufficient."); } if (hasVMNum) { break; } } return hasVMNum; } /** * Returns true of the newDigit parameter can be added at the current selection * point, otherwise returns false. Loading