2208 Commits

Author SHA1 Message Date
Jeff Sharkey
115d2c189a Add feature versions for devices and apps.
We're starting to see more instances of device features that will
increment separately from the SDK API level, such as camera HAL,
GPU capabilities, Bluetooth, and other hardware standards.

This change adds the ability for device features to specify a
version, which is defined to be backwards compatible.  That is, apps
requesting an older version of a feature must continue working on
devices with a newer version of that same feature.

When a version is undefined, we assume the default version "0".

Bug: 27162500
Change-Id: If890bf3f3dbb715e8feb80e7059a0d65618482ea
2016-02-15 17:45:42 -07:00
Vladislav Kaznacheev
989b58a633 Update pointer icon when View.setPointerIcon is called
Currently the updated pointer icon is only displayed after
the next mouse move.

Bug:27107871
Change-Id: Ieed57b07fe44699735179cf57968a9bb08981396
2016-02-12 16:55:53 -08:00
Ben Wagner
a87b07d7fa Add support for gx font variation axes.
This adds an 'axis' child element to the 'font' element. The 'axis'
element has attributes 'tag' (a four byte identifier) and 'stylevalue'
(a float value) to the parser. This also modifies reading the font file
name in a backwards compatible fashion by using only the direct #text
children of the 'font' element. (Both the Minikin and Skia parsers now
allow the font file name on a separate line in the fonts.xml file).

This information is then passed through to Skia in order to select the
desired variation. The Skia parser already parses this way and has for
some time, so Chrome and WebView can already read this format.

Change-Id: I15623fe864fa92b2bf0705af5e389daedfb77e5c
(cherry picked from commit b8e367fb7428076ff2e4aa2a97adaed1ef806e92)
2016-02-12 16:28:35 +00:00
Jerome Gaillard
69d9feb938 Layoutlib supports rounded corners of different sizes am: 3381cde9f2
am: 6f35d2c6ea

* commit '6f35d2c6ea1d18decd6b646035fd02fd5b1f0256':
  Layoutlib supports rounded corners of different sizes
2016-02-11 17:11:33 +00:00
Jerome Gaillard
3381cde9f2 Layoutlib supports rounded corners of different sizes
Bug: http://b.android.com/29098
Change-Id: I4e7dc3810559b509baf5ea306221c1d2504be0e1
2016-02-11 12:26:50 +00:00
Svet Ganov
8c6d8a7ef9 Fix build
Change-Id: I7c0601f873e37c7ebf71068ba81366704672bd70
2016-02-09 20:45:13 -08:00
Robert Carr
e12aece4ca Ensure surfaces stay alive until activity stop.
Prior to this commit in this case of activity pause, with finishing=true
the activity manager will notify us of app visibility and we will begin
an exit animation. When this exit animation finishes, we will destroy
the application surface (unless its eligible for saving). However there
are two cases where this breaks down:

1. The exit animation finishes before the activity thread handles
the stop transition. Many activities stop rendering on Pause
but many do not and it is totally legal to do so. Sometimes this
results in non fatal dequeue buffer errors and sometimes results in
fatal errors with Pixel Buffers, etc...
2. We may resume the activity shortly after asking the window manager
to pause it. If the window wasn't eligible for animation, we will
immediately destroy it after being told of the visibility change
following PAUSE_FINISHING. It's possible for this to complete
before we process the resume. On the other hand the client
happilly processes the resume and transitions back from PAUSE
and then crashes once it attempts to use it's surface.

In this commit we have the activity manager notify the window manager
when an application has actually finished (or we have timed out
waiting). For windows which have not been explicitly removed by the
client, we defer destruction until we have received both this signal
and the animation has completed.

Bug: 26793431
Change-Id: Ib6ee8fbdd1f03450fbbfd62468a19e97774befab
2016-02-08 20:46:53 +00:00
Deepanshu Gupta
08df538482 Remove obsolete try catch am: ebdcc80ac2
am: 29e8071d2e

* commit '29e8071d2e9f3a8171624fd63b849f5c14360b21':
  Remove obsolete try catch
