Commit Graph

8093 Commits

Author SHA1 Message Date
TreeHugger Robot
3661808cb7 Merge "Restrict reflection access to Toast's TransientNotification." 2019-02-15 21:15:51 +00:00
Shep Shapard
156ac1d73d Merge "Removing reflection access ProgressBar#mDuration" 2019-02-15 16:55:35 +00:00
shepshapard
3b07045a3f Removing reflection access ProgressBar#mDuration
For the following reasons:
1. Developers can set this via XML
2. Using this value is inferior to setting an
indeterminate drawable that implements Animatable.

Fixes: 124052713
Test: No new implementation, so no tests.

Change-Id: Ie1e23f75328cce5d8f4d317625d8f38c0a166352
2019-02-14 14:08:58 -08:00
Ralston Da Silva
17d7ce6e4a Removing hidden api usage from AutoCompleteTextView
ensureImeVisible() was added to show the keyboard in SearchDialog go/ensureImeVisible-added. A better fix would be to expose a function to setInputMethodMode(), as showDropDown() is public and can be called externally. Adding this new API in this CL.

Bug: 123768913

Test: Added tests to android.widget.AutoCompleteTextViewTest.

Change-Id: I07e53c6d5e93d1e33381f8f87f75a7dee2f2f5a5
2019-02-14 11:02:23 -08:00
Nader Jawad
9b31762790 Merge "Added public API alternatives to reflective calls on ScrollBarDrawable" 2019-02-13 17:55:48 +00:00
Yigit Boyar
0d305f224c Restrict usage of mSelectorPosition and mSelectorRect
These two fields were accessed via reflection by certain apps but
they are not really designed to be public API.

Moreover, these usages seem to come from an open source project
and I've created an issue there to notify the owners.

https://github.com/emilsjolander/StickyListHeaders/issues/497

Bug: 123768403
Bug: 123769365
Test: existing tests pass
Change-Id: I7d6beba8ea7e9b9a406ea2332bcccfd283db8196
2019-02-12 23:41:17 +00:00
TreeHugger Robot
a057c94bc5 Merge "Revert "[Magnifier-77] Show it on long press selection"" 2019-02-12 23:04:28 +00:00
Nader Jawad
93aeba8c52 Added public API alternatives to reflective calls on ScrollBarDrawable
Added public setter/getter APIs on View to set/get the track/thumb
Drawables for the vertical and horizontal scroll bars to support
configuring scrollbars programmatically in addition to xml
attributes

Change-Id: Ic0b42742e8a795fe616887369dd0e592cde5c2fa
Fixes: 123769505
Test: Added View.java test cases to verify new setter/getters
2019-02-12 14:31:49 -08:00
TreeHugger Robot
f518983925 Merge "Restrict reflection access to NumberPickers's mSelectionWheelPaint" 2019-02-12 17:39:08 +00:00
Mihai Popa
26ee00dd57 Revert "[Magnifier-77] Show it on long press selection"
This reverts commit 88fbed49af.

Reason for revert: We decided to punt this functionality to R, in order to keep consistency with WebView and Chrome. (b/119819194)

Change-Id: I625a8bca52687e3f15957f4dc4a0982c1ad28a2a
2019-02-12 13:57:47 +00:00
Aurimas Liutikas
ec0cfcbafb Merge "Update core widgets to save attribute source info." 2019-02-11 22:08:28 +00:00
TreeHugger Robot
6077ea8e2b Merge "Allow reflection access to ProgressBar#mOnlyIndeterminate." 2019-02-11 19:27:07 +00:00
TreeHugger Robot
86f957f85d Merge "Fix for Hidden API Landroid/widget/AbsListView;->mMaximumVelocity:I in ligt-grey list" 2019-02-11 19:23:01 +00:00
Yigit Boyar
39620d2f82 Merge "Add edge effect color APIs to ScrollViews" 2019-02-11 19:18:59 +00:00
Haoyu Zhang
2c282d75db Merge "Add trackingBug number for UnsupportedAppUsage of mMarquee" 2019-02-11 18:28:54 +00:00
TreeHugger Robot
da17a20286 Merge "TextClock registerContentObserver with UserHandle" 2019-02-11 17:24:58 +00:00
Mihai Popa
3df49260c4 Make ProgressBar#getCurrentDrawable() public
The CL adds ProgressBar#getCurrentDrawable() to the public API, and
transitions mCurrentDrawable in ProgressBar to dark gray list.
Developers can use getCurrentDrawable(), setProgressDrawable() and
setIndeterminateDrawable() instead of accessing mCurrentDrawable
directly.

