OSDN Git Service

Fix Configuration layout direction comparison.
authorCraig Mautner <cmautner@google.com>
Tue, 13 Aug 2013 00:56:34 +0000 (17:56 -0700)
committerCraig Mautner <cmautner@google.com>
Tue, 13 Aug 2013 16:23:13 +0000 (09:23 -0700)
commit31678b52e4b65e8e4d22ef5dced713424e5deada
tree02e43104c91edccfa6b7139f4fb40b651842dd1a
parent890db42b0d4873bf3a19cd784bb7497db2add22e
Fix Configuration layout direction comparison.

If the Configuration layout direction is not changing don't indicate
that it has changed. When the indication is made incorrectly it
causes the window manager to believe that the configuration has
changed and it will start freezing the screen and setting up
animations. Bad jank is the result.

In Configuration.updateFrom() anytime that the screenLayouts were
different the code was setting ActivityInfo.CONFIG_LAYOUT_DIRECTION
in the return bitmask. Even if the only difference was between
UNDEFINED fields. This fix makes sure that the layout direction
field has actually changed before setting
ActivityInfo.CONFIG_LAYOUT_DIRECTION in the return bitmask.

In Configuration.diff() if the passed Configuration had
SCREENLAYOUT_LAYOUTDIR_UNDEFINED the code was setting
ActivityInfo.CONFIG_LAYOUT_DIRECTION in the return bitmask. This fix
makes sure that if the passed Configuration has fields set to
SCREENLAYOUT_*_UNDEFINED then corresponding bits will no longer be set
in the returned bitmask.

Fixes bug 10291622.
Fixes bug 10247094.

Change-Id: If26de662206fe85dc4671adbae39dfb99dc1038c
core/java/android/content/res/Configuration.java