2016-02-01 22:56:43 +00:00
Jorim Jaggi
1444cfd50e Fix build
Change-Id: Ifed64dc2a4db9a58c3588ea0ca899f628efe685a
2016-02-01 22:24:46 +00:00
Deepanshu Gupta
ebdcc80ac2 Remove obsolete try catch
The try catch was to prevent crashing on preview releases of Android
Studio. We don't support them anymore.

Change-Id: I8e33cae98117c0034aea1b56903b623fcb64435e
2016-02-01 14:03:30 -08:00
Jeff Sharkey
35871f2c2b Offer to migrate databases and SharedPreferences.
Databases and SharedPreferences often involve multiple files under
the hood, so developers wanting to migrate them between different
storage contexts should ask us to make sure all relevant files are
migrated correctly.

This makes a best-effort attempt to recover from battery pulls
during migration, while still trying to alert developers to
conflicting files.

Bug: 26668510, 25860525
Change-Id: I9ffa3e8cb6191dfd4237b9466a081d6d77df3ba0
2016-01-30 17:03:23 -07:00
Wale Ogunwale
b1faf60b89 Use resizeMode integer instead of resizeable boolean.
Changes activity manager and window manager to use resizeMode
as defined by ActivityInfo#resizeMode instead of a boolean.

Bug: 26774816
Change-Id: I8cef46d9fba6bfdd21df7da63ed5d5330ad03d4b
2016-01-29 07:44:33 -08:00
Jorim Jaggi
a4a58efe82 Fix app staying in drag resizing when undocking
When dismissing the docked stack, the fullscreen stack stayed in drag
resize mode because it got a relayout, but because the bounds didn't
change (it switches to the fullscreen layout a bit earlier) it never
called WM.relayoutWindow, so it stayed in drag resize mode indefinitely.

To fix this, introduce forceRelayout in Window.resized(), which makes
sure the client always calls relayoutWindow. Set this to true whenever
drag resizing is changing.

For some very weird reason this also broke that home button was not
responding anymore.

Bug: 26806532
Change-Id: I4b39c1c419a166aa7093c31226f2a4915f642328
2016-01-27 14:00:02 -08:00
Ian Pedowitz
2260a61842 Fix build and reorder methods to match ec6a447c86b03f5896fdb717de530c8abf8887f9
Change-Id: I39ee2864eda489bf0e485ea96d30e56b29500865
2016-01-25 19:09:42 -08:00
Filip Gruszczynski
0a66b6bc92 Fix build.
Change-Id: I68d6fade1b2a44a3542182914e0cd5853f4f0a81
2016-01-25 18:25:28 -08:00
Deepanshu Gupta
676ae8c8c9 Merge "Remove GregorianCalendar hack" am: 187c022bf1
am: 08f736e7b1

* commit '08f736e7b143f825fe3c29e70e9b505bbf8e1ae6':
  Remove GregorianCalendar hack
2016-01-23 01:05:26 +00:00
Vladislav Kaznacheev
c8680438c0 Merge "Change mouse pointer when drag and drop is active" 2016-01-23 00:26:01 +00:00
Deepanshu Gupta
08f736e7b1 Merge "Remove GregorianCalendar hack"
am: 187c022bf1

* commit '187c022bf187f137d48d9031c43cfc233c9fc158':
  Remove GregorianCalendar hack
2016-01-23 00:02:05 +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
Deepanshu Gupta
4f3d0c6caa Remove GregorianCalendar hack
Bug: http://b.android.com/199424
Change-Id: I589d153e1f57b6302c6fe3c031c5c63e33ad9996
2016-01-22 11:33:53 -08:00
Selim Cinek
e797745d75 Fix build by adding missing method
Change-Id: I4309225f9c799237857ce4c8f7ae2f8667d0b8be
2016-01-22 07:17:39 +00:00
Jerome Gaillard
751766a561 Deals with translation and scaling in layoutlib am: ded4d14e33
am: cc90965d8f