Bug: 123769441
Test: none
Change-Id: Ia9876f97dc2ec2c69902b8281cd7876b516dbdd4
2019-02-11 10:11:52 +00:00
Matvei Malkov
b0bd3e7a04 Epicenter API for ListPopupWindow
Introduced epicenter API for ListPopupWindow to mirror the same API that we've made for PopupWindow (b/123768589). Also add mutability protection to PopupWindow epicenter rects

Bug: b/124094855

Test: All widgets tests passed. getter / setter tests introduced in
I648c169b67972c80befbeae9c37c2819eaad27d4
Change-Id: I2b79a16039d345c9c8893b815735a2811543cf60
2019-02-10 21:52:30 +00:00
Ralston Da Silva
0671c44a85 Merge "Removing hidden api usage from AutoCompleteTextView" 2019-02-10 05:10:22 +00:00
TreeHugger Robot
5333f25e37 Merge "Fix for Hidden API Landroid/widget/ImageView;->mDrawMatrix:Landroid/graphics/Matrix; in ligt-grey list" 2019-02-09 06:12:43 +00:00
TreeHugger Robot
c649af94c3 Merge "Fix for Hidden API Landroid/widget/ScrollView;->mOverflingDistance:I in ligt-grey list" 2019-02-09 01:36:34 +00:00
Sumir Kataria
08b675370a Allow reflection access to ProgressBar#mOnlyIndeterminate.
I think this one is fine to punt.  The field applies to the default
progress bar, which can only be indeterminate.  However, if someone
can't customize their themes and styles, they may end up in a
situation where they need this to be different and there is no public
API for it.  Making a public API is messy because it is really hard
to reason about and the behavior would be a no-op much of the time.
It's better to avoid adding confusion for the majority of developers.

Test: N/A
Bug: 124049927
Change-Id: Ie63429831ec803d2d3c50464176c4e6f8a30ec33
2019-02-09 00:56:57 +00:00
Ralston Da Silva
ccec37e1d1 Removing hidden api usage from AutoCompleteTextView
doBeforeTextChanged() and doAfterTextChanged() were being called to
trigger a refresh of the autocomplete suggestions when the refresh
was not automatically triggered by text input.

An androidx usage example is in SearchView, where we need to trigger
the autocomplete results manually.
https://cs.corp.google.com/aosp-kitkat/frameworks/support/v7/appcompat/src/android/support/v7/widget/SearchView.java?rcl=197708fc4fc0a6a5ede2da2479613382b561f028&l=1199
https://cs.corp.google.com/aosp-kitkat/frameworks/support/v7/appcompat/src/android/support/v7/widget/SearchView.java?rcl=197708fc4fc0a6a5ede2da2479613382b561f028&l=895

I feel this is a valid use case and added a new public api refreshAutoCompleteResults()

Bug: 123768711
Bug: 123768433

Test: Added new CTS tests for newly added api

Change-Id: Icfa6287889b4f63c00aa2ad6450e47942a9adda5
2019-02-09 00:47:48 +00:00
Rahul Ravikumar
48a7cdd434 Fix for Hidden API Landroid/widget/AbsListView;->mMaximumVelocity:I in ligt-grey list
* Use the ViewConfiguration#getScaledMaximumFlingVelocity() API instead.

Test: N/A
Change-Id: I1c66cd4cf9140c7a47630eb7aabdd529ed06b13d
Fixes: b/124051740
2019-02-08 16:45:00 -08:00
Rahul Ravikumar
cd946ba2c9 Fix for Hidden API Landroid/widget/ImageView;->mDrawMatrix:Landroid/graphics/Matrix; in ligt-grey list
* Use ImageView#getImageMatrix() and setImageMatrix() instead.

Test: N/A
Change-Id: I34b489ee872e470358be225528f4b576c753b290
Fixes: b/124051687
2019-02-08 16:32:40 -08:00
Rahul Ravikumar
420654a90d Fix for Hidden API Landroid/widget/ScrollView;->mOverflingDistance:I in ligt-grey list
* Use ViewConfiguration#getScaledOverflingDistance() instead.
* Use ViewConfiguration#getScaledOverscrollDistance() instead.

