Commit Graph

8876 Commits

Author SHA1 Message Date
Joanne Chung
9b316222ff Merge "Add debug logs to help clarify the issue" into sc-dev 2021-03-11 14:03:23 +00:00
Joanne Chung
3cda8bd49f Add debug logs to help clarify the issue
We receive translation doesn't work issues but we don't have enough
log information to help debugging the issue. To help clarify issue

- Add more information when dumpsys activity information
- We use Log.isLoggable() to control if the debug log need to be
printed. But for the development phase, we enable print log on the
debuggable ROM, we will delete it before platform release.

Bug: 181975692
Test: manual. adb shell dumpsys activity <myactivity> --translation
(Can find dumpsys result of sample app in bug 182433547)

Change-Id: I4a9a1667a544fc4d1654c5f297d365a8288b1f4a
2021-03-11 16:34:44 +08:00
George Mount
73046dc2f6 Merge "Use spring animation for stretch overscroll" into sc-dev 2021-03-11 00:43:04 +00:00
George Mount
167dea1218 Merge "Compatibility feature USE_STRETCH_EDGE_EFFECT_BY_DEFAULT" into sc-dev 2021-03-10 23:15:21 +00:00
Adam He
a47c17768c Merge "Full refactor of Translation APIs." into sc-dev 2021-03-09 19:05:54 +00:00
George Mount
61324dbfcc Use spring animation for stretch overscroll
Bug: 171228096

Use the spring animation from the prototype in
EdgeEffect.

Test: manual testing for fling and recede

Change-Id: I7eec03a98f5d26153512ba402d6bb5bc5dc70ffb
2021-03-09 16:47:01 +00:00
George Mount
659dc01e5b Compatibility feature USE_STRETCH_EDGE_EFFECT_BY_DEFAULT
Bug: 171228096

Added two ChangeIds for stretch overscroll:

USE_STRETCH_EDGE_EFFECT_BY_DEFAULT makes stretch overscroll
the default.

USE_STRETCH_EDGE_EFFECT_FOR_SUPPORTED makes stretch overscroll
the default for applications that use the new EdgeEffect
constructor that accepts an AttributeSet. This indicates
knowledge of stretch overscroll APIs and can be a proxy for
supporting stretch overscroll.

Test: Both flags on apps that support and don't support new api

Change-Id: If2ec832c9656116fe1aa64d33682c489abbde30f
2021-03-08 21:39:58 +00:00
TreeHugger Robot
b6d634df79 Merge "Add a way to set the View ID of the top-level view on a RemoteViews." into sc-dev 2021-03-08 08:53:12 +00:00
Adam He
59716789f4 Full refactor of Translation APIs.
* Added ViewTranslationRequest/Response
* Added TranslationRequest/ResponseValue
* Removed single TranslationData.
* Moved service.TRequest -> view.TRequest.

Bug: 176208267
Bug: 177371091
Test: atst CtsTranslationTestCases
Change-Id: I25d4bce385d64a8eb9c2a316bd6b5a23e14fb14e
2021-03-05 17:51:03 -08:00
TreeHugger Robot
a9171adcbe Merge "Correct API for new sizes in App Widgets." into sc-dev 2021-03-05 22:44:57 +00:00
Pierre Barbier de Reuille
a4f7b7b1d4 Add a way to set the View ID of the top-level view on a RemoteViews.
Bug: 181985606
Test: atest CtsWidgetTestCases:android.widget.cts.RemoteViewsTest
Change-Id: I2bcd16bef6cfa9a1461c519239dd6a31558eca64
2021-03-05 22:20:06 +00:00
Nader Jawad
6f2ee4b4a0 Merge "Wire SKSL based stretch shader to HWUI" into sc-dev 2021-03-05 03:14:55 +00:00
Pierre Barbier de Reuille
3e443e6b24 Correct API for new sizes in App Widgets.
This follow recommendations from the API council review.

Based on those recommendations: I updated the API and updated the
comments to make the function behavior clearer.

