828 Commits

Author SHA1 Message Date
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
Zak Cohen
1a6acdbb86 Introduce new UI_MODE_TYPE_VR_HEADSET and qualifier.
Bug: 30989383
Test: Unit test for aapt2
Change-Id: I66dc65af6327b94fed74538bee08cada0b8be4fa
2017-01-11 11:44:47 -08:00
Adam Lesinski
2386df23ac AAPT: Dump maxSdkVersion for implicit permissions
Bug: 32599997
Test: Manual
Change-Id: I13bdcf097625e3cb5fb35da1eb2544b0f8906e79
2016-12-28 16:07:24 -05:00
Adam Lesinski
fcb5f7bf36 AAPT: fix error message
Test: none
Bug:9779154
Change-Id: Iebda7d4f0061cdc51db0103977195964fcc1211d
2016-11-02 13:17:10 -07:00
Mark Salyzyn
21c2e9e60c Merge "missing includes" am: 78929f3ee0 am: 6a8f0d70b0
am: 6e60ab12e7

Change-Id: I1b5c6f49d2ae565ebd59c6ce8d590512ab306487
2016-10-17 21:38:33 +00:00
Mark Salyzyn
6a8f0d70b0 Merge "missing includes"
am: 78929f3ee0

Change-Id: I3e7a25ded484d516fab453abe434c2e53cf0f27e
2016-10-17 21:25:59 +00:00
Mark Salyzyn
4d6c372eae missing includes
Assumptions are made about header side effects

Test: compile
Bug: 30465923
Change-Id: Icc9415aed5e54b2bc00b70aa0da6df4148f30654
2016-10-17 12:32:54 -07:00
George Burgess IV
8607c7016f Merge "Fix static-analyzer warning." am: 2fbf30d3fe am: a52992e290 am: c88628da5e
am: a40eeb0979

Change-Id: I973bb3f7f72f38133472874727b4297042ee0a50
2016-10-14 20:07:51 +00:00
George Burgess IV
a40eeb0979 Merge "Fix static-analyzer warning." am: 2fbf30d3fe am: a52992e290
am: c88628da5e

Change-Id: Iece80dfbd8a5d01ffdcf6edf1decd8078af31511
2016-10-14 14:39:06 +00:00
George Burgess IV
0c2774b16a Fix static-analyzer warning.
frameworks/base/tools/aapt/Images.cpp:845:17: warning: Assigned value is
garbage or undefined
     row += bpp;

Bug: None.
Test: The warning is gone.
Change-Id: Idf4623d2510111a9188ed39922e109a8db225c76
2016-10-13 15:51:04 -07:00
Adam Lesinski
a77685fa59 Remove unused methods from AssetManager.cpp
A lot of the vendor/locale specific code existed pre-1.0
and was reworked into the current system.

Test: refactoring CL, all code except setLocale() was not being executed.
Test: setLocale() change tested manually
Change-Id: Ifb098f9808763a6cf5fb4336e089430adc09e198
2016-10-03 16:33:12 -07:00
Colin Cross
f45d261928 Merge "aapt: remove duplicate definition of ZD" am: ac2d839d7c am: 3efa1e7c17 am: e43f2d4ef5
am: b62cc13c7c

Change-Id: Ieb593095a6bdc1842b95863fa2cf08ff1fb0669f
2016-09-23 01:17:34 +00:00
Colin Cross
ece4c72900 Merge "Remove has_trivial_move trait from StringPool types" am: d333f28397 am: 6f02f57f12 am: 57ef0a40f1
am: 01496b46d9

Change-Id: Icdbc696e08f06986b699681d858a10953402ca7a
2016-09-23 01:08:09 +00:00
Colin Cross
b62cc13c7c Merge "aapt: remove duplicate definition of ZD" am: ac2d839d7c am: 3efa1e7c17
am: e43f2d4ef5

