2630 Commits

Author SHA1 Message Date
Zhijun He
2f17431194 ImageFormat: add PRIVATE format
Bug: 19865019
Change-Id: I1a9335fe1733a5b28d9cb20485b509fb216cb52b
2015-03-30 16:17:35 -07:00
Christopher Tate
11ae768cf1 Add payload-size preflight stage to full transport backup
We now peform a total-size preflight pass before committing data to the
wire.  This is to eliminate the large superfluous network traffic that
would otherwise happen if the transport enforces internal quotas: we
now instead ask the transport up front whether it's prepared to accept
a given payload size for the package.

From the app's perspective this preflight operation is indistinguishable
from a full-data backup pass.  If the app has provided its own full-data
handling in a subclassed backup agent, their usual file-providing code
path will be executed.  However, the files named for backup during this
pass are not opened and read; just measured for their total size.  As
far as component lifecycles, this measurement pass is simply another
call to the agent, immediately after it is bound, with identical
timeout semantics to the existing full-data backup invocation.

Once the app's file set has been measured the preflight operation
invokes a new method on BackupTransport, called checkFullBackupSize().
This method is called after performFullBackup() (which applies any
overall whitelist/blacklist policy) but before any data is delivered
to the transport via sendBackupData().  The return code from
checkFullBackupSize() is similar to the other transport methods:
TRANSPORT_OK to permit the full backup to proceed; or
TRANSPORT_REJECT_PACKAGE to indicate that the requested payload is
unacceptable; or TRANSPORT_ERROR to report a more serious overall
transport-level problem that prevents a full-data backup operation
from occurring right now.

The estimated payload currently does not include the size of the
source-package metadata (technically, the manifest entry in its
archive payload) or the size of any widget metadata associated with
the package's install.  In practice this means the preflighted size
underestimates by 3 to 5 KB.  In addition, the preflight API currently
cannot distinguish between payload sizes larger than 2 gigabytes;
any payload estimate larger than that is passed as Integer.MAX_VALUE
to the checkFullBackupSize() query.

Bug 19846750

Change-Id: I44498201e2d4b07482dcb3ca8fa6935dddc467ca
2015-03-26 18:57:36 -07:00
Adam Lesinski
8a9355a98e Output modified bcp47 tag in ResTable_config::toString()
We expect to be able to parse the output of ResTable_config::toString(),
so it should use modified bcp47 (b+en+Latn+US).

Change-Id: I597a1779a1fa5cff171c473e6a0368d93b9c7722
2015-03-16 22:25:26 +00:00
Eino-Ville Talvala
805f3c9428 Add DEPTH image formats, support in ImageReader
- Add an explicit mapping between public ImageFormat/
  PixelFormat enums and internal HAL format/dataspace.
- Add DEPTH16 and DEPTH_POINT_CLOUD formats
- Wire up mapping layer to ImageReader to support depth
  formats

Change-Id: I8197eccef900cc91baddcfcb934ccd4d8c972eff
2015-03-09 16:42:25 -07:00
Leon Scroggins III
283ddb9d4f am 3523e4fc: am efe085ff: Merge "Handle bad ninepatch data." into lmp-mr1-dev
automerge: 8475144

* commit '847514499f5920d073f5cd402dd0d3bbd19ac2c1':
  Handle bad ninepatch data.
2015-01-27 23:34:35 +00:00
Leon Scroggins III
847514499f am 3523e4fc: am efe085ff: Merge "Handle bad ninepatch data." into lmp-mr1-dev
* commit '3523e4fcb3c74a5dee2f4497e2b8ec7b9e2b5e57':
  Handle bad ninepatch data.
2015-01-27 18:33:46 +00:00
Leon Scroggins III
a730ef3f77 Handle bad ninepatch data.
Changes proposed by Ben Hawkes of Google Project Zero.

NinePatchPeeker.cpp:
Instead of asserting, return false for bad data.

ResourceTypes.h:
Store ninepatch values as unsigned.

