298 Commits

Author SHA1 Message Date
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
Mårten Kongstad
96198ebae8 RRO idmap: pad with 0xffffffff, not 0x00000000
In the new idmap format (version 0x1), 0x00000000 no longer represents a
non-existing entry: 0xffffffff should be used instead.

Bug: 17765434
Change-Id: If2c7e09feba2224eeafe88fd9230e6392d81b9a7
2014-11-07 16:08:04 +01:00
Mårten Kongstad
30113131fb RRO: reintroduce lost ResTable insert of assets
With the recent introduction of AssetManager::appendPathToResTable,
overlay packages were not properly added to the AssetManager, and once
added, were not properly inserted into the ResTable.

Bug: 17765434
Change-Id: Ie21f227c654c98730f74a687d0e16ee2b80e747e
2014-11-07 16:07:42 +01:00
Adam Lesinski
1adf320606 am 8491c4ea: Merge "Merge commit \'fb96e54\' into manualmerge" into lmp-mr1-dev-plus-aosp
* commit '8491c4ead7dba5cfd406cf99a511fc1dce07cc4d':
  Add error checking to aapt for split generation
2014-11-05 20:35:27 +00:00
Adam Lesinski
685d363d7a Merge commit 'fb96e54' into manualmerge
Conflicts:
	tools/aapt/Resource.cpp

Change-Id: I4147c3550e9426f3429146eaeb16f10ba76b5b15
2014-11-05 12:30:25 -08: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
24655f37ed am 3fd34002: Merge commit \'78be0498\' into manualmerge
* commit '3fd340028fc24198edb23ddf5eb5a0a100bab745':
  Fix issues that will be present in C++11
2014-11-04 02:14:37 +00:00
Adam Lesinski
3fd340028f Merge commit '78be0498' into manualmerge
Conflicts:
	libs/androidfw/ResourceTypes.cpp
	tools/aapt/Android.mk
	tools/aapt/StringPool.cpp
	tools/aapt/StringPool.h

Change-Id: I9d69efdfb892032895ace12159d193304f02dc6c
2014-11-03 18:06:22 -08:00
Adam Lesinski
de7de47fef Add error checking to aapt for split generation
Change-Id: Ica627db6a671f6a6c35f98bfd9c03598ffe103ce
2014-11-03 15:55:44 -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
f2ae40739a am 9a77c8a2: am 3c5cc234: am 674a3a21: Merge "Distinguish unspecified and explicit null values in resources" into lmp-mr1-dev
* commit '9a77c8a279bfe3293295ed77c775ea29b88b2916':
  Distinguish unspecified and explicit null values in resources
2014-10-31 00:25:37 +00:00
Alan Viverette
9a77c8a279 am 3c5cc234: am 674a3a21: Merge "Distinguish unspecified and explicit null values in resources" into lmp-mr1-dev
* commit '3c5cc234eeef4a08ad7b00b4e869a1e47cf14ab3':
  Distinguish unspecified and explicit null values in resources
2014-10-31 00:15:01 +00: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
6d2268420d am d75d3eb5: am 31b76b66: Merge "libandroidfw: Do not build device library when building SDK" into lmp-mr1-dev automerge: 06caf1b
* commit 'd75d3eb5e423fbcc069dd3c40a4a5eeeaf8bcdab':
  libandroidfw: Do not build device library when building SDK
2014-10-28 19:06:00 +00:00
Adam Lesinski
d75d3eb5e4 am 31b76b66: Merge "libandroidfw: Do not build device library when building SDK" into lmp-mr1-dev
automerge: 06caf1b

* commit '06caf1b1112a6a3e364a46d02b883451e9180a07':
  libandroidfw: Do not build device library when building SDK
2014-10-28 18:09:20 +00:00
Adam Lesinski
f001e37b31 libandroidfw: Do not build device library when building SDK
Building the windows SDK causes a build failure if the device
libandroidfw target is not omitted.

Change-Id: I587b166342d0d047820911d279f192d2b39b6263
2014-10-24 18:39:56 +00:00
Adam Lesinski
63f5e0f7b1 am 705f2ac4: am 879f237a: Merge "Added some more Split density tests" into lmp-mr1-dev automerge: 93b43445
* commit '705f2ac42412c8a5a436f0044b84ebbcd1e9c729':
  Added some more Split density tests
