Commit Graph

6486 Commits

Author SHA1 Message Date
Alan Viverette
a770530e12 Announce the date for accessibility using EMMMMdy format
Which for en_US would be something like "Friday August 5th 2016" but may
be re-ordered for other locales. Dates are hard.

Bug: 30682782
Change-Id: I015d293526592add27ce8fada12cd58bcc274ccf
2016-08-17 12:46:59 -04:00
TreeHugger Robot
75f7bfdc7a Merge "Use localized hour when announcing selection for accessibility" into nyc-mr1-dev 2016-08-10 21:55:30 +00:00
Alan Viverette
47be54bb78 Use symmetric conditions for advertising and performing ACTION_SCROLL
Bug: 30186372
Change-Id: Ieea0cd539049990ffa98edabb2a7b026445dd14a
2016-08-05 16:48:19 -04:00
Alan Viverette
66a8562c58 Use localized hour when announcing selection for accessibility
Bug: 30451273
Change-Id: I04276dc12d479ff5336799ebb32ff4cf5d66068a
2016-08-04 13:24:14 -04:00
Yigit Boyar
2dd20a61e9 Target API check for margin params fix
Prior to N, our widgets were not converting MarginLayoutParams
properly between ViewGroups. The fix intrudced some issues in
older apps as the broken conversion code would hide developer
errors. This CL guards the change with a target API check so
that we don't affect older apps.

Bug: 30378230
Change-Id: I215281d261b553c3b4cedcd29ea0a861df809471
2016-08-02 11:27:18 -07:00
Svetoslav Ganov
a2f247e6a6 Merge "Revert "Prevent apps to overlay other apps via toast windows"" into nyc-mr1-dev 2016-08-02 01:56:10 +00:00
Svetoslav Ganov
2fc661a453 Revert "Prevent apps to overlay other apps via toast windows"
bug:30150688

This reverts commit dc24f937b0.

Change-Id: Id7e8ddbf82ab426f55a5296791f1e8ebb61514bc
2016-08-02 01:55:01 +00:00
Alan Viverette
7dd40cd411 Merge "Adjust touch progress offset to account for changes to AbsSeekBar" into nyc-mr1-dev 2016-08-01 20:53:50 +00:00
Alan Viverette
1d33c3f3a3 Adjust touch progress offset to account for changes to AbsSeekBar
Previously AbsSeekBar always rounded up, which resulted in poor handling
of touches near the edge of a progress value. We fixed this but forgot
to adjust RatingBar for the new behavior.

Bug: 30558586
Change-Id: I634fa7a0b98568093e16279ef5a80abe08d2e2fe
2016-08-01 15:14:05 -04:00
Svet Ganov
dc24f937b0 Prevent apps to overlay other apps via toast windows
It was possible for apps to put toast type windows
that overlay other apps which toast winodws aren't
removed after a timeout.

Now for apps targeting SDK greater than N MR1 to add a
toast window one needs to have a special token. The token
is added by the notificatoion manager service only for
the lifetime of the shown toast and is then removed
including all windows associated with this token. This
prevents apps to add arbitrary toast windows.

Since legacy apps may rely on the ability to directly
add toasts we mitigate by allowing these apps to still
add such windows for unlimited duration if this app is
the currently focused one, i.e. the user interacts with
it then it can overlay itself, otherwise we make sure
these toast windows are removed after a timeout like
a toast would be.

We don't allow more that one toast window per UID being
added at a time which prevents 1) legacy apps to put the
same toast after a timeout to go around our new policy
of hiding toasts after a while; 2) modern apps to reuse
the passed token to add more than one window; Note that
the notification manager shows toasts one at a time.

bug:30150688

Change-Id: Icc8f8dbd060762ae1a7b1720e96c5afdb8aff3fd
2016-08-01 11:46:02 -07:00
Michael Kwan
744be16ffa Add titles to PreferenceFragments and PreferenceScreens for watches.
Preferences lack a title on watch type devices due to lack of ActionBar
support. A custom ListView was added to use a custom wrapper adapter to
add a persistent header view at the top of the ListView that developers
would not be able to remove via the ListView API.

Bug: 27962897
Change-Id: I6bccecf85592d9507e0c7a04c9a035617001e9ef
2016-07-26 10:57:56 -07:00
Alan Viverette
48c5f38b34 Merge "Ensure forwarding listener target is long-clickable" into nyc-mr1-dev 2016-07-22 21:09:37 +00:00
TreeHugger Robot
0ff47b64cd Merge changes Idd0b38b4,I511356a8 into nyc-mr1-dev
* changes:
  Fixed a bug where the fade in from dark would not work properly
  Changed the appearance of fullscreen intent notifications again
