Commit Graph

7957 Commits

Author SHA1 Message Date
Vishnu Nair
9a42260be4 Merge "WM: Removes setSize from buffer-less surfaces" 2018-11-29 16:14:19 +00:00
TreeHugger Robot
8ce7d1d992 Merge "Add onActionClicked in NotificationAssistantService" 2018-11-29 15:43:29 +00:00
Tony Mak
7d4b3a5f19 Add onActionClicked in NotificationAssistantService
This is added to report clicks on actions buttons to NAS.

BUG: 119010281
Test: atest SystemUITests
Test: atest RemoteViewsTest
Test: atest NotificationManagerServiceTest
Test: Manual. Tapped on the action (both normal and contextual) and
      observed the log.

Change-Id: I381994737d8c3185d3fabf9b6c481fd01a89a634
2018-11-29 11:43:53 +00:00
Vishnu Nair
e86bd98a8b WM: Removes setSize from buffer-less surfaces
- Make a better distinction between surface bounds and buffer size by renaming setSize to
  setBufferSize and removing setSize for all buffer-less surfaces.
- Adds an error check in SurfaceControl to ensure buffer size is only set for buffer-less surfaces.
- Updates color fade surface to use passed in transaction object.

Bug:114413815
Test: go/wm-smoke
Test: atest FrameworksServicesTests:DimmerTests
Test: atest FrameworksServicesTests:SurfaceAnimatorTest
Change-Id: I88bd1452d6b3b3009e73e26986027d6a5a9efebc
2018-11-28 14:24:03 -08:00
Siyamed Sinir
a1e851c873 Make TextView.getTextDirectionHeuristic public
Test: Added new CTS tests under cts.TextViewTest
Test: atest CtsWidgetTestCases:android.widget.cts.TextViewTest

Bug: 117521460
Change-Id: I27391f69f2387cc761a7fc859423bd921601bea9
2018-11-27 17:59:18 -08:00
Abodunrinwa Toki
f14f2b63dc Merge "Do not linkify text with RLO/LRO characters." 2018-11-27 20:19:35 +00:00
TreeHugger Robot
2bad68cd1a Merge "Fixed when IntelligenceManager.notifyAppeared()/disappeared() is called." 2018-11-27 19:30:48 +00:00
TreeHugger Robot
02fc5ccc54 Merge "Made ImageView.animateTransform(Matrix) public" 2018-11-27 19:09:24 +00:00
Andrey Kulikov
3ac312acf0 Made ImageView.animateTransform(Matrix) public
ImageView.animateTransform(Matrix) is now public so we can use it in AndroidX Transitions without a reflection.
Also I fixed a bug that we forgot to clear mDrawMatrix when we provide null matrix into a method. Before it doesn't work as expected if ImageView already calculated some draw matix and we wan't to override it.

Bug: 117521477
Test: Added new cts tests for both usages with null and not null matrix
Change-Id: I9e25e1f673fabdfeb227fabc0b3635056de0a6fd
2018-11-27 15:52:17 +00:00
Abodunrinwa Toki
adc194032b Do not linkify text with RLO/LRO characters.
Also don't show smart actions for selections in text with unsupported
characters.

Bug: 116321860
Test: atest android.view.textclassifier.TextClassifierTest \
            android.text.util.cts.LinkifyTest \
	    android.text.util.LinkifyTest \
	    android.widget.TextViewActivityTest

Change-Id: Id271cab8aef6b9b13ef17f1a8654c7616f75cf13
2018-11-27 15:11:41 +00:00
TreeHugger Robot
b5297b78ad Merge "Restrict access to ImageView#mMaxWidth/Height" 2018-11-27 12:52:15 +00:00
Clara Bayarri
9e6588db04 Restrict access to ImageView#mMaxWidth/Height
These two have getters (since api 16) and setters (since api 1),
so no reason to be reflecting anymore.

