Loading include/batteryservice/IBatteryPropertiesListener.h +6 −0 Original line number Diff line number Diff line Loading @@ -40,6 +40,12 @@ public: // ---------------------------------------------------------------------------- class BnBatteryPropertiesListener: public BnInterface<IBatteryPropertiesListener> { public: virtual status_t onTransact(uint32_t code, const Parcel& data, Parcel* reply, uint32_t flags = 0); }; }; // namespace android #endif // ANDROID_IBATTERYPROPERTIESLISTENER_H services/batteryservice/IBatteryPropertiesListener.cpp +18 −0 Original line number Diff line number Diff line Loading @@ -43,4 +43,22 @@ IMPLEMENT_META_INTERFACE(BatteryPropertiesListener, "android.os.IBatteryProperti // ---------------------------------------------------------------------------- status_t BnBatteryPropertiesListener::onTransact(uint32_t code, const Parcel& data, Parcel* reply, uint32_t flags) { switch(code) { case TRANSACT_BATTERYPROPERTIESCHANGED: { CHECK_INTERFACE(IBatteryPropertiesListener, data, reply); struct BatteryProperties props = {}; if (data.readInt32() != 0) { props.readFromParcel((Parcel*)&data); } batteryPropertiesChanged(props); return NO_ERROR; } default: return BBinder::onTransact(code, data, reply, flags); } }; }; // namespace android Loading
include/batteryservice/IBatteryPropertiesListener.h +6 −0 Original line number Diff line number Diff line Loading @@ -40,6 +40,12 @@ public: // ---------------------------------------------------------------------------- class BnBatteryPropertiesListener: public BnInterface<IBatteryPropertiesListener> { public: virtual status_t onTransact(uint32_t code, const Parcel& data, Parcel* reply, uint32_t flags = 0); }; }; // namespace android #endif // ANDROID_IBATTERYPROPERTIESLISTENER_H
services/batteryservice/IBatteryPropertiesListener.cpp +18 −0 Original line number Diff line number Diff line Loading @@ -43,4 +43,22 @@ IMPLEMENT_META_INTERFACE(BatteryPropertiesListener, "android.os.IBatteryProperti // ---------------------------------------------------------------------------- status_t BnBatteryPropertiesListener::onTransact(uint32_t code, const Parcel& data, Parcel* reply, uint32_t flags) { switch(code) { case TRANSACT_BATTERYPROPERTIESCHANGED: { CHECK_INTERFACE(IBatteryPropertiesListener, data, reply); struct BatteryProperties props = {}; if (data.readInt32() != 0) { props.readFromParcel((Parcel*)&data); } batteryPropertiesChanged(props); return NO_ERROR; } default: return BBinder::onTransact(code, data, reply, flags); } }; }; // namespace android