Commit Graph

11812 Commits

Author SHA1 Message Date
Hyundo Moon
9a908db9f4 Rename KeyEvent.isMediaKey() to isMediaSessionKey()
Since not all KEYCODE_MEDIA_* keycodes return true in isMediaKey(),
the naming can give confusion. This CL renames the method to
isMediaSessionKey() and revises its Javadoc.

Bug: 119789707
Test: make -j
Change-Id: I36786ccf5606977e6d971c13d77d950356561bda
2018-11-30 13:54:32 +09:00
Fan Zhang
b36ba90475 Fix a NPE in ViewRootImpl
Fixes: 120229477
Test: make RunSettingsRoboTests -j40
Change-Id: I82f6c5fe5f553399c368bf30eef73b2d7f60d046
2018-11-29 13:45:05 -08:00
Jorim Jaggi
9a94afc6ca Merge "A brave new world for window insets (1/n)" 2018-11-29 17:14:15 +00:00
TreeHugger Robot
636be16176 Merge "Made View.setLeftTopRightBottom() public" 2018-11-29 16:32:22 +00:00
Andrey Kulikov
6ee8379dc0 Made View.setLeftTopRightBottom() public
It will allow to call this method in AndroidX Transition without reflection.
ChangeBounds#BOTTOM_RIGHT_ONLY_PROPERTY,POSITION_PROPERTY are restricted now as well as developers can just use setLeftTopRightBottom method instead (it was used as a performance optimization in third-party transitions backport)

Bug: 117521189
Bug: 117521197
Bug: 117521053
Test: new test added for the method
Change-Id: I0a29bc8cf0b3357e49f6be14270993a21a6dfeee
2018-11-29 14:44:29 +00:00
Jorim Jaggi
f96c90ac6c A brave new world for window insets (1/n)
This CL starts a journey to discover a brave new inset world. The
path to get us there may be rocky, but it's going to be rocky.

One of the main pledges of the new API is that an app can retrieve
what is causing a certain inset easily. For that, we need to
dispatch metadata who is causing what inset, such that we can query
it from the client side.

Furthermore, the client will be able to manipulate insets directly,
but also listen to animation changes. We don't want to go through
window manager for that, thus, there needs to be a local codepath
from (global window state -> WindowInsets).

Because we have these two requirements, we dispatch the relevant
global window state for insets, represented by InsetsState, and
dispatch it to the client. On the client side we take the frame
and the InsetsState and generate WindowInsets out of it.

Bug: 118118435
Test: InsetsSourceTest, InsetsStateTest, InsetsSourceProviderTest,
InsetsStateControllerTest
Change-Id: I2bfe9dda376512916261823fc2ee35cbedeb6731
2018-11-29 13:37:43 +01:00
Vishnu Nair
e86bd98a8b WM: Removes setSize from buffer-less surfaces
- Make a better distinction between surface bounds and buffer size by renaming setSize to
  setBufferSize and removing setSize for all buffer-less surfaces.
- Adds an error check in SurfaceControl to ensure buffer size is only set for buffer-less surfaces.
- Updates color fade surface to use passed in transaction object.

Bug:114413815
Test: go/wm-smoke
Test: atest FrameworksServicesTests:DimmerTests
Test: atest FrameworksServicesTests:SurfaceAnimatorTest
Change-Id: I88bd1452d6b3b3009e73e26986027d6a5a9efebc
2018-11-28 14:24:03 -08:00
Rob Carr
d5b4a58de5 Merge changes from topic "sfinput4"
* changes:
  ScreenMagnifier: Track SurfaceFlinger Input
  Forward SurfaceInsets to InputWindowInfo
  Track native changes: Rework InputApplicationInfo
  Replace InputWindowInfo#inputChannel with an IBinder token.
  Fix name for canReceiveTouchInput
  Fix pointer capture
  Cleanup Input left-overs.
  Port other InputWindowHandles to input surfaces.
  Port InputConsumerImpl to SurfaceFlinger input.
  Pass InputWindowInfo to SurfaceFlinger.
2018-11-28 20:35:10 +00:00
TreeHugger Robot
de6fe070b0 Merge "Initial buffering of Content Capture events." 2018-11-28 17:13:00 +00:00
TreeHugger Robot
6f4e271922 Merge "Add displayId for WMS override pending transition APIs." 2018-11-28 12:02:33 +00:00
TreeHugger Robot
18439804f4 Merge "Support hasNavigationBar per display(1/2)" 2018-11-28 11:42:24 +00:00
Charles Chen
ea6e7f0401 Support hasNavigationBar per display(1/2)
This change is to support Auto case.
Auto may need to support displays without navigation bar by default,
because the display may be far away from driver.
Note: currently, hasNavigationBar is global since it's from config.
  In future patches, it will also check hasSystemDecorations() on
  secondary display.
