Commit Graph

10626 Commits

Author SHA1 Message Date
Adrian Roos
ba5aaf1867 Merge "DisplayCutout: Only dispatch to apps requesting it" 2017-12-12 21:15:59 +00:00
TreeHugger Robot
659f6b2204 Merge "Fix bug when generating the textclassifier intent." 2017-12-12 17:35:25 +00:00
Adrian Roos
2b0dcb3fd2 DisplayCutout: Only dispatch to apps requesting it
Fixes a compatibility issues, where apps that were not expecting
a cutout were dispatched one anyway, which caused the WindowInsets
dispatch to continue down the hierarchy even though the SystemInsets
were consumed by the app.

To avoid this, we pre-emptively consume the cutout for any apps that
did not request to be laid out in the cutout area. This is safe,
because for apps that don't request it, the status bar will take care
of consuming it, or they won't be laid out in the cutout at all.

If apps still need to know where the cutout is, they can query for it
via View.getRootWindowInsets().

Fixes: 65689439
Bug: 70490585
Test: atest android.view.cts.DisplayCutoutTest
Change-Id: If06674c619f095d4105be1b3a511fb5823b63d2b
2017-12-12 18:16:27 +01:00
TreeHugger Robot
ac6aaf5fdd Merge "Nullcheck to fix Autofill CTS" 2017-12-12 05:47:48 +00:00
TreeHugger Robot
950c769caf Merge "Convert screenshot hw Bitmap to sw Bitmap for screenshot preview." 2017-12-12 02:07:10 +00:00
Eugene Susla
dfb43327da Nullcheck to fix Autofill CTS
Test: presubmit
Fixes: 70506475
Change-Id: I187bed4889a4901a7137a2995178ea651ed09186
2017-12-11 15:35:12 -08:00
TreeHugger Robot
a21ae5cb5d Merge "Fix resizing when hardware renderer is off." 2017-12-11 19:36:57 +00:00
Abodunrinwa Toki
46664a88fe Fix bug when generating the textclassifier intent.
Our automated tests should have caught this issue, but they weren't run
 on the offending cl (I294f7e4d16c98c6512d56d08d488b204c1f91d47).

Fixes: 70279108
Test: bit FrameworksCoreTests:android.view.textclassifier.TextClassificationManagerTest
Change-Id: I99ced41a7c92bece02754fc72966c5440752d8d6
2017-12-11 17:44:13 +00:00
Jeff Sharkey
27674aedc0 Merge "Add auto-doc support for @StringDef." 2017-12-11 16:47:13 +00:00
TreeHugger Robot
b8f2728a78 Merge "Prevent reporting fake package name - framework" 2017-12-09 19:51:00 +00:00
Svet Ganov
240aed987c Prevent reporting fake package name - framework
Test: added AccessibilityEndToEndTest#testPackageNameCannotBeFaked
      cts-tradefed run cts -m CtsAccessibilityServiceTestCases
      cts-tradefed run cts -m CtsAccessibilityTestCases

bug:69981755

Change-Id: I13304efbee10d1affa087e9c8bc4ec237643283e
2017-12-09 09:04:24 -08:00
Tor Norbye
60f1ee2df7 Merge "Switch @IntDef from long to int, and add @LongDef" 2017-12-09 15:10:47 +00:00
Jorim Jaggi
096959932b Merge "Lock free animations (1/2)" 2017-12-09 14:23:37 +00:00
Jorim Jaggi
21c39a7771 Lock free animations (1/2)
First CL that introduces SurfaceAnimator/LockFreeAnimator

We start our synchronized app transition journey by showing that
the concept works by using WindowState animations as proof of
concept.

The main class in this CL are SurfaceAnimator and
SurfaceAnimatorRunner. When we start an animation on a Window, we
create a new bufferless surface, called "The Leash", in the
hierarchy and attach the surface of WindowState onto it, while
attaching the leash onto the old surface parent which is still
responsible for z-layering.

Then, we pass off the Leash into SurfaceAnimationRunner, which then
changes the surface properties of Leash in every animation frame,
without holding the WM lock. While it's doing that we can still
update the z-layering of the window, or even relayout the window
of needed - the important surfaces for this are still under WM's
control.

In case the animation is finished the window surface gets
reparented to its original parent, and the leash is abandoned.
Note that the reparenting is done in the same transaction as
processing the animation finish, such that we don't end up with
a flicker in case of a disappearing animation, where the window
surface gets destroyed.

In case the animation needs to be cancelled, WM can revoke control
of the leash by reparenting the window surface. Even if the
cancellation signal is heavily delayed, WM immediately regains
control over the surface by reparenting it within a transaction.

