Commit f96f053f by olly Committed by Oliver Woodman

Reinstate non-static useExtensionRenderers method

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=193970940
parent 301bb3ad
......@@ -35,8 +35,6 @@ import java.io.File;
*/
public class DemoApplication extends Application {
public static final boolean USE_EXTENSION_RENDERERS = "withExtensions".equals(BuildConfig.FLAVOR);
private static final String DOWNLOAD_ACTION_FILE = "actions";
private static final String DOWNLOAD_CONTENT_DIRECTORY = "downloads";
......@@ -63,6 +61,11 @@ public class DemoApplication extends Application {
return new DefaultHttpDataSourceFactory(userAgent, listener);
}
/** Returns whether extension renderers should be used. */
public boolean useExtensionRenderers() {
return "withExtensions".equals(BuildConfig.FLAVOR);
}
/** Returns the download {@link Cache}. */
public synchronized Cache getDownloadCache() {
if (downloadCache == null) {
......
......@@ -381,7 +381,7 @@ public class PlayerActivity extends Activity
boolean preferExtensionDecoders =
intent.getBooleanExtra(PREFER_EXTENSION_DECODERS_EXTRA, false);
@DefaultRenderersFactory.ExtensionRendererMode int extensionRendererMode =
DemoApplication.USE_EXTENSION_RENDERERS
((DemoApplication) getApplication()).useExtensionRenderers()
? (preferExtensionDecoders ? DefaultRenderersFactory.EXTENSION_RENDERER_MODE_PREFER
: DefaultRenderersFactory.EXTENSION_RENDERER_MODE_ON)
: DefaultRenderersFactory.EXTENSION_RENDERER_MODE_OFF;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment