865 Commits

Author SHA1 Message Date
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
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
Tenghui Zhu
fd7e897193 Merge "Disable versioning for pathInterpolator when no-version-vectors is on." 2017-03-08 21:42:49 +00:00
ztenghui
010df88f90 Disable versioning for pathInterpolator when no-version-vectors is on.
Test: manually build demo app for support lib, and works!
bug:33527757

Change-Id: I3badea18b2eb8cddea94f7e44f9129bb55ed9649
2017-03-07 16:12:07 -08:00
Mathias Agopian
df7707cb4f fallout of cleaning-up libutils includes
Test: run & compile
Bug: n/a
Change-Id: I0f6a0be03f4b120b1b5876aae0c0618c025d9f2b
2017-03-03 12:37:54 -08:00
Dianne Hackborn
cd154e9535 Implement issue #34842682: Add ability to limit permissions based on features
Two new attributes for <uses-permission>: android:requiredFeature and
android:requiredNotFeature.

Also update aapt to include this information in badging:

uses-permission: name='android.content.cts.REQUIRED_NOT_FEATURE_UNDEFINED' requiredNotFeature='android.software.cts.undefined'
uses-permission: name='android.content.cts.REQUIRED_MULTI_DENY' requiredFeature='android.software.cts.undefined' requiredNotFeature='android.software.cts'

Test: new PermissionFeatureTest suite.

Change-Id: Icc1f815a4675ae9dd2cb7f61730ab28b5c11228a
2017-03-01 12:40:57 -08:00
Aurimas Liutikas
75e7d1d73e Removes an already defined warning in aapt.
Apps that expect to use the current SDK don't specify anything in their
manifest and the build system rightfully injects the current SDK.

Any apps that specify their own <uses-sdk> or versionCode are telling
the build system that they are purposely using some other minSdkVersion,
etc (support library demos).

Test: None
Change-Id: I0aba3a71e15703c7bcafcf4d35608a1851dd8567
Fixes: 34901699
2017-02-17 18:44:28 -08:00
Adam Lesinski
af463961bc Merge "AAPT: Fix --feature-of to allow non-public symbol visibility" 2017-02-08 14:07:22 +00:00
TreeHugger Robot
d9861d9715 Merge "Finish font support for AAPT" 2017-01-25 03:28:26 +00:00
TreeHugger Robot
e84ad491c8 Merge "Add color mode to activity/window" 2017-01-25 01:20:28 +00:00
Adam Lesinski
fa1e9d7ad0 AAPT: Fix --feature-of to allow non-public symbol visibility
Test: manual
Change-Id: Iada18b201c6463011002f96285a64c64565a6e1c
2017-01-24 16:16:09 -08:00
Romain Guy
4832745b84 Add color mode to activity/window
The color mode lets an application request a wide color gamut for
a specific window. This will also be used in the future to request
HDR. The color mode is currently either default (sRGB) or an undefined
wide gamut color space chosen by the platform. These attributes could
later be used to choose a specific color space if we deem this important
or useful.

This change also renames the various "colorimetry" attributes and
constants to "color mode" for consistency. These symbols were
added in O and can be safely renamed.

Test: CtsColorModeTestCases
Bug: 32984164
Change-Id: I4d4691dd12dbe3f3aa6a5cf893cff39aa16c739e
2017-01-24 15:55:09 -08:00
Adam Lesinski
9bbe787822 Finish font support for AAPT
Test: make CtsContentTestCases in cts/tests/tests/content
Change-Id: Ie1e08deeef56611de261bd12f25f53c88068950e
2017-01-24 13:52:45 -08:00
Yuichi Araki
4d35cca96c AAPT: Add --no-version-transitions flag
Add a new flag to disable versioning of Transition related XMLs.
Transition support library will use this to handle these XMLs on older
API levels.

Test: make libaapt_tests AaptTestAppOne
Bug: 34427868
Change-Id: I66e81cca049e71ef6704177b2ca21c9cdeaff78f
2017-01-24 14:59:51 +09:00
TreeHugger Robot
b334b8f0f2 Merge "AAPT: Add support for 'font' resource type" 2017-01-23 11:48:12 +00:00
Adam Lesinski
83b4f7daba AAPT: Add support for 'font' resource type
Change-Id: I5bc459e34715779ab3b1c415f40f592a4ccbb96e
Test: manual
2017-01-20 13:19:27 -08:00
Romain Guy
c9ba559021 Add wide color gamut and HDR resource qualifiers
Bug: 32984164
Test: Config_test, AaptConfig_test and aapt2_tests
Change-Id: Ie9c82bfe2d36b1d6180ee223250ab5bb2ce90dd4
2017-01-19 18:44:00 -08:00