755 Commits

Author SHA1 Message Date
Jeongik Cha
dee02a0fae Merge changes from topic "system_ext"
am: a828ee6442

Change-Id: I2b636d0c54c932342586de47a38c16e93bf978e8
2019-09-26 15:40:26 -07:00
Jeongik Cha
3e725f2224 Consider overlay in system_ext as system's
When there is overlay package in system_ext, turn on POLICY_SYSTEM_PARTITION.
In other words, overlay pacakge in /system_ext is considered as system's one

Test: mv vendor/overlay/framework-res__auto_generated_rro.apk system_ext/overlay
      and then check if it works properly.
Bug: 136715327

Change-Id: Ib225368eae41203a8630f4310d26e9cf1afa706a
Merged-In: Ib225368eae41203a8630f4310d26e9cf1afa706a
(cherry picked from commit cba9579158cc70bf8eadb6e8a239e0ab2dc073d2)
2019-09-23 22:01:29 +00:00
Xin Li
d57e959e71 Merge qt-r1-dev-plus-aosp-without-vendor (5817612) into stage-aosp-master
Bug: 135460123
Change-Id: I65906d82b14125c0893d5cde0cfebb73bf9e38ab
Merged-In: I1f2564837c33cd4c6c3db6aac3cbaf8c09707da9
2019-09-10 11:16:29 -07:00
Yi Kong
ae6248d35b Merge "Fix reversed logic"
am: 946e857c71

Change-Id: I22194d1d2923170a224ad6d782dd8155e957ebe3
2019-08-30 07:16:21 -07:00
Yi Kong
f69c334dea Fix reversed logic
To check if a value falls in a range, it should be
  a >= MIN && a <= MAX
instead of
  a >= MIN || a <= MAX

Found by an experimental Clang warning change,
https://reviews.llvm.org/D66044.

Test: presubmit
Change-Id: I91e2a04687285d9311fd831197c73af38ec8379c
2019-08-30 02:09:30 +00:00
Ryan Mitchell
18e2a06453 Merge "Set idmap2 binary uid and gid after forking" into qt-dev am: ebad9125c8
am: e9acb9c566

Change-Id: I30d650e7d5548f6e53f37c22f62e4de244145bdc
2019-07-02 11:53:41 -07:00
Ryan Mitchell
e9acb9c566 Merge "Set idmap2 binary uid and gid after forking" into qt-dev
am: ebad9125c8

Change-Id: I13b16878cad1cb742c0b417fa09ec406e8f1bf2d
2019-07-02 10:52:24 -07:00
Ryan Mitchell
3fc3c813ff Merge "Set idmap2 binary uid and gid after forking" into qt-dev
am: ebad9125c8

Change-Id: Ia4a881fc50118e15c4b6cbe66164c76e7b765298
2019-07-02 10:32:13 -07:00
Ryan Mitchell
a8f13667c2 Set idmap2 binary uid and gid after forking
The file permissions of the idmap2 binary are currently not set
correctly when the system forks and execs the idmap binary during
zygote. This chnages sets the uid and gid after forking to the same uid
and gid of the parent process.

Bug: 134897503
Test: device boots and generates idmap
Change-Id: Ic7fac49e5982f3c47713603b905c3a6be117a05b
2019-07-01 21:19:21 +00:00
Elliott Hughes
0566225cb8 Merge "Move off ZipString and over to std::string/std::string_view as appropriate." into qt-dev-plus-aosp
am: ee1c95f060

Change-Id: Ic87fff08eaf240bbaa370432b6955520206d3882
2019-06-17 16:26:05 -07:00
Elliott Hughes
a65cae9e7f Move off ZipString and over to std::string/std::string_view as appropriate.
(Cherrypick to AOSP master, resolving merge conflicts.)

Bug: http://b/129068177
Test: treehugger
Change-Id: Ib46761d89772d3a3c655a39df573fd305c117d19
Merged-In: Ib46761d89772d3a3c655a39df573fd305c117d19
2019-06-17 16:05:19 -07:00
Elliott Hughes
78de4f999d Move off ZipString and over to std::string/std::string_view as appropriate.
Bug: http://b/129068177
Test: treehugger
Change-Id: Ib46761d89772d3a3c655a39df573fd305c117d19
2019-06-17 16:47:58 +00:00
Ady Abraham
8c219250c7 Merge "DisplayEventDispatcher: use eConfigChangedDispatch" into qt-r1-dev
am: 619946fdc4