Change-Id: I71e7bfd44396aa2a7d79ba983bcc71d7684a36c1
2016-09-22 23:04:06 +00:00
Colin Cross
01496b46d9 Merge "Remove has_trivial_move trait from StringPool types" am: d333f28397 am: 6f02f57f12
am: 57ef0a40f1

Change-Id: If6fab1852e0e9b287a904fe4a4b556167ac0800d
2016-09-22 22:58:02 +00:00
Treehugger Robot
ac2d839d7c Merge "aapt: remove duplicate definition of ZD" 2016-09-22 21:24:49 +00:00
Colin Cross
cafc05357c Remove has_trivial_move trait from StringPool types
StringPool:entry* are not trivially moveable, as they contain Vector<>
objects.  The data in Vector<> is trivially moveable, but Vector<>
itself is a dynamic type with a vtable, which is not trivially
moveable.

Impact on aapt for frameworks-res is negligible, ~3%.

Bug: 31595853
Test: m -j framework-res
Change-Id: I562a46ef8934aed7aab5c5377db53d9cf64a08b9
2016-09-22 10:09:38 -07:00
Adam Lesinski
fd2cfb17e8 AAPT: Don't imply specific location hardware for dump badging am: 43158773b4 am: 7f56759cfd
am: 5c60cb9208

Change-Id: I7251036c3212a576fb68023d05687d0e10a9f6b5
2016-09-22 06:52:45 +00:00
Adam Lesinski
5c60cb9208 AAPT: Don't imply specific location hardware for dump badging am: 43158773b4
am: 7f56759cfd

Change-Id: Id54d729793267634f1ade9073395ed6d6921ce60
2016-09-22 05:40:44 +00:00
Adam Lesinski
43158773b4 AAPT: Don't imply specific location hardware for dump badging
Permissions such as android.permission.ACCESS_FINE_LOCATION
and android.permission.ACCESS_COARSE_LOCATION assumed the underlying feature
technology and aapt dump badging would emit an implied feature.

This is no longer accurate, so the only implied feature is on the general
android.hardware.location when the target SDK of the app is 21+.

Bug:25218770
Change-Id: Ica9ebf7d4f360b137af54a8c8fd6c0358cd9be6a
2016-09-21 17:52:58 -07:00
Colin Cross
281386df64 aapt: remove duplicate definition of ZD
ZD and ZD_TYPE are set by utils/Compat.h, remove them from
StringPool.cpp and Resource.cpp.

Test: m -j native
Bug: 31492149
Change-Id: I6154e4598dd1f279e348ef6c0b32d756464bda8a
2016-09-16 12:56:21 -07:00
Colin Cross
7fd4eb7ff7 Merge "Replace libziparchive-host with libziparchive" am: 611e205bbe am: 8c8bb25089 am: 63dc310e6a
am: e3cd4b394c

Change-Id: Icc088a0cdd6a2ebc2b7bedb719ad7220d947273d
2016-08-31 00:29:35 +00:00
Colin Cross
e3cd4b394c Merge "Replace libziparchive-host with libziparchive" am: 611e205bbe am: 8c8bb25089
am: 63dc310e6a

Change-Id: I645d077dd656f84446f77fd91c169fd7b977e661
2016-08-26 20:40:27 +00:00
Colin Cross
9a1a3bcb16 Replace libziparchive-host with libziparchive
libziparchive-host is no longer necessary, and mixing libziparchive-host
and libziparchive can cause ODR violations.

Change-Id: I623c0c5579e28f26a6e1db7bd953f33ed1ca68cd
2016-08-26 11:15:17 -07:00
Sergio Giro
d90d8d615a Add bound checks to utf16_to_utf8
Test: ran libaapt2_tests64
Bug: 29250543
Change-Id: I1ebc017af623b6514cf0c493e8cd8e1d59ea26c3
(cherry picked from commit 4781057e78f63e0e99af109cebf3b6a78f4bfbb6)
2016-08-25 12:19:12 +02:00
Adam Lesinski
05e31f1837 AAPT: Handle gaps in resources when building splits am: 26ae640c34
am: 2c8aa38e7a

