Commit Graph

7276 Commits

Author SHA1 Message Date
Salud Lemus
c9d9f93570 Update stats-log-api-gen based off of google3 presubmit-checks
Bug: 161812407
Test: `m statslog-framework-java-gen`
Test: `m statslog-telephony-java-gen`
Test: `m stats-log-api-gen-test &&
out/host/linux-x86/nativetest/stats-log-api-gen-test/stats-log-api-gen-test`
Change-Id: If4a130e4728c4ffd632c76b6999e9a3da9b21f0c

Change-Id: Icddf5ef21155ede50319fc2bf7c8a361eeb09539
2020-08-03 15:16:43 +00:00
Ryan Mitchell
5fa0c6d621 Merge "OMS: Add config_signature policy handling" 2020-08-03 14:14:41 +00:00
Alan Stokes
f2081ee4e9 Merge "Use red-on-white rather than red-on-black." 2020-08-03 08:23:01 +00:00
TreeHugger Robot
de5d3a6d01 Merge "Make aapt2 terminology more inclusive" 2020-07-31 22:50:07 +00:00
Ryan Mitchell
4ea9075124 Make aapt2 terminology more inclusive
Update language to comply with Android's inclusive language guidance

See https://source.android.com/setup/contribute/respectful-code
for reference

Bug: 162364131
Bug: 162536543
Test: aapt2_tests
Change-Id: I4eef925d6319b40a395fc8d59a3f2912a02ca03b
2020-07-31 21:03:54 +00:00
Salud Lemus
8c31d4eaca Merge "Update stats-log-api-gen source based off of google3 presubmit checks" 2020-07-31 19:17:11 +00:00
Salud Lemus
0cbe9d948b Update stats-log-api-gen source based off of google3 presubmit checks
Bug: 161812407
Test: `m statslog-framework-java-gen`
Test: `m statslog-telephony-java-gen`
Test: `m stats-log-api-gen-test && out/host/linux-x86/nativetest/stats-log-api-gen-test/stats-log-api-gen-test`
Change-Id: Id68982e306fbc379ed8e90b33a38b8a6604e66ad
2020-07-31 17:31:53 +00:00
Andrei-Valentin Onea
aae4ca2b42 Merge "Update language to comply with Android's inclusive language guidance" am: 31be55091f am: df5b66050c am: b6f7d962e4 am: a10fe74cf4 am: 3f2d9c2bda
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1374279

Change-Id: If86716ca1936a8eb029e918e45476a8208fbdd11
2020-07-31 01:11:57 +00:00
Andrei-Valentin Onea
b6f7d962e4 Merge "Update language to comply with Android's inclusive language guidance" am: 31be55091f am: df5b66050c
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1374279

Change-Id: I9bff1926c2878da6b20f67482683afccb21123f4
2020-07-30 12:42:53 +00:00
Aleksei Kalinov
c57b3c2b13 Update language to comply with Android's inclusive language guidance
The binary uses flags to mean both command-line parameter names
and the API names, used in files and internally in the class.

Internal representation and command-line parameter names are updated to
use more inclusive language. However, the output file produced by
`generate_csv` function still uses old flags. Format update in
the input/output files is out of scope for this change
and will be updated in the follow-up changelist.

See https://source.android.com/setup/contribute/respectful-code for
reference.

Bug: 161896447

Test: python3 generate_hiddenapi_lists_test.py

Change-Id: I36c85ce04b89ba3e4eee319f95511110d2c4374e
2020-07-30 08:29:33 +00:00
Zoran Jovanovic
9336d9e13b OMS: Add config_signature policy handling
Alongside SIGNATURE and ACTOR_SIGNATURE policies, add CONFIG_SIGNATURE
policy to overlayable that overlay fulfills if it is signed with the
same certificate as the reference package whose package name is
declared in 'config-signature' tag of SystemConfig and is vetted by
OMS that it's a system pre-installed package.

BUG: 158726924
TEST: regular aapt2, idmap2, OMS tests