Bug: 117519954
Bug: 117519983
Test: make
Change-Id: Ib8f740071c7c05b1869117ab919297d26eae7650
2018-11-27 11:39:58 +00:00
Felipe Leme
bd5f58d845 Fixed when IntelligenceManager.notifyAppeared()/disappeared() is called.
We were not calling it on all places it should. And even worse, it was called
when the view was not laid out yet, which caused a side-effect on TextViews
(as it was calling assumeLayout()).

Bug: 111276913
Fixes: 119786503

Test: manual verification on Hangouts
Test: atest android.view.cts.ViewTest \
  android.widget.cts.TextViewTest \
  android.widget.cts.EditTextTest \
  CtsAutoFillServiceTestCases

Change-Id: I685460d9b1e0428ec0e5377826a549a678f6434e
2018-11-26 15:13:57 -08:00
TreeHugger Robot
6d45ba0491 Merge "Simplified View.onProvideContentCaptureStructure()" 2018-11-26 19:17:02 +00:00
Clara Bayarri
6036858696 Restrict unsupported usage of Linear/RelativeLayout APIs
These internal accesses can be done by existing public API

Bug: 117521217, 117521667
Test: make
Change-Id: I31116551f6e5a4f8c84a811f62419302fee91c2c
2018-11-22 15:17:54 +00:00
Mihai Popa
c6950296fe [Magnifier-65] Separate builder defaults
Bug: 72211470
Test: manual testing
Change-Id: I235a0cd15dd2156a8510023ba983ef06822ca7da
2018-11-21 09:14:17 +00:00
Mihai Popa
a5c84f2980 Merge "[Magnifier-57] Add API to set overlay" 2018-11-20 11:14:28 +00:00
Mihai Popa
1ddabb2c80 [Magnifier-57] Add API to set overlay
The CL adds an API to customize what overlay will be drawn on the top of
the magnifier content. Our default is to draw a 5% white overlay to make
magnifiers distinguishable in dark contexts.

Bug: 72211470
Test: manual testing
Change-Id: I1a356813960a60f49e068c6135ded9d41429d57c
2018-11-19 19:01:46 +00:00
Sungsoo Lim
371d34ae9b Merge "Remove unused media2 widgets" 2018-11-19 01:20:07 +00:00
TreeHugger Robot
f16a3537b6 Merge "[Magnifier-55] Add API for content clamping" 2018-11-16 21:45:40 +00:00
Felipe Leme
92ab3857b0 Simplified View.onProvideContentCaptureStructure()
That method was returning a boolean to indicate whether the IntelligenceManager
should be notify, so views with virtual hierarchy could return false.

But now it returns void and always notify, which makes the API easier to
understand and use.

Bug: 117944706

Test: m -j update-api doc-comment-check-docs
Test: atest CtsAutoFillServiceTestCases

Change-Id: I216cacb6edb144239b6eabe56ab177fc2582e1aa
2018-11-16 09:19:37 -08:00
Mihai Popa
3e1aed1272 [Magnifier-55] Add API for content clamping
The CL adds API to customize the bounds relative to a view where the
magnifier content is allowed to be copied from.

Bug: 72211470
Test: manual testing
Test: atest CtsWidgetTestCases:android.widget.cts.MagnifierTest
Change-Id: I3016a34929acf029f5251d03812f17e4da4cb948
2018-11-16 16:29:44 +00:00
Philip P. Moltmann
33a19c7e86 Remove most of AppSecurityPermissions
This is a dead code that cannot even be used correctly as the
permission<->group mapping is not authorative in the platform

Hence remove the code beside the small sections still used by settings.

Test: Built
Change-Id: I09cfcb5cc6811222f77377fa20123ef954b7a309
2018-11-15 09:50:16 -08:00
Sungsoo Lim
b23d6a5c5a Remove unused media2 widgets
Bug: 119591238
Test: build
Change-Id: I8ec964f304ae1ea6d868b65f2fbeb9d5e5f39f3d
2018-11-15 15:03:02 +09:00
Felipe Leme
ebebce29f9 Merge "Minor Content Capture-related changes." 2018-11-14 23:10:03 +00:00
Felipe Leme
92736c1af1 Minor Content Capture-related changes.
- Refactored onProvideStructureForAssistOrAutofillOrViewCapture() into a common,
  hidden onProvideStructure(viewFor) method on View that (hopefully :-) makes
  it easier to understand / extend.