Test: N/A
Change-Id: I3d2edb8d197f1b6fc4515c8f175b9862e8f8236c
Fixes: b/124050903
2019-02-08 15:23:33 -08:00
Rahul Ravikumar
8065e8e915 Fix for Hidden API Landroid/widget/ScrollView;->mMinimumVelocity:I in ligt-grey list
* Use ViewConfiguration#getScaledMinimumFlingVelocity() instead.

Test: N/A
Change-Id: I1604032f206414171ea4a4c92fcf19dacbfbefe1
Fixes: b/124051125
2019-02-08 15:16:08 -08:00
Rahul Ravikumar
400d99a807 Merge "Fix Hidden API Landroid/widget/AbsListView;->trackMotionScroll(II)Z in ligt-grey list" 2019-02-08 22:56:29 +00:00
Yigit Boyar
08b1d993cf Add edge effect color APIs to ScrollViews
This CL adds APIs to ScrollView and HorizontalScrollView to
set edge effect colors.

Previously, edge effect fields were accessed via reflection
by many apps to obtain this functionality.
For apps targeting Q, those fields will not be accessible
anymore and instead we'll ask them to use the new APIs.

Bug: 123769386
Bug: 123768600
Bug: 124052619
Bug: 124053130
Test: HorizontalScrollViewTest, ScrollViewTest
Change-Id: I32cbf0b01658955d34662c9a9aaca87b54ab7706
2019-02-08 22:02:22 +00:00
Sumir Kataria
07d709cf78 Merge "Disallow reflection access to AdapterView#mDataChanged after P." 2019-02-08 21:11:05 +00:00
TreeHugger Robot
b9f1cae5f8 Merge "Restrict access to AbsListView internals." 2019-02-08 19:33:35 +00:00
Sumir Kataria
d80525db8e Disallow reflection access to AdapterView#mDataChanged after P.
I talked to the biggest 3p user of this API and they are resilient
to this change.  Moving forward, our advice to developers is to
use RecyclerView.

Test: N/A
Change-Id: I8de647b10ed06f1f0f4b10865fb88ac0bcc10608
Fixes: 123768524
2019-02-08 18:36:15 +00:00
Daniel Santiago Rivera
11a57f22b4 Restrict reflection access to NumberPickers's mSelectionWheelPaint
Applications reflecting into mSelectionWheelPaint do it because there is
no API for correctly updating the text size and color at runtime. Since
the NumberPicker is composed of an EditText and an additional paint to
draw the scroll wheel numbers, developers found themselves reflecting
on the paint since updating the EditText child is not enough.

This CL restrict access to mSelectionWheelPaint but add an alternative
API for updating the NumberPicker's text size and color at runtime.

Bug: 123769712
Test: NumberPickerTest
Change-Id: I9f5a0275916a6852a6378e5ffae5a9a171b9cd51
2019-02-08 10:23:02 -08:00
Matvei Malkov
3085300f7c Changes in PopupWindow API
Restriced access to private mScrollChangedListener private field and to
private invokePopup method. Removed @hide annotation for several methods
to allow deeper customization of PopupWindow and it's transitions.

Bug: 123768397
Bug: 123769350
Bug: 123769516
Bug: 123768511
Bug: 123768510
Bug: 123768589
Test: Tests has been added to PopupWindowTest in I468b592a3ba2e5f2f895210d21843d328a454794
Change-Id: I7fb4d8e28f0de889e110b7b90f71ebec9ab4cc9d
2019-02-08 09:38:26 +00:00
Aurimas Liutikas
ab324cfbe5 Update core widgets to save attribute source info.
Bug: 111439551
Test: make -j
Change-Id: I72997a87122f38b32e38e42a690385acc7d0e521
2019-02-07 16:46:38 -08:00
Haoyu Zhang
5c4bfc29c4 Add trackingBug number for UnsupportedAppUsage of mMarquee
We should support this usage better in future.
And it's kept in light grey list until new API is released.

Bug: 124050217
Test: N/A
Change-Id: Ia2842d99410965a5b724979f09850839bc84789f
2019-02-07 16:36:15 -08:00
Rahul Ravikumar
6933d7ec57 Fix Hidden API Landroid/widget/AbsListView;->trackMotionScroll(II)Z in ligt-grey list
* We have a scrollListBy() API that we introduced in API 19 which should cover this use case.

