7381 Commits

Author SHA1 Message Date
TreeHugger Robot
8d845b02c9 Merge "Optimize FilterApkAssets by caching config" 2021-01-14 07:20:17 +00:00
Ryan Mitchell
14e8ade9a9 Optimize FilterApkAssets by caching config
ResTable_config of every ResTable_type is read from device every time
AssetManager::RebuildFilterList is invoked. For large APKs (like
framework-res.apk), this causes a large number of page faults
when accessing the config from disk. The configs are also used in the
slow path of AssetManager::FindEntryInternal, which makes it even
slower. Instead cache the config on the TypeSpec of its ApkAsset.

Bug: 177247024
Test: libandroidfw_tests
Change-Id: I66d507c4eeb2399f7558f3d9dfc53c157129ada0
2021-01-13 21:14:31 -08:00
Mat Bevilacqua
723784a055 Add state residency logging to power stats
Test: atest FrameworksServicesTests:PowerStatsServiceTest
Bug: 175724197

Change-Id: I4ba7af3b9a895ecdc9f8c16cd371e5582458d212
2021-01-08 18:06:02 -08:00
Mat Bevilacqua
0d0dde6544 Change OWNERS for powerstats tests/tools
Bug: 176431677
Test: m
Change-Id: If14bdbd5557c5e428668419f0dae177a1e125310
2020-12-28 10:44:42 -08:00
Bernie Innocenti
fbc9afb084 Add explicit Result::ok() where missing
This is part of a large-scale cleanup to remove operator bool() from
android::base::expected. For more details, see aosp/1533001.

Bug: 176148206
Test: m checkbuild continuous_instrumentation_tests continuous_instrumentation_tests_api_coverage continuous_native_tests device-tests platform_tests
Exempt-From-Owner-Approval: mechanical large-scale change
Change-Id: Ie8cf279c20c9284ad6476280e80dc25545f833de
2020-12-22 20:15:12 +09:00
Bernie Innocenti
fbb7fe0da3 Merge "Add explicit Result::ok() checks where needed" am: c08d3ef8a8 am: ae613dd6c4 am: f454301ae6
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1532909

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I22f3e4f97d523bd09b898ebdf4de18114cb4c34f
2020-12-22 07:02:53 +00:00
Bernie Innocenti
58cf8e3ffa Add explicit Result::ok() checks where needed
Test: m checkbuild continuous_instrumentation_tests continuous_instrumentation_tests_api_coverage continuous_native_tests device-tests platform_tests
Exempt-From-Owner-Approval: mechanical mass refactoring
Change-Id: I3117833c51cdb333cccdfd159d1582f2adef77db
2020-12-21 15:50:57 +00:00
Baligh Uddin
cfea49246b Migrate to frameworks/proto_logging/stats
BUG: 175318992
Test: TH
Merged-In: Id85494f7f40a0201061e74fbf3f08f70a632a62c
Change-Id: I8bee7a0a6acecc1274d5acc0adb44c5dde8862e4
2020-12-15 15:05:53 +00:00
Baligh Uddin
7cb30de800 Merge "Migrate to frameworks/proto_logging/stats" 2020-12-15 06:29:11 +00:00
Treehugger Robot
4af7c21be5 Merge "Add resources owners to core/jni and split-select" am: 2991744d47 am: 578171d320 am: 550156c202
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1527770

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Idc1ed6c2245fe72e73b7aa046bf35d1e419bd2d1
2020-12-14 21:50:18 +00:00
Ryan Mitchell
314863c132 Merge changes from topic "inc-hard-am"
* changes:
  Revert^2 "Cache resolved theme values"
  Set resource id correctly when resolve fails
  Revert^2 "libandroidfw hardening for IncFs"
  idmap2: remove call to obsolete 'idmap2 verify' from valgrind.sh
  idmap2: remove the 'scan' command
2020-12-14 20:42:03 +00:00
Ryan Mitchell
e147d00c9e Add resources owners to core/jni and split-select
Adds the owners of the resources sub-system to own resources related
classes in core/jni and the split-select tool previously owned by
adamlesinski@.

