Commit Graph

238 Commits

Author SHA1 Message Date
Jeremy Meyer
a761f3325e implement drawable frros
Test: unit tests
Bug: 251283316
Change-Id: Iead53711c54596c3787eeba6dcf9ced129f94426
2022-11-14 18:38:12 +00:00
TreeHugger Robot
bc96ec27e4 Merge "[security] Make frro iteration thread-safe" 2022-10-03 23:35:52 +00:00
Yurii Zubrytskyi
de47d0b926 [security] Make frro iteration thread-safe
Add a lock over all frro iterator methods to make sure the
iterator isn't changed or removed from under the iteration
call while it's running.

+ Also introduce an ID ensuring the caller is the same for
  all the acquire/next/release methods

+ a bit of moves where they were supposed to be from the start

Bug: 245727875
Test: manual + presubmits
Change-Id: Ie585b6d113ebddee491c9ee433f070bed71a57cc
2022-09-29 16:43:04 -07:00
Yurii Zubrytskyi
1fc44ebb01 Clean up some resources code
More moves and fewer allocations

Bug: 237583012
Test: unit tests
Change-Id: I5cf43c8af0743c0e4d96808f1e55ceb4f02d7021
2022-09-29 14:28:51 -07:00
Chih-hung Hsieh
bf40f4f898 Merge "Allow modernize-use-emplace warnings" am: bd37f6ff68 am: 604ea8edec am: 1dca501deb am: a8bf930790 am: 5838404f7f
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2221662

Change-Id: I793c58d57ccd513418dbc3c7999c5948f414786c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-23 07:26:21 +00:00
Jeremy Meyer
b8aec01e6a Avoid unnecessary object creation
Without this change there are errors when running with the new version
of clang

Bug: 247585041
Test: verified that frros used for colors still works, automated tests

Change-Id: Iebbef8aaca866c6f34c381792c1e66bd6b2121f0
2022-09-20 22:10:06 +00:00
Chih-Hung Hsieh
a602a8b12c Allow modernize-use-emplace warnings
Bug: 247585041
Test: presubmit
Test: lunch aosp_cf_arm64_only_phone_hwasan-userdebug;
Test: make tidy-frameworks-base-cmds-idmap2_subset
Change-Id: I2cd78fddb330c3fda3bbb88c2470dfb8b51ea4cf
2022-09-19 15:13:36 -07:00
Jeremy Meyer
be2b779746 Store frro configs in idmap file
This also includes the change to use the configs to decide which (if
any) frros to use at runtime

Bug: 243066074
Test: Manual, updated and created automated tests
Change-Id: I3f1d23e2958ad170799880b9f5eb5bd8ceb1fa67
2022-09-15 21:45:27 +00:00
TreeHugger Robot
51f9763e98 Merge "Assign nullopt to remove unnecessary log" 2022-09-05 03:13:23 +00:00
Ryan Prichard
a2260aa39d Merge "Add missing cassert includes" am: 565f2ab115 am: 1bfdac63f2 am: 935ee60974 am: a0511aa6ea am: 43354b577c
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2202602

Change-Id: Ic0552e5d9392042603d9f2ae91f78789043dfb64
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-01 21:54:04 +00:00
Ryan Prichard
d9a3ffa6f8 Add missing cassert includes
Bug: http://b/175635923
Test: treehugger
Change-Id: I8caf940f7b6e2fdd921516efea4aed14e0c2afb7
2022-08-31 19:09:21 -07:00
felkachang
e03cea4389 Assign nullopt to remove unnecessary log
Once the client requests idmap2d to release a directory iterator,
idmap2d should follow the client request to free and release
frro_iter_.

It should not only check the value of frro_iter_ but also make
frro_iter_ to be nullopt in releaseFabricatedOverlayIterator.

Fixes: 244389702
Test: adb reboot; adb wait-for-device; adb logcat -s idmap2d
Change-Id: Ida1e7e7ae89f12407d26e66ab318a91e4f861df4
2022-08-31 12:50:56 +08:00
Zimuzo Ezeozue
677ab57b7f Merge "Fix ATRACE_TAG redefinition in SysTrace.h" am: 5b999ecd30 am: 9aa4f14985 am: bda05a0a37 am: 0d25702ac3 am: 5d66d97ba3
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2190736

Change-Id: I82612ab6e791b7f31889cf151992fd8c9434378c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-26 16:45:39 +00:00
Zimuzo Ezeozue
5b999ecd30 Merge "Fix ATRACE_TAG redefinition in SysTrace.h" 2022-08-26 08:35:47 +00:00
Zim
cabd966568 Fix ATRACE_TAG redefinition in SysTrace.h
Split SysTrace.h into SysTrace.cpp to avoid defining ATRACE_TAG
in the clients of SysTrace.h

This is in preparation to land aosp/2190022

Test: m
Bug: 161393989
Change-Id: I0ed94c9f66043aa83a59e8042ec9e61ee47db0f2
2022-08-25 14:03:49 +00:00
Jeremy Meyer
77c8a939d6 Add ability to pass in a config string for FRROs
This enables passing them and and storing them in the .frro file but no
further.

Bug: 243066074
Test: Manual
Change-Id: I5c9723e69d175a536f9739619c6b6bf3162a5027
2022-08-24 18:44:14 +00:00
Jeremy Meyer
6587102ec2 Store string frros in a string pool and copy that pool to the idmap
Bug: 232940948
Test: manual with test app and added automated tests
Change-Id: I30f5efefff7cf4fb0869188be78cc08e8efe7f04
2022-08-16 18:13:40 +00:00
Jeremy Meyer
05466592a3 Allow string type when fabricating FRROs
This includes all of the work of passing the string all the way down to
the native code but then does nothing with it. Storing and retrieving of
it will be in follow up changes.

Test: Manual
Bug: 232940948
Change-Id: Ie00cc23680a0132588744991bf829afad6ba336f
2022-06-15 22:46:59 +00:00
Pirama Arumuga Nainar
026c3f0838 Merge "Disable "-readability-duplicate-include" tidy warning in generated file" am: e6c05a8fd7 am: 07888666d2 am: 92d4ec9cd5 am: 3900e2887b
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2019339

Change-Id: I699618c3301ea50aaa0e579cc9b69dcb2c5d301d
2022-03-14 22:16:13 +00:00
Pirama Arumuga Nainar
3900e2887b Merge "Disable "-readability-duplicate-include" tidy warning in generated file" am: e6c05a8fd7 am: 07888666d2 am: 92d4ec9cd5
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2019339

Change-Id: Id5cca221c2e7c80c66d3233020e0900faee230c2
2022-03-14 21:59:01 +00:00
Pirama Arumuga Nainar
8186f296d0 Disable "-readability-duplicate-include" tidy warning in generated file
/buildbot/src/android/master-plus-llvm/out/soong/.intermediates/frameworks/base/cmds/idmap2/libidmap2_protos/android_arm64_armv8-2a_cortex-a55_static/gen/proto/frameworks/base/cmds/idmap2/libidmap2/proto/fabricated_v1.pb.h:34:1: error: duplicate include [readability-duplicate-include,-warnings-as-errors]

Change-Id: I5da44b2714ce8455a4b8af7556decfc1c24c0d11
Test: presubmit
2022-03-10 05:25:35 +00:00
Yi Kong
206bd671be Merge "idmap2: Remove more redundant "using" statements" am: ee8e50ac1f am: a872a08411 am: e676492866 am: 0a1eeefb0d
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1991775

Change-Id: I35885a21d227ba0597e3d16d58c363f124465d97
2022-02-23 20:42:10 +00:00
Yi Kong
0a1eeefb0d Merge "idmap2: Remove more redundant "using" statements" am: ee8e50ac1f am: a872a08411 am: e676492866
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1991775

Change-Id: I2bef74e6be9d76721e6ef5f4e516f7da8dc574ab
2022-02-23 19:05:49 +00:00
Yi Kong
a872a08411 Merge "idmap2: Remove more redundant "using" statements" am: ee8e50ac1f
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1991775

Change-Id: I029e6c4037a86993923a3e204df4fef60a4de2bf
2022-02-23 18:20:44 +00:00
Yi Kong
56f2cf6fa5 idmap2: Remove more redundant "using" statements
Test: presubmit
Bug: 219872355
Change-Id: I74e5b38400060477f9d50b51b1f261ec6a181dd1
2022-02-20 14:36:15 +08:00
Yurii Zubrytskyi
430098a426 Merge "idmap2: Remove redundant "using" statements" am: 871327e261 am: 5e0db6292d am: 22af5f4dd0 am: 279475e4e6
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1990330

Change-Id: I52a9f99eeebc55704453c75c26702dcf6cf4ee7c
2022-02-18 06:18:29 +00:00
Yurii Zubrytskyi
279475e4e6 Merge "idmap2: Remove redundant "using" statements" am: 871327e261 am: 5e0db6292d am: 22af5f4dd0
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1990330

Change-Id: Id60f75ef1d69b8f501e21ce8c1ccd8ff9f8548a6
2022-02-18 05:55:09 +00:00
Yurii Zubrytskyi
5e0db6292d Merge "idmap2: Remove redundant "using" statements" am: 871327e261
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1990330

Change-Id: I362da94b4ee8445aff305872024a4aff55cc9d3d
2022-02-18 05:09:39 +00:00
TreeHugger Robot
088af197e2 Merge "[res] Update resources to c++23" 2022-02-17 21:44:22 +00:00
Yi Kong
b0981d9287 idmap2: Remove redundant "using" statements
They are already under the same namespace.

Test: presubmit
Bug: 219872355
Change-Id: Ie09d529bc9d9f690feb5dba16fe174b89a14ee08
2022-02-17 17:53:42 +00:00
Yurii Zubrytskyi
ba6f8a3cc6 [res] Update resources to c++23
Test: manual
Change-Id: I769e907103cf0dbf1e02b95a78040ebc722c05a9
2022-02-16 17:46:20 -08:00
Yurii Zubrytskyi
280a4cfbc4 [idmap] Add logging for the service start/stop
As of now it's impossible to tell what happened or is happening
to idmap2d - and that's the important thing in the bug. Adding
some logging to help investigating it if it happens again

Bug: 219393586
Test: manual
Change-Id: Ia6615f80d8a4b7ba94714f0af10e09ba9d709bb6
2022-02-16 16:58:30 -08:00
Mårten Kongstad
546e8e9b3f idmap2: fix clang-format warnings
Bug: N/A
Test: frameworks/base/cmds/idmap2/static-checks.sh
Test: atest --host idmap2_tests
Change-Id: I5cd8d512df188371d4b2096246e51effbcbc1a61
2022-02-14 09:29:18 +00:00
Xin Li
10d9972786 Merge sc-qpr1-dev-plus-aosp-without-vendor@7810918
Bug: 205056467
Merged-In: I13199bc39e9445929195f3d15579cbffe94e92b0
Change-Id: I35fa3c6c2abf679c51033f1395a08d511ed8739f
2021-11-18 17:00:37 +00:00
Yurii Zubrytskyi
4c87aec35f Update the resources owner files
Bug: 205633893
Test: n/a

Change-Id: Ib9cf70c9acb200e8019a6522cb6a85f85b760651
2021-11-08 16:25:33 -08:00
Xin Li
c03b0fa033 Merge "Merge Android 12" 2021-10-07 23:50:15 +00:00
Treehugger Robot
75c39b2515 Merge "Allow readability-identifier-length warnings" am: 8cc0f40cf2
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1844656

Change-Id: I947247fecc4195a37d708f74e7efe763d86ab77e
2021-10-07 17:38:54 +00:00
Chih-Hung Hsieh
715a6c427c Allow readability-identifier-length warnings
Many such warnings come from the next clang r437112.

Test: make with new clang r437112.
Change-Id: Ia43848b02ed00d50eb55a5152abcab8bd2178d9e
2021-10-04 16:01:56 -07:00
Colin Cross
8af0caf41d Fix idmap2 compiling against musl
Add missing includes that are not transitively provided when compiling
against musl.

Bug: 190084016
Test: m USE_HOST_MUSL=true
Change-Id: If8829cebb0c62b539d7a336b75cf106755588cdd
Merged-In: If8829cebb0c62b539d7a336b75cf106755588cdd
2021-09-16 19:25:28 +00:00
Colin Cross
9192abcf13 Fix idmap2 compiling against musl
Add missing includes that are not transitively provided when compiling
against musl.

