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

Commit addd10c6 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Binder API for native pulled atoms"

parents c4459238 b7802511
Loading
Loading
Loading
Loading
+12 −1
Original line number Diff line number Diff line
@@ -1295,7 +1295,18 @@ Status StatsService::registerPullAtomCallback(int32_t uid, int32_t atomTag, int6
                                    const sp<android::os::IPullAtomCallback>& pullerCallback) {
    ENFORCE_UID(AID_SYSTEM);

    VLOG("StatsService::registerPuller called.");
    VLOG("StatsService::registerPullAtomCallback called.");
    mPullerManager->RegisterPullAtomCallback(uid, atomTag, coolDownNs, timeoutNs, additiveFields,
                                             pullerCallback);
    return Status::ok();
}

Status StatsService::registerNativePullAtomCallback(int32_t atomTag, int64_t coolDownNs,
                                    int64_t timeoutNs, const std::vector<int32_t>& additiveFields,
                                    const sp<android::os::IPullAtomCallback>& pullerCallback) {

    VLOG("StatsService::registerNativePullAtomCallback called.");
    int32_t uid = IPCThreadState::self()->getCallingUid();
    mPullerManager->RegisterPullAtomCallback(uid, atomTag, coolDownNs, timeoutNs, additiveFields,
                                             pullerCallback);
    return Status::ok();
+7 −0
Original line number Diff line number Diff line
@@ -186,6 +186,13 @@ public:
            int64_t timeoutNs, const std::vector<int32_t>& additiveFields,
            const sp<android::os::IPullAtomCallback>& pullerCallback) override;

    /**
     * Binder call to register a callback function for a pulled atom.
     */
    virtual Status registerNativePullAtomCallback(int32_t atomTag, int64_t coolDownNs,
            int64_t timeoutNs, const std::vector<int32_t>& additiveFields,
            const sp<android::os::IPullAtomCallback>& pullerCallback) override;

    /**
     * Binder call to unregister any existing callback function for a vendor pulled atom.
     */
+1 −1
Original line number Diff line number Diff line
@@ -86,7 +86,7 @@ bool CombinationConditionTracker::init(const vector<Predicate>& allConditionConf
            ALOGW("Child initialization failed %lld ", (long long)child);
            return false;
        } else {
            ALOGW("Child initialization success %lld ", (long long)child);
            VLOG("Child initialization success %lld ", (long long)child);
        }

        if (allConditionTrackers[childIndex]->isSliced()) {
+7 −0
Original line number Diff line number Diff line
@@ -201,6 +201,13 @@ interface IStatsManager {
    oneway void registerPullAtomCallback(int uid, int atomTag, long coolDownNs, long timeoutNs,
                           in int[] additiveFields, IPullAtomCallback pullerCallback);

   /**
    * Registers a puller callback function that, when invoked, pulls the data
    * for the specified atom tag.
    */
    oneway void registerNativePullAtomCallback(int atomTag, long coolDownNs, long timeoutNs,
                           in int[] additiveFields, IPullAtomCallback pullerCallback);

   /**
    * Unregisters a puller callback function for the given vendor atom.
    *