Commit Graph

279 Commits

Author SHA1 Message Date
TreeHugger Robot
095e4fd986 Merge "Update FakedFont to use shared pointer" into sc-dev 2021-02-06 01:27:57 +00:00
Seigo Nonaka
7fc019ca7b Merge "Update OWNERS file for font files in FrameworksCoreTests" am: eff415e780 am: a4e2684bb5 am: 1bba2cdafa
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1548869

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I271582e3e246a35da9274d8ecee669fd307e76c9
2021-02-04 21:50:29 +00:00
Seigo Nonaka
0e5f67a04e Update FakedFont to use shared pointer
Bug: 179113771
Test: minikin_tests
Change-Id: I76082fd2ae00412726113654a87c7b59d47dd03d
2021-02-03 23:47:44 -08:00
Seigo Nonaka
bd4d43b1b7 Update OWNERS file for font files in FrameworksCoreTests
Bug: N/A
Test: N/A
Change-Id: Iaf764a2fcff1348f2e9a4c51dab9c7e6c5a8c4d0
2021-02-03 11:59:02 -08:00
Jiyong Park
ab0846e035 Remove __ANDROID_API__ guards
__ANDROID_API__ guards are removed in favor of __INTRODUCED_IN macros.

Currently, __INTRODUCED_IN macro does nothing for these headers (it's
meaningful only to the headers processed by versioner which are limited
to binic headers). The plan is to make the macros to tag the declaration
with the availability attribute. Then, when the min_sdk_version of a
caller is set to an API level that is older than the API level of the
APIs, the compiler will provide them as weak symbols and enforce that
calling the APIs are guarded with a runtime check.

For now, these guards are preventing from making a build system change
to let __ANDROID_API__ track the min_sdk_version property instead of the
sdk_version property. With the build system change, __ANDROID_API__ will
suddenly drop for the native modules where min_sdk_version <
sdk_version, which is the case when the modules are included in APEXes.
As a result, some new APIs will be unavailable at build-time. Dropping
the hand-written guards fixes the problem.

Bug: 163288375
Test: m
Change-Id: I8cafdba77fe358b2dcc9ad33f43c5410c9c27934
2021-01-15 15:59:16 +09:00
Chris Forbes
6e73857c79 Merge "thermal: Add AThermal_getThermalHeadroom" 2021-01-07 00:05:41 +00:00
Chong Zhang
366ef60790 Merge "transcoding: move MediaTranscodeManager to apex" 2020-12-23 03:28:03 +00:00
Daniel Norman
4209c4bc3f Merge "Updates noparent to only apply to the per-file files." am: ea8ca4b88a am: 96acd833fc am: f15eb86be0
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1535381

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I7d16d3b3d878c698bd0fc650bc25dc50c41e5bbc
2020-12-23 00:01:53 +00:00
Daniel Norman
94a2752536 Updates noparent to only apply to the per-file files.
This is needed to fix invalid OWNERS for other files in this directory.

Test: n/a
Change-Id: I5d6d4b8c578ba066cf968cb719b6dd29693f017b
2020-12-22 20:35:04 +00:00
Chong Zhang
864d0b7220 transcoding: move MediaTranscodeManager to apex
bug: 159172726
test: builds; presubmit; manual testing transcoding locally.
Change-Id: I727912a04cf4f7f03fdf5fa0a74e522f69dca66f
2020-12-22 19:34:46 +00:00
Chris Forbes
1900bef116 thermal: Add AThermal_getThermalHeadroom
Bug: b/168612028
Change-Id: I8f192b50f74b1666beeab3ad546c9e3b25842187
2020-12-16 16:04:43 -08:00
Jeff Sharkey
0ab7007631 resolve merge conflicts of 358f0d4fc8 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
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
Chong Zhang
c4be44372d Merge "Add AActivityManager UidImportance test" 2020-12-04 17:15:45 +00:00
Chong Zhang
cb95b8375b Merge "Add ActivityManager UidImportanceListener to libandroid" 2020-12-04 17:15:45 +00:00
Chong Zhang
e6bcd1bbb1 Add AActivityManager UidImportance test
Add a gtest that runs as root to test receving UidImportance
updates.

bug: 172942349
bug: 159172726

