Somehow InputMethodManager#peekInstance() has not been thread-safe.
Although we basically do not care this deprecated method, but let's
just update it for consistency.
Bug: 115891476
Test: atest CtsInputMethodTestCases CtsInputMethodServiceHostTestCases
Change-Id: I56bf05f76a7939f004efefdd956776e533bae058
Some parts of WM init assume that display with id 0 will be added
before all other displays. This CL traverses the displays from DM
from the beginning of the list, which will provide increasing
display ids.
Bug: 74446287
Test: Boot bat_land with 2 displays attached
Change-Id: Ie46954cc9f20a29f30c5f45fb6aabf46eba63fa8
PagedTileLayout respects MeasureSpec mode for height to decide on how many
rows to show. TilePage and PagedTileLayout only show as many rows as
they can up to the height of the screen. TileLayout can calculate the
maximum number of rows given a height limit.
Fixes: 113082314
Test: Visual, atest
Change-Id: I2860d71c9aeb2a8ac62fcdbc71a3041a91605bcb
This is the last step to remove the dependency on IInputMethodClient
from WindowManagerService.
With my previous CL [1], now WindowManagerService (WMS) depends on
IInputMethodClient just because it implements lifecycle management of
IInputMethodClient on behalf of InputMethodManagerService (IMMS).
This CL mechanically moves that responsibility from WMS to IMMS for
better separation of concerns. It is a bit ironic that this CL is
partly undoing my previous CLs [2][3] that removed
IInputMethodManager.addClient() though.
This CL aims to preserve the current observable behavior (e.g. when
InputMethodManager instance is being created) as much as possible.
Most likely there would be no observable behavior difference when seen
from other components.
[1]: I444077b1e4af4033f67ab72c181fac85b601e08a
41f89c3bcc
[2]: I453200fd5847e9a78876affb6a1caec221525e1d
e24ed79edb
[3]: Id91dd600120e4981aa1d9005ce644728968430c9
fffc0e53c6
Fix: 115993358
Test: atest CtsInputMethodTestCases CtsInputMethodServiceHostTestCases
Change-Id: I7726c70613ea72d6e78fa5754e9fc840f0a40f11
This is a mechanical refactoring, which should have no observable
behavior difference at this moment.
We need this refactoring because InputMethodManager#getInstance() does
not work well on multi-display scenarios.
Bug: 115891476
Test: Manually made sure that IME still works on inline-reply
Change-Id: I266c17187c7faab4d436e19a4db7595cab4244ac
This is a follow up of I2d9641c68148
Bug: 113800711
Test: tradefed.sh run commandAndExit FrameworksServicesTests \
--include-filter com.android.server.wm \
--include-annotation android.platform.test.annotations.Presubmit \
--exclude-annotation androidx.test.filters.FlakyTest
Change-Id: I7fa4d2cb70594431574d44d886352a2e81d8e51e
Prior to this change, we were comparing the package name of the
conflicting component with the soon-to-be installed
PackageParser.Package package name using object equality, as used
elsewhere in packagemanager components. However, ComponentName.mPackage
does not use an interned string for performance reasons, so we need to
use .equals here.
Change-Id: Ibfed7cd47f18d06b2f65c6d8f6c46b752859375c
Fixes: 115956948
Bug: 109941548
Test: run pts -m PtsTimeZoneTestCases passes
InputMethodManager#sInstance is a long live static object so we have to
set its field with right value, otherwise any object referenced by it
cannot be gc including potential activity context.
Now InputMethodManager#mCurRootView is set to null in
InputMethodManager#onPreWindowFocus which is invoked when app's
ViewRootImpl received ViewRootImpl#W#windowfocusChanged from WMS.
However, in the ViewRootImpl#W#windowfocusChanged, mViewAncestor is a
weak reference which get() may returns null sometimes.
One scenario is the ViewRootImpl#W#windowfocusChanged is called after
ActivityThread#handleDestroyActivity. The activity is destroyed and its
ViewRootImpl get GC'd. Then InputMethodManager#onPreWindowFocus won't
get called and InputMethodManager#mCurRootView won't be set to null.
And it is a proper time to set InputMethodManager#mCurRootView to null
when the window it served dismissed.
Fix: 116078227
Test: Break at ActivityThread#handleDestroyActivity and ViewRootImpl#W#windowfocusChanged
Change-Id: I8fabb30f14bcb2cd7019e29b6642b4562d49d248
Signed-off-by: daqi <daqi@xiaomi.com>