Commit Graph

6553 Commits

Author SHA1 Message Date
Robert Carr
0bfaa461c6 [DO NOT MERGE] Prevent crash from early Toast surface destruction.
To understand this change it's first helpful to review Toasts.
The ViewRoot is constructed on the client side, but it's added,
to a window token controlled by the NotificationManagerService.
When we call NotificationManagerService#cancelToast, the system
will remove this window token. With the window token removed,
the WindowManager needs to destroy the surface to prevent orphaned
windows. If we destroy the Surface before removing the toast on the
client side however, we've never asked the ViewRoot to stop rendering
and we could have a crash. To solve this we just have to ensure we call
removeView before cancelToast.

Bug: 31547288
Bug: 30150688
Change-Id: I96672b0ac07ff18e9f51348f2ed42913c5a5226f
2016-12-13 21:11:10 +00:00
Sunny Goyal
bde1091f50 Merge "Preventing widgets from exceeding Bitmap memory limit" into nyc-mr2-dev 2016-12-07 19:12:24 +00:00
Alan Viverette
61edf5bbff Show popup transitions when there is no anchor set
Allow anchorRoot to be null when starting exit transition. Pushes
epicenter callback creation into startExitTransition. Adds nullability
annotations.

Bug: 33035511
Test: PopupWindowTest#testEnterExitTransition
Change-Id: Ie752a0d6b29d5eb11c160771d8a78fa6234de5bb
2016-12-05 10:56:18 -05:00
Phil Weaver
d1b7d3262b Merge "Don't invalidate list data during layout." into nyc-mr2-dev 2016-11-30 17:51:42 +00:00
Sunny Goyal
4f05d8d76b Preventing widgets from exceeding Bitmap memory limit
> Moving the size check to a comman place so that it is executed in
all related code
> Fixing size calculation when views are merged as a result of partial
update

Test: Manually tested with a dummy app
Bug: 31790171
Change-Id: Id0ea776796f156455d2cba31c8392d4875116949
(cherry picked from commit 349b412b4b)
2016-11-15 05:22:04 +00:00
Yigit Boyar
7e6fdaab69 List all methods that change data in the docs
am: 42c69b9ce4

Change-Id: I0808918c44981da63ace801c486d442ff1a99700
2016-11-11 22:31:15 +00:00
Phil Weaver
a9d976f39a Don't invalidate list data during layout.
When a FastScroller is enabled, we were invalidating the
list data during layout, which left the UI in a bad state.
Long-presses didn't work properly, and TalkBack touches
were impossible to perform.

Bug: 31160338

Test: Manually tested long pressing, and verified
that TalkBack now works with the TestActivity in ag/1567328.
Change-Id: Iecd2d597259748a3ecbf5573950e565a0e9faa42
(cherry picked from commit 2112742be6)
2016-11-02 17:37:53 +00:00
Phil Weaver
96b4a68c06 Revert "Don't invalidate list data during layout."
am: 866ded50bb

Change-Id: I191c26bfb9488d5d67514a81387a9cde95a20eb4
2016-11-02 17:20:17 +00:00
Phil Weaver
866ded50bb Revert "Don't invalidate list data during layout."
This reverts commit 456158ffc2.

Change-Id: I7a61dc34dfc81ee650ca0883fe99c0f5dc08ba75
2016-11-01 23:38:44 +00:00
Phil Weaver
06ffff6132 Don't invalidate list data during layout.
am: 456158ffc2

Change-Id: I550b63d3fd6b5f451083627dc16f369729b1e1d7
2016-11-01 22:55:11 +00:00
Phil Weaver
456158ffc2 Don't invalidate list data during layout.
When a FastScroller is enabled, we were invalidating the
list data during layout, which left the UI in a bad state.
Long-presses didn't work properly, and TalkBack touches
were impossible to perform.

Bug: 31160338

