diff options
author | Mitsuru Oshima <oshima@google.com> | 2009-07-19 21:14:56 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2009-07-19 21:14:56 -0700 |
commit | a065b01904d5017232c9b51ccb174412ff57e138 (patch) | |
tree | 35e9fc7aaf8a0149374c5c3260106828b1991824 /core | |
parent | bec99bffeecacb1af603966391014895f9a16025 (diff) | |
parent | 841f13c8e9ff3f7695b6c18a8abcec3c947983ff (diff) | |
download | frameworks_base-a065b01904d5017232c9b51ccb174412ff57e138.zip frameworks_base-a065b01904d5017232c9b51ccb174412ff57e138.tar.gz frameworks_base-a065b01904d5017232c9b51ccb174412ff57e138.tar.bz2 |
am 841f13c8: * Reverted the change in PackageParser that I checked by accident * More surface view fix. - correct event translation on surface view. - use compatible window * removed FLAG_NO_COMPATIBILITY_SCALE. It was my misunderstanding of how SurfaceView works,
Merge commit '841f13c8e9ff3f7695b6c18a8abcec3c947983ff'
* commit '841f13c8e9ff3f7695b6c18a8abcec3c947983ff':
* Reverted the change in PackageParser that I checked by accident
Diffstat (limited to 'core')
-rw-r--r-- | core/java/android/content/pm/PackageParser.java | 2 | ||||
-rw-r--r-- | core/java/android/content/res/CompatibilityInfo.java | 3 | ||||
-rw-r--r-- | core/java/android/view/SurfaceView.java | 9 | ||||
-rw-r--r-- | core/java/android/view/WindowManager.java | 9 |
4 files changed, 9 insertions, 14 deletions
diff --git a/core/java/android/content/pm/PackageParser.java b/core/java/android/content/pm/PackageParser.java index 903f482..cebb696 100644 --- a/core/java/android/content/pm/PackageParser.java +++ b/core/java/android/content/pm/PackageParser.java @@ -979,12 +979,12 @@ public class PackageParser { /** * TODO: enable this before code freeze. b/1967935 * * - */ if ((densities == null || densities.length == 0) && (pkg.applicationInfo.targetSdkVersion >= android.os.Build.VERSION_CODES.CUR_DEVELOPMENT)) { pkg.supportsDensities = ApplicationInfo.ANY_DENSITIES_ARRAY; } + */ return pkg; } diff --git a/core/java/android/content/res/CompatibilityInfo.java b/core/java/android/content/res/CompatibilityInfo.java index 25e7a68..6e34cc8 100644 --- a/core/java/android/content/res/CompatibilityInfo.java +++ b/core/java/android/content/res/CompatibilityInfo.java @@ -224,8 +224,7 @@ public class CompatibilityInfo { if (DBG) Log.d(TAG, "no translation required"); return null; } - if (!isScalingRequired() || - (params.flags & WindowManager.LayoutParams.FLAG_NO_COMPATIBILITY_SCALING) != 0) { + if (!isScalingRequired()) { return null; } return new Translator(); diff --git a/core/java/android/view/SurfaceView.java b/core/java/android/view/SurfaceView.java index 187767b..25bbb6a 100644 --- a/core/java/android/view/SurfaceView.java +++ b/core/java/android/view/SurfaceView.java @@ -258,7 +258,7 @@ public class SurfaceView extends View { // scales the event back to the pre-scaled coordinates for such surface. if (mScaled) { MotionEvent scaledBack = MotionEvent.obtain(event); - scaledBack.scale(mTranslator.applicationScale); + mTranslator.translateEventInScreenToAppWindow(event); try { return super.dispatchTouchEvent(scaledBack); } finally { @@ -297,7 +297,8 @@ public class SurfaceView extends View { if (!mHaveFrame) { return; } - mTranslator = ((ViewRoot)getRootView().getParent()).mTranslator; + ViewRoot viewRoot = (ViewRoot) getRootView().getParent(); + mTranslator = viewRoot.mTranslator; float appScale = mTranslator == null ? 1.0f : mTranslator.applicationScale; @@ -357,8 +358,10 @@ public class SurfaceView extends View { | WindowManager.LayoutParams.FLAG_SCALED | WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE | WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE - | WindowManager.LayoutParams.FLAG_NO_COMPATIBILITY_SCALING ; + if (!getContext().getResources().getCompatibilityInfo().supportsScreen()) { + mLayout.flags |= WindowManager.LayoutParams.FLAG_COMPATIBLE_WINDOW; + } mLayout.memoryType = mRequestedType; diff --git a/core/java/android/view/WindowManager.java b/core/java/android/view/WindowManager.java index ba3bfa7..6a26a31 100644 --- a/core/java/android/view/WindowManager.java +++ b/core/java/android/view/WindowManager.java @@ -483,19 +483,12 @@ public interface WindowManager extends ViewManager { * {@hide} */ public static final int FLAG_SHOW_WHEN_LOCKED = 0x00080000; - /** Window flag: special flag to let a window ignore the compatibility scaling. - * This is used by SurfaceView to pass this info into ViewRoot, and not used - * by WindowManager. - * - * {@hide} */ - public static final int FLAG_NO_COMPATIBILITY_SCALING = 0x00100000; - /** Window flag: special flag to limit the size of the window to be * original size ([320x480] x density). Used to create window for applications * running under compatibility mode. * * {@hide} */ - public static final int FLAG_COMPATIBLE_WINDOW = 0x00200000; + public static final int FLAG_COMPATIBLE_WINDOW = 0x00100000; /** Window flag: a special option intended for system dialogs. When * this flag is set, the window will demand focus unconditionally when |