Change-Id: I2c6ee84f09afd1638c53e502e288f23bd8717a9b
2020-12-02 09:24:42 -08:00
Yiwei Zhang
7d8bb8a465 Adding AHardwareBuffer_getId to libandroid
Bug: 163615119
Test: atest AHardwareBufferTest
Change-Id: I95339f326125183ab4b57c22011bbe034c11a33d
2020-11-19 00:06:46 +00:00
Chong Zhang
8af87925ea Add ActivityManager UidImportanceListener to libandroid
Add UidImportanceListener methods to libandroid for native apex use.

bug: 172942349
bug: 159172726
bug: 146507383

test: updated mediatranscoding's UidPolicy locally to use the new api,
and passed mediatranscodingservice unit tests.

Change-Id: I7ca76f057a83b5bcd634deb2408784d7b93e46fc
2020-11-18 08:57:03 -08:00
Marin Shalamanov
41ffa8dd06 Add shouldBeSeamless param to Surface.setFrameRate
This CL adds a new parameter shouldBeSeamless to the existing
setFrameRate APIs. This parameter indicates whether the desired
refresh rate should be achieved only seamlessly or also switches
with visual interruptions for the user are allowed. The default
value of the new parameter is "true".

Test: atest SetFrameRateTest
Test: atest RefreshRateConfigsTest
Test: atest libsurfaceflinger_unittest
Bug: 161776961
Change-Id: Ic2446d278e4f57fe507d30a0a18ef7b85909da4b
2020-11-17 11:53:14 +01:00
Chong Zhang
06dbe5bf2c Add APermissionManager_checkPermission to libandroid
And allow IActivityManager#checkPermission to be used by native code.

bug: 172283477
bug: 159172726
Change-Id: I582fb918ac3ddc2289ef0040a4391db407673692
2020-11-06 01:49:55 +00:00
Colin Cross
2e21e9b289 Merge "Make the connection between implementation and llndk_library explicit" am: 3e7b21c1b6 am: 2cbc12ba3e am: e0f4fce861 am: 7eebf2a93a
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1465666

Change-Id: I9c4e659cf8c47d63d808079c4bffad77b9764b4b
2020-10-23 20:14:54 +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
Colin Cross
27f13787e1 Make the connection between implementation and llndk_library explicit
Instead of assuming a module with the .llndk suffix exists, add an
llndk_stubs property to every cc_library module that has a
corresponding llndk_library.  Also rename the llndk_library to have
an explicit .llndk suffix.

Bug: 170784825
Test: no changes to build.ninja (excluding comments) or Android-${TARGET_PRODUCT}.mk
Change-Id: I5f0b9d92162b532b1e6e8752ac3e130759cde08c
2020-10-19 13:37:57 -07:00
Pablo Gamito
117040c542 Update JNI to pass SurfaceControls rather than handles to layer state
updates

This allows us to have all the information that is stored in surface control including the layer id in the layer state so that it can be dumped directly from the client side

Test: N/A
Change-Id: I3d953382d0aad1a192ad9f767daa09a4ceefba8b
2020-10-01 17:34:18 +00:00
Devin Moore
a76ba95b6f Merge "Remove libandroid_trace" am: 242c212b80 am: 7d36816ecd am: 7e2c27581a am: bcd3b9c997 am: 2adaf74b30
Change-Id: I7d256d3477607ceed70f6f878a3c6e21963306af
2020-05-15 17:05:24 +00:00
Devin Moore
7e2c27581a Merge "Remove libandroid_trace" am: 242c212b80 am: 7d36816ecd
Change-Id: I7231a6ad6a3d4c5846ca8699b68360f4946f3529
2020-05-15 16:30:14 +00:00
Devin Moore
b276f63257 Remove libandroid_trace
We do not want platform code to be using TRACE_TAG_APP.
This is being moved to system/tools/aidl and, with the new name
libandroid_aidltrace, using TRACE_TAG_AIDL.

Test: atest aidl_unittests aidl_integration_test && atest
CtsNdkBinderTestCases

Change-Id: I92ee2bf75fe82b0f212bb4a1908df482d6e81933
2020-05-14 15:11:06 -07:00
Alec Mouri
6a5be8eaca Merge "Dispatch refresh rate callbacks from DMS" into rvc-dev am: 00f681a582 am: 151365a461 am: c94de5c5ce am: f7f8d57074
Change-Id: I912b29d038f9938b963818577b2c9644d7d5e023
2020-05-10 06:05:37 +00:00
Alec Mouri
151365a461 Merge "Dispatch refresh rate callbacks from DMS" into rvc-dev am: 00f681a582
Change-Id: I193dfe7532893c3675d074aa00078ab0885095c3
2020-05-10 05:17:32 +00:00
Alec Mouri
cf3ad873dd Dispatch refresh rate callbacks from DMS
AChoreographer will consume these callbacks in lieu of going through SF
for the callbacks. This is so that DMS can update its view of display
configs before apps receive the refresh rate callback so that apps can
get consistent information.