2014-10-24 02:13:51 +00:00
Adam Lesinski
705f2ac424 am 879f237a: Merge "Added some more Split density tests" into lmp-mr1-dev
automerge: 93b43445

* commit '93b434451abd11ff58ada66abdcddb3f33bb5023':
  Added some more Split density tests
2014-10-24 02:01:16 +00:00
Adam Lesinski
6029319737 Added some more Split density tests
Change-Id: I3b83515f1240e713bbcff5385cf054bba693f297
2014-10-23 16:01:58 -07:00
Bill Yi
5a71f83227 Merge lmp-dev-plus-aosp-without-vendor into stage-aosp-master
Change-Id: I7063b7b52e9c09a57eb6bf3b4ffa3716d58ebf43
2014-10-22 09:00:49 -07:00
Dan Albert
c96ac3900c am 827d00f2: am 3d23d557: am 7f2bc6c7: Merge "More LOCAL_ADDITIONAL_DEPENDENCIES."
* commit '827d00f2f416a4271249b7a345b1fcdf7f8a10ae':
  More LOCAL_ADDITIONAL_DEPENDENCIES.
2014-10-21 16:16:31 +00:00
Dan Albert
827d00f2f4 am 3d23d557: am 7f2bc6c7: Merge "More LOCAL_ADDITIONAL_DEPENDENCIES."
* commit '3d23d557ff00010c041ec3fc655472db3d12509e':
  More LOCAL_ADDITIONAL_DEPENDENCIES.
2014-10-21 16:11:52 +00:00
Dan Albert
00b4e773ab More LOCAL_ADDITIONAL_DEPENDENCIES.
Change-Id: I9bf20507442b0722e93446fdb32d8236be974e28
2014-10-21 08:58:39 -07:00
Adam Lesinski
c34a7c9ca2 am 97ce1a6a: am 983b668b: am be003a35: am f23e3ea6: am aeef612f: Merge "Search all packages for a given type string when looking up resources by name" into lmp-dev
* commit '97ce1a6a23bdb4213303384c6cf73b43cce6aa8f':
  Search all packages for a given type string when looking up resources by name
2014-10-10 22:07:09 +00:00
Adam Lesinski
97ce1a6a23 am 983b668b: am be003a35: am f23e3ea6: am aeef612f: Merge "Search all packages for a given type string when looking up resources by name" into lmp-dev
* commit '983b668bd8deb58cbd3faabb931c4fb2dd80bf2f':
  Search all packages for a given type string when looking up resources by name
2014-10-10 17:14:41 +00:00
Adam Lesinski
73587de154 am aeef612f: Merge "Search all packages for a given type string when looking up resources by name" into lmp-dev
* commit 'aeef612f200b6b5cee214230271e1c3d718151ee':
  Search all packages for a given type string when looking up resources by name
2014-10-09 19:15:36 +00:00
Adam Lesinski
e60a87f552 Search all packages for a given type string when looking up resources by name
Previously we would stop at the first match when looking for a type string,
but we should search all packages in case a feature Split added a type
with the same name.

Bug:17924027

Change-Id: I6bc7ef073324db99448538cd8bdf566658f066ff
2014-10-09 11:26:19 -07:00
Adam Powell
29e2e5d2d5 am e18d68d6: am 4e789dbf: am 8628387c: am b226d295: am c6a06d43: Merge "Revert "Fix issue with using locally defined attrs in a shared lib"" into lmp-dev
* commit 'e18d68d6ab2f5354441162719ec87cb57de83519':
  Revert "Fix issue with using locally defined attrs in a shared lib"
2014-10-02 12:52:38 +00:00
Adam Powell
e18d68d6ab am 4e789dbf: am 8628387c: am b226d295: am c6a06d43: Merge "Revert "Fix issue with using locally defined attrs in a shared lib"" into lmp-dev
* commit '4e789dbff0bc4d9c259a33d6e8ea595c0f4d5f35':
  Revert "Fix issue with using locally defined attrs in a shared lib"
2014-10-02 12:38:21 +00:00
Adam Powell
e4275843fe am c6a06d43: Merge "Revert "Fix issue with using locally defined attrs in a shared lib"" into lmp-dev
* commit 'c6a06d437cf2ee7926a01b2f8ee685555bfb3d81':
  Revert "Fix issue with using locally defined attrs in a shared lib"
