Commit Graph

7727 Commits

Author SHA1 Message Date
Vladislav Kaznacheev
a74e729fa9 Merge "Fix SecurityException in Editor.onDrop" 2016-01-27 00:38:38 +00:00
Vladislav Kaznacheev
c14df8e73d Fix SecurityException in Editor.onDrop
When a content URI is dropped onto EditText, it tries making sense
of the contents, and in the process it accesses the content provider.
If this content provider requires a permission grant, SecurityException
occurs.

This fix does two things:
1. Editor.onDrop now requests DropPermissions and releases is
when it is done. This required the introduction of a new hidden method
DropPermissions.takeTransient, because the existing method required
access to an Activity instance.

2. If the drag originator neglected to allow the permission grant,
DropPermission request would not help, so a try/catch block
is added to Editor.onDrop to avoid breaking the recipient app.

Bug: 26694948
Change-Id: I714429a507e62c83a150d91fbcdee791bced3ad3
2016-01-26 11:53:00 -08:00
Keisuke Kuroyanagi
0837daa464 Merge "Make scroll bar mouse draggable." 2016-01-26 01:46:53 +00:00
Yigit Boyar
c3bc45ec04 Merge "Fix requestRectangleOnScreen" 2016-01-25 23:00:42 +00:00
Vladislav Kaznacheev
92b26c5bff Merge "Restore correct mouse pointer after drag and drop" 2016-01-25 22:09:38 +00:00
Yigit Boyar
d62d5e9acc Fix requestRectangleOnScreen
This CL fixes a bug in View#requestRectangleOnScreen where the
position was not being moved from child's coordinate space to
the parent's coordinate space properly.

I've also added more documentation to clarify the API.

Bug: 25787435
Change-Id: Id821fa178e04016f6fb830d0bd2abde046581465
2016-01-25 10:39:29 -08:00
Andres Morales
56efa64d62 Merge "stash FrameStatsObservers when mAttachInfo is null" 2016-01-25 16:51:37 +00:00
Andres Morales
214a137209 Merge "expose hwui frame stats through FrameStatsObserver" 2016-01-25 16:51:14 +00:00
Vladislav Kaznacheev
ec6a447c86 Restore correct mouse pointer after drag and drop
This CL introduces IWindow.updatePointerIcon method.
When the drag is complete, this method is called on the window
directly under the pointer.

Same method can be used in the future to update mouse pointer
when a window appears or disappears.

Bug: 24415739
Change-Id: Ia7b0522448cb3cd754da5e24696060d3b3bf2e50
2016-01-22 17:30:10 -08:00
Vladislav Kaznacheev
c8680438c0 Merge "Change mouse pointer when drag and drop is active" 2016-01-23 00:26:01 +00:00
Andres Morales
51dbe5bf7d stash FrameStatsObservers when mAttachInfo is null
register in dispatchAttachedToWindow

Change-Id: Ida01d49e5886e4a715e4f16a378ab0d9d9986c3d
2016-01-22 13:57:18 -08:00
Andres Morales
06f5bc70a6 expose hwui frame stats through FrameStatsObserver
Change-Id: I88884bafc8e2f6d7f67a36d3609490e83cf8afd5
2016-01-22 12:58:51 -08:00
Michael Wright
1262dc0390 Merge "Switch and store keyboard layouts based on IME subtype." 2016-01-22 20:18:29 +00:00
Vladislav Kaznacheev
ba761124e6 Change mouse pointer when drag and drop is active
Mouse pointer is set to STYLE_GRAB when the drag has started and
reset to STYLE_DEFAULT when the drag has ended.

Resetting the pointer shape to the one defined by an underlying
view will be handled in a separate patch.

Bug: 24415739
Change-Id: I8df0a08c5701a34a48f10ec6b43c2cf2e6362d61
2016-01-22 12:09:45 -08:00
Tor Norbye
df8373389d Merge "Specify a maximum value for View.MeasureSpec.makeMeasureSpec" 2016-01-22 20:00:16 +00:00
Alan Viverette
7dfd9e4cd6 Merge "Verify results of methods called during child ordering" 2016-01-22 19:43:18 +00:00
Alan Viverette
a7b85e6855 Verify results of methods called during child ordering
Also updates nullability annotations for methods called during touch
dispatch. Verifies that TouchTarget and HoverTarget are not recycled
multiple times.