BUG:19151999
Change-Id: Ibe35e7569f632c6bb8a34a7701e26bb6ed547ec2
2015-01-27 16:41:16 +00:00
Adam Lesinski
43a88535df am d9bd0886: am aee7225e: Merge "Process base APK" into lmp-mr1-dev automerge: 554a6f5
* commit 'd9bd08864eaf9d8847d974eadb81806b9e086a2d':
  Process base APK
2015-01-20 22:03:16 +00:00
Adam Lesinski
d9bd08864e am aee7225e: Merge "Process base APK" into lmp-mr1-dev
automerge: 554a6f5

* commit '554a6f5278ec05077d8252249afc911897fbfe76':
  Process base APK
2015-01-20 21:55:12 +00:00
John Reck
849911a9c4 Move Canvas
Change-Id: I83d557af30fc2d5c69d06eedc0f4d52ac41c4210
2015-01-20 12:39:05 -08:00
Adam Lesinski
42eea270a0 Process base APK
The base APK may have resources with configurations that compete
against some splits. The base APK must be involved in the selection
of splits.

Bug:18982001
Change-Id: Ieb29b5a36cf2c68e7831484d98a9fd275acd97e8
2015-01-16 14:11:30 -08:00
Christopher Tate
33194035a5 am 49138184: am 9568307c: am 43a4a8c7: Fix redundant file backups
* commit '49138184dee54357b1923f302e4b3fedd73ca34f':
  Fix redundant file backups
2015-01-15 04:30:34 +00:00
Christopher Tate
49138184de am 9568307c: am 43a4a8c7: Fix redundant file backups
* commit '9568307cf32c8abc6703dc7a1b0b0fee56c4f8f5':
  Fix redundant file backups
2015-01-15 01:39:29 +00:00
Christopher Tate
43a4a8c777 Fix redundant file backups
We'd observed a bug in which an unchanged file was nevertheless
being redundantly transmitted for backup on every backup pass.
The underlying issue turns out to have been the FileBackupHelper
base implementation's logic for diffing the prior-state file
set against the current state, in the case when there had been
deletions of prior files.  In addition, there was also a
parallel bug in which file checksums were not calculated
properly in some cases, leading to at least one additional
redundant backup of the file in question.

Bug 18694053

Change-Id: Ie0dec06486b5fef4624561737019569c85d6b2a0
2015-01-14 16:36:30 -08:00
Tom Hudson
8dfaa49042 Make DisplayListRenderer inherit from Canvas, merge JNI
Incrementally unify the upper layers for Skia and HWUI.
Remove redundant code from GLES20Canvas.java; instead
use inherited mNativeCanvasWrapper and superclass method
definitions.

Moves some unrelated SkPaint utility functions from Renderer
to new utils/PaintUtils.

bug: 15672762
Change-Id: I4ddd4214b8e9eeb95289d054ef423f2542bb5fa5
2015-01-05 15:25:41 -08:00
Leon Scroggins III
18981294a5 Make SkiaCanvas creation call ref() on SkCanvas.
There are two callers of SkiaCanvas::create_canvas(SkCanvas*). In both
cases, we were calling ref() first. It is necessary to call ref() in
both cases, since we have an SkCanvas returned by
SkPictureRecorder::beginRecording, which does not increment the ref
count to account for the caller. (i.e. the SkPictureRecorder has the
only ref until you call ref()).

Rather than leave the ref up to the caller, since the SkiaCanvas does
the unref(), it should also do the ref(). Update it to do so and
document its behavior.

Also, make SkiaCanvas' constructors explicit.

Change-Id: I894d0a71a87587cf8c2b26deb2384dc49ae090ef
2014-12-17 13:20:33 -05:00
Adam Lesinski
347040cf84 am 740acf21: am c7801877: Merge "Fix issue where non-resource attributes would cause obtainStyleAttributes to fail" into lmp-mr1-dev
* commit '740acf213c56c406132294790fa2fadd0380cfa7':
  Fix issue where non-resource attributes would cause obtainStyleAttributes to fail
2014-12-11 00:07:02 +00:00
Adam Lesinski
5dce5e67db Fix issue where non-resource attributes would cause obtainStyleAttributes to fail
A sentinal value of 0x00000000 was used to mark the first time an AttributeFinder
was used. If the resource ID of an attribute was also 0x00000000 (which occurs with
non-resource attributes, like 'style'), then it would be mistaken as the sentinel
start value.

