918 Commits

Author SHA1 Message Date
Eric Laurent
1b638aa181 Fix AudioPolicyTest manifest
Add missing android:exported attribute in manifest for S+ compatibility.

Test: atest AudioProductStrategyTest

Change-Id: I4cf84723d2e31639cc472806c3a6be83c17fd897
2020-10-08 11:31:12 -07:00
Hangyu Kuang
ee743d3238 Merge "transcoding: Add forClientUid in TranscodingRequest." 2020-09-23 00:19:00 +00:00
hkuang
9e0c251319 transcoding: Add forClientUid in TranscodingRequest.
This is used to let MediaProvider could specify the request is
on behalf of which client.

CTS-Coverage-Bug: 168990206

Bug: 154733526
Test: Unit test.
Change-Id: Id1a2c4cccff12dd1d979fa9350120e2ddad9ff5b
2020-09-23 00:04:21 +00:00
hkuang
516eebe5c1 transcoding: Add retry api.
The retry api is used internally to retry the pending jobs
upon service die and also used by client to retry the failed job.

CTS-Coverage-Bug: 168805960

Bug: 161469320
Test: Unit test

Change-Id: I5c3f4d1d0e7a21cd2f802fdffe0e5b0566833328
2020-09-17 17:23:22 +00:00
Chong Zhang
566b316d8d transcoding: add API for determininng transcoding format
Add a helper API for determining whether to transcode
as well as the transcoding video format.

bug: 163086057
test: MediaTranscodeManagerTest; Manually verify with
local changes in MediaProvider to use the API.

Change-Id: Id694bd83a960fe21008b06a7144ede831103cea2
2020-09-03 20:32:45 -07:00
hkuang
bd974fadcb trancoding: Rework some API signature.
This is for addressing part of API counsel comments.

1. Remove AutoCloseable from MediaTranscodeManager.
2. Return job id in progress update callback.
3. Hide PRIORITY_OFFLINE.

Bug: 160260102
Test: Unit test
Change-Id: I7ae4d723a8f1b325ddc5fe7e81c49783adcbae19
2020-09-01 22:59:48 -07:00
hkuang
48be9935c0 transcoding: Rework MediaTranscodeManager test.
1. Remove MediaTranscodeManagerWithMockServiceTest and move
   all the tests to MediaTranscodeManagerTest.
2. Move the service died test in MediaTranscodeManagerTest into a
   seperate ServiceDied test as it affect the normal test when
   killing the service.

Bug: 160260102
Test: Unit test
Change-Id: I192200744a44d4d724289f6001255100b332c968
2020-09-01 23:35:58 +00:00
TreeHugger Robot
a64e5145ea Merge "transcoding: Enable the benchmark for video file with audio." 2020-08-28 18:20:32 +00:00
hkuang
60d5b2e8e0 transcoding: Enable the benchmark for video file with audio.
They are disabled due to bug in transcoding file with audio.

Bug: 154734675
Test: Benchmarking test.
Change-Id: Id4b6d4da5b09cc1f8cc6fc1604bf55d73f9a2cf1
2020-08-28 09:58:15 -07:00
hkuang
3eb57dc580 TranscodingAPI: Expose MediaTranscodeManager as System API.
Bug: 160260102
Test: Unit test
Change-Id: I38e9efc46e23fe1aafe65100bbc7f72eb200720f
2020-08-27 22:20:18 +00:00
hkuang
ef9108a1de TranscodingAPI: Handling Transcding service crash.
Upon receiving a binder died event of the client
due to service crash, we will do the following:
 1) For the job that is running, notify the client
    that the job is failed with error code, so client
    could choose to retry the job or not.
 2) For the jobs that is still pending or paused,
    we will resubmit the job internally once we
    successfully reconnect to the service and
    register a new client.
 3) When trying to connect to the service and register
    a new client. The service may need time to reboot
    or never boot up again. So we will retry for a number
    of times. If we still could not connect, we will notify
    client job failure for the pending and paused jobs.

Bug: 161469320
Bug: 160260102
Test: Run the test with long clip and kill the service.
Change-Id: Idfd8dd0aae60b1dfd6c766552c71f07c60663918
2020-08-20 15:06:30 -07:00
hkuang
4ccf29836e TranscodingApi: Update job status upon receiving callback.
Bug: 160260102
Test: Unit test.

