Commit Graph

9559 Commits

Author SHA1 Message Date
Evan Rosky
fe9ce65491 Merge "Handle edge-case where the focus-search root is focused" into oc-dev 2017-04-03 23:10:56 +00:00
Yohei Yukawa
1061992733 Merge "Warn if IMM#showSoftInputUnchecked() is called" into oc-dev 2017-04-03 22:14:28 +00:00
Vladislav Kaznacheev
671a9701c9 Javadoc fix for View.setTooltipText
Change "unless is not handled" to "unless it is handled"

Bug: 36668465
Test: read the Javadoc
Change-Id: I432f24e313358b4448aff2ff9de382d4a58652bc
2017-04-03 18:39:05 +00:00
Evan Rosky
e55f4a611e Handle edge-case where the focus-search root is focused
Bug: 36854948
Test: Added check to FocusFinderTest#testFindNextFocus
Change-Id: Iac6ea6e255d16d4cd1f7fe053ba47e171fff73e0
2017-04-03 11:37:20 -07:00
Yohei Yukawa
101ae464fc Warn if IMM#showSoftInputUnchecked() is called
With this CL, an @hide method InputMethodManager#showSoftInputUnchecked
is marked to be deprecated and starts showing a warning message in logcat
when it gets called to tell application developers who are still using
old implementation fo android.support.v7.widget.SearchView that they
need to switch to support library ver. 26.0 or later version.

Other than that there is no behavior change in this CL.

Test: Manually verified as follows:
       1. Flash an OS image
       2. Complete the setup wizard (if any).
       3. In N MR-1 AOSP repository
          frameworks/support/gradlew -p frameworks/support support-v7-demos:assemble
       4. adb install out/host/gradle/frameworks/support/support-v7-demos/build/outputs/apk/support-v7-demos-debug.apk
       5. adb logcat -s InputMethodManager
       6. adb shell am start -n com.example.android.supportv7/.Support7Demos
       7. Tap AppCompat -> Action Bar -> Action Bar Usage
       8. Tap the magnifier icon.
       9. Make sure that the software keyboard shows up.
      10. Make sure that in logcat a warning that showSoftInputUnchecked
          is going to be removed is shown.
Fixes: 36015425
Change-Id: If01316a0c2a210f9ea03b53700d0ef651955ba9c
2017-04-03 17:11:41 +00:00
Bryce Lee
7efe56b779 Merge "Add app bounds to configuration." into oc-dev 2017-04-03 14:30:49 +00:00
Bryce Lee
7566d76c61 Add app bounds to configuration.
The system previously overrode the display size for a specific scope
(task/activity/etc.) by setting the associated Configuration's
screenWidthDp/screenHeightDp. This leads to two issues. First, the
conversion of screen size from pixels to display independent pixels
and then upconverting later on leads to rounding errors. Secondly,
the screenWidthDp and screenHeightDp values account for insets, such
as the status bar. These however are not reflected in the display
size when returned from Display#getMetrics/getSize.

This changelist addresses the issue by adding a Rect value to
Configuration which stores the app display bounds. This is always set
at the display level and overridden as appropriate. As the proper
app insets are accounted for at the root configuration, all overrides
(outside of specific exceptions) are the result of the intersection
between the requested bound and the parent bound.

Change-Id: I2c4fcd0bee92af12aabbca258de05b4ec061d0e1
Fixes: 34338931
Bug: 36812336
Bug: 36676979
Test: cts/hostsidetests/services/activityandwindowmanager/util/run-test CtsAppTestCases android.app.cts.AspectRatioTests
Test: cts/hostsidetests/services/activityandwindowmanager/util/run-test CtsServicesHostTestCases android.server.cts.ActivityManagerDisplayTests
Test: bit FrameworksServicesTests:com.android.server.wm.AppBoundsTests
2017-03-31 21:34:30 -07:00
TreeHugger Robot
4d558930c8 Merge "Created an HtmlInfo object on ViewStructure." into oc-dev 2017-04-01 02:34:03 +00:00
TreeHugger Robot
2af994ec03 Merge "Ensure we show the PiP menu in response to KEYCODE_WINDOW." into oc-dev 2017-03-31 23:07:23 +00:00
Winson Chung
ac52f2892d Ensure we show the PiP menu in response to KEYCODE_WINDOW.
Bug: 36687605
Test: android.server.cts.ActivityManagerPinnedStackTests
Test: #testWindowButtonEntersPip
Change-Id: I0bb35fd666eb6a438e4676267f6726b44bffb3db
2017-03-31 10:42:53 -07:00
TreeHugger Robot
774b1f1f37 Merge "Split scroll factor into a 2d float." into oc-dev 2017-03-31 14:54:45 +00:00
TreeHugger Robot
f9533e7b4d Merge "TextClassificationManager API cleanup." into oc-dev 2017-03-31 04:29:27 +00:00
Abodunrinwa Toki
802144cca4 TextClassificationManager API cleanup.
Removes @removed methods.
See: I24e86272cf58bf6864505bee3b06978c1c0d46e5

