6136 Commits

Author SHA1 Message Date
Mathew Inwood
bad89e5e5b Processor for @UnsupportedAppUsage annotations.
The processor outputs unsupportedappusage_index.csv, containing source
position info for every@UnsupportedAppUsage annotation processed. It is a
mapping of dex signature to the source postion of the annotation on that
signature. It is used as input for scripts which update the annotations.

We include a META-INF file which causes the compiler to automatically
pick up the annotation processor. Otherwise we would need to explicitly
specify the processor with a -processor flag to javac.

We create a new build target for just the @UnsupportedAppUsage annotation
and the @IntDef annotation (which it depends on) so that the processor can
also depend on that directly.

The processor only runs on a new build target framework-annotation-proc
so that it is not invoked as part of a regular build. This is done so
that we don't slow down peoples builds: Soong does not support annotation
processors when javac sharding is in use. This workaround can be removed
once b/77284273 is fixed.

Test: m framework-annotation-proc
Bug: 113853502

Change-Id: Ie9cd5a90ddf7a51f6035e849703fc39ad9127557
2018-09-05 15:01:21 +01:00
David Brazdil
8503b9045b Rewrite hidden API list generation in Python
Generating hidden API lists has grown in complexity and the original
Makefile rule has become a bottleneck for build times. Rewrite the
logic in Python.

Bug: 113278235
Bug: 73736106
Test: frameworks/base/tools/hiddenapi/generate_hiddenapi_lists_test.py
Change-Id: I63f03133d70260d06c55f482b844a4980dc6f734
2018-08-30 16:19:26 +01:00
Dan Willemsen
5d12935f35 Convert aapt to Soong
See build/soong/README.md for more information.

Test: cd frameworks/base/tools/aapt; mma
Test: aapt version
Change-Id: Ice97e9b32c53cfed30d68acd5717d8c66712df4c
2018-08-29 17:24:18 -07:00
Todd Kennedy
895e19edf0 dump package name
Test: aapt2 dump packagename foo.apk bar.apk
Bug: 113105112
Change-Id: Ibea429adc3a2a890be10548824583addc59ad42d
Merged-In: Ibea429adc3a2a890be10548824583addc59ad42d
2018-08-24 19:29:22 +00:00
Treehugger Robot
c07d4e7118 Merge "Mark symbols as dynamic for shared libraries" 2018-08-20 21:31:28 +00:00
Alex Light
159799d7c9 Work around b/70221552
If one sets a sufficiently long OUT_DIR to build into the
//frameworks/base:framework-javastream-protos generate target will
fail due to trying to run a too-long command. This works around that
problem by making the command being run much smaller.

Test: Build
Bug: 70221552
Change-Id: I0134ccfc83469826d3ea8679e1c52b9b52c6d2e0
2018-08-08 09:52:51 -07:00
Mathew Inwood
1397d297f0 Merge "Remove class2greylist from frameworks/base."
am: 32979f03fe

Change-Id: I72f8797be98fe75806535da7b9f277ae68db8d57
2018-07-26 11:55:02 -07:00
Mathew Inwood
f364aedecb Remove class2greylist from frameworks/base.
It's moving to a new home under art/tools, since it is needed by
branches which don't include frameworks/base.

Bug: 110868826
Test: Build master-art branch
Change-Id: Ice8324db52ae1e7e2ac6734e45874a66de935c9a
2018-07-26 15:57:05 +01:00
Mathew Inwood
7393f85a6e Merge "Update annotation name in class2greylist."
am: 6c32f5d18e

Change-Id: I1a1f79a7a95814e37d337f1bb6bd10aa545cfaf9
2018-07-25 04:54:37 -07:00
Mathew Inwood
738a23fbeb Update annotation name in class2greylist.
Annotation was added with name @UnsupportedAppUsage after Android API
council discussion.

Bug: 110868826
Test: m class2greylist
Change-Id: I63ad61e97c5e8fdebfcead9e4ee5b060a60f97c7
2018-07-25 09:45:04 +01:00
Todd Kennedy
196dbc379b Mark symbols as dynamic for shared libraries
Bug: 111425000
Change-Id: Ic1a68ac90d5e0443a536ee9ce75a72bc370cd673
Test: build, install and run the shared library test application
2018-07-24 21:55:12 +00:00
Mathew Inwood
812291cc46 Merge "Add new "class2greylist" tool."
am: 7f0aa734a3

Change-Id: I7d53d60ea3537530a9e21e2de2f53eb764f7d0b5
2018-07-23 10:08:47 -07:00
Mathew Inwood
6395690ec9 Add new "class2greylist" tool.
This extracts signatures of methods that have the @UsedByApps annotation
for generating the greylist. It will be integrated into the build to
replace many members on greylist.txt.

Test: $ atest class2greylisttest
Bug: 110868826
Change-Id: Ifaf5859b60076c051de6be5a912ef70734330ce7
2018-07-23 14:39:19 +01:00
Colin Cross
ff311dd893 Fix ManifestMerger issues
Set LOCAL_MIN_SDK_VERSION in aapt2 integration test libraries so that
the build system doesn't raise the minSdkVersion value specified in
the manifest, which causes ManifestMerger to error when trying to
merge it into a package that specifies a lower minSdkVersion.

Bug: 78447299
Test: m java
Change-Id: If5d4f97bb2d8a503bd3c20f2ea8aea2519c51e85
2018-06-15 23:03:46 +00:00
Yao Chen
39c8fe12e4 Merge "Disable statsd and make StatsLog no-op if ro.statsd.enable=false" into pi-dev
am: 38b92986df

Change-Id: Ia90bed14900a2c944165aefe00661d3979c08aed
2018-06-07 14:53:43 -07:00
Yao Chen
38b92986df Merge "Disable statsd and make StatsLog no-op if ro.statsd.enable=false" into pi-dev 2018-06-07 21:10:16 +00:00
Yao Chen
cf3829a696 Disable statsd and make StatsLog no-op if ro.statsd.enable=false
Bug: 79324611
Test: manually tested on marlin_svelte
Change-Id: Ic7fbf86d7c295cb6b2f20e7f9a957d1ed74c42c0
2018-06-06 17:25:08 -07:00
George Burgess IV
02bf04ac01 Merge "Fix a 'memory leak'" am: 38e7338d92
am: bc49cb8460

Change-Id: I3ecf0ecdf20bb61bda76fff547f920040ded47d6
2018-06-05 19:56:22 -07:00
Treehugger Robot
38e7338d92 Merge "Fix a 'memory leak'" 2018-06-05 23:29:10 +00:00
Bookatz
0bd972083a Wean statsd off batterystats: workchain (cp)
Modified cherry pick from master:
(cherry picked from commit d888df2ba99e117b50a5553e18426ad370294a20)
covering ag/4210168 and ag/4230692.

The tool that generates StatsLogInternal.java now includes the following
type of code, to accomodate WorkSources automatically.

    public static void write(int code, WorkSource ws, int arg2) {
        for (int i = 0; i < ws.size(); ++i) {
            write_non_chained(code, ws.get(i), ws.getName(i), arg2);
        }
        ArrayList<WorkSource.WorkChain> workChains = ws.getWorkChains();
        if (workChains != null) {
            for (WorkSource.WorkChain wc : workChains) {
                write(code, wc.getUids(), wc.getTags(), arg2);
            }
        }
    }

This will reduce a lot of code repitition for the StatsLog.write calls
in BatteryStats. Consequently, doing so will make it easier to remove
these StatsLog.write calls out of BatteryStats.

Bug: 80308558
Bug: 80314737
Test: manual verification
Test: com.android.internal.os.BatteryStatsTests
Change-Id: Ied537a6195121f16ef49b6bccf58c8c31964909c
Merged-In: Ibd28297345f4ab926dec01a89de0f1bfff9f8871
2018-06-05 19:46:23 +00:00
Colin Cross
da02feaca2 Add support for --replace-version to aapt2
Implement --replace-version to match aapt1.

Bug: 79755007
Test: aapt2_tests
Change-Id: Iee2bd9a3981c7d4681509f18b735c6e9e6c1a336
Merged-In: Iee2bd9a3981c7d4681509f18b735c6e9e6c1a336
(cherry picked from commit dcd58c420771af75c625242985bd96ba828aca56)
2018-05-30 23:25:21 +00:00
Colin Cross
f7ae76d845 Add support for --replace-version to aapt2
Implement --replace-version to match aapt1.

Bug: 79755007
Test: aapt2_tests
Change-Id: Iee2bd9a3981c7d4681509f18b735c6e9e6c1a336
Merged-In: Iee2bd9a3981c7d4681509f18b735c6e9e6c1a336
(cherry picked from commit dcd58c420771af75c625242985bd96ba828aca56)
2018-05-30 15:40:06 -07:00
Izabela Orlowska
533c09b01b AAPT2: treat manifest validation errors as warnings when asked
Bug: 65670329
Test: updated
Change-Id: Ic554cc20134fce66aa9ddf8d16ddffe0131c50e9
Merged-In: Ic554cc20134fce66aa9ddf8d16ddffe0131c50e9
(cherry picked from commit ad9e1324ff2c459d0ee6ee571d4a3e458c02cc81)
2018-05-21 19:51:50 +00:00
Adam Lesinski
b2b20f26db AAPT2: Better error messages for ManifestFixer
AAPT2 will now print the XML hierarchy where it found an unexpected
element.

Test: make aapt2_tests
Change-Id: Iac7918b2f344fab874f0a3e7aa9c6936ecde8913
Merged-In: Iac7918b2f344fab874f0a3e7aa9c6936ecde8913
(cherry picked from commit ed37f4842ad838792b16bf19768ed9b2519b0194)
2018-05-21 19:51:42 +00:00
Adam Lesinski
ef506c73bb AAPT2: Differentiate between Android and Java package names
Android package names are more strict (ASCII only) than Java package names.
Also fixed an issue where trailing underscores were disallowed in Android
package names.

(cherry picked from commit 96ea08f1e737e0d19e274e9a29f71c387d81b09a)

Also includes part of I357fb84941bfbb3892a8c46feb47f55b865b6649 to remove
usage of FindNonAlphaNumericAndNotInSet.

Bug: 79481102
Test: make aapt2_tests
Change-Id: I1052e9e82b6617db6065ce448d9bf7972bb68d59
Merged-In: I1052e9e82b6617db6065ce448d9bf7972bb68d59
2018-05-21 19:48:36 +00:00
Adam Lesinski
89794158a1 Change ownership of AAPT2 and libandroidfw
toddke@ is now the new owner of these projects.

Exempt-From-Owner-Approval: setting new owners
Test: none
Change-Id: Ie92b020e0ba063f48ce8a76ebaef768fe0d554f1
Merged-In: Ie92b020e0ba063f48ce8a76ebaef768fe0d554f1
(cherry picked from commit a95e841846c3add37cab0ca228e1e1a4eb0a1455)
2018-05-17 22:13:11 -07:00
Seigo Nonaka
df8ed7a446 Merge "Update font chain linter to match latest font file" into pi-dev
am: 31c4a48267

Change-Id: Ia5f7799fcb43b59adfc672a9d7af0f6a8c583f09
2018-05-16 15:38:26 -07:00
TreeHugger Robot
31c4a48267 Merge "Update font chain linter to match latest font file" into pi-dev 2018-05-16 22:11:17 +00:00
George Burgess IV
9fb8177ca5 Fix a 'memory leak'
Realistically, this memory will be reclaimed by the OS when we return
here. Regardless, we do a similar cleanup above if an exec() function
fails, and having the free here makes our tooling slightly happier.

Complained about by the static analyzer

Bug: None
Test: Ran the analyzer. It no longer complains about this leak.
Change-Id: Ia7107c585cc38fef8bd7c59d85ff896b04e93658
2018-05-15 18:03:00 -07:00
Yi Jin
6ef148ce5c Merge "The argument type is bool, the current bug passes a "true" or "false" string." into pi-dev
am: 0a3815958a

Change-Id: Iadf8a52e65ba7930f419eacbaac9816992715506
2018-05-15 11:27:13 -07:00
Seigo Nonaka
c18086310b Update font chain linter to match latest font file
- FAMILY emoji now has own gender neutral emoji
- Some flags are newly supported
- Some regions may have the same flags.

Bug: 77148691
Test: m fontchain_lint
Change-Id: If1a69974230f025d35503eb49bea105923593e87
2018-05-15 16:09:48 +00:00
Yi Jin
480a956521 The argument type is bool, the current bug passes a "true" or "false"
string.

Bug: 79710844
Test: atest incidentd_test
Change-Id: I66fc086e4a194e68638311ccdc305a495ecf8da4
2018-05-14 18:04:29 -07:00
Pirama Arumuga Nainar
ea5cf9f31c Merge "For Win32, don't cast ssize_t while printing" am: aaf8d7aa2e
am: 466ada94fe

Change-Id: I39b73406a41ecc5396c39648f8e05e8a88e7aaee
2018-05-14 11:22:57 -07:00
Pirama Arumuga Nainar
dc36bb6dea For Win32, don't cast ssize_t while printing
Bug: http://b/69933068

This is a partial revert of
https://android-review.googlesource.com/c/platform/frameworks/base/+/109433
so we can use Clang for windows cross compilation.

Clang does not allow a cast to 'signed size_t' and both Clang and
current MinGW accept a ssize_t to the '%zd' format specifier.

Test: m native-host, m native-host-cross with both MinGW and Clang
Change-Id: I5366622b91be1433f6c533c55a9ae429b57c7a27
2018-05-11 23:22:10 +00:00
Ryan Mitchell
78e0e6aa2e Merge "AAPT2: Insert platformBuild information" into pi-dev
am: 91d2f87d0e

Change-Id: Ifa673f17cb3ee1ecb146aaafab7c3c71b47f7154
2018-05-11 08:30:35 -07:00
Ryan Mitchell
91d2f87d0e Merge "AAPT2: Insert platformBuild information" into pi-dev 2018-05-11 15:18:56 +00:00
Ryan Mitchell
7cb82a86be AAPT2: Insert platformBuild information
Inserts platformBuildVersionName and platformBuildVersionName when the
attributes are not currrently present. The attributes are set to
the values of versionName and versionCode.