Test: Manually tested long pressing, and verified
that TalkBack now works with the TestActivity in ag/1567328.
Change-Id: Iecd2d597259748a3ecbf5573950e565a0e9faa42
2016-11-01 18:36:16 +00:00
Alan Viverette
74c6d9bd3f Add note about density scaling behavior to setImageURI
am: ac21e56f63

Change-Id: I4a85ae20023dd0589227ca7684a965a246f451fd
2016-10-12 01:36:33 +00:00
Alan Viverette
ac21e56f63 Add note about density scaling behavior to setImageURI
Bug: 27327999
Change-Id: I1e348a1fbda20fff9575261df7097fbd46381383
2016-10-11 23:32:10 +00:00
Alan Viverette
444f2043d1 Scale bitmap shaders for target density
am: 0d2a46b733

Change-Id: I8e3274a9c6047d943336827e7e0c8563e40c2ca5
2016-10-07 20:39:48 +00:00
Alan Viverette
0d2a46b733 Scale bitmap shaders for target density
Also fixes progress bar sample tile to reflect density and ensures
that ProgressBar.tileify() clones inner drawables into the correct
density.

Bug: 31841123
Test: BitmapDrawableTest#testPreloadDensity()
Test: ThemeHostTest
Test: Visual inspection of ApiDemos
Change-Id: I9dcb9817d8d91d61ff0215987247e9e7fb089c46
2016-10-07 16:23:32 -04:00
Erik Wolsheimer
e12cd3bb3b Do not listen for clock ticks, time changes, timezone changes, or time format changes when TextClock is not visible
BUG: 31840153
Change-Id: I11adf1036fb25b28aee5caba6daa1ab0d9d1f23a
2016-10-05 12:45:37 -07:00
Kevin Hufnagle
52da8b3341 docs: Added min/max values and descriptions for alpha getter/setter in ImageView am: bdb308a059 am: c012a7ed7a
am: 971696f632

Change-Id: Ie85b198034089302bd5fee74c0c01dccfe460cc3
2016-09-27 00:25:13 +00:00
Kevin Hufnagle
971696f632 docs: Added min/max values and descriptions for alpha getter/setter in ImageView am: bdb308a059
am: c012a7ed7a

Change-Id: Ib2c868e86e516ae2a2f92e4e26a8c0113237557a
2016-09-27 00:08:50 +00:00
Kevin Hufnagle
c012a7ed7a docs: Added min/max values and descriptions for alpha getter/setter in ImageView
am: bdb308a059

Change-Id: Ida297f581f7177cd92ec4157a1b735c91d2e26a4
2016-09-26 23:37:36 +00:00
Kevin Hufnagle
bdb308a059 docs: Added min/max values and descriptions for alpha getter/setter
in ImageView

Bug: 12644483
Change-Id: I269d63b50412ecea5269acb99fc09c8110e404b4
2016-09-23 15:54:42 -07:00
Mark Lu
100c1ffe2a docs: Add param info to TextView.setTextColor am: 193879a8b6 am: 544e899559
am: d1bb5fad4e

Change-Id: Ib01e3a74299eb61fe8e0e85d08a0b9963eeacad1
2016-09-23 22:34:56 +00:00
Mark Lu
d1bb5fad4e docs: Add param info to TextView.setTextColor am: 193879a8b6
am: 544e899559

Change-Id: Ic4506ceaf5c34c93b3d937137f9a4756508ff189
2016-09-23 22:25:17 +00:00
Mark Lu
544e899559 docs: Add param info to TextView.setTextColor
am: 193879a8b6

Change-Id: I5b157858dd056b2510486ad7546ab74e1287005c
2016-09-23 22:16:37 +00:00
Mark Lu
ed68ee67c2 docs: Mention SwitchCompat in Switch and toggle documentation am: 3404032dfc am: 902fb28784
am: a744c8c25a

Change-Id: I401a87f3d1a013e61e0d5a65797ce7dc1b58162d
2016-09-23 22:09:35 +00:00
Mark Lu
7df8927691 Merge "docs: Add param info to TextView.setTextColor" into nyc-dev 2016-09-23 22:09:34 +00:00
Mark Lu
a744c8c25a docs: Mention SwitchCompat in Switch and toggle documentation am: 3404032dfc
am: 902fb28784

