4447 Commits

Author SHA1 Message Date
Adam Lesinski
355f285ffd AAPT2: Implement density stripping and initial Split support
When a preferred density is supplied, the closest matching densities
will be selected, the rest stripped from the APK.

Split support will be enabled in a later CL. Command line support is still
needed, but the foundation is ready.

Bug:25958912
Change-Id: I56d599806b4ec4ffa24e17aad48d47130ca05c08
2016-02-17 18:17:25 -08:00
Deepanshu Gupta
491523d52c LayoutLib fixes for N
Moves LayoutLib to Java 8 - YAY!
Fix delegates

Change-Id: I098996e43e330e995d33f12df1c16355bbc02f0f
2016-02-18 02:10:24 +00:00
Diego Perez
aa9c9fb29e Replace SimpleDateFormat implementation
This will process all the classes and replace all the uses of
java.text.DateFormat and java.text.SimpleDateFormat with the
android.icu.text. package implementations. The original ones do not
match the Android platform behaviour.

Change-Id: Id55f103c21117a8d6403bf2124b6c1a0e1fb2f71
2016-02-17 18:54:17 +00:00
Andrei Stingaceanu
eb84b1843a Suspend packages - one call for multiple packages
Refactor setPackageSuspended into setPackagesSuspended. The rationale
is that the consumers of this API are likely to want to remove
multiple packages at once. Rather than calling the API N times, call
it just once.

The good part is that we already have the broadcast intent for
suspended packages take an array so only one broadcast. Less stress
on the system.

Another good part is that (right now) we only have one consumer of
this API and it will be easy to make changes once this CL goes in.

As a shell command, for consistency only allowed one package at
a time.

Bug: 22776761
Change-Id: Ic8b8cf64d0a288ea3a282bb7b72f9d663b3b0049
2016-02-17 15:14:33 +00:00
Andrei Stingaceanu
5ae4e73ef0 Merge "Suspend packages - new API for retrieving the suspended status" into nyc-dev 2016-02-17 11:57:51 +00:00
Todd Kennedy
9706c01f9b Remove deprecated methods / classes
Now that we've moved the majority of system components to the
PackageInstaller, we can remove the majority of the "installPackage"
methods and the VerificationParams/ContainerEncryptionParams
classes. There are still some lingering references to the two
installPackage() methods left [both internal and external; play
is using these methods via reflection].

Bug: 24542768
Change-Id: Ib65323d842d9f0e7fed60e37e6b5f103c94c859b
2016-02-16 13:39:55 -08:00
Andrei Stingaceanu
355b232d79 Suspend packages - new API for retrieving the suspended status
Instead of always rebuilding the full ApplicationInfo for a
package when callers are only interested in the suspended status
add a new fast API in Packagemanager (which only checks the
suspended user setting for the requested package and returns
a boolean) and change the appropriate caller code too.

Bug: 26794775
Bug: 22776761
Change-Id: Ide8428ef734479360d5a8a75fd8e0ed8ddf2da7a
2016-02-16 14:57:29 +00:00
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
Adam Lesinski
5f7c461be6 AAPT2: Fix source output when error occurs in style
We were serializing the wrong Source when writing to protobuf

Change-Id: Ib65e962ebc1244ddf4af0e5666aaaebe5f7864a8
2016-02-12 23:38:08 -08:00
Adam Lesinski
923e6342fb Merge "AAPT2: Introduce notion of 'product' to ResourceTable" into nyc-dev 2016-02-13 06:28:06 +00:00
Adam Lesinski
e4bb9eb5af AAPT2: Introduce notion of 'product' to ResourceTable
This allows us to preserve the various product definitions during the compile
phase, and allows us to select the product in the link phase.

This allows compiled files to remain product-independent, so that they do not need
to be recompiled when switching targets.

Bug:25958912
Change-Id: Iaa7eed25c834b67a39cdc9be43613e8b5ab6cdd7
2016-02-12 22:21:48 -08: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
Adam Lesinski
d7d584b225 Merge "AAPT: Remove warnings for public resources without comments" into nyc-dev 2016-02-12 01:42:16 +00:00
Adam Lesinski
9e1923d02f AAPT: Remove warnings for public resources without comments
There are so many public resources that do not warrant comments
that having a warning that no one cares about is just producing
log spam.

Bug:21495023
Change-Id: I84e3b39c7139ee67fb5cb711d5ab466d8f4ef2e0
2016-02-11 14:17:25 -08: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
Svetoslav Ganov
3552418fcf Merge "Fix build" into nyc-dev 2016-02-10 04:46:07 +00:00
Svet Ganov
8c6d8a7ef9 Fix build
Change-Id: I7c0601f873e37c7ebf71068ba81366704672bd70
2016-02-09 20:45:13 -08:00
Adam Lesinski
59e04c6f92 AAPT2: Switch to protobuf for intermediate format
Without needing to conform to the runtime data format,
it is much easier to add new features such as debugging symbols
and carrying over product data to link time.

This also simplifies the runtime format parser and serializer,
which will change much less frequently than the protobuf intermediate
format.

Change-Id: I209787bbf087db0a58a534cb8511c51d21133e00
2016-02-09 19:59:17 +00: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
Diego Perez
c1a8e3311f Remove BufferedImage allocation from PorterDuff filter
Change-Id: Iedc280081e1889d316df17863f6ddf377592bc4c
2016-02-08 14:20:11 +00:00
Adam Lesinski
6a008170cb AAPT2: Support -c configuration filtering
Change-Id: I1e5855ca73440bdc30c21bcbc1dfdd31a9842363
2016-02-02 17:02:58 -08: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
Matt Sarett
37a866e9a6 Merge "Encode paletted PNGs more efficiently (part 2)" 2016-02-01 15:22:42 +00:00
Matt Sarett
4c95e0b4df Merge "Encode paletted PNGs more efficiently" 2016-02-01 15:20:24 +00:00
Matt Sarett
33fcd11bc2 Encode paletted PNGs more efficiently (part 2)
Many PNGs have multiple distinct pixels with zero alpha.  This
CL allows us to treat all of those pixels as a single zero pixel.

This saves space in the color palette and also may help save
memory pages when we skip writing zeros.

There is also a potential disadvantage: if someone intended to decode
this image as unpremultiplied with particular transfer modes where
their color components have an effect even though alpha is zero,
this will prevent that.  At the moment, we do not support unpremul as
a source, so this won't affect anyone trying to draw with the view
system.

This change originated in:
https://googleplex-android-review.git.corp.google.com/#/c/854580/

Change-Id: I702c7bd22d431cc7c775ed29bbd73c930f945ca3
2016-02-01 14:15:35 +00:00
Matt Sarett
2a84e23399 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: Id21b3b31850c9db6149ced6d20ed5e0ce2d71c5b
2016-02-01 09:03:34 -05: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
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