35 Commits

Author SHA1 Message Date
Paul Duffin
444c535a46 Merge "Move hiddenapi sort preupload tools to tools/platform-compat" am: b82853357b am: 89aedd6cb8 am: af77c134d9
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1675867

Change-Id: I35b678f40dbc8643224aec26ba1808da893bb80f
2021-04-16 16:15:32 +00:00
Paul Duffin
738f919418 Move hiddenapi sort preupload tools to tools/platform-compat
Bug: 179354495
Test: try and upload changes to hiddenapi flag files
Change-Id: Iedc21893bbc62adaaca4de353d022e77fc70ace2
2021-04-15 10:45:39 +01:00
Paul Duffin
661c3e3e8b Enforce formatting of bp files on repo upload
Test: modified an incorrectly formatted .bp file and attempted to
      upload just to make sure it was rejected.
Change-Id: Ib51cedb8b24d61c416a53a447a909314cc0e91c3
2021-04-12 10:44:16 +01:00
Songchun Fan
d4574b55b4 Revert "Revert "[incremental] change build rules to not to use aidl_interface""
This reverts commit 8d1235b882dde3eb055a652185a0f0f31e176211.

Reason for revert: trying again
Test: forest
BUG: 181266844
Change-Id: I57652132fda01a8a7964a1338b7f31a208df8094

Change-Id: I71a93fcba3463b143d9b6e055587ce36b35889af
2021-03-04 20:50:18 +00:00
Jerome Gaillard
8d1235b882 Revert "[incremental] change build rules to not to use aidl_interface"
This reverts commit e2c109d7e49e18a3ca503b60fbdf0a1959f468f9.

Reason for revert: This breaks sdk_mac target of git_master-without-vendor

Bug: 181646945
Change-Id: I19d957113d1c80a88e5fba917b344c69b64a2c94
2021-03-02 11:59:37 +00:00
Songchun Fan
e2c109d7e4 [incremental] change build rules to not to use aidl_interface
This will allow the usage of PersistableBundle in the aidl interfaces.
The modules do not need to be stable so it is okay to just use the old
aidl to build both c++ and Java backend.

+ use bpfmt to check Android.bp format before upload

BUG: 181266844
Test: builds (with aosp/1607482)
Change-Id: I3340129ae6d12f33ade38d7a2b0eb23e7c37e996
2021-02-27 01:08:42 +00:00
Siarhei Vishniakou
d11f38f6c5 Send input event id to SurfaceFlinger
The application receives input events and produces graphic buffers in
response. We are interested in measuring the total time that the input
event takes to process, from the moment it's received on the device, to
the moment that the image is displayed on the screen.

To do this, we need to understand which input event produced a specific
buffer. In this CL, we are sending the input event id from FrameInfo to
SurfaceFlinger. This event id will later be used to identify a specific
frame, and provide the frame timing information to inputflinger.

Inputflinger will be able to use this information to reconstruct the
complete event timeline, and record metrics on the duration of each
input / graphics processing stage. This will allow us to optimize
end-to-end touch latency.

In the current CL, we are using 'NewestInputEvent' as the inputEventId.
That's not quite correct. Today, this field contains the timestamp of
the input event. Therefore, we will simply pass the truncated
timestamp instead of proper input event id. We will fix this in a
separate CL by providing input event id to FrameInfo.

Design doc: https://docs.google.com/document/d/1G3bLaZYSmbe6AKcL-6ZChvrw_B_LXEz29Z6Ed9QoYXY/edit#
Bug: 169866723
Test: printed input event id at the site of SurfaceFrame creation in
FrameTimeline.cpp

Change-Id: Ia90337bb2f000e9c93a4db04d9dd6ea9ea153520
2021-01-29 18:41:08 +00:00
Vishnu Nair
ce1a648484 Allow creating child surfaces from BlastBufferQueue
App such as Chrome create child surfaces and parent them to
surfaces provided by SurfaceView. When we enable the blast
adapter for SurfaceView, the IGBP returned to the app is
created in the client and SurfaceFlinger does not know about it.
When the app creates a child surface and provides the IGBP as the
parent surface identifier, SF fails to validate the IGBP and the
surface is not created. This can be avoid if the client creates the
child surface from the SV SurfaceControl but we still need to
support existing APIs.

To fix this, when we create a Surface from the adapter, pass in
the handle of the Blast SurfaceControl. When calling
ASurfaceControl_createFromWindow, use this handle to identify
the parent.

Bug: 168917217
Test: adb shell settings put global use_blast_adapter_sv 1 & launch chrome
Change-Id: I879b411c47e8558397516bd7b7278813e79e005f
2020-10-22 18:03:22 -07:00
Vishnu Nair
57928e6a37 Verify SurfaceView BlastBufferQueue behavior
Initial code to easily configure buffer producers to generate buffers
with different properties inorder exercise and validate
BlastBufferQueue adapter.

