Commit Graph

12276 Commits

Author SHA1 Message Date
TreeHugger Robot
6686d19fc7 Merge "Prevent access to MotionEvent#mNativePtr" 2019-02-09 00:10:50 +00:00
Felipe Leme
6c7c87bb4e Merge "Fixed sendEvent() so it can merge TYPE_VIEW_DISAPPEARED with multiple ids." 2019-02-08 22:31:25 +00:00
Abodunrinwa Toki
aa0fc10c7a Merge "TextClassifier: normalize uri for browser intent." 2019-02-08 21:39:09 +00:00
George Mount
bbc84a8b26 Prevent access to MotionEvent#mNativePtr
Fixes: 124051968
Test: compiled framework

Removes reflection access to MotionEvent#mNativePtr. All
necessary access to mNativePtr is available through the public
methods on MotionEvent, so access to mNativePtr is unnecessary.

Change-Id: I448eddfc4a5bc64deff44db2e69b5481477cdf91
2019-02-08 09:58:45 -08:00
Felipe Leme
c8875e7073 Fixed sendEvent() so it can merge TYPE_VIEW_DISAPPEARED with multiple ids.
Test: atest CtsContentCaptureServiceTestCases # nothing broke

Bug: 124107816
Fixes: 124060720

Change-Id: I632d4f600eabccf7e991450ff0291c6f5721cc28
2019-02-08 09:52:57 -08:00
Issei Suzuki
a5dbf52d0a Set insets on the virtual display to avoid IME covering the bubble.
Bug: 123544535
Test: Manual test using the test app, and atest DisplayPolicyLayoutTests
Change-Id: If2fceea97f4d702d000d887883c7f131337e9fd0
2019-02-08 14:21:53 +01:00
Abodunrinwa Toki
c33fc77de4 TextClassifier: normalize uri for browser intent.
Also updates TemplateIntentFactory to validate RemoteActionTemplates.

Bug: 123640937
Test: atest core/tests/coretests/src/android/view/textclassifier/TextClassifierTest.java
Test: atest core/tests/coretests/src/android/view/textclassifier/TemplateIntentFactoryTest.java
Change-Id: I2dc5d988234f1aaace4b30e9fbe272937c99ca47
2019-02-08 12:58:57 +00:00
Jorim Jaggi
5d4f5ebf7b Merge changes I1268101d,Id40470f6
* changes:
  Handle adjustResize flag properly on client
  Reparent IME window and handle non-fullscreen windows correctly
2019-02-08 11:22:12 +00:00
TreeHugger Robot
2546e0da58 Merge "Open API for onCreateView and createView with Context" 2019-02-08 00:29:17 +00:00
Evan Rosky
fa8e8f4ca3 Merge "Fix layer creation metadata parceling" 2019-02-08 00:28:36 +00:00
Sumir Kataria
79974722c4 Merge "Restrict reflection of default DisplayInfo constructor to P and lower." 2019-02-07 21:51:53 +00:00
Shep Shapard
b6b7fe181f Merge "Restricting access to View.internalSetPadding(...)" 2019-02-07 21:49:57 +00:00
shepshapard
8ecc5224cd Restricting access to View.internalSetPadding(...)
Developers can already use the public setPadding(...)
and setPaddingRelative(...) methods.

Bug: 123768420
Test: None.

Change-Id: I3c7bd84699730cb11c2d801aff6340c3ac9c36d3
2019-02-07 13:45:52 -08:00
John Reck
83e5eb59d7 Merge "Revert "Add view inflation device config property"" 2019-02-07 21:36:58 +00:00
Rob Carr
424e875630 Merge changes from topic "sc-destruction-cleanup"
* changes:
  SurfaceControl: Provide Transaction#remove() method.
  Replace SurfaceControl#destroy with #remove
  SurfaceControl: Fix release
