880 Commits

Author SHA1 Message Date
Ryan Mitchell
8a891d86ab Allow for RRO internal referencing
This change allows RROs to reference their own internal resources as
expected.

Overlays are loaded as shared libraries so they can have their own
resource id space that does not conflict with the resource id space of
the target or other overlays.

References to overlay resources that override target resources now
appear as references to the target resources.

Overlay values that are inlined into the xml file specified using
android:overlayResources are now able to be used at runtime.

See go/rro-references for more information.

Bug: 135943783
Test: idmap2_tests
Test: libandroidfw_tests
Change-Id: Ie349c56d7fd3f7d94b7d595ed6d01dc6b59b6178
2019-10-17 13:09:33 -07:00
Ian Pedowitz
203ac63ea6 Merge "Revert "Revert "Android Q is API 29""" into qt-dev
am: a326dfb1e5

Change-Id: I50abb7ed7a0c3730da90c4a6951971df1e4e6ef3
2019-05-15 17:59:43 -07:00
Ian Pedowitz
1912a57900 Revert "Revert "Android Q is API 29""
This reverts commit 60c71cee6ec064a0d2f4c6608fdb54bf95545d45.

Reason for revert: Rolling forward for Q-Finalization

Bug: 131429032
Bug: 129975435
Change-Id: Idd812d93b767d8a672b9ada58c8bcc2441395847
2019-05-12 19:44:42 +00:00
Stephen Hines
38b1fecaad Merge "NFC: Fix implicit fallthrough warning." am: 30fc8829ed
am: 4c4ac1c2b1

Change-Id: I8d3a746434bd551aff34593897cd85c7b53ec25f
2019-05-09 16:23:35 -07:00
Stephen Hines
d17f06d488 NFC: Fix implicit fallthrough warning.
Bug: http://b/112564944
Test: Builds.
Change-Id: I3cbb6e751b1341ae8a9abcd04bd16c6b81156ff0
2019-05-08 16:41:06 -07:00
Ian Pedowitz
60c71cee6e Revert "RESTRICT AUTOMERGE Android Q is API 29"
This reverts commit 8a3d1f96e1736c7e0493ebb71ed2904dffdebbfd.

Reason for revert: QT SDK Finalization. Will be merged again on/after May 13th

Bug: 131429032
Bug: 129975435
Change-Id: I7a48ef6a057a97ebd9903b7e934a7d95ec97f00e
2019-05-02 00:55:51 +00:00
Suprabh Shukla
8a3d1f96e1 RESTRICT AUTOMERGE Android Q is API 29
Time may be eternal, Captain, but our patience is not. It's time to put
an end to your trek through the stars.

Test: Builds, boots.

Bug: 131429032
Bug: 129975435
Change-Id: Ia2367124afb642dac0fb365e4fa096db1c648adb
2019-05-01 14:11:18 -07:00
Aurimas Liutikas
ab364fc3b6 Suppress -Wimplicit-fallthrough in aapt code
AaptAsssets intentinally falls through in a switch statement.
This change adds [[fallthrough]]; to suppress this implicit fallthrough.

frameworks/base/tools/aapt/AaptAssets.cpp:305:17: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough]
                case 5:
                ^
frameworks/base/tools/aapt/AaptAssets.cpp:305:17: note: insert '[[fallthrough]];' to silence this warning
                case 5:
                ^
                [[fallthrough]];
frameworks/base/tools/aapt/AaptAssets.cpp:305:17: note: insert 'break;' to avoid fall-through
                case 5:
                ^
                break;

Test: make -j aapt
Change-Id: Ia9d2ca3b59eb804e20c6295791f6a19f0f5f63ab
2019-01-30 08:32:57 -08:00
Chih-Hung Hsieh
3b3be3f10f Merge "Fix/suppress aapt/aapt2 google-explicit-constructor warnings" am: cdf6be573f am: d42fe48c93
am: 0bf62f1309

Change-Id: Iffb7e4a145b172a35dd58b9450d4a5184d8b07f7
2019-01-04 12:20:01 -08:00
Chih-Hung Hsieh
1fc78e1814 Fix/suppress aapt/aapt2 google-explicit-constructor warnings
* Add explicit to conversion constructors/operators
* Use NOLINT or NOLINTNEXTLINE to suppress warnings on intended converters

Bug: 28341362
Test: make with WITH_TIDY=1 DEFAULT_GLOBAL_TIDY_CHECKS=-*,google-explicit-constructor
Change-Id: Ie02101ea7c422e8add535c111a30a2f21ead0ace
2019-01-04 17:38:13 +00:00
Chih-hung Hsieh
51025d638d Merge "Allow implicit-fallthrough warnings locally." am: 36afe11a64 am: 9c5738238d
am: 469705cca4