Bug: 26611563
Change-Id: Ica5ff18e18b325b12fe72b8ca145443b25625fe4
2016-01-22 10:14:02 -05:00
Yohei Yukawa
094e64b7cf Merge "Clarify the purpose of EditorInfo#hintLocales." 2016-01-22 09:54:19 +00:00
Yohei Yukawa
a823912f84 Merge "Initialize InputMethodSubtype with "languageTag"." 2016-01-22 07:35:17 +00:00
Yohei Yukawa
b8456a6a48 Initialize InputMethodSubtype with "languageTag".
My previous commit [1] introduced a new XML attribute "languageTag" for
subtypes but forgot to initialize InputMethodSubtype object with that
attribute.  As a result, InputMethodSubtype#getLanguageTag() has always
returned null even if "languageTag" attribute is specified.

  [1]: I77db5b99a7cf745d800db75baf135bb60ad04820
       8d6eeb01df

With this CL, InputMethodSubtype#getLanguageTag() starts returning the
value specified in the XML resource.

Bug: 22859862
Change-Id: I251d3d999afd13c0d618f2cb59e8ed3d47f21c98
2016-01-21 22:24:44 -08:00
Selim Cinek
6183d12926 Fixed that music notifications were not clickable on lockscreen
On the lockscreen we were unintentionally disabling single clicks
on the media buttons while we only wanted to disallow it for the
notification header. This is now fixed by explicitly checking if
we are clicking on the notification header.

Bug: 26325096
Change-Id: I044f25ac3216b98c7769c31d09d19f801a437194
2016-01-21 19:42:49 -08:00
Selim Cinek
c848c3a1b4 Changed the work profile appearance
Change-Id: I0545ee9b18572b93f73b4cf54126cf03085b61b5
2016-01-21 19:42:49 -08:00
Selim Cinek
4ffd63611a Changed the transformation from when switching notification views
Change-Id: I2af3c2f36787d208be7745dabae96903df256156
2016-01-21 19:42:49 -08:00
Vladislav Kaznacheev
829ab6daf5 Merge "Zero out DragEvent position when it should not be available" 2016-01-22 00:41:57 +00:00
Vladislav Kaznacheev
cc010b2a98 Zero out DragEvent position when it should not be available
Bug: 26729675
Change-Id: I46507198deea89c100cb1b99a1ab7ec0719efb12
2016-01-21 16:24:40 -08:00
Michael Wright
d5f7ed9fe9 Switch and store keyboard layouts based on IME subtype.
Rather than associate the keyboard layout solely with a specific
hardware model, we should also associate it with a given IME subtype.
This lets users switch between various languages and have the
keyboard change in unison with them so they can use the appropriate
layouts for each language.

This change adds initial support for associating IME subtypes and
keyboard layouts. We still need to:
  - Remove support for the old style of layout association once the
    Settings apps begins to use the new APIs
  - Automatically select an appropriate layout based on the given
    subtype (or set a reasonable universal default such as QWERTY)

Bug: 25752812

Change-Id: Ie88ce1ab77dbfe03ab51d89c1dc9e0a7ddbb3216
2016-01-21 14:03:43 -08:00
Yohei Yukawa
d469f2122e Clarify the purpose of EditorInfo#hintLocales.
During the initial attempt to support automatic language switching in
LatinIME, it turns out that the current EditorInfo#locales is difficult
to use and even confusing in some situations.  Based on that
experience, this CL changes as follows:

* Rename EditorInfo#locales to EditorInfo#hintLocales:
  This is mainly to avoid possible confusion when to set this.  We want
  to make it clear that having non-empty LocaleList there is a clear
  signal that the user would switch to certain languages regardless of
  the currently selected input method subtype.

* Make EditorInfo#hintLocales nullable:
  Previously marshaling EditorInfor causes NPE when
  EditorInfo#hintLocales is null.  This CL relaxes such a restriction.