2019-02-07 20:45:11 +00:00
Felipe Leme
8f5ef4518f Merge "Made moar ContentCapture APIs available for testing." 2019-02-07 20:22:33 +00:00
TreeHugger Robot
6f82297cb1 Merge "Make android.view.RemotableViewMethod annotation @TestApi" 2019-02-07 20:00:43 +00:00
Felipe Leme
ee14187b68 Merge "Removed FLAG_SMART_SUGGESTION_LEGACY" 2019-02-07 19:16:55 +00:00
Aurimas Liutikas
86ef44bcc7 Merge "Add helper methods for View attribute debugging" 2019-02-07 19:05:20 +00:00
John Reck
f8c0d70f3e Revert "Add view inflation device config property"
This reverts commit 86076a7cbe.

Reason for revert: Requires apps to have READ_DEVICE_CONFIG permission which they cannot possibly get. Also breaks instant apps (which don't have & can't get that permission)

Bug: 123524494
Test: CtsAccelerationTestCases[instant] passes.
Change-Id: I789a2c9007780331c510802a9f807cc24174be2d
2019-02-07 18:31:50 +00:00
Sumir Kataria
47ed9eec76 Restrict reflection of default DisplayInfo constructor to P and lower.
There doesn't appear to be a valid use to create this object yourself;
you can retrieve DisplayInfos of the attached displays using various
other APIs, such as through WindowManager.  The copy constructor is
also available.  This method is only used by one app.

One possible usage is to get the display cutout information; this is
something that is now available as an official API in Q.

Test: N/A
Change-Id: I632b337e5dfdcddd494b03fd1403f73d2c46a475
Fixes: 123769467
2019-02-07 18:01:25 +00:00
George Mount
f38b2c62ab Open API for onCreateView and createView with Context
Fixes: 123768619

LayoutInflater's mConstructorArgs was being accessed for two
reasons: reading and writing the context. When onCreateView()
was called, the inflation context was not being passed, so
if the developer wanted to get it, they had to read it from
mConstructorArgs. When the developer wanted to create a view,
with createView(), the developer could not adjust the view's
constructor context.

This CL creates versions of those two classes that take
Context as a parameter to remove the need for accessing
mConstructorArgs.

Test: ran LayoutInflaterTest
Test: Ia40341c24998be13205a72386d217d038a3bcf93
Change-Id: Ic2e990567512dd051f3d4f6c842398c71d6817b5
2019-02-07 07:58:33 -08:00
Jorim Jaggi
648e5881dc Handle adjustResize flag properly on client
Test:
adb shell setprop persist.wm.new_insets 1
adb shell setprop persist.pre_render_ime_views 0

Test: Open IME with app that doesn't have adjustResize set
Test: InsetsStateTest
Bug: 111084606
Change-Id: I1268101d851ddc8fee7896a1a8316eedf0c8de95
2019-02-07 15:56:22 +01:00
Tarandeep Singh
a6f3561667 Reparent IME window and handle non-fullscreen windows correctly
IME window is attached to the IME target if possible. This ensures
a smooth enter/exit animation when the activity is coming in/going
away.

Furthermore, if the controlling window doesn't span the entire
display, we can't offer controlling it in a frame-by-frame
manner, and we need to do the inset calculations relative to the
display frame.

Test:
adb shell setprop persist.wm.new_insets 1
adb shell setprop persist.pre_render_ime_views 0

Test: Open IME, go home, reopen app
Test: Show dialog with EditText
Bug: 111084606
Change-Id: Id40470f6f8284b48acfa4719049afd14fde332d6
2019-02-07 15:56:21 +01:00
Sergey Vasilinets
9481a0781a Merge "Add maxTargetSdk to @UnsupportedAppUsage for mH, mServedView, mNextServedView" 2019-02-07 11:31:32 +00:00
Felipe Leme
f38d414e09 Made moar ContentCapture APIs available for testing.
Test: m update-api
Test: atest CtsContentCaptureServiceTestCases

Bug: 123037756
Bug: 123038898

Change-Id: I06373d3a06e064c2e9546bc0d45a50b50f712189
2019-02-06 19:25:53 -08:00
TreeHugger Robot
5105cc02f8 Merge "High contrast mode is an experimental feature." 2019-02-07 02:10:23 +00:00
Aurimas Liutikas
1e47d35a96 Make android.view.RemotableViewMethod annotation @TestApi
This method is needed in CTS to test RemoteView behavior.