TODO: We may find a way to make OEMs set hasNavigationBar() for each
  display.

Fixes: 119584629
Test: atest WmTests
Test: atest InputMethodManagerServiceTests
Test: atest SystemUiTests
Change-Id: I427f8ad1f3da644a2bf79ee5b777830378515348
2018-11-28 15:22:44 +08:00
Robert Carr
fcc0852558 Forward SurfaceInsets to InputWindowInfo
So that SurfaceFlinger can set the appropriate frame. See
frameworks/native commit and InputWindow.h for detailed
discussion.

Test: Manual
Bug: 80101428
Bug: 113136004
Bug: 111440400
Change-Id: I5df12fa3f90335f2045ee7107d3b1242ff0d00c5
2018-11-27 18:06:36 -08:00
Robert Carr
0bcbe6442d Track native changes: Rework InputApplicationInfo
First we move it inside of InputWindowInfo instead of InputWindowHandle
so it is part of the data sent across binder. Second we give it a persistent
identity of an IBinder token and use this for comparisons.

Bug: 80101428
Bug: 113136004
Bug: 111440400
Test: EndToEndNativeInputTest. Existing tests pass.
Change-Id: Id89a40e66887d834020f8e645fd1fb48adb7ee2e
2018-11-27 18:06:36 -08:00
Robert Carr
eadae82b55 Replace InputWindowInfo#inputChannel with an IBinder token.
The IBinder token is now being used as the UUID for InputWindows.
We can pass it around without the channel to avoid unnecessary FD
parcelling, duping, and other juggling.

Test: Existing tests pass.
Bug: 80101428
Bug: 113136004
Bug: 111440400
Change-Id: I8eba3fa05f249b7dfcb5c3d9817241cbfe9ab76c
2018-11-27 18:06:36 -08:00
Felipe Leme
b18e3179c2 Initial buffering of Content Capture events.
IntelligenceManager must buffer ContentCapture events and send them to the
service in a batch, and this is the initial implementation of such batch:
it's just batching a pre-defined number of events, without any further
optimization (like flushing after x ms).

Test: manual verification

Bug: 111276913
Bug: 119220549

Change-Id: I96a4708fd3fcfd3098a0894a3ae3e967804cf4e6
2018-11-27 17:24:23 -08:00
TreeHugger Robot
e3a6d9450a Merge "Add "dictionary" entity type" 2018-11-27 21:51:45 +00:00
Abodunrinwa Toki
f14f2b63dc Merge "Do not linkify text with RLO/LRO characters." 2018-11-27 20:19:35 +00:00
TreeHugger Robot
2bad68cd1a Merge "Fixed when IntelligenceManager.notifyAppeared()/disappeared() is called." 2018-11-27 19:30:48 +00:00
Tony Mak
e1f3ac064c Add "dictionary" entity type
We will classify the word as "dictionary" if we think user may want to look
it up. A "Dictionary" option will be shown in the floating toolbar
if users select words of this entity type.

A new Intent action is introduced to bring up the dictionary app.

The model that supports this entity type is not checked-in yet.
So no behavior change can be seen for now.

Test: Check-in the WIP model and try to select a "dictionary word".
Test: atest frameworks/base/core/tests/coretests/src/android/view/textclassifier/IntentFactoryTest.java

BUG: 68238822

Change-Id: Ib318d5b2abf79d61e55b33e397065a0714573121
2018-11-27 18:20:10 +00:00
Abodunrinwa Toki
adc194032b Do not linkify text with RLO/LRO characters.
Also don't show smart actions for selections in text with unsupported
characters.

Bug: 116321860
Test: atest android.view.textclassifier.TextClassifierTest \
            android.text.util.cts.LinkifyTest \
	    android.text.util.LinkifyTest \
	    android.widget.TextViewActivityTest

Change-Id: Id271cab8aef6b9b13ef17f1a8654c7616f75cf13
2018-11-27 15:11:41 +00:00
TreeHugger Robot
18ff896138 Merge "Introduce Message.USER_LOCAL and added logic to map person to user id" 2018-11-27 13:44:39 +00:00
TreeHugger Robot
88dbb1b2d4 Merge "Make View#transformMatrixToLocal/Global public" 2018-11-27 12:53:16 +00:00
lumark
a483f31ce8 Add displayId for WMS override pending transition APIs.
1) For sysui or launcher used APIs to support multi-display:
- overridePendingAppTransitionMultiThumbFuture
- overridePendingAppTransitionRemote

2) Modify WindowAnimator pending layout change debug log for all displays.

Bug: 119530958