* Introduce TextView#{set, get}ImeHintLocales():
  In the previous implementation [1], we just copied
  TextView#getTextLocales() into EditorInfo.  This is, however, does not
  work well because it is no more or less than the default value.  If
  LatinIME supports automatic language switching, having the default
  value in EditorInfo actually means that whenever you focus in a new
  text field, the keyboard language is reset to the default locale.
  In order to make this "hint" useful for IME developers, this "hint"
  should be specified only when the application developers are confident
  to do so.

  [1]: I738ffaaf07091d8b980f8bfc6e16227fcb85a96a
       0445fdf321

Bug: 22859862
Change-Id: I0a730011874ea8d01e50624ed3f1ecd197d05f94
2016-01-21 21:13:06 +00:00
Matt Wu
6c09ff5560 Merge "Set WindowSession's touchmode when in local focus mode," 2016-01-21 20:09:36 +00:00
Alan Viverette
dd26bfc13e Merge "Remove unnecessary @inheritDoc, add missing @Override to ViewGroup" 2016-01-21 19:49:00 +00:00
Phil Weaver
75fab6b8bc Merge "Pass drawing order information to accessibility." 2016-01-21 19:17:48 +00:00
Phil Weaver
1f2225486d Pass drawing order information to accessibility.
Bug: 22721935
Change-Id: I45a2be7c174c8b5a469b68a45dec0eb536825d92
2016-01-21 10:35:26 -08:00
Alan Viverette
be463f229e Remove unnecessary @inheritDoc, add missing @Override to ViewGroup
No functional changes. The default behavior for overridden methods is
@inheritDoc, so a standalone annotation is not necessary.

Change-Id: I3ace1989e9035ecf3cf8f7acc5391de1c1ff7c65
2016-01-21 10:50:10 -05:00
Keisuke Kuroyanagi
d85bc5074d Make scroll bar mouse draggable.
This is for Views that have special mouse dragging handling. e.g.
TextView invokes text selection on mouse dragging, so it cannot be
scrolled by mouse dragging.
This provides such Views or ViewGroups a last resort to scroll as we
don't assume that all devices have touch panel, touch pad, or mouse
wheel.

Bug: 20016455

Change-Id: I68a13258a50b5e4ea681b2576da6000a0bb3fa65
2016-01-21 14:50:38 +09:00
Robert Carr
d86c63a25e Layout SurfaceView in parent frame.
We always want the SurfaceView to be layed out
relative to the parent frame, fixes multiple issues
in freeform mode.

Bug: 26689889
Change-Id: Ib4728a515dc01c6884363b68a29f2e4ce5d5babc
2016-01-20 13:37:57 -08:00
Filip Gruszczynski
1937a4c68a Update width available for dialogs on all configuration changes.
Bug: 26504275
Change-Id: I7a0399e4af77ab02df8b3dff68adcf37b36d7ca7
2016-01-19 18:09:05 -08:00
Yohei Yukawa
18f3d9a39e Merge "There should be a way to clear additional subtypes." 2016-01-20 00:03:37 +00:00
Rob Carr
0102a8a8e9 Merge "Replace SurfaceViews across resize trigerred relaunches." 2016-01-19 22:59:10 +00:00
Robert Carr
23fa16b759 Replace SurfaceViews across resize trigerred relaunches.
In resize modes where we are preserving the main application
window, we need to tell the WindowManager to prepare to replace
the child surfaces, or they will dissapear across relaunches.

Bug: 26070641
Change-Id: I864168688dc320e9280e651f9c5df614f52bc96c
2016-01-19 22:23:41 +00:00
Yohei Yukawa
ac3e599069 Merge "Introdude IC#deleteSurroundingTextInCodePoints()." 2016-01-18 05:34:26 +00:00
Jorim Jaggi
2e95a488e0 More optimization while dragging docked divider
- Make sure mPendingBackdropFrame gets also set when if the window
triggers a relayout on it's own, so it doesn't call into window manager
all the time.
- Set the insets of the docked divider to empty so we don't trigger a
layout when we are just moving it - it doesn't need it in any case.
- Send a window move message to the divider when it moved
- Update attach info in all move cases, update light center

