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
6e11d320
authored
Aug 05, 2020
by
gyumin
Committed by
kim-vde
Aug 07, 2020
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Use static import for TimeUnit
PiperOrigin-RevId: 324941042
parent
c0ee267a
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
27 additions
and
36 deletions
extensions/media2/src/androidTest/java/com/google/android/exoplayer2/ext/media2/MediaSessionUtilTest.java
extensions/media2/src/androidTest/java/com/google/android/exoplayer2/ext/media2/SessionCallbackBuilderTest.java
extensions/media2/src/androidTest/java/com/google/android/exoplayer2/ext/media2/SessionPlayerConnectorTest.java
extensions/media2/src/androidTest/java/com/google/android/exoplayer2/ext/media2/TestUtils.java
extensions/media2/src/main/java/com/google/android/exoplayer2/ext/media2/PlayerCommandQueue.java
extensions/media2/src/main/java/com/google/android/exoplayer2/ext/media2/SessionCallback.java
extensions/media2/src/androidTest/java/com/google/android/exoplayer2/ext/media2/MediaSessionUtilTest.java
View file @
6e11d320
...
@@ -16,6 +16,7 @@
...
@@ -16,6 +16,7 @@
package
com
.
google
.
android
.
exoplayer2
.
ext
.
media2
;
package
com
.
google
.
android
.
exoplayer2
.
ext
.
media2
;
import
static
com
.
google
.
common
.
truth
.
Truth
.
assertThat
;
import
static
com
.
google
.
common
.
truth
.
Truth
.
assertThat
;
import
static
java
.
util
.
concurrent
.
TimeUnit
.
MILLISECONDS
;
import
android.content.Context
;
import
android.content.Context
;
import
android.os.Looper
;
import
android.os.Looper
;
...
@@ -32,7 +33,6 @@ import com.google.android.exoplayer2.ext.media2.test.R;
...
@@ -32,7 +33,6 @@ import com.google.android.exoplayer2.ext.media2.test.R;
import
com.google.android.exoplayer2.util.Assertions
;
import
com.google.android.exoplayer2.util.Assertions
;
import
com.google.common.util.concurrent.ListenableFuture
;
import
com.google.common.util.concurrent.ListenableFuture
;
import
java.util.concurrent.CountDownLatch
;
import
java.util.concurrent.CountDownLatch
;
import
java.util.concurrent.TimeUnit
;
import
org.junit.Rule
;
import
org.junit.Rule
;
import
org.junit.Test
;
import
org.junit.Test
;
import
org.junit.runner.RunWith
;
import
org.junit.runner.RunWith
;
...
@@ -89,11 +89,8 @@ public class MediaSessionUtilTest {
...
@@ -89,11 +89,8 @@ public class MediaSessionUtilTest {
throw
new
IllegalStateException
(
e
);
throw
new
IllegalStateException
(
e
);
}
}
});
});
assertThat
(
assertThat
(
prepareResult
.
get
(
PLAYER_STATE_CHANGE_WAIT_TIME_MS
,
MILLISECONDS
).
getResultCode
())
prepareResult
.
get
(
PLAYER_STATE_CHANGE_WAIT_TIME_MS
,
TimeUnit
.
MILLISECONDS
)
.
getResultCode
())
.
isEqualTo
(
PlayerResult
.
RESULT_SUCCESS
);
.
isEqualTo
(
PlayerResult
.
RESULT_SUCCESS
);
assertThat
(
latch
.
await
(
PLAYER_STATE_CHANGE_WAIT_TIME_MS
,
TimeUnit
.
MILLISECONDS
)).
isTrue
();
assertThat
(
latch
.
await
(
PLAYER_STATE_CHANGE_WAIT_TIME_MS
,
MILLISECONDS
)).
isTrue
();
}
}
}
}
extensions/media2/src/androidTest/java/com/google/android/exoplayer2/ext/media2/SessionCallbackBuilderTest.java
View file @
6e11d320
...
@@ -19,6 +19,7 @@ package com.google.android.exoplayer2.ext.media2;
...
@@ -19,6 +19,7 @@ package com.google.android.exoplayer2.ext.media2;
import
static
com
.
google
.
android
.
exoplayer2
.
ext
.
media2
.
TestUtils
.
assertPlayerResultSuccess
;
import
static
com
.
google
.
android
.
exoplayer2
.
ext
.
media2
.
TestUtils
.
assertPlayerResultSuccess
;
import
static
com
.
google
.
common
.
truth
.
Truth
.
assertThat
;
import
static
com
.
google
.
common
.
truth
.
Truth
.
assertThat
;
import
static
com
.
google
.
common
.
truth
.
Truth
.
assertWithMessage
;
import
static
com
.
google
.
common
.
truth
.
Truth
.
assertWithMessage
;
import
static
java
.
util
.
concurrent
.
TimeUnit
.
MILLISECONDS
;
import
android.content.Context
;
import
android.content.Context
;
import
android.net.Uri
;
import
android.net.Uri
;
...
@@ -52,7 +53,6 @@ import java.util.List;
...
@@ -52,7 +53,6 @@ import java.util.List;
import
java.util.concurrent.CountDownLatch
;
import
java.util.concurrent.CountDownLatch
;
import
java.util.concurrent.Executor
;
import
java.util.concurrent.Executor
;
import
java.util.concurrent.Future
;
import
java.util.concurrent.Future
;
import
java.util.concurrent.TimeUnit
;
import
org.junit.Before
;
import
org.junit.Before
;
import
org.junit.Rule
;
import
org.junit.Rule
;
import
org.junit.Test
;
import
org.junit.Test
;
...
@@ -156,7 +156,7 @@ public class SessionCallbackBuilderTest {
...
@@ -156,7 +156,7 @@ public class SessionCallbackBuilderTest {
latch
.
countDown
();
latch
.
countDown
();
};
};
try
(
MediaController
controller
=
createConnectedController
(
session
,
listener
,
null
))
{
try
(
MediaController
controller
=
createConnectedController
(
session
,
listener
,
null
))
{
assertThat
(
latch
.
await
(
CONTROLLER_COMMAND_WAIT_TIME_MS
,
TimeUnit
.
MILLISECONDS
)).
isTrue
();
assertThat
(
latch
.
await
(
CONTROLLER_COMMAND_WAIT_TIME_MS
,
MILLISECONDS
)).
isTrue
();
assertSessionResultFailure
(
controller
.
skipToNextPlaylistItem
());
assertSessionResultFailure
(
controller
.
skipToNextPlaylistItem
());
assertSessionResultFailure
(
controller
.
skipToPreviousPlaylistItem
());
assertSessionResultFailure
(
controller
.
skipToPreviousPlaylistItem
());
...
@@ -223,9 +223,7 @@ public class SessionCallbackBuilderTest {
...
@@ -223,9 +223,7 @@ public class SessionCallbackBuilderTest {
createConnectedController
(
session
,
connectedListener
,
allowedCommandChangedListener
))
{
createConnectedController
(
session
,
connectedListener
,
allowedCommandChangedListener
))
{
assertPlayerResultSuccess
(
sessionPlayerConnector
.
skipToNextPlaylistItem
());
assertPlayerResultSuccess
(
sessionPlayerConnector
.
skipToNextPlaylistItem
());
assertThat
(
assertThat
(
allowedCommandChangedLatch
.
await
(
CONTROLLER_COMMAND_WAIT_TIME_MS
,
MILLISECONDS
))
allowedCommandChangedLatch
.
await
(
CONTROLLER_COMMAND_WAIT_TIME_MS
,
TimeUnit
.
MILLISECONDS
))
.
isTrue
();
.
isTrue
();
// Also test whether the rewind fails as expected.
// Also test whether the rewind fails as expected.
...
@@ -251,9 +249,7 @@ public class SessionCallbackBuilderTest {
...
@@ -251,9 +249,7 @@ public class SessionCallbackBuilderTest {
@Override
@Override
public
int
readAt
(
long
position
,
byte
[]
buffer
,
int
offset
,
int
size
)
{
public
int
readAt
(
long
position
,
byte
[]
buffer
,
int
offset
,
int
size
)
{
try
{
try
{
assertThat
(
assertThat
(
readAllowedLatch
.
await
(
PLAYER_STATE_CHANGE_WAIT_TIME_MS
,
MILLISECONDS
))
readAllowedLatch
.
await
(
PLAYER_STATE_CHANGE_WAIT_TIME_MS
,
TimeUnit
.
MILLISECONDS
))
.
isTrue
();
.
isTrue
();
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
assertWithMessage
(
"Unexpected exception %s"
,
e
).
fail
();
assertWithMessage
(
"Unexpected exception %s"
,
e
).
fail
();
...
@@ -297,7 +293,7 @@ public class SessionCallbackBuilderTest {
...
@@ -297,7 +293,7 @@ public class SessionCallbackBuilderTest {
readAllowedLatch
.
countDown
();
readAllowedLatch
.
countDown
();
assertThat
(
assertThat
(
seekToAllowedForSecondMediaItem
.
await
(
seekToAllowedForSecondMediaItem
.
await
(
CONTROLLER_COMMAND_WAIT_TIME_MS
,
TimeUnit
.
MILLISECONDS
))
CONTROLLER_COMMAND_WAIT_TIME_MS
,
MILLISECONDS
))
.
isTrue
();
.
isTrue
();
}
}
}
}
...
@@ -326,7 +322,7 @@ public class SessionCallbackBuilderTest {
...
@@ -326,7 +322,7 @@ public class SessionCallbackBuilderTest {
try
(
MediaController
controller
=
createConnectedController
(
session
))
{
try
(
MediaController
controller
=
createConnectedController
(
session
))
{
assertSessionResultSuccess
(
assertSessionResultSuccess
(
controller
.
setRating
(
testMediaId
,
testRating
),
CONTROLLER_COMMAND_WAIT_TIME_MS
);
controller
.
setRating
(
testMediaId
,
testRating
),
CONTROLLER_COMMAND_WAIT_TIME_MS
);
assertThat
(
latch
.
await
(
0
,
TimeUnit
.
MILLISECONDS
)).
isTrue
();
assertThat
(
latch
.
await
(
0
,
MILLISECONDS
)).
isTrue
();
}
}
}
}
}
}
...
@@ -378,7 +374,7 @@ public class SessionCallbackBuilderTest {
...
@@ -378,7 +374,7 @@ public class SessionCallbackBuilderTest {
try
(
MediaController
controller
=
createConnectedController
(
session
,
null
,
listener
))
{
try
(
MediaController
controller
=
createConnectedController
(
session
,
null
,
listener
))
{
assertSessionResultSuccess
(
assertSessionResultSuccess
(
controller
.
sendCustomCommand
(
testCommand
,
null
),
CONTROLLER_COMMAND_WAIT_TIME_MS
);
controller
.
sendCustomCommand
(
testCommand
,
null
),
CONTROLLER_COMMAND_WAIT_TIME_MS
);
assertThat
(
latch
.
await
(
0
,
TimeUnit
.
MILLISECONDS
)).
isTrue
();
assertThat
(
latch
.
await
(
0
,
MILLISECONDS
)).
isTrue
();
}
}
}
}
}
}
...
@@ -508,10 +504,9 @@ public class SessionCallbackBuilderTest {
...
@@ -508,10 +504,9 @@ public class SessionCallbackBuilderTest {
assertSessionResultSuccess
(
assertSessionResultSuccess
(
controller
.
setMediaItem
(
testMediaIdUri
.
toString
()),
controller
.
setMediaItem
(
testMediaIdUri
.
toString
()),
PLAYER_STATE_CHANGE_OVER_SESSION_WAIT_TIME_MS
);
PLAYER_STATE_CHANGE_OVER_SESSION_WAIT_TIME_MS
);
assertThat
(
providerLatch
.
await
(
0
,
TimeUnit
.
MILLISECONDS
)).
isTrue
();
assertThat
(
providerLatch
.
await
(
0
,
MILLISECONDS
)).
isTrue
();
assertThat
(
assertThat
(
currentMediaItemChangedLatch
.
await
(
currentMediaItemChangedLatch
.
await
(
CONTROLLER_COMMAND_WAIT_TIME_MS
,
MILLISECONDS
))
CONTROLLER_COMMAND_WAIT_TIME_MS
,
TimeUnit
.
MILLISECONDS
))
.
isTrue
();
.
isTrue
();
}
}
}
}
...
@@ -543,7 +538,7 @@ public class SessionCallbackBuilderTest {
...
@@ -543,7 +538,7 @@ public class SessionCallbackBuilderTest {
.
build
()))
{
.
build
()))
{
try
(
MediaController
controller
=
createConnectedController
(
session
))
{
try
(
MediaController
controller
=
createConnectedController
(
session
))
{
assertSessionResultSuccess
(
controller
.
skipBackward
(),
CONTROLLER_COMMAND_WAIT_TIME_MS
);
assertSessionResultSuccess
(
controller
.
skipBackward
(),
CONTROLLER_COMMAND_WAIT_TIME_MS
);
assertThat
(
skipBackwardCalledLatch
.
await
(
0
,
TimeUnit
.
MILLISECONDS
)).
isTrue
();
assertThat
(
skipBackwardCalledLatch
.
await
(
0
,
MILLISECONDS
)).
isTrue
();
}
}
}
}
}
}
...
@@ -574,7 +569,7 @@ public class SessionCallbackBuilderTest {
...
@@ -574,7 +569,7 @@ public class SessionCallbackBuilderTest {
.
build
()))
{
.
build
()))
{
try
(
MediaController
controller
=
createConnectedController
(
session
))
{
try
(
MediaController
controller
=
createConnectedController
(
session
))
{
assertSessionResultSuccess
(
controller
.
skipForward
(),
CONTROLLER_COMMAND_WAIT_TIME_MS
);
assertSessionResultSuccess
(
controller
.
skipForward
(),
CONTROLLER_COMMAND_WAIT_TIME_MS
);
assertThat
(
skipForwardCalledLatch
.
await
(
0
,
TimeUnit
.
MILLISECONDS
)).
isTrue
();
assertThat
(
skipForwardCalledLatch
.
await
(
0
,
MILLISECONDS
)).
isTrue
();
}
}
}
}
}
}
...
@@ -591,8 +586,7 @@ public class SessionCallbackBuilderTest {
...
@@ -591,8 +586,7 @@ public class SessionCallbackBuilderTest {
.
setPostConnectCallback
(
postConnectCallback
)
.
setPostConnectCallback
(
postConnectCallback
)
.
build
()))
{
.
build
()))
{
try
(
MediaController
controller
=
createConnectedController
(
session
))
{
try
(
MediaController
controller
=
createConnectedController
(
session
))
{
assertThat
(
postConnectLatch
.
await
(
CONTROLLER_COMMAND_WAIT_TIME_MS
,
TimeUnit
.
MILLISECONDS
))
assertThat
(
postConnectLatch
.
await
(
CONTROLLER_COMMAND_WAIT_TIME_MS
,
MILLISECONDS
)).
isTrue
();
.
isTrue
();
}
}
}
}
}
}
...
@@ -609,8 +603,7 @@ public class SessionCallbackBuilderTest {
...
@@ -609,8 +603,7 @@ public class SessionCallbackBuilderTest {
.
setDisconnectedCallback
(
disconnectCallback
)
.
setDisconnectedCallback
(
disconnectCallback
)
.
build
()))
{
.
build
()))
{
try
(
MediaController
controller
=
createConnectedController
(
session
))
{}
try
(
MediaController
controller
=
createConnectedController
(
session
))
{}
assertThat
(
disconnectedLatch
.
await
(
CONTROLLER_COMMAND_WAIT_TIME_MS
,
TimeUnit
.
MILLISECONDS
))
assertThat
(
disconnectedLatch
.
await
(
CONTROLLER_COMMAND_WAIT_TIME_MS
,
MILLISECONDS
)).
isTrue
();
.
isTrue
();
}
}
}
}
...
@@ -666,13 +659,12 @@ public class SessionCallbackBuilderTest {
...
@@ -666,13 +659,12 @@ public class SessionCallbackBuilderTest {
private
static
void
assertSessionResultSuccess
(
Future
<
SessionResult
>
future
,
long
timeoutMs
)
private
static
void
assertSessionResultSuccess
(
Future
<
SessionResult
>
future
,
long
timeoutMs
)
throws
Exception
{
throws
Exception
{
SessionResult
result
=
future
.
get
(
timeoutMs
,
TimeUnit
.
MILLISECONDS
);
SessionResult
result
=
future
.
get
(
timeoutMs
,
MILLISECONDS
);
assertThat
(
result
.
getResultCode
()).
isEqualTo
(
SessionResult
.
RESULT_SUCCESS
);
assertThat
(
result
.
getResultCode
()).
isEqualTo
(
SessionResult
.
RESULT_SUCCESS
);
}
}
private
static
void
assertSessionResultFailure
(
Future
<
SessionResult
>
future
)
throws
Exception
{
private
static
void
assertSessionResultFailure
(
Future
<
SessionResult
>
future
)
throws
Exception
{
SessionResult
result
=
SessionResult
result
=
future
.
get
(
PLAYER_STATE_CHANGE_OVER_SESSION_WAIT_TIME_MS
,
MILLISECONDS
);
future
.
get
(
PLAYER_STATE_CHANGE_OVER_SESSION_WAIT_TIME_MS
,
TimeUnit
.
MILLISECONDS
);
assertThat
(
result
.
getResultCode
()).
isNotEqualTo
(
SessionResult
.
RESULT_SUCCESS
);
assertThat
(
result
.
getResultCode
()).
isNotEqualTo
(
SessionResult
.
RESULT_SUCCESS
);
}
}
...
...
extensions/media2/src/androidTest/java/com/google/android/exoplayer2/ext/media2/SessionPlayerConnectorTest.java
View file @
6e11d320
This diff is collapsed.
Click to expand it.
extensions/media2/src/androidTest/java/com/google/android/exoplayer2/ext/media2/TestUtils.java
View file @
6e11d320
...
@@ -18,6 +18,7 @@ package com.google.android.exoplayer2.ext.media2;
...
@@ -18,6 +18,7 @@ package com.google.android.exoplayer2.ext.media2;
import
static
androidx
.
media2
.
common
.
SessionPlayer
.
PlayerResult
.
RESULT_SUCCESS
;
import
static
androidx
.
media2
.
common
.
SessionPlayer
.
PlayerResult
.
RESULT_SUCCESS
;
import
static
com
.
google
.
common
.
truth
.
Truth
.
assertThat
;
import
static
com
.
google
.
common
.
truth
.
Truth
.
assertThat
;
import
static
java
.
util
.
concurrent
.
TimeUnit
.
MILLISECONDS
;
import
android.content.ContentResolver
;
import
android.content.ContentResolver
;
import
android.content.Context
;
import
android.content.Context
;
...
@@ -31,7 +32,6 @@ import androidx.media2.common.UriMediaItem;
...
@@ -31,7 +32,6 @@ import androidx.media2.common.UriMediaItem;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.List
;
import
java.util.concurrent.Future
;
import
java.util.concurrent.Future
;
import
java.util.concurrent.TimeUnit
;
/** Utilities for tests. */
/** Utilities for tests. */
public
final
class
TestUtils
{
public
final
class
TestUtils
{
...
@@ -84,7 +84,7 @@ public final class TestUtils {
...
@@ -84,7 +84,7 @@ public final class TestUtils {
Future
<
PlayerResult
>
future
,
/* @PlayerResult.ResultCode */
int
playerResult
)
Future
<
PlayerResult
>
future
,
/* @PlayerResult.ResultCode */
int
playerResult
)
throws
Exception
{
throws
Exception
{
assertThat
(
future
).
isNotNull
();
assertThat
(
future
).
isNotNull
();
PlayerResult
result
=
future
.
get
(
PLAYER_STATE_CHANGE_WAIT_TIME_MS
,
TimeUnit
.
MILLISECONDS
);
PlayerResult
result
=
future
.
get
(
PLAYER_STATE_CHANGE_WAIT_TIME_MS
,
MILLISECONDS
);
assertThat
(
result
).
isNotNull
();
assertThat
(
result
).
isNotNull
();
assertThat
(
result
.
getResultCode
()).
isEqualTo
(
playerResult
);
assertThat
(
result
.
getResultCode
()).
isEqualTo
(
playerResult
);
}
}
...
...
extensions/media2/src/main/java/com/google/android/exoplayer2/ext/media2/PlayerCommandQueue.java
View file @
6e11d320
...
@@ -15,6 +15,8 @@
...
@@ -15,6 +15,8 @@
*/
*/
package
com
.
google
.
android
.
exoplayer2
.
ext
.
media2
;
package
com
.
google
.
android
.
exoplayer2
.
ext
.
media2
;
import
static
java
.
util
.
concurrent
.
TimeUnit
.
MILLISECONDS
;
import
androidx.annotation.GuardedBy
;
import
androidx.annotation.GuardedBy
;
import
androidx.annotation.IntDef
;
import
androidx.annotation.IntDef
;
import
androidx.annotation.Nullable
;
import
androidx.annotation.Nullable
;
...
@@ -33,7 +35,6 @@ import java.util.ArrayList;
...
@@ -33,7 +35,6 @@ import java.util.ArrayList;
import
java.util.Deque
;
import
java.util.Deque
;
import
java.util.List
;
import
java.util.List
;
import
java.util.concurrent.Callable
;
import
java.util.concurrent.Callable
;
import
java.util.concurrent.TimeUnit
;
/** Manages the queue of player actions and handles running them one by one. */
/** Manages the queue of player actions and handles running them one by one. */
/* package */
class
PlayerCommandQueue
implements
AutoCloseable
{
/* package */
class
PlayerCommandQueue
implements
AutoCloseable
{
...
@@ -399,7 +400,7 @@ import java.util.concurrent.TimeUnit;
...
@@ -399,7 +400,7 @@ import java.util.concurrent.TimeUnit;
.
append
(
result
.
hashCode
());
.
append
(
result
.
hashCode
());
if
(
result
.
isDone
())
{
if
(
result
.
isDone
())
{
try
{
try
{
int
resultCode
=
result
.
get
(
/* timeout= */
0
,
TimeUnit
.
MILLISECONDS
).
getResultCode
();
int
resultCode
=
result
.
get
(
/* timeout= */
0
,
MILLISECONDS
).
getResultCode
();
stringBuilder
.
append
(
", resultCode="
).
append
(
resultCode
);
stringBuilder
.
append
(
", resultCode="
).
append
(
resultCode
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
// pass-through.
// pass-through.
...
@@ -437,7 +438,7 @@ import java.util.concurrent.TimeUnit;
...
@@ -437,7 +438,7 @@ import java.util.concurrent.TimeUnit;
.
append
(
result
.
hashCode
());
.
append
(
result
.
hashCode
());
if
(
result
.
isDone
())
{
if
(
result
.
isDone
())
{
try
{
try
{
int
resultCode
=
result
.
get
(
/* timeout= */
0
,
TimeUnit
.
MILLISECONDS
).
getResultCode
();
int
resultCode
=
result
.
get
(
/* timeout= */
0
,
MILLISECONDS
).
getResultCode
();
stringBuilder
.
append
(
", resultCode="
).
append
(
resultCode
);
stringBuilder
.
append
(
", resultCode="
).
append
(
resultCode
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
// pass-through.
// pass-through.
...
...
extensions/media2/src/main/java/com/google/android/exoplayer2/ext/media2/SessionCallback.java
View file @
6e11d320
...
@@ -16,6 +16,8 @@
...
@@ -16,6 +16,8 @@
package
com
.
google
.
android
.
exoplayer2
.
ext
.
media2
;
package
com
.
google
.
android
.
exoplayer2
.
ext
.
media2
;
import
static
java
.
util
.
concurrent
.
TimeUnit
.
MILLISECONDS
;
import
android.os.Bundle
;
import
android.os.Bundle
;
import
androidx.annotation.NonNull
;
import
androidx.annotation.NonNull
;
import
androidx.annotation.Nullable
;
import
androidx.annotation.Nullable
;
...
@@ -43,7 +45,6 @@ import java.util.List;
...
@@ -43,7 +45,6 @@ import java.util.List;
import
java.util.Set
;
import
java.util.Set
;
import
java.util.concurrent.ConcurrentHashMap
;
import
java.util.concurrent.ConcurrentHashMap
;
import
java.util.concurrent.ExecutionException
;
import
java.util.concurrent.ExecutionException
;
import
java.util.concurrent.TimeUnit
;
import
java.util.concurrent.TimeoutException
;
import
java.util.concurrent.TimeoutException
;
/* package */
class
SessionCallback
extends
MediaSession
.
SessionCallback
{
/* package */
class
SessionCallback
extends
MediaSession
.
SessionCallback
{
...
@@ -205,7 +206,7 @@ import java.util.concurrent.TimeoutException;
...
@@ -205,7 +206,7 @@ import java.util.concurrent.TimeoutException;
if
(
seekTimeoutMs
<=
0
)
{
if
(
seekTimeoutMs
<=
0
)
{
return
result
.
get
().
getResultCode
();
return
result
.
get
().
getResultCode
();
}
}
return
result
.
get
(
seekTimeoutMs
,
TimeUnit
.
MILLISECONDS
).
getResultCode
();
return
result
.
get
(
seekTimeoutMs
,
MILLISECONDS
).
getResultCode
();
}
catch
(
ExecutionException
|
InterruptedException
|
TimeoutException
e
)
{
}
catch
(
ExecutionException
|
InterruptedException
|
TimeoutException
e
)
{
Log
.
w
(
TAG
,
"Failed to get the seeking result"
,
e
);
Log
.
w
(
TAG
,
"Failed to get the seeking result"
,
e
);
return
SessionResult
.
RESULT_ERROR_UNKNOWN
;
return
SessionResult
.
RESULT_ERROR_UNKNOWN
;
...
...
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