We want to be able to control at a fine grained level whether precompiled
layouts are enabled so we can compare inflation results with and without. This
changes adds a @TestApi method that supports this.
Bug: 111895153
Merged-In: Ib6b62d79a9ca7aefefff8639752aa5838e491038
Change-Id: I2f28f6912499825e52c17cc163be9c0fe93855cb
This change enables the use of precompiled layouts, provided a couple of
conditions are met:
1. Precompiled layouts are enabled by the system property
view.use_precompiled_layouts.
2. There is a file called compiled_view.dex in the application's code cache
directory.
If these conditions are met, when a layout is inflated, the LayoutInflater will
first check if a precompiled version is available and use that. If anything goes
wrong, such as if the layout is not available or something goes wrong during the
inflation process, then the LayoutInflater will fall back on interpretting the
layout resource as before.
Bug: 111895153
Test: atest $ANDROID_BUILD_TOP/cts/tests/tests/view/src/android/view/cts/LayoutInflaterTest.java
Change-Id: Id050072c0206080322a0e876782ee2b66d03916d
Thic CL eliminates the native dependency on libtextclassifier in favor of the java one
because the .java implementation is built on top of stable APIs (@CorePlatformAPI, Android SDK)
while the native API might change in future, leading to breakages.
Bug: 119788152
Test: m droid successfully builds + atest frameworks/base/core/tests/coretests/src/android/view/textclassifier
Change-Id: I4c3bb4790c360dd514ed2ea48e0634de43dab9e7
Merged-In: Ide5e58d1c80d9a028cea4e9192a91aeac2843c71
(cherry picked from commit 64c4cb2ea9)
Apps can call addChild through AccessibilityNodeProvider, so it's
possible that an app adds a node itself as a child node. This will break
down the integrity of UI tree and cause failure to operation in
UIAutomator. Thus I suggest do this integrity check when adding child.
Test: as follows
- built
- flashed
- booted
- run my test script based on uiautomator
Change-Id: I8cba22a1d9d1a49365c6bce4241ef5067502fb79
Signed-off-by: qinyige <qinyige@xiaomi.com>
This method is needed so that precompiled layouts can reuse the factory logic
from the LayoutInflater.
Bug: 111895153
Test: atest android.view.cts.LayoutInflaterTest
Change-Id: Ifd1028906b655af2bd14247d586dc16b35550c82
The parseInclude method had some deep nesting that could be improved by
rearranging things a little.
Test: atest android.view.cts.LayoutInflaterTest
Change-Id: I2ee13c2ee80bcb220371d39a5a6da6044cfa245c
Members modified herein are suspected to be false positives: i.e. things
that were added to the greylist in P, but subsequent data analysis
suggests that they are not, in fact, used after all.
Add a maxTargetSdk=P to these APIs. This is lower-risk that simply
removing these things from the greylist, as none of out data sources are
perfect nor complete.
For APIs that are not supported yet by annotations, move them to
hiddenapi-greylist-max-p.txt instead which has the same effect.
Exempted-From-Owner-Approval: Automatic changes to the codebase
affecting only @UnsupportedAppUsage annotations, themselves added
without requiring owners approval earlier.
Bug: 115609023
Test: m
Change-Id: Ia937d8c41512e7f1b6e7f67b9104c1878b5cc3a0
Merged-In: I020a9c09672ebcae64c5357abc4993e07e744687
* changes:
DO NOT MERGE Set ContainerLayer for buffer-less surface
DO NOT MERGE: WM: Restrict SC Builder to set a single surface type
Implement construction of container layers
Added a null check to avoid exceptions caused by timing delay during VTS run.This case fail is because AccessibilityWindowQueryActivity execute scheduleTraversals before Activity destroyed and execute doTraversal after Activity destroyed. This means window animation is not stop after AccessibilityWindowQueryActivity is destroyed and this will lead to test crash.
Test: Tested 5 times and it is passed 5 times.
Bug: 121169721
Change-Id: I915d46f925fb7a5ca43cac3ef3a343822b952b02
When building a surface control, only allow a single surface type to be set, clearing any
previously set types so the surface creating flags remain valid.
Test: reboot device, rotate the screen, enter and exit multi window, check the UI is normal Dump SF layer and check the container layer is set successfully
Bug: 111164627
Change-Id: Ifc022881ee7fec0561a39ce647868d5b43cb49d9
Expose existing native functionality. In preparation for use as
bufferless-input-catching-surfaces.
Bug: 80101428
Bug: 113136004
Bug: 111440400
Change-Id: I455792aec3ee58d9dd20016b484ce7c27808d522
Merged-In: I455792aec3ee58d9dd20016b484ce7c27808d522
Based on some analysis, these fields/methods are likely false positives.
Set maxTargetSdk=P so that any apps using them are required to migrate off
them in future. See the bug for more details.
Exempted-From-Owner-Approval: Automatic changes to the codebase
affecting only @UnsupportedAppUsage annotations, themselves added
without requiring owners approval earlier.
Bug: 115609023
Test: m
Merged-In: I719b5c94e5b1f4fa562dd5d655953422958ad37e
Change-Id: I719b5c94e5b1f4fa562dd5d655953422958ad37e
(cherry picked from commit 8c854f86a4)
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>
With my change [1] in Android N, applications no longer need to
manually call this hidden API even when directly implementing
InputConnection interface without extending BaseInputConnection [2].
So far applications that we have confirmed to be using this hidden API
is Chromium and browsers that are supposed to be built on top of
Chromium source code [3]. Actually my change [1] was per request from
Chromium team and Chromium does not use this hidden API on Android N
and later devices [4].
Moving forward, with this CL applications that target API 29 and later
are no longer allowed to use this hidden API since we see no actual
use case of this hidden API on Android N and later devices so far.
If you have any reason to continue relying on this hidden API, please
leave a comment in Bug 114740982.
[1]: I571d6cc9c6e461d8994aa7496e7e18be13766411
159dd47db3
[2]: This scenario had not been suppored until Android N.
See also other CLs that are tagged with Bug 24688781.
[3]: https://cs.chromium.org/chromium/src/content/public/android/java/src/org/chromium/content/browser/input/InputMethodManagerWrapperImpl.java?rcl=525c72b0f4694d6b3f93bcc7797d0411c2fa683c&l=113-128
[4]: crbug.com/551193
Bug: 114159783
Bug: 114740982
Test: compile
Merged-In: I41d6419438cef92cce81cc33d9db00dd2ee89d33
Change-Id: Iac81f49413605271fccc0b8aec3e6ed95925f061
Adds an option to mask the cutout by effectively shrinking the logical display
such that developers can test apps as if the device did not have a notch.
Bug: 112876936
Test: Go to Settings > Developer Options > Simulate display with cutout > "No cutout". Cutout should be hidden. Rotate screen, take screenshots, screenrecord, screen off animation should all work as expected.
Change-Id: I5cdb201734d238bf3785ab55843114e4b5b4ee41
Bug: None
Test: I solemnly swear I tested this conflict resolution.
Change-Id: I0807ae67e0ed3e84f17af962dc8b7a3152f8103f
Merged-In: I4147b038ed7adf0311ee9918b44766f82a057eaf
For packages:
android.view.textservice
android.view.textclassifier.logging
android.view.textclassifier
android.view.inputmethod
android.view.autofill
android.view.accessibility
android.view
This is an automatically generated CL. See go/UnsupportedAppUsage
for more details.
Exempted-From-Owner-Approval: Mechanical changes to the codebase
which have been approved by Android API council and announced on
android-eng@
Bug: 110868826
Test: m
Change-Id: Ie4663ebd4640b2893e575e599582d2c9530da313
Merged-In: I4147b038ed7adf0311ee9918b44766f82a057eaf
- Print compatibility mode info and activity token on AutofillManager.dump().
- Add --autofill option on Activity so it just dump autofill state.
Also fixed checkstyle import warnings on ActivityManagerShellCommand.
Bug: 112417431
Bug: 112584717
Test: adb shell dumpsys activity top --autofill
Change-Id: Id56b56a5d7e591d5204663a1da1322a15f8ef3aa
(cherry picked from commit b546ca7916)
This is useful to identify cases where a browser used a trampoline activity to
launch its rendering activity.
Bug: 112584717
Bug: 112690889
Test: adb logcat AutofillManager
Change-Id: I5e58cd8c8dc67ddeed8aa0996233dca9b89cc0d3
(cherry picked from commit 7d4461d133)
Altough these are super spammy, they're super valuable when debugging why
compat mode doesn't work.
Bug: 112417431
Fixes: 112584717
Test: adb logcat AutofillManager
Change-Id: I1574b51b1c6caf783038b82ff207986b726b2e8b
(cherry picked from commit 5d35d3d2d6)
Bug: None
Test: I solemnly swear I tested this conflict resolution.
Merged-In: I773bda19dc7b32c01bf064bf78b517896e8df991
Change-Id: I2c9bd92522932175856fb72ca5cce2c1999f4a1e
For packages:
android.view.animation
This is an automatically generated CL. See go/UnsupportedAppUsage
for more details.
Exempted-From-Owner-Approval: Mechanical changes to the codebase
which have been approved by Android API council and announced on
android-eng@
Bug: 110868826
Test: m
Change-Id: I52f3e770dd1e8240e67c897e7788bd928145f583
Merged-In: I773bda19dc7b32c01bf064bf78b517896e8df991
Before applying this patch, when a show-when-locked immersive app is
showing, the system bars would quickly show and hide, which are
redundant to the user.
The root cause is that, for nav bar, we have a policy to show nav bar
if the width and height of status bar are MATCH_PARENT and status bar
has no PRIVATE_FLAG_KEYGUARD. When keyguard is becoming status bar,
its keyguard flag would be removed first, and then the height would
be changed to the bar height. So the nav bar would be shown between
these events. For status bar, we force showing it when it is expanded
by checking its width and height are MATCH_PARENT or not.
To fix the issue, this change introduces a new private flag which
indicates that the status bar window is now in an explicit expanded
state. We check this flag instead of checking the width and height of
status bar.
This change also fix a bug that: when AOD is enabled, if the
foreground app has FLAG_SHOW_WHEN_LOCKED, FLAG_TURN_SCREEN_ON, and
FLAG_FULLSCREEN, clicking on the power key would make it show the app
again instead of AOD. (not 100%, but chances)
Bug: 80147982
Test: 1. go/wm-smoke
2. Launch a show-when-locked turn-screen-on immersive app on
AOD, and see if any system bar flashes.
3. Launch a show-when-locked turn-screen-on immersive app on
lockscreen, and see if any system bar flashes.
4. a. Enable AOD in Settings.
b. Open a show-when-locked turn-screen-on immersive app.
c. Click on power key, and see if AOD shows.
5. Launch an immersive app and drag down the status bar, see
if nav bar keeps there as long as status bar is expanded.
Change-Id: Ie885d504eb73ae8a86736b2c3ed4fb03eb9f739e
Merged-In: Ie885d504eb73ae8a86736b2c3ed4fb03eb9f739e
(cherry picked from commit 3404601e07)
Such that it gets executed after setSurface, in order that
mReqUsage has the correct flags set.
Test: Take trace, ensure that allocateBuffers actually allocates
in the right format/usage by ensuring that dequeueBuffer doesn't
trash them immediately again.
Bug: 111517695
Change-Id: I94b402d7b29d565155a77a2d09106246261712d2
Root cause has been identified, but fix is too risky. Instead, we
remove the WTF for now and readd the fix as well as the WTF
in master.
Note that due to defensive programming, in case we land in the WTF
case, it doesn't cause any real bug.
Test: boots
Bug: 110834518
Change-Id: I0da1e48e420c3fcde0e818b7fe0527da9155a159
When SurfaceControl is created with creating variable
in updateSurface(), sizeChanged is also set.
So, setSize() is called, and it blocks UI thread
until the transaction is handled in SF.
There is no need to resize in the creation time,
because size is already set when creating SurfaceControl.
Test: systrace any app including SurfaceView
Change-Id: I65028b4d0d0ba2b75fbe089c98a11a56b6c08104
Otherwise there is a big performance hit in all kinds of
situations where we do operations with the region, specifically
when:
- updating input windows
- insetting the cutout during layout
- touch dispatch
Test: DisplayCutoutTest, WmDisplayCutoutTest
Bug: 110464019
Bug: 110452325
Change-Id: I94a25c3794ecd33b8b7204ca308ac91623498f13
If draw() invokes postDraw that sets the next callback, the
callback will never be invoked.
Test: Long-swipe-up from navigation bar
Change-Id: If2e4dfff8a845b73fa77426305d5ece1921857e5
Fixes: 109701914
If an app crashes during Keyguard transition, make sure to keep
Keyguard transition
Test: AppTransitionTests
Test: go/wm-smoke
Change-Id: I80b80952f93d2b5611754f05a3dc333905cd1c86
Fixes: 80132133