Benchmarks on bullhead-userdebug show that there is a negligent
performance impact when using sparse entries on a 30% loaded
sparse type of 1000 resources.
Benchmark Time CPU Iterations
-----------------------------------------------------------------------------------
BM_SparseEntryGetResourceSparseLarge 255 ns 254 ns 2751408
BM_SparseEntryGetResourceNotSparseLarge 254 ns 254 ns 2756534
Bug: 27381711
Test: make libandroidfw_tests aapt2_tests
Change-Id: I051ea22f2f6b2bc3696e446adc9e2a34be18009f
Return null instead of triggering a NPE when there are no resource of
the asked type.
Test: RenderTests.testFonts
Change-Id: Ib45ebdf2178e62cbd987082512fcbb009de3f1b2
The class loader in Resources is now used to inflate drawables. Because
layoutlib was using the system class loader, the drawables would fail to
inflate.
With this change, Resources will use the layoutlib class loader instead
of the system one.
Test: Tested from the studio side
Change-Id: I933ff68e704f9d3599b69cd74e98e44bdca3c789
After any package install, removal or update, save the changed
package and update a global sequence number. At any point, apps
can query for the packages changed since a particular sequence
number.
If a package is changed multiple times, it is only included once
in the change list.
Bug: 33865505
Test: Create sample app to query for changes and see which packages are changed after performing certain operations
Change-Id: Ia4646035362b16a97110e05f3f909ce385b48428
This is part of work to introduce historical debugging infrastructure
for Android IME.
In this CL, we will focus on the following two event flows.
A1. IMMS#attachNewInputLocked() queues MSG_(RE)START_INPUT to deliver
new InputConnection/EditorInfo to the current IME
A2. The IME triggers IMS#onStartInput()/IMS#onRestartInput() and
updates the following fields:
- InputMethodService#mStartedInputConnection
- InputMethodService#mInputEditorInfo
B1. IME is expected to call back IMM#setImeWindowStatus() to notify
its window visibility change to IMMS.
B2. IMMS updates the following field if the caller is still the
current IME.
- InputMethodManagerService#mImeWindowVis
What this CL aims to do is to enable IMMS to access A1 state when it
was in B2 state, by considering that for given a B1 the last A2
happened before B1 is the cause of B1 and B2.
To do this, IMMS issues a binder token in A1 and each IME keeps it
so that it can be passed in B1. By using this Binder token as a key,
IMMS can keep tracking state snapshot taken from each A1. Note that
those state snapshots keep alive until the Binder token's proxy in the
IME process loses strong reference from its GC root.
Test: Make sure `adb shell dumpsys input_method | grep mImeWindowVis`
matches to the IME window visibility.
Test: Make sure the current IME is not receiving any
InvalidParameterException from IMMS.
Bug: 35079353
Change-Id: I9921b381e02106dbffff5e0b3d13f0a1245ce807
Reverse the logic since the field wouldn't be initialized to true before
super is called.
Test: Layoutlib tests
Change-Id: Ic3affb608bdf3306ada25e2dd986a48f6caae202
During construction, we want to make NopCanvas as light as possible so
we just say that we are hw accelerated.
This caused some crashes further down the line for some views that
thought that NopCanvas was hw accelerated. From now on, NopCanvas is
only hw accelerated during construction.
Test: Covered by the existing tests
Change-Id: If09a662312e5c90d011e7ab2cbb524ef7b420d12
Keeping the mapping manually is very error prone and the
SystemServiceRegistry already does it for us.
Bug: http://b.android.com/231975
Test: Added new test
Change-Id: I507c4a9d5f0821a5a237ee27f5e97c5cd9040223
- Make sure that all ImageViews containing animated vector drawables
have the animation started.
- VGroup does not need to copy the children as they are copied by the
VectorDrawable initialization
Test: Covered by existing animated vector drawable tests
Change-Id: Ic0fc09ee5c98b3747dbc6fe311cdeea2c8dba380
Doing this allows us to annotate integer values that should corresponds
to WindowManager.LayoutParams#softInputMode.
Test: There should be no behavior change. RetentionPolicy.SOURCE
annotation should change nothing in production code.
Test: checkbuild
Bug: 32784563
Bug: 35079353
Change-Id: I96300b090edce327d0515c740183abe91ded6bac
As explained in the commit message of my previous CL [1], we have
had a design issue in how to notify the full-screen mode change
from the IME to InputMethodManager running in the target application.
Histrically we have done this by using hooking the following IPC
from the IME to the target application.
InputConnection#reportFullscreenMode()
However, since we also want InputConnection to be deactivated in some
situations such as the when the target application is no longer
focused. In other words, InputConnection is not a reliable way to
notify something.
As a result, we have suffered from many stale state issues.
Bug 21455064 and Bug 28157836 are such examples. In Android N, we
introduced yet another hack to work around those issues, but it is
really time to fix the protocol design instead.
The new strategy is to rely on internal IPCs provided by
InputMethodManager to deliver such critical notifications from one
process to the other. This is actually more natural because our goal
is to make sure that InputMethodManager#isFullscreenMode() always
returns the latest value as long as the caller is the focused
application.
For backword compatibility, applications that are monitoring
this callback should continue working, as InputMethodManager emulates
the previous behavior. However, as updated in JavaDoc, IMEs are no
longer allowed to invoke InputConnection#reportFullscreenMode(),
which should be OK because even on previous releases IMEs should rely on
InputMethodService#updateFullscreenMode() instead.
[1]: Iba184245a01a3b340f006bc4e415d304de3c2696
1544def0facda69c210b0ae64b17394ea2860d39
Fixes: 28406127
Test: Make sure Bug 21455064 is still fixed.
1. Input some words in extract mode.
2. Select a word.
3. Perform copy.
4. Select a word.
5. Rotate the device.
6. Try to select a word.
7. Make sure he word is selected and action mode starts.
Test: Make sure Bug 28157836 is still fixed.
1. Rotate device to landscape mode.
2. Tap on EditText and start full screen extracted mode.
3. Rotate device to portrait mode.
4. Long press to start action mode.
5. Make sure Action mode gets started.
Test: `adb shell dumpsys input_method` to make sure that fullscreen
state is synchronized across the app, IMMS, and the IME.
Change-Id: If23e7c7c265ab3dfb48c2fb6fdb361b17d22c594
The XLIFF 'g' tag specifies content that should NOT be translated.
AAPT2's pseudolocalization process should respect it.
Bug:34064599
Test: make libandroidfw_tests
Change-Id: Ice437d7f0ff246730ee04896fd035e2d846148fb
- #1: Move logic for handling IME size changes into SysUI, and only rely
on PinnedStackController to provide bounds when first entering
PiP and on rotation
- #2: Doing #1 allows us to move PipMotionHelper to SysUI completely, which
lets us aggregate the animation calls out of PipTouchHandler
- #3: Add proper callbacks to the listeners when the movement bounds
changed from config change, ime change, or aspect ratio change. This
allows SysUI to calculate the associated movement bounds for the
expanded state, and we can then remove the corresponding WM call.
It also means that SysUI is the only thing that needs to know about
the expanded state.
- #4: Fix issue where TV was getting the default bounds, not taking the
aspect ratio when the PiP was entered into account. Doing #3
allows us to report the right bounds.
- #5: Remove dead code related to edge snapping/minimizing now that they
are on by default and associated tuner setting, and controller
callbacks
Test: android.server.cts.ActivityManagerPinnedStackTests (all existing tests pass)
Change-Id: I3ef361bdf8d44094b4c0a11c70ba4db7d697fdec
Signed-off-by: Winson Chung <winsonc@google.com>