Commit Graph

12245 Commits

Author SHA1 Message Date
Sergey Vasilinets
9481a0781a Merge "Add maxTargetSdk to @UnsupportedAppUsage for mH, mServedView, mNextServedView" 2019-02-07 11:31:32 +00:00
TreeHugger Robot
5105cc02f8 Merge "High contrast mode is an experimental feature." 2019-02-07 02:10:23 +00: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
Dominik Laskowski
9e7dce3833 Merge "Generalize physical display management" 2019-02-06 22:46:09 +00: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
TreeHugger Robot
6737cc67ce Merge "Restrict reflection access to View methods" 2019-02-05 22:54:24 +00:00
shepshapard
ff18d86c00 Improved padding code comments in View.java
This was done in preparation for making changes related to
@UnsupportedAppUsage while trying to understand the semantics
of certain fields and the methods that use or modify them.

Bug: 123768420
Bug: 123768921
Test: No code changes.

Change-Id: I449be366906100c385ee610ce33953ddf0fb4ef0
2019-02-05 14:34:07 -08:00
TreeHugger Robot
a30095d965 Merge "Don't allow reflection on ViewConfiguration#sHasPermanentMenuKey." 2019-02-05 22:26:49 +00:00
Felipe Leme
2ca5dfe50b Added unit tests for ContentCaptureContext
Test: atest FrameworksCoreTests:android.view.contentcapture.ContentCaptureEventTest \
      FrameworksCoreTests:android.view.contentcapture.ViewNodeTest \
      CtsContentCaptureServiceTestCases
Fixes: 123038898

Change-Id: I0454e14743bb90f3f6883d86fe393efbda09166b
2019-02-05 13:57:49 -08:00
Tony Mak
f014d01cdd Merge changes from topic "action-intent"
* changes:
  Update ExtService to use suggestConversationActions
  Support intent configuration for actions
2019-02-05 21:57:31 +00:00
Tony Mak
ae33c3bd35 Support intent configuration for actions
1. Pull out the common intent genereation logic to TemplateIntentFactory,
so that it could be used by actions.

2. Fix a bug that we are freeing the annotator immediately when
   we are switching annotator model file. It is incorrect as
   it could be used by another thread / model.

Test: atest frameworks/base/core/tests/coretests/src/android/view/textclassifier/

BUG: 123745079

Change-Id: I6c5364595470b900be2dd976dda6e9fc90464de9
2019-02-05 21:53:37 +00:00
TreeHugger Robot
250bd27338 Merge "Don't allow reflection on ScaleGestureDetector#mSpanSlop." 2019-02-05 21:06:16 +00:00
Ashley Rose
2879c9c95f Merge "@InspectableProperty coverage for android.widget" 2019-02-05 21:03:00 +00:00
Mathieu Chartier
c9dcaeb4a5 Merge "Add view inflation device config property" 2019-02-05 20:26:07 +00:00
TreeHugger Robot
f264eebd8e Merge "Removed the Augmented Autofill blacklist APIs." 2019-02-05 19:32:11 +00:00
Louis Pullen-Freilich
c9d007d7c9 Merge "Makes View#setTransitionVisibility public and dark-greylists mViewFlags" 2019-02-05 19:31:11 +00:00
Yohei Yukawa
d20eef826c Query right user's system IMEs in AppRestrictionsHelper
It turns out that AppRestrictionsHelper#addSystemImes() has always
queried for the owner user's system IMEs despite the fact that it's
trying to query system IMEs for a restricted profile user.  This
behavior has not changed since its beginning [1].

Most likely people would not have noticed this though, because:

* Settings app does not show a menu item to create a restricted user
   on phone devices.
 * Even if it's available, most people do not use restricted users.
 * Even if someone created a restrected user, most likely the owner
   user and the restrected user share the same set of system IMEs,
   which are defined as "pre-installed" IMEs.

Anyway, AppRestrictionsHelper#addSystemImes() will start using a newly
introduced @hide API IMM#getEnabledInputMethodListAsUser() so that it
can query for the right user's system IMEs, instead of querying owner
user's ones.

 [1]: Ifced841ad3bfbde33d2403356216dd1749b7fa9a
      a7a93784d1f9798d37cb618def1a558f8d626f0f

