Remove extra indirection in native puller API
The indirection is unneeded since we already take a function pointer.
Test: builds
Change-Id: Ice426d7dcb090aaf87a377ede233a4eb18f5eb30
diff --git a/libstats/pull/include/stats_pull_atom_callback.h b/libstats/pull/include/stats_pull_atom_callback.h
index 6369b84..530b489 100644
--- a/libstats/pull/include/stats_pull_atom_callback.h
+++ b/libstats/pull/include/stats_pull_atom_callback.h
@@ -38,7 +38,7 @@
const void* cookie);
struct stats_event* add_stats_event_to_pull_data(pulled_stats_event_list* pull_data);
-void register_stats_pull_atom_callback(int32_t atom_tag, stats_pull_atom_callback_t* callback,
+void register_stats_pull_atom_callback(int32_t atom_tag, stats_pull_atom_callback_t callback,
pull_atom_metadata* metadata, void* cookie);
#ifdef __cplusplus
diff --git a/libstats/pull/stats_pull_atom_callback.cpp b/libstats/pull/stats_pull_atom_callback.cpp
index 177bbba..f3a0ac5 100644
--- a/libstats/pull/stats_pull_atom_callback.cpp
+++ b/libstats/pull/stats_pull_atom_callback.cpp
@@ -42,7 +42,7 @@
class StatsPullAtomCallbackInternal : public android::os::BnPullAtomCallback {
public:
- StatsPullAtomCallbackInternal(const stats_pull_atom_callback_t* callback, const void* cookie,
+ StatsPullAtomCallbackInternal(const stats_pull_atom_callback_t callback, const void* cookie,
const int64_t coolDownNs, const int64_t timeoutNs,
const std::vector<int32_t> additiveFields)
: mCallback(callback),
@@ -55,7 +55,7 @@
int32_t atomTag,
const ::android::sp<::android::os::IPullAtomResultReceiver>& resultReceiver) override {
pulled_stats_event_list statsEventList;
- bool success = (*mCallback)(atomTag, &statsEventList, mCookie);
+ bool success = mCallback(atomTag, &statsEventList, mCookie);
// Convert stats_events into StatsEventParcels.
std::vector<android::util::StatsEventParcel> parcels;
@@ -82,7 +82,7 @@
const std::vector<int32_t>& getAdditiveFields() const { return mAdditiveFields; }
private:
- const stats_pull_atom_callback_t* mCallback;
+ const stats_pull_atom_callback_t mCallback;
const void* mCookie;
const int64_t mCoolDownNs;
const int64_t mTimeoutNs;
@@ -134,7 +134,7 @@
return sStatsd;
}
-void register_stats_pull_atom_callback(int32_t atom_tag, stats_pull_atom_callback_t* callback,
+void register_stats_pull_atom_callback(int32_t atom_tag, stats_pull_atom_callback_t callback,
pull_atom_metadata* metadata, void* cookie) {
int64_t coolDownNs = metadata == nullptr ? DEFAULT_COOL_DOWN_NS : metadata->cool_down_ns;
int64_t timeoutNs = metadata == nullptr ? DEFAULT_TIMEOUT_NS : metadata->timeout_ns;