Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Bring back "End call to Home Screen Setting"

Change-Id: Ib2b40e33a4321e26d9b3d7b240ed3b562594eb04
  • Loading branch information...
commit 115b3504f1fd94e909a7be1ae52813fc259611eb 1 parent b4644fd
qnhoang81 authored Gerrit Code Review committed
View
2  res/values/strings.xml
@@ -647,6 +647,8 @@
<string name="ring_delay_summary">Select Ring Delay</string>
<string name="auto_retry_mode_title">Auto-retry</string>
<string name="auto_retry_mode_summary">Enable Auto-retry mode</string>
+ <string name="exit_to_home_screen_title">Exit to Home on End Call</string>
+ <string name="exit_to_home_screen_summary">Exit to Home screen on End Call rather than going to Call Log</string>
<!-- FDN list screen: menu item label -->
<string name="menu_add">Add contact</string>
View
6 res/xml/call_feature_setting.xml
@@ -146,6 +146,12 @@
android:persistent="true"
android:summary="@string/hac_mode_summary"/>
+ <CheckBoxPreference
+ android:key="button_exit_to_home_screen_key"
+ android:title="@string/exit_to_home_screen_title"
+ android:persistent="true"
+ android:summary="@string/exit_to_home_screen_summary"/>
+
<ListPreference
android:key="button_dtmf_settings"
android:title="@string/dtmf_tones_title"
View
4 src/com/android/phone/CallFeaturesSetting.java
@@ -183,6 +183,7 @@
"sip_call_options_wifi_only_key";
private static final String SIP_SETTINGS_CATEGORY_KEY =
"sip_settings_category_key";
+ private static final String BUTTON_EXIT_TO_HOMESCREEN_KEY = "button_exit_to_home_screen_key";
private Intent mContactListIntent;
@@ -266,6 +267,8 @@ public void handleMessage(Message msg) {
private ListPreference mVoicemailNotificationVibrateWhen;
private SipSharedPreferences mSipSharedPreferences;
+ private CheckBoxPreference mButtonExitToHomeScreen;
+
private class VoiceMailProvider {
public VoiceMailProvider(String name, Intent intent) {
this.name = name;
@@ -1520,6 +1523,7 @@ protected void onCreate(Bundle icicle) {
mButtonTTY = (ListPreference) findPreference(BUTTON_TTY_KEY);
mButtonNoiseSuppression = (CheckBoxPreference) findPreference(BUTTON_NOISE_SUPPRESSION_KEY);
mButtonRingDelay = (ListPreference) findPreference(BUTTON_RING_DELAY_KEY);
+ mButtonExitToHomeScreen = (CheckBoxPreference) findPreference(BUTTON_EXIT_TO_HOMESCREEN_KEY);
mVoicemailProviders = (ListPreference) findPreference(BUTTON_VOICEMAIL_PROVIDER_KEY);
if (mVoicemailProviders != null) {
mVoicemailProviders.setOnPreferenceChangeListener(this);
View
21 src/com/android/phone/InCallScreen.java
@@ -71,6 +71,9 @@
import com.android.phone.InCallUiState.InCallScreenMode;
import com.android.phone.OtaUtils.CdmaOtaScreenState;
+import android.preference.PreferenceManager;
+import android.content.SharedPreferences;
+
import java.util.List;
@@ -117,6 +120,8 @@
/* package */ static final String EXTRA_GATEWAY_URI =
"com.android.phone.extra.GATEWAY_URI";
+ private static final String BUTTON_EXIT_TO_HOMESCREEN_KEY = "button_exit_to_home_screen_key";
+
// Amount of time (in msec) that we display the "Call ended" state.
// The "short" value is for calls ended by the local user, and the
// "long" value is for calls ended by the remote caller.
@@ -243,6 +248,8 @@
private boolean mIsForegroundActivityForProximity = false;
private PowerManager mPowerManager;
+ public boolean Exit_To_Home_Screen = false;
+
// For use with Pause/Wait dialogs
private String mPostDialStrAfterPause;
private boolean mPauseInProgress = false;
@@ -458,6 +465,8 @@ protected void onCreate(Bundle icicle) {
return;
}
+ updateSettings();
+
mApp = PhoneApp.getInstance();
mApp.setInCallScreenInstance(this);
@@ -548,6 +557,8 @@ protected void onResume() {
if (DBG) log("onResume()...");
super.onResume();
+ updateSettings();
+
mIsForegroundActivity = true;
mIsForegroundActivityForProximity = true;
@@ -2679,7 +2690,8 @@ private void delayedCleanupAfterDisconnect() {
log("- Show Call Log (or Dialtacts) after disconnect. Current intent: "
+ intent);
}
- try {
+ if (!Exit_To_Home_Screen)
+ try {
startActivity(intent, opts.toBundle());
} catch (ActivityNotFoundException e) {
// Don't crash if there's somehow no "Call log" at
@@ -4624,6 +4636,13 @@ private void log(String msg) {
Log.d(LOG_TAG, msg);
}
+ protected void updateSettings() {
+ SharedPreferences callsettings = PreferenceManager.getDefaultSharedPreferences(this);
+
+ Exit_To_Home_Screen = (callsettings.getBoolean(BUTTON_EXIT_TO_HOMESCREEN_KEY,false));
+
+ }
+
/**
* Requests to remove provider info frame after having
* {@link #PROVIDER_INFO_TIMEOUT}) msec delay.
Please sign in to comment.
Something went wrong with that request. Please try again.