Commit Graph

8068 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
Louis Pullen-Freilich
f0955ac71f Adds FlingRunnable to dark-greylist
To stop a scroll early, developers should instead use AbsListView#smoothScrollBy(0,0)
To start a specific fling, developers should instead use AbsListView#fling(int)
For any further customization, developers should migrate to using
and customizing RecyclerView

Bug: b/123769448
Bug: b/123769453
Bug: b/123769380
Test: n/a
Change-Id: I08a773c3fa70270ddc9f4e36dcbc64c64f7336de
2019-02-06 19:29:34 +00:00
Yigit Boyar
b621847ec6 Add edge effect color APIs to AbsListView
This CL adds APIs to AbsListView 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: 123768444
Bug: 123769408
Test: AbsListViewTest#testEdgeEffectColors
Change-Id: Ia81bb1af9708255cceaabfd6e8ecfd1f12d67798
2019-02-06 11:27:07 -08:00
TreeHugger Robot
3a8257bbc5 Merge "Restrict access to mRequestedNumColumns." 2019-02-06 19:07:44 +00:00
TreeHugger Robot
cc80396b9c Merge "Added a ScrollView#scrollToDescendant() API." 2019-02-06 18:50:59 +00:00
Siyamed Sinir
abb20bebd6 Merge "Blacklist TextView.mCurTextColor" 2019-02-06 18:02:14 +00:00
Filip Pavlis
669a752a7c Restrict access to mRequestedNumColumns.
There is little value in exposing this as public API as general users
of the GridView have this value as they had to set it via setNumColumns.
Also classes extending GridView can keep track of this value by
overriding setNumColumns.

At the same time I don't see much motivation in needing the value as it
is only used in private method determineColumns.

Also the amount of usage of this field is really low.

Bug: b/123769395
Test: N/A
Change-Id: I0996cd1df2d1c3394b17333762a19a057005137a
2019-02-06 16:59:18 +00:00
Mihai Popa
cbc059d713 Enable changing ProgressBar min/max width/height
The CL adds getters and setters for the min/max width/height attributes
of ProgressBar. This could be already specified in xml, but not post
inflation.

Bug: 123769470
Test: atest android.widget.cts.ProgressBarTest
Change-Id: I3bb4992da0c34cd88078588253ef6789fa8f1856
2019-02-06 15:13:01 +00:00
Yohei Yukawa
0115ac1272 Honor text-operation user in "Add to dictionary"
This is a follow up CL to my previous CL [1], which introduced a
concept of "text-operation user" into TextView then plumbed it to IME
APIs and spell checker APIs as a short term workaround for System UI's
hosting multiple users' text contents in user 0 process.

With this CL, "Add to dictionary" menu item for misspelled words also
takes this text-operation user into account.

 [1]: I6d11e4d6a84570bc2991a8552349e8b216b0d139
      401e3d4c84

Fix: 123955642
Test: Manually done as follows.
   1. Build aosp_taimen-userdebug and flash it.
   2. adb shell pm create-user test_user
   3. adb shell am switch-user 10
   4. make -j EditTextVariations
   5. adb install -r \
        $ANDROID_TARGET_OUT_TESTCASES/EditTextVariations/EditTextVariations.apk
   6. adb shell am start \
        -n com.android.inputmethod.tools.edittextvariations/.EditTextVariations
   7. Tap the menu icon on the EditTextVariations then click "Direct Reply"
   8. Open notification shade.
   9. Tap reply icon on "Message from UserHandle{10}".
  10. Type "gggg".
  11. Make sure a red underline is shown.
  12. Tap "gggg".
  13. Make sure a dropdown UI is shown below "gggg".
  14. Tap "ADD TO DICTIONARY"
  15. Dismiss the notification shade.
  16. Make sure "Add to dictionary" dialog is shown.
Change-Id: Iaf11cd7e54636ab552e2469006e120e39dca99a8
2019-02-05 22:27:20 -08:00
Qasid Ahmad Sadiq
834787afb6 Use map to traverse accessibilityIds instead of the view tree
This is the first step to a few things including allowing for virtual nodes to have view backed descendants and siblings.
The main change in findViewByAccessibilityId SPI (its changed name and location, but it still is effectively the same thing) is that if something has a nodeProvider it will now still return view children.
I sifted through each use of the SPI and determined if they were an issue, and cleaned up any code in the process (Autofill cleanup is coming in a different CL).

Test: added a few simple unit tests, used talkback on system in a few places including virtual views, atest accessibility*, cts accessibility* (There were some failures here but they don't seem to be caused by this change, those are captured in these bugs b/120628276 b/120890822), CtsAutoFillServiceTestCases
Bug: 37714287

Change-Id: Id5807114fbb4c932eaea275dc2d94d0dbe25a8ae
2019-02-06 01:06:08 +00:00
Nader Jawad
599a0e2ad2 UnsupportedAppUsage AbsListView#mOnScrollListener
Updated @UnsupportedAppUsage annotation with maxTargetSdk as well
as corresponding tracking bug

Change-Id: I49b527fcd5d7cc67c3163adcd70a596b3e398ff7
Fixes: 123769353
Test: N/A
2019-02-05 16:54:22 -08:00
TreeHugger Robot
bdbfcebca6 Merge "Restrict reflection for ProgressBar#mIndeterminate" 2019-02-05 23:47:55 +00:00
Siyamed Sinir
403693bc41 Blacklist TextView.mCurTextColor
setTextColor/getCurrentTextColor should be used instead.

Test: None
Bug: 123769356
Change-Id: Ic31897632fb7a32e7f653a7bc0ad3655379a70db
2019-02-05 13:38:52 -08:00
Adam Powell
841133661f Restrict reflection for ProgressBar#mIndeterminate
Change-Id: Ie60de396a7f57be57caa9abdec5e24f3f8a04b10
Fixes: 123769456
2019-02-05 13:32:47 -08:00
Robert Carr
5ea304db74 Replace SurfaceControl#destroy with #remove
Because there may be other references, #destroy does
not actually destroy a Surface. We try and make this more clear
in the naming.

Bug: 111297488
Test: Builds
Change-Id: I3a395abf4449de27fac298e37a96eb54c204c42f
2019-02-05 13:29:16 -08:00
Ashley Rose
2879c9c95f Merge "@InspectableProperty coverage for android.widget" 2019-02-05 21:03:00 +00:00
TreeHugger Robot
6a98b6d236 Merge "Add PopupMenu#setForceShowIcon" 2019-02-05 20:00:57 +00:00
TreeHugger Robot
d25105a54d Merge "Restrict usage of PopupWindow::mOverlayAnchor" 2019-02-05 19:47:29 +00:00
Louis Pullen-Freilich
87dd8aa97d Merge "Adds comment to dark-greylisted mShowCursor" 2019-02-05 19:46:22 +00:00
Rahul Ravikumar
6d21df2e2b Added a ScrollView#scrollToDescendant() API.
* Eliminates the need for a reflective call to Landroid/widget/ScrollView;->mChildToScrollTo:Landroid/view/View;

Test: Added CTS tests.
Fixes: b/123769715

Change-Id: If28891cdeda3c13c3dd5d9b4faf697543311590a
2019-02-05 11:14:18 -08:00
Mihai Popa
da59e1da16 Add PopupMenu#setForceShowIcon
The API enables developers to display icons for menu items. Before this,
the common workaround was to reflect in MenuPopupHelper (non-public
class), and call setForceShowIcon there.

Bug: 123769396
Test: atest android.widget.cts.PopupMenuTest
Change-Id: If4ef46bc7786a2e7e756a9b15c81147e0cce1090
2019-02-05 17:20:21 +00:00
TreeHugger Robot
cc2237d2f7 Merge "Restrict RemoteViews unsupported app usage" 2019-02-05 17:02:24 +00:00
Louis Pullen-Freilich
1c400a3ad9 Adds comment to dark-greylisted mShowCursor
Bug: b/123769485
Test: n/a
Change-Id: Ice7dbcc92456507def621ef50602519f81dd6c12
2019-02-05 16:46:38 +00:00
Matvei Malkov
40001ded9d Restrict usage of PopupWindow::mOverlayAnchor
The field mOverlayAnchor has getter and setter since API 23 and it's a
recommended way to access and set this field. All the usages from
opensource is mostly AppCompatPopupWindow forks (some with version
check, some are not), so they can easily migrate to getter and setters.

Bug: 123768692
Test: PopupWindow and PopupMenu tests passed
Change-Id: Ida3077b17a043b2acf2d89456e4501d7ed052e4e
2019-02-05 14:19:51 +00:00
Ashley Rose
55f9f92545 @InspectableProperty coverage for android.widget
A few getters for view properties have been added where they were
missing. CTS tests for the new APIs are pending in b/123894719.

Test: m framework
Bug: 120492712
Change-Id: I743ce693d384eaf749ced3db7f81bda7d19ed275
2019-02-04 19:11:56 -05:00