Test: atest ActivityManagerMultiDisplayTests
Test: atest SystemUITests
Change-Id: I46a118a21b4df42c0d1767b77d838956a53262d3
2018-11-27 20:36:08 +08:00
Abodunrinwa Toki
8df4152469 Merge "Introduce Translate intent." 2018-11-27 12:09:26 +00:00
Clara Bayarri
c127cbe76c Make View#transformMatrixToLocal/Global public
These methods are being reflected into and seem generally useful
to developers.

Bug: 117521349
Bug: 117521191
Test: new CTS in topic
Change-Id: I86e8a379e458aefe7fb2fe936b57eeeffa5ad42d
2018-11-27 09:37:23 +00:00
Felipe Leme
fc8b2460c3 Merge "Initial implementation of Augmented Autofill." 2018-11-27 06:46:20 +00:00
Felipe Leme
284ad1c3e2 Initial implementation of Augmented Autofill.
Augmented Autofill is a mechanism that will let a system-provided service
provide autofill suggestions when the stardand autofill can't.

Because the Augmented Autofill service is a system app, it has less restrictions
than the standard service; in particular, this service will be responsible for
drawing the autofill UI, although the framework will provide a mechanism to host
the window. Right now, it's creating a TYPE_APPLICATION_OVERLAY window in the
service process roughly below the focused view, but in the long-term it will
use the IME suggestion window to display it.

This CL provides the initial APIs and end-to-end workflow for the simplest
scenario, but it's still full of TODO's.

Test: atest CtsAutoFillServiceTestCases # to make sure it doesn't break it
Test: atest FrameworksCoreTests:SettingsBackupTest
Test: mmm -j150 packages/experimental/FillService &&\
  adb install -r ${OUT}/data/app/FillService/FillService.apk &&\
  adb shell settings put secure intel_service foo.bar.fill/.AiaiService &&\
  adb shell settings put global autofill_smart_suggestion_emulation_flags 2 &&\
  adb shell pm grant foo.bar.fill android.permission.SYSTEM_ALERT_WINDOW

Bug: 119638877

Change-Id: I8d59b4eab3e530cd89b81456681a72fdab532756
2018-11-27 05:09:06 +00:00
TreeHugger Robot
5023323520 Merge "Fixed ViewNode.setText(...)" 2018-11-27 05:00:05 +00:00
Felipe Leme
bd5f58d845 Fixed when IntelligenceManager.notifyAppeared()/disappeared() is called.
We were not calling it on all places it should. And even worse, it was called
when the view was not laid out yet, which caused a side-effect on TextViews
(as it was calling assumeLayout()).

Bug: 111276913
Fixes: 119786503

Test: manual verification on Hangouts
Test: atest android.view.cts.ViewTest \
  android.widget.cts.TextViewTest \
  android.widget.cts.EditTextTest \
  CtsAutoFillServiceTestCases

Change-Id: I685460d9b1e0428ec0e5377826a549a678f6434e
2018-11-26 15:13:57 -08:00
Felipe Leme
e56d191ed5 Fixed ViewNode.setText(...)
Bug: 111276913
Test: manual verification

Change-Id: If5bec7931a6ca6e4f05c79bf9bbb98ff5179cb98
2018-11-26 14:05:14 -08:00
TreeHugger Robot
6d45ba0491 Merge "Simplified View.onProvideContentCaptureStructure()" 2018-11-26 19:17:02 +00:00
Tony Mak
f99ee17fc0 Introduce Message.USER_LOCAL and added logic to map person to user id
1. Introduce Message.USER_LOCAL to allow caller to specify which
   message is from the local user.

2. TextClassifierImpl will now encode the Person object to a user
   id.

3. Fixed a bug in Person.equals check

BUG: 111437455
BUG: 111406942

Test: atest frameworks/base/core/tests/coretests/src/android/view/textclassifier/ActionsSuggestionsHelperTest.java

Change-Id: I6629f42244a402fa210f87afa88a629c2ca4a510
2018-11-26 18:33:16 +00:00
Clara Bayarri
c90e782c71 Restrict unsupported API usage to View#mParent/mTop/mLeft/mRight/mBottom
All these properties have getters and setters since API 11 and
should be accessed via those.

Bug: 117521221
Bug: 117520719
Bug: 117521672
Test: none
Change-Id: Id96421370abf6d9417d7411698aae7603c1e0ff1
2018-11-26 12:50:40 +00:00
Clara Bayarri
9424812311 Restrict unsupported API usage to View#mMinWidth/Height
This data is directly accessible via getMinimumWidth (API 16)
and setMinimumWidth (API 1). Also exposed in androidX via
ViewCompat

Identical for Height methods

