diff options
Diffstat (limited to 'native')
-rw-r--r-- | native/android/Android.bp | 11 | ||||
-rw-r--r-- | native/android/libandroid.map.txt | 10 | ||||
-rw-r--r-- | native/android/surface_control.cpp | 48 | ||||
-rw-r--r-- | native/graphics/jni/Android.bp | 9 | ||||
-rw-r--r-- | native/webview/loader/Android.bp | 9 | ||||
-rw-r--r-- | native/webview/plat_support/Android.bp | 32 |
6 files changed, 113 insertions, 6 deletions
diff --git a/native/android/Android.bp b/native/android/Android.bp index 3daaf05fa8d5..9566b9242fc7 100644 --- a/native/android/Android.bp +++ b/native/android/Android.bp @@ -13,6 +13,15 @@ // limitations under the License. // The headers module is in frameworks/native/Android.bp. +package { + // See: http://go/android-license-faq + // A large-scale-change added 'default_applicable_licenses' to import + // all of the 'license_kinds' from "frameworks_base_license" + // to get the below license kinds: + // SPDX-license-identifier-Apache-2.0 + default_applicable_licenses: ["frameworks_base_license"], +} + ndk_library { name: "libandroid", symbol_file: "libandroid.map.txt", @@ -88,7 +97,7 @@ cc_library_shared { "libarect", ], - header_libs: [ "libhwui_internal_headers",], + header_libs: [ "libhwui_internal_headers", "libandroid_headers_private"], whole_static_libs: ["libnativewindow"], diff --git a/native/android/libandroid.map.txt b/native/android/libandroid.map.txt index 7a18bd5ae962..b01878b3070b 100644 --- a/native/android/libandroid.map.txt +++ b/native/android/libandroid.map.txt @@ -300,3 +300,13 @@ LIBANDROID { local: *; }; + +LIBANDROID_PLATFORM { + global: + extern "C++" { + ASurfaceControl_registerSurfaceStatsListener*; + ASurfaceControl_unregisterSurfaceStatsListener*; + ASurfaceControlStats_getAcquireTime*; + ASurfaceControlStats_getFrameNumber*; + }; +} LIBANDROID;
\ No newline at end of file diff --git a/native/android/surface_control.cpp b/native/android/surface_control.cpp index fe4753bd9dd6..e8cf63f64572 100644 --- a/native/android/surface_control.cpp +++ b/native/android/surface_control.cpp @@ -17,6 +17,7 @@ #include <android/hardware/configstore/1.0/ISurfaceFlingerConfigs.h> #include <android/native_window.h> #include <android/surface_control.h> +#include <surface_control_private.h> #include <configstore/Utils.h> @@ -195,6 +196,48 @@ void ASurfaceControl_release(ASurfaceControl* aSurfaceControl) { SurfaceControl_release(surfaceControl); } +struct ASurfaceControlStats { + int64_t acquireTime; + sp<Fence> previousReleaseFence; + uint64_t frameNumber; +}; + +void ASurfaceControl_registerSurfaceStatsListener(ASurfaceControl* control, void* context, + ASurfaceControl_SurfaceStatsListener func) { + SurfaceStatsCallback callback = [func](void* callback_context, + nsecs_t, + const sp<Fence>&, + const SurfaceStats& surfaceStats) { + + ASurfaceControlStats aSurfaceControlStats; + + ASurfaceControl* aSurfaceControl = + reinterpret_cast<ASurfaceControl*>(surfaceStats.surfaceControl.get()); + aSurfaceControlStats.acquireTime = surfaceStats.acquireTime; + aSurfaceControlStats.previousReleaseFence = surfaceStats.previousReleaseFence; + aSurfaceControlStats.frameNumber = surfaceStats.eventStats.frameNumber; + + (*func)(callback_context, aSurfaceControl, &aSurfaceControlStats); + }; + TransactionCompletedListener::getInstance()->addSurfaceStatsListener(context, + reinterpret_cast<void*>(func), ASurfaceControl_to_SurfaceControl(control), callback); +} + + +void ASurfaceControl_unregisterSurfaceStatsListener(void* context, + ASurfaceControl_SurfaceStatsListener func) { + TransactionCompletedListener::getInstance()->removeSurfaceStatsListener(context, + reinterpret_cast<void*>(func)); +} + +int64_t ASurfaceControlStats_getAcquireTime(ASurfaceControlStats* stats) { + return stats->acquireTime; +} + +uint64_t ASurfaceControlStats_getFrameNumber(ASurfaceControlStats* stats) { + return stats->frameNumber; +} + ASurfaceTransaction* ASurfaceTransaction_create() { Transaction* transaction = new Transaction; return reinterpret_cast<ASurfaceTransaction*>(transaction); @@ -213,11 +256,6 @@ void ASurfaceTransaction_apply(ASurfaceTransaction* aSurfaceTransaction) { transaction->apply(); } -typedef struct ASurfaceControlStats { - int64_t acquireTime; - sp<Fence> previousReleaseFence; -} ASurfaceControlStats; - struct ASurfaceTransactionStats { std::unordered_map<ASurfaceControl*, ASurfaceControlStats> aSurfaceControlStats; int64_t latchTime; diff --git a/native/graphics/jni/Android.bp b/native/graphics/jni/Android.bp index 3d633ea7089d..1709dfd973d6 100644 --- a/native/graphics/jni/Android.bp +++ b/native/graphics/jni/Android.bp @@ -12,6 +12,15 @@ // See the License for the specific language governing permissions and // limitations under the License. +package { + // See: http://go/android-license-faq + // A large-scale-change added 'default_applicable_licenses' to import + // all of the 'license_kinds' from "frameworks_base_license" + // to get the below license kinds: + // SPDX-license-identifier-Apache-2.0 + default_applicable_licenses: ["frameworks_base_license"], +} + cc_library_shared { name: "libjnigraphics", diff --git a/native/webview/loader/Android.bp b/native/webview/loader/Android.bp index dfa5bdde0785..bb9b8903273e 100644 --- a/native/webview/loader/Android.bp +++ b/native/webview/loader/Android.bp @@ -17,6 +17,15 @@ // Loader library which handles address space reservation and relro sharing. // Does NOT link any native chromium code. +package { + // See: http://go/android-license-faq + // A large-scale-change added 'default_applicable_licenses' to import + // all of the 'license_kinds' from "frameworks_base_license" + // to get the below license kinds: + // SPDX-license-identifier-Apache-2.0 + default_applicable_licenses: ["frameworks_base_license"], +} + cc_library_shared { name: "libwebviewchromium_loader", diff --git a/native/webview/plat_support/Android.bp b/native/webview/plat_support/Android.bp index 1a3b36d046e1..2e94e8452fdd 100644 --- a/native/webview/plat_support/Android.bp +++ b/native/webview/plat_support/Android.bp @@ -18,6 +18,38 @@ // Native support library (libwebviewchromium_plat_support.so) - does NOT link // any native chromium code. +package { + default_applicable_licenses: [ + "frameworks_base_native_webview_plat_support_license", + ], +} + +// Added automatically by a large-scale-change that took the approach of +// 'apply every license found to every target'. While this makes sure we respect +// every license restriction, it may not be entirely correct. +// +// e.g. GPL in an MIT project might only apply to the contrib/ directory. +// +// Please consider splitting the single license below into multiple licenses, +// taking care not to lose any license_kind information, and overriding the +// default license using the 'licenses: [...]' property on targets as needed. +// +// For unused files, consider creating a 'fileGroup' with "//visibility:private" +// to attach the license to, and including a comment whether the files may be +// used in the current project. +// See: http://go/android-license-faq +license { + name: "frameworks_base_native_webview_plat_support_license", + visibility: [":__subpackages__"], + license_kinds: [ + "SPDX-license-identifier-Apache-2.0", + "SPDX-license-identifier-BSD", + ], + license_text: [ + "LICENSE", + ], +} + cc_library_shared { name: "libwebviewchromium_plat_support", |