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

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

Snap for 6160382 from 366d217b to rvc-release

Change-Id: If171cf1724cd1711dafda7a40c7d229e0e7b794f
parents ba202308 366d217b
Loading
Loading
Loading
Loading
+15 −11
Original line number Diff line number Diff line
@@ -423,11 +423,12 @@ ssize_t ServiceManager::Service::getNodeStrongRefCount() {

void ServiceManager::handleClientCallbacks() {
    for (const auto& [name, service] : mNameToService) {
        handleServiceClientCallback(name);
        handleServiceClientCallback(name, true);
    }
}

ssize_t ServiceManager::handleServiceClientCallback(const std::string& serviceName) {
ssize_t ServiceManager::handleServiceClientCallback(const std::string& serviceName,
                                                    bool isCalledOnInterval) {
    auto serviceIt = mNameToService.find(serviceName);
    if (serviceIt == mNameToService.end() || mNameToClientCallback.count(serviceName) < 1) {
        return -1;
@@ -451,6 +452,8 @@ ssize_t ServiceManager::handleServiceClientCallback(const std::string& serviceNa
        service.guaranteeClient = false;
    }

    // only send notifications if this was called via the interval checking workflow
    if (isCalledOnInterval) {
        if (hasClients && !service.hasClients) {
            // client was retrieved in some other way
            sendClientCallbackNotifications(serviceName, true);
@@ -460,6 +463,7 @@ ssize_t ServiceManager::handleServiceClientCallback(const std::string& serviceNa
        if (!hasClients && service.hasClients) {
            sendClientCallbackNotifications(serviceName, false);
        }
    }

    return count;
}
@@ -518,7 +522,7 @@ Status ServiceManager::tryUnregisterService(const std::string& name, const sp<IB
        return Status::fromExceptionCode(Status::EX_ILLEGAL_STATE);
    }

    int clients = handleServiceClientCallback(name);
    int clients = handleServiceClientCallback(name, false);

    // clients < 0: feature not implemented or other error. Assume clients.
    // Otherwise:
@@ -527,7 +531,7 @@ Status ServiceManager::tryUnregisterService(const std::string& name, const sp<IB
    // So, if clients > 2, then at least one other service on the system must hold a refcount.
    if (clients < 0 || clients > 2) {
        // client callbacks are either disabled or there are other clients
        LOG(INFO) << "Tried to unregister " << name << " but there are clients: " << clients;
        LOG(INFO) << "Tried to unregister " << name << ", but there are clients: " << clients;
        return Status::fromExceptionCode(Status::EX_ILLEGAL_STATE);
    }

+1 −1
Original line number Diff line number Diff line
@@ -75,7 +75,7 @@ private:
    void removeRegistrationCallback(const wp<IBinder>& who,
                        ServiceCallbackMap::iterator* it,
                        bool* found);
    ssize_t handleServiceClientCallback(const std::string& serviceName);
    ssize_t handleServiceClientCallback(const std::string& serviceName, bool isCalledOnInterval);
     // Also updates mHasClients (of what the last callback was)
    void sendClientCallbackNotifications(const std::string& serviceName, bool hasClients);
    // removes a callback from mNameToClientCallback, deleting the entry if the vector is empty
+4 −0
Original line number Diff line number Diff line
@@ -245,6 +245,10 @@ enum {
     * {@link ASENSOR_TYPE_ACCELEROMETER_UNCALIBRATED}
     */
    ASENSOR_TYPE_ACCELEROMETER_UNCALIBRATED = 35,
    /**
     * {@link ASENSOR_TYPE_HINGE_ANGLE}
     */
    ASENSOR_TYPE_HINGE_ANGLE = 36,
};

/**
+5 −5
Original line number Diff line number Diff line
@@ -419,11 +419,11 @@ void ASurfaceTransaction_setHdrMetadata_cta861_3(ASurfaceTransaction* transactio
 * callback timings, and changes to the time interval at which the system releases buffers back to
 * the application.
 *
 * |frameRate| is the intended frame rate of this surface. 0 is a special value that indicates the
 * app will accept the system's choice for the display frame rate, which is the default behavior if
 * this function isn't called. The frameRate param does *not* need to be a valid refresh rate for
 * this device's display - e.g., it's fine to pass 30fps to a device that can only run the display
 * at 60fps.
 * |frameRate| is the intended frame rate of this surface, in frames per second. 0 is a special
 * value that indicates the app will accept the system's choice for the display frame rate, which is
 * the default behavior if this function isn't called. The frameRate param does *not* need to be a
 * valid refresh rate for this device's display - e.g., it's fine to pass 30fps to a device that can
 * only run the display at 60fps.
 *
 * Available since API level 30.
 */
Loading