- Renamed / documentted some methods on TextView.

Bug: 111276913
Test: atest CtsAutoFillServiceTestCases CtsAssistTestCases \
            AssistFrameworksCoreTests:AssistStructureTest

Change-Id: I328ce3f26a42e7408015cc0014a3f707801ebeb9
2018-11-14 17:27:26 +00:00
Mihai Popa
1903cab178 [Magnifier-53] Add API around outofbounds behavior
The CL adds a public API to enable customizing magnifier's behavior when
the coordinates passed to #show would position the magnifier outside the
main application window.

Bug: 72211470
Test: manual testing
Test: atest CtsWidgetTestCases:android.widget.cts.MagnifierTest
Change-Id: I9de26e446354d0ad987a4509089fbec4ee5ef7d3
2018-11-14 14:23:03 +00:00
TreeHugger Robot
1eec951795 Merge "Added moar ContentCapture APIs (and their initial implementation)." 2018-11-13 19:40:40 +00:00
TreeHugger Robot
912963cc72 Merge "Removing mApplyTheme parameter in RemoteViews as it changes the internal state of RemoteView without parcelling the new state" 2018-11-13 18:51:56 +00:00
Felipe Leme
88eae3bc69 Added moar ContentCapture APIs (and their initial implementation).
There are 4 new APIs on View:
  - boolean setImportantForContentCapture()
  - boolean getImportantForContentCapture()
  - boolean isImportantForContentCapture()
  - boolean onProvideContentCaptureStructure()

And 4 on IntelligenceManager:
  - void notifyViewAppeared()
  - void notifyViewDisappeared()
  - void notifyViewTextChanged()
  - ViewStructure newVirtualViewStructure()

These methods are similar to the equivalent methods that are used for Autofill
and/or Assist, except for the following differences:

- The view hierarchy nodes are reported as they are rendered, rather than at
  once in a tree, recursively. Hence, the ViewStructure implementation does
  not implement the methods that add children to it, and views that provide
  virtual hierarchies must manually call IntelligenceManager to create the
  ViewStructure to their children and notify when their children are added and
  removed.
- It does not support methods added for Autofill to handle HTML pages (such
  as setHtmlInfo() and setWewbDomain()), as they're not important in the
  Content Capture context.
- Similarly, it also does not support setDataIsSensitive(), because the
  Intelligence service does not have the same restrictions as the Autofill
  service.

The CL also provides the initial implementation of these APIs, although still
full of TODOs (for example, we're not holding the events to send as a batch
yet).

Test: m -j update-api doc-comment-check-docs
Bug: 117944706

Change-Id: I43f06ce82bfe3b14d8d13fb3b2ebee223db83284
2018-11-12 22:29:26 -08:00
Sunny Goyal
40f589c685 Removing mApplyTheme parameter in RemoteViews as it changes the internal state
of RemoteView without parcelling the new state

Bug: 119437911
Test: atest CtsAutofillTest
Change-Id: I561ce28ca754d3d27f3eb9fedc1e0f702b557159
2018-11-13 00:57:37 +00:00
Mihai Popa
db68c543ca Fix handle creation on startActionMode
The CL fixes a null pointer exception happening when the selection
controller in Editor is created on startActionMode. The NPE was
introduced by I261559b5c1abe21fd8508ab72f24a5696899a074, which removed
the handle drawable loading before using the drawables for creating the
handles. The current CL adds the handle drawable loading back.