Bug:18421787
Change-Id: I4be353e0f8c940cb6f262d155129f048dcc444ae
2014-12-10 10:51:48 -08:00
Adam Lesinski
e97908d32e Merge commit '0953ab27' into manualmerge
Change-Id: I36dea45f7571096136ea7bda5e2680bd85a0df32
2014-12-05 11:06:21 -08:00
Adam Lesinski
8e5362f20e am 503071ae: am a2b5067a: Merge "RRO: prevent duplicate system overlays"
* commit '503071ae41374a66f61e53e05a91243473db83b9':
  RRO: prevent duplicate system overlays
2014-12-04 09:21:45 +00:00
Adam Lesinski
9b624c186c AAPT: Move private attrs to new type for framework
Private attributes are typically placed after public
attributes in the resource table. Each time a new version
of the Android framework is released, new public attributes
take the place of the private attributes, and the private
attributes are shifted after the new public ones.

This means that any apps built against the newer SDK
may inadvertently be using private attributes on older
devices.

This change moves all private attributes to a completely
different type ID, so there will never be collisions across
versions.

These private attributes are automatically moved to a synthesized
type only for the system resources.

Bug:18263655

Change-Id: I7a850512953fadcc9f3524d509cea30249782db8
2014-12-03 15:59:20 -08:00
Adam Lesinski
a2b5067aee Merge "RRO: prevent duplicate system overlays" 2014-12-03 17:44:18 +00:00
Adam Lesinski
11bdd5b10b Merge commit '06d8b7b8' into manualmerge
Conflicts:
	core/jni/android_util_AssetManager.cpp

Change-Id: I77b72d0d3ec8184ccd97419e4c76b7d55b1a52ca
2014-11-17 12:17:16 -08:00
Andreas Gampe
5bf0c65eef am f89a2fda: Merge "Frameworks/base: Fix two warnings in cmds"
* commit 'f89a2fdacb2ba907f180188dc79f9de81e3eb254':
  Frameworks/base: Fix two warnings in cmds
2014-11-08 02:04:43 +00:00
Andreas Gampe
ebee1379ea Frameworks/base: Fix two warnings in cmds
Change-Id: Ifb9c7fb7a2d28c13010ddc186bea5f5f0daefb4a
2014-11-08 01:04:45 +00:00
Andreas Gampe
dc9c109af8 resolved conflicts for merge of 487ae9b8 to lmp-mr1-dev-plus-aosp
Change-Id: I395f184d885a7ef30aa113ab01fcaacc94243008
2014-11-07 15:14:02 -08:00
Andreas Gampe
2204f0bf56 Frameworks/base: Wall Werror in libs/androidfw
Turn on -Wall -Werror in libs/androidfw. Fix warnings. Refactor
some code.

Change-Id: I66fe54ace433c15dee5de328b149ca142f74b2dd
2014-11-07 13:35:05 -08:00
Mårten Kongstad
cb7b63d928 RRO: prevent duplicate system overlays
System overlays, ie overlays with targetPackage="android", were loaded
twice, which caused all sorts of issues. Ensure they are only loaded
once, which will be during Zygote initialization.

Bug: 17765434
Change-Id: Ia5064045c77f713c58fb78adc3942f6af1abdc93
2014-11-07 16:08:22 +01:00
Adam Lesinski
a7d1d73a47 Implement back-tracking when searching for attributes in XML or resource bag
Shared libraries have their package ID assigned at run-time, so some
of the guarantees we used to have about sort order of attributes in
bags or XML elements no longer hold.

This CL adds back-tracking and can jump to the nearest attribute with the
same package ID and continue searching.

This means that attributes with the same package ID must be sorted by increasing
resource ID, as was the case before.

Attributes with the same package ID must be grouped together, but the groups can
be in any order. Ex: 0x02010001, 0x02010002, 0x01010000, 0x01010010, 0x7f010032