We also introduce the concept of animating a WindowContainer. We
clean up isAnimating:
- isLocalAnimating: is the container itself animating
- isAnimating: is the container or one of its parents animating
- isSelfOrChildAnimating: is local animating or any child
animating.

SurfaceAnimationRunner also needs it's own thread so it's not getting
bogged down by any WM lock contention by processing regular
animation frames. We call that thread android.anim.lf (lockfree).

Now, imagine that SurfaceAnimationAnimator would sit behind an IPC in
another process and instead of animating WindowState, we'd animate
AppWindowToken. Then, synchronized app transitions would be done.

Test: go/wm-smoke
Test: SurfaceAnimatorTest
Test: SurfaceAnimationRunnerTest
Test: WindowContainerTests
Bug: 64674361
Change-Id: I10d41f7a289ab2158da3f2f1c3ddd78edd1efc86
Exempt-From-Owner-Approval: Tiny change unrelated to display management.
2017-12-09 14:23:03 +00:00
Tor Norbye
f740c7ea08 Switch @IntDef from long to int, and add @LongDef
This CL mirrors changes made to the android.support.annotation version
of IntDef, to keep the usage and semantics identical (though the
internal version of @IntDef and @LongDef are of course hidden and not
part of the SDK.)

Test: These annotations have source retention and therefore have
no runtime impact; the change was compiling the SDK.

Change-Id: Idaf47e8d983c88be1bd8f938615c86611014b45a
2017-12-08 20:54:50 -08:00
TreeHugger Robot
21084779c5 Merge "Improved AccessibilityNodeInfo.toString()." 2017-12-09 01:53:11 +00:00
Jeff Sharkey
5db9a91135 Add auto-doc support for @StringDef.
Behaves pretty much the same as @IntDef, but now supports "suffix"
in addition to "prefix" when matching constants.

Test: manual docs output looks sane
Bug: 70406696
Change-Id: I35064b0f9f36f1f13ccdb40302d818a004014f15
2017-12-08 17:33:40 -07:00
Felipe Leme
ac645bae45 Improved AccessibilityNodeInfo.toString().
Test: manual verification
Bug: 70292857

Change-Id: I2d81071402c429ed29e6c5b443956b085944e12f
2017-12-08 14:05:09 -08:00
Tarandeep Singh
d8d03a8e1b Move IME related API methods from IMM to IMS.
InputMethodManager is public InputMethod API for apps. The methods
that take Window-token as parameter are restricted to system
and/or IME developers. Such methods should really live
in InputMethodService.
This CL deprecates such methods in IMM and moves them to IMS.

This is the first step towards simplifying IME APIs.

Bug: 70282603
Test: atest InputMethodManagerTest
Change-Id: I3163f3cbe557c85103ca287bee0874a3b4194032
2017-12-08 10:40:38 -08:00
Adrian Roos
dcc92eda11 Adjust window layout for DisplayCutout
Add policy around how the display cutout should influence window layout:
- if not requested, windows should not overlap with the display cutout
 - except windows that asked for LAYOUT_IN_SCREEN | LAYOUT_INSET_DECOR,
   which overlap only with a top cutout, provided they did not request any FULLSCREEN mode.
- the content frame must never overlap with the display cutout
- adds FLAG2_LAYOUT_IN_CUTOUT to explicitly ask to be laid out in the cutout area.

Bug: 65689439
Test: atest com.android.server.policy.PhoneWindowManagerLayoutTest
Change-Id: I3a966bc78ef7a4e076104a996799369c60ab7de1
2017-12-08 14:45:18 +01:00
Tarandeep Singh
89a6c48a8b Add support for VR InputMethod.
This change adds support for VR-only IMEs in InputMethod framework.
In order to set this VR IME, setVrInputMethod(ComponentName) should be
called by VrManager.

When VrManager calls setVrInputMethod(), IMMS changes updates
the selected input method in a transient way i.e. it doesn't
update the Settings or input history. Once VR mode finishes,
it restores last input from settings.

Bug: 63037786
Test: Manually using the sample app in bug.

Change-Id: I1db7981b5198e7e203d4578cae7e5b6d20037d0d
2017-12-08 00:55:11 +00:00
TreeHugger Robot
ac74dc42f7 Merge "Further improvements when app forges package info for autofill:" 2017-12-07 21:05:59 +00:00
TreeHugger Robot
33203ffd18 Merge "Display Cutout: Dispatch Cutout from WindowManager" 2017-12-07 20:36:13 +00:00
Adrian Roos
5c6b622328 Display Cutout: Dispatch Cutout from WindowManager
Adds the logic to dispatch a DisplayCutout from DisplayFrames
through WindowState to the View hierarchy. Does however not yet
change how windows are laid out in response to a DisplayCutout.

The display cutout is currently never present, the following CL
will add logic to emulate a display cutout on devices that do
not have a physical one.