Change-Id: I4bc5f389495ed535762438632e65ccd6c66f3739
2018-10-25 17:58:17 -07:00
Marco Nelissen
18f16d6241 Don't try to compress opus resources
Test: build

Change-Id: Ibf398b3afca02d4111d88b126c8d107ac44068a6
2018-10-25 08:31:19 -07:00
Chih-Hung Hsieh
e8abd06776 Allow implicit-fallthrough warnings locally.
It will be a global error by default.

Test: make checkbuild
Bug: 112564944
Change-Id: I26616fd50ccf3639fa7c01d850a14d079273ede7
Exempt-From-Owner-Approval: do not block on new warnings
2018-10-22 09:56:12 -07:00
Dan Willemsen
2d30bf731d Merge "Convert aapt to Soong" am: 7bd321ca25 am: 9f5e3e822c
am: 946e6eedc2

Change-Id: Iffb3b89148643365a356512d806a4e9e123e359b
2018-08-29 20:02:39 -07:00
Dan Willemsen
5d12935f35 Convert aapt to Soong
See build/soong/README.md for more information.

Test: cd frameworks/base/tools/aapt; mma
Test: aapt version
Change-Id: Ice97e9b32c53cfed30d68acd5717d8c66712df4c
2018-08-29 17:24:18 -07:00
Donald Chai
5f92797fbf AAPT: Render resource ID values with 0x%08x in "dump xmltree" output as
is done elsewhere.

Test: N/A
Change-Id: I7ff686425fec447ae43b364e592b81bfcbc1df30
2018-08-20 17:11:27 +00:00
Pirama Arumuga Nainar
ea5cf9f31c Merge "For Win32, don't cast ssize_t while printing" am: aaf8d7aa2e
am: 466ada94fe

Change-Id: I39b73406a41ecc5396c39648f8e05e8a88e7aaee
2018-05-14 11:22:57 -07:00
Pirama Arumuga Nainar
dc36bb6dea For Win32, don't cast ssize_t while printing
Bug: http://b/69933068

This is a partial revert of
https://android-review.googlesource.com/c/platform/frameworks/base/+/109433
so we can use Clang for windows cross compilation.

Clang does not allow a cast to 'signed size_t' and both Clang and
current MinGW accept a ssize_t to the '%zd' format specifier.

Test: m native-host, m native-host-cross with both MinGW and Clang
Change-Id: I5366622b91be1433f6c533c55a9ae429b57c7a27
2018-05-11 23:22:10 +00:00
Wale Ogunwale
3da5f3b2dd Finalizing P SDK
Bug: 77588754
Test: builds
Change-Id: Ic06cad790a3dc53d012a7c43dfac911fc6dc61e7
2018-04-12 15:26:31 -07:00
Nick Butcher
e78a816966 Prevent AAPT from versioning <animated-selector> tags.
Bug: 69359529
Test: Manually tested with ag/3178054
Change-Id: I10ae4d96c2a31a0a7c363d7a9292ecdfd3bb526a
2018-02-09 11:36:27 +00:00
Alan Viverette
11be9317ef AAPT v1 embed compile SDK version and codename into app
Also adds support for dumping compile SDK attributes.

Bug: 63388434
Fixes: 68854953
Test: manual, compiled & dumped ApiDemos APK
Change-Id: I2eef812bd957950cdef5f1257b73b57044a1e731
2017-12-04 17:37:28 -08:00
TreeHugger Robot
f4165c4cf7 Merge "AAPT leave <gradient> alone for VDC" 2017-10-16 19:30:04 +00:00
ztenghui
ab2a38c03d AAPT leave <gradient> alone for VDC
bug: 62421666
Test: Tested with changes for Gradient of VDC.

Change-Id: I07b39721aeaaafd888416a0f71f6cbd5fce97732
2017-10-16 10:34:27 -07:00
Donald Chai
d1ac6e1f9e AAPT: treat "-I" with lower precedence than main APK for dumping.
This is the desired behavior if resource IDs may overlap, and also happens to
improve the behavior of:

  aapt dump -I base.apk badging feature.apk

when both APKs use the same package name with different package IDs
(base=0x7F, feature=0x80).  Previously, the final call to
DynamicRefTable::addMapping was for base.apk, and all references to 0x80 were
rewritten in DynamicRefTable::lookupResourceId to 0x7F.  After this
change resources defined in both APKs are resolved correctly.

Note that this is a bit of kludge, and APKs should use different names
to avoid conflating the package IDs.

Fixes: 67070085
Bug: 64058531
Test: manual with sample in b/67070085#comment2
Change-Id: I285adb6f44a297440b08fc7a1f9ad73c700eb9bc
2017-10-12 21:34:22 -07:00
Yunlian Jiang
08e76846b6 Merge "Replace strcpy with memcpy." am: bb115bac41 am: 16951dcb54 am: 23f6dca5fd
am: 61879522fe

Change-Id: Iaf1e0edbb3902714621492d6dd53458c1ad50b01
2017-10-03 04:44:37 +00:00
Yunlian Jiang
61879522fe Merge "Replace strcpy with memcpy." am: bb115bac41 am: 16951dcb54
am: 23f6dca5fd

Change-Id: I446973c3b96f253e3c3fc2dfda7647cd3e625916
2017-10-03 04:38:07 +00:00
Treehugger Robot
bb115bac41 Merge "Replace strcpy with memcpy." 2017-10-03 04:09:48 +00:00
Yunlian Jiang
d32ae10f4c Replace strcpy with memcpy.
This fixes the warning
Call to function 'strcpy' is insecure as it does not provide bounding of
the memory buffer. As a side effect, it sliences the warning
frameworks/base/tools/aapt/Images.cpp:1270:50: warning: Potential leak
of memory pointed to by field 'data' [clang-analyzer-unix.Malloc]
frameworks/base/tools/aapt2/compile/Png.cpp:562:42: warning: Potential
leak of memory pointed to by field 'data' [clang-analyzer-unix.Malloc].

Bug: None
Test: The warning is gone.

Change-Id: I25f68ff85bea7069c21549c7deb7920d1877069e
2017-09-26 16:02:11 -07:00
Adam Lesinski
e33de76a16 Merge changes Id8bdb14e,I573a6735,Ia804777f,Ia68122cb,Ia1997800, ... into oc-mr1-dev
am: e02983681a

Change-Id: I42369e6fb7bd121e45b5a002cd5f00e05221ead3
2017-09-15 16:57:21 +00:00
Adam Lesinski
40e869e2a5 AAPT: Dump badging should pickup strings from the right package
A bug in the dump badging command caused strings to be looked up in the
first loaded package only.

Bug: 64948230
Bug: 65645766
Test: none
Change-Id: Ia804777fe3f963004a5c053129ef6e0c94b7f6a3
Merged-In: Ia804777fe3f963004a5c053129ef6e0c94b7f6a3
2017-09-14 11:31:40 -07:00
Dan Willemsen
116abe23c4 Merge changes I93cf24d4,I32e438ef am: 30798ad13a am: c28d591b36 am: 59225490b8
am: 2e9ec5f0de

Change-Id: Ie590c34bce9d0218bb9b48294756dae04e9210b7
2017-09-10 02:15:34 +00:00
Dan Willemsen
2e9ec5f0de Merge changes I93cf24d4,I32e438ef am: 30798ad13a am: c28d591b36
am: 59225490b8

Change-Id: I6cf57e951900b3df816070feee0d3bf92a6a5a7d
2017-09-10 02:05:05 +00:00
Dan Willemsen
8487558120 Merge changes Ia3bcece1,Icd26dc1e am: ec462238f6 am: c201a6bb7d am: 9539d236e7
am: eb211c23d5

Change-Id: I0b4d324af3a1d7dad4648a9d0ffe0d8c44bee6a9
2017-09-09 20:03:39 +00:00
Dan Willemsen
eb211c23d5 Merge changes Ia3bcece1,Icd26dc1e am: ec462238f6 am: c201a6bb7d
am: 9539d236e7

Change-Id: I2a5c73a54004c1aa378d25776de0d2080544137d
2017-09-09 19:54:02 +00:00
Dan Willemsen
d3eac266b0 Convert host tools to Android.bp
See build/soong/README.md for more information.

Test: m libinstrumentation interrupter accessorychat accessorytest bit obbtool pbkdf2gen libsplit-select_tests split-select protoc-gen-javastream validatekeymaps libaapt_tests aapt
Test: mmma frameworks/base
Test: out/host/linux-x86/nativetest64/libaapt_tests/libaapt_tests
Test: out/host/linux-x86/nativetest64/libsplit-select_tests/libsplit-select_tests
Change-Id: I93cf24d4b232353a52d53be8ed85781b8f4a3877
2017-09-09 06:18:48 +00:00
Dan Willemsen
896f01879b Don't compile libaapt with the build number
Only do that for the aapt binary itself. This will allow libaapt to be
converted to Soong.

Also remove a few lines that weren't doing anything: aaptCppflags was
never set, LOCAL_C_INCLUDES := $(LOCAL_PATH) is implied.

Test: m aapt
Test: aapt version
Change-Id: Ia3bcece14921417e1bfd3406630961c013bd497c
2017-09-08 22:58:56 -07:00
Dan Willemsen
85aee73e98 aapt: Always use our libz
Instead of using the system libz (-lz), include our copy as a static
library. This is safer in case the system version isn't compatible.

Also removes references to -ldl -lrt -lpthread, which are now implied.