Test: Checked that API is removed.
Change-Id: I93e7f64740671b5ff856f8b38eddc04417f6486e
2017-03-31 02:15:28 +01:00
Philip P. Moltmann
81192b40de Rename autoFillHint to autoFillHints.
Fixes: 35364993
Test: cts-tradefed run cts-dev -m CtsAutoFillServiceTestCases
Change-Id: I65a4c2c65563e7bbd60c4e99c8800b0b11af2300
(cherry picked from commit feb3299ed5)
2017-03-30 23:45:33 +00:00
TreeHugger Robot
e577a840a1 Merge "Fix issue with not forwarding config. changes on the window size" into oc-dev 2017-03-30 23:06:18 +00:00
TreeHugger Robot
fb4a74f26b Merge "Adds FillResponse extra to passed to authentication intent." into oc-dev 2017-03-30 22:40:24 +00:00
Felipe Leme
25bf787ffb Created an HtmlInfo object on ViewStructure.
The ViewStructure typically represents a View, but it it can also be a virtual
view; in particular, WebView uses virtual views to represent HTML elements.

Although most of the properties of the HTML element maps to properties of
Android Views, some properties (such as 'name' and 'id' on <INPUT> fields)
don't, and those are crucial for autofilling web pages.

Rather than trying to artificially map these properties, it's better to create
a generic representation, for the following reasons:

1. Web standards move in a different velocity than Android APIs
2. Android APIs cannot be changed easily. Deprecated APIs continue to work,
   and new added APIs don't work in older versions
3. The data used for autofill is opaque to the Framework - it's only relevant
   to the node producers (like WebView) and consumers (Autofill services).

Also removed the setIdEntry() that was used for the same purpose.

Fixes: 36696757
Bug: 36718508
Test: VirtualContainerActivityTest with new checks pass

Change-Id: Ia626bd1f640b0b5861e81a5915504b95029874c9
2017-03-30 14:24:05 -07:00
Wale Ogunwale
cdc8ada9c9 Fix issue with not forwarding config. changes on the window size
Coding error inroduced in ag/1965162 where we were no longer setting
the config. if the dispatchResized() call originated from a different
process.

Fixes: 36544847
Test: Change languages and confirm that the status bar changed to the
new language.

Change-Id: I91d73c9f506f28cf1ba13a55f86f87a1aff80e0b
2017-03-30 21:01:22 +00:00
TreeHugger Robot
60e0c19505 Merge "API refactor: context.startForegroundService()" into oc-dev 2017-03-30 20:54:24 +00:00
Rob Carr
2b33162e82 Merge "Remove code for seamlessly rotating SurfaceView's." into oc-dev 2017-03-30 20:10:26 +00:00
TreeHugger Robot
dada7c0e71 Merge "TextClassificationManager API updates." into oc-dev 2017-03-30 19:17:24 +00:00
TreeHugger Robot
7600925263 Merge "Hide TextClassifier.EntityType from the public API." into oc-dev 2017-03-30 19:15:17 +00:00
Christopher Tate
08992ac57e API refactor: context.startForegroundService()
Rather than require an a-priori Notification be supplied in order to
start a service directly into the foreground state, we adopt a two-stage
compound operation for undertaking ongoing service work even from a
background execution state.  Context#startForegroundService() is not
subject to background restrictions, with the requirement that the
service formally enter the foreground state via startForeground() within
5 seconds.  If the service does not do so, it is stopped by the OS and
the app is blamed with a service ANR.

We also introduce a new flavor of PendingIntent that starts a service
into this two-stage "promises to call startForeground()" sequence, so
that deferred and second-party launches can take advantage of it.

Bug 36130212
Test: CTS

