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

Commit 73d4ce46 authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 7318334 from cfd247d3 to sc-release

Change-Id: If2a3a91ab1afba6078cd1f459b41763521a41c94
parents 9a5d6908 cfd247d3
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -739,6 +739,9 @@ int32_t AImageDecoder_getRepeatCount(AImageDecoder* _Nonnull decoder)
 * skipping frames in an image with such frames may not produce the correct
 * results.
 *
 * Only supported by {@link ANDROID_BITMAP_FORMAT_RGBA_8888} and
 * {@link ANDROID_BITMAP_FORMAT_RGBA_F16}.
 *
 * @param decoder an {@link AImageDecoder} object.
 * @return {@link ANDROID_IMAGE_DECODER_SUCCESS} on success or a value
 *         indicating the reason for the failure.
@@ -747,6 +750,8 @@ int32_t AImageDecoder_getRepeatCount(AImageDecoder* _Nonnull decoder)
 * - {@link ANDROID_IMAGE_DECODER_BAD_PARAMETER}: The AImageDecoder
 *   represents an image that is not animated (see
 *   {@link AImageDecoder_isAnimated}) or the AImageDecoder is null.
 * - {@link ANDROID_IMAGE_DECODER_INVALID_STATE): The requested
 *   {@link AndroidBitmapFormat} does not support animation.
 * - {@link ANDROID_IMAGE_DECODER_INCOMPLETE}: The input appears
 *   to be truncated. The client must call {@link AImageDecoder_rewind}
 *   before calling {@link AImageDecoder_decodeImage} again.
+5 −4
Original line number Diff line number Diff line
@@ -534,11 +534,12 @@ void ASurfaceTransaction_setFrameRate(ASurfaceTransaction* transaction,
 *
 * \param compatibility The frame rate compatibility of this surface. The compatibility value may
 * influence the system's choice of display frame rate. To specify a compatibility use the
 * ANATIVEWINDOW_FRAME_RATE_COMPATIBILITY_* enum.
 * ANATIVEWINDOW_FRAME_RATE_COMPATIBILITY_* enum. This parameter is ignored when frameRate is 0.
 *
 * \param changeFrameRateStrategy Whether display refresh rate transitions should be seamless.
 * A seamless transition is one that doesn't have any visual interruptions, such as a black
 * screen for a second or two. See the ANATIVEWINDOW_CHANGE_FRAME_RATE_* values.
 * \param changeFrameRateStrategy Whether display refresh rate transitions caused by this
 * surface should be seamless. A seamless transition is one that doesn't have any visual
 * interruptions, such as a black screen for a second or two. See the
 * ANATIVEWINDOW_CHANGE_FRAME_RATE_* values. This parameter is ignored when frameRate is 0.
 *
 * Available since API level 31.
 */
+5 −0
Original line number Diff line number Diff line
@@ -109,5 +109,10 @@ bool PermissionCache::checkPermission(
    return granted;
}

void PermissionCache::purgeCache() {
    PermissionCache& pc(PermissionCache::getInstance());
    pc.purge();
}

// ---------------------------------------------------------------------------
} // namespace android
+15 −18
Original line number Diff line number Diff line
@@ -130,24 +130,21 @@ bool RpcConnection::addVsockClient(unsigned int cid, unsigned int port) {

#endif // __BIONIC__

class SocketAddressImpl : public RpcConnection::SocketAddress {
class InetSocketAddress : public RpcConnection::SocketAddress {
public:
    SocketAddressImpl(const sockaddr* addr, size_t size, const String8& desc)
          : mAddr(addr), mSize(size), mDesc(desc) {}
    InetSocketAddress(const sockaddr* sockAddr, size_t size, const char* addr, unsigned int port)
          : mSockAddr(sockAddr), mSize(size), mAddr(addr), mPort(port) {}
    [[nodiscard]] std::string toString() const override {
        return std::string(mDesc.c_str(), mDesc.size());
        return String8::format("%s:%u", mAddr, mPort).c_str();
    }
    [[nodiscard]] const sockaddr* addr() const override { return mAddr; }
    [[nodiscard]] const sockaddr* addr() const override { return mSockAddr; }
    [[nodiscard]] size_t addrSize() const override { return mSize; }
    void set(const sockaddr* addr, size_t size) {
        mAddr = addr;
        mSize = size;
    }

private:
    const sockaddr* mAddr = nullptr;
    size_t mSize = 0;
    String8 mDesc;
    const sockaddr* mSockAddr;
    size_t mSize;
    const char* mAddr;
    unsigned int mPort;
};

AddrInfo GetAddrInfo(const char* addr, unsigned int port) {
@@ -170,14 +167,15 @@ AddrInfo GetAddrInfo(const char* addr, unsigned int port) {
}

bool RpcConnection::setupInetServer(unsigned int port) {
    auto aiStart = GetAddrInfo("127.0.0.1", port);
    const char* kAddr = "127.0.0.1";

    auto aiStart = GetAddrInfo(kAddr, port);
    if (aiStart == nullptr) return false;
    SocketAddressImpl socketAddress(nullptr, 0, String8::format("127.0.0.1:%u", port));
    for (auto ai = aiStart.get(); ai != nullptr; ai = ai->ai_next) {
        socketAddress.set(ai->ai_addr, ai->ai_addrlen);
        InetSocketAddress socketAddress(ai->ai_addr, ai->ai_addrlen, kAddr, port);
        if (setupSocketServer(socketAddress)) return true;
    }
    ALOGE("None of the socket address resolved for 127.0.0.1:%u can be set up as inet server.",
    ALOGE("None of the socket address resolved for %s:%u can be set up as inet server.", kAddr,
          port);
    return false;
}
@@ -185,9 +183,8 @@ bool RpcConnection::setupInetServer(unsigned int port) {
bool RpcConnection::addInetClient(const char* addr, unsigned int port) {
    auto aiStart = GetAddrInfo(addr, port);
    if (aiStart == nullptr) return false;
    SocketAddressImpl socketAddress(nullptr, 0, String8::format("%s:%u", addr, port));
    for (auto ai = aiStart.get(); ai != nullptr; ai = ai->ai_next) {
        socketAddress.set(ai->ai_addr, ai->ai_addrlen);
        InetSocketAddress socketAddress(ai->ai_addr, ai->ai_addrlen, addr, port);
        if (addSocketClient(socketAddress)) return true;
    }
    ALOGE("None of the socket address resolved for %s:%u can be added as inet client.", addr, port);
+2 −0
Original line number Diff line number Diff line
@@ -73,6 +73,8 @@ public:

    static bool checkPermission(const String16& permission,
            pid_t pid, uid_t uid);

    static void purgeCache();
};

// ---------------------------------------------------------------------------
Loading