Request cpuset change for 1080p HDR using soft decoder
Keep track of cpuset change requests in ResourceManagerService,
and request changing of cpuset via SchedulingPolicyService.
Bug: 72841545
Test:
1)Using modified Youtube/Exoplayer (that uses softMediaCodec
to decode VP9 profile2), manually verify the following:
- media.codec is put into top-app cpuset playing VP9 1080p HDR
- media.codec is put back into foreground after done
- media.codec stays in foreground cpuset playing other content
- kill the app process, verify media.codec is put back to
foreground until new instances request top-app
- kill mediaserver process, verify media.codec is put back to
foreground until new instances request top-app
- kill media.codec process, starting playback again, verify new
media.codec's cpuset can be changed correctly
- kill system_server process (using 'adb shell stop &&
adb shell start'), verify media.codec is put back to
foreground. Restart playback and verify the cpuset can be
changed correctly.
2) CTS post submit tests
Change-Id: Iba50ede1c08b695821fe4f56dbfc5694eab54e7b
diff --git a/media/utils/ISchedulingPolicyService.cpp b/media/utils/ISchedulingPolicyService.cpp
index 22fbc97..b210404 100644
--- a/media/utils/ISchedulingPolicyService.cpp
+++ b/media/utils/ISchedulingPolicyService.cpp
@@ -25,6 +25,7 @@
// Keep in sync with frameworks/base/core/java/android/os/ISchedulingPolicyService.aidl
enum {
REQUEST_PRIORITY_TRANSACTION = IBinder::FIRST_CALL_TRANSACTION,
+ REQUEST_CPUSET_BOOST,
};
// ----------------------------------------------------------------------
@@ -60,6 +61,23 @@
}
return reply.readInt32();
}
+
+ virtual int requestCpusetBoost(bool enable, const sp<IInterface>& client)
+ {
+ Parcel data, reply;
+ data.writeInterfaceToken(ISchedulingPolicyService::getInterfaceDescriptor());
+ data.writeInt32(enable);
+ data.writeStrongBinder(IInterface::asBinder(client));
+ status_t status = remote()->transact(REQUEST_CPUSET_BOOST, data, &reply, 0);
+ if (status != NO_ERROR) {
+ return status;
+ }
+ // fail on exception: force binder reconnection
+ if (reply.readExceptionCode() != 0) {
+ return DEAD_OBJECT;
+ }
+ return reply.readInt32();
+ }
};
IMPLEMENT_META_INTERFACE(SchedulingPolicyService, "android.os.ISchedulingPolicyService");
@@ -71,6 +89,7 @@
{
switch (code) {
case REQUEST_PRIORITY_TRANSACTION:
+ case REQUEST_CPUSET_BOOST:
// Not reached
return NO_ERROR;
break;