Bug: 122164939
Test: atest SettingsLibTests:AppRestrictionsHelperTest
Test: manually done as follows.
  1. Build aosp_taimen-userdebug and flash it.
  2. adb shell pm create-user --restricted test_profile
  3. adb shell am start -a android.settings.USER_SETTINGS
  4. Click the gear icon next to the "test_profile" user.
  5. By adding a log, make sure that IMMS#getInputMethodList()
     gets called with userId = 10.
Change-Id: I5b50b5fe143c74c87b331bda3e5bcc4d6248436e
2019-02-05 10:45:32 -08:00
Jakub Gielzak
4ba27796a6 Restrict reflection access to View methods
Restricted reflection access to:
- dispatchAttachedToWindow
- dispatchDetachedFromWindow

Those should not be used directly as it violates internal code
guarantees. Instead Views need to be actually attached to the window.

Bug: 123769352, 123769370
Test: n/a

Change-Id: I0006bc99a2d10747e931e944caee21932c4642dd
2019-02-05 18:22:50 +00:00
TreeHugger Robot
7e968348cf Merge "Make ContentCapture calls directly from the UI thread." 2019-02-05 17:12:22 +00:00
Louis Pullen-Freilich
76ff3e0184 Makes View#setTransitionVisibility public and dark-greylists mViewFlags
Developers should use setTransitionVisibility instead of using
reflection to change the visibility in mViewFlags directly.

Bug: b/123768691
Test: CTS test in topic
Change-Id: I04d76100c53238b92cdc1575bc20af2a6b4410fe
2019-02-05 16:08:07 +00:00
Yohei Yukawa
1fb13c59de Query right user's enabled IMEs in KeyguardPasswordView
This CL fixes a regression introduced by my previous CL [1], which
enabled InputMethodManager#getEnabledInputMethodList() to return the
result based on the caller's user ID, not based on the current IME
user, even when it gets called from background users.

Since Keyguard always runs as user 0 currently, it is now Keyguard's
responsibility for querying enabled IMEs with an explicit user ID.  To
do so this CL adds a @hide API IMM#getEnabledInputMethodListAsUser()
and lets KeyguardPasswordView use it.

 [1]: I192a0f5a1375170d17a4c08af94f23966dbaea8b
      7f8ee4b9dd

Bug: 122164939
Fix: 123904896
Test: Manually verified as follows.
  1. Build aosp_taimen-userdebug and flash it.
  2. make -j SoftKeyboard
  3. adb install -r $OUT/system/app/SoftKeyboard/SoftKeyboard.apk
  4. adb shell ime enable com.example.android.softkeyboard/.SoftKeyboard
  5. adb shell pm create-user test_user
  6. adb shell am switch-user 10
  7. adb shell locksettings set-password aaaa
  8. adb shell wm dismiss-keyguard
  9. Make sure that the IME switcher icon is not shown at the right
     end of the password field.
Change-Id: I6e7d7353c2b5b1da5d460ae005fb2585f85fb1c4
2019-02-05 07:55:28 -08:00
Yohei Yukawa
629271aa85 Improve API documents of some IME query APIs
This is a follow up CL to my previous CL [1], which enabled following
IME query APIs to return the result based on the caller's user ID, not
based on the current IME user, even when they get called from
background users.

 * InputMethodManager#getInputMethodList()
 * InputMethodManager#getEnabledInputMethodList()
 * InputMethodManager#getEnabledInputMethodSubtypeList()

This CL just clarifies it in the API documents.

This is purely a document fix.  There should be no behavior change.

 [1]: I192a0f5a1375170d17a4c08af94f23966dbaea8b
      7f8ee4b9dd

Bug: 13002424
Bug: 122164939
Test: make -j checkbuild
Change-Id: I55f51e211a8a47c01469e2d93b04c5c864f0b9ea
2019-02-05 07:50:36 -08:00
Felipe Leme
aba2ef4af2 Merge "Made ContentCapture APIs available for testing." 2019-02-05 15:20:04 +00:00
Felipe Leme
0a64976a09 Merge "Refactored how initial content capture events are sent." 2019-02-05 15:15:17 +00:00
Jakub Gielzak
79bceebe32 Restrict reflection access to mLayoutParams
Users should rely on the getter / setter. The setter additionally
guarantees internal state correctness.