2014-10-01 22:37:27 +00:00
Adam Powell
908c748096 Revert "Fix issue with using locally defined attrs in a shared lib"
This reverts commit 5069dd69898bd0d9c69ba2bbd37239ec8d1c9dc6.

The reverted commit caused issues loading resources supplied by static libraries.

Bug 17748356

Change-Id: I860a4f31451ee7c03c02974826472a67226b029f
2014-10-01 18:11:18 +00:00
Adam Lesinski
8cb387b3b7 am 7923da5f: am 06f380e9: am 95731abe: am bb7b5197: am cd8e7381: Merge "Fix issue with using locally defined attrs in a shared lib" into lmp-dev
* commit '7923da5f5d05f256179e0d926b3b55bbf1d29a8e':
  Fix issue with using locally defined attrs in a shared lib
2014-10-01 17:19:30 +00:00
Adam Lesinski
7923da5f5d am 06f380e9: am 95731abe: am bb7b5197: am cd8e7381: Merge "Fix issue with using locally defined attrs in a shared lib" into lmp-dev
* commit '06f380e9efa4698c223077cacaa2df80a704ef96':
  Fix issue with using locally defined attrs in a shared lib
2014-10-01 17:11:10 +00:00
Adam Lesinski
d388b1fdde am cd8e7381: Merge "Fix issue with using locally defined attrs in a shared lib" into lmp-dev
* commit 'cd8e73817d14798f9d2031ffd301a03a096b7907':
  Fix issue with using locally defined attrs in a shared lib
2014-10-01 00:44:31 +00:00
Adam Lesinski
5069dd6989 Fix issue with using locally defined attrs in a shared lib
The attribute name resource IDs were never fixed up with
the runtime package ID so we weren't finding attributes
whenever the runtime package ID was different than the build
time one, which happened to be when a shared lib referenced itself
(0x00 vs 0x02).

Bug:17666947
Change-Id: Icf3e874bcea0e27eebe42d60fbed626a34bf9266
2014-09-30 16:18:09 -07:00
Dan Albert
1e6b474bfa am cd29983b: resolved conflicts for merge of 8791ebf0 to lmp-mr1-dev-plus-aosp
* commit 'cd29983b31c1da70289fa3589770933333389921':
  Clean up test makefiles.
2014-09-19 23:30:57 +00:00
Adam Lesinski
3ae4ac218c am 60040044: am 9ee3ba23: am e7e9ad6d: am 863b1a90: am 19f9d54f: Merge "Fix backwards compat problem with AAPT public attrs" into lmp-dev
* commit '6004004428a93a03657b513d62eeaab660db0896':
  Fix backwards compat problem with AAPT public attrs
2014-09-19 23:28:24 +00:00
Dan Albert
5648b12da1 resolved conflicts for merge of 8791ebf0 to lmp-mr1-dev-plus-aosp
Change-Id: Ifedb15de5a4db6cb0238fec93aaa2d95f1844694
2014-09-19 15:50:13 -07:00
Dan Albert
ece13f90ed resolved conflicts for merge of 8791ebf0 to lmp-dev-plus-aosp
Change-Id: I9d0f81003f84d03a7a67420dd496fde18dd654d4
2014-09-19 15:37:15 -07:00
Adam Lesinski
0fa7511db2 am 9ee3ba23: am e7e9ad6d: am 863b1a90: am 19f9d54f: Merge "Fix backwards compat problem with AAPT public attrs" into lmp-dev
* commit '9ee3ba23395bd1a13bbfd3fe523ee611a5ca001b':
  Fix backwards compat problem with AAPT public attrs
2014-09-19 19:08:50 +00: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
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
Dan Albert
bcaaebb8a8 Merge "Clean up test makefiles." 2014-09-11 23:21:14 +00:00
Dan Albert
715d01aedf Clean up test makefiles.
The build system takes care of linking the correct STL and gtest
libraries for you, and specifying them manually confuses the build
system when using libc++.

Change-Id: I9f76ab26a63ace51293614cfb5ca002f37438e02
2014-09-11 15:49:57 -07:00
Dan Albert
181f731f9d am 167efbdf: Merge "resolved conflicts for merge of 6c585756 to lmp-dev-plus-aosp" into lmp-dev-plus-aosp
* commit '167efbdfcf22143c7383091ba46d59bea9921e0d':
  Use char16_t for char things.
2014-09-09 15:02:57 +00: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