Change-Id: I67ad867bdad8634437fe6779e027001355bbc6ae
2016-09-23 21:58:21 +00:00
Mark Lu
902fb28784 docs: Mention SwitchCompat in Switch and toggle documentation
am: 3404032dfc

Change-Id: I1df8dd7f48f095a93aaff120b0f86e2ccc6467fd
2016-09-23 21:52:30 +00:00
Alan Viverette
010ab618af Allow developer to override Material-style modes in picker dialogs
am: 8817aa9339

Change-Id: I4733798d4785459ea36a75cddfeb7358912fe9d6
2016-09-23 19:36:42 +00:00
Alan Viverette
8817aa9339 Allow developer to override Material-style modes in picker dialogs
A recent fix prevented developers from specifying Holo-style mode when
displaying a date or time picker dialog. This CL also cleans up unused
code in TimePickerDialog and documents how themeResId will be used.

Adds hidden @TestApi methods for use in CTS tests. These may be made
public later, but it's too late in MR1 for API changes.

Bug: 31586821
Test: Ice2e203983769f1ea1cfa93105eb97b6fa5176b9
Change-Id: I1b7512b7647ddd7ab987beac2c0aef4fe7cc16bc
2016-09-22 11:16:22 -04:00
Alan Viverette
1fd7fadfe4 Cancel pending selection before filtering input
am: 57fe701ddf

Change-Id: I54c33948716e7b37976c65b0f822d626a518b03a
2016-09-12 22:08:43 +00:00
TreeHugger Robot
a4e2b2a1c1 Merge "Cancel pending selection before filtering input" into nyc-mr1-dev 2016-09-12 21:57:15 +00:00
Robert Carr
5712f5474a PopupWindow: Don't ignore top decorations in getMaxAvailableHeight.
am: 701d73084d

Change-Id: Ie8fba517534ca2bd2324b3d88e05b8854700bcc4
2016-09-12 21:26:11 +00:00
Rob Carr
33c879fe14 Merge "PopupWindow: Don't ignore top decorations in getMaxAvailableHeight." into nyc-mr1-dev 2016-09-12 18:43:42 +00:00
Aurimas Liutikas
edaac91993 Fix SearchView measure for UNSPECIFIED height.
am: f6a50be25c

Change-Id: If436923fe690252efb224a072ac0c79ddb9d58d9
2016-09-10 00:29:07 +00:00
TreeHugger Robot
fceb3598f9 Merge "Fix SearchView measure for UNSPECIFIED height." into nyc-mr1-dev 2016-09-10 00:18:51 +00:00
Aurimas Liutikas
f6a50be25c Fix SearchView measure for UNSPECIFIED height.
Previously it would almost always force SearchView to become 0
when height mode was UNSPECIFIED.

Bug: 31302290
Change-Id: Icd2116b84951b1b967666147dbc5762d996408e6
2016-09-09 15:32:55 -07:00
Robert Carr
701d73084d PopupWindow: Don't ignore top decorations in getMaxAvailableHeight.
getMaxAvailableHeight is ignoring the top insets, while
findDropDownPosition is not. This is causing getMaxAvailableHeight
to return a fits above position that findDropDownPosition will think
is too large.

Bug: 31048766
Change-Id: Ifa57cb4ebe0944c701a6f38b58d4f144d8b9199c
2016-09-09 12:00:19 -07:00
Alan Viverette
57fe701ddf Cancel pending selection before filtering input
There may be a pending selection from a previous filter() call, but the
current filter() call may return an empty string without posting a new
pending selection.

Bug: 31049172
Change-Id: I2cb88b3283a3705b6c85d61f26951c35d2b0acd2
2016-09-09 14:29:35 -04:00
Svet Ganov
0c3d70a1f4 [DO NOT MERGE] Remove toast window immediately
am: 6367e4ed30