Change-Id: I98ecea42a933ed20ddd7b085baa88c277e53e353
2019-06-07 18:36:52 -07:00
Ady Abraham
9c501aad4b DisplayEventDispatcher: use eConfigChangedDispatch
In order to get DISPLAY_EVENT_CONFIG_CHANGED, eConfigChangedDispatch needs
to be used when creating DisplayEventDispatcher.

Bug: 131688378
Test: adb shell /data/nativetest64/libsurfaceflinger_unittest/libsurfaceflinger_unittest
Test: trigger config change and observe logcat
Change-Id: I0de8037ee5b024b7d9729750f582be919087be41
2019-06-07 10:26:47 -07:00
Eric Holk
64bd7c068c Merge "Remove obtainStyledAttribute and AssetManager2::GetBag tracing" into qt-dev
am: bdc1ba53ef

Change-Id: I664783b86275e5a6513c1d464aa0bc7d12829ad0
2019-05-21 14:36:36 -07:00
Eric Holk
4487398e0d Remove obtainStyledAttribute and AssetManager2::GetBag tracing
These traces are small and noisy, so they hurt performance more than they help.

This reverts commit c37457799be3db0590a5d94832b2fef5f64ef439.

Test: m
Bug: 132721345
Change-Id: I9ef719f54f2bc8a54f23e88f46d74e35417a6519
(cherry picked from commit 3509b624feecbcb8be850f9e1f397cdd7aeea5e2)
2019-05-21 00:31:03 +00:00
Elliott Hughes
e94bde383b Merge "Track libziparchive API change." am: 71e79a2396
am: b17db5960e

Change-Id: I07b669391eb8030bd09529f224fefefe73a6d1f5
2019-05-09 16:29:49 -07:00
Elliott Hughes
7a6cc0c006 Track libziparchive API change.
Bug: http://b/129068177
Test: treehugger
Change-Id: Id4b202502b07e08102deda49f7d28ba10a63bb0a
2019-05-08 12:29:25 -07:00
Elliott Hughes
dfe3d688fc Merge "Track libziparchive API change." am: 32581e1dd2
am: 78791cd8d7

Change-Id: Id4ac5019e267fbd0a32a41437e92c3f802e334e8
2019-05-06 17:45:35 -07:00
Elliott Hughes
b97e737c18 Track libziparchive API change.
Bug: http://b/129068177
Test: treehugger
Change-Id: I88f49a06db416a7c6ec8afe87cc9cca825eb5ccb
2019-05-03 22:42:31 -07:00
TreeHugger Robot
b0815b80e8 Merge "Add support for /oem/overlay" into qt-dev 2019-04-24 08:33:38 +00:00
TreeHugger Robot
9c88c1e93e Merge "Add odm and oem policies" into qt-dev 2019-04-18 01:39:51 +00:00
Ryan Mitchell
939df096be Add odm and oem policies
This change adds parsing, encoding, and validating of odm and oem
overlayable policies to aapt2, libandroidfw, and idmap2.

Bug: 121033532
Test: aapt2_tests, idmap2_tests
Change-Id: Ifc0d4b6c9f9c37e06b2988abade69dbb277c50c2
2019-04-17 16:07:57 -07:00
Winson
1201ca7054 Skip idmap1 generation if target defines overlayable
Since idmap1 can't enforce policy restrictions, we can't allow it
to generate an idmap that might get used.

Migrating to idmap2 is too difficult for now as it requires a lot
of PackageManager infrastructure to validate policies, and none of
that is available during manifest parsing, which is where idmap1
is currently used.

Bug: b/130260055

Test: manual test BT issue from b/130260055
Test: manual test app with test overlay toggling Activity enabled

Change-Id: I5e7e321d27aab9be360a5e8be77d804ad3f66336
2019-04-15 15:31:39 -07:00
Mårten Kongstad
eb8a5c0b91 Add support for /oem/overlay
Add support for runtime resource overlay (RRO) APKs in /oem/overlay.

Bug: 121033532
Test: manual (adb push apk to /oem/overlay, reboot, cmd overlay list)
Change-Id: I70b23b11831d57b3241e6057c745aa4ce9f795ef
2019-04-09 06:37:33 -07:00
Ryan Mitchell
93bca97e7c Allow non-references to be copied between AssetManagers
Hard-coded values in styles can be copied between AssetManagers even if
the source package is not present in the destination AssetManager. Only
references and strings should be prevented from being copied over
because they would be invalid in the destination AssetManager.

