summaryrefslogtreecommitdiffstats
path: root/policy
diff options
context:
space:
mode:
authorDianne Hackborn <hackbod@google.com>2011-06-02 09:20:52 -0700
committerDianne Hackborn <hackbod@google.com>2011-06-02 09:20:52 -0700
commited60f81940c5f2125518c7c31ad4f61b8a9baf3e (patch)
tree59c083e4c28f202179b41cfb350a2c68c43ad0d3 /policy
parentc49b870adf26cd0ca6c0c562fe544b27d6ca312e (diff)
parent76450622f08b1d0d09df7f1ad8e52afe01090770 (diff)
downloadframeworks_base-ed60f81940c5f2125518c7c31ad4f61b8a9baf3e.zip
frameworks_base-ed60f81940c5f2125518c7c31ad4f61b8a9baf3e.tar.gz
frameworks_base-ed60f81940c5f2125518c7c31ad4f61b8a9baf3e.tar.bz2
resolved conflicts for merge of 76450622 to master
Change-Id: I26ccd8f264e65f100d894f43cf597a781552db83
Diffstat (limited to 'policy')
-rwxr-xr-xpolicy/src/com/android/internal/policy/impl/PhoneWindowManager.java29
1 files changed, 19 insertions, 10 deletions
diff --git a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
index e48dbe9..6eaba21 100755
--- a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
+++ b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
@@ -56,6 +56,7 @@ import com.android.internal.telephony.ITelephony;
import com.android.internal.view.BaseInputHandler;
import com.android.internal.widget.PointerLocationView;
+import android.util.DisplayMetrics;
import android.util.EventLog;
import android.util.Log;
import android.util.Slog;
@@ -745,15 +746,14 @@ public class PhoneWindowManager implements WindowManagerPolicy {
mSafeModeEnabledVibePattern = getLongIntArray(mContext.getResources(),
com.android.internal.R.array.config_safeModeEnabledVibePattern);
- // Note: the Configuration is not stable here, so we cannot load mStatusBarCanHide from
- // config_statusBarCanHide because the latter depends on the screen size
-
// Controls rotation and the like.
initializeHdmiState();
}
public void setInitialDisplaySize(int width, int height) {
+ int shortSize;
if (width > height) {
+ shortSize = height;
mLandscapeRotation = Surface.ROTATION_0;
mSeascapeRotation = Surface.ROTATION_180;
if (mContext.getResources().getBoolean(
@@ -765,6 +765,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
mUpsideDownRotation = Surface.ROTATION_90;
}
} else {
+ shortSize = width;
mPortraitRotation = Surface.ROTATION_0;
mUpsideDownRotation = Surface.ROTATION_180;
if (mContext.getResources().getBoolean(
@@ -776,6 +777,17 @@ public class PhoneWindowManager implements WindowManagerPolicy {
mSeascapeRotation = Surface.ROTATION_270;
}
}
+
+ // Determine whether the status bar can hide based on the size
+ // of the screen. We assume sizes > 600dp are tablets where we
+ // will use the system bar.
+ int shortSizeDp = (shortSize*DisplayMetrics.DENSITY_DEVICE)
+ / DisplayMetrics.DENSITY_DEFAULT;
+ mStatusBarCanHide = shortSizeDp < 600;
+ mStatusBarHeight = mContext.getResources().getDimensionPixelSize(
+ mStatusBarCanHide
+ ? com.android.internal.R.dimen.status_bar_height
+ : com.android.internal.R.dimen.system_bar_height);
}
public void updateSettings() {
@@ -1083,6 +1095,10 @@ public class PhoneWindowManager implements WindowManagerPolicy {
return STATUS_BAR_LAYER;
}
+ public boolean canStatusBarHide() {
+ return mStatusBarCanHide;
+ }
+
public int getNonDecorDisplayWidth(int rotation, int fullWidth) {
return fullWidth;
}
@@ -1244,13 +1260,6 @@ public class PhoneWindowManager implements WindowManagerPolicy {
return WindowManagerImpl.ADD_MULTIPLE_SINGLETON;
}
mStatusBar = win;
-
- // The Configuration will be stable by now, so we can load this
- mStatusBarCanHide = mContext.getResources().getBoolean(
- com.android.internal.R.bool.config_statusBarCanHide);
- mStatusBarHeight = mContext.getResources().getDimensionPixelSize(
- com.android.internal.R.dimen.status_bar_height);
-
break;
case TYPE_NAVIGATION_BAR:
mContext.enforceCallingOrSelfPermission(