Bug: none
Test: none
Change-Id: I0117b0ccb258fb0b9a3e075dfd81c0351abecd3a
2020-12-14 11:07:19 -08:00
Baligh Uddin
ff6457f822 Migrate to frameworks/proto_logging/stats
BUG: 175318992
Test: TH
Merged-In: Ia6463c8f6a801cd9db54afa30df0aa3f16b09891
Change-Id: I81324b83802dc2b06081600282bb73491f29473b
Exempt-From-Owner-Approval: cleanup CL
2020-12-12 17:42:07 +00:00
Jeff Sharkey
0ab7007631 resolve merge conflicts of 358f0d4fc8c248498cf113c41e043877a14e89a1 to master
Bug: 174932174
Test: I solemnly swear I tested this conflict resolution.
Exempt-From-Owner-Approval: refactoring with team leads buy-in
Change-Id: I9262a08ffc1ccede8e519d0eed90ed2bfcf0232c
2020-12-08 11:01:05 -07:00
Ryan Mitchell
80094e39f9 Revert^2 "libandroidfw hardening for IncFs"
55ef6167a2c235bd88c7216238b2001b46795b79

Change-Id: I02d4890d181655dfd0a14c188468db512559d27b
Merged-In: I02d4890d181655dfd0a14c188468db512559d27b
2020-12-08 16:58:12 +00:00
Jeff Sharkey
52b9862f87 Improve OWNERS coverage across frameworks/base/.
As general background, OWNERS files expedite code reviews by helping
code authors quickly find relevant reviewers, and they also ensure
that stakeholders are involved in code changes in their areas.

Some teams under frameworks/base/ have been using OWNERS files
successfully for many years, and we're ready to expand them to cover
more areas.  Here's the historical coverage statistics for the last
two years of changes before these new OWNERS changes land:

-- 56% of changes are fully covered by OWNERS
-- 17% of changes are partially covered by OWNERS
-- 25% of changes have no OWNERS coverage

Working closely with team leads, we've now identified clear OWNERS on
a per-package basis, and we're using "include" directives whenever
possible to to simplify future maintenance.  With this extensive
effort, we've now improved our coverage as follows:

-- 98% of changes are fully covered by OWNERS
-- 1% of changes are partially covered by OWNERS
-- 1% of changes have no OWNERS coverage

This specific change is automatically generated by a script that
identifies relevant "include" directives.

Bug: 174932174
Test: manual
Exempt-From-Owner-Approval: refactoring with team leads buy-in
Merged-In: I3480ddf2fe7ba3dfb922b459d4da01fa17a2c813
Change-Id: I3480ddf2fe7ba3dfb922b459d4da01fa17a2c813
2020-12-08 08:36:28 -07:00
Jeff Sharkey
fab0ab3c9c Improve OWNERS coverage across frameworks/base/.
As general background, OWNERS files expedite code reviews by helping
code authors quickly find relevant reviewers, and they also ensure
that stakeholders are involved in code changes in their areas.

Some teams under frameworks/base/ have been using OWNERS files
successfully for many years, and we're ready to expand them to cover
more areas.  Here's the historical coverage statistics for the last
two years of changes before these new OWNERS changes land:

-- 56% of changes are fully covered by OWNERS
-- 17% of changes are partially covered by OWNERS
-- 25% of changes have no OWNERS coverage

Working closely with team leads, we've now identified clear OWNERS on
a per-package basis, and we're using "include" directives whenever
possible to to simplify future maintenance.  With this extensive
effort, we've now improved our coverage as follows:

-- 98% of changes are fully covered by OWNERS
-- 1% of changes are partially covered by OWNERS
-- 1% of changes have no OWNERS coverage

This specific change is automatically generated by a script from
detailed ownership information confirmed by team leads.

Bug: 174932174
Test: manual
Exempt-From-Owner-Approval: refactoring with team leads buy-in
Merged-In: I9789c97c1de8e5d962b48c29c57d82fe83729eba
Change-Id: I9789c97c1de8e5d962b48c29c57d82fe83729eba
2020-12-08 08:36:27 -07:00
Rhed Jao
28ed7b9c1e Merge "aapt2: Add a new flag '--revision-code'" 2020-12-02 03:58:32 +00:00
Eugene Susla
ed4d8e5f36 Fix genHiddenBuilder generating an invalid buildUpon() method
This removes a redundant check causing the method to be generated

Test: . frameworks/base/tests/Codegen/runTest.sh
Change-Id: Ibe7ee110f7b21875d2f7f6784deca66638bab6c4
2020-11-30 17:01:39 -08:00
Rhed Jao
b9ccb8a49b aapt2: Add a new flag '--revision-code'
A new flag to inject revisionCode into the manifest for cts splits tests.