Bug:17666947
Change-Id: I9c198bbb6ca788849aac85b6323606ea5d9550d6
2014-11-04 16:34:34 -08:00
Adam Lesinski
668f0a356c Merge "Fix issues that will be present in C++11" into lmp-mr1-dev 2014-11-03 23:38:43 +00:00
Adam Lesinski
4bf58108d4 Fix issues that will be present in C++11
- char16_t is a distinct type, so stay consistent
  with it throughout the code base.
- char16_t is defined as minimum size of 16 bits.
  Since we mmap and cast data structures onto raw memory,
  we need a precise definition (uint16_t), so we cast between
  that (and static_assert that they are the same size).

Change-Id: I869c32637543bbcfb39d2643e7d9df10d33acd3c
2014-11-03 11:49:47 -08:00
Alan Viverette
f296940502 Distinguish unspecified and explicit null values in resources
BUG: 17919345
Change-Id: Ic4f04f7dd0f986f58a749b5950d80c1cfdb074ea
2014-10-29 17:09:36 -07:00
Adam Lesinski
8d2556f0de am 8bdb265f: am 19f9d54f: Merge "Fix backwards compat problem with AAPT public attrs" into lmp-dev
* commit '8bdb265f0a73bc6f2114ca70f141c214a23696c7':
  Fix backwards compat problem with AAPT public attrs
2014-09-19 18:37:15 +00:00
Adam Lesinski
b6812b64c4 Merge "Fix backwards compat problem with AAPT public attrs" into lmp-dev 2014-09-19 18:19:58 +00:00
Mike Lockwood
99f8f21c16 am d3d6ecdb: am 52e5e359: Merge "USB string descriptors are not UTF8, so it is not safe to treat them as such." into lmp-dev
* commit 'd3d6ecdb7a6b00347920c5e706275017854849af':
  USB string descriptors are not UTF8, so it is not safe to treat them as such.
2014-09-19 03:56:19 +00:00
Mike Lockwood
51938c205f Merge "USB string descriptors are not UTF8, so it is not safe to treat them as such." into lmp-dev 2014-09-19 02:00:26 +00:00
Adam Lesinski
82a2dd8efe Fix backwards compat problem with AAPT public attrs
AAPT has traditionally assigned resource IDs to public attributes,
and then followed those public definitions with private attributes.

--- PUBLIC ---
| 0x01010234 | attr/color
| 0x01010235 | attr/background

--- PRIVATE ---
| 0x01010236 | attr/secret
| 0x01010237 | attr/shhh

Each release, when attributes are added, they take the place of the private
attributes and the private attributes are shifted down again.

--- PUBLIC ---
| 0x01010234 | attr/color
| 0x01010235 | attr/background
| 0x01010236 | attr/shinyNewAttr
| 0x01010237 | attr/highlyValuedFeature

--- PRIVATE ---
| 0x01010238 | attr/secret
| 0x01010239 | attr/shhh

Platform code may look for private attributes set in a theme. If an app
compiled against a newer version of the platform uses a new public
attribute that happens to have the same ID as the private attribute
the older platform is expecting, then the behavior is undefined.

We get around this by detecting any newly defined attributes (in L),
copy the resource into a -v21 qualified resource, and delete the
attribute from the original resource. This ensures that older platforms
don't see the new attribute, but when running on L+ platforms, the
attribute will be respected.

We still need to address this problem in the platform moving forward,
as this will only help us in the transition from pre L to L.

Bug:17520380
Change-Id: Ia2a985798b50006c21c7c3431d30d9598f27cd91
2014-09-18 14:05:24 -07:00
Jeff Brown
c846e61639 am a38e59b1: am 683872af: Merge "Clean entire arg block when setting process name." into lmp-dev
* commit 'a38e59b1b4164a33c38fc522e56601d886c49833':
  Clean entire arg block when setting process name.
2014-09-12 05:45:07 +00:00
Jeff Brown
00c0cd4a24 Clean entire arg block when setting process name.
When Android processes fork from Zygote, we rewrite the command line
with a new name, eg. "system_server".  When we do this, we should
fill the entire block with zeros to remove corrupted argument
information that may otherwise remain in the /proc/<pid>/cmdline buffer
and be seen in tools and stack dumps.