Bug: 72044662
Test: existing android.widget.cts.RemoteViewsTest
Change-Id: I8ca0ae151604062e5ecd58dc66c04103c351224b
2019-02-06 16:05:15 -08:00
Qasid Sadiq
a7a0578481 Merge "Use map to traverse accessibilityIds instead of the view tree" 2019-02-06 23:54:35 +00:00
TreeHugger Robot
f17a698307 Merge "Added unit tests for ContentCaptureContext" 2019-02-06 23:47:19 +00:00
Rahul Ravikumar
7023751972 High contrast mode is an experimental feature.
* Not having apps do custom things is WAI per pweaver@.

Fixes: b/123768939

Test: N/A.
Change-Id: I695322ae5dd8fb94df4d687e633deb5a23433f4d
2019-02-06 15:47:00 -08:00
Michael Wright
ebc78db8e1 Merge "Instrument wake up reasons." 2019-02-06 23:37:05 +00:00
Aurimas Liutikas
8f004c85a0 Add helper methods for View attribute debugging
Adding abilities to debug:
- Attribute resolution stack (which resources are looked
  at when resolving an attribute)
- Attribute value source (where did each attribute value
  get defined)
- Get explicit style id (if a view had it set via style="...")

This feature will be behind Settings.Global flag that Android
Studio will set to the debugged application package ID.

Bug: 111439551
Test: atest CtsViewTestCases:android.view.cts.ViewStyleTest
Change-Id: Ib6f9fc81000bb867b5b94a68953c99b0bc802d6c
2019-02-06 14:46:17 -08:00
Dominik Laskowski
9e7dce3833 Merge "Generalize physical display management" 2019-02-06 22:46:09 +00:00
Evan Rosky
c12c9a3bbc Fix layer creation metadata parceling
There were a couple issues:
- Parcel shares the same position between read/write, so the position
  had to be reset before sending to native
- Java's "native"IO ByteBuffer defaults to big-endian!? instead of
  the native endian.

Bug: 123914715
Test: sf_trace shows metadata. screenshots don't include notch/corners
      anymore

Change-Id: I27bcc54e4e81108554ba5c5009c43195902bbcf1
2019-02-06 14:18:07 -08:00
Robert Carr
71200f2c0e SurfaceControl: Provide Transaction#remove() method.
When we switched from destroy() to reparent(..., null) we introduced
a regression where the CloseGuard was not released. reparent(..., null) can
not release the CloseGuard because the caller may want to retain the control.
It seems a frustrating burden to require users to write: "reparent(null), release()"
where previously we provided destroy so we provide a helper #remove method.

Test: Existing tests pass
Bug: 123923589
Bug: 122728663
Change-Id: I60b529573f8868624c70b78c7a71a4d7c7827ff7
2019-02-06 14:02:13 -08:00
Felipe Leme
28a6c0ec0e Removed FLAG_SMART_SUGGESTION_LEGACY
Test: atest CtsAutoFillServiceTestCases:android.autofillservice.cts.augmented.AugmentedLoginActivityTest

Bug: 123233342

Change-Id: Ia1855b6262deea67add17631d91bce9cd7643bae
2019-02-06 13:21:48 -08:00
TreeHugger Robot
ca1a0c4445 Merge "Move setLayerStack back to max-sdk-o greylist." 2019-02-06 20:05:35 +00:00
TreeHugger Robot
95d9144efa Merge "Move setTarget() to max-sdk-o greylist." 2019-02-06 19:49:25 +00:00
Sergey Vasilinets
6f1b7a2137 Add maxTargetSdk to @UnsupportedAppUsage for mH, mServedView, mNextServedView
These fields are accessed to clean up leaks on older versions,
but they shouldn't be accessed anymore.

Fixes: 123768581
Fixes: 123768639
Fixes: 123769388
Test: no code changes