Bug: 174338944
Test: atest aapt2_tests
Change-Id: If5a089f37233f53af3012ca5eab17fab21eafd9c
2020-11-30 21:48:34 +08:00
Ioana Stefan
4e5e87cc74 Update comment for generating IntDefs mapping
This change updates the IntDefs processor intructions for how to
generate the IntDefs mapping files.

Test: N/A
Change-Id: I974636d1ed658e0d44ad2c50f738eff1c80127d9
2020-11-30 12:00:08 +00:00
Jeffrey Huang
05e50cc991 Revert^2 "Delete atoms.proto from statsd"
e8552cd24a5ba2f894ba99ca5db1135ceb342b81

Change-Id: I202a31ab654ca31ba9e5b73b23c5aa3d22a3e8b2
Merged-In: I81a8287ed5b055e7b6547794d01e7ac897f0f022
2020-11-24 22:47:44 +00:00
Jeffrey Huang
91224ea837 Revert^2 "Delete atoms.proto from statsd"
217301c36f7ffd500441cb879a4fa88b770092db

Change-Id: I81a8287ed5b055e7b6547794d01e7ac897f0f022
2020-11-24 22:28:38 +00:00
Jeffrey Huang
e8552cd24a Revert "Delete atoms.proto from statsd"
Revert "Add android bp to proto_logging"

Revert submission 1508746-delete_atoms

Reason for revert: Build Failure
Reverted Changes:
I184cf8bf8:Add android bp to proto_logging
I36ec354d2:Delete atoms.proto from statsd

Change-Id: Ifec6a57d66cbd9c37503ca47847c3ae492f3d343
2020-11-24 21:53:20 +00:00
Alex Light
217301c36f Revert "Delete atoms.proto from statsd"
Revert "Add android bp to proto_logging"

Revert submission 13070789-atomsproto

Reason for revert: Breaks multiple git_master-without-vendor targets

```
out/soong/.bootstrap/bin/soong_build -t -l out/.module_paths/Android.bp.list -b out/soong -n out -d out/soong/build.ninja.d -globFile out/soong/.bootstrap/build-globs.ninja -o out/soong/build.ninja Android.bp
error: frameworks/base/tools/stats_log_api_gen/Android.bp:49:1: "stats-log-api-gen-test" depends on undefined module "libstats_proto_host"
ninja: build stopped: subcommand failed.
```

Reverted Changes:
I184cf8bf8:Add android bp to proto_logging
I36ec354d2:Delete atoms.proto from statsd

Bug: 167962588

Change-Id: Idce97c5cf020473744eb7f96dcfbdc7677c094da
2020-11-24 21:25:39 +00:00
Jeffrey Huang
5d230a2d49 Delete atoms.proto from statsd
Use the atoms.proto in proto_logging as the source of truth. Also
migrates statsd log api gen to use the new atoms.proto

Bug: 167962588
Test: m -j && m CtsStatsdAtomHostTestCases

Change-Id: I36ec354d273dceace5245d7634c68ac63dc5a8cd
Merged-In: I36ec354d273dceace5245d7634c68ac63dc5a8cd
2020-11-24 10:57:06 -08:00
Jeffrey Huang
4e671568fe Delete atoms.proto from statsd
Use the atoms.proto in proto_logging as the source of truth. Also
migrates statsd log api gen to use the new atoms.proto

Bug: 167962588
Test: m -j && m CtsStatsdAtomHostTestCases

Change-Id: I36ec354d273dceace5245d7634c68ac63dc5a8cd
2020-11-23 23:47:38 -08:00
Eugene Susla
a74ecc3709 Merge "Fix genHiddenConstructor missing @hide" 2020-11-24 01:56:46 +00:00
Eugene Susla
8b886c6f9c Fix genHiddenConstructor missing @hide
Test: run on AppOpsManager, ensure ctr hidden
Change-Id: I691628d04664b5d9e871fdeadb32455bfda8b158
2020-11-23 16:03:11 -08:00
Yury Khmel
257ac460fa Merge "Fix presubmit for hidden api." 2020-11-23 22:02:41 +00:00
Rhed Jao
61bcee0cd1 Merge "aapt2: Limit length of package name and shared user id" 2020-11-20 02:18:53 +00:00
Yury Khmel
e6a5253f12 Fix presubmit for hidden api.
grep returns 1 for if nothing was found. This fails presubmit hook due
to bash handling "set -e" Looks like grep not found is valid case.
This fixes this issue by bypassing grep exit code.

