At async release, set to stub surface to free up the current surface.
Bug: 129008570
Test: atest CtsMediaTestCases -- --module-arg CtsMediaTestCases:size:small
Test: manual app test
Change-Id: I2d90bd37b2be5324199410e1f776afb9cb19d662
releaseAsync() kicks off shutdown sequence but don't wait for it to
finish. Instead, mark itself as pending removal to the resource manager.
Bug: 129008570
Test: atest CtsMediaTestCases -- --module-arg CtsMediaTestCases:size:small
Test: ResourceManagerServce_test
Change-Id: I119945684e4c101c44d64c13913fa01320662fa9
Current MediaResourceManager assume that the calling process actually use the resource.
In TV Input Framework, the actually user of the resource is different application.
To allow MediaResourceManager to use pid of actual user, we add overridePid method
bug: 139809797
Test: Manual
Change-Id: Ia113ca2387dfbcc092eb150d19b4751448e9f27a
Convert with minimal change to the interface itself.
Add additional test to cover DrmSessionManager's usage
of possible negative value field (which is signed now).
bug: 142396029
test: ResourceManagerService_test, DrmSessionManager_test,
CTS ResourceManagerServiceTest;
Manually check battery stats reporting.
Change-Id: I5c537a54efc2663281c96ddbdbd4ee56f23c1adf
Refactor the calls to other system services to an interface
to allow more testing.
Add test for callbacks to BatteryStatsService and
SchedulingPolicyService.
bug: 138381810
bug: 139440234
test: presubmit
Change-Id: I04408ad5a126e9f4083b5806b228449cb432acf6
- Fix ResourceManagerSerivce handling of adding same-type
resource in multiple calls, combine entries with the same
<type, subtype>. This is not required in existing usage,
bug could be required if we allow same type to be added
incrementally (eg. memory usage).
- Add api for removing some resources. Currently we can
add resources in multiple calls, but removeResource always
remove all resources of that client. We need this to toggle
battery stat On/Off based on actual usage of the codec.
- Add unit tests for the above.
bug: 138381810
test: ResourceManagerService_test; CTS ResourceManangerTest.
Change-Id: Icdba6c6b4c517755291668c52764169aac3071ea
We can't track video stats accurately if it's reported from
app side MediaCodec. If the app dies, video stats get stuck
in On state forever. This can be easily triggered by forcefully
kill and app that uses MediaCodec from app side (instead of
through mediaserver's Recorder or Player service), eg.
launch GoogleCamera app and switch to Video tab, and kill it
from adb shell.
In order to track MediaCodec usage from apps we need to move
the battery stats reporting from MediaCodec into ResourceManager.
bug: 138381810
test:
1. test if app uses MediaCodec directly and it dies off, the video
off is received: launch GoogleCamera app, swipe to Video tab,
"dumpsys batterystats --history" and see +video; now adb shell
kill GoogleCamera, dumpsys should show -video.
2. test app that uses MediaCodec through mediaserver: use Chrome
(which uses MediaPlayer) to play some website with video, kills
Chrome from adb shell, and check -video is received.
In anycase it shouldn't stuck in On state.
3. ResourceManagerService_test
Change-Id: I164b31681c4e72e8cce02342641dbec14b8df374
(cherry picked from commit 47db2ff19c)
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
- Ensure OMX handle is freed even if binder death notification comes
first.
- Add DeathRecipient in ResourceManagerService so that it could
handle dead clients properly.
Fix: 28824626
Fix: 34252788
Test: adb shell am instrument -e size small -w 'android.media.cts/android.support.test.runner.AndroidJUnitRunner'
Change-Id: Ifc441a2771b5674749ff65a4520177dda115b292
* Add explicit keyword to conversion constructors.
Bug: 28341362
* Use const reference type for read-only parameters.
Bug: 30407689
Test: build with WITH_TIDY=1
Change-Id: I9aac64b379ddb77a9abb4b03a6648f38e2a756ab