* commit 'cc90965d8f3b8779fc477ec8a43b16306e5da535':
  Deals with translation and scaling in layoutlib
2016-01-21 13:19:57 +00:00
Jerome Gaillard
ded4d14e33 Deals with translation and scaling in layoutlib
Layoutlib now correctly interprets the translation and scaling
xml attributes of views, by implementing what the Android platform
does in native code.

Change-Id: Ie8465f40ef4508d3c31796200800f12cb8f883a4
2016-01-21 11:21:47 +00:00
Jerome Gaillard
b384adf63f Merge "Deals with android:rotation attribute in layoutlib" into mnc-ub-dev am: 7efb74d54a
am: 426910e4df

* commit '426910e4dfb1f84f93697017c90400c0b4f8e6c0':
  Deals with android:rotation attribute in layoutlib
2016-01-20 17:44:57 +00:00
Jerome Gaillard
7efb74d54a Merge "Deals with android:rotation attribute in layoutlib" into mnc-ub-dev 2016-01-20 11:44:07 +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
Jerome Gaillard
c92d70dff7 Deals with android:rotation attribute in layoutlib
The way Android views deal with their rotation xml attribute is through
native code called for hardware accelerated rendering. So layoutlib
has to bypass that in order to take those attributes into account.

Bug: http://b.android.com/73300
Change-Id: Ieb5bf0567a25a9021491ebf3250cedd0752f7863
2016-01-19 18:31:06 +00:00
Diego Perez
82b425f853 Fix bug in PropertyValuesHolder_Delegate method index am: ada8c117b1
am: 0eac32be0b

* commit '0eac32be0b7804184ad5e61af87f79d45b82c6b2':
  Fix bug in PropertyValuesHolder_Delegate method index
