Reinstate non-static useExtensionRenderers method

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=193970940
This commit is contained in:
olly 2018-04-23 13:04:26 -07:00 committed by Oliver Woodman
parent 301bb3ada4
commit f96f053f2e
2 changed files with 6 additions and 3 deletions

View file

@ -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) {

View file

@ -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;