Bug: 181611658
Test: atest android.widget.cts.RemoteViewsSizeMapTest
Test: Local widget to check rendering
Change-Id: Ie9fcedbc7b18b83f6d1220f99240f264e53e3649
2021-03-04 23:27:08 +00:00
Joanne Chung
41a214c2a7 Merge "Make SelectionActionModeHelper hardcoded constants configurable." into sc-dev 2021-03-04 02:30:32 +00:00
Nader Jawad
6701a6014f Wire SKSL based stretch shader to HWUI
--Ported SKSL based stretch shader from OpenGL prototype
--Hooked up the stretch APIs in RenderNode to the stretch
shader.
--Updated RenderNode layer logic to promote the RenderNode to
a layer if there is a stretch to be applied to it in order
to feed the layer as input to the stretch shader

Bug: 179047472
Test: builds + sample overscroll stretches + updated CTS test
Change-Id: I744ff70099fe251ce07f23d067bf13444a468c08
2021-03-03 14:56:17 -08:00
Joanne Chung
a6d3ac4721 Make SelectionActionModeHelper hardcoded constants configurable.
Read the selection timeout value from ViewConfiguration,
ViewConfiguration is statically configurable by the OEM. OEMs can
set the value which works on their device before shipping it.

After privacy sync, we can make the selection context size
configurable by DeviceConfig but we need to provide a
reasonable upper bound. The value is 240 after experiment.

Bug: 169042855
Test: atest CtsTextClassifierTestCases
Test: atest CtsWidgetTestCases:TextViewTest
Test: atest android.widget.TextViewActivityTest
Test: manual. Changes values by command and checks the values.

Change-Id: I59346fdc3b482bca586c13ba6c653d1e9b593922
2021-03-02 14:13:48 +08:00
Seigo Nonaka
0de34e9d87 Override isRestricted for preventing unexpected resource loading
Bug: 179461812
Test: atest FontResourceTest
Change-Id: Ifb731310d31b80522bc82052625716083cac9e6f
2021-03-01 19:23:10 -08:00
Pierre Barbier de Reuille
4e14c35736 Merge "Framework implementation of go/widgets-dynamic-colors" into sc-dev 2021-02-24 20:16:40 +00:00
TreeHugger Robot
e4c9e20df0 Merge "Add edge effect type accessors for views that support it" into sc-dev 2021-02-24 16:32:07 +00:00
Pierre Barbier de Reuille
4219de7ded Framework implementation of go/widgets-dynamic-colors
Bug: 179783721
Test: atest CtsWidgetTestCases:android.widget.cts.RemoteViewsThemeColorsTest
Change-Id: I622e79ed8738dc862790191bf9fcf44b0af35c8e
2021-02-24 15:13:29 +00:00
TreeHugger Robot
f6d8a8390b Merge "Update toast parameters instead of re-adding" into sc-dev 2021-02-24 00:34:02 +00:00
Stevie Kideckel
82d0290282 Merge "Add tint list/mode APIs to AnalogClock" into sc-dev 2021-02-23 22:47:59 +00:00
Stevie Kideckel
990269dd07 Merge "Expose tint lists and other runtime functionality to RemoteViews" into sc-dev 2021-02-23 10:18:10 +00:00
George Mount
7954a1afaa Add edge effect type accessors for views that support it
Bug: 171228096
The edge effect type attribute is supported in
ScrollView, HorizontalScrollView, and ListView, so
those views must provide accessor methods for the
edge effect type. This CL adds them.

Test: I5684df2a21cfeaefeac01290f7681e5c5beebd7c
Change-Id: I93db702995401bf890217e8001cfe0664ac51c81
2021-02-22 19:52:40 +00:00
TreeHugger Robot
d90f98587f Merge "ListView implementation for stretch overscroll." into sc-dev 2021-02-22 18:21:25 +00:00
Stevie Kideckel
41c60e0ccb Expose tint lists and other runtime functionality to RemoteViews
Bug: 180086170
Test: sample app using new methods, atest
Change-Id: I5aa5476d95d6c9fb992c4548d97f577234d747a7
2021-02-22 15:09:18 +00:00
Stevie Kideckel
1f01cf90c5 Add dark mode apis for setting colors and icons
Bug: 180494787
Test: sample app
Test: atest RemoteViewsTest
Change-Id: I685804c5d0fe51b75508ec5ba7c122e75ad750da
2021-02-22 11:47:36 +00:00
George Mount
3cdfc89600 ListView implementation for stretch overscroll.
Bug: 178807038