The test captures surface flinger traces and verifies properties of a
single buffer. This will allow us to verify buffer presentation order,
buffer rejection, buffer properties and so on.

Test: atest SurfaceViewBufferTests
Bug: 168504870
Change-Id: I9714d7b6f5ffbe5fecca5d93e8184f0e6ac2b4c1
2020-09-25 19:57:58 +00:00
Siarhei Vishniakou
2da17761f9 Update usage of PropertyMap::load
Now that PropertyMap returns an owned object, update the usage in
validatekeymaps.

Bug: 163171599
Test: presubmit
Change-Id: I75b9abe3fa1d418951a8c23a624771046a89b3f8
2020-09-18 16:29:17 -05:00
Chris Ye
3c5b809387 Add "uinput" command to support uinput device.
Add support of uinput device with "uinput" shell command, allows user to
create a virtual uinput device and inject events to it, for input
framework testing.

Bug: 160360195
Bug: 163217897

Test: run uinput command from adb shell.
Change-Id: Ic885ae510d98fa282722f7a17d66778c15a893b6
2020-08-19 09:12:11 -07:00
Aurimas Liutikas
d5c5ac6ada Revert "Temporarily disable checkstyle hook"
This reverts commit 8497789b3b3f78e8eec53e946654afd896436c60.

Reason for revert: This was fixed, see b/160796554

Bug: 160796554
Change-Id: I42f8d6b76c7319522239517ac3aff6eee7d9084b
2020-07-10 18:10:14 +00:00
Aurimas Liutikas
8497789b3b Temporarily disable checkstyle hook
checkstyle uses inefficient git calls that make it really slow for --partial-clone

Bug: 160796554
Change-Id: I3bb2ac1bebdb6f778b2d2ff159eefb27664aa177
2020-07-09 20:51:58 +00:00
Alex Buynytskyy
1d89216eac Appops permission monitoring for GET_USAGE_STATS.
This makes sure DataLoader won't be able to obtain read logs once user
denies access.

Bug: b/152633648
Test: atest PackageManagerShellCommandTest PackageManagerShellCommandIncrementalTest IncrementalServiceTest
Test: adb shell appops set 1000 GET_USAGE_STATS deny
Change-Id: Ibbb74933b4ef0dd8f5fe27732743e5820b8ee4dc
2020-04-06 12:22:49 -07:00
Siarhei Vishniakou
44d50feacc Enable clang-format for f/b/services/core/jni
To avoid code review comments about code style, line length, and
spacing, enable clang-format for frameworks/base/services/core/jni

Bug: none
Test: repo upload
Change-Id: Ie38ecca2d5face78367d3eab450e497120ce12b1
2020-01-27 11:56:53 -06:00
Siarhei Vishniakou
cd2fe53533 Enable clang-format for core/jni
To have consistent code style and avoid format-related comments in code
review, enable clang-format in frameworks/base/core/jni.

Bug: none
Test: repo upload
Change-Id: Ie9e5408d85036dfabae3a9c60b238b4a190da5fc
2020-01-03 11:01:01 -08:00
Siarhei Vishniakou
a3117ca4c6 Enable clang-format for input code
Currently, there is no format enforcement for hid command. Add
clang-format hook for all input-related code in frameworks/base.

Bug: None
Test: repo upload
Change-Id: I08b8c6d1bae7d1954847c207ef8e6d80373b2d05
2019-12-10 10:15:27 -08:00
Adrian Roos
7bf3cd9de8 API Lint: remove obsolete python linter
Linting is performed by metalava as part of the build now.

Test: n/a
Change-Id: I6223549657912fdf305a17f66f55b97561f7f7ac
2019-11-01 08:56:27 +01:00
Remi NGUYEN VAN
ba47bae749 Add ktlint to preupload hooks
The kotlin linter is particularly useful for tests written in Kotlin in
frameworks/base.

This is already merged in internal master.

Test: Tried uploading change with/without kotlin style problems.
Merged-In: Ie8659765b674ac7b2d82ed3d343f387195c07d83
Change-Id: I420366c49d071e022b8988c3d6293dbc8e9a283a
2019-07-24 15:54:24 +09:00
Lorenzo Colitti
6bfffd68de Enable checkstyle everywhere in frameworks/base.
This was done in internal master in ag/5397886. Do it in AOSP as
well so we can benefit from checkstyle in AOSP as well.

Test: None
Change-Id: Ib00fc8d318e8127224846e0a69cb542178631437
Merged-In: I7d350c2bbb9fcd1019abd1addb035ce5e9e05acc
2018-12-10 18:23:09 +09:00
Paul Duffin
00537c15e8 Prevent hiddenapi entries being added for libcore related projects
The libcore related projects (see below) have been (mostly) switched
over to use UnsupportedAppUsage annotations, This change will prevent
entries for those projects being added to a config/hiddenapi-* file.