Bug:126400561
Test: manual
Change-Id: I970a3e961763b2c003c15b950d864a9a0b615022
2019-04-05 12:44:51 -07:00
TreeHugger Robot
ca3088a9aa Merge "Add per-file owner for CursorWindow.cpp" 2019-04-03 23:05:48 +00:00
TreeHugger Robot
7988315b01 Merge "Add support for /odm/overlay" 2019-04-03 21:56:39 +00:00
Makoto Onuki
9e1566faf1 Update OWNERS
Test: N/A
Change-Id: Id6bd3f7b9b63ad8e0ec4022926966e58137f1657
Merged-in: I075ac3ec47743f5d9cd2acbd0cc01ce55cd1a8e3
2019-04-03 14:35:40 -07:00
Makoto Onuki
878cbf8269 Add per-file owner for CursorWindow.cpp
(Need to merge it first to avoid merge conflict)

Test: N/A
Change-Id: I075ac3ec47743f5d9cd2acbd0cc01ce55cd1a8e3
2019-04-03 14:32:35 -07:00
Makoto Onuki
2276ceacb3 Improve CursorWindow failure message
Bug: 129139241
Bug: 129721058
Test: atest CursorWindowTest
Change-Id: Iac1c5ec6f999dadd638fc5ab47c69d13f60ea467
2019-04-03 16:01:33 +00:00
Mårten Kongstad
48c24cf149 Add support for /odm/overlay
Add support for runtime resource overlay (RRO) APKs in /odm/overlay.

Bug: 121033532
Test: manual (adb push apk to /odm/overlay, reboot, cmd overlay list)
Change-Id: I0918d276dfa6a43054068d3f84ecd0d1639f1d0b
2019-04-02 11:07:10 -07:00
Winson
b0085ce5b6 Fix AssetManager2 isUpToDate check
This logic was lost in the AssetManager1 -> 2 migration.

The old AM1 checked the last modification time of the file
and compared it to a previously stored value. This re-adds the
logic to ApkAssets and fixes the checks in the JNI/Java layer.

Unfortunately I couldn't find a failing/practical case where
this check mattered. It only came up when diagnosing an issue
which ended up being unrelated.

Test: manually ran with other overlay changes

Change-Id: I758e4af1d32a9c03b2204a8a3a26e82b7e83feda
2019-03-29 12:18:18 -07:00
Mårten Kongstad
dbf343becb RRO: remove ability to overlay assets
Target packages use <overlayable> to opt-in to RRO. While this works for
resources, it does not support assets. For security reasons, remove the
ability to overlay assets via RRO for now: a future change may extend
<overlayable> to include assets.

Test: atest OverlayDeviceTests
Bug: 120867881
Change-Id: Ie0b6897f0586ea8b9d75f357e216904e25d4dc7b
2019-03-19 15:40:55 -07:00
Winson
40e0d2a92b Delete pAsset* when failing to open chunk from FileAsset
Realistically this doesn't matter because FileAsset always returns
NO_ERROR. But it's worth being correct, in case that ever changes.

Bug: 112146313

Test: none necessary

Change-Id: Iaeddc77c78c93394f96b77533cf8ce30cd1dc370
2019-03-18 13:52:48 -07:00
Aurimas Liutikas
908309feb5 Merge "Clean up attribute apis based on api council feedback." 2019-03-08 22:02:17 +00:00
Aurimas Liutikas
f9dbd5fed6 Clean up attribute apis based on api council feedback.
Bug: 127714248
Test: None
Change-Id: I40596a88e7e446c6a25f2b9074bb88a0a417ed63
2019-03-07 14:23:59 -08:00
Ryan Mitchell
2c4d874d72 Invalidate style stack resids
Style resid stacks should also be invalidated when invalidating
AssetManager caches.

Bug:117176857
Test: manual
Change-Id: I28224597adf4b0af8326bd788eab289e4ba60418
2019-03-04 17:50:11 +00:00
Ryan Mitchell
2fe2347e1e Add ANDROID_LOG to supress android specific logs
AAPT2 uses AssetManager2 as the implmentation of its symbol table.
When generating the the R.java, AAPT2 adds information about styleables
in the comments. If the first symbol table checked by the delegate is an
AssetManager2 symbol table and it does not contain the styleable
attribute being searched for, a bogus error is printed and the resource
is found in a later symbol table.

Bug: 126596328
Test: m -j Settings && diffed generated java files
Change-Id: If86a9d62fd72317525dffa862be1267621f93afd
2019-02-27 15:08:53 -08:00
TreeHugger Robot
1f24ccf2f6 Merge changes from topic "display_policy"
* changes:
  DisplayEventDispatcher: add DISPLAY_EVENT_CONFIG_CHANGED
  SurfaceControl: add setAllowedDisplayConfigs
2019-02-27 00:01:45 +00:00
Ady Abraham
a5a21f70e1 DisplayEventDispatcher: add DISPLAY_EVENT_CONFIG_CHANGED
Add a new event for display configuration change. This event
will be sent by SF anytime it changes the display config.