Bug: 123768937
Test: n/a

Change-Id: Ia2dcbe9db3fdeab8aeac9b80dcfaaa0932724dc2
2019-02-05 12:51:52 +00:00
Felipe Leme
19652c0c27 Made ContentCapture APIs available for testing.
Test: atest CtsContentCaptureServiceTestCases
Test: m update-api

Bug: 123584359
Bug: 119187075

Change-Id: I4ece03de6c7994451dbb9d0ce36d37f20656d3e0
2019-02-04 21:09:16 -08:00
Tarandeep Singh
73f9f9bf8f Merge changes Ib3997487,Ifed8351b
* changes:
  Link InsetsController to IME (IME transitons 4/n)
  Send IME control to client
2019-02-05 03:56:58 +00:00
Felipe Leme
3fe6e92440 Make ContentCapture calls directly from the UI thread.
Most calls are bufffered anyways, so by not using a handler we save time spent
on getting a pooled lambda and posting to the the handler.

The only "expensive" operation is flushing, but it makes a oneway binder call
so it might be fine (and if necessary, we can optimize it later).

Bug: 123307965
Test: atest CtsContentCaptureServiceTestCases
Change-Id: I7182c8e193f58fa000396fdb3003e771214bf79b
2019-02-04 18:30:12 -08:00
Felipe Leme
01297698a1 Refactored how initial content capture events are sent.
The overall workflow of Content Capture is:
 - send initial structure
 - send deltas afterwards

Initially, the initial structure was being reported one view at time, which was causing janking.
This CL changes it so while that while the initial structure is being laid out, the content captures
are held. Then after it's finished, it traverses the structure and sends the initial events.

This change also allowed use to optimize the performance by caching the following state:
 - View.isImportantForContentCapture()
 - View.getContentCaptureSession()
 - Context.getContentCaptureManager()

Besides the performance improvements, this approach also has the following advantanges:
- It sends the VIEW_APPEARED events for the parent views before the events for the children.
- It send events to notify when the view structure layout is ready.

Bug: 123307965
Test: atest CtsContentCaptureServiceTestCases
Test: m update-api

Change-Id: I6db7cc11c6edf65cbffe42187fda82c84c3665ff
2019-02-04 18:28:15 -08:00
Sumir Kataria
471709aef4 Don't allow reflection on ViewConfiguration#sHasPermanentMenuKey.
This seems to be used to force action bar to show an overflow
menu.  Perhaps this functionality needs to exist in Toolbar,
but after discussion with the team, we have decided it does not
need to be supported in this fashion any longer.

Bug: 123768915
Test: No API or behavior changes
Change-Id: I8e311133faec599f4dee635e261507521318260e
2019-02-04 16:20:19 -08:00
Ashley Rose
55f9f92545 @InspectableProperty coverage for android.widget
A few getters for view properties have been added where they were
missing. CTS tests for the new APIs are pending in b/123894719.

Test: m framework
Bug: 120492712
Change-Id: I743ce693d384eaf749ced3db7f81bda7d19ed275
2019-02-04 19:11:56 -05:00
Sumir Kataria
867b901c7e Don't allow reflection on ScaleGestureDetector#mSpanSlop.
This is a value provided by ViewConfiguration that is standardized
across the device.  There are two problems in changing this:
  1. inconsistent behavior with the rest of the uses
  2. modifying this would open the door to modifying all slops,
     which is infeasible and has no good API story

Bug: 123769434
Test: No API or behavior changes
Change-Id: I30bc9d065be8633752a67bd0faa9eafe1678e843
2019-02-04 15:29:50 -08:00
TreeHugger Robot
b031e8e7cb Merge "SurfaceView: Check correct OPAQUE flag for background visibility." 2019-02-04 22:34:43 +00:00
Ashley Rose
aed477d58a Merge "Add InspectionCompanionProvider" 2019-02-04 22:28:51 +00:00
Jorim Jaggi
7974259907 Better interpolation and duration for animations
Test: Open IME
Bug: 111084606
Change-Id: I3c64fe8b772a8164573c8fe3de94d3573e8cd238
2019-02-04 20:55:01 +00:00