Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d9ff327e authored by Alec Mouri's avatar Alec Mouri
Browse files

[libnativedisplay] Cleanup map file usage

* Update Android.bp to use the map.txt file as a version script
* Move ADisplay stubs into c++ stubs, since they don't need to be
formally stable as long as they're treated as stable in practice.

Bug: 136262896
Test: builds
Change-Id: I17a1fb758e318e959538ba4bda32b886a5423d82
parent 4991c597
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -129,6 +129,8 @@ int64_t computeSfOffset(const DisplayInfo& info) {
}
} // namespace

namespace android {

int ADisplay_acquirePhysicalDisplays(ADisplay*** outDisplays) {
    const std::vector<PhysicalDisplayId> ids = SurfaceComposerClient::getPhysicalDisplayIds();
    const size_t size = ids.size();
@@ -298,3 +300,5 @@ int64_t ADisplayConfig_getAppVsyncOffsetNanos(ADisplayConfig* config) {

    return reinterpret_cast<DisplayConfigImpl*>(config)->appOffset;
}

} // namespace android
+2 −0
Original line number Diff line number Diff line
@@ -40,6 +40,8 @@ cc_library {
        "-Wno-unused-function",
    ],

    version_script: "libnativedisplay.map.txt",

    srcs: [
        "AChoreographer.cpp",
        "ADisplay.cpp",
+8 −2
Original line number Diff line number Diff line
@@ -20,7 +20,12 @@
#include <android/hardware_buffer.h>
#include <inttypes.h>

__BEGIN_DECLS
// TODO: the intention of these apis is to be stable - hence they are defined in
// an apex directory. But because they don't yet need to be stable, hold off on
// making them stable until a Mainline module needs them.
// __BEGIN_DECLS

namespace android {

/**
 * Opaque handle for a native display
@@ -130,4 +135,5 @@ int64_t ADisplayConfig_getCompositorOffsetNanos(ADisplayConfig* config);
 */
int64_t ADisplayConfig_getAppVsyncOffsetNanos(ADisplayConfig* config);

__END_DECLS
} // namespace android
// __END_DECLS
+22 −0
Original line number Diff line number Diff line
@@ -7,6 +7,28 @@ LIBNATIVEDISPLAY {
    AChoreographer_postFrameCallbackDelayed64; # apex # introduced=30
    AChoreographer_registerRefreshRateCallback; # apex # introduced=30
    AChoreographer_unregisterRefreshRateCallback; # apex # introduced=30
    AChoreographer_create; # apex # introduced=30
    AChoreographer_destroy; # apex # introduced=30
    AChoreographer_getFd; # apex # introduced=30
    AChoreographer_handlePendingEvents; # apex # introduced=30
  local:
    *;
};

LIBNATIVEDISPLAY_PLATFORM {
  global:
    extern "C++" {
      android::ADisplay_acquirePhysicalDisplays*;
      android::ADisplay_release*;
      android::ADisplay_getMaxSupportedFps*;
      android::ADisplay_getDisplayType*;
      android::ADisplay_getPreferredWideColorFormat*;
      android::ADisplay_getCurrentConfig*;
      android::ADisplayConfig_getDensity*;
      android::ADisplayConfig_getWidth*;
      android::ADisplayConfig_getHeight*;
      android::ADisplayConfig_getFps*;
      android::ADisplayConfig_getCompositorOffsetNanos*;
      android::ADisplayConfig_getAppVsyncOffsetNanos*;
    };
} LIBNATIVEDISPLAY;