Change-Id: I96d6b23fcfc27d8fa606827b7d48a093611b2345
(cherry picked from commit 79047c62b5)
2017-03-30 18:31:24 +00:00
Abodunrinwa Toki
45cb3e6c1f Hide TextClassifier.EntityType from the public API.
Test: current.txt and friends updated correctly.
Bug: 35959173
Change-Id: I74011020a4e509bad98b94738d2e929fc068d9ae
2017-03-30 16:56:18 +01:00
Abodunrinwa Toki
df61b0328e TextClassificationManager API updates.
- Changes getDefaultTextClassifier to getTextClassifier
- Adds a setTextClassifier API

Test: cts-tradefed run cts-dev -m CtsWidgetTestCases -t
android.widget.cts.TextViewTest
Bug: 35763797

Change-Id: I24e86272cf58bf6864505bee3b06978c1c0d46e5
2017-03-30 14:15:44 +01:00
Felipe Leme
955e252a95 Simplified autofill() methods by returning void instead of boolean.
Test: CtsAutoFillServiceTestCases pass

Change-Id: Ic94e6686e291fed60ef6715bd160f9b568bf0ea6
2017-03-29 18:16:40 -07:00
Evan Rosky
7ac3fb2282 Merge "Expose initial focus feature flag for testing" into oc-dev 2017-03-30 01:02:28 +00:00
Aaron Whyte
f830652e97 Split scroll factor into a 2d float.
Test: Existing unit tests, manual sanity check.
BUG=35764483

Change-Id: If6ac121452698747e1f8bc9d4ec0111bb881d4d4
(cherry picked from commit e9956c5c65)
2017-03-29 23:34:56 +00:00
Felipe Leme
7320ca9f99 Adds FillResponse extra to passed to authentication intent.
Test: CtsAutoFillServiceTestCases (with new test) pass
Fixes: 36603378

Change-Id: I3d04a656e50b2b3665405f6c1891ad0379a54ea6
2017-03-29 15:20:29 -07:00
Evan Rosky
18b886e8b2 Allow cluster navigation to jump into touchscreenBlocksFocus
Adds an exception to touchscreenBlocksFocus ViewGroups which
are also keyboardNavigationClusters. The behavior we want is
that cluster navigation can jump into touchscreenBlocksFocus
clusters but normal keyboard navigation can't. Once focus is
in a touchscreenBlocksFocus cluster; however, we allow focus
navigation to move freely within that cluster. It remains in
that cluster until a subsequent cluster navigation brings it
back out.

Adds back the touchscreenBlocksFocus attributes to Toolbar
and actionbar so that they behave like they did before.

Bug: 34363323
Test: Added CTS test. Verified desired behavior in a test app

Change-Id: I555bf5570b16a57f0d4c8a020ae509a1e1b33910
(cherry picked from commit aee802f3bc)
2017-03-29 22:18:56 +00:00
Evan Rosky
01f46a29ce Expose initial focus feature flag for testing
Bug: 34520588
Test: View_FocusHandlingTest
Change-Id: I7a20a6e9c57fc61bd2562307f4e7f8dee1979a40
(cherry picked from commit 9a0ea38671)
2017-03-29 22:11:34 +00:00
Robert Carr
897215d76a Remove code for seamlessly rotating SurfaceView's.
No longer required :D

Bug: 36230754
Bug: 36727915
Test: Rotate camera in different modes.
Change-Id: I7708d61646a36bc0c35cfa91d441296eb49eff9a
2017-03-29 12:29:29 -07:00
TreeHugger Robot
dd83c2006b Merge "TextClassifier: Switch model based on locale" into oc-dev 2017-03-29 19:17:36 +00:00
TreeHugger Robot
94696c5ac5 Merge "Fix bad Java docs in View.java" into oc-dev 2017-03-29 18:33:11 +00:00
Rob Carr
76d779374a Merge "SurfaceView: Make surfaceRedrawNeededAsync work with WM bypass." into oc-dev 2017-03-29 16:44:41 +00:00
Philip P. Moltmann
dc90922f78 Fix bad Java docs in View.java
Test: Used intelliJ to warn about bad docs
Change-Id: Idb119aff8ce0f2370f66707bd583e2d131fb0751
(cherry picked from commit f4946e7f15)
2017-03-29 16:29:22 +00:00
Abodunrinwa Toki
c39006a1cd TextClassifier: Switch model based on locale
Test: cts-tradefed run cts-dev -m CtsViewTestCases -t
android.view.textclassifier.cts.TextClassificationManagerTest