Bug: 119214395
Bug: 119189742
Test: atest CtsWidgetTestCases:android.widget.cts.TextViewTest
Test: atest android.widget.TextViewActivityTest
Test: atest android.widget.TextViewTest
Change-Id: Iba5f6b606b1aaf2124487da5642c6f3b132a061c
2018-11-08 15:53:45 +00:00
Jorim Jaggi
05ac00c630 Merge changes from topic "windowinsets-api"
* changes:
  WindowInsets: Annotate nullability
  WindowInsets: Add Builder
  WindowInsets: reimplement WindowInsets on top of Insets
  WindowInsets: make WindowInsets.inset() public
2018-11-07 16:35:06 +00:00
Mihai Popa
33e8c93551 Merge "Make text handle drawables public" 2018-11-03 13:51:15 +00:00
Mihai Popa
6315a322b2 Make text handle drawables public
The CL adds public setters and getters for the drawables used
for the insertion and selection handles of a TextView.

Bug: 117521469
Bug: 79404656
Test: atest CtsWidgetTestCases:android.widget.cts.TextViewTest
Change-Id: I261559b5c1abe21fd8508ab72f24a5696899a074
2018-11-02 11:54:43 +00:00
Adrian Roos
60f59298c7 WindowInsets: reimplement WindowInsets on top of Insets
Bug: 111829774
Test: atest WindowInsetsTest
Change-Id: Ic01c6cd46981af2e457c740c35b17c8cc9c8d25a
2018-10-30 19:09:03 +01:00
Sunny Goyal
43c970436d Adding shared element transitions support in AppWidgets
Bug: 113071278
Test: atest frameworks/base/core/tests/coretests/src/android/widget/RemoteViewsTest.java
Change-Id: I0d7698faa8d9e61913b55d34de8b7cfbb32863b1
2018-10-29 17:04:33 -07:00
John Reck
c7ddcf390f Update some docs & tweak some method names
Test: builds
Change-Id: Id0e5cf6fdb3a391136a1d314498f75e0b954ceeb
2018-10-26 13:57:12 -07:00
John Reck
8884cfc13e Merge "Rename & package shuffle" 2018-10-23 20:02:00 +00:00
Seigo Nonaka
9958c4ab21 Introduce FontStyle for future extensibility
This is a ground work for b/114479228
FontStyle is an argument of the font itemization. Currently Android
system uses weight and italic info for itemizing but maybe we will
use width and oblique style in future.
To be extensible in future, introduce FontStyle.

This CL includes:
- new class FontStyle which holds width and italic at this moment. In
  future, we may add width and oblique. (or grdual italic slant)
- Font class still returns weight/slant since they need to be immutable.
- Moved font weight constants from Font to FontStyle

Bug: 114479228
Test: atest CtsGraphicsTestCases
Change-Id: I0ba717fbf9f90ee6f760c1a0f6eda17b4bef6f43
2018-10-19 14:51:59 -07:00
Haoyu Zhang
0a04650e51 Merge "Add textLocale attributes to TextView and TextAppearanceSpan" 2018-10-19 20:30:02 +00:00
Haoyu Zhang
1137512f7c Add textLocale attributes to TextView and TextAppearanceSpan
Bug: 112390716
Test: atest TextAppearanceSpanTest TextViewTest
Change-Id: I812f76cc3acec14b9839436cc7c5cc1ef827998e
2018-10-18 15:38:30 -07:00
TreeHugger Robot
b3a793d969 Merge "Add activity options flag to force launching an activity in a new task" 2018-10-18 20:31:30 +00:00
TreeHugger Robot
02f2a315d7 Merge "Add Context.getDisplayId() to avoid possible IPC" 2018-10-16 00:20:52 +00:00
Gus Prevas
9cc966012f Fixes touch ripples on media buttons.
This change makes touch ripples appear correctly on the action buttons
on media notifications.  This involves the following changes:

- NotificationViewWrapper.onReinflated() sets the notification content
root's background to transparent rather than null when transferring the
background color to the NotificationBackgroundView.  This gives the
ripples a surface to draw on.
- The RemoteViews for the media templates are changed to use a fixed
set of buttons instead of removing and re-adding them on every update.
This prevents the update caused by whatever action the tap invokes from
interrupting the ripples.
- A method is added to RemoteViews allowing the ripple color to be
specified.  This allows us to change the ripple color to match the
foreground color of the controls, which is necessary for the ripples to
show up against a dark background.