Test: Locally
Bug: 161351699
Change-Id: I39e926a348a0fb8f4040f86034affdb4204faac5
2020-11-19 17:51:36 +00:00
Rhed Jao
2c4344223d aapt2: Limit length of package name and shared user id
Package name and shared user id could be used as part of filename
as prefix by other modules. Limits the length to 223 and reserves
32 for the OS.

Bug: 118768971
Test: atest aapt2_tests
Test: aapt2 link -I android.jar --manifest ManifestLongPackageName.xml
Test: aapt2 link -I android.jar --manifest ManifestLongSharedUserId.xml
Change-Id: Ic4b5b4647b9e253b79b663f4d7a9050f43bb8cf0
2020-11-19 15:34:14 +08:00
TreeHugger Robot
c7b60a8835 Merge changes Ib1db7caf,Icb295186,Iad1760c0,I02d4890d
* changes:
  Revert^2 "Do not cache bag parent stack until requested"
  Revert^2 "Cache resolved theme values"
  Set resource id correctly when resolve fails
  Revert^2 "libandroidfw hardening for IncFs"
2020-11-18 04:40:28 +00:00
Ryan Mitchell
db21f09a8e Revert^2 "libandroidfw hardening for IncFs"
55ef6167a2c235bd88c7216238b2001b46795b79

Change-Id: I02d4890d181655dfd0a14c188468db512559d27b
2020-11-17 23:01:35 +00:00
Todd Kennedy
ce3e129498 Handle new manifest tag <property>
Bug: 169258655
Test: aapt2_tests
Change-Id: Ia1c8e7c38fb882c3ce0aa2913b844cccdc5b8749
2020-11-17 11:59:07 -08:00
Ryan Mitchell
0b27d157dd Merge "Fix DominatorTree for locale and mcc/mnc config" am: 8f2f4e14de am: caff40cad3 am: c9acec6545 am: 518d35c017
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1481918

Change-Id: I78ffd81962fdfba38c46590e8b6ae76c582ab77b
2020-11-15 23:05:18 +00:00
Ryan Mitchell
8f2f4e14de Merge "Fix DominatorTree for locale and mcc/mnc config" 2020-11-15 21:41:24 +00:00
Tej Singh
18a3a6644d Merge changes from topic "revert-12787270-FYIHXORGZY"
* changes:
  Revert "libandroidfw hardening for IncFs"
  Revert "Cache resolved theme values"
  Revert "Do not cache bag parent stack until requested"
2020-11-14 03:22:09 +00:00
Ryan Mitchell
55ef6167a2 Revert "libandroidfw hardening for IncFs"
Revert "Move map_ptr to incfs namspace"

Revert submission 12787270

Reason for revert: b/173250495
Reverted Changes:
I5cd1bc8a2:libandroidfw hardening for IncFs
Ice5dbcfb2:Move map_ptr to incfs namspace
I29ccdc8ed:Do not cache bag parent stack until requested
I1e9e9acaa:Cache resolved theme values

Change-Id: Ib90ef68339710086df41e9abe0833a542d03a74f
2020-11-13 23:55:20 +00:00
Ryan Mitchell
c234812e27 Merge changes from topic "libaw-hardening"
* changes:
  Do not cache bag parent stack until requested
  Cache resolved theme values
  libandroidfw hardening for IncFs
2020-11-13 00:05:40 +00:00
Ryan Mitchell
c75c2e0922 libandroidfw hardening for IncFs
Migrate libandroifw to using incfs::util::map_ptr to prevent processes
from crashing when parsing the resources.arsc, parsing compiled xml,
files, and retrieving resource values.

This change propagates incremental failures to the JNI level where they
are raised as ResourcesNotFoundException.

Performance of ResourcesPerfWorkloads without change (time in
nanoseconds):
[1/3] com.android.resources.perf.PerfTest#youtube: PASSED (11.883s)
    youtube_ns_median: 93812805
    youtube_ns_standardDeviation: 4387062
    youtube_ns_mean: 94455597
[2/3] com.android.resources.perf.PerfTest#maps: PASSED (11.265s)
    maps_ns_standardDeviation: 2997543
    maps_ns_mean: 83480371
    maps_ns_median: 82210941
[3/3] com.android.resources.perf.PerfTest#gmail: PASSED (24.963s)
    gmail_ns_median: 266141091
    gmail_ns_standardDeviation: 3492043
    gmail_ns_mean: 267472765

With change and verification forcibly enabled for all apks
(including the framework-res.apk):
[1/3] com.android.resources.perf.PerfTest#youtube: PASSED (11.646s)
    youtube_ns_median: 101999396
    youtube_ns_standardDeviation: 4625782
    youtube_ns_mean: 102631770