Test: N/A
Fixes: b/124051739

Change-Id: I0ba7091eb95702a275989fb0f22f9da04b61e989
2019-02-07 14:13:04 -08:00
Rahul Ravikumar
f6f2e32b4e Merge "Add a EdgeEffect#setBlendMode API." 2019-02-07 21:39:19 +00:00
Yigit Boyar
68d28e3fcb Merge "Add edge effect color APIs to AbsListView" 2019-02-07 21:31:38 +00:00
Rob Carr
424e875630 Merge changes from topic "sc-destruction-cleanup"
* changes:
  SurfaceControl: Provide Transaction#remove() method.
  Replace SurfaceControl#destroy with #remove
  SurfaceControl: Fix release
2019-02-07 20:45:11 +00:00
Aurimas Liutikas
86ef44bcc7 Merge "Add helper methods for View attribute debugging" 2019-02-07 19:05:20 +00:00
Filip Pavlis
ab80291cb9 Restrict access to AbsListView internals.
There is in general very low usage of these and they do not seem much
legitimate. Also if there is some customization needed RecyclerView
is the answer. We certainly do not want to start opening these internals.
Please see individual justifications as comments per each item.

Bug: b/123769398
Bug: b/123769710
Bug: b/123768941
Bug: b/123769413
Bug: b/123769379
Test: N/A
Change-Id: I04cacc69612f0693f83fe5caa1cb02490bfb0fcb
2019-02-07 16:06:06 +00:00
Louis Pullen-Freilich
65650acdbc Merge "Adds FlingRunnable to dark-greylist" 2019-02-07 12:16:58 +00:00
Haoyu Zhang
5ddbae336b Merge "Add trackingBug number to UnsupportedAppUsage of mListeners" 2019-02-07 01:43:17 +00:00
Bookatz
ea05bd56d2 TextClock registerContentObserver with UserHandle
When adding a widget that uses TextClock to the home screen from a work
profile, the home screen may crash due to a
android.permission.INTERACT_ACROSS_USERS permission error, due to a
mismatch between the caller's userId and the widget's userId.
This fix uses the caller's userId to register the ContentObserver.

Bug: 111627637
Test: added a widget (as specified in the bug) that uses TextClock from a work profile
Change-Id: I153e55b755d656f1d7882645df15290bf8ad56f9
2019-02-06 16:09:50 -08:00
Qasid Sadiq
a7a0578481 Merge "Use map to traverse accessibilityIds instead of the view tree" 2019-02-06 23:54:35 +00:00
Aurimas Liutikas
8f004c85a0 Add helper methods for View attribute debugging
Adding abilities to debug:
- Attribute resolution stack (which resources are looked
  at when resolving an attribute)
- Attribute value source (where did each attribute value
  get defined)
- Get explicit style id (if a view had it set via style="...")

This feature will be behind Settings.Global flag that Android
Studio will set to the debugged application package ID.

Bug: 111439551
Test: atest CtsViewTestCases:android.view.cts.ViewStyleTest
Change-Id: Ib6f9fc81000bb867b5b94a68953c99b0bc802d6c
2019-02-06 14:46:17 -08:00
Rahul Ravikumar
7ab5459af9 Add a EdgeEffect#setBlendMode API.
* Fixes hidden api usage b/123769450
* Move from setXferMode() to setBlendMode in Paint.

Fixes: b/123769450

Test: Added CTS Tests.
Change-Id: I1f950e4c14d30dd223cce05835b230c086755089
2019-02-06 14:15:13 -08:00
TreeHugger Robot
437ed07bb1 Merge "UnsupportedAppUsage AbsListView#mOnScrollListener" 2019-02-06 21:53:01 +00:00
Haoyu Zhang
7db39b400a Add trackingBug number to UnsupportedAppUsage of mListeners
mListeners is used by developers to resolve a memory leak bug
and it was fixed before. But there are still a very high amount
usage of this Non-SDK API. So we can't put them into darklist.

Bug: 123769451
Test: atest TextViewTest
Change-Id: I7ba822e94d290fd99189970da0a4bf7bfa52d64b
2019-02-06 11:29:58 -08:00