Change-Id: I645ee72271496008742886274be0d63a2985201b
2020-07-28 18:30:53 +00:00
Alan Stokes
293096a0cb Use red-on-white rather than red-on-black.
Relying purely on color change is unfriendly to those of us that are
color blind; red on black is a particularly challenging
combination. (Even worse when working from home, since video
compression can lead to washed out colors.)

Changing from light on dark to dark on light should make it fairly
obvious even to those with monochrome vision.

Test: Manual
Change-Id: I79013686038cb4ebea6087b53cece3266bf6ec0b
2020-07-28 18:19:20 +01:00
Salud Lemus
556f656b78 Merge "Revert "Revert "Add pulled atoms support for native clients in s..."" 2020-07-28 16:52:43 +00:00
Luke Edgar
3e810aec45 Merge "Add --source-path flag to AAPT2 compile" 2020-07-23 14:41:29 +00:00
Jiyong Park
5a63c65998 Merge "Introduce uses-native-library tag" 2020-07-23 08:56:41 +00:00
Salud Lemus
0deb0e3dfd Revert "Revert "Add pulled atoms support for native clients in s..."
Revert submission 12182663-revert-12111163-native pulled atoms support-NYTWIBBAKX

Reason for revert: Uploaded CL that guards the use of the symbol "AStatsEvent_getBuffer"
Reverted Changes:
Ib6cc99e9b:Revert "Make libstatspull host supported"
I665448247:Revert "Add pulled atoms support for native client...

Change-Id: I59d861fc9ffc6f03cc0dbd34e82a4df4f51f0cb9
2020-07-22 19:53:44 +00:00
lukeedgar
19b8ebf109 Add --source-path flag to AAPT2 compile
This added flag uses a given value to replace the default absolute resource
file path in the compiled resource file. This allows for relative file
paths to be used instead of absolute file paths.

Test: Compile_test.cpp
Bug: 159611599
Change-Id: I5f1c99cf40e5d31fc54cda819c91640285986d2a
2020-07-22 15:14:07 +00:00
Jiyong Park
6a5b8b1f6d Introduce uses-native-library tag
Since Android 7.0, partners were able to export some of their native
shared libraries to apps. So far, the native libraries were provided to
all apps regardless of whether they are actually needed or not. Even
worse, it was impossible to prevent the installation of an app to the
device where the some (or all) of the required native libs don't exist;
the apps had to manually handle the case, which sometimes impossible
when the dependency is so fundamental.

This change introduces a new tag <uses-native-library> to the app
manifest. Similary to the existing <uses-library> tag which is for
(java) shared libraries, the new tag is used to describe the depedencies
to the native shared libraries.

Apps targeting Android S or higher are required to use the tag to import
the native shared libraries. Libraries that are not depended on won't be
available to the app even if the libraries are listed in the
public.libraries*.txt files. Furthermore, when the dependency can't be
satisfied for an app, the package manager refejects installing the app.

The dependency can be optional using the `android:required` attribute.
When it is set to true, the absence of the lib on the device doesn't
prevent the app from being installed. However, the app has to gracefully
deal with the absence.

The changed behavior only affects apps targeting S or higher. Existing
apps are unaffected; they still get all the public native libraries
regardless of whether they have <uses-native-library> tags or not; the
tags are simply ignored.

This is the first version of the implementation and therefore needs
further refinements. The followings are two major TODOs.

1) The native shared lib dependencies of the java shared libraries
are not enforced. For example, if an app depends on a java shared
library foo and foo depends on some native shared libraries, the
classloader where code from foo is loaded still gets all native shared
libraries. This should be fixed.

2) New APIs should be added. SharedLibraryInfo should be extended to
represent native shared libraries. The meaning of
ApplicationInfo.sharedLibraryFiles should be revised. Finally, the new
tag should be made public.

Bug: 142191088
Test: atest CtsUsesNativeLibraryTest
Change-Id: Iceb038aa86872d23e9faf582ae91b1fdcaf5c64c
2020-07-21 08:42:00 +09:00
TreeHugger Robot
3284a2100a Merge "Revert "Add pulled atoms support for native clients in stats-log..."" 2020-07-18 02:12:18 +00:00
Salud Lemus
8b84a38e8c Revert "Add pulled atoms support for native clients in stats-log..."
Revert submission 12111163-native pulled atoms support

Reason for revert: ld.lld: error: undefined symbol: AStatsEvent_getBuffer
Bug link: https://b.corp.google.com/issues/151102177
Reverted Changes:
I57911864c:Add pulled atoms support for native clients in sta...
I069792c0e:Make libstatspull host supported

Change-Id: I665448247d3bf7d05251d302a38b2a7f61a7c071
2020-07-18 00:26:10 +00:00
Salud Lemus
5e3abe4683 Merge "Add pulled atoms support for native clients in stats-log-api-gen" 2020-07-16 14:42:33 +00:00
Salud Lemus
6d99ddcecb Add pulled atoms support for native clients in stats-log-api-gen
Similar to adding pulled atoms support for Java clients, now also
add pulled atoms support for native clients.

Bug: 160367907
Test: Ran `m` and completed successfully
Test: Ran `atest statsd_test` and all CTS tests passed
Test: Ran `atest HostAtomTests` and all CTS tests passed
Test: Ran `atest stats-log-api-gen-test` and all CTS tests passed
Change-Id: I57911864cc3fc5569322333a934dfc10aa78ddca
2020-07-15 21:58:11 +00:00
Pablo Gamito
c18f0a3562 Add intDef annotation processor to generate mapping
Test: Run 'mp :framework-all' and check if mapping file is properly
generated

Change-Id: I58f7ea5894e8ec994a74781663654508205c4db1
2020-07-14 13:38:57 +00:00
chaviw
929d80f726 Add dependency on libui-types
Test: Builds
Bug: 158476194
Change-Id: I9234bd688e572a40649810eb1862a3e9e5386e5f
2020-07-13 10:44:53 -07:00
Salud Lemus
b77d9e984c Added support for pulled atoms for stats-log-api-gen
Currently, stats-log-api-gen allows statsd clients to send events for
pushed atoms to statsd using a simple auto-generated function call.
Allow support for pulled atoms so that clients no longer have to
hand-construct StatsEvent objects by calling StatsEvent write methods
directly and also making sure that the appropriate annotations are
added. This support is for Java clients only for now.

Bug: 160368804
Test: Ran `m statslog-framework-java-gen` and completed successfully
Test: Ran `m` and completed successfully
Test: Ran `m stats-log-api-gen-test && out/host/linux-x86/nativetest/stats-log-api-gen-test/stats-log-api-gen-test`
Test: Ran `atest CtsStatsdHostTestCases:android.cts.statsd.atom` and all passed except for CTS tests related to a SIM card because the testing device does not have a SIM card
Change-Id: Ie2cbb298690ce71ff7fe7457b17b9d7bdbb24f6b
2020-07-07 20:07:51 +00:00
TreeHugger Robot
aed7bf43db Merge "Don't add API annotations in the internal R.java" into rvc-dev-plus-aosp am: 7c72b7f45e am: 780aeb116a am: 47d47a8ac5
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11955280

Change-Id: I602f8515391d93daf1d538f965659dfdca62e550
2020-06-23 17:11:14 +00:00
Makoto Onuki
eab9e7f801 Don't add API annotations in the internal R.java
I'm trying to enable a check for the following structure:
```
/** @hide */
public class Class1 {
    /** @hide */
    @SystemApi // Invalid because the class is hidden.
    public void method1() { }
}
```

The internal R.java file violates this, which this change is going to fix.

Bug: 159162473
Test: build (treehugger)
Test: atest aapt2_tests

Merged-in: I613e8611ddaf5f8e4761d351d4cd0142d59c7cc9
Change-Id: I613e8611ddaf5f8e4761d351d4cd0142d59c7cc9
2020-06-23 09:35:36 -07:00
TreeHugger Robot
7c72b7f45e Merge "Don't add API annotations in the internal R.java" into rvc-dev-plus-aosp 2020-06-23 16:27:59 +00:00
TreeHugger Robot
9bc8e57bbe Merge changes from topic "featureIdCleanup"
* changes:
  Do not allow invalid attribution tags
  Remove legacy support for "featureId".