* libcore
* external/bouncycastle
* external/conscrypt
* external/icu
* external/okhttp
* external/libphonenumber - still has a couple of entries in
      config/hiddenapi-light-greylist.txt due to limitations in
      UnsupportedAppUsage/class2greylist.

Tested by attempting to upload the file with entries for libcore
projects and without those entries and checking that the behavior
is expected.

Test: see above
Bug: 117818301
Change-Id: I67a30b307e12e842b28cfb2160fab0029868fa06
2018-11-29 09:41:56 +00:00
Felipe Leme
4c192e9690 Added OWNERS to Shell and hook to make sure it's developed on AOSP.
Bug: none
Test: none

Change-Id: I1f6f554cf98c78d1ab8a1e820d485a37238230f5
2018-11-21 13:00:06 -08:00
Jeff Sharkey
0a9c731969 Upload hook that guides people towards AOSP.
The canonical location of certain parts of the source tree live in
AOSP, and should not be changed internally to avoid merge conflicts.

This initially starts with "OWNERS" files, but the hook can easily
be repeated to match any files based on file path regexes.

Bug: 113136846
Test: manual
Change-Id: I113e63b6133f20389d84ec0d6d8b81cdbdf35d38
Merged-In: I113e63b6133f20389d84ec0d6d8b81cdbdf35d38
2018-09-11 11:09:05 -06:00
Mathew Inwood
1b216d84c0 Merge "Add presubmit hook for hidden API lists." into pi-dev
am: 02033386c2

Change-Id: I6c437a6ffa62794f1fc88d0c8bcdcef798b68d8c
2018-04-24 09:47:36 -07:00
Mathew Inwood
e5dc64d428 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: I4cdd3bc5c11be91a9a3f678580af49ac67f3c968
2018-04-24 15:15:13 +01:00
Jeff Sharkey
6527cd70a2 Merge "Add linter for strings.xml." into pi-dev
am: 642c0be3f3

Change-Id: I9677257b4ddfe5c1347b6de13b98e2b25fd649ac
2018-03-27 01:06:54 +00:00
Jeff Sharkey
abe058c0f0 Add linter for strings.xml.
Strings are tedious to get right, so write a lint script that catches
common errors to warn developers before they're uploaded.

Test: builds, boots
Bug: 76097999
Change-Id: I9826ca796c17cd93a100951d56214653de63a379
2018-03-26 11:04:48 -06:00
Jack Yu
2ea5e20c8b Merge "Enable Checkstyle for "repo upload" for more projects." am: dd6764a522
am: 2ff91e5132

Change-Id: Ie880f61f511ad51011607c531c9028376e5683d1
2018-03-23 02:31:36 +00:00
Jack Yu
8ee42c2b95 Enable Checkstyle for "repo upload" for more projects.
This CL enables Checkstyle for the following directories:
- telephony/

Bug: 34746646, 32954735
Test: Compilation
Change-Id: Ia67eaf5b871e6b74f21344fef1572835801843a5
2018-03-22 16:47:16 -07:00
Siyamed Sinir
56eed89bb6 Add checkstyle check to graphics package
Test: None
Change-Id: I1c8342dda2678917e245e48ab141b2953a522197
2018-02-09 11:34:57 -08:00
Jason Monk
53b2a73c37 Add api lint to upload checks
Currently will never block upload, only considered a warning, but
will print out any lint issues discovered.

Test: do an upload
Bug: 69115822
Change-Id: I69b8e5a3f92ac28ee3c954408e88a1056c33af65
2017-11-13 13:25:05 -05:00
Aurimas Liutikas
e5abb866a5 Enable Checkstyle for "repo upload" for more projects.
This CL enables Checkstyle for the following directories:
- core/java/android/
- core/tests/coretests/src/android/

Bug: 34746646
Test: None
Change-Id: Ib8b3f198000be19e9a7a61aa5abd61d827454eba
2017-04-28 21:39:48 +00:00
Aurimas Liutikas
cb494a3031 Point to the new checkstyle location for frameworks/base PREUPLOAD hook.
This change depends on r.android.com/314437

Bug: 33666900
Test: None
Change-Id: I301723d516803146943f0866ea35b68cc36af6af
2016-12-15 15:01:36 -08:00
Philip P. Moltmann
d7cee3cf5a Check USB and Print Framework code.
Test: Uploaded
Change-Id: Ib103a4fdc1dea0efc3a1a1be8c864541d283343a
2016-10-20 17:27:48 -07:00
Aurimas Liutikas
5c19b5428d Enable Checkstyle preupload hook for certain frameworks/base directories.
Enables Checkstyle preupload hook for the following directories:
- core/java/android/animation/
- core/java/android/text/
- core/java/android/view/
- core/java/android/transition/
- core/java/android/widget/

Test: tested manually uploading a CL that contained many changes
      to directories outside of the listed ones and checkstyle did
      not complain about those.

Change-Id: I795ba478fad7af124c43ca1e18d51b33d7800976
2016-10-12 13:09:24 -07:00