Test: Generate DISPLAY_EVENT_CONFIG_CHANGED and observe the log
Bug: 122905403
Change-Id: Ifa473a34d7b313501e5e4e8a67186fb82754fdcd
2019-02-22 17:54:06 -08:00
Ryan Mitchell
a55dc2ed6b Fix long paths on Windows
util::mkdirs iteratively creates each directory of a specified path. For
windows, Calling mkdir on only the drive letter or on the extended path
prefix (\?\\) will result in an error. Start after the long path prefix
and the drive letter.

This also changes AAPT2 to use AssetMaanager2 to retrieve symbols from
the symbol table. AssetManager2's zip library uses _wopen to open
windows files.

Bug:123251200
Test: aapt2_tests.exe
Change-Id: I26169d83b22d441485de3c49d63a6c4ed710e292
2019-02-20 09:46:00 -08:00
Winson
b2d7f5343d Signature policy for overlayable items
Add encoding/decoding of new policy for overlays. Signature enforces
that an overlay package is signed with the same key as the actor of
the target resource, so that an overlay can be installed by the user
as a normal app but restricted to those built by the author of the
actor (which can be the same as the target).

This also enforces that a valid policy is specified.

This doesn't implement the actors nor the signature check.

Bug: 119402606

Test: ResourceParserTest ParseOverlayablePolicy
Test: ProtoSerializerTest SerializeAndDeserializeOverlayable
Test: aapt2_tests

Change-Id: I8495ad790c2ebd51759bc6eba81149680c209475
2019-02-14 10:07:13 -08:00
Mårten Kongstad
c92c4dd6c6 Surface <overlayable> info in Java AssetManager
Add a new, hidden method to AssetManager to extract a mapping
overlayable name -> overlayable actor for all <overlayable> blocks in a
package. [This will eventually be used to check if the caller of the OMS
AIDL API is the registered actor for a given overlay.]

Also, teach AssetManager2 to not accept packages that re-use the same
overlayable name. [Such packages have always been ill-formed.]

Bug: 123894537
Test: make libandroidfw_tests
Change-Id: I1117fd3503f04fe4c73eb7114901e022508f4d9e
2019-02-07 14:32:16 -08:00
Aurimas Liutikas
86ef44bcc7 Merge "Add helper methods for View attribute debugging" 2019-02-07 19:05:20 +00:00
Aurimas Liutikas
8f004c85a0 Add helper methods for View attribute debugging
Adding abilities to debug:
- Attribute resolution stack (which resources are looked
  at when resolving an attribute)
- Attribute value source (where did each attribute value
  get defined)
- Get explicit style id (if a view had it set via style="...")

This feature will be behind Settings.Global flag that Android
Studio will set to the debugged application package ID.

Bug: 111439551
Test: atest CtsViewTestCases:android.view.cts.ViewStyleTest
Change-Id: Ib6f9fc81000bb867b5b94a68953c99b0bc802d6c
2019-02-06 14:46:17 -08:00
Dominik Laskowski
9e7dce3833 Merge "Generalize physical display management" 2019-02-06 22:46:09 +00:00
Ryan Mitchell
198234502b Enforce overlayable API when defined
If a package defines overlayable resources, then do not allow resources
that are not defined as overlayable to be overlaid.

Bug:123600120
Test: idmap2_tests and cts-tradefed run cts -m CtsRROTestCases
Change-Id: I35120a97ccf4650e67c7ba65a60f4f3c51b0e627
2019-02-05 07:56:50 -08:00
Dominik Laskowski
3316a0a08e Generalize physical display management
This CL enables the framework to manage an arbitrary number of physical
displays. It also surfaces physical display IDs, which are stable across
reboots and encode (model, port) information that will be propagated
further up in a follow-up CL.

Bug: 116025192
Test: Boot with more than two displays
Test: Hotplug works with any number of displays
Test: Verify stable display IDs with "dumpsys display"
Change-Id: Idb2eaff66b2e0873be6ad27d337ff18b730d1331
2019-02-04 10:06:15 -08:00
Aurimas Liutikas
949b05dbdc Update TypedArray and TypedValue to store source layouts.
In ag/5859897 we started tracking source styles for each TypedValue.
It is also useful to keep track of source layouts if the attribute
was resolved against a layout (attribute set in XML layout inside
of <View> tag).

Test: atest CtsContentTestCases:android.content.res.cts.TypedArrayTest
Bug: 111439551
Change-Id: Ie6bc6ecd9a22b536a2f3288263b896f9cec67d38
2019-01-31 15:44:51 -08:00