2020-06-23 16:20:57 +00:00
Muhammad Qureshi
1da594aadc Merge "Remove libstatsmetadata" into rvc-dev am: 271cbbd708 am: 5c5e239026 am: 0269d364dc am: 34306c79f3
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11923902

Change-Id: If0892fc6ed90b89f80876da41ff9bf7dc50eb5dd
2020-06-23 02:00:30 +00:00
Muhammad Qureshi
34306c79f3 Merge "Remove libstatsmetadata" into rvc-dev am: 271cbbd708 am: 5c5e239026 am: 0269d364dc
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11923902

Change-Id: I179cc6b2145254c921489fae5b646bb7eb5c2bfa
2020-06-23 01:45:14 +00:00
Muhammad Qureshi
ff0d53f089 Merge "Remove libstatsmetadata" into rvc-dev am: 271cbbd708
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11923902

Change-Id: Ief9909dfe6c21bb62e891677d3e08612241c56c3
2020-06-23 01:28:47 +00:00
Makoto Onuki
de6e6f2098 Don't add API annotations in the internal R.java
I'm trying to enable a check for the following structure:
```
/** @hide */
public class Class1 {
    /** @hide */
    @SystemApi // Invalid because the class is hidden.
    public void method1() { }
}
```

The internal R.java file violates this, which this change is going to fix.

Bug: 159162473
Test: build (treehugger)
Test: atest aapt2_tests

Change-Id: I613e8611ddaf5f8e4761d351d4cd0142d59c7cc9
2020-06-22 16:33:53 -07:00
Philip P. Moltmann
3a69660910 Remove legacy support for "featureId".
"featureId" was the old name of "attributionTag". This was never shipped
in any public build and is hence just dead code.

Bug: 151105954
Test: atest CtsAppOpsTestCases
Change-Id: I7570e7f84cc3f6cabaa769c700c3ceaf7eed0ae9
2020-06-19 19:57:27 -07:00
Muhammad Qureshi
741d31898a Remove libstatsmetadata
Remove kWhitelistedAtoms usage in MetricsManager and remove:
- atoms_info references from statsd
- libstatsmetadata usages from statsd
- libstatsmetadata library
- atoms_info_writer.h/.cpp
- references to atoms_info in rest of stats-log-api-gen
- allow_from_any_uid annotation

Fixes: 147600720
Fixes: 154856835
Fixes: 148993016

Test: m stats-log-api-gen
Test: m stats-log-api-gen-test &&
out/host/linux-x86/nativetest/stats-log-api-gen-test/stats-log-api-gen-test
Test: m statsd

Change-Id: I2e0579609ff257da934b95cdda397f3ca0ffa1f0
2020-06-18 18:59:12 -07:00
Automerger Merge Worker
6c2c137f88 Merge "Merge "Add policies and enforce overlayable to header" into rvc-dev am: 2201f8b626 am: 64d0e6f31b am: e2426c48bd" into rvc-qpr-dev-plus-aosp am: 1da88a7cf1
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11481145

Change-Id: I1af37d280e52ea663678d4bf62f2818bfa4f13dc
2020-06-05 18:46:51 +00:00
Ryan Mitchell
22cf8d565e Merge "Add policies and enforce overlayable to header" into rvc-dev am: 2201f8b626 am: 64d0e6f31b am: e2426c48bd
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11481145

Change-Id: I268738c0312b6a158599d9487f09b753c91ba36a
2020-06-05 16:46:45 +00:00
Ryan Mitchell
1b4cda227a Merge "Add policies and enforce overlayable to header" into rvc-dev am: 2201f8b626
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11481145