Fixed an issue where VM options could be overwritten after setting
the nice name if the name was too long.

Bug: 17474152
Change-Id: Ie6cf9ed7752a04300a340e26cd6812bb35c59e1b
2014-09-11 14:19:52 -07:00
Dan Albert
20ec4fa229 resolved conflicts for merge of 6c585756 to lmp-dev-plus-aosp
Change-Id: I5a25f2bac44ac5efcd7462af91005e09680a1d96
2014-09-08 22:25:54 -07:00
Dan Albert
2ffa4aabd7 Merge "Use char16_t for char things." 2014-09-09 04:30:35 +00:00
Dan Albert
f348c15ecf Use char16_t for char things.
When compiling in C++ mode, the compiler will complain about conversions
from uint16_t to char16_t. Be consistent in using char16_t for strings.

Change-Id: I052b6176ced635162920b31560052d9a64f92764
2014-09-08 18:30:08 -07:00
Mike Lockwood
9ee5e7e17f USB string descriptors are not UTF8, so it is not safe to treat them as such.
Add AndroidRuntime::NewStringLatin1() to convert non-UTF8 strings to Java strings.

Bug: 17427781
Change-Id: I7df1d4e94a7beebc8b1a74c0c0a163b794025ae8
2014-09-08 17:05:44 -07:00
Adam Lesinski
ad2d07d2d9 Stamp platform version code into app Apks
The versionCode of theframework resources that an app is built against
gets stamped inside an app's AndroidManifest.xml in the <manifest>
tag as "platformBuildVersionCode" and "platformBuildVersionName"
attributes.

Bug:17207635
Change-Id: Id573c3dffcbca38eec9c0eb3e89f4a547e3361d3
2014-08-27 18:28:49 -07:00
Adam Lesinski
31245b4f06 Introduce anydpi density resource qualifier
This is meant to be used with scaleable vector
drawables, and are chosen as the best match unless
there is a configuration that matches the density
requested exactly.

Bug:17007265
Change-Id: Ic3288d0236fe0bff20bb1599aba2582c25b0db32
2014-08-25 17:47:30 -07:00
Adam Lesinski
6022debdbc AAPT: Fix regression generating dynamic ref table for shared libraries
AAPT stopped generating dynamic reference tables for shared libraries.

Change-Id: Ib0025811bdca1a4756eb21080dd6b6bb3fc1ca3d
2014-08-20 17:55:33 -07:00
Adam Lesinski
ec64709ce0 Merge "AAPT support for feature splits" into lmp-dev 2014-08-09 00:40:15 +00:00
Adam Lesinski
833f3ccbc8 AAPT support for feature splits
This change allows the developer to add a base package for
which to build a feature split. The generated resource types
will begin after the base APK's defined types so as not
to collide or override resources.

Multiple features can be generated by first choosing an
arbitrary order for the features. Then for each feature,
the base APK and any preceding features are specified
with the --feature-of flags.

So with a base APK 'A' and features, 'B', and 'C',
'B' would be built with

aapt package [...] --feature-of A [...]

and 'C' would be built with

aapt package [...] --feature-of A --feature-of B [...]

Change-Id: I1be66e3f8df9a737b21c71f8a93685376c7e6780
2014-08-04 18:48:14 -07:00
Brian Carlstrom
0d8fb01963 Disable compilation based on vold.decrypt. [frameworks/base]
Bug: 15165413

(cherry picked from commit 4fd561637a173c7fa6a1d71e9115db1db90514ff)

Change-Id: I2a13b63f9d4a7ffd69a8d21666c6dce84739c6ed
2014-08-06 22:25:01 -07:00
Brian Carlstrom
3fbfbb4ade Move from dalvik.vm.image-dex2oat-flags to dalvik.vm.dex2oat-filter [frameworks/base]
This will allow us to conditionally change the compiler-filter based on other properties.

Bug: 15165413

(cherry picked from commit f60d3a4702f6d00d7edb5d348c53b9b03ae16b76)

Change-Id: I293c81ba817e9abbf9c05b3fb554ef2f0ad0c4ed
2014-08-06 22:25:00 -07:00