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

Commit 59ddead9 authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 13677809 from 5953c8ae to 25Q4-release

Change-Id: I7c92f16020e628568245f27764cbd606d9d3e823
parents ae35b0e0 5953c8ae
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -676,6 +676,9 @@ status_t RpcState::transactAddress(const sp<RpcSession::RpcConnection>& connecti
            waitUs = 1;
        }

        // This is restricted to "CONTROL_ONLY" because we should not receive any
        // nested transactions until the entire transaction is sent and starts
        // executing.
        return drainCommands(connection, session, CommandType::CONTROL_ONLY);
    };
    if (status_t status = rpcSend(connection, session, "transaction", iovs, countof(iovs),
@@ -899,7 +902,12 @@ status_t RpcState::processCommand(

    switch (command.command) {
        case RPC_COMMAND_TRANSACT:
            if (type != CommandType::ANY) return BAD_TYPE;
            if (type != CommandType::ANY) {
                ALOGE("CommandType %d, but got RPC command %d.", static_cast<int>(type),
                      command.command);
                (void)session->shutdownAndWait(false);
                return BAD_TYPE;
            }
            result = processTransact(connection, session, command, std::move(ancillaryFds));
            break;
        case RPC_COMMAND_DEC_STRONG:
+10 −2
Original line number Diff line number Diff line
@@ -81,19 +81,27 @@ interface IPackageManagerNative {
     */
     int getPackageUid(in @utf8InCpp String packageName, in long flags, in int userId);

    /**
     * Checks whether the specified package has the specified permission.
     *
     * @param permName The name of the permission you are checking for.
     * @param packageName The name of the package you are checking against.
     * @return If the package has the permission, PERMISSION_GRANTED (0) is returned.  If it
     *         does not have the permission, PERMISSION_DENIED (1) is returned.
     */
    int checkPermission(in String permName, in String packageName, in int userId);

    /**
     * Returns the name of the installer (a package) which installed the named
     * package. Preloaded packages return the string "preload". Sideloaded packages
     * return an empty string. Unknown or unknowable are returned as empty strings.
     */

    @utf8InCpp String getInstallerForPackage(in String packageName);

    /**
     * Returns the version code of the named package.
     * Unknown or unknowable versions are returned as 0.
     */

    long getVersionCodeForPackage(in String packageName);

    /**
+41 −21
Original line number Diff line number Diff line
@@ -82,10 +82,11 @@ SensorFusion::SensorFusion()

void SensorFusion::process(const sensors_event_t& event) {
    // sensor additional info is not currently used in fusion algorithm
    if (event.type == SENSOR_TYPE_ADDITIONAL_INFO)
    if (event.type == SENSOR_TYPE_ADDITIONAL_INFO) {
        return;
    }

    if (event.sensor == mGyro.getHandle()) {
    if (mGyro.has_value() && event.sensor == mGyro.value().getHandle()) {
        float dT;
        if (event.timestamp - mGyroTime > 0 &&
            event.timestamp - mGyroTime < (int64_t)(5e7) ) { // 0.05sec
@@ -107,19 +108,20 @@ void SensorFusion::process(const sensors_event_t& event) {
            }
        }
        mGyroTime = event.timestamp;
    } else if (event.sensor == mMag.getHandle()) {
    } else if (mMag.has_value() && event.sensor == mMag.value().getHandle()) {
        const vec3_t mag(event.data);
        for (int i = 0; i < NUM_FUSION_MODE; ++i) {
            if (mEnabled[i]) {
                mFusions[i].handleMag(mag);// fusion in no mag mode will ignore
                // fusion in no mag mode will ignore
                mFusions[i].handleMag(mag);
            }
        }
    } else if (event.sensor == mAcc.getHandle()) {
        float dT;
        if (event.timestamp - mAccTime > 0 &&
            event.timestamp - mAccTime < (int64_t)(1e8) ) { // 0.1sec
            dT = (event.timestamp - mAccTime) / 1000000000.0f;

            dT = (event.timestamp - mAccTime) / 1000000000.0f;
            const vec3_t acc(event.data);
            for (int i = 0; i < NUM_FUSION_MODE; ++i) {
                if (mEnabled[i]) {
@@ -160,14 +162,22 @@ status_t SensorFusion::activate(int mode, void* ident, bool enabled) {
        }
    }

    if (mode != FUSION_NOMAG && !mMag.has_value()) {
        ALOGE("%s: magnetic sensor is expected but not present!", __func__);
        return NO_INIT;
    }
    if (mode != FUSION_NOGYRO && !mGyro.has_value()) {
        ALOGE("%s: gyroscope is expected but not present!", __func__);
        return NO_INIT;
    }

    mSensorDevice.activate(ident, mAcc.getHandle(), enabled);
    if (mode != FUSION_NOMAG) {
        mSensorDevice.activate(ident, mMag.getHandle(), enabled);
        mSensorDevice.activate(ident, mMag.value().getHandle(), enabled);
    }
    if (mode != FUSION_NOGYRO) {
        mSensorDevice.activate(ident, mGyro.getHandle(), enabled);
        mSensorDevice.batch(ident, mGyro.value().getHandle(), 0, mTargetDelayNs, 0);
    }

    return NO_ERROR;
}

@@ -176,12 +186,22 @@ status_t SensorFusion::setDelay(int mode, void* ident, int64_t ns) {
    if (ns > (int64_t)5e7) {
        ns = (int64_t)(5e7);
    }

    if (mode != FUSION_NOMAG && !mMag.has_value()) {
        ALOGE("%s: magnetic sensor is expected but not present!", __func__);
        return NO_INIT;
    }
    if (mode != FUSION_NOGYRO && !mGyro.has_value()) {
        ALOGE("%s: gyroscope is expected but not present!", __func__);
        return NO_INIT;
    }

    mSensorDevice.batch(ident, mAcc.getHandle(), 0, ns, 0);
    if (mode != FUSION_NOMAG) {
        mSensorDevice.batch(ident, mMag.getHandle(), 0, ms2ns(10), 0);
        mSensorDevice.batch(ident, mMag.value().getHandle(), 0, ms2ns(10), 0);
    }
    if (mode != FUSION_NOGYRO) {
        mSensorDevice.batch(ident, mGyro.getHandle(), 0, mTargetDelayNs, 0);
        mSensorDevice.batch(ident, mGyro.value().getHandle(), 0, mTargetDelayNs, 0);
    }
    return NO_ERROR;
}
@@ -189,8 +209,8 @@ status_t SensorFusion::setDelay(int mode, void* ident, int64_t ns) {

float SensorFusion::getPowerUsage(int mode) const {
    float power =   mAcc.getPowerUsage() +
                    ((mode != FUSION_NOMAG) ? mMag.getPowerUsage() : 0) +
                    ((mode != FUSION_NOGYRO) ? mGyro.getPowerUsage() : 0);
                    ((mode != FUSION_NOMAG) ? mMag.value().getPowerUsage() : 0) +
                    ((mode != FUSION_NOGYRO) ? mGyro.value().getPowerUsage() : 0);
    return power;
}

+2 −2
Original line number Diff line number Diff line
@@ -42,8 +42,8 @@ class SensorFusion : public Singleton<SensorFusion> {

    SensorDevice& mSensorDevice;
    Sensor mAcc;
    Sensor mMag;
    Sensor mGyro;
    std::optional<Sensor> mMag;
    std::optional<Sensor> mGyro;

    Fusion mFusions[NUM_FUSION_MODE]; // normal, no_mag, no_gyro

+4 −1
Original line number Diff line number Diff line
@@ -4832,7 +4832,10 @@ void SurfaceFlinger::setTransactionFlags(uint32_t mask, TransactionSchedule sche
    SFTRACE_INT("mTransactionFlags", transactionFlags);

    if (const bool scheduled = transactionFlags & mask; !scheduled) {
        if (FlagManager::getInstance().resync_on_tx()) { mScheduler->resync(); }
        if (FlagManager::getInstance().resync_on_tx() &&
                FlagManager::getInstance().vsync_predictor_predicts_within_threshold()) {
            mScheduler->resync();
        }
        scheduleCommit(frameHint);
    } else if (frameHint == FrameHint::kActive) {
        // Even if the next frame is already scheduled, we should reset the idle timer
Loading