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
b394c461
authored
Jun 26, 2015
by
Oliver Woodman
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Add utility method to query whether device is an AndroidTV.
parent
a1ab1fc2
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
0 deletions
library/src/main/java/com/google/android/exoplayer/util/Util.java
library/src/main/java/com/google/android/exoplayer/util/Util.java
View file @
b394c461
...
...
@@ -20,8 +20,10 @@ import com.google.android.exoplayer.ExoPlayerLibraryInfo;
import
com.google.android.exoplayer.upstream.DataSource
;
import
com.google.android.exoplayer.upstream.DataSpec
;
import
android.annotation.SuppressLint
;
import
android.content.Context
;
import
android.content.pm.PackageInfo
;
import
android.content.pm.PackageManager
;
import
android.content.pm.PackageManager.NameNotFoundException
;
import
android.os.Build
;
import
android.text.TextUtils
;
...
...
@@ -81,6 +83,17 @@ public final class Util {
private
Util
()
{}
/**
* Returns whether the device is an AndroidTV.
*
* @param context A context.
* @return True if the device is an AndroidTV. False otherwise.
*/
@SuppressLint
(
"InlinedApi"
)
public
static
boolean
isAndroidTv
(
Context
context
)
{
return
context
.
getPackageManager
().
hasSystemFeature
(
PackageManager
.
FEATURE_LEANBACK
);
}
/**
* Returns true if the URL points to a file on the local device
*
* @param url The URL to test
...
...
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