Commit Graph

11246 Commits

Author SHA1 Message Date
Mathew Inwood
152d5a5dcd Merge "Limit access to suspected false positives."
am: aeda49d185

Change-Id: Ib24456aaad850d5aee46dd242513840511942536
2019-01-02 04:48:33 -08:00
Mathew Inwood
55418eada5 Limit access to suspected false positives.
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
2018-12-28 14:26:35 +00:00
Robert Carr
ef7f39f4f5 Implement construction of container layers
am: c1ea10447f

Change-Id: I5a8f0080051d2ae66a4a2f99c4a88ef452f0a467
2018-12-20 14:59:10 -08:00
Treehugger Robot
321b208f0f Merge changes from topic "fw_container"
* 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
2018-12-20 22:45:18 +00:00
Xin Li
15b123ef45 DO NOT MERGE - Merge pie-platform-release (PPRL.181205.001) into master
Bug: 120502534
Change-Id: Idc8bfb6d97a869b76cfb87ca1a494201baf9e8bd
2018-12-11 14:13:44 -08:00
Xin Li
75f75c18cc DO NOT MERGE - Merge pie-platform-release (PPRL.181205.001) into stage-aosp-master
Bug: 120502534
Change-Id: I7351a1832c4bd2fd86324183ab83e9088d716822
2018-12-10 12:30:19 -08:00
Vishnu Nair
cb122ec8a5 DO NOT MERGE: WM: Restrict SC Builder to set a single surface type
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
2018-12-07 09:45:41 -08:00
Robert Carr
c1ea10447f Implement construction of container layers
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
2018-12-07 08:55:00 -08:00
Treehugger Robot
29f0f9a910 Merge "Update API doc of View.DragShadowBuilder" 2018-11-13 03:15:51 +00:00
Nathan Harold
f5cf9f24ed Merge "Move some members to the "Q blacklist"." 2018-10-23 21:53:51 +00:00
Mathew Inwood
45d2c252b1 Move some members to the "Q blacklist".
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)
2018-10-22 17:28:24 -07:00
Daichi Hirono
1f68b5e91d Update API doc of View.DragShadowBuilder
Since Android P, DragShadowBuilder#onProvideShadowMetrics must provides
positive values for shadow width/height.

Bug: 113779428
Test: None
Change-Id: Idd8c24ee5bf2c7023f7c82137399c59a60162a4f
2018-10-09 13:49:30 +09:00
daqi
9c5a6e2c6c Merge "Set InputMethoMananger#mCurRootView to null when window dismissed"
am: 7bd18423f6

Change-Id: Ie0127bd83b714c540bcf387a3fc74d01bd60eb13
2018-09-19 19:22:12 -07:00
Treehugger Robot
7bd18423f6 Merge "Set InputMethoMananger#mCurRootView to null when window dismissed" 2018-09-20 00:35:25 +00:00
daqi
dff365ef4d Set InputMethoMananger#mCurRootView to null when window dismissed
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>
2018-09-20 08:30:40 +08:00
Yohei Yukawa
81be3fdc66 Merge "Restrict IMM.notifyUserAction() with targetSdkVersion <= P"
am: ec52757ecb

Change-Id: Ia35a97362a467b452abf8649d3ac30b61a410560
2018-09-12 14:39:44 -07:00
Yohei Yukawa
5b83a80aab Restrict IMM.notifyUserAction() with targetSdkVersion <= P
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
2018-09-11 13:34:36 -07:00
Adrian Roos
c05c2d1e48 Merge "Cutout: Add developer setting to mask the display cutout" into pi-dev 2018-08-21 19:51:58 +00:00
Adrian Roos
8c28c7c2d9 Cutout: Add developer setting to mask the display cutout
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
2018-08-21 21:47:51 +02:00
Mathew Inwood
ec73e7514f resolve merge conflicts of 597229d681 to stage-aosp-master
Bug: None
Test: I solemnly swear I tested this conflict resolution.
Change-Id: I0807ae67e0ed3e84f17af962dc8b7a3152f8103f
Merged-In: I4147b038ed7adf0311ee9918b44766f82a057eaf
2018-08-21 09:31:16 +01:00
TreeHugger Robot
c9443e3894 Merge "Improved AutofillManager and Activity dump() methods:" into pi-dev 2018-08-21 01:18:09 +00:00
TreeHugger Robot
db7648f374 Merge "Log AutofillClient on CompatibilityBridge.onAccessibilityEvent()." into pi-dev 2018-08-20 20:29:21 +00:00
TreeHugger Robot
e4d35b6dc0 Merge "Log CompatibilityBridge.onAccessibilityEvent()" into pi-dev 2018-08-20 19:07:10 +00:00
Mathew Inwood
e5ad598d11 Add @UnsupportedAppUsage annotations
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
2018-08-20 14:52:19 +01:00
Felipe Leme
4226033998 Improved AutofillManager and Activity dump() methods:
- 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)
2018-08-17 14:18:37 -07:00
Felipe Leme
3438421295 Log AutofillClient on CompatibilityBridge.onAccessibilityEvent().
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)
2018-08-17 13:55:58 -07:00
Felipe Leme
a9aacf9bfd Log CompatibilityBridge.onAccessibilityEvent()
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)
2018-08-17 13:54:38 -07:00
Laura Davis
43e75d98d8 Docs: Inserted links to relevant guide pages.
This is the proof of concept for adding relevant
links in API pages to narrative content.
The design doc is hosted at:
https://docs.google.com/document/d/1Y6bFua27Gs7ONZ27gz0nHz3Djv0WND_V_rX-XvbeB3U/edit?usp=sharing

Test: make ds-docs

Bug: 112478848
Change-Id: Ic3842629c802fe89582d4d7b4a153e54d4ba1713
2018-08-16 16:57:18 -07:00
Joshua Baxter
ce01dba2b7 Merge "docs: fixed typo" into pi-dev 2018-08-13 22:46:02 +00:00
Mathew Inwood
04f16736ae resolve merge conflicts of 6987a91e7c to stage-aosp-master
am: 5346961615

Change-Id: I2bcb356c7cbd76067202b27ec6db7f1eeef17aa3
2018-08-03 02:41:47 -07:00
Mathew Inwood
5346961615 resolve merge conflicts of 6987a91e7c to stage-aosp-master
Bug: None
Test: I solemnly swear I tested this conflict resolution.
Merged-In: I773bda19dc7b32c01bf064bf78b517896e8df991
Change-Id: I2c9bd92522932175856fb72ca5cce2c1999f4a1e
2018-08-03 09:00:19 +01:00
Mathew Inwood
8452828b5b Add @UnsupportedAppUsage annotations
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
2018-07-27 16:06:00 +01:00
Tiger Huang
926f7d815c Don't flash system bars while showing an immersive app on lockscreen
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)
2018-07-26 05:31:16 +00:00
youngmin0822.lee
762b60ce74 Merge "don't call setSize() when creating SurfaceControl" am: 57e98b19be
am: e332fe4b3d

Change-Id: I384dd4a03db135c703e3672037212a970d222689
2018-07-24 22:14:56 -07:00
youngmin0822.lee
e332fe4b3d Merge "don't call setSize() when creating SurfaceControl"
am: 57e98b19be

Change-Id: Iec44550e5c18fa7d3005c8c79e607fc1bc656c13
2018-07-24 22:01:41 -07:00
Jorim Jaggi
7823ee73ee Move allocateBuffers to RT
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
2018-07-17 17:34:49 +02:00
Jorim Jaggi
511ac80149 DO NOT MERGE Remove WTF spam
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
2018-07-12 12:01:48 +00:00
youngmin0822.lee
4dde7d19cb don't call setSize() when creating SurfaceControl
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
2018-07-09 15:27:43 +09:00
Jorim Jaggi
606405180f Only use simple rects for cutout region
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
2018-07-02 17:58:10 +02:00
TreeHugger Robot
e4e9ee7951 Merge "Move nulling of nextFrameCallback" into pi-dev 2018-06-07 22:14:51 +00:00
Jorim Jaggi
e6a026bdfe Move nulling of nextFrameCallback
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
2018-06-07 17:49:01 +02:00
Laura Davis
890662c3c4 docs: Changed language to be gender-neutral.
Test: make ds-docs

Bug: 75324366
Change-Id: Ia2dbcbe4bec303791cbbb004bab6a0b585c5dfb6
2018-06-05 16:02:42 -07:00
Jorim Jaggi
9c52ebbf96 Crashing can not override Keyguard transit
If an app crashes during Keyguard transition, make sure to keep
Keyguard transition

Test: AppTransitionTests
Test: go/wm-smoke
Change-Id: I80b80952f93d2b5611754f05a3dc333905cd1c86
Fixes: 80132133
2018-06-01 16:32:44 +02:00
John Reck
5b02c629bd Attempting to fix the black flicker
Bug: 79231206
Test: Repro steps from bug

Merged-In: I4c2810c42a7a4358f64584da3ab0cdf1499e71b6
Change-Id: I4c2810c42a7a4358f64584da3ab0cdf1499e71b6
2018-05-31 12:56:28 -07:00
Evan Rosky
7ba4c2b254 Merge "Fixed a bug where sometimes unhandled handler would consume all keys" into pi-dev 2018-05-30 21:47:25 +00:00
Adrian Roos
8997b7e4c9 Merge "WindowInsets: Never dispatch negative insets" into pi-dev 2018-05-28 14:40:20 +00:00
Evan Rosky
cd80e611ca Fixed a bug where sometimes unhandled handler would consume all keys
In a situation where a focused view consumed only the UP of a key
and the unhandled key manager would focus a listener, it wouldn't
drop focus unless the original key was pressed/released again.

This updates the record of captured keys before it can be consumed
in the view hierarchy.

Bug: 79993136
Test: Added a test for this to cts ViewTest#testUnhandledKeys
Change-Id: I5dfdcf16c5c41e9ad51cb62b385580c5493e8520
2018-05-25 16:18:57 -07:00
Joshua Baxter
2ef2675547 docs: fixed typo
Test: make ds-docs

Bug: 79973165
Change-Id: I058e1ee49ec29890764a7deac5f8e0d40a61ba7f
2018-05-25 11:25:50 -07:00
Adrian Roos
7419a17d92 WindowInsets: Never dispatch negative insets
Bug: 80204753
Test: atest ViewRootImplTest
Change-Id: Idace95ae57c6a3a1667b95ce8c3ac7d2bfe06f94
2018-05-25 14:54:09 +02:00
Felipe Leme
ce3ae87da9 New Autofill field: FIELD_AUTOFILL_SESSION_ID
This field contains the autofill session id (Thank You, Captain Obvious!), which
is useful to correlate autofill metrics that are not logged on
AUTOFILL_REQUEST.

Test: atest CtsAutoFillServiceTestCases # to make sure it didn't break anything
Test: manually run some test and watched
      'adb shell logcat -b events | grep sysui'. Example:
     [757,913,758,4,806,android.autofillservice.cts,871,android.autofillservice.cts.LoginActivity,914,2,915,2,1456,-2045861404

Fixes: 80093094

Merged-In: If4b1c9ab616b2ba580745096894997eb7edb3e34
Change-Id: If4b1c9ab616b2ba580745096894997eb7edb3e34
2018-05-25 06:22:25 +00:00