Test: manual
Change-Id: I907f9a1a75efb48da496133ad357fc5150de4410
Fixes: 35856702
2018-10-15 09:42:06 -04:00
Yohei Yukawa
5281b6b4c0 Add Context.getDisplayId() to avoid possible IPC
ContextImpl has an internal rule that when ContextImpl#mDisplay is
null the Context is associated with the default display.  The problem
is that, as discussed in Bug 117709581, when ContextImpl#mDisplay is
null ContextImpl#getDisplay() tries to get some non-null Display
object by making an IPC to the system server, which is redundant when
the display ID is the only thing that the caller wants to know.

By having an @hide method Context.getDisplayId(), we can ensure that
display ID can be obtained without any IPC.  This enables us to
re-submit my CL [1] that aimed to instantiate InputMethodManager (IMM)
for each display but then got reverted due to a performance regression
(Bug 117434607).

There should be no developer-observable behavior change.

 [1]: I7242e765426353672823fcc8277f20ac361930d7
      c53d78e992

Fix: 117712745
Test: atest FrameworksCoreTests:android.content.ContextTest
Test: prebuilts/checkstyle/checkstyle.py -f \
      frameworks/base/core/tests/coretests/src/android/content/ContextTest.java
Change-Id: I2534530a5ce90e2620c5039d793a6454a0a1e154
2018-10-15 07:38:25 +08:00
Haoyu Zhang
5dfae05460 Change TextView.TextAppearanceAttributes.mStyleIndex to mTextStyle
Currently mStyleIndex is used as a flag int, but its default value is -1.
Rename it to mTextStyle and change the default value to 0 in order to avoid confusion.
Also fix the bug that when fontWeight is specified while not textStyle is
specified in XML, the typeface unexpectedly becomes italic.

Bug: 78873447
Test: atest TextViewTest
Change-Id: I819b8f15e1dcaae7b16f7c97b489b4ed8db494c6
2018-10-10 18:32:44 +00:00
John Reck
32f140aa67 Rename & package shuffle
Rename DisplayListCanvas -> RecordingCanvas
Move RecordingCanvas to android.graphics
Move RenderNode to android.graphics

Bug: 112709971
Test: make & boot
Change-Id: Iddeb6a89f8923ea81a1f37bbee4e9b1db8ede238
2018-10-04 16:18:12 -07:00
Mihai Popa
3d71e1f388 Merge "[Magnifier-63] Hide it for rotated/scaled textview" 2018-10-03 10:19:50 +00:00
Felipe Leme
77f85861e1 Removed afm.notifyValueChanged() optimization.
On Android P, TextView was keeping track of the last mText that was sent to
AutofillManager to avoid calling it again if the value didn't change, as that
would incur on unnecessary IPC calls from AFM to AFMService in the UIThread.

Now on Android Q this optimization is causing the method to not be called when
it should when the mText is a reference to a SpannableStringBuilder, as it's
equals() method now returns true in this case (before it was returning false,
which was a bug: if the reference didn't change, it should return true).

We have 2 options to solve this problem:

1.Fix TextView to keep a String copy of mText.
2.Remove the optimization.

This CL fixes it using #2, for 2 reasons:

1.On Android Q, the AFM calls to AFMS are async, so it's not a jankiness issue
anymore.
2.Making a copy will actually be *worse* for performance, as it would be making
an unnecessary copy for the cases where autofill is disabled.

Test: atest android.autofillservice.cts.DatasetFilteringTest#testFilter_usingKeyboard
Test: atest CtsAutoFillServiceTestCases # to make sure it didn't break anything
Fixes: 117106046

Change-Id: Ia1c69e2d7a478288f65566e862f4a43e88eca463
2018-10-01 18:14:14 -07:00