Test: m -j
Test: out/host/linux-x86/nativetest64/libaapt_tests/libaapt_tests
Test: out/host/linux-x86/nativetest64/aapt2_tests/aapt2_tests
Test: out/host/linux-x86/nativetest64/libsplit-select_tests/libsplit-select_tests
Change-Id: Icd26dc1e0d011e5b5f158e562640533c5ac34e33
2017-09-08 22:44:19 -07:00
Makoto Onuki
7bd7a62336 Add VERSION_CODES.P
Bug: 64982450
Test: Build and boot
Change-Id: I0a90033239081c583b10021cbc06d032e206beb4
2017-08-31 18:06:26 +00:00
TreeHugger Robot
d1ae6e2bf4 Merge "AAPT: Dump badging should pickup strings from the right package" 2017-08-30 17:02:38 +00:00
Adam Lesinski
3b8e9e2468 AAPT: Dump badging should pickup strings from the right package
A bug in the dump badging command caused strings to be looked up in the
first loaded package only.

Bug: 64948230
Test: none
Change-Id: Ia804777fe3f963004a5c053129ef6e0c94b7f6a3
2017-08-25 17:29:47 -07:00
Michael Wright
eec01ac5a3 O MR1 is API 27
Bug: 64982450
Test: manual
Change-Id: I4be170f9f1021899db3ef0bce3eaeada21f8b475
2017-08-23 13:49:14 -07:00
Jeff Sharkey
7beabc264b Let's get a constant for O_MR1.
Test: none
Exempt-From-Owner-Approval: HULK SMASH!
Change-Id: I440ebae4d0891d9044bbbfb5beaaaa98639aea98
2017-07-20 03:19:33 +00:00
Igor Viarheichyk
4fb6516a55 Improved word break for BiDi pseudolocalizer.
Characted sequences \n and \t are now treated as word separators
by BiDi pseudolocalizer. This solves issues when text rendering
engine breaks a line in the middle of a text chunk marked with
RLM+RLO and PDF+RLM sequences.

Bug:34064580
Change-Id: I52e6018785fae25479fa167440f24c534b0e3253
Fixes:34064580
Test: make aapt2_tests
Test: Run aapt2_tests binary
2017-07-06 15:41:47 -07:00
Adam Lesinski
57fe48389f AAPT: Allow including dependencies in dump command
Feature splits depend on their base. The dump badging command
does resource resolution, and needs to be able to find resources
located in the base APK of a feature split.

Bug: 38038608
Test: manual
Change-Id: I8c22f0083c46a853a3a56a4049715409ac2723fe
2017-05-10 15:42:22 -07:00
TreeHugger Robot
7844a34308 Merge "Fix issue with unresolved IDs in adaptive icons" into oc-dev 2017-04-19 20:54:10 +00:00
Adam Lesinski
54b58ba5cc Fix issue with unresolved IDs in adaptive icons
Adaptive icons were versioned correctly, but skipped the compilation
/ resource ID assignment phase. This CL fixes the glitch.

Bug: 34829129
Test: manual
Change-Id: I93739a8b10fac53a048d95b330edf381684a807c
2017-04-18 18:05:02 -07:00
Adam Lesinski
99d36ee8a9 AAPT: Auto-alias application adaptive-icon
When a developer specifies an adaptive application icon,
and a non-adaptive round application icon, create an alias
from the round icon to the regular icon for v26 APIs and up.

We do this because certain devices prefer android:roundIcon over
android:icon regardless of the API levels of the drawables set for
either.

This auto-aliasing behaviour allows an app to prefer the
android:roundIcon on API 25 devices, and prefer the adaptive icon on
API 26 devices.

An app developer can override this behaviour by explicitly setting the
android:roundIcon to a drawable that has a v26 qualifier.

Bug: 34829129
Test: manual
Change-Id: Iaaaa5d8367e4f3f9e9f2e3b51c782d3be6a3bb71
2017-04-17 16:22:03 -07:00
Adam Lesinski
cf1f1d9128 AAPT: Version <adaptive-icon> to v26
Bug: 35908647
Test: manual
Change-Id: Ic8f43efe34385192fbab18675eb5898ed80912a5
2017-03-28 19:16:11 +00:00
ztenghui
205548561c disable versioning for objectAnimator to support path motion
bug:33527757

Test: replace the AAPT in local SDK, and make sure the propertyX/YName
still works within ObjectAnimator.

Change-Id: Ic9bb14cd228dcf7e4d250bd0f6cb5f0c31a14183
2017-03-21 16:44:00 -07:00
Adam Lesinski
2d6fa033e1 AAPT: Process XML in mipmap directory
Mipmap directories should be treated like drawables.
They are just a convention that prevents them from
being split or stripped for multi-apk.

Bug: 36068314
Test: manual
Change-Id: I93ab3871c7d9d403b77989bcc88304e9939866c4
2017-03-10 18:43:56 -08:00