[2/3] com.android.resources.perf.PerfTest#maps: PASSED (11.286s)
    maps_ns_standardDeviation: 2692088
    maps_ns_mean: 91326538
    maps_ns_median: 90519884
[3/3] com.android.resources.perf.PerfTest#gmail: PASSED (24.694s)
    gmail_ns_median: 290284442
    gmail_ns_standardDeviation: 5764632
    gmail_ns_mean: 291660464

With change and verification disabled:
[1/3] com.android.resources.perf.PerfTest#youtube: PASSED (11.748s)
    youtube_ns_median: 95490747
    youtube_ns_standardDeviation: 7282249
    youtube_ns_mean: 98442515
[2/3] com.android.resources.perf.PerfTest#maps: PASSED (10.862s)
    maps_ns_standardDeviation: 4484213
    maps_ns_mean: 87912988
    maps_ns_median: 86325549
[3/3] com.android.resources.perf.PerfTest#gmail: PASSED (24.034s)
    gmail_ns_median: 282175838
    gmail_ns_standardDeviation: 6560876
    gmail_ns_mean: 282869146

These tests were done on a Pixel 3 and with cpu settings configured by
libs/hwui/tests/scripts/prep_generic.sh:

 Locked CPUs 4,5,6,7 to 1459200 / 2803200 KHz
 Disabled CPUs 0,1,2,3

Bug: 160635104
Bug: 169423204
Test: boot device && atest ResourcesPerfWorkloads

Change-Id: I5cd1bc8a2257bffaba6ca4a1c96f4e6640106866
2020-11-12 08:13:44 -08:00
Ryan Mitchell
527ebbaa55 Fix DominatorTree for locale and mcc/mnc config
De-duping of configurations with locales was disabled previously since
there is not a good way to dedupe locales in a forwards compatible way
(change SHA: e38567480be67ac83a8f8f090704bb0d49e2eed2).

In b/171892595, since every locale is a root in the dominator tree,
configs that do not specify locale qualifiers are dominated by the
default config and their values are checked for compatiblity with the
locale config values.

b/171892595 took a while to detect because, this is only an issue at
runtime when a resource has one config containing mnc/mcc without a
locale, one config containing a locale, and the values for the configs
differ. This is because mcc/mnc is the only qualifier with a greater
precedence than locale.

Make configurations with mcc/mnc and mcc unable to be dominated until
locale deduping is fixed.

Bug: 171892595
Bug: 62409213
Test: aapt2-tests
Change-Id: Ia0a5e5d7a1650d070f5f2fcaf9a8469a8c7dabe6
2020-11-11 17:02:57 +00:00
Steven Moreland
bf75ccdb36 Merge "libstatslog: disable on darwin" am: 2f76449ef7 am: 090ca078f3 am: 8140a06a28 am: f0041a9534
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1488537

Change-Id: I8a49b94974f355321d483a76e4a9bb684344538f
2020-11-05 21:44:48 +00:00
TreeHugger Robot
e5975c10ee Merge "Convert validatekeymaps to enum class" 2020-11-05 16:26:38 +00:00
Steven Moreland
51f0cb67c1 libstatslog: disable on darwin
libbinder doesn't support mac.

Bug: 172023026
Test: N/A
Change-Id: Idc484994e7cf5125736ddd7f5c98165ee9f01e67
2020-11-05 16:12:03 +00:00
Eugene Susla
3f1e82b12c Merge "Disregard annotation params for stale dataclass detection" 2020-11-04 23:57:15 +00:00
Eugene Susla
ddb2681455 Disregard annotation params for stale dataclass detection
Annotation processor seens annotation args with constants already inlined,
making it challenging to compare to the souce-generated metadata that contains
initial expressions.

For now just ignoring args for all non-DataClass annotations to prevent false positives

Test: . frameworks/base/tests/Codegen/runTest.sh
Exempt-From-Owner-Approval: changing metadata on multiple files
Change-Id: I640816ae0f20f36b1b828bc2161f53788c4a4dae
2020-11-04 12:40:58 -08:00
TreeHugger Robot
2456ebbb04 Merge "Convert KeyCharacterMap to enum class" 2020-11-04 19:18:54 +00:00
Michael Wright
781b1294fa Convert validatekeymaps to enum class
Test: compiles
Bug: 160010896
Change-Id: I4e582a442a267c2a35bea7a5d4fc7e080d281ecf
2020-11-04 05:22:44 +00:00