Bug: 77541121
Test: Build apk using aapt and appt2 and dumped using xmltree to confirm
the presence of the attributes
Change-Id: I5330381905c878fb877214b42f83d7e2e48cd062
2018-05-10 15:37:37 -07:00
android-build-team Robot
f01c08de24 Merge "Move libstatssocket to system/ so that lmkd can build on PDK." into pi-dev
am: 8ca46fc4ac

Change-Id: I70b7f3187da66eb720d1bc0c5ac83658ea4a6280
2018-05-09 11:46:43 -07:00
android-build-team Robot
8ca46fc4ac Merge "Move libstatssocket to system/ so that lmkd can build on PDK." into pi-dev 2018-05-09 18:08:46 +00:00
android-build-team Robot
ccb89f9263 Merge "Adding batterystats history to proto dump." into pi-dev
am: 291b944d89

Change-Id: Ie1766ac31bc048eeba13d540c446372ef56c2da6
2018-05-08 08:11:22 -07:00
David Brazdil
2200a1b83b Add presubmit hook for hidden API lists.
Check that they're sorted as expected and contain no duplicates.
The sort order now uses:
$ LC_COLLATE=C sort -f

So that non-alphanumeric characters are not ignored, giving a more
intuitive sort order. the '-f' means ignore case.

Also sort the existing lists accordingly.

Test: repo upload
Bug: 64382372
Merged-In: I52b884da33a9a46455df6747a215683d9d3c3218
Change-Id: Icc124fd8ceb3f001a9c11bbf40e0a111910c6b39
(cherry picked from commit e5dc64d4281dd9f38c2b585202e26ae4278fcfc5)
2018-05-08 10:29:50 +01:00
Kweku Adams
71a9531806 Adding batterystats history to proto dump.
It will only print out a dump for userdebug or eng builds.

Bug: 77727638
Test: flash device and check output of incident proto and
'dumpsys batterystats -c --history'

Merged-In: Ib74d4c664f23a61e6fc33f700ba6a3c6fad32c74
Change-Id: Ia0c993d1281cc350d93f9c13f5540b349a4bfb84
2018-05-07 17:53:57 -07:00
Yao Chen
c9c242e5cf Move libstatssocket to system/ so that lmkd can build on PDK.
Bug: 79349329
Test: builds locally
Change-Id: I9e767639f39fcd317ba0d8daf353d9af3bb73359
2018-05-07 17:00:46 -07:00
Yao Chen
4ea3ecbc14 Merge "Support stats log in lmkd." into pi-dev
am: dcd71294a4

Change-Id: I2607f3f94cc74e5bddccc664acbd8f139af85151
2018-05-04 13:35:07 -07:00
Yao Chen
88e881017c Support stats log in lmkd.
This CL changes the relevant cpp files to c files. And added functionalities to reset the log
context for reuse.

Background:
+ lmkd doesn't use the generated statslog code because:
   1. lmkd doesn't want to create a 4K log context for each log. lmkd is single threaded and can
      reuse the same log context.
   2. lmkd is written in c, and the existing statslog.h/.cpp are not compatible

Bug: 78603347
Test: manually tested with alloc-stress
Change-Id: Ife6f5c69248ecf5af730269e67f229ba4c72f37f
2018-05-03 15:42:17 -07:00
Yi Jin
68a16c4277 Merge "Add a section flag to bypass failure if a specific path can't be found." into pi-dev
am: e09cde0cd9

Change-Id: I01c5a7a2c1ead02f5af0514cf9bf9b83f1682316
2018-05-02 15:10:58 -07:00
Yi Jin
e09cde0cd9 Merge "Add a section flag to bypass failure if a specific path can't be found." into pi-dev 2018-05-02 21:36:23 +00:00
Ryan Mitchell
cc6e856522 Merge "AAPT2: Fix quoted text in res/xml assets" into pi-dev
am: 150bafd217

Change-Id: I5bb4a63234cf3ee022bbf59edd5b613abefd8bef
2018-05-02 13:43:45 -07:00
Ryan Mitchell
0dcb20c727 AAPT2: Fix quoted text in res/xml assets
AAPT2 aggressively processed xml nodes and regressed from the behavior
of AAPT. This change restores AAPT's processing of xml nodes with
quotations.

Bug: 71805084
Test: Created tests in XmlFlattener_test.cpp and ran the test in the
Android Studio project given in the bug

Change-Id: Idedb4f1002e9fd705ceb5feae35289235b754b02
2018-05-02 17:53:21 +00:00
Ryan Mitchell
932c44d329 Merge "AAPT2: Fixed id parsing error" into pi-dev
am: f4c089dd90

Change-Id: I81147ee8629edc98ba19565083c09d7dce8e6bf7
2018-05-02 09:42:11 -07:00