Bug: 117521509
Bug: 117521475
Test: none
Change-Id: I2e92574acd053aecec9c992a89ee57fd9785415e
2018-11-26 12:14:03 +00:00
Tiger Huang
3d373af66d Merge "Let System UI show on external displays (1/3)" 2018-11-22 11:44:05 +00:00
Tiger Huang
7c610aaab3 Let System UI show on external displays (1/3)
Let each display have one status bar and one navigation bar. This is
so on each display, status bar and navigation bar can be laid out with
apps and produce proper insets.

Bug: 117474929
Test: atest com.android.server.wm
Test: Watch YouTube video in fullscreen mode, and see if status bar
      and navigation will be hidden as expected. Swipe on the edge
      of screen and see if status bar and navigation bar are both
      shown as expected.

Change-Id: I1550659b7cd1dd1676bf04483c5b68376ef42905
2018-11-22 17:58:06 +08:00
Abodunrinwa Toki
4bad09cd1d Introduce Translate intent.
Action: ACTION_TRANSLATE
Text: EXTRA_TEXT

TODO: Consider introducing a "translate" schema to pass the text to
translate instead of using a string extra to define this.

Bug: 116020587
Test: manually tested by selecting foreign language text and watching
      for a "Translate" action.
Change-Id: I046157f4b3e1aa60afaf3f123fdeecf406f712dc
2018-11-21 21:01:17 +00:00
Tony Mak
0be540b227 Add detectLanguage and suggestConversationActions to TCS
BUG: 111406942
BUG: 111437455

Test: atest frameworks/base/core/tests/coretests/src/android/view/textclassifier/TextClassifierTest.java

Change-Id: Iee9c970ebbec6590906907d67be3dd4021c1b4b2
2018-11-21 15:36:11 +00:00
Felipe Leme
2eadd14d5a Merge "Minor changes on IntelligenceManager APIs." 2018-11-20 00:09:31 +00:00
Felipe Leme
29397ce998 Temporarily disabled IntelligenceService.
It's not properly ignoring events when the service is not set, which is causing
issues on some apps.

Fixes: 119659731
Test: manual verification

Change-Id: Ie271b8fcfde0bc2a5d6bf7c73b88bd6c48d50fdb
2018-11-16 18:13:30 -08:00
Vishnu Nair
e626d58c1b ViewRoot: Notify app when surface is released from setWindowStopped
NativeActivities do not receive onNativeWindowDestroyed callback when the activity is stopped. If
the app still uses the window object after the window is destroyed, the app can crash.

Test: run native-plasma from Android NDK. Launch activity & press home. Verify from the logs app
receives onNativeWindowDestroyed callback when its stopped.

Bug: b/111948775
Change-Id: I1de76feb7f4974b77b42b56e592ff6444713c699
2018-11-16 13:29:28 -08:00
TreeHugger Robot
b6661f3615 Merge "Swaps position of expand button and bell icon." 2018-11-16 17:40:31 +00:00
Felipe Leme
92ab3857b0 Simplified View.onProvideContentCaptureStructure()
That method was returning a boolean to indicate whether the IntelligenceManager
should be notify, so views with virtual hierarchy could return false.

But now it returns void and always notify, which makes the API easier to
understand and use.

Bug: 117944706

Test: m -j update-api doc-comment-check-docs
Test: atest CtsAutoFillServiceTestCases

Change-Id: I216cacb6edb144239b6eabe56ab177fc2582e1aa
2018-11-16 09:19:37 -08:00
TreeHugger Robot
0638d504d0 Merge "Add maxTargetSdk annotation" 2018-11-16 11:38:18 +00:00
Dieter Hsu
02896eb9fe Merge "Synthesize hover events for TouchDelegate#onTouchExplorationHoverEvent" 2018-11-16 09:22:26 +00:00
Rob Carr
235c7199a8 Merge changes from topic "sfinput3"
* changes:
  WindowManager: Communicate with input system by WindowTokens.
  Plumbing for SurfaceControl#setInputWindowInfo.
2018-11-15 23:48:33 +00:00
John Reck
01053cd75b Add maxTargetSdk annotation
Bug: 119066174
Test: build
Change-Id: Ib744d3019bd5969cbfba89d1e350aceef970181f
2018-11-15 14:12:24 -08:00
Gus Prevas
51425313db Swaps position of expand button and bell icon.
This change puts the expand caret at the end of the notification header
if the new interruption model is turned on, and moves the bell icon on
noisy notifications from the end of the header to directly after the
header text.

Test: manually
Change-Id: I2a97f80920598f5f99f2d9c3b14d58858e1de1bb
2018-11-15 15:16:14 -05:00
TreeHugger Robot
18647776ac Merge "Fix ModelFile.isPreferredTo method" 2018-11-15 14:46:36 +00:00