The whole resize operation now only takes around 4ms per frame, and
leaves a lot more resources for the apps to do configuration changes.

Bug: 25015474
Change-Id: Ica48129570a0fc858a89c21f46abf3442efb0224
2016-01-15 14:31:50 -08:00
Jorim Jaggi
844e1712df Don't relayout when windows move during resize
Not needed and just increases system load.

Bug: 25015474
Change-Id: Iaf871389527237b5cbc88c03b2f060629b6351dc
2016-01-15 14:31:20 -08:00
Jorim Jaggi
4846ee3cc3 Optimize window relayouts when dragging divider
- Communicate the resize mode to ViewRootImpl. If it is a docked
divider resize, do not call relayout for every traversal.
- Do not call Task.resizeWindows() unconditionally when changing
Stack bounds. It might be just a move.
- However, not calling relayout breaks layout bounds while
relaunching. To fix that, do the following:
-- Inform ViewRootImpl that the activity just relaunched, and force
a relayout call in the next traversal so the client can pick up
the unfrozen bounds.
-- When unfreezing the bounds, cause a traversal in window manager.

Bug: 25015474
Change-Id: Iab9a445dabce4f6ec1e25957038fe40a4be65246
2016-01-15 14:31:08 -08:00
Yohei Yukawa
70f5c48e8e There should be a way to clear additional subtypes.
InputMethodManager#setAdditionalInputMethodSubtypes() is the only API
that allows IMEs to add and remove additional subtypes.  However, due to
a bug, there is no way to clear the last entry of additional subtypes
because the API in question does nothing if the given array is emptry.

With this CL, an empty array is treated as a valid input.

This CL also adds a JavaDoc comment about a possible way to work around
this limitation in Android M and prior devices.

Bug: 26298984
Change-Id: I3731f84531247d071d9d88861e9079afc244a4e8
2016-01-15 21:02:52 +00:00
Chong Zhang
bd925dac2d Merge "Fix missing dialog windows" 2016-01-15 18:24:09 +00:00
Chong Zhang
f6525ceebc Fix missing dialog windows
Use the size in the configuration (not the display size) to set the
dialog size.

bug: 26490549
Change-Id: I8e17482ddcc39fae1d6fd7b0a8e1954b21dac5c8
2016-01-14 17:30:22 -08:00
Yohei Yukawa
f1fc5a0fe8 Merge changes Ib5ea8131,I571d6cc9
* changes:
  Add a new API IMM#dispatchKeyEventFromInputMethod().
  BaseInputConnection shouldn't rely on @hide APIs.
2016-01-15 01:23:09 +00:00
Alan Viverette
bc490ca283 Don\'t verify the scrollbar drawable am: a53c3b2197 am: ca6b87fea6
am: c8ef3f8730

* commit 'c8ef3f8730d20541e8f01f500c380fa09aa3853c':
  Don't verify the scrollbar drawable
2016-01-15 00:21:22 +00:00
Winson
3e87474145 Improving drag and drop animations.
- Expanding drop targets to indicate the size of the to-be docked window
- Fixing animation when dropping task
- Fixing drag view z order
- Fixes issue where the dock divider position in WM is not exact
- Requiring user to move the slop distance before accepting drops

Change-Id: I2f6eab504db7126c19e0c680629e89a39e7512e3
2016-01-14 15:23:20 -08:00
Alan Viverette
c8ef3f8730 Don\'t verify the scrollbar drawable am: a53c3b2197
am: ca6b87fea6

* commit 'ca6b87fea6b16e38f8bbbd514d3cf07361a5feba':
  Don't verify the scrollbar drawable
2016-01-14 21:49:09 +00:00
Alan Viverette
a53c3b2197 Don't verify the scrollbar drawable
Avoids infinite invalidations caused by re-use of scrollbar drawable
during a single draw() pass. Does not address the general problem of
drawable reuse causing unnecessary invalidations as a result of calls
to setBounds() invoking invalidateSelf().

Bug: 26533725
Change-Id: I99e9c2dfe4ddfc833569e40e7268dcb03e931fc9
2016-01-14 21:07:13 +00:00