Permalink
Browse files

Phone: Sprint MWI Quirk: Phantom message wait indicator workaround

If true, message wait indicators are hidden by default on this device
unless the user enables it in Call Settings. This quirk is necessary
for the "Phantom Voicemail" issue where notifications that are
impossible to dismiss on the Sprint network. In rare instances, feature
phone voicemail gets stuck in a Sprint account where smart phones are
unable to delete them. Sprint will not help the subscriber fix this,
as their own Android phones ignore message wait indicators.

When you enable 'sprint_mwi_quirk' in overlay/packages/apps/Phone/res/values/config.xml
this option appears in the Phone app:

Settings > Message Wait Indicator

Default is disabled, as Sprint Android phones have no reason to see
message wait indicators. It can however be enabled for Sprint phones
used on overseas carriers where message wait indicators are desired.

Rebased on jellybeans

Change-Id: I36f8d43b5684a6f7337852da0394a21ca92fefbf
  • Loading branch information...
1 parent dd02e31 commit 42992991db6e455d2d5872b7a8e554db4a264b61 nullghost committed with PhantomGamers Jul 31, 2012
View
@@ -118,4 +118,11 @@
<!-- If true, removes the Voice Privacy option from Call Settings -->
<bool name="config_voice_privacy_disable">false</bool>
+
+ <!-- Sprint Message Wait Indicator Quirk
+ If true, message wait indicators are hidden by default on this device
+ unless the user enables it in Call Settings. This quirk is necessary
+ for the "Phantom Voicemail" issue where notifications that are
+ impossible to dismiss on the Sprint network. -->
+ <bool name="sprint_mwi_quirk">false</bool>
</resources>
View
@@ -167,6 +167,10 @@
<string name="settings_label">Network settings</string>
<!-- Call settings screen, setting option name -->
<string name="voicemail">Voicemail</string>
+ <!-- Call settings screen, message wait indicator name -->
+ <string name="mwi_notification_title">Message Wait Indicator</string>
+ <!-- Call settings screen, message wait indicator summary -->
+ <string name="mwi_notification_summary">Show message wait indicator voicemail notifications</string>
<!-- Call forwarding dialog box, voicemail number prefix -->
<string name="voicemail_abbreviated">VM:</string>
<!-- Mobile network settings screen, setting option name -->
@@ -52,6 +52,14 @@
android:key="button_voicemail_category_key"
android:title="@string/voicemail"
android:persistent="false">
+
+ <CheckBoxPreference
+ android:defaultValue="false"
+ android:key="button_mwi_notification_key"
+ android:title="@string/mwi_notification_title"
+ android:persistent="false"
+ android:summary="@string/mwi_notification_summary" />
+
<ListPreference
android:key="button_voicemail_provider_key"
android:title="@string/voicemail_provider"
@@ -48,6 +48,7 @@
import android.preference.ListPreference;
import android.preference.Preference;
import android.preference.PreferenceActivity;
+import android.preference.PreferenceCategory;
import android.preference.PreferenceGroup;
import android.preference.PreferenceScreen;
import android.provider.ContactsContract.CommonDataKinds;
@@ -158,6 +159,8 @@
// String keys for preference lookup
// TODO: Naming these "BUTTON_*" is confusing since they're not actually buttons(!)
private static final String BUTTON_VOICEMAIL_KEY = "button_voicemail_key";
+ private static final String BUTTON_VOICEMAIL_CATEGORY_KEY = "button_voicemail_category_key";
+ private static final String BUTTON_MWI_NOTIFICATION_KEY = "button_mwi_notification_key";
private static final String BUTTON_VOICEMAIL_PROVIDER_KEY = "button_voicemail_provider_key";
private static final String BUTTON_VOICEMAIL_SETTING_KEY = "button_voicemail_setting_key";
/* package */ static final String BUTTON_VOICEMAIL_NOTIFICATION_VIBRATE_WHEN_KEY =
@@ -284,6 +287,7 @@ public void handleMessage(Message msg) {
private ListPreference mButtonRingDelay;
private CheckBoxPreference mButtonNoiseSuppression;
private ListPreference mButtonSipCallOptions;
+ private CheckBoxPreference mMwiNotification;
private ListPreference mVoicemailProviders;
private PreferenceScreen mVoicemailSettings;
private ListPreference mVoicemailNotificationVibrateWhen;
@@ -497,6 +501,11 @@ public boolean onPreferenceTreeClick(PreferenceScreen preferenceScreen, Preferen
} else if (preference == mPlayDtmfTone) {
Settings.System.putInt(getContentResolver(), Settings.System.DTMF_TONE_WHEN_DIALING,
mPlayDtmfTone.isChecked() ? 1 : 0);
+ } else if (preference == mMwiNotification) {
+ int mwi_notification = mMwiNotification.isChecked() ? 1 : 0;
+ Settings.System.putInt(mPhone.getContext().getContentResolver(),
+ Settings.System.ENABLE_MWI_NOTIFICATION, mwi_notification);
+ return true;
} else if (preference == mButtonDTMF) {
return true;
} else if (preference == mButtonTTY) {
@@ -582,6 +591,10 @@ public boolean onPreferenceChange(Preference preference, Object objValue) {
Settings.System.DTMF_TONE_TYPE_WHEN_DIALING, index);
} else if (preference == mButtonTTY) {
handleTTYChange(preference, objValue);
+ } else if (preference == mMwiNotification) {
+ int mwi_notification = mMwiNotification.isChecked() ? 1 : 0;
+ Settings.System.putInt(mPhone.getContext().getContentResolver(),
+ Settings.System.ENABLE_MWI_NOTIFICATION, mwi_notification);
} else if (preference == mVoicemailProviders) {
final String newProviderKey = (String) objValue;
if (DBG) {
@@ -1546,6 +1559,17 @@ protected void onCreate(Bundle icicle) {
mVibrationPreference = findPreference(BUTTON_VIBRATION_KEY);
mVibrateWhenRinging = (CheckBoxPreference) findPreference(BUTTON_VIBRATE_ON_RING);
mPlayDtmfTone = (CheckBoxPreference) findPreference(BUTTON_PLAY_DTMF_TONE);
+ mMwiNotification = (CheckBoxPreference) findPreference(BUTTON_MWI_NOTIFICATION_KEY);
+ if (mMwiNotification != null) {
+ if (getResources().getBoolean(R.bool.sprint_mwi_quirk)) {
+ mMwiNotification.setOnPreferenceChangeListener(this);
+ } else {
+ PreferenceCategory voicemailCategory = (PreferenceCategory) findPreference(BUTTON_VOICEMAIL_CATEGORY_KEY);
+ voicemailCategory.removePreference(mMwiNotification);
+ mMwiNotification = null;
+ }
+ }
+
mButtonDTMF = (ListPreference) findPreference(BUTTON_DTMF_KEY);
mButtonAutoRetry = (CheckBoxPreference) findPreference(BUTTON_RETRY_KEY);
mButtonHAC = (CheckBoxPreference) findPreference(BUTTON_HAC_KEY);
@@ -1785,6 +1809,11 @@ protected void onResume() {
if (mVibrateWhenRinging != null) {
mVibrateWhenRinging.setChecked(getVibrateWhenRinging(this));
}
+ if (mMwiNotification != null) {
+ int mwi_notification = Settings.System.getInt(getContentResolver(), Settings.System.ENABLE_MWI_NOTIFICATION, 0);
+ mMwiNotification.setChecked(mwi_notification != 0);
+
+ }
if (mButtonDTMF != null) {
int dtmf = Settings.System.getInt(getContentResolver(),
@@ -28,6 +28,8 @@
import com.android.internal.telephony.cdma.CdmaInformationRecords.CdmaDisplayInfoRec;
import com.android.internal.telephony.cdma.CdmaInformationRecords.CdmaSignalInfoRec;
import com.android.internal.telephony.cdma.SignalToneUtil;
+import com.android.internal.telephony.CallManager;
+import com.android.phone.CallFeaturesSetting;
import android.app.ActivityManagerNative;
import android.content.ContentResolver;
@@ -1335,6 +1337,15 @@ private void onMwiChanged(boolean visible) {
return;
}
+ boolean notifProp = mApplication.getResources().getBoolean(R.bool.sprint_mwi_quirk);
+ boolean notifOption = Settings.System.getInt(mApplication.getPhone().getContext().getContentResolver(), Settings.System.ENABLE_MWI_NOTIFICATION, 0) == 1;
+ if (notifProp && !notifOption) {
+ // sprint_mwi_quirk is true, and ENABLE_MWI_NOTIFICATION is unchecked or unset (false)
+ // ignore the mwi event, but log if we're debugging.
+ if (VDBG) log("onMwiChanged(): mwi_notification is disabled. Ignoring...");
+ return;
+ }
+
mApplication.notificationMgr.updateMwi(visible);
}

0 comments on commit 4299299

Please sign in to comment.