Change-Id: I475c971fabb2b4bf5acb4f0e9a86d95d79a650ed
2016-08-17 21:56:34 +00:00
Adam Lesinski
26ae640c34 AAPT: Handle gaps in resources when building splits
Due to public ID assignment, gaps in resource type and entry
IDs can occur. This can lead to null pointer dereferencing
if not careful. This happened in ResourceTable::getDensityVaryingResources()
which is called when building Splits.

Bug:30879690
Change-Id: I588e4dcd2e042fccfcb2e87967b5cbd0d23b4497
(cherry picked from commit 081d1b4cf602fdd7302b597e6bf902cb415bc3a8)
2016-08-17 19:53:01 +00:00
Adam Lesinski
84ae78b109 Merge "AAPT: Handle gaps in resources when building splits" 2016-08-17 00:03:36 +00:00
Adam Lesinski
081d1b4cf6 AAPT: Handle gaps in resources when building splits
Due to public ID assignment, gaps in resource type and entry
IDs can occur. This can lead to null pointer dereferencing
if not careful. This happened in ResourceTable::getDensityVaryingResources()
which is called when building Splits.

Bug:30879690
Change-Id: I588e4dcd2e042fccfcb2e87967b5cbd0d23b4497
2016-08-15 18:45:00 -07:00
Adam Lesinski
00e7ebbe1a AAPT: Fix use-after-free error am: 193ed74c2d am: 646f2d9c33
am: 9e8da4a476

Change-Id: I591fd51bf456cd42fe8c633de8924a9f2c844866
2016-08-15 23:33:01 +00:00
Adam Lesinski
9e8da4a476 AAPT: Fix use-after-free error am: 193ed74c2d
am: 646f2d9c33

Change-Id: If9fe7a52e62ae6b2900aa187996b4b785894ab03
2016-08-15 23:22:04 +00:00
Adam Lesinski
193ed74c2d AAPT: Fix use-after-free error
Re-order deletion of ResXMLTree and the Asset object
it iterates over.

Bug:30844391
Change-Id: Ied033d0a8f93343006228a2054c6d0f42bb4717a
2016-08-15 14:22:36 -07:00
Chih-Hung Hsieh
84717d4118 resolve merge conflicts of 17bd236 to stage-aosp-master am: b3d46b44a3
am: c76aa69207

Change-Id: I6bb066d131dde297612c5dcbf5051f4964e62a8b
2016-08-12 19:35:08 +00:00
Chih-Hung Hsieh
c76aa69207 resolve merge conflicts of 17bd236 to stage-aosp-master
am: b3d46b44a3

Change-Id: I5123493e165c4d2ab74cf045e5fb8181886dce62
2016-08-12 19:30:02 +00:00
Chih-Hung Hsieh
b3d46b44a3 resolve merge conflicts of 17bd236 to stage-aosp-master
Change-Id: I08d4500aaa378b08d41e8d046c62101e08dbfba8
2016-08-12 11:44:16 -07:00
Chih-Hung Hsieh
56996ff61e resolve merge conflicts of 76ce8e5 to stage-aosp-master am: ed935c32f4
am: ef57a0d629

Change-Id: Ifcc24ad835f2e74a25954bf3fd7090c75abdc084
2016-08-12 00:40:25 +00:00
Chih-Hung Hsieh
ef57a0d629 resolve merge conflicts of 76ce8e5 to stage-aosp-master
am: ed935c32f4

Change-Id: Ibb7415686469d7b15e8dbe0cd04226c4e0cd7d76
2016-08-12 00:31:29 +00:00
Chih-Hung Hsieh
ed935c32f4 resolve merge conflicts of 76ce8e5 to stage-aosp-master
Change-Id: I4b4ca9906373a95776d2da8ba2fa39a4a78e2a30
2016-08-11 16:48:46 -07:00