aboutsummaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2016-09-23 22:11:25 -0700
committerScott Jackson <daneren2005@gmail.com>2016-09-23 22:11:25 -0700
commit01e5812356a918da1f526b8476a5775608f3750c (patch)
tree571b94bd19ca53bd762703a36623edc3aba787a4 /app
parent72751eafc2f9485d4720bbed9ec3b75726f92c9d (diff)
downloaddsub-01e5812356a918da1f526b8476a5775608f3750c.tar.gz
dsub-01e5812356a918da1f526b8476a5775608f3750c.tar.bz2
dsub-01e5812356a918da1f526b8476a5775608f3750c.zip
Move cast id over to EnvironmentVariables
Diffstat (limited to 'app')
-rw-r--r--app/src/main/java/github/daneren2005/dsub/service/ChromeCastController.java5
-rw-r--r--app/src/main/java/github/daneren2005/dsub/util/EnvironmentVariables.java1
-rw-r--r--app/src/main/java/github/daneren2005/dsub/util/compat/CastCompat.java8
3 files changed, 6 insertions, 8 deletions
diff --git a/app/src/main/java/github/daneren2005/dsub/service/ChromeCastController.java b/app/src/main/java/github/daneren2005/dsub/service/ChromeCastController.java
index c2007139..2df290cf 100644
--- a/app/src/main/java/github/daneren2005/dsub/service/ChromeCastController.java
+++ b/app/src/main/java/github/daneren2005/dsub/service/ChromeCastController.java
@@ -41,6 +41,7 @@ import github.daneren2005.dsub.domain.MusicDirectory;
import github.daneren2005.dsub.domain.PlayerState;
import github.daneren2005.dsub.domain.RemoteControlState;
import github.daneren2005.dsub.util.Constants;
+import github.daneren2005.dsub.util.EnvironmentVariables;
import github.daneren2005.dsub.util.FileUtil;
import github.daneren2005.dsub.util.Util;
import github.daneren2005.dsub.util.compat.CastCompat;
@@ -465,14 +466,14 @@ public class ChromeCastController extends RemoteController {
void launchApplication() {
try {
- Cast.CastApi.launchApplication(apiClient, CastCompat.APPLICATION_ID, false).setResultCallback(resultCallback);
+ Cast.CastApi.launchApplication(apiClient, EnvironmentVariables.CAST_APPLICATION_ID, false).setResultCallback(resultCallback);
} catch (Exception e) {
Log.e(TAG, "Failed to launch application", e);
}
}
void reconnectApplication() {
try {
- Cast.CastApi.joinApplication(apiClient, CastCompat.APPLICATION_ID, sessionId).setResultCallback(resultCallback);
+ Cast.CastApi.joinApplication(apiClient, EnvironmentVariables.CAST_APPLICATION_ID, sessionId).setResultCallback(resultCallback);
} catch (Exception e) {
Log.e(TAG, "Failed to reconnect application", e);
}
diff --git a/app/src/main/java/github/daneren2005/dsub/util/EnvironmentVariables.java b/app/src/main/java/github/daneren2005/dsub/util/EnvironmentVariables.java
index d8046d1b..710d5232 100644
--- a/app/src/main/java/github/daneren2005/dsub/util/EnvironmentVariables.java
+++ b/app/src/main/java/github/daneren2005/dsub/util/EnvironmentVariables.java
@@ -17,4 +17,5 @@ package github.daneren2005.dsub.util;
public final class EnvironmentVariables {
public static final String PASTEBIN_DEV_KEY = "";
+ public static final String CAST_APPLICATION_ID = "";
}
diff --git a/app/src/main/java/github/daneren2005/dsub/util/compat/CastCompat.java b/app/src/main/java/github/daneren2005/dsub/util/compat/CastCompat.java
index ab64bca9..415106db 100644
--- a/app/src/main/java/github/daneren2005/dsub/util/compat/CastCompat.java
+++ b/app/src/main/java/github/daneren2005/dsub/util/compat/CastCompat.java
@@ -23,13 +23,9 @@ import com.google.android.gms.cast.CastMediaControlIntent;
import github.daneren2005.dsub.service.ChromeCastController;
import github.daneren2005.dsub.service.DownloadService;
import github.daneren2005.dsub.service.RemoteController;
+import github.daneren2005.dsub.util.EnvironmentVariables;
-/**
- * Created by owner on 2/9/14.
- */
public final class CastCompat {
- public static final String APPLICATION_ID = "5F85EBEB";
-
static {
try {
Class.forName("com.google.android.gms.cast.CastDevice");
@@ -52,6 +48,6 @@ public final class CastCompat {
}
public static String getCastControlCategory() {
- return CastMediaControlIntent.categoryForCast(APPLICATION_ID);
+ return CastMediaControlIntent.categoryForCast(EnvironmentVariables.CAST_APPLICATION_ID);
}
}