Change-Id: I71ff9f46e1e5a5016291a062dd5389078527588f
2020-06-05 16:11:20 +00:00
Ryan Mitchell
a707013b78 Add policies and enforce overlayable to header
If the fulfilled policies change without the contents of the target
and overlay APKs changing, the idmap for the overlay should be
regenerated. This change adds fulfilled policies and enforce
overlayable to the idmap header so that idmap2d can determine if the
polices or enforce overlayable changed from what was used to generate
the idmap.

Bug: 119328308
Test: idmap2_tests
Test: atest RegenerateIdmapTest

Change-Id: I96f970e82b5243be01b205ac2cb6ab249c6100bc
2020-06-01 16:15:35 -07:00
Liz Kammer
5691fb68fd Merge "Do not rename R.java package" 2020-05-21 20:04:38 +00:00
Ryan Mitchell
ad19790515 Do not rename R.java package
Cherry picks the rest of Id9d10e16f32533da1b67ab72ac846791526e7a76.

When the --rename-resources-package flag is used, only rename the
package name within the resources.arsc. Generate the R.java under
the package name defined by the manifest unless --custom-package is
used.

Test: manual
Bug: 147434671
Merged-In: Iab30ff9d3d136fa1e5464913f8d493df22c5c1c4
Change-Id: I896b8c69793cff714a950081fd8521e4acf0cf25
2020-05-21 12:06:25 -07:00
satayev
b84befad12 Merge "Add support for greylist-max-r signatures." am: dbf501e0eb am: 06a93cbca2 am: dc3191e9bd am: 6e97b389d5 am: 500aaca137
Change-Id: Ic9406931c472503bd0c48a0e36ba9ad998385e01
2020-05-21 15:07:58 +00:00
satayev
dc3191e9bd Merge "Add support for greylist-max-r signatures." am: dbf501e0eb am: 06a93cbca2
Change-Id: Icd1c8858eba2eace7d7bfeccc6fb5dff80e8b6d6
2020-05-21 14:28:45 +00:00
Artur Satayev
54c2d606b3 Add support for greylist-max-r signatures.
Bug: 156307884
Test: m
Change-Id: I66f8e48817d16bad5b306b91323bf0cdf42dbabe
2020-05-20 17:50:24 +01:00
Ryan Mitchell
9ed5638125 Do not rename R.java package
When the --rename-resources-package flag is used, only rename the
package name within the resources.arsc. Generate the R.java under
the package name defined by the manifest unless --custom-package is
used.

(This is a cherry pick.)

Bug: 147434671
Test: manual
Merged-In: Id9d10e16f32533da1b67ab72ac846791526e7a76
Change-Id: Id9d10e16f32533da1b67ab72ac846791526e7a76
2020-05-13 09:04:14 -07:00
TreeHugger Robot
51822d01df Merge "Add OWNERS for display, haptics, input and power" into rvc-dev am: f30c225fcb am: 1e3fe956cf am: 689486059f am: 4623e80530
Change-Id: I80f338fc23ef80f544bc33d169f262346ab17786
2020-05-12 22:31:13 +00:00
TreeHugger Robot
689486059f Merge "Add OWNERS for display, haptics, input and power" into rvc-dev am: f30c225fcb am: 1e3fe956cf
Change-Id: I36ce5198582b6aa3fe6fc1c89e9438454df09f3f
2020-05-12 20:44:35 +00:00
TreeHugger Robot
4dca85b87f Merge "Add OWNERS for display, haptics, input and power" into rvc-dev am: f30c225fcb
Change-Id: Id6ab3fe424d9914f1ec54c0f9a4684578ed89c0b
2020-05-12 20:28:17 +00:00
Michael Wright
2e7e81c950 Add OWNERS for display, haptics, input and power
Bug: 156349083
Test: N/A
Change-Id: Ia8afccfc2e470095ae3d52c827c0ac78b7c120ae
2020-05-12 19:11:13 +01:00
Ryan Mitchell
d7465318e6 Merge "Do not rename R.java package" into rvc-dev am: 5c8dd641ba am: 98b076b85d am: 1da72bfb6c am: 9bb6fa9e89
Change-Id: I128110df8aa4c7f0d9abd144be3f4078e6d87ad6
2020-05-08 18:41:04 +00:00