Bug: 154874011
Test: ChoreographerNativeTest
Test: Manually verify that HWUI is receiving callbacks
Change-Id: I992c247fd16ef414f94a259bbd300bea3e4c9467
2020-05-07 19:19:23 -07:00
Devin Moore
0999381492 Merge "Create a header-only library for atrace in platform NDK builds" am: f1e3232bd2 am: 0487c3a14c am: 566a773522 am: 16e08e3f32 am: a69a29bc6a
Change-Id: Icd2991c15285bfa432b7b823f9ade5552c67e6d4
2020-05-06 20:46:34 +00:00
Devin Moore
566a773522 Merge "Create a header-only library for atrace in platform NDK builds" am: f1e3232bd2 am: 0487c3a14c
Change-Id: Ia3021212837b8f4aef439b05e199f943979a4ec3
2020-05-06 20:09:56 +00:00
Devin Moore
cc2e5a3709 Create a header-only library for atrace in platform NDK builds
App NDK has access to libandroid for tracing APIs in trace.h. These APIs
wrap libcutils atrace methods.
Vendor does not have access to libandroid, but does have access to
libcutils.
To keep the code portable, libandroid_trace is created for the
platform NDK. Now both variants can include android/trace.h, use the
same APIs, and just link with the different libraries(libandroid for
apps, libandroid_trace and libcutils for platform code).

Test: Build and run aidl interfaces(-ndk and -ndk_platform) with these tracing calls.
Bug: 128533039
Change-Id: Iba5917a06fd58573265dcaf5658c4958d8f591dc
2020-05-06 11:09:01 -07:00
TreeHugger Robot
c522d8958a Merge "Add java-to-native converters for input events." 2020-04-15 05:17:36 +00:00
Tom Cherry
842e5af146 resolve merge conflicts of 7d0c3abcf4 to rvc-dev-plus-aosp
Test: I solemnly swear I tested this conflict resolution.
Bug: None
Change-Id: Ia19eb2f0061426915f857fdee1cd6112b4a5f9ad
2020-04-13 13:09:58 -07:00
Tom Cherry
30f8f823aa Include what you use: <fcntl.h>
This was transitively included, but no longer is, so it must be
explicitly included.

Exempt-From-Owner-Approval: Janitorial
Test: build
Change-Id: Id88ee5113aa9f0a223dfabfc164ce17747727647
2020-04-13 11:10:30 -07:00
Chris Ye
3da1d20bcf Add java-to-native converters for input events.
Add java-to-native converters for android.view.KeyEvent,
android.view.MotionEvent.

Bug: 116830907
Test: atest KeyEventTest, atest MotionEventTest
Change-Id: Ib993afb08ef900d95e21907660f776ad2bd3d50e
2020-04-09 14:18:25 -07:00
Derek Sollenberger
76e7430bae Merge changes from topic "HWUI_JNI"
* changes:
  Export symbols for the newly exposed APEX/internal headers
  Remove dependence on libandroid_runtime from Bitmap.cpp
  Update Region.cpp to use AParcel NDK APIs
  Cleanup header and build targets for libhwui clients.
  Remove dependencies on headers outside UI module
  Cleanup LOG_TAG when bundled in HWUI
  Move android.graphics JNI & APEX files into HWUI
2020-02-21 11:43:02 +00:00
Derek Sollenberger
ee538a3a85 Cleanup header and build targets for libhwui clients.
Targets that will also be contained within the UI module
are allowed to access internal headers.  All other targets
that depend on libhwui are restricted to using the APEX headers.

Bug: 137655431
Test: CtsUiRenderingTestCases
Change-Id: Id92e9874dafb98bd79839d45ab8f22ab999689de
2020-02-20 21:50:06 -05:00
Chris Ye
48dbcaae41 Add native Thermal Throttling API to libandroid.
Add native thermal manager API of thermal mananger service into
libandroid. Export Thermal API as NDK library.

Bug: 137151587
Bug: 136285293
Test: build, atest thermalmanager-test atest CtsThermalTestCases

Change-Id: Ia49fb2133624ffcd6168af804ae612ef2bb190f2
2020-02-19 16:25:25 -08:00
Steven Thomas
dd7bf2fea5 Add compatibility param to setFrameRate() api
Add a compatiblity param to the setFrameRate() api, so the system has
more info to decide the device frame rate when there are multiple
competing preferences.

