Skip to content
Browse files

Phone mods

Landscape in call && Exit to home

Patch2 : Cleanup
patch3 : Whitespace cleanup - removed references to preferences
	that were not needed/used/

Change-Id: I1eb5904b9c5f0a252d9e1a935dc21668361cedb6
Signed-off-by: Zaphod <mwilson@acesappraisal.com>
  • Loading branch information...
1 parent 67596b6 commit 61c4a0b851b06d7507cf53cf7edd3a0001e59832 @Zaphod-Beeblebrox Zaphod-Beeblebrox committed with Zaphod-Beeblebrox Jan 27, 2012
View
2 AndroidManifest.xml 100644 → 100755
@@ -244,7 +244,7 @@
android:label="@string/phoneIconLabel"
android:excludeFromRecents="true"
android:launchMode="singleInstance"
- android:screenOrientation="nosensor"
+ android:screenOrientation="sensor"
android:configChanges="keyboardHidden"
android:exported="false">
</activity>
View
4 res/values/strings.xml
@@ -652,6 +652,10 @@
<string name="tty_mode_option_summary">Set TTY mode</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 Last Activity on End Call</string>
+ <string name="exit_to_home_screen_summary">Exit to Previous activity screen on End Call rather than going to Call Log</string>
+ <string name="landscape_mode_title">Enable Landscape</string>
+ <string name="landscape_mode_summary">Enable Landscape Mode (if sensor enabled)</string>
<!-- FDN list screen: menu item label -->
<string name="menu_add">Add contact</string>
View
12 res/xml/call_feature_setting.xml 100644 → 100755
@@ -145,6 +145,18 @@
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"/>
+
+ <CheckBoxPreference
+ android:key="button_landscape_key"
+ android:title="@string/landscape_mode_title"
+ android:persistent="true"
+ android:summary="@string/landscape_mode_summary"/>
+
<ListPreference
android:key="button_dtmf_settings"
android:title="@string/dtmf_tones_title"
View
6 src/com/android/phone/CallCard.java
@@ -17,6 +17,7 @@
package com.android.phone;
import android.animation.LayoutTransition;
+import android.content.res.Configuration;
import android.content.ContentUris;
import android.content.Context;
import android.content.Intent;
@@ -332,7 +333,10 @@ private void updateCallInfoLayout(PhoneConstants.State state) {
int reservedVerticalSpace = mInCallScreen.getInCallTouchUi().getTouchUiHeight();
ViewGroup.MarginLayoutParams callInfoLp =
(ViewGroup.MarginLayoutParams) mCallInfoContainer.getLayoutParams();
- callInfoLp.bottomMargin = reservedVerticalSpace; // Equivalent to setting
+ if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE)
+ callInfoLp.rightMargin = reservedVerticalSpace; // set margin on right side if in landscape rather than bottom
+ else
+ callInfoLp.bottomMargin = reservedVerticalSpace; // Equivalent to setting
// android:layout_marginBottom in XML
if (DBG) log(" ==> callInfoLp.bottomMargin: " + reservedVerticalSpace);
mCallInfoContainer.setLayoutParams(callInfoLp);
View
0 src/com/android/phone/CallFeaturesSetting.java 100644 → 100755
File mode changed.
View
35 src/com/android/phone/InCallScreen.java
@@ -33,6 +33,7 @@
import android.content.DialogInterface.OnCancelListener;
import android.content.Intent;
import android.content.IntentFilter;
+import android.content.pm.ActivityInfo;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.graphics.Typeface;
@@ -74,6 +75,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;
@@ -120,6 +124,9 @@
/* 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";
+ private static final String BUTTON_LANDSCAPE_KEY = "button_landscape_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.
@@ -244,6 +251,9 @@
private boolean mIsForegroundActivityForProximity = false;
private PowerManager mPowerManager;
+ public boolean Exit_To_Home_Screen = false;
+ private boolean Enable_Landscape_In_Call = false;
+
// For use with Pause/Wait dialogs
private String mPostDialStrAfterPause;
private boolean mPauseInProgress = false;
@@ -450,6 +460,8 @@ protected void onCreate(Bundle icicle) {
return;
}
+ updateSettings();
+
mApp = PhoneGlobals.getInstance();
mApp.setInCallScreenInstance(this);
@@ -550,6 +562,13 @@ protected void onResume() {
if (DBG) log("onResume()...");
super.onResume();
+ updateSettings();
+
+ if (Enable_Landscape_In_Call) {
+ setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED);
+ } else {
+ setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_NOSENSOR);
+ }
mIsForegroundActivity = true;
mIsForegroundActivityForProximity = true;
@@ -2195,7 +2214,8 @@ private void showPausePromptDialog(final Connection c, String postDialStrAfterPa
private View createWildPromptView() {
LinearLayout result = new LinearLayout(this);
- result.setOrientation(LinearLayout.VERTICAL);
+ //result.setOrientation(LinearLayout.VERTICAL);
+ // Let the Manfiest determine Layout.
result.setPadding(5, 5, 5, 5);
LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(
@@ -2644,7 +2664,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
@@ -2662,8 +2683,8 @@ private void delayedCleanupAfterDisconnect() {
// stay in the activity history.
}
+ endInCallScreenSession();
}
- endInCallScreenSession();
// Reset the call origin when the session ends and this in-call UI is being finished.
mApp.setLatestActiveCallOrigin(null);
@@ -4590,6 +4611,14 @@ 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));
+ Enable_Landscape_In_Call = callsettings.getBoolean(BUTTON_LANDSCAPE_KEY,false);
+
+ }
+
/**
* Requests to remove provider info frame after having
* {@link #PROVIDER_INFO_TIMEOUT}) msec delay.

0 comments on commit 61c4a0b

Please sign in to comment.
Something went wrong with that request. Please try again.