2016-07-22 19:20:49 +00:00
Selim Cinek
981962e6ad Changed the appearance of fullscreen intent notifications again
Change-Id: I511356a8dc0fe253541c625fb7b43ed0c7bafaca
Fixes: 28269355
2016-07-22 12:13:11 -07:00
Alan Viverette
123db917b2 Merge "Better docs for ImageView legacy tint" into nyc-mr1-dev 2016-07-22 02:50:40 +00:00
Yigit Boyar
93652f20f2 Merge "Resolve ListView children's RTL properties when added" into nyc-mr1-dev 2016-07-21 21:56:56 +00:00
Alan Viverette
2b4e14cfcc Better docs for ImageView legacy tint
Bug: 30283225
Change-Id: Ic748c2cc341edf44aed0202aa55a57584bd928c1
2016-07-21 16:25:13 -04:00
Alan Viverette
11ace9eedb Ensure forwarding listener target is long-clickable
Bug: 28550349
Change-Id: Id9bb74eee0c91919e3167e3a8a316e3921652df5
2016-07-21 16:04:33 -04:00
Svetoslav Ganov
f1395d730a Revert "Prevent apps to overlay other apps via toast windows"
This reverts commit b3b22cba86.

Change-Id: I905e7435893fab49f03fdb708f4ab5a9d2c9cbae
2016-07-20 01:00:51 +00:00
Yigit Boyar
4d827aafad Resolve ListView children's RTL properties when added
ListView adds children without requesting a layout for them.
This creates a problem if the child does not request a
layout because we reset the child's RTL properties when
addViewInner is called.

A proper solution would be to call resolve when child is
being measured (and ignore cache if it resolves) but
a change like that is too risky for MR1. This CL will
fix ListView portion of the issue.

On master, we'll solve this in View level.
Bug: 30132566

Change-Id: I0b131ac1086b1d32146f3c93d1323050873293d3
2016-07-19 15:32:09 -07:00
Svet Ganov
b3b22cba86 Prevent apps to overlay other apps via toast windows
It was possible for apps to put toast type windows
that overlay other apps which toast winodws aren't
removed after a timeout like toasts are.

Now to add a toast window one needs to have a special
token. The token is added by the notificatoion manager
service only for the lifetime of the shown toast and
is then removed including all windows associated with
this token.

This prevents apps to add arbitrary toast windows. The
token is passed in the app domain in the request to
construt and add the toast window which allows a bad
app to add arbitrary toast windows. However, this is
fine since the token will be invalided and all of its
windows removed after the toast for which it was
create times out.

We do not care of braking apps that add toast windows
directly due to the security and privacy implications
of arbitrary UI redressing. Also we have dedicated
Toast APIs which are the way to add this time of UI.

bug:30150688

Change-Id: I65372c81a791489de89fb2886cc96392c28680bb
2016-07-14 19:16:42 -07:00
Alan Viverette
26489e1688 Set up view state before attaching, jump drawables if needed
View attachment calls jumpDrawablesToCurrentState(), so the view state
needs to be set up prior to attachment. For views that are already
attached but are being moved to a new position, manually jump.

Cleans up comments in methods that were modified.

Bug: 29978498
Change-Id: Ica27b2c60ad7ee98b9d1e4912c4f8b8c248af88d
2016-07-07 16:39:27 -04:00
Alan Viverette
a2beb44834 Merge \"Only clip PopupWindow in the vertical direction\" into nyc-dev
am: 4b736ea56d

Change-Id: Idf5aedfb2f19595b8317c7dca1640ff0caf31696
2016-06-30 17:35:52 +00:00
Alan Viverette
4b736ea56d Merge "Only clip PopupWindow in the vertical direction" into nyc-dev 2016-06-30 17:24:22 +00:00
Alan Viverette
650cc68f10 Merge \"Exclude children from excess space distribution when using largest child\" into nyc-dev
am: 7705d5fd6e

Change-Id: I747b4dab5bfc31b2461b445d1d983ac95a05693d
2016-06-30 17:19:41 +00:00
Alan Viverette
9705fa0602 Only clip PopupWindow in the vertical direction
Bug: 29865091
Change-Id: Ic4e3b50571034f341aff2c2fbf2c349342622448
2016-06-30 13:17:26 -04:00
TreeHugger Robot
7705d5fd6e Merge "Exclude children from excess space distribution when using largest child" into nyc-dev 2016-06-30 17:07:07 +00:00
Alan Viverette
070b22bdee Exclude children from excess space distribution when using largest child
Preserves API 23 behavior.