I also changed the plumbing for setFrameRate() to go directly to surface
flinger, instead of through buffer queue. We're trying to avoid changes
to buffer queue code, to avoid disturbing the prebuilts.

Bug: 137287430

Test: Added new cts tests to verify behavior of the compatibility param.
      cts-tradefed run commandAndExit cts-dev --module CtsGraphicsTestCases --test android.graphics.cts.SetFrameRateTest

Test: /data/nativetest64/SurfaceFlinger_test/SurfaceFlinger_test --gtest_filter='SetFrameRateTest.*'

Change-Id: I9123afee2ba63d01ff35fb2b257a1ee0e4928ddd
2020-02-17 00:38:43 -08:00
Siarhei Vishniakou
cf07528a0e New VerifiedInputEvent api
The Verified{Input/Key/Motion}Event api are the same as
{Input/Key/Motion}Event api.
The VerifiedMotion class is the same as the MotionEvent class, but
contains less information. It only contains the information that the
system is able to verify.
Same applies to VerifiedKeyEvent.

The class VerifiedInputEvent contains common information applicable to
both Key and Motion.

Test: atest VerifiedKeyEventTest VerifiedMotionEventTest
Bug: 134977432
Change-Id: I4770104eb4c025263da7efeea9c7a658dff74ac9
2020-02-10 13:43:55 -08:00
TreeHugger Robot
c9853809e1 Merge "Pass back frame event stats" 2020-02-06 01:11:19 +00:00
Muhammad Qureshi
006d3ee677 Merge "Fix StatsLog JNI registration" 2020-02-03 17:12:49 +00:00
Muhammad Qureshi
93b4e99d9b Fix StatsLog JNI registration
Re-add StatsLog JNI regsitration in AndroidRuntime.cpp.
This will have to be revisited once StatsLog is moved into statsd apex.

Test: m
Test: fastboot flashall
Test: adb logcat "*:E"
Change-Id: I233a527d00d524cbc2edaed7c2be76ea1c212b29
2020-02-02 08:25:44 -08:00
Alec Mouri
a8f9a9e85f Merge "[AChoreographer] Lift refresh rate callbacks into NDK" 2020-01-31 19:14:20 +00:00
Tej Singh
a2b78e4d6b Create libstats_jni
This cl creates libstats_jni, puts the android_util_StatsLog class in it
to implement the jni StatsLog.writeImpl() call, and puts the library in
the statsd apex.

Right now, it does NOT load the library properly and therefore the
library is still in the platform. It needs to be removed from the
platform.

Test: boots
Test: adb shell cmd stats print-logs shows logs still flow
Bug: 147315667
Change-Id: I0a06b66d4640d00ee75bc273423b33dafc944b05
2020-01-30 13:52:42 -08:00
Valerie Hau
d6a222eab0 Pass back frame event stats
Adding frame event stats to SurfaceControlStats
Not exposing to ASurfaceControlStats

Bug: 141939081
Test: build, boot
Change-Id: If64056514be6b5161d52f5e8c2cc499bd8389099
2020-01-29 20:01:38 -08:00
Steven Thomas
6cf051ef89 Add setFrameRate() api
setFrameRate() is a new api in Android 11 that will enable apps to
specify their intended frame rate.

Bug: 143912624
Bug: 137287430

Test: Added a new CTS test - android.graphics.cts.SetFrameRateTest.

Change-Id: I922573c0d704e2e0ce4cfc2a462f14dce8cb7a79
2020-01-22 13:20:42 -08:00
Stan Iliev
5af5d3077f Refactor TextureLayer JNI to use only APEX APIs
Move ASurfaceTexture JNI implementation from libandroid to
libnativedisplay.
TextureLayer uses ASurfaceTexture_fromSurfaceTexture from
libnativedisplay instead of libandroid_runtime code.
libgui is no longer leaked through surface_texture_platform.h.
DeferredLayerUpdater uses ASurfaceTexture_release instead of
private ASurfaceTexture dtor.

Test: pass CtsUiRenderingTestCases and CtsViewTestCases
Bug: 147060713
Exempt-From-Owner-Approval: Changed only a header path in android_hardware_camera2_legacy_LegacyCameraDevice.cpp
Change-Id: I9720d9c383f8120f9db116fd2b74fc241af84396
2020-01-17 20:09:19 +00:00