2016-01-19 15:53:12 +00:00
Diego Perez
ada8c117b1 Fix bug in PropertyValuesHolder_Delegate method index
The method index in PropertyValuesHolder was using only the method name
+ the number of parameters in the call to index the different properties
methods. This worked ok most of the time because, for a given method
name (let's say setTrimStartOffset), the class is usually the same.
However, if the same method name is used in multiple classes, this will
cause collisions and will most likely crash.

Change-Id: Ie6fa8872c5c5e69e690f4f1bb79191a31bef2a28
2016-01-19 10:42:19 +00:00
Diego Perez
365bd8f9b1 New path interpolation to paint vector drawables am: b9c48d8f49
am: 6952063e71

* commit '6952063e7166599f5300427019ca845bbaafa660':
  New path interpolation to paint vector drawables
2016-01-19 10:39:46 +00:00
Diego Perez
b9c48d8f49 New path interpolation to paint vector drawables
Before this CL, PathMeasure_Delegate would use Path_Delegate.approximate
to get a path segment to draw. Path_Delegate.approximate uses a
flattening iterator to do the path approximation.
Unfortunately, because we do not control the stroke mode while painting,
in some cases the approximation would draw unwanted artifacts caused by
the rough approximation and the use of wrong miter values.
This CL does a much better calculation of the path and interpolates the
segments of the curves instead of replacing them with line segments.

This also fixes an issue with the calculation of empty paths.

Bug: http://b.android.com/187256

Change-Id: I450f7aa4c3d9efcbf902a40c3b4d6d388546893f
2016-01-19 10:14:46 +00:00
Jorim Jaggi
0da43029fd Fix build
Change-Id: I6d4bebf90c11a4a00d259aac34bb9459d973da9b
2016-01-15 16:20:25 -08:00
Deepanshu Gupta
15cc7bba8d Merge "Fix custom font rendering" into mnc-ub-dev am: f5984d5fce
am: 14df39f9e5

* commit '14df39f9e5855caef8d272fb136abe17b225d971':
  Fix custom font rendering
2016-01-15 05:29:10 +00:00
Deepanshu Gupta
9757c933b0 LayoutLib: Fix device used comments in intensive tests am: 1665a621da
am: bbd0b324ba

* commit 'bbd0b324ba8e89bd51aad0a59b1a1c891383779f':
  LayoutLib: Fix device used comments in intensive tests
2016-01-15 00:23:33 +00:00
Deepanshu Gupta
4da12f19a6 Merge "Minor fix to wrong error message" 2016-01-14 23:54:14 +00:00
Tor Norbye
8b4a6981fd Minor fix to wrong error message
Change-Id: I3d34c90d37d35d0649a6ef8a73ca0d9320f975dd
2016-01-14 15:53:05 -08:00
Deepanshu Gupta
f5984d5fce Merge "Fix custom font rendering" into mnc-ub-dev 2016-01-14 23:48:17 +00:00
Deepanshu Gupta
2ea852541f Fix custom font rendering
The context was using the wrong asset manager.

Bug: http://b.android.com/198897
Change-Id: Id58473a4539ed93a9f338c730686128c7089fc92
2016-01-14 23:46:42 +00:00
Deepanshu Gupta
1665a621da LayoutLib: Fix device used comments in intensive tests
Change-Id: I65ee2f8bdf096ea991e72c99777c8981da7b5ae2
2016-01-14 23:19:29 +00:00
Wale Ogunwale
b2d135694f Fix build breakage.
Bug: 22405482
Change-Id: I8fc522885801e9735544ec3820c8fdd4a4368d71
2016-01-13 15:08:29 -08:00
Deepanshu Gupta
0beaeadbe3 Merge "Fix ninepatch scaling." into mnc-ub-dev am: 0c08fc0fc5
am: 2aebcddf02

* commit '2aebcddf02383c84a8a21279d32fd00376b8c25e':
  Fix ninepatch scaling.
2016-01-11 18:23:50 +00:00
Jerome Gaillard
63ebf34d6d Merge "Get color state list file content from PSI instead of disk" into mnc-ub-dev am: 171a2a9322
am: 1bddf2b19d

* commit '1bddf2b19dbfc3f1edc540a5aaaacd84f8831412':
  Get color state list file content from PSI instead of disk
2016-01-11 18:20:35 +00:00
Deepanshu Gupta
0c08fc0fc5 Merge "Fix ninepatch scaling." into mnc-ub-dev 2016-01-11 18:09:45 +00:00
Jerome Gaillard
171a2a9322 Merge "Get color state list file content from PSI instead of disk" into mnc-ub-dev 2016-01-11 18:06:10 +00:00
Jerome Gaillard
b63da06a7a Get color state list file content from PSI instead of disk
Use new functionality from callback to get the content of state list files
from PSI instead of disks.

Bug: http://b.android.com/183767
Change-Id: Ic256d1e7787209d772ccd42c2e3c7f409cac2964
2016-01-11 11:37:19 +00:00
Jeff Sharkey
cd65448ccd Even more PackageManager caller triage.
Finish moving all UID/GID callers to single AIDL method that requires
callers to provide flags.

Triage AppWidgets and PrintServices, which currently can only live on
internal storage; we should revisit that later.

Fix two bugs where we'd drop pending install sessions and persisted
Uri grants for apps installed on external storage.

Bug: 26471205
Change-Id: I66fdfc737fda0042050d81ff8839de55c2b4effd
2016-01-08 18:35:54 -07:00
Deepanshu Gupta
80dc34e358 Merge "Java 8 in layoutlib-create" 2016-01-08 17:37:56 +00:00
Deepanshu Gupta
23e47f5621 Java 8 in layoutlib-create
Upgrade to ASM 5 and diamond operators.

Also minor fixes here and there.

Bug: 26442940
Change-Id: I5611ed0889aa94cca8655fec47799e1ddccb0150
2016-01-08 08:03:06 -08:00
Alex Klyubin
e7565ad959 Merge "[1/3] Remove unnecessary throws statement in ServiceManager" am: d1240219aa
am: 4a06b7ea7e

* commit '4a06b7ea7e493bf7b575da5219429e2cbeb5b3e8':
  [1/3] Remove unnecessary throws statement in ServiceManager
2016-01-07 19:21:59 +00:00