Loading apex/statsd/aidl/android/os/IPullAtomCallback.aidl +1 −1 Original line number Original line Diff line number Diff line Loading @@ -26,6 +26,6 @@ interface IPullAtomCallback { /** /** * Initiate a request for a pull for an atom. * Initiate a request for a pull for an atom. */ */ void onPullAtom(int atomTag, IPullAtomResultReceiver resultReceiver); oneway void onPullAtom(int atomTag, IPullAtomResultReceiver resultReceiver); } } apex/statsd/aidl/android/os/IStatsCompanionService.aidl +3 −0 Original line number Original line Diff line number Diff line Loading @@ -90,4 +90,7 @@ interface IStatsCompanionService { /** Tells StatsCompanionService to tell statsd to register a puller for the given atom id */ /** Tells StatsCompanionService to tell statsd to register a puller for the given atom id */ oneway void registerPullAtomCallback(int atomTag, long coolDownNs, long timeoutNs, oneway void registerPullAtomCallback(int atomTag, long coolDownNs, long timeoutNs, in int[] additiveFields, IPullAtomCallback pullerCallback); in int[] additiveFields, IPullAtomCallback pullerCallback); /** Tells StatsCompanionService to tell statsd to unregister a puller for the given atom id */ oneway void unregisterPullAtomCallback(int atomTag); } } apex/statsd/aidl/android/os/IStatsd.aidl +5 −0 Original line number Original line Diff line number Diff line Loading @@ -215,6 +215,11 @@ interface IStatsd { */ */ oneway void unregisterPullerCallback(int atomTag, String packageName); oneway void unregisterPullerCallback(int atomTag, String packageName); /** * Unregisters any pullAtomCallback for the given uid/atom. */ oneway void unregisterPullAtomCallback(int uid, int atomTag); /** /** * The install requires staging. * The install requires staging. */ */ Loading apex/statsd/service/java/com/android/server/stats/StatsCompanionService.java +24 −0 Original line number Original line Diff line number Diff line Loading @@ -2752,6 +2752,30 @@ public class StatsCompanionService extends IStatsCompanionService.Stub { } } } } @Override public void unregisterPullAtomCallback(int atomTag) { synchronized (sStatsdLock) { // Always remove the puller in SCS. // If statsd is down, we will not register it when it comes back up. int callingUid = Binder.getCallingUid(); final long token = Binder.clearCallingIdentity(); PullerKey key = new PullerKey(callingUid, atomTag); mPullers.remove(key); if (sStatsd == null) { Slog.w(TAG, "Could not access statsd for registering puller for atom " + atomTag); return; } try { sStatsd.unregisterPullAtomCallback(callingUid, atomTag); } catch (RemoteException e) { Slog.e(TAG, "Failed to access statsd to register puller for atom " + atomTag); } finally { Binder.restoreCallingIdentity(token); } } } // Statsd related code // Statsd related code /** /** Loading cmds/statsd/src/StatsService.cpp +7 −0 Original line number Original line Diff line number Diff line Loading @@ -1320,6 +1320,13 @@ Status StatsService::unregisterPullerCallback(int32_t atomTag, const String16& p return Status::ok(); return Status::ok(); } } Status StatsService::unregisterPullAtomCallback(int32_t uid, int32_t atomTag) { ENFORCE_UID(AID_SYSTEM); VLOG("StatsService::unregisterPullAtomCallback called."); mPullerManager->UnregisterPullAtomCallback(uid, atomTag); return Status::ok(); } Status StatsService::sendBinaryPushStateChangedAtom(const android::String16& trainNameIn, Status StatsService::sendBinaryPushStateChangedAtom(const android::String16& trainNameIn, const int64_t trainVersionCodeIn, const int64_t trainVersionCodeIn, const int options, const int options, Loading Loading
apex/statsd/aidl/android/os/IPullAtomCallback.aidl +1 −1 Original line number Original line Diff line number Diff line Loading @@ -26,6 +26,6 @@ interface IPullAtomCallback { /** /** * Initiate a request for a pull for an atom. * Initiate a request for a pull for an atom. */ */ void onPullAtom(int atomTag, IPullAtomResultReceiver resultReceiver); oneway void onPullAtom(int atomTag, IPullAtomResultReceiver resultReceiver); } }
apex/statsd/aidl/android/os/IStatsCompanionService.aidl +3 −0 Original line number Original line Diff line number Diff line Loading @@ -90,4 +90,7 @@ interface IStatsCompanionService { /** Tells StatsCompanionService to tell statsd to register a puller for the given atom id */ /** Tells StatsCompanionService to tell statsd to register a puller for the given atom id */ oneway void registerPullAtomCallback(int atomTag, long coolDownNs, long timeoutNs, oneway void registerPullAtomCallback(int atomTag, long coolDownNs, long timeoutNs, in int[] additiveFields, IPullAtomCallback pullerCallback); in int[] additiveFields, IPullAtomCallback pullerCallback); /** Tells StatsCompanionService to tell statsd to unregister a puller for the given atom id */ oneway void unregisterPullAtomCallback(int atomTag); } }
apex/statsd/aidl/android/os/IStatsd.aidl +5 −0 Original line number Original line Diff line number Diff line Loading @@ -215,6 +215,11 @@ interface IStatsd { */ */ oneway void unregisterPullerCallback(int atomTag, String packageName); oneway void unregisterPullerCallback(int atomTag, String packageName); /** * Unregisters any pullAtomCallback for the given uid/atom. */ oneway void unregisterPullAtomCallback(int uid, int atomTag); /** /** * The install requires staging. * The install requires staging. */ */ Loading
apex/statsd/service/java/com/android/server/stats/StatsCompanionService.java +24 −0 Original line number Original line Diff line number Diff line Loading @@ -2752,6 +2752,30 @@ public class StatsCompanionService extends IStatsCompanionService.Stub { } } } } @Override public void unregisterPullAtomCallback(int atomTag) { synchronized (sStatsdLock) { // Always remove the puller in SCS. // If statsd is down, we will not register it when it comes back up. int callingUid = Binder.getCallingUid(); final long token = Binder.clearCallingIdentity(); PullerKey key = new PullerKey(callingUid, atomTag); mPullers.remove(key); if (sStatsd == null) { Slog.w(TAG, "Could not access statsd for registering puller for atom " + atomTag); return; } try { sStatsd.unregisterPullAtomCallback(callingUid, atomTag); } catch (RemoteException e) { Slog.e(TAG, "Failed to access statsd to register puller for atom " + atomTag); } finally { Binder.restoreCallingIdentity(token); } } } // Statsd related code // Statsd related code /** /** Loading
cmds/statsd/src/StatsService.cpp +7 −0 Original line number Original line Diff line number Diff line Loading @@ -1320,6 +1320,13 @@ Status StatsService::unregisterPullerCallback(int32_t atomTag, const String16& p return Status::ok(); return Status::ok(); } } Status StatsService::unregisterPullAtomCallback(int32_t uid, int32_t atomTag) { ENFORCE_UID(AID_SYSTEM); VLOG("StatsService::unregisterPullAtomCallback called."); mPullerManager->UnregisterPullAtomCallback(uid, atomTag); return Status::ok(); } Status StatsService::sendBinaryPushStateChangedAtom(const android::String16& trainNameIn, Status StatsService::sendBinaryPushStateChangedAtom(const android::String16& trainNameIn, const int64_t trainVersionCodeIn, const int64_t trainVersionCodeIn, const int options, const int options, Loading