Change-Id: I91f814fc47bd75922c0e42a774dc7376daf65366
2017-03-29 17:12:56 +01:00
TreeHugger Robot
36e2483663 Merge "Add Configuration param to onMovedToDisplay" into oc-dev 2017-03-28 21:36:40 +00:00
Robert Carr
8508bb2f10 SurfaceView: Make surfaceRedrawNeededAsync work with WM bypass.
Prior to SurfaceView bypassing the WM, the WM would see that
the app had multiple windows and wait for them all
to finish drawing before beginning any animation, or similar operations.
Now that SurfaceView is invisible to the WM we have to replicate this
two-way latching in ViewRootImpl.

Bug: 36492285
Test: Launch Chrome over and over.
Change-Id: Ie72c2d394f1bb0eb8551e6f63bb1c19a5df43afd
2017-03-28 12:39:33 -07:00
Andrii Kulian
e5c58eefb1 Add Configuration param to onMovedToDisplay
To be consistent with other multi-window callbacks adding
Configuration param to the onMovedToDisplay, so that app
developer can handle configuration change at the same time
when it receives a notification about move.

Bug: 36649499
Test: android.server.ActivityManagerDisplayTests
Test: #testOnMovedToDisplayCallback
Change-Id: I80c765473bfc09ea1fb7aa4e2e77baf3b21606b8
(cherry picked from commit 2c32a11a71)
2017-03-28 17:28:17 +00:00
Tadashi G. Takaoka
da5790de78 Fix double-checked locking in InputMethodSubtype
No functional change.

Fixes: 35737935
Test: run cts test and confirmed all tests passed
  cts-tradefed run singleCommand cts-dev -m CtsInputMethodTestCases
Change-Id: I44e5e91b6462c3c7d023f50365b30da9cf98c509
2017-03-28 14:39:12 +00:00
Abodunrinwa Toki
b5ab25948b SmartSelection: Pass hintFlags to native library.
Test: cts-tradefed run cts-dev -m CtsViewTestCases -t android.view.textclassifier.cts.TextClassificationManagerTest
Tests have been written on the native side.
Bug: 35416389

Change-Id: If2de73391e1a343e0dc7698039ad1464cedfbf08
2017-03-28 10:02:07 +01:00
Abodunrinwa Toki
d2d1399a62 TextClassifier updates
- Increase the size of the text sent as context to the classifier
- Pass regex match hints to the classifer

Test: Build still works. Regex hints logged correctly. The hints won't
matter until we've actually passed in this values to native code. Native
library test will be written and I've got a tracker bug to write more robust Java tests.

Bug: 35416389
Bug: 36584397

Change-Id: I29e56189b388b36dc0cc7a8bb13ef237ff55be7b
2017-03-27 17:53:24 +01:00
TreeHugger Robot
2858ad3a4b Merge "TextClassifier cleanup." 2017-03-27 14:51:13 +00:00
TreeHugger Robot
1e8fd460fd Merge "Target selection for Accessibility button" 2017-03-25 04:04:16 +00:00
Casey Burkhardt
5e8b980c5d Target selection for Accessibility button
Allows for selecting a single accessibility service or feature
to be triggered by the accessibility button in the navigation bar

Bug: 34720082
Test: Manual
Change-Id: I320febede0398b1eff38a87d4db31fd7dfc53062
2017-03-24 19:17:12 -07:00
Felipe Leme
4753bb0c34 Make auto-fill UI robust
Now the autofill UI tracks the movement of the anchor view,
both real and virtual and while still preventing the filled
app from accessing the chooser UI. This was achieved by using
a popup window in the app process to determine the window
location and adding a window presenter interface to popup
window that controls the actual window addition, removal, and
update which is implemented by the system server.

Test: all autofill CTS tests pass

bug: 36392498
bug: 35708258
bug: 34943932
fixes: 36039182
fixes: 36493078

Change-Id: I0321913b2e2e759f4b17003bf85cb873e63a467c
2017-03-24 15:16:28 -07:00
Felipe Leme
b4ca70184c Added LocaleList on ViewStructure.
Fixes: 36219641
Test: CtsAssistTestCases pass

Change-Id: I4f208a3b979a524d631e9d2c642b9b5a3cdccb22
2017-03-22 18:51:00 -07:00
Andrii Kulian
38691e9d8f Merge "Revert "Update display contents when metrics change"" 2017-03-22 21:57:31 +00:00
Andrii Kulian
b6c5c0d902 Revert "Update display contents when metrics change"
This reverts commit eddb7c0985.

Reason for revert: b/36518752

Bug: 36518752
Change-Id: I39773db7b8d02aec360ca80d02b3c161ccf02786
2017-03-22 21:50:52 +00:00