Bug: 190084016
Test: m USE_HOST_MUSL=true
Change-Id: If8829cebb0c62b539d7a336b75cf106755588cdd
2021-09-15 15:08:20 -07:00
Colin Cross
304793a811 Rename ProcResult stdout and stderr fields
stdout and stderr are macros in musl, which causes build failures
when they are used as field names.  Rename the fields to stdout_str
and stderr_str.

Test: builds
Merged-In: I04770d2d6e82ca8393308ab12a304838a80f0ae5
Change-Id: I04770d2d6e82ca8393308ab12a304838a80f0ae5
2021-08-18 23:01:24 +00:00
Colin Cross
faa5e27652 Rename ProcResult stdout and stderr fields
stdout and stderr are macros in musl, which causes build failures
when they are used as field names.  Rename the fields to stdout_str
and stderr_str.

Test: builds
Change-Id: I04770d2d6e82ca8393308ab12a304838a80f0ae5
2021-08-17 15:01:14 -07:00
Chih-hung Hsieh
df6f18e77a Merge "Remove system-headers, minimize unwanted warnings." am: 4e6598eef7 am: 6c423b166c
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1778852

Change-Id: I068d9de923165a4799645c81399309b1c1dcf1d1
2021-08-03 01:35:40 +00:00
Chih-Hung Hsieh
69df09d4d0 Remove system-headers, minimize unwanted warnings.
* If necessary, use --header-filter to select warnings
  in owned header files for each module.

Change-Id: I5a2a52a4f78661b60a8375fbcc46bd5bad92ae60
Test: make with WITH_TIDY=1
2021-07-27 11:49:11 -07:00
TreeHugger Robot
fbb8676b2b Merge "Use binder-based iterator to retrieve FRROs" into sc-dev am: 5be998a660
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15302837

Change-Id: If9c7c5521ee2844ff8049e3bbd95461af406a9fa
2021-07-19 22:07:49 +00:00
Ryan Mitchell
b887f68ad1 Use binder-based iterator to retrieve FRROs
If for some reason there are a lot of fabricated overlays in the
resources cache, the binder limit of the list of fabricated overlay
infos could exceed the maximum binder transaction size. Rather than
return all of the frro infos in one transactions, register an iterator
with the native idmap2d service and use multiple binder transactions
to iterate through all of the frros.

Bug: 192948522
Test: Toggle device theme colors several times and observe frro cache
      Reboot device and observe old frros are deleted
Change-Id: I5e9cf3ae9d1d45eda683c24141a0cd4e4301e02f
2021-07-19 16:53:27 +00:00
Yabin Cui
c0e80b3048 Merge "idmap2: fix for compiler update." am: 0cb190e889 am: 951a22e80e
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1768613

Change-Id: I6a43049b33454a9fe615325d7812935de6eaea41
2021-07-16 22:15:48 +00:00
Yabin Cui
5fa57f6afc idmap2: fix for compiler update.
Suppress below errors:

include/idmap2/Idmap.h:126:12: error: avoid repeating the return type
from the declaration; use a braced initializer list instead
[modernize-return-braced-init-list,-warnings-as-errors]
    return StringPiece(target_path_);
           ^~~~~~~~~~~~            ~
           {                       }

gen/aidl/android/os/BnIdmap2.h:6:1: error: nested namespaces can be concatenated
[modernize-concat-nested-namespaces,-warnings-as-errors]
namespace android {
^~~~~~~~~~~~~~~~~~~
namespace android::os

Bug: 193712493
Test: build with the next compiler
Change-Id: I14297355dd92c2bbf4bd24da95cfa868b427739e
2021-07-15 14:03:24 -07:00
Ryan Mitchell
dc628e77a1 Merge changes I6da18cdb,I9de6ba64,I1af88c6d,I154783ff into sc-dev
* changes:
  idmap2: fix cpplint warnings
  OMS: include idmap data in dump
  idmap2: create in-memory FRRO before creating file
  OMS: update shell command --help
2021-06-03 15:02:22 +00:00
Mårten Kongstad
1195a6bd46 idmap2: fix cpplint warnings
Bug: 189963636
Test: frameworks/base/cmds/idmap2/static-checks.sh
Change-Id: I6da18cdbbd2fc33db711696445230a9f316dc143
2021-06-02 21:55:28 +00:00