Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
SDK
/
exoplayer
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
a21572f0
authored
Feb 11, 2019
by
olly
Committed by
Andrew Lewis
Feb 18, 2019
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Fix minor issues and lint errors
PiperOrigin-RevId: 233428556
parent
6a7157de
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
43 additions
and
33 deletions
demos/cast/build.gradle
demos/cast/src/main/java/com/google/android/exoplayer2/castdemo/MainActivity.java
demos/cast/src/main/res/layout/main_activity.xml
demos/cast/src/main/res/values/strings.xml
demos/ima/build.gradle
demos/main/build.gradle
demos/main/src/main/AndroidManifest.xml
extensions/cronet/build.gradle
extensions/gvr/src/main/java/com/google/android/exoplayer2/ext/gvr/GvrPlayerActivity.java
extensions/gvr/src/main/res/layout/vr_ui.xml
extensions/ima/build.gradle
extensions/leanback/build.gradle
library/core/src/main/java/com/google/android/exoplayer2/extractor/ogg/OggPacket.java
library/core/src/main/java/com/google/android/exoplayer2/text/subrip/SubripDecoder.java
library/core/src/main/java/com/google/android/exoplayer2/upstream/cache/CachedContentIndex.java
library/core/src/main/java/com/google/android/exoplayer2/upstream/cache/SimpleCache.java
library/core/src/test/java/com/google/android/exoplayer2/upstream/cache/SimpleCacheSpanTest.java
library/ui/src/main/java/com/google/android/exoplayer2/ui/PlayerView.java
testutils/src/main/java/com/google/android/exoplayer2/testutil/HostActivity.java
demos/cast/build.gradle
View file @
a21572f0
...
...
@@ -44,8 +44,8 @@ android {
}
lintOptions
{
// The demo app
does no
t have translations.
disable
'MissingTranslation'
// The demo app
isn't indexed and doesn'
t have translations.
disable
'
GoogleAppIndexingWarning'
,
'
MissingTranslation'
}
}
...
...
demos/cast/src/main/java/com/google/android/exoplayer2/castdemo/MainActivity.java
View file @
a21572f0
...
...
@@ -150,8 +150,11 @@ public class MainActivity extends AppCompatActivity
@Override
public
void
onClick
(
View
view
)
{
new
AlertDialog
.
Builder
(
this
).
setTitle
(
R
.
string
.
sample_list_dialog_title
)
.
setView
(
buildSampleListView
()).
setPositiveButton
(
android
.
R
.
string
.
ok
,
null
).
create
()
new
AlertDialog
.
Builder
(
this
)
.
setTitle
(
R
.
string
.
add_samples
)
.
setView
(
buildSampleListView
())
.
setPositiveButton
(
android
.
R
.
string
.
ok
,
null
)
.
create
()
.
show
();
}
...
...
demos/cast/src/main/res/layout/main_activity.xml
View file @
a21572f0
...
...
@@ -40,7 +40,8 @@
android:layout_alignParentEnd=
"true"
android:layout_alignParentRight=
"true"
android:layout_alignParentBottom=
"true"
android:padding=
"30dp"
/>
android:padding=
"30dp"
android:contentDescription=
"@string/add_samples"
/>
</RelativeLayout>
<com.google.android.exoplayer2.ui.PlayerControlView
android:id=
"@+id/cast_control_view"
android:layout_width=
"match_parent"
...
...
demos/cast/src/main/res/values/strings.xml
View file @
a21572f0
...
...
@@ -20,7 +20,7 @@
<string
name=
"media_route_menu_title"
>
Cast
</string>
<string
name=
"
sample_list_dialog_title
"
>
Add samples
</string>
<string
name=
"
add_samples
"
>
Add samples
</string>
<string
name=
"cast_context_error"
>
Failed to get Cast context. Try updating Google Play Services and restart the app.
</string>
...
...
demos/ima/build.gradle
View file @
a21572f0
...
...
@@ -41,8 +41,8 @@ android {
}
lintOptions
{
// The demo app
does no
t have translations.
disable
'MissingTranslation'
// The demo app
isn't indexed and doesn'
t have translations.
disable
'
GoogleAppIndexingWarning'
,
'
MissingTranslation'
}
}
...
...
demos/main/build.gradle
View file @
a21572f0
...
...
@@ -44,8 +44,9 @@ android {
}
lintOptions
{
// The demo app does not have translations.
disable
'MissingTranslation'
// The demo app isn't indexed, doesn't have translations, and has a
// banner for AndroidTV that's only in xhdpi density.
disable
'GoogleAppIndexingWarning'
,
'MissingTranslation'
,
'IconDensities'
}
flavorDimensions
"extensions"
...
...
demos/main/src/main/AndroidManifest.xml
View file @
a21572f0
...
...
@@ -15,6 +15,7 @@
-->
<manifest
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:tools=
"http://schemas.android.com/tools"
package=
"com.google.android.exoplayer2.demo"
>
<uses-permission
android:name=
"android.permission.INTERNET"
/>
...
...
@@ -33,7 +34,8 @@
android:banner=
"@drawable/ic_banner"
android:largeHeap=
"true"
android:allowBackup=
"false"
android:name=
"com.google.android.exoplayer2.demo.DemoApplication"
>
android:name=
"com.google.android.exoplayer2.demo.DemoApplication"
tools:ignore=
"UnusedAttribute"
>
<activity
android:name=
"com.google.android.exoplayer2.demo.SampleChooserActivity"
android:configChanges=
"keyboardHidden"
...
...
extensions/cronet/build.gradle
View file @
a21572f0
...
...
@@ -29,7 +29,7 @@ android {
}
dependencies
{
api
'org.chromium.net:cronet-embedded:7
1.3578.98
'
api
'org.chromium.net:cronet-embedded:7
2.3626.96
'
implementation
project
(
modulePrefix
+
'library-core'
)
implementation
'com.android.support:support-annotations:'
+
supportLibraryVersion
testImplementation
project
(
modulePrefix
+
'library'
)
...
...
extensions/gvr/src/main/java/com/google/android/exoplayer2/ext/gvr/GvrPlayerActivity.java
View file @
a21572f0
...
...
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
com
.
google
.
android
.
exoplayer2
.
ext
.
gvr
;
import
android.content.Context
;
...
...
extensions/gvr/src/main/res/layout/vr_ui.xml
View file @
a21572f0
...
...
@@ -13,13 +13,14 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
<merge
xmlns:
android=
"http://schemas.android.com/apk/res/android
"
<merge
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:
tools=
"http://schemas.android.com/tools
"
android:id=
"@+id/video_ui_view"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:background=
"#000"
android:orientation=
"horizontal"
>
android:background=
"@android:color/black"
android:orientation=
"horizontal"
tools:ignore=
"Overdraw"
>
<com.google.android.exoplayer2.ui.PlayerControlView
android:id=
"@+id/controller"
android:layout_width=
"match_parent"
...
...
extensions/ima/build.gradle
View file @
a21572f0
...
...
@@ -32,11 +32,11 @@ android {
dependencies
{
api
'com.google.ads.interactivemedia.v3:interactivemedia:3.10.6'
implementation
project
(
modulePrefix
+
'library-core'
)
implementation
'com.google.android.gms:play-services-ads:17.1.
2
'
implementation
'com.google.android.gms:play-services-ads:17.1.
3
'
// These dependencies are necessary to force the supportLibraryVersion of
// com.android.support:support-v4 and com.android.support:customtabs to be
// used. Else older versions are used, for example via:
// com.google.android.gms:play-services-ads:17.1.
2
// com.google.android.gms:play-services-ads:17.1.
3
// |-- com.android.support:customtabs:26.1.0
implementation
'com.android.support:support-v4:'
+
supportLibraryVersion
implementation
'com.android.support:customtabs:'
+
supportLibraryVersion
...
...
extensions/leanback/build.gradle
View file @
a21572f0
...
...
@@ -30,7 +30,7 @@ android {
dependencies
{
implementation
project
(
modulePrefix
+
'library-core'
)
implementation
(
'com.android.support:leanback-v17:'
+
supportLibraryVersion
)
implementation
'com.android.support:leanback-v17:'
+
supportLibraryVersion
}
ext
{
...
...
library/core/src/main/java/com/google/android/exoplayer2/extractor/ogg/OggPacket.java
View file @
a21572f0
...
...
@@ -15,7 +15,6 @@
*/
package
com
.
google
.
android
.
exoplayer2
.
extractor
.
ogg
;
import
android.support.annotation.VisibleForTesting
;
import
com.google.android.exoplayer2.C
;
import
com.google.android.exoplayer2.extractor.ExtractorInput
;
import
com.google.android.exoplayer2.util.Assertions
;
...
...
@@ -111,7 +110,6 @@ import java.util.Arrays;
* @return the {@code PageHeader} of the last page read or an empty header if the packet has yet
* to be populated.
*/
@VisibleForTesting
public
OggPageHeader
getPageHeader
()
{
return
pageHeader
;
}
...
...
library/core/src/main/java/com/google/android/exoplayer2/text/subrip/SubripDecoder.java
View file @
a21572f0
...
...
@@ -247,8 +247,11 @@ public final class SubripDecoder extends SimpleSubtitleDecoder {
case
Cue
.
ANCHOR_TYPE_MIDDLE
:
return
SubripDecoder
.
MID_FRACTION
;
case
Cue
.
ANCHOR_TYPE_END
:
default
:
return
SubripDecoder
.
END_FRACTION
;
case
Cue
.
TYPE_UNSET
:
default
:
// Should never happen.
throw
new
IllegalArgumentException
();
}
}
}
library/core/src/main/java/com/google/android/exoplayer2/upstream/cache/CachedContentIndex.java
View file @
a21572f0
...
...
@@ -15,6 +15,7 @@
*/
package
com
.
google
.
android
.
exoplayer2
.
upstream
.
cache
;
import
android.annotation.SuppressLint
;
import
android.content.ContentValues
;
import
android.database.Cursor
;
import
android.database.sqlite.SQLiteDatabase
;
...
...
@@ -294,6 +295,7 @@ import org.checkerframework.checker.nullness.compatqual.NullableType;
return
cachedContent
;
}
@SuppressLint
(
"GetInstance"
)
// Suppress warning about specifying "BC" as an explicit provider.
private
static
Cipher
getCipher
()
throws
NoSuchPaddingException
,
NoSuchAlgorithmException
{
// Workaround for https://issuetracker.google.com/issues/36976726
if
(
Util
.
SDK_INT
==
18
)
{
...
...
library/core/src/main/java/com/google/android/exoplayer2/upstream/cache/SimpleCache.java
View file @
a21572f0
...
...
@@ -597,10 +597,10 @@ public final class SimpleCache implements Cache {
return
createUid
(
directory
);
}
@SuppressWarnings
(
"TrulyRandom"
)
private
static
long
createUid
(
File
directory
)
throws
IOException
{
SecureRandom
random
=
new
SecureRandom
();
// Generate a non-negative UID.
long
uid
=
random
.
nextLong
();
long
uid
=
new
SecureRandom
()
.
nextLong
();
uid
=
uid
==
Long
.
MIN_VALUE
?
0
:
Math
.
abs
(
uid
);
// Persist it as a file.
String
hexUid
=
Long
.
toString
(
uid
,
/* radix= */
16
);
...
...
library/core/src/test/java/com/google/android/exoplayer2/upstream/cache/SimpleCacheSpanTest.java
View file @
a21572f0
...
...
@@ -18,12 +18,12 @@ package com.google.android.exoplayer2.upstream.cache;
import
static
com
.
google
.
common
.
truth
.
Truth
.
assertThat
;
import
static
com
.
google
.
common
.
truth
.
Truth
.
assertWithMessage
;
import
android.util.LongSparseArray
;
import
com.google.android.exoplayer2.testutil.TestUtil
;
import
com.google.android.exoplayer2.util.Util
;
import
java.io.File
;
import
java.io.FileOutputStream
;
import
java.io.IOException
;
import
java.util.HashMap
;
import
java.util.Set
;
import
java.util.TreeSet
;
import
org.junit.After
;
...
...
@@ -112,7 +112,7 @@ public class SimpleCacheSpanTest {
TreeSet
<
SimpleCacheSpan
>
spans
=
index
.
get
(
key
).
getSpans
();
assertWithMessage
(
"upgradeOldFiles() shouldn't add any spans."
).
that
(
spans
.
isEmpty
()).
isTrue
();
HashMap
<
Long
,
Long
>
cachedPositions
=
new
HashMap
<>();
LongSparseArray
<
Long
>
cachedPositions
=
new
LongSparseArray
<>();
for
(
File
file
:
files
)
{
SimpleCacheSpan
cacheSpan
=
SimpleCacheSpan
.
createCacheEntry
(
file
,
file
.
length
(),
index
);
if
(
cacheSpan
!=
null
)
{
...
...
@@ -121,9 +121,9 @@ public class SimpleCacheSpanTest {
}
}
assertThat
(
cachedPositions
.
get
(
(
long
)
0
)).
isEqualTo
(
1
);
assertThat
(
cachedPositions
.
get
(
(
long
)
1
)).
isEqualTo
(
2
);
assertThat
(
cachedPositions
.
get
(
(
long
)
5
)).
isEqualTo
(
6
);
assertThat
(
cachedPositions
.
get
(
0
)).
isEqualTo
(
1
);
assertThat
(
cachedPositions
.
get
(
1
)).
isEqualTo
(
2
);
assertThat
(
cachedPositions
.
get
(
5
)).
isEqualTo
(
6
);
}
private
static
void
createTestFile
(
File
file
,
long
length
)
throws
IOException
{
...
...
library/ui/src/main/java/com/google/android/exoplayer2/ui/PlayerView.java
View file @
a21572f0
...
...
@@ -403,7 +403,6 @@ public class PlayerView extends FrameLayout implements AdsLoader.AdViewProvider
surfaceView
=
new
TextureView
(
context
);
break
;
case
SURFACE_TYPE_MONO360_VIEW:
Assertions
.
checkState
(
Util
.
SDK_INT
>=
15
);
SphericalSurfaceView
sphericalSurfaceView
=
new
SphericalSurfaceView
(
context
);
sphericalSurfaceView
.
setSurfaceListener
(
componentListener
);
sphericalSurfaceView
.
setSingleTapListener
(
componentListener
);
...
...
testutils/src/main/java/com/google/android/exoplayer2/testutil/HostActivity.java
View file @
a21572f0
...
...
@@ -80,6 +80,7 @@ public final class HostActivity extends Activity implements SurfaceHolder.Callba
}
private
static
final
String
TAG
=
"HostActivity"
;
private
static
final
String
LOCK_TAG
=
"ExoPlayerTestUtil:"
+
TAG
;
private
static
final
long
START_TIMEOUT_MS
=
5000
;
private
WakeLock
wakeLock
;
...
...
@@ -175,10 +176,10 @@ public final class HostActivity extends Activity implements SurfaceHolder.Callba
public
void
onStart
()
{
Context
appContext
=
getApplicationContext
();
WifiManager
wifiManager
=
(
WifiManager
)
appContext
.
getSystemService
(
Context
.
WIFI_SERVICE
);
wifiLock
=
wifiManager
.
createWifiLock
(
WifiManager
.
WIFI_MODE_FULL_HIGH_PERF
,
TAG
);
wifiLock
=
wifiManager
.
createWifiLock
(
WifiManager
.
WIFI_MODE_FULL_HIGH_PERF
,
LOCK_
TAG
);
wifiLock
.
acquire
();
PowerManager
powerManager
=
(
PowerManager
)
appContext
.
getSystemService
(
Context
.
POWER_SERVICE
);
wakeLock
=
powerManager
.
newWakeLock
(
PowerManager
.
PARTIAL_WAKE_LOCK
,
TAG
);
wakeLock
=
powerManager
.
newWakeLock
(
PowerManager
.
PARTIAL_WAKE_LOCK
,
LOCK_
TAG
);
wakeLock
.
acquire
();
super
.
onStart
();
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment