Hide the home/up arrow in the voicemail pref screen.
The behavior doesn't work because of a more underlying problem in the
with roots in the dialog component, so hiding the arrow for L. Not
ideal, but figuring it's better than a back arrow which does nothing.
Bug: 17650972
Change-Id: Ic51795b3231f93bed175a1dcbf19eaf6c6ff3fa5
diff --git a/src/com/android/phone/CallFeaturesSetting.java b/src/com/android/phone/CallFeaturesSetting.java
index a4ec5c8..b85cb7e 100644
--- a/src/com/android/phone/CallFeaturesSetting.java
+++ b/src/com/android/phone/CallFeaturesSetting.java
@@ -155,6 +155,7 @@
// String keys for preference lookup
// TODO: Naming these "BUTTON_*" is confusing since they're not actually buttons(!)
+ private static final String VOICEMAIL_SETTING_SCREEN_PREF_KEY = "button_voicemail_category_key";
private static final String BUTTON_VOICEMAIL_KEY = "button_voicemail_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";
@@ -251,6 +252,7 @@
private ListPreference mButtonTTY;
private Preference mPhoneAccountSettingsPreference;
private ListPreference mVoicemailProviders;
+ private PreferenceScreen mVoicemailSettingsScreen;
private PreferenceScreen mVoicemailSettings;
private Preference mVoicemailNotificationRingtone;
private CheckBoxPreference mVoicemailNotificationVibrate;
@@ -483,6 +485,7 @@
mAudioManager.setParameter(HAC_KEY, hac != 0 ? HAC_VAL_ON : HAC_VAL_OFF);
return true;
} else if (preference == mVoicemailSettings) {
+ mVoicemailSettings.getDialog().getActionBar().setDisplayHomeAsUpEnabled(false);
if (DBG) log("onPreferenceTreeClick: Voicemail Settings Preference is clicked.");
if (preference.getIntent() != null) {
if (DBG) {
@@ -507,6 +510,9 @@
// This should let the preference use default behavior in the xml.
return false;
}
+ } else if (preference == mVoicemailSettingsScreen) {
+ mVoicemailSettingsScreen.getDialog().getActionBar().setDisplayHomeAsUpEnabled(false);
+ return false;
}
return false;
}
@@ -1550,6 +1556,8 @@
if (mVoicemailProviders != null) {
mVoicemailProviders.setOnPreferenceChangeListener(this);
+ mVoicemailSettingsScreen =
+ (PreferenceScreen) findPreference(VOICEMAIL_SETTING_SCREEN_PREF_KEY);
mVoicemailSettings = (PreferenceScreen)findPreference(BUTTON_VOICEMAIL_SETTING_KEY);
mVoicemailNotificationRingtone =
findPreference(BUTTON_VOICEMAIL_NOTIFICATION_RINGTONE_KEY);
@@ -2026,7 +2034,6 @@
}
return super.onOptionsItemSelected(item);
}
-
/**
* Finish current Activity and go up to the top level Settings ({@link CallFeaturesSetting}).
* This is useful for implementing "HomeAsUp" capability for second-level Settings.