ListView implementation for stretch overscroll. Currently
this uses the prototype offset implementation, but there should
not need to be any changes for stretch overscroll implementation.

Test: Iee68563413f40810f63119d427e6fb41f4287e41
Change-Id: Ie8bb1258caeb2c7edc36e03c1d78751d92b77b3f
2021-02-19 21:56:22 +00:00
Beverly
e8667d6c99 Update toast parameters instead of re-adding
To avoid a race condition

Test: manual
Fixes: 180615914
Change-Id: I9b39fd2f495605065c1a90ae3ffd5e59a1463fda
2021-02-19 12:49:50 -05:00
Stevie Kideckel
90362ddd27 Merge "Add checked change APIs to RemoteViews" into sc-dev 2021-02-19 09:48:25 +00:00
Stevie Kideckel
33882b673d Merge "Add RemoteViews.setBlendMode and expose target methods" into sc-dev 2021-02-17 17:37:38 +00:00
Stevie Kideckel
60e41fcc38 Add tint list/mode APIs to AnalogClock
Bug: 177997338
Test: atest
Change-Id: I12846543c4d017e19ec4bccf60eeaf7509534b07
2021-02-17 17:03:50 +00:00
TreeHugger Robot
ab25c0a0dd Merge "Consolidate ImeAwareEditText#scheduleShowSoftInput (1/2)" into sc-dev 2021-02-17 13:26:01 +00:00
Stevie Kideckel
289da0b787 Add checked change APIs to RemoteViews
Bug: 179245670
Test: built sample app to use APIs with and without collections, atest
Change-Id: I5474bfb7dc15d559867063d1d8516b8ca2ef9755
2021-02-17 12:01:28 +00:00
Pierre Barbier de Reuille
574718564e Merge "Framework changes for go/widget-size-specification" into sc-dev 2021-02-17 00:34:18 +00:00
TreeHugger Robot
6c9f4850fb Merge "ScrollView and HorizontalScrollView stretch overscroll" into sc-dev 2021-02-17 00:30:32 +00:00
Pierre Barbier de Reuille
d7541b8990 Framework changes for go/widget-size-specification
Update the framework to:

1 - Allow creating RemoteViews with a mapping from size to layouts
2 - Use the closes sized layout in any given situation
3 - Allow the launher to specify the current size when inflating a
    remote views

Bug: 179025145
Test: atest android.widget.cts.RemoteViewsSizeMapTest
Change-Id: Icf98d01bd0cf8b48c47555a1af6acb498b46b1a4
2021-02-16 21:24:11 +00:00
TreeHugger Robot
b399995df7 Merge "Placeholder implementation of stretch overscroll using offset" into sc-dev 2021-02-16 17:47:50 +00:00
Ming-Shin Lu
8bcce88c86 Consolidate ImeAwareEditText#scheduleShowSoftInput (1/2)
As InputMethodManager#isActive(View) may not always predictable as
reality since the method only check if the given view has been aligned
with the current served view, but not consider if the view has an active
input connection.

Test flakiness may happen when verifying showSoftInput should be invoked
after onStartInput but the event stream shows the reversed sequence.

Consolidate scheduleShowSoftInput by checking
IMM#hasActiveInputConnection to make sure showSoftInput request should
invoked after the input connection activated by the given focus view.

Bug: 176697749
Test: atest --iterations 100 KeyboardVisibilityControlTest#\
      testImeInvisibleWhenForceStopPkgProcess_Full
Change-Id: I466a93e2b4706ae809ac50dc16dc8e4ffa7c2f1c
2021-02-17 01:02:34 +08:00
Oli Lan
0e588cc322 Merge "Add ClipDescription method to determine if the clip is styled text." into sc-dev 2021-02-15 16:14:15 +00:00
George Mount
97f04fe7d3 ScrollView and HorizontalScrollView stretch overscroll
Bug: 178807038

Modify ScrollView and HorizontalScrollView to support
stretch overscroll.

