update battery status for audio/video
Bug: 12979595 Change-Id: Ic8e8d625becc6d1050f840ad63b7423f388eeba3
This commit is contained in:
parent
7b3f48d2ef
commit
bd42d38b16
@ -30,10 +30,18 @@ public:
|
|||||||
|
|
||||||
virtual void noteStartSensor(int uid, int sensor) = 0;
|
virtual void noteStartSensor(int uid, int sensor) = 0;
|
||||||
virtual void noteStopSensor(int uid, int sensor) = 0;
|
virtual void noteStopSensor(int uid, int sensor) = 0;
|
||||||
|
virtual void noteStartVideo(int uid) = 0;
|
||||||
|
virtual void noteStopVideo(int uid) = 0;
|
||||||
|
virtual void noteStartAudio(int uid) = 0;
|
||||||
|
virtual void noteStopAudio(int uid) = 0;
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
NOTE_START_SENSOR_TRANSACTION = IBinder::FIRST_CALL_TRANSACTION,
|
NOTE_START_SENSOR_TRANSACTION = IBinder::FIRST_CALL_TRANSACTION,
|
||||||
NOTE_STOP_SENSOR_TRANSACTION,
|
NOTE_STOP_SENSOR_TRANSACTION,
|
||||||
|
NOTE_START_VIDEO_TRANSACTION,
|
||||||
|
NOTE_STOP_VIDEO_TRANSACTION,
|
||||||
|
NOTE_START_AUDIO_TRANSACTION,
|
||||||
|
NOTE_STOP_AUDIO_TRANSACTION,
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -49,6 +49,34 @@ public:
|
|||||||
data.writeInt32(sensor);
|
data.writeInt32(sensor);
|
||||||
remote()->transact(NOTE_STOP_SENSOR_TRANSACTION, data, &reply);
|
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");
|
IMPLEMENT_META_INTERFACE(BatteryStats, "com.android.internal.app.IBatteryStats");
|
||||||
@ -75,6 +103,34 @@ status_t BnBatteryStats::onTransact(
|
|||||||
reply->writeNoException();
|
reply->writeNoException();
|
||||||
return NO_ERROR;
|
return NO_ERROR;
|
||||||
} break;
|
} 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:
|
default:
|
||||||
return BBinder::onTransact(code, data, reply, flags);
|
return BBinder::onTransact(code, data, reply, flags);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user