131 Commits

Author SHA1 Message Date
ibaker
8df6a4b301 Remove nullness warning suppressions from Matcher.group
These were introduced in c7164a30a0

In each case I checked that the groups are not optional,
so if they match they must be non-null.

PiperOrigin-RevId: 305213293
2020-04-07 13:39:13 +01:00
ibaker
c7164a30a0 Suppress go/nullness warnings caused by Matcher#group(String) and Matcher#group(int)
This is required to align google3's stub (currently marked non-null) with Checker Framework's.

More information: go/matcher-nullness-lsc

Tested:
    TAP train for global presubmit queue
    http://test/OCL:303344687:BASE:303326748:1585344475427:29edc250
PiperOrigin-RevId: 303709053
2020-03-30 17:17:00 +01:00
olly
2f91c12f56 Drop prefix test- from test methods under v2/extensions
This is one step toward following the google3's test naming convention.
See go/java-testing/getting_started#basic-test-template for details
why prefix test isn't necessary.

This CL is generated by following command
$ find -name '*Test.java' | xargs -I{} sed -i 's/^\ \ public\ void\ test\([A-Z]\)\(.*\)$/  public void \L\1\E\2/' {}

PiperOrigin-RevId: 300530329
2020-03-19 00:46:24 +00:00
tonihei
b5976a55ff Upgrade Kotlin annotations and fix gradle warnings
The new version fixes some warnings in Gradle builds. Also
add missing indirect compileOnly dependencies to fix some more warnings

Issue:issue:#7007
PiperOrigin-RevId: 298855510
2020-03-10 10:19:19 +00:00
tonihei
ffdc5805bd Remove dependency on legacy Robolectric Looper mode
The default will soon change to Looper mode PAUSED. Some parts of our code
relies on the legacy behaviour when setting set SystemClock and expecting
pending messages to be delivered. With the new mode, we need to explicitly
request to idle the main looper so that pending messages can be delivered.

PiperOrigin-RevId: 297814964
2020-02-28 18:42:22 +00:00
olly
1cbe3f72e6 DataSpec: Deprecate most constructors
Keeping (Uri) and (Uri, position, length) to avoid needing
Builder for the trivial case.

PiperOrigin-RevId: 294530226
2020-02-13 15:43:54 +00:00
olly
14d3ed09d5 Add DataSpec.Builder
PiperOrigin-RevId: 294518763
2020-02-13 15:43:35 +00:00
olly
719b34a9f8 Migrate static imports of org.mockito.Matchers to org.mockito.ArgumentMatchers
The former is deprecated and replaced by the latter in Mockito 2.

For more information see go/mockito-2-lsc

Tested:
    TAP --sample ran all affected tests and none failed
    http://test/OCL:292555754:BASE:292543534:1580490509580:bfdfdd31
PiperOrigin-RevId: 292881633
2020-02-03 11:21:46 +00:00
christosts
5695bae9d8 Remove DataSpec.FLAG_ALLOW_ICY_METADATA
Remove the flag DataSpec.FLAG_ALLOW_ICY_METADATA. Instead, set the
header IcyHeaders.REQUEST_HEADER_ENABLE_METADATA_NAME in the DataSpec
httpRequestHeaders.

BUG:134034248
PiperOrigin-RevId: 270662676
2019-10-02 21:25:07 +01:00
christosts
260db03167 Use DataSpec request params in HttpDataSource impls
Include Dataspec.httpRequestHeaders in CronetDataSource,
and OkHttpDataSource. Updated documentation of
HttpDataSource.open() to suggest that it should set request
headers (in decreasing priority) from (1) the passed DataSpec,
(2) parameters set with setRequestProperty() and (3) default
parameters set in the HttpDataSource.Factory. No mechanism
has been put in place to enforce this.