Change-Id: Ie3fa91540cf941aa5156597899c0b5dff37ec87e
2016-09-08 23:56:07 +00:00
Svet Ganov
6367e4ed30 [DO NOT MERGE] Remove toast window immediately
To address a security issue where a toast window can be
used by an app to overlay other apps without a permission
we now allow legacy apps to be able to put at most one
toast window on the screen to prevent adding the same
window over and over again to go around the new restriction
that toast windows are always removed after a timeout.
This change ensures that Toast removes its window immediately.

bug:31340854

Change-Id: Ia7f90844eb64b583321103d090e4407038b41547
(cherry picked from commit 1777c91f8f)
2016-09-08 23:12:11 +00:00
Svetoslav Ganov
dea62c6f58 Prevent apps to overlay other apps via toast windows
am: aa07653d2e

Change-Id: I309615a989eade43401b086da42ff6522d000b68
2016-09-02 23:36:59 +00:00
Svetoslav Ganov
aa07653d2e Prevent apps to overlay other apps via toast windows
It was possible for apps to put toast type windows
that overlay other apps which toast winodws aren't
removed after a timeout.

Now for apps targeting SDK greater than N MR1 to add a
toast window one needs to have a special token. The token
is added by the notificatoion manager service only for
the lifetime of the shown toast and is then removed
including all windows associated with this token. This
prevents apps to add arbitrary toast windows.

Since legacy apps may rely on the ability to directly
add toasts we mitigate by allowing these apps to still
add such windows for unlimited duration if this app is
the currently focused one, i.e. the user interacts with
it then it can overlay itself, otherwise we make sure
these toast windows are removed after a timeout like
a toast would be.

We don't allow more that one toast window per UID being
added at a time which prevents 1) legacy apps to put the
same toast after a timeout to go around our new policy
of hiding toasts after a while; 2) modern apps to reuse
the passed token to add more than one window; Note that
the notification manager shows toasts one at a time.

bug:30150688

Change-Id: Ia1dae626bd9e22541be46edb072aa288eb1ae414
2016-09-02 14:00:07 -07:00
Mark Lu
3404032dfc docs: Mention SwitchCompat in Switch and toggle documentation
Bug: 19574556
Change-Id: I2ebb504b144a442d90cfdf6ab4b407726a3b896f
2016-09-02 10:13:17 -07:00
Robert Carr
a732ea6c1f PopupWindow: Gravity fixes.
am: 085160612d

Change-Id: Ia9477ead7cf1cdd942817f2f427053c6187a1cdf
2016-08-31 19:26:55 +00:00
Rob Carr
8330a91def Merge "PopupWindow: Gravity fixes." into nyc-mr1-dev 2016-08-31 19:21:52 +00:00
Mark Lu
193879a8b6 docs: Add param info to TextView.setTextColor
Bug: 6617101
2016-08-30 17:36:52 -07:00
Ned Burns
20ad073581 Add rotary encoder support to scrolling containers
Change-Id: I1b7a2a60ac9864f2639af81fff810db601b2fbd4
2016-08-29 20:09:23 -04:00
Adam Powell
ee2f4d890e Fixes for ImageView drawable visibility dispatch am: 06f9eb8b62
am: fd86f7fdfd

Change-Id: I155ed970c7f58895419778f01eebc5babb141c33
2016-08-27 01:25:05 +00:00
Adam Powell
fd86f7fdfd Fixes for ImageView drawable visibility dispatch
am: 06f9eb8b62

Change-Id: I8b7d8c73f0a718963a191fd5460517e5a7445974
2016-08-27 01:19:28 +00:00
Alan Viverette
c328f042a6 Set up view state before attaching, jump drawables if needed
View attachment calls jumpDrawablesToCurrentState(), so the view state
needs to be set up prior to attachment. For views that are already
attached but are being moved to a new position, manually jump.

Cleans up comments in methods that were modified.

Bug: 29978498
Change-Id: Ica27b2c60ad7ee98b9d1e4912c4f8b8c248af88d
(cherry picked from commit 26489e1688)
2016-08-27 01:17:22 +00:00