Change-Id: Ib3727889a102f64d76794703e085e73feeabe34e
2020-08-11 09:56:46 -07:00
hkuang
be355a317c Transcoding API: Add support for progress update.
Bug: 160260102
Test: Unit test.
Change-Id: I2203b10e330ea31463d73d1248acb3c3f54f4d64
2020-08-10 09:42:56 -07:00
Ivan Lozano
a170a5435a Merge "Update language to comply with Android's inclusive language guidance" am: 09b57ae95f am: 678e3dabaf am: abbbf97c85 am: 2b50c7140e am: da146d78ab
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1374738

Change-Id: I84bf93a72135f6b57c1c8a3fecf2eb7a93626bf7
2020-07-31 19:45:42 +00:00
Ivan Lozano
abbbf97c85 Merge "Update language to comply with Android's inclusive language guidance" am: 09b57ae95f am: 678e3dabaf
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1374738

Change-Id: I8af3657bda2f47898d1578711f98677c448fd247
2020-07-31 18:49:10 +00:00
Ivan Lozano
8b7f939789 Update language to comply with Android's inclusive language guidance
See https://source.android.com/setup/contribute/respectful-code for reference

 #inclusivefixit

Also re-order incorrectly ordered imports.

Bug: 161896447
Test: mma
Change-Id: Icc876290ca169ebfddba1975de9f28a39ec863ab
2020-07-28 13:17:57 -04:00
TreeHugger Robot
878acd4038 Merge "Transcoding: Add HEVC->AVC performance test." 2020-07-15 16:56:26 +00:00
hkuang
6bc5ae0cf7 Transcoding: Add HEVC->AVC performance test.
Due to slowness in transcoding video with audio, only adding
the video only file for now.

Bug: 154734456
Test: Unit test.
Change-Id: I5a353e24cca0a6624df4e9309ac64bc2fef4b0ed
2020-07-14 12:01:50 -07:00
Eino-Ville Talvala
79d4a4c181 Merge "Camera: Remove all camera HALv1 code" 2020-07-13 17:12:42 +00:00
Eino-Ville Talvala
7208d0af87 Camera: Remove all camera HALv1 code
- Remove legacy wrapper implementing camera2 API on HALv1
  - Move JNI utility code into SurfaceUtils
- Remove openLegacy path, which allowed HALv1 behavior on HALv3 devices
- Remove relevant tests

Test: atest CtsCameraTestCases
Bug: 136024295
Change-Id: I49ad89bee5c4fdc09e288597821163c81494476f
2020-07-10 11:42:59 -07:00
hkuang
2fd238f6a2 Transcoding: Add more tests to collect the performance.
Due to slowness in transcoding video with audio, those test will be
disable for now and enable after the issue is fixed.

Bug:  154734456
Test: Unit test.

Change-Id: Ia98a4f14a71bfa2aee7f21613a1c5df58ebfc9ff
2020-07-09 18:01:41 -07:00
hkuang
3c47c7b497 Transcoding: Add test for cancel transcoding.
Bug: 160260102
Test: Unit Test.
Change-Id: Ibca34efc639cb72dbb0a7eb44154ff80343d0fdb
2020-07-08 13:39:43 -07:00
hkuang
ce2fb63375 transcoding: Add benchmark for transcoding.
This CL only adds preliminary benchmark for avc->avc.
More benchmark will be added later.

Bug:  154734456
Test: Unit test.

Change-Id: Iceb61dcf8f3831529be3670cdee8adfe8843fda2
2020-07-07 11:22:36 -07:00
hkuang
6497987277 transcoding: Add util class to verify transcoding.
The util class will calculate the PSNR of the transcoded
video againest the source video.

Bug: 145628554
Bug: 154734285
Test: Unit test

Change-Id: Ifa1ba87da1f190aef373a2755fd292a51092f57e
2020-06-26 11:15:59 -07:00
Hangyu Kuang
5a6a574094 Merge "transcoding: Add HEVC->AVC transcoding test." 2020-06-24 19:02:10 +00:00
hkuang
331fbc0434 transcoding: Add HEVC->AVC transcoding test.
1) This CL verifies hevc to avc transcoding is working.
Still need to verify the transcoding result in the
coming CLs.
2) This CL also fix a bug that the track format
is not set when sending job to transcoding service.

Bug: 145628554
Bug: 154734285
Test: Unit test

Change-Id: Ia740e1e969357c3f719966c114f1e5182f4d7f66
2020-06-24 09:31:04 -07:00
Automerger Merge Worker
712bf9b72c Merge "Merge "MediaRouter: Defer releasing routing controller when transfer" into rvc-dev am: 82ff3f1472 am: 31353b7e2f am: c6b3963a9d" into rvc-qpr-dev-plus-aosp am: 5e45f13d12
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11593494

Change-Id: Iff7ddf30ce35f2a315616f3fb11aab6088d4d28b
2020-06-24 07:25:46 +00:00
Kyunglyul Hyun
87e73f53fe Merge "MediaRouter: Defer releasing routing controller when transfer" into rvc-dev am: 82ff3f1472 am: 31353b7e2f am: c6b3963a9d
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11593494

Change-Id: I45a250ffb6fdb7251094b0ea8bf9c19e7af08446
2020-06-24 07:10:54 +00:00
Kyunglyul Hyun
e08ef1e658 Merge "MediaRouter: Defer releasing routing controller when transfer" into rvc-dev am: 82ff3f1472
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11593494

Change-Id: I8d6fcaab699f7fa8342206c2a19e247506ec52e3
2020-06-24 06:45:21 +00:00
Kyunglyul Hyun
6a2f1d67b7 MediaRouter: Defer releasing routing controller when transfer
In order to allow media router to communicate with the old routing
controller for synchronizing media status during transfer,
this CL postpone releasing the old routing controller.

Basically media router should release the old routing controller by
itself when it's done with the old routing controller.
If it didn't, the old routing controller is automatically released
after timeout (30s for now)

This CL also clarifies "old routing controller" in onTransfer callback.
Now it is consistent regardless of who requested transfer.

A request from MediaRouter2Manager is handled by MediaRouter2 to
simplify session creation logic.
Limitation of this approach is that a routing session unknown to
MediaRouter2 can't be transferred to a different provider but it is out
of R scope so it's okay.

Bug: 158713035
Test: CTS test && atest mediaroutertest && manually transfer using
support v7 demos

Change-Id: I168af69e2a25240227aea0fd9e892eaa91e78ee3
2020-06-23 11:28:35 +09:00
Hangyu Kuang
19ca683f1b Merge "Transcoding: Bring up first real transcoding with Java API." 2020-06-22 18:06:01 +00:00
Kyunglyul Hyun
f034a802ce Merge "System routes are not automatically exposed" into rvc-dev am: c8f4a8a5e9 am: 387622bd1d am: d7243c4e39 am: de27fdfecb
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11926262

Change-Id: I3d6580fd406a72b3e1be68e40962872989b7e0ed
2020-06-22 05:49:00 +00:00
Kyunglyul Hyun
d7243c4e39 Merge "System routes are not automatically exposed" into rvc-dev am: c8f4a8a5e9 am: 387622bd1d
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11926262

Change-Id: I06577d65a4f57e14fccddf90312be4054cb9b3ce
2020-06-22 05:21:00 +00:00
Kyunglyul Hyun
460ba3e6e5 Merge "System routes are not automatically exposed" into rvc-dev am: c8f4a8a5e9
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11926262

Change-Id: I0fe1b249c9d186a98f6f68caba88e7642da705b3
2020-06-22 05:06:48 +00:00
hkuang
cfdbc0d335 Transcoding: Bring up first real transcoding with Java API.
This CL verifies avc to avc transcoding is working.
Still need to verify the transcoding result in the
coming CLs.

Bug: 145628554
Bug: 154734285
Test: Unit test
Change-Id: I2a3ddc31f84775ee2d7b7cf856d9f028a81034c6
2020-06-21 12:23:35 -07:00
Kyunglyul Hyun
c036350122 System routes are not automatically exposed
From this CL, even for system routes (phone speaker, bt routes),
features are required to get notified of events on routes or to
get them as "available" routes.

By adding this, apps can disable cast -> phone feature.

Bug: 159090706
Test: cts test && atest mediaroutertest && manually
using support v7 demos such that
  with LIVE_AUDIO : nothing changed
  w/o LIVE_AUDIO : cast -> phone feature is disabled
  unregistering callback : cast -> cast (media transfer) and
                           phone -> phone is only enabled <- this is
                           the expected behavior for apps that updates
                           AndroidX library

Change-Id: I4bd27eb1d4776b9cedb59b10e1bac5868d56d305
2020-06-19 22:54:59 +09:00
hkuang
c4b07f6eae transcoding: Add tests for transcoding to internal/external storage.
Also refactor the code to remove duplication.

Bug: 145628554
Test: unit testing

Change-Id: If0a75ba3101c7d9261ccae95f8b82f8b41704592
2020-06-16 12:22:37 -07:00
hkuang
c1b763c91b transcoding: Fix the bug in openFileDescriptor and add more tests.
Bug: 145628554
Test: unit testing

Change-Id: If340c770ad396f45d6faa829915870a9da797adf
2020-06-15 16:54:39 +00:00
Hyundo Moon
5015aada0b Merge "Prevent abuse of MediaRoute2ProviderService#notifyRequestFailed()" into rvc-dev am: f3ff3de37e am: bc36ec31cd am: ebb913c929 am: 358b726fab
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11788495

Change-Id: I17f6173e8b8a2d9a004042b8efdfd96940cd2626
2020-06-11 01:47:19 +00:00
Hyundo Moon
358b726fab Merge "Prevent abuse of MediaRoute2ProviderService#notifyRequestFailed()" into rvc-dev am: f3ff3de37e am: bc36ec31cd am: ebb913c929
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11788495

Change-Id: I199f38672c5d747ddec52f1733c5ed329204058c
2020-06-11 01:23:52 +00:00
Hyundo Moon
3a97d70182 Merge "Prevent abuse of MediaRoute2ProviderService#notifyRequestFailed()" into rvc-dev am: f3ff3de37e am: bc36ec31cd
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11788495

Change-Id: I2692681f338b255d995d74c35f011e76b3655919
2020-06-11 01:21:46 +00:00
Hyundo Moon
49b01ec14c Merge "Prevent abuse of MediaRoute2ProviderService#notifyRequestFailed()" into rvc-dev am: f3ff3de37e
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11788495

Change-Id: I8fd3f269be7d0224ba83b0fd83a5ea13b27a624b
2020-06-11 01:15:14 +00:00
Hyundo Moon
f3ff3de37e Merge "Prevent abuse of MediaRoute2ProviderService#notifyRequestFailed()" into rvc-dev 2020-06-11 01:10:25 +00:00
hkuang
3b285d600d Transcoding: Test api with actual service.
Also adding the new start/pause/resume handling in
client callback.

Bug: 145628554
Test: Build
Change-Id: Ie059a57b4d2552067df0cecb512e1fbabc683037
2020-06-09 23:26:08 +00:00
Hyundo Moon
9b5e3923d1 Prevent abuse of MediaRoute2ProviderService#notifyRequestFailed()
The method can be called with a random requestId, or called multiple
times with the valid requestId. It can result unnecessary calls
to MediaRouter2Manager#onRequestFailed().

This CL resolves this problem.

Bug: 157873556
Test: Passes CTS and mediaroutertest
Change-Id: Ia7dd4ddafd532b9f23bf19491a0820d5a74f6a70
2020-06-09 19:12:30 +09:00
TreeHugger Robot
b24b900ac6 Merge "Add MediaRouterManager.Callback#onSessionReleased" into rvc-dev am: 2950ebf07d am: b18e625b5b am: ca6780f98d am: ec6933933f
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11733425

Change-Id: Ic22a601711db1abefa231a2251dc323ad7ee6b80
2020-06-09 06:45:45 +00:00
TreeHugger Robot
b18e625b5b Merge "Add MediaRouterManager.Callback#onSessionReleased" into rvc-dev am: 2950ebf07d
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11733425

Change-Id: I720ea5577814b17bfcfc705585af154566367a59
2020-06-09 06:21:39 +00:00
Kyunglyul Hyun
fe7b5b125b Add MediaRouterManager.Callback#onSessionReleased
Add the callback to let MediaRouter2Manager get notified
of released sessions.
A test is also added to check if the manager is aware of
a released session when the session is released from the
media router.

Bug: 157872573
Test: atest mediaroutertest
Change-Id: Ifb96b23ed61cc15f5015c453727a487c3b09a92b
2020-06-09 13:13:30 +09:00
Automerger Merge Worker
ae79bcf807 Merge "Merge "Ignore transfer to an unknown route" into rvc-dev am: e3767bdaae am: a33170d2b5 am: 356b62dd4f" into rvc-qpr-dev-plus-aosp am: b43cdd6303
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11700107

Change-Id: I667497c83220c996a65a626becb010841642ceb0
2020-06-08 12:32:58 +00:00
TreeHugger Robot
d3c0fedad9 Merge "Notify a failure on transfer timeout" into rvc-dev am: 6b1cfced63 am: 71012d52b0 am: bb872b6184 am: 5e3172ec68
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11716082

Change-Id: I606dc3daf38dbe160139c1ba6abbffa4ce2d95b8
2020-06-08 12:30:55 +00:00