Change-Id: I7265109290ba11477837bd09136b1d6ef5c73702
2019-02-06 18:39:56 +00:00
Nader Jawad
f8295b1e06 Merge "Updated UnsupportedAppUsage annotation usage on setAlphaNoInvalidation" 2019-02-06 17:56:24 +00:00
TreeHugger Robot
955ad96db0 Merge "Move drawRoundRect back to max-sdk-o greylist." 2019-02-06 17:53:34 +00:00
Shep Shapard
72be7c2a2f Merge "Improved padding code comments in View.java" 2019-02-06 17:27:29 +00:00
Mathew Inwood
679c15ed59 Move setLayerStack back to max-sdk-o greylist.
The API was dark grey listed in P, and it was greylisted in commit
76907ee.

Move it back as we should not be making API less restrictive in new
letter releases.

Test: m
Bug: 123987101
Change-Id: I0b43e31cb1d3d1c170d6718d3f71e21841ec30dc
2019-02-06 16:58:46 +00:00
Mathew Inwood
556d3a6fdb Move setTarget() to max-sdk-o greylist.
This method was on the dark grey list in P. It was removed sometime in
the meantime, and re-added in commit 01053cd, but put onto the grey list
rather then the max-sdk-o greylist (equivalent to dark grey in P).

Move it back as we should not be making API less restrictive in new
letter releases.

Test: m
Bug: 123987101
Change-Id: I5ec57e6523f2d0881e0e4e5597009fc2717bfb85
2019-02-06 16:58:38 +00:00
Mathew Inwood
0106c5dd5e Move drawRoundRect back to max-sdk-o greylist.
The API was dark grey listed in P, and it was inadvertantly moved on the
max-sdk-p greylist in commit 01053cd.

We should not make greylist APIs less restrictive between letter
releases as this makes the situation confusing for developers.

Test: m
Bug: 123987101
Change-Id: I2b8675c7e15479a6e8121976329fec88558f8cad
2019-02-06 16:58:30 +00:00
Mihai Popa
55b346bf81 Move View#scrollX and scrollY to dark gray list
The CL transitions View#scrollX and View#scrollY to the dark gray list,
not usable by reflection starting with Q. Instead of accessing them,
developers should use getScrollX(), getScrollY() added in API 1 and
setScrollX(int), setScrollY() added in API 14.

Bug: 123769508
Test: none
Change-Id: I166b9fe897bd35fd97b2e1fc2a8df73691255688
2019-02-06 14:05:19 +00:00
Michael Wright
e3001042b6 Instrument wake up reasons.
This lets us run experiments that need to know the reason for the wake
up in addition to the time and latency.

Bug: 122949636
Test: manually turning the device on and off, looking at the logs
Change-Id: I38429c3387a289010e1a2696ad351ffbe568413b
2019-02-06 12:54:00 +00:00
Qasid Ahmad Sadiq
834787afb6 Use map to traverse accessibilityIds instead of the view tree
This is the first step to a few things including allowing for virtual nodes to have view backed descendants and siblings.
The main change in findViewByAccessibilityId SPI (its changed name and location, but it still is effectively the same thing) is that if something has a nodeProvider it will now still return view children.
I sifted through each use of the SPI and determined if they were an issue, and cleaned up any code in the process (Autofill cleanup is coming in a different CL).

Test: added a few simple unit tests, used talkback on system in a few places including virtual views, atest accessibility*, cts accessibility* (There were some failures here but they don't seem to be caused by this change, those are captured in these bugs b/120628276 b/120890822), CtsAutoFillServiceTestCases
Bug: 37714287

Change-Id: Id5807114fbb4c932eaea275dc2d94d0dbe25a8ae
2019-02-06 01:06:08 +00:00
Nader Jawad
bc3c7592cb Updated UnsupportedAppUsage annotation usage on setAlphaNoInvalidation
Restricted access to setAlphaNoInvalidation method on View class.
Consumers should be able to handle the same functionality by leveraging
the onSetAlpha method within a View subclass. Removed usages of
setAlphaNoInvalidation within ViewPropertyAnimator.

Change-Id: Ieab3d54313972051484ac591b6f4329d3ae7b0cc
Fixes: 123768435
Test: Re-ran CtsAnimationTestCases
2019-02-05 16:18:16 -08:00