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)
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
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
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
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)
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
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
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
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
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
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
Style resid stacks should also be invalidated when invalidating
AssetManager caches.
Bug:117176857
Test: manual
Change-Id: I28224597adf4b0af8326bd788eab289e4ba60418
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
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
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
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
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
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
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
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
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