From 00678d104661ce736bce72e02113ff549d763796 Mon Sep 17 00:00:00 2001 From: Kenny Root Date: Sat, 13 Jun 2009 12:28:27 +0000 Subject: Make sure we can go back to automatic rotation mode without side-effects git-svn-id: https://connectbot.googlecode.com/svn/trunk/connectbot@290 df292f66-193f-0410-a5fc-6d59da041ff2 --- src/org/connectbot/ConsoleActivity.java | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/org/connectbot/ConsoleActivity.java b/src/org/connectbot/ConsoleActivity.java index e502f23..dae0c52 100644 --- a/src/org/connectbot/ConsoleActivity.java +++ b/src/org/connectbot/ConsoleActivity.java @@ -105,8 +105,6 @@ public class ConsoleActivity extends Activity { protected TerminalBridge copySource = null; private int lastTouchRow, lastTouchCol; - private boolean forcedOrientation = false; - private ServiceConnection connection = new ServiceConnection() { public void onServiceConnected(ComponentName className, IBinder service) { bound = ((TerminalManager.TerminalBinder) service).getService(); @@ -558,13 +556,12 @@ public class ConsoleActivity extends Activity { rotate = rotateDefault; // request a forced orientation if requested by user - if (PreferenceConstants.ROTATION_LANDSCAPE.equals(rotate)) { + if (PreferenceConstants.ROTATION_LANDSCAPE.equals(rotate)) setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE); - forcedOrientation = true; - } else if (PreferenceConstants.ROTATION_PORTRAIT.equals(rotate)) { + else if (PreferenceConstants.ROTATION_PORTRAIT.equals(rotate)) setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); - forcedOrientation = true; - } + else + setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED); } @@ -884,7 +881,7 @@ public class ConsoleActivity extends Activity { super.onConfigurationChanged(newConfig); Log.d(TAG, String.format("onConfigurationChanged; requestedOrientation=%d, newConfig.orientation=%d", getRequestedOrientation(), newConfig.orientation)); - if (forcedOrientation && bound != null) { + if (bound != null) { if ((newConfig.orientation != Configuration.ORIENTATION_LANDSCAPE && getRequestedOrientation() == ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE) || (newConfig.orientation != Configuration.ORIENTATION_PORTRAIT && -- cgit v1.2.3