Bug: 65689439
Test: runtest -x frameworks/base/services/tests/servicestests/src/com/android/server/wm/WindowFrameTests.java
Change-Id: Ie4cd4b575755b66a7ffead31e28640983ef4894e
2017-12-07 19:43:33 +01:00
TreeHugger Robot
734afbe61e Merge "Moar changes for Autofill Field Classification mechanism:" 2017-12-07 17:35:23 +00:00
Felipe Leme
637e05ee0f Further improvements when app forges package info for autofill:
- Dont create a session if the component is not owned by the calling UID.
- Log metrics for forged attempts.
- Avoid possible NPEs on AutofillManager when context or client is null.

Test: cts-tradefed run commandAndExit cts-dev -m CtsAutoFillServiceTestCases -t android.autofillservice.cts.VirtualContainerActivityTest#testAppCannotFakePackageName
Test: cts-tradefed run commandAndExit cts-dev -m CtsAutoFillServiceTestCases

Bug: 69981710

Change-Id: I9695bc046f3eb8aeecfe44f80fd0366f68b2c635
2017-12-06 16:58:13 -08:00
Makoto Onuki
299504742f Merge "Extreme battery saver: Allow lowering framerate for experiments." 2017-12-07 00:18:56 +00:00
TreeHugger Robot
a8b9e2a545 Merge changes from topics "moar_fields", "fc_refactor_score"
* changes:
  Implemented autofill field classification on multiple fields and user data.
  Refactored the FieldsClassification score mechanism.
2017-12-06 23:03:17 +00:00
TreeHugger Robot
dac644cd4a Merge "Deprecate inKeyguardRestrictedInputMode" 2017-12-06 22:27:51 +00:00
John Reck
9f51644abf Extreme battery saver: Allow lowering framerate for experiments.
Bug: 68769804
Test: manual
Change-Id: Ic0c95f32c7ba6d86a997997e480e6d8a5f228f25
2017-12-06 13:59:19 -08:00
TreeHugger Robot
ed29cd94f5 Merge "targetSdkVersion float property sanitization" 2017-12-06 21:39:03 +00:00
Felipe Leme
329d04097e Moar changes for Autofill Field Classification mechanism:
- Changed max score to float (range 0.0 - 1.0).
- Replaced getTopMatch() to getMatches().
- Created a Scorer interface with a default edit-distance implementation.
- Added a isFieldClassificationEnabled() method.

Test: atest CtsAutoFillServiceTestCases:FieldsClassificationTest
Test: atest CtsAutoFillServiceTestCases:EditDistanceScorerTest
Test: atest CtsAutoFillServiceTestCases:UserDataTest
Test: atest FrameworksCoreTests:SettingsBackupTest

Bug: 68045531

Change-Id: Ice6cbf548053b86b47980d9664a3a21219c0ff08
2017-12-06 13:14:15 -08:00
Felipe Leme
5672defaa6 Implemented autofill field classification on multiple fields and user data.
Test: atest CtsAutoFillServiceTestCases:FieldsClassificationTest
Test: atest CtsAutoFillServiceTestCases:FieldsClassificationScorerTest
Test: atest CtsAutoFillServiceTestCases:UserDataTest

Bug: 68045531

Change-Id: Ia9252cb5b84236a76a1419f4a2669b2e933f5177
2017-12-06 11:20:10 -08:00
chaviw
1da9cd9b84 Convert screenshot hw Bitmap to sw Bitmap for screenshot preview.
Bitmaps created from SurfaceControl.screenshot are hardware Bitmaps. In
order to update the size for the screenshot preview, the Bitmaps need to
be converted to software Bitmaps first.

Also updated the SurfaceControl docs to make this clear.

Fixes: 69929720
Test: Notifications from lock screen and status bar show the screenshot
preview.

Change-Id: Iebc4a261216f3d965e1c98a77c27cc0cb2e442af
2017-12-06 10:48:11 -08:00
John Reck
c888788cb9 targetSdkVersion float property sanitization
Bug: 70242902
Test: CTS tests checking for exception still pass
Change-Id: I77dd772a6cb7077de058a3ca85b984c2c3f7321e
2017-12-06 09:46:13 -08:00
TreeHugger Robot
57a69f683c Merge "Revert "Don't generate irrelevant a11y events - framework"" 2017-12-06 16:48:16 +00:00
Tomasz Mikolajewski
711f1f9caf Fix resizing when hardware renderer is off.
Dirty rect offsets and canvas offsets were incorrectly set.

Cherry picked from: b02004c5e4ecfc9b1df49200ebcaa24883c35b0e
and 223fee602408fdd62ac23f7d59406ffe7719e6be.

Test: Resize a test app with HW acceleration disabled. Confirm no
      regressions with HW enabled - eg. Gmail.
Bug: 63601140, 64402035

Change-Id: I3e1cea4dc354457b794d3cc50456a27073cb96a0
2017-12-06 20:08:42 +09:00
TreeHugger Robot
473b5606c9 Merge "SurfaceControl: Fix Global Transaction locking error." 2017-12-06 03:51:41 +00:00
Tarandeep Singh
b360b995c9 Add new SystemApi InputMethod attr isVrOnly.
In order to support VR-only InputMethod, new attribute 'isVrOnly' is
added.

Bug: 63037786
Test: atest InputMethodInfoTest
Change-Id: Iab936df9972212f56277ef9c18d9e1f67f92a913
2017-12-05 13:37:14 -08:00
Eugene Susla
d4128ec0df Revert "Don't generate irrelevant a11y events - framework"
This reverts commit 8ddfb4794f.

Test: presubmit
Bug: 69975306
Change-Id: I05cb545eb0adc77298dddf2dea2997ef36b58a5f
2017-12-05 13:08:51 -08:00
Robert Carr
c5fc461116 SurfaceControl: Fix Global Transaction locking error.
Simple mistake. Change from one branch didn't get propagated forward
during review.

Bug: 69974273
Test: Boots
Change-Id: I4df8a939f2b38202ada2d1dc150b56ec5dc8f496
2017-12-05 11:55:40 -08:00
Abodunrinwa Toki
358b028f01 Merge "Add a signature to TextSelection and TextClassification" 2017-12-05 16:39:28 +00:00
Jorim Jaggi
b4de060971 Merge "Make SurfaceControl parcelable (1/2)" 2017-12-05 15:41:12 +00:00
TreeHugger Robot
3ce82e34e6 Merge "Refactored field detection mechanism to support multiple fields." 2017-12-04 19:46:51 +00:00
Abodunrinwa Toki
008f387e83 Add a signature to TextSelection and TextClassification
A signature is a tag that a TextClassifier may use to identify an
object it returned for a given query. This is useful for logging
purposes.

This cl also removes:
 - TextClassification.getLogType() and related logging.
   This is already covered by selection event logging.
 - TextClassification.getVersionInfo(),
   TextSelection.getVersionInfo()/getSourceClassifier().
   These are now featured in the signature.

TODO: Write a container class that generates and parses signatures.

Bug: 69791269
Test: bit FrameworksCoreTests:android.view.textclassifier.TextClassificationManagerTest
Test: bit FrameworksCoreTests:android.widget.TextViewActivityTest
Test: bit CtsWidgetTestCases:android.widget.cts.TextViewTest
Change-Id: I294f7e4d16c98c6512d56d08d488b204c1f91d47
2017-12-04 19:22:00 +00:00
Abodunrinwa Toki
9798a611f7 Merge "Primary/Secondary actions in TextClassification." 2017-12-04 18:13:25 +00:00
Felipe Leme
452886a5b8 Refactored field detection mechanism to support multiple fields.
Now instead of using FillResponse.setFieldDetection() with an object that
contains both the autofill ids an the user data, service must:
- Set global mapping through AutofillService.setUserData()
- Pass just the autofill ids to FillResponse.setFieldClassificationIds()

This CL is purely a refactoring CL - although the new API supports multiple
values and multiple fields, the implementation is still hardcode for one
value and one field (as before).

Test: atest CtsAutoFillServiceTestCases:FieldsClassificationTest
Test: atest CtsAutoFillServiceTestCases:UserDataTest
Test: atest CtsAutoFillServiceTestCases:FillResponseTest

Bug: 68045531

Change-Id: I8d846d817dfcde3a4db7abff798bb2250e1c4e7b
2017-12-04 09:56:06 -08:00
Chavi Weingarten
29fdbc67fc Merge changes from topic "hw_bitmap"
* changes:
  Update screenshot requests to render proper crop and rotation.
  Revert "Revert "Updated screenshot code to reflect native changes.""
2017-12-04 17:10:30 +00:00
Jorim Jaggi
06975df77a Make SurfaceControl parcelable (1/2)
Bug: 69145041
Test: Send SurfaceControl over binder
Change-Id: Ia3780fcb8dc2716f416eaad151aff79ea3f977a9
2017-12-04 16:43:52 +01:00
Abodunrinwa Toki
ba3856266c Primary/Secondary actions in TextClassification.
Bug: 68846316
Test: bit FrameworksCoreTests:android.view.textclassifier.TextClassificationManagerTest
Test: bit FrameworksCoreTests:android.widget.TextViewActivityTest
Test: bit CtsWidgetTestCases:android.widget.cts.TextViewTest
Change-Id: I84c652cb953f1af9b1c4077fa2a13ae23689c48b
2017-12-02 01:06:39 +00:00