PiperOrigin-RevId: 266895574
2019-09-05 10:48:45 +01:00
olly
52edbaa9a3 Update cronet and workmanager dependencies
PiperOrigin-RevId: 266803888
2019-09-05 10:48:45 +01:00
olly
2d0b10a73a Use constant to define androidx annotation version
PiperOrigin-RevId: 266801762
2019-09-05 10:45:08 +01:00
olly
a02237de20 Fix imports
PiperOrigin-RevId: 266676413
2019-09-01 22:03:52 +01:00
olly
f5c1e8b5e3 Add HttpDataSource.getResponseCode to provide the status code associated with the most recent HTTP response.
PiperOrigin-RevId: 266218104
2019-08-30 14:42:21 +01:00
tonihei
389eca6e07 Merge robolectric_testutils into testutils.
We no longer need two modules as AndroidX-Test takes care of the system
abstraction and we no longer have Robolectric Handler/Looper workarounds.

PiperOrigin-RevId: 262363201
2019-08-09 18:36:32 +01:00
tonihei
346f8e670a Turn on non-null-by-default for most extensions.
PiperOrigin-RevId: 261700729
2019-08-05 20:27:43 +01:00
olly
fb0481c520 Bump annotations dependency + update release notes
PiperOrigin-RevId: 261353271
2019-08-02 19:04:56 +01:00
olly
6f014749b3 Upgrade dependency versions
PiperOrigin-RevId: 261341256
2019-08-02 18:55:09 +01:00
olly
6606a4ff01 CronetDataSource: Fix invalid Javadoc tag
PiperOrigin-RevId: 257456890
2019-07-14 16:21:24 +01:00
olly
2f8bd42b0e Remove Utils.equals() check for object equality that is fragile.
PiperOrigin-RevId: 254046126
2019-06-21 18:21:22 +01:00
andrewlewis
b449269552 Remove Objects.equals use from CronetDataSource
Objects was added in API 19.

PiperOrigin-RevId: 253567490
2019-06-18 17:46:18 +01:00
olly
e525c1c59e Add CronetDataSource.read(ByteBuffer) method that writes directly into caller's buffer.
PiperOrigin-RevId: 251915459
2019-06-14 16:32:59 +01:00
tonihei
b8ec05aea1 Handle gzip in DefaultHttpDataSource.
Setting the requested encoding in all cases ensures we receive the relevant
response headers indicating whether gzip was used. Doing that allows to
detect the content length in cases where gzip was requested, but the server
replied with uncompressed content.

PiperOrigin-RevId: 250660890
2019-05-30 15:26:32 +01:00
olly
94d668567c Migrate org.mockito.Matchers#any* to org.mockito.ArgumentMatchers
The former is deprecated and replaced by the latter in Mockito 2. However, there is a
functional difference: ArgumentMatchers will reject `null` and check the type
if the matcher specified a type (e.g. `any(Class)` or `anyInt()`). `any()` will
remain to accept anything.

PiperOrigin-RevId: 250458607
2019-05-30 15:25:28 +01:00
olly
14c46bc406 Remove contentTypePredicate from DataSource constructors
The only known use case for contentTypePredicate is to catch
the case when a paywall web page is returned via a DataSource,
rather than the data that was being requested. These days streaming
providers should be using HTTPS, where this problem does not exist.
Devices have also gotten a lot better at showing their own
notifications when paywalls are detected, which largely mitigates
the need for the app to show a more optimal error message or
redirect the user to a browser.

It therefore makes sense to deprioritize this feature. In
particular by removing the arg from constructors, where nearly
all applications are probably passing null.

PiperOrigin-RevId: 249634594
2019-05-30 15:10:08 +01:00
olly
118218cc73 Remove cronet extension nullness blacklist
PiperOrigin-RevId: 249432337
2019-05-23 13:29:35 +01:00
olly
52888ab55b Remove CronetEngineWrapper from nullness test blacklist
PiperOrigin-RevId: 249275623
2019-05-23 13:27:20 +01:00
tonihei
33c677846a Use versioned manifest in all Robolectric tests.
We are currently defaulting to targetSdk=1 as no targetSdk is specified. Only
tests which explicitly ask for another SDK use another test SDK. With the
versioned manifest, all tests run using the targetSDK by default.