Test: I18820794f2511ff4b7df1c5c6a9d7a2d5fafeaa0
Change-Id: I1370b702ce7331269744033c6acb61b84519c853
2021-02-12 21:12:07 +00:00
Stevie Kideckel
bc1d288d62 Add RemoteViews.setBlendMode and expose target methods
Bug: 180086170
Test: sample app,atest
Change-Id: I2323d297412afb64d142bddb6608978ccc8d292f
2021-02-12 16:38:55 +00:00
George Mount
f1de89b16c Placeholder implementation of stretch overscroll using offset
Temporarily use an offset RenderEffect for the stretch overscroll.
This makes it possible to visually validate the effect and start
writing CTS tests to ensure it is functioning.

Bug: 178807038
Test: Iab32812bfa626ae6932f52c1a9af78069b5dc6ac
Change-Id: I5b0da0e669d36f4149cd58b4b3aff149a1fa7e14
2021-02-11 23:17:16 +00:00
TreeHugger Robot
5febe8f633 Merge "Clean up: Remove mIsSentenceSpellCheckSupported since it is always true." into sc-dev 2021-02-11 20:14:47 +00:00
George Mount
0901fc33f7 Update the EdgeEffect API
Bug: 178807038

EdgeEffect adds getDistance() to allow the developer to
determine how much of the pull was consumed by the EdgeEffect.
onPullDistance() is similar to onPull() except that it returns
the consumed pull distance.
A new constructor was added to allow EdgeEffect attributes to
apply to Views.

Test: I7f6d6153c1a5bc714ad1935ae0c78907e6839547
Change-Id: Ie29b081cb34af0219287bd1702fea8d273a78d74
2021-02-10 21:23:15 +00:00
TreeHugger Robot
36192d4044 Merge "Update Toast visuals + motion" into sc-dev 2021-02-10 20:53:07 +00:00
TreeHugger Robot
0177fad845 Merge "Add edgeEffectType attribute and type property" into sc-dev 2021-02-10 17:57:54 +00:00
Beverly
75a4033db8 Update Toast visuals + motion
Puts Toast style/animation changes behind a FeatureFlag

Toasts can be added via Toast APIs OR legacy apps can add the
window directly. Because toast windows can be added directly by legacy
apps, DisplayPolicy.java requires that toast windows are removed
after TOAST_WINDOW_TIMEOUT.  This also means Toast windows added via
the Toast APIs are subject to this timeout. Therefore, this CL also
increases the timeout by 600ms to account for SystemUI's in/out
toast animations.

Bug: 169587378
Test: atest ToastUITest
Test: manual, rotate device while toast is showing
Change-Id: Ib17655c253f4ec4f7018cc5f7939b88a50ea5014
Merged-In: Ib17655c253f4ec4f7018cc5f7939b88a50ea5014
2021-02-10 17:08:51 +00:00
George Mount
ba1c4c4e30 Add edgeEffectType attribute and type property
Bug: 178807038

This adds the edgeEffectType property and
type attribute. These will be used to
enable stretchy edge effect for overscroll.

Merged-In: I16f20b36d9a15c08e0a37f98572ef9c9f8fbc88f
Test: new CTS test for setting/retrieving the effect type.
Test: Ic363f71d241649d15faa86434516457e62b261f4
Change-Id: I16f20b36d9a15c08e0a37f98572ef9c9f8fbc88f
2021-02-10 15:48:02 +00:00
Oli Lan
4d5c48d988 Add ClipDescription method to determine if the clip is styled text.
This adds a new method to ClipDescription to allow callers to
determine if the associated ClipData is styled text, without
accessing the ClipData directly.

This information is used by editors such as TextView or WebView
when they show a selection toolbar, in order to determine if a
"Paste as plain text" option should be shown. Currently, ClipData
must be accessed in order to do this, so a clipboard access
occurs whenever text is selected.

Avoiding these clipboard accesses is desirable because a user-visible
message may in future be shown whenever ClipData is accessed
(see b/167676460), which may cause user confusion.

Bug: 167660455
Test: new tests added to ClipDescriptionTest in CTS
Change-Id: I48bea4d11a68b198d60016b364a3cfa0b0bf277e
2021-02-10 10:06:05 +00:00