Bug: 29872769
Change-Id: I514cde81dcca4d78238f407251805cced4c0bea1
2016-06-30 11:15:36 -04:00
Yohei Yukawa
cb56978912 Merge "Use a flag to grant a temporary URI permission." into nyc-mr1-dev 2016-06-27 20:18:51 +00:00
Robert Carr
c6413cc919 Merge \"PopupWindow: Use DISPLAY_CLIP_VERTICAL/HORIZONTAL.\" into nyc-dev
am: 8afc1f70f0

Change-Id: Iabd270da70c540b9da38a72895adc6904bbb41cd
2016-06-24 22:50:39 +00:00
Robert Carr
489c39d2db PopupWindow: Use DISPLAY_CLIP_VERTICAL/HORIZONTAL.
When we want the WindowManager to clip our requested width/height
to the display frame, we need to pass DISPLAY_CLIP_VERTICAL/HORIZONTAL.
It seems this behavior was unintentionally applied without this flag
in previous releases.

Bug: 29602363
Change-Id: Ib98060e36efde0dbaabb59a758da5374035dbb62
2016-06-24 14:07:20 -07:00
Yohei Yukawa
45700fa135 Use a flag to grant a temporary URI permission.
It turns out that we can let the system to call
InputMethodService#exposeContent(InputContentInfo, EditorInfo), which
added in my previous CL [1], during the IME is calling
InputConnection#commitContent() as follows.

  [IME]
  InputContentInfo contentInfo = new InputContentInfo(
          contentUri,
          new ClipDescription(description, new String[]{mimeType}),
          linkUrl);
  getCurrentInputConnection().commitContent(
          inputContentInfo,
          InputConnection.INPUT_CONTENT_GRANT_READ_URI_PERMISSION,
          null);

  [App]
  try {
      contentInfo.requestPermission();
      // Load inputContentInfo.getContentUri() here.
  } finally {
      contentInfo.releasePermission();
  }

This gives us flexibility to let InputConnection#commitContent() do all
the magic for IME developers like other APIs such as
Context#startActivity(), rather than asking them to call one more API to
grant a temporary URI permission like a scenario where
Context#grantUriPermission() is used.

 [1]: I2772889ca01f2ecb2cdeed4e04a9319bdf7bc5a6
      25e0813e6e

Bug: 29450031
Change-Id: I99536cd58c9984af30b0bafb4a1dd25a26634a2d
2016-06-23 17:12:59 -07:00
Alan Viverette
54e12ac7f5 Merge \"Clarify docs for PopupWindow width/height parameters\" into nyc-dev
am: 22f887a014

Change-Id: I7311e8cb98da040148e961734646251949975270
2016-06-23 01:00:32 +00:00
Alan Viverette
22f887a014 Merge "Clarify docs for PopupWindow width/height parameters" into nyc-dev 2016-06-23 00:55:52 +00:00
Robert Carr
d748b54615 Merge \"Don\'t try and resolve WRAP_CONTENT too early.\" into nyc-dev
am: 72ce991692

Change-Id: I277968e2a48ac5647db0f03877ab168afc245a6c
2016-06-21 23:35:11 +00:00
Alan Viverette
c129b58ad1 Clarify docs for PopupWindow width/height parameters
Bug: 29496188
Change-Id: I1e9b74880f4ea0454971f0d7d6eb4765b64db98f
2016-06-21 11:09:03 -04:00
Chris Banes
3b925c1ab0 Fix NPE in Toolbar - framework edition
Caused by super constructor calling non-final methods
which Toolbar overrides, and then tries to reference
final variables.

BUG: 28806107
Change-Id: Ieaf5f7611dbbf954e49c31e604aa2f7627248615
2016-06-21 08:09:24 +00:00
Robert Carr
07421cb9bb Don't try and resolve WRAP_CONTENT too early.
At the point of showDropDownPosition measure
may have not yet been called and we can't try
and resolve WRAP_CONTENT. ViewRoot will do it for us
and set requestedWidth/Height at an appropriate point.

Bug: 29496188
Change-Id: I99f26612bec800f3e321495b3df3e37b5ffb3152
2016-06-20 15:55:02 -07:00
Yohei Yukawa
adebb52588 API Rename: IC#inputContent to IC#commitContent.
As shown in below, we have already used commit* naming convention in
InputConnection.

 - InputConnection#commitCompletion(CompletionInfo);
 - InputConnection#commitCorrection(CorrectionInfo);
 - InputConnection#commitText(CharSequence, int);

Hence renaming IC#inputContent() to IC#commitContent() would make the
new method more consistent.

Bug: 29450024
Change-Id: Ica1ba3154795c1bf44e140dfe639b299f83cd8af
2016-06-17 10:10:39 -07:00
Robert Carr
33809d724e Merge \"PopupWindow: Resolve measure specs before passing to WM.\" into nyc-dev
am: 4a284be41d

Change-Id: I3716c7a67310d3f1dea47db0da8db7915610345a
2016-06-15 16:52:07 +00:00
TreeHugger Robot
4a284be41d Merge "PopupWindow: Resolve measure specs before passing to WM." into nyc-dev 2016-06-15 16:41:51 +00:00
Adrian Roos
ba38cc6992 Merge \"Make RemoteView margins density-change safe\" into nyc-dev
am: 26e864c398

Change-Id: I3098eb8a803de7bc471bb362a2eb01b7f6d473ce
2016-06-14 19:41:54 +00:00
Robert Carr
cb8dcec66a PopupWindow: Resolve measure specs before passing to WM.
For the setClipToScreen case we need constraint to
the available display area, but not to the parent window.
If we don't pass FLAG_LAYOUT_NO_LIMITS, we will be constrained
to the parent window. However when we do pass it, we will
not be constrained to the system insets. So, we can pass
FLAG_LAYOUT_NO_LIMITS and constrain ourselves to the insets
via getWindowVisibleDisplayFrame. We also need to avoid
calling setWidth/Height with these resolved values
so we can preserve the indeterminate values in case
layout changes (e.g. rotation).

Bug: 29166136
Change-Id: I4c7c6204e6bc1cdcf4ad86f7e99e3511d4312ae4
2016-06-13 20:23:14 -07:00
Adrian Roos
2d5dbba923 Make RemoteView margins density-change safe
Bug: 28935363
Change-Id: I279da8da84f794c512a66cb46c76ae9e746a6387
2016-06-13 15:39:05 -07:00
Yohei Yukawa
152944f490 Add InputConnection#insertContent().
Providing an official protocol for IMEs to insert an image to the
application is something that has been requested from many IME
developers to Android OS.  With this CL, IMEs are able to ask
applications to insert a content including image files as follows.

 1. An application that opts in to this protocol specifies a list of
    supported content MIME types in EditorInfo#contentMimeTypes.
 2. When an IME is actively interacting with such an application, the
    IME can call InputConnection#insertContent() with a InputContentInfo
    that contains content URI, metadata (ClipDescription), and an
    optional link URI.
 3. The application can read the stream data from the given content URI
    to insert the content into somewhere in the application.

Detailed design background can be found in the JavaDoc of
InputConnection#insertContent().

Bug: 22830793
Change-Id: Iaadf934a997ffcd6000a516cc3c1873db56e60ad
2016-06-10 19:04:34 -07:00
Yigit Boyar
8e5e136403 Merge "Invalidate child bounds when AbsListView bounds change" into nyc-dev
am: bb039d2f17

* commit 'bb039d2f17d61b96c88d2cae445a53a642fb421f':
  Invalidate child bounds when AbsListView bounds change

Change-Id: I204f80216fb0594b7c7cb6070add58e91003b7a7
2016-05-31 19:26:09 +00:00
Yigit Boyar
bb039d2f17 Merge "Invalidate child bounds when AbsListView bounds change" into nyc-dev 2016-05-31 19:20:21 +00:00
Yigit Boyar
51b5caf902 Invalidate child bounds when AbsListView bounds change
This CL fixes a bug in AbsListView where it was not invalidating
children's bounds when AbsListView's bounds change. This was
triggering bugs where if you set padding on a list view, it would
not resize its children.

Bug: 28800232
Change-Id: I81a4e9ea234c395de80efea5ef5e47a71cb95136
2016-05-27 16:00:22 -07:00
Siyamed Sinir
4dc77b7a5e Merge "Revert "Fix TextView layout reuse when maxLines is set"" into nyc-dev
am: 990e26118d

* commit '990e26118d5b6cad2d34483b1908ba6f8334a764':
  Revert "Fix TextView layout reuse when maxLines is set"

Change-Id: Ia2c2d22b40c4613c54c9d86a29f21059da3f7a42
2016-05-27 18:50:50 +00:00
Siyamed Sinir
3f23dad913 Merge "Set StaticLayout.maxLines only when ellipsize is set" into nyc-dev
am: 92d0316d28

* commit '92d0316d2837baceffb22e1a7eb0e5da50f0a025':
  Set StaticLayout.maxLines only when ellipsize is set

Change-Id: I17934afae1d5e8b7fe3b3ad8b4286dd43f68393e
2016-05-27 18:45:17 +00:00