PiperOrigin-RevId: 249060796
2019-05-21 13:51:43 +01:00
olly
8edce41ff3 Add simpler HttpDataSource constructors
PiperOrigin-RevId: 248350557
2019-05-15 18:14:25 +01:00
olly
d89f3eeb29 Update dependency versions
PiperOrigin-RevId: 244816212
2019-04-26 18:28:13 +01:00
eguven
f9f009645d Add missing DownloadService build*Intent and startWith* methods
PiperOrigin-RevId: 244196081
2019-04-18 23:22:35 +01:00
tonihei
1ee51518ae Use new exoplayer.dev domain everywhere.
The old domain automatically forwards to the new one. For consistency, change
all doc and code references regardless.

Also adds GitHub CNAME config file which configures our page for the custom
domain.

PiperOrigin-RevId: 243592110
2019-04-16 15:25:27 +01:00
tonihei
8e80acd18f Use androidx.test and extensions.
This replaces the deprecated usages of RobolectricTestRunner and
RuntimeEnvironent and fully migrates the tests to androidx.

PiperOrigin-RevId: 238011667
2019-03-15 04:53:12 +00:00
olly
0622afe170 Migrate to androidx
Issue: #5489
PiperOrigin-RevId: 234507428

Add missing annotation dependency

Issue: #5489
PiperOrigin-RevId: 234566177
2019-02-19 13:22:54 +00:00
tonihei
edabbd52d0 Update Robolectric and Truth.
PiperOrigin-RevId: 233612344
2019-02-18 15:59:32 +00:00
olly
a21572f0dd Fix minor issues and lint errors
PiperOrigin-RevId: 233428556
2019-02-18 15:58:37 +00:00
olly
8401097ead Upgrade gradle plugin and friends
PiperOrigin-RevId: 233390513
2019-02-18 15:57:55 +00:00
olly
2ab91bf08a Update OkHttp and Cronet dependencies
PiperOrigin-RevId: 231644908
2019-01-30 20:32:18 +00:00
olly
355b3d6334 Increase minSdkVersion to 16
The combination of pre-16 API levels accounting for ~0.5% of the device
population, and that the most important components in ExoPlayer (e.g.
the MediaCodec renderers) have always required API level 16, mean it's
very unlikely this will negatively impact on anyone.

PiperOrigin-RevId: 230701808
2019-01-29 16:41:45 +00:00
Oliver Woodman
be2636c365 Merge pull request #4993 from saschpe:icy
PiperOrigin-RevId: 226031838
2018-12-18 19:46:54 +00:00
tonihei
30e753ea1d Provide Cronet request and response data for subclasses.
Subclasses may want to analyze, log and react to the Cronet-specific
connection data.

Issue:#5134
PiperOrigin-RevId: 222809441
2018-11-26 16:40:27 +00:00
Oliver Woodman
2dfe7a7ad6 Misc fixes / stylistic consistency changes for merged pull requests 2018-10-31 20:37:59 +00:00
tonihei
70ccbc6eb8 Fix review comments
See https://github.com/google/ExoPlayer/pull/5004
2018-10-24 11:47:36 +02:00
Patrik Åkerfeldt
8c5703e931 Provide http status message to InvalidResponseCodeException
When response code alone is not enough to distinguish error responses, the http status message is helpful.
2018-10-23 16:51:46 +02:00
tonihei
5c8dabade6 Add @Documented to @IntDef and @StringDef annotations.
This makes the annotations appear in the generated JavaDoc.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=214952419
2018-10-01 19:22:34 +01:00
tonihei
e25b7d2148 Add wrapper for Log messages to allow settig the log level.
Currently there is no way to disable (or reduce) the logcat output generated
by ExoPlayer.

Issue:#4665

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=213421072
2018-09-20 12:12:21 +01:00
tonihei
d0161ad18b Fix all error-prone, style, optional suggestion, etc. issues.
This fixes or suppresses all reported issues by the code review linter tools.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=210107759
2018-08-28 16:37:14 +01:00
olly
3196bc40db Fix CronetDataSource redirect logic
- Remove usage of deprecated postBody field
- Transform POST to GET on redirect, as in DefaultHttpDataSource

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=210092576
2018-08-24 16:14:51 +01:00
tonihei
4bf5e4991c Improve IntDef javadoc.
The doc can be improved by enumerating and linking all possible values from
the interface doc.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=209772309
2018-08-24 15:53:30 +01:00
olly
bd8a956d53 Use lamdas everywhere
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=209162373
2018-08-24 15:19:30 +01:00