diff options
author | Chong Zhang <chz@google.com> | 2014-07-23 00:02:53 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2014-07-22 21:50:21 +0000 |
commit | 9b365296a745751c08731f369435e00682165f18 (patch) | |
tree | eac353312dfd2ac0d24a3121f4fe5828edbb99bd /libs | |
parent | 78014f32da6d0ebf52fb34ebb7663863000520a0 (diff) | |
parent | bd42d38b161beb8a4f23ca40b7551e941280e556 (diff) | |
download | frameworks_native-9b365296a745751c08731f369435e00682165f18.zip frameworks_native-9b365296a745751c08731f369435e00682165f18.tar.gz frameworks_native-9b365296a745751c08731f369435e00682165f18.tar.bz2 |
Merge "update battery status for audio/video" into lmp-dev
Diffstat (limited to 'libs')
-rw-r--r-- | libs/binder/IBatteryStats.cpp | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/libs/binder/IBatteryStats.cpp b/libs/binder/IBatteryStats.cpp index 5702151..82bde62 100644 --- a/libs/binder/IBatteryStats.cpp +++ b/libs/binder/IBatteryStats.cpp @@ -49,6 +49,34 @@ public: data.writeInt32(sensor); remote()->transact(NOTE_STOP_SENSOR_TRANSACTION, data, &reply); } + + virtual void noteStartVideo(int uid) { + Parcel data, reply; + data.writeInterfaceToken(IBatteryStats::getInterfaceDescriptor()); + data.writeInt32(uid); + remote()->transact(NOTE_START_VIDEO_TRANSACTION, data, &reply); + } + + virtual void noteStopVideo(int uid) { + Parcel data, reply; + data.writeInterfaceToken(IBatteryStats::getInterfaceDescriptor()); + data.writeInt32(uid); + remote()->transact(NOTE_STOP_VIDEO_TRANSACTION, data, &reply); + } + + virtual void noteStartAudio(int uid) { + Parcel data, reply; + data.writeInterfaceToken(IBatteryStats::getInterfaceDescriptor()); + data.writeInt32(uid); + remote()->transact(NOTE_START_AUDIO_TRANSACTION, data, &reply); + } + + virtual void noteStopAudio(int uid) { + Parcel data, reply; + data.writeInterfaceToken(IBatteryStats::getInterfaceDescriptor()); + data.writeInt32(uid); + remote()->transact(NOTE_STOP_AUDIO_TRANSACTION, data, &reply); + } }; IMPLEMENT_META_INTERFACE(BatteryStats, "com.android.internal.app.IBatteryStats"); @@ -75,6 +103,34 @@ status_t BnBatteryStats::onTransact( reply->writeNoException(); return NO_ERROR; } break; + case NOTE_START_VIDEO_TRANSACTION: { + CHECK_INTERFACE(IBatteryStats, data, reply); + int uid = data.readInt32(); + noteStartVideo(uid); + reply->writeNoException(); + return NO_ERROR; + } break; + case NOTE_STOP_VIDEO_TRANSACTION: { + CHECK_INTERFACE(IBatteryStats, data, reply); + int uid = data.readInt32(); + noteStopVideo(uid); + reply->writeNoException(); + return NO_ERROR; + } break; + case NOTE_START_AUDIO_TRANSACTION: { + CHECK_INTERFACE(IBatteryStats, data, reply); + int uid = data.readInt32(); + noteStartAudio(uid); + reply->writeNoException(); + return NO_ERROR; + } break; + case NOTE_STOP_AUDIO_TRANSACTION: { + CHECK_INTERFACE(IBatteryStats, data, reply); + int uid = data.readInt32(); + noteStopAudio(uid); + reply->writeNoException(); + return NO_ERROR; + } break; default: return BBinder::onTransact(code, data, reply, flags); } |