4217 Commits

Author SHA1 Message Date
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
Matt Sarett
2c0348ffbb Merge "Revert "Encode paletted PNGs more efficiently"" 2016-01-29 23:59:40 +00:00
Matt Sarett
634ac1e497 Revert "Encode paletted PNGs more efficiently"
This reverts commit 3c7235d3868d4bf554d4c1700ac11fc3d4125c71.

Change-Id: I615827c7f4570467bb85c115c01de8c3b46e4e8a
2016-01-29 23:57:53 +00:00
Matt Sarett
fc1159c808 Merge "Encode paletted PNGs more efficiently" 2016-01-29 22:57:12 +00:00
Matt Sarett
3c7235d386 Encode paletted PNGs more efficiently
Saves about 2 MB of encoded size across affected assets.

Also will enable more efficient decoding.

Specifically, encoded palette values are assumed to be opaque unless
alpha values are provided in a tRNS chunk.  Before this change, we
would wastefully store many opaque alpha values in tRNS chunk.
Additionally, the decoder used to need to premultiply all of these
opaque colors, because the encoded data indicated that they had alpha.

Change-Id: I1d5400f71a0e3cb800fd0fc68a04c8c4069da8ef
2016-01-29 22:56:45 +00: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
Adam Lesinski
a68cf3c4a7 Merge "AAPT2: Add -x and -z flags to minimize changes in build scripts" 2016-01-26 06:51:42 +00:00
Adam Lesinski
8900aa8b44 AAPT2: Add -x and -z flags to minimize changes in build scripts
The -z flag will be supported soon anyway and -x is legacy.

Change-Id: I710467d35066d267dea8dfe7c521737fc768ede9
2016-01-25 22:48:15 -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
Adam Lesinski
ac7c606c90 Merge "AAPT2: Allow specifying non-final IDS when building 'legacy' style libraries" 2016-01-22 22:12:01 +00:00
Adam Lesinski
ef9c50120d AAPT2: Allow specifying non-final IDS when building 'legacy' style libraries
Real libraries will be built correctly, but since we are not doing that
yet, support the old way and allow a flag --non-final-ids to remove
the final modifier from R.java.

Change-Id: Iad55fb9140e55dbb0f41d0d55f2e2bd958294c8e
2016-01-22 14:09:53 -08: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
Roozbeh Pournader
2d05094209 Merge "Implement smarter locale resource selection" 2016-01-21 22:17:31 +00:00
Adam Lesinski
6f0324315b Merge "AAPT2: Accept empty zip files" 2016-01-21 22:13:15 +00:00
Roozbeh Pournader
b927c559e1 Implement smarter locale resource selection
* Add support for determining script from language and region.
* Add support for determining special parents of locales.
* Add support for smart comparison of locales with only a difference
  in region, using the locale parentage tree.
* Fix LocaleData.matchScore() to not fallback to old locale matching
  behavior if we can't determine a script.
* Allow four-character variant codes. (Previously, only five- to
  eight-character variant codes were allowed.)

Bug: 7296673
Bug: 26589793
Change-Id: Ibde0a48c0564ff383b41068095a5cbacfe7b94bc
2016-01-21 13:47:22 -08:00
Adam Lesinski
c446a733b8 AAPT2: Accept empty zip files
The libziparchive returns an error on empty zip files.
Work around this by checking for that error condition and
returning an empty ZipFileCollection.

Change-Id: I9edaf2e089456b6ccb4bb099b20ede10331bd352
2016-01-21 11:04:46 -08: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
Dan Albert
46736ec81c Merge "Make the appropriate cast to protect from mingw." am: dbf8c17bd2
am: 2edfa8c9b0

* commit '2edfa8c9b00cd0c0bd18738f75e0928394b99c76':
  Make the appropriate cast to protect from mingw.
2016-01-16 02:25:22 +00:00
Jorim Jaggi
0da43029fd Fix build
Change-Id: I6d4bebf90c11a4a00d259aac34bb9459d973da9b
2016-01-15 16:20:25 -08:00
Dan Albert
2edfa8c9b0 Merge "Make the appropriate cast to protect from mingw."
am: dbf8c17bd2

* commit 'dbf8c17bd20c3c5b4ba99242afa8b714841914d1':
  Make the appropriate cast to protect from mingw.
2016-01-15 21:02:29 +00:00
Dan Albert
ed811eeaea Make the appropriate cast to protect from mingw.
As the comment at the top of the file says:

    STATUST: mingw does seem to redefine UNKNOWN_ERROR from our enum
    value, so a cast is necessary.

Bug: http://b/26523949
Change-Id: I9d86cafdc47bbb9ce0e967cdde9315babc083432
2016-01-15 12:16:06 -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
Adam Lesinski
656a577a34 AAPT2: Accept zip, jack, jar, and flata extensions as archives
Change-Id: I3a4db129998e2351e8221f9d72a4b40d2c7a8cf9
2016-01-14 15:17:41 -08:00
Adam Lesinski
52364f7ae3 AAPT2: Variety of small fixes to get the build working
- Add option to rename package in AndroidManifest.xml
- Support default versionName and versionCode
- Accept True and False as valid booleans

Change-Id: I400e350b9dcd0fd1c197d1929144299c7823617d
2016-01-13 18:48:24 -08:00
Wale Ogunwale
b2d135694f Fix build breakage.
Bug: 22405482
Change-Id: I8fc522885801e9735544ec3820c8fdd4a4368d71
2016-01-13 15:08:29 -08:00
Adam Lesinski
04a424082b Merge "AAPT2: Warn when positional arguments exist and --legacy is on" 2016-01-11 18:44:58 +00:00
Adam Lesinski
979ccb2e6f AAPT2: Warn when positional arguments exist and --legacy is on
This is normally an error, but old AAPT didn't check for it correctly,
so many projects violate this. With --legacy, this becomes a warning.

Change-Id: I23647e029930e11b719591cd38609e1b43247e20
2016-01-11 10:42:19 -08:00