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

Commit 13fff930 authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 11666018 from efd55b1a to 24Q3-release

Change-Id: I12ecdf3f3b3664f95ca32951b146860ee6a5f2b2
parents 5eb4d8db efd55b1a
Loading
Loading
Loading
Loading
+3 −5
Original line number Diff line number Diff line
@@ -33,11 +33,9 @@
  <distance-noise-floor>0.2</distance-noise-floor>
  <!-- The low and high jerk thresholds for prediction pruning.

    The jerk thresholds are based on normalized dt = 1 calculations, and
    are taken from Jetpacks MotionEventPredictor's KalmanPredictor
    implementation (using its ACCURATE_LOW_JANK and ACCURATE_HIGH_JANK).
    The jerk thresholds are based on normalized dt = 1 calculations.
  -->
  <low-jerk>0.1</low-jerk>
  <high-jerk>0.2</high-jerk>
  <low-jerk>1.0</low-jerk>
  <high-jerk>1.1</high-jerk>
</motion-predictor>
+27 −0
Original line number Diff line number Diff line
@@ -199,4 +199,31 @@ status_t getBinderClientPids(BinderDebugContext context, pid_t pid, pid_t servic
    return ret;
}

status_t getBinderTransactions(pid_t pid, std::string& transactionsOutput) {
    std::ifstream ifs("/dev/binderfs/binder_logs/transactions");
    if (!ifs.is_open()) {
        ifs.open("/d/binder/transactions");
        if (!ifs.is_open()) {
            LOG(ERROR) << "Could not open /dev/binderfs/binder_logs/transactions. "
                       << "Likely a permissions issue. errno: " << errno;
            return -errno;
        }
    }

    std::string line;
    while (getline(ifs, line)) {
        // The section for this pid ends with another "proc <pid>" for another
        // process. There is only one entry per pid so we can stop looking after
        // we've grabbed the whole section
        if (base::StartsWith(line, "proc " + std::to_string(pid))) {
            do {
                transactionsOutput += line + '\n';
            } while (getline(ifs, line) && !base::StartsWith(line, "proc "));
            return OK;
        }
    }

    return NAME_NOT_FOUND;
}

} // namespace  android
+8 −0
Original line number Diff line number Diff line
@@ -44,4 +44,12 @@ status_t getBinderPidInfo(BinderDebugContext context, pid_t pid, BinderPidInfo*
status_t getBinderClientPids(BinderDebugContext context, pid_t pid, pid_t servicePid,
                             int32_t handle, std::vector<pid_t>* pids);

/**
 * Get the transactions for a given process from /dev/binderfs/binder_logs/transactions
 * Return: OK if the file was found and the pid was found in the file.
 *         -errno if there was an issue opening the file
 *         NAME_NOT_FOUND if the pid wasn't found in the file
 */
status_t getBinderTransactions(pid_t pid, std::string& transactionOutput);

} // namespace  android
+6 −6
Original line number Diff line number Diff line
@@ -291,12 +291,12 @@ TEST_WITH_FLAGS(
    MotionPredictor predictor(/*predictionTimestampOffsetNanos=*/0,
                              []() { return true /*enable prediction*/; });

    // Jerk is medium (1.5 normalized, which is halfway between LOW_JANK and HIGH_JANK)
    predictor.record(getMotionEvent(DOWN, 0, 4, 20ms));
    predictor.record(getMotionEvent(MOVE, 0, 6.25, 30ms));
    predictor.record(getMotionEvent(MOVE, 0, 9.4, 40ms));
    predictor.record(getMotionEvent(MOVE, 0, 13.6, 50ms));
    predictor.record(getMotionEvent(MOVE, 0, 19, 60ms));
    // Jerk is medium (1.05 normalized, which is halfway between LOW_JANK and HIGH_JANK)
    predictor.record(getMotionEvent(DOWN, 0, 5.2, 20ms));
    predictor.record(getMotionEvent(MOVE, 0, 11.5, 30ms));
    predictor.record(getMotionEvent(MOVE, 0, 22, 40ms));
    predictor.record(getMotionEvent(MOVE, 0, 37.75, 50ms));
    predictor.record(getMotionEvent(MOVE, 0, 59.8, 60ms));
    std::unique_ptr<MotionEvent> predicted = predictor.predict(82 * NSEC_PER_MSEC);
    EXPECT_NE(nullptr, predicted);
    // Halfway between LOW_JANK and HIGH_JANK means that half of the predictions
+11 −5
Original line number Diff line number Diff line
@@ -147,6 +147,7 @@ NotifyMotionArgs PointerChoreographer::processMouseEventLocked(const NotifyMotio
                   << args.dump();
    }

    mMouseDevices.emplace(args.deviceId);
    auto [displayId, pc] = ensureMouseControllerLocked(args.displayId);
    NotifyMotionArgs newArgs(args);
    newArgs.displayId = displayId;
@@ -178,6 +179,7 @@ NotifyMotionArgs PointerChoreographer::processMouseEventLocked(const NotifyMotio
}

NotifyMotionArgs PointerChoreographer::processTouchpadEventLocked(const NotifyMotionArgs& args) {
    mMouseDevices.emplace(args.deviceId);
    auto [displayId, pc] = ensureMouseControllerLocked(args.displayId);

    NotifyMotionArgs newArgs(args);
@@ -405,8 +407,10 @@ std::pair<int32_t, PointerControllerInterface&> PointerChoreographer::ensureMous
    const int32_t displayId = getTargetMouseDisplayLocked(associatedDisplayId);

    auto it = mMousePointersByDisplay.find(displayId);
    LOG_ALWAYS_FATAL_IF(it == mMousePointersByDisplay.end(),
                        "There is no mouse controller created for display %d", displayId);
    if (it == mMousePointersByDisplay.end()) {
        it = mMousePointersByDisplay.emplace(displayId, getMouseControllerConstructor(displayId))
                     .first;
    }

    return {displayId, *it->second};
}
@@ -431,7 +435,9 @@ PointerChoreographer::PointerDisplayChange PointerChoreographer::updatePointerCo
    // new PointerControllers if necessary.
    for (const auto& info : mInputDeviceInfos) {
        const uint32_t sources = info.getSources();
        if (isMouseOrTouchpad(sources)) {
        const bool isKnownMouse = mMouseDevices.count(info.getId()) != 0;

        if (isMouseOrTouchpad(sources) || isKnownMouse) {
            const int32_t displayId = getTargetMouseDisplayLocked(info.getAssociatedDisplayId());
            mouseDisplaysToKeep.insert(displayId);
            // For mice, show the cursor immediately when the device is first connected or
@@ -439,8 +445,8 @@ PointerChoreographer::PointerDisplayChange PointerChoreographer::updatePointerCo
            auto [mousePointerIt, isNewMousePointer] =
                    mMousePointersByDisplay.try_emplace(displayId,
                                                        getMouseControllerConstructor(displayId));
            auto [_, isNewMouseDevice] = mMouseDevices.emplace(info.getId());
            if ((isNewMouseDevice || isNewMousePointer) && canUnfadeOnDisplay(displayId)) {
            mMouseDevices.emplace(info.getId());
            if ((!isKnownMouse || isNewMousePointer) && canUnfadeOnDisplay(displayId)) {
                mousePointerIt->second->unfade(PointerControllerInterface::Transition::IMMEDIATE);
            }
        }
Loading