diff options
author | nchalko <nchalko@google.com> | 2019-02-19 07:10:39 -0800 |
---|---|---|
committer | Nick Chalko <nchalko@google.com> | 2019-02-20 17:13:32 +0000 |
commit | 351902c895ce8b4790183550d216ef73adb8ac11 (patch) | |
tree | 0fc6eedfafc019d63439e1943c52817577b3621d | |
parent | 97a63874fccb180ec1717f38d0230bdb13f0178a (diff) | |
download | android_packages_apps_TV-351902c895ce8b4790183550d216ef73adb8ac11.tar.gz android_packages_apps_TV-351902c895ce8b4790183550d216ef73adb8ac11.tar.bz2 android_packages_apps_TV-351902c895ce8b4790183550d216ef73adb8ac11.zip |
Move ExoplayerV2 flags to the Tuner
PiperOrigin-RevId: 234595512
Change-Id: I1b57005dcb892b7bfcfc565628979e7685d7cb08
8 files changed, 16 insertions, 78 deletions
diff --git a/common/src/com/android/tv/common/flags/ConcurrentDvrPlaybackFlags.java b/common/src/com/android/tv/common/flags/ConcurrentDvrPlaybackFlags.java index 76e17886..1afff793 100755 --- a/common/src/com/android/tv/common/flags/ConcurrentDvrPlaybackFlags.java +++ b/common/src/com/android/tv/common/flags/ConcurrentDvrPlaybackFlags.java @@ -26,7 +26,7 @@ public interface ConcurrentDvrPlaybackFlags { */ boolean compiled(); - /** Enable playback of DVR playback druing recording */ + /** Enable playback of DVR playback during recording */ boolean enabled(); /** Enable tuner using recording data for playback in onTune */ diff --git a/common/src/com/android/tv/common/flags/Exoplayer2Flags.java b/common/src/com/android/tv/common/flags/Exoplayer2Flags.java deleted file mode 100755 index 4a3956f5..00000000 --- a/common/src/com/android/tv/common/flags/Exoplayer2Flags.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (C) 2019 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License - */ -package com.android.tv.common.flags; - -/** Flags for using Exoplayer V2 */ -public interface Exoplayer2Flags { - - /** - * Whether or not this feature is compiled into this build. - * - * <p>This returns true by default, unless the is_compiled_selector parameter was set during - * code generation. - */ - boolean compiled(); - - /** Enable using exoplayer V2 */ - boolean enabled(); -} diff --git a/common/src/com/android/tv/common/flags/TunerFlags.java b/common/src/com/android/tv/common/flags/TunerFlags.java index f1d91113..5f899b90 100755 --- a/common/src/com/android/tv/common/flags/TunerFlags.java +++ b/common/src/com/android/tv/common/flags/TunerFlags.java @@ -28,4 +28,7 @@ public interface TunerFlags { /** Tune using current recording if available. */ boolean tuneUsingRecording(); + + /** Enable using exoplayer V2 */ + boolean useExoplayerV2(); } diff --git a/common/src/com/android/tv/common/flags/impl/DefaultExoplayer2Flags.java b/common/src/com/android/tv/common/flags/impl/DefaultExoplayer2Flags.java deleted file mode 100644 index 0e1fd2fc..00000000 --- a/common/src/com/android/tv/common/flags/impl/DefaultExoplayer2Flags.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (C) 2018 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.android.tv.common.flags.impl; - -import com.android.tv.common.flags.Exoplayer2Flags; - -/** Default Flags for using Exoplayer V2 */ -public class DefaultExoplayer2Flags implements Exoplayer2Flags { - - @Override - public boolean compiled() { - return true; - } - - @Override - public boolean enabled() { - return false; - } -} diff --git a/common/src/com/android/tv/common/flags/impl/DefaultFlagsModule.java b/common/src/com/android/tv/common/flags/impl/DefaultFlagsModule.java index 3ff6ddf4..49352364 100644 --- a/common/src/com/android/tv/common/flags/impl/DefaultFlagsModule.java +++ b/common/src/com/android/tv/common/flags/impl/DefaultFlagsModule.java @@ -21,7 +21,6 @@ import dagger.Reusable; import com.android.tv.common.flags.BackendKnobsFlags; import com.android.tv.common.flags.CloudEpgFlags; import com.android.tv.common.flags.ConcurrentDvrPlaybackFlags; -import com.android.tv.common.flags.Exoplayer2Flags; import com.android.tv.common.flags.TunerFlags; import com.android.tv.common.flags.UiFlags; @@ -49,12 +48,6 @@ public class DefaultFlagsModule { @Provides @Reusable - Exoplayer2Flags provideExoplayer2Flags() { - return new DefaultExoplayer2Flags(); - } - - @Provides - @Reusable TunerFlags provideTunerFlags() { return new DefaultTunerFlags(); } diff --git a/common/src/com/android/tv/common/flags/impl/DefaultTunerFlags.java b/common/src/com/android/tv/common/flags/impl/DefaultTunerFlags.java index 24941004..195953bc 100644 --- a/common/src/com/android/tv/common/flags/impl/DefaultTunerFlags.java +++ b/common/src/com/android/tv/common/flags/impl/DefaultTunerFlags.java @@ -29,4 +29,9 @@ public class DefaultTunerFlags implements TunerFlags { public boolean tuneUsingRecording() { return false; } + + @Override + public boolean useExoplayerV2() { + return false; + } } diff --git a/tests/common/src/com/android/tv/testing/TestSingletonApp.java b/tests/common/src/com/android/tv/testing/TestSingletonApp.java index 74fc192d..f1a98ff5 100644 --- a/tests/common/src/com/android/tv/testing/TestSingletonApp.java +++ b/tests/common/src/com/android/tv/testing/TestSingletonApp.java @@ -29,7 +29,7 @@ import com.android.tv.common.experiments.ExperimentLoader; import com.android.tv.common.flags.impl.DefaultBackendKnobsFlags; import com.android.tv.common.flags.impl.DefaultCloudEpgFlags; import com.android.tv.common.flags.impl.DefaultConcurrentDvrPlaybackFlags; -import com.android.tv.common.flags.impl.DefaultExoplayer2Flags; +import com.android.tv.common.flags.impl.DefaultTunerFlags; import com.android.tv.common.flags.impl.DefaultUiFlags; import com.android.tv.common.recording.RecordingStorageStatusManager; import com.android.tv.common.singletons.HasSingletons; @@ -84,7 +84,7 @@ public class TestSingletonApp extends Application new TsDataSourceManager.Factory(() -> new TunerTsStreamerManager(null)); private final TunerSessionFactoryImpl mTunerSessionFactory = new TunerSessionFactoryImpl( - new DefaultExoplayer2Flags(), + new DefaultTunerFlags(), mConcurrentDvrPlaybackFlags, mTsDataSourceManagerFactory); private PerformanceMonitor mPerformanceMonitor; diff --git a/tuner/src/com/android/tv/tuner/tvinput/factory/TunerSessionFactoryImpl.java b/tuner/src/com/android/tv/tuner/tvinput/factory/TunerSessionFactoryImpl.java index 66179951..54e959e6 100644 --- a/tuner/src/com/android/tv/tuner/tvinput/factory/TunerSessionFactoryImpl.java +++ b/tuner/src/com/android/tv/tuner/tvinput/factory/TunerSessionFactoryImpl.java @@ -7,22 +7,22 @@ import com.android.tv.tuner.tvinput.TunerSession; import com.android.tv.tuner.tvinput.TunerSessionExoV2; import com.android.tv.tuner.tvinput.datamanager.ChannelDataManager; import com.android.tv.common.flags.ConcurrentDvrPlaybackFlags; -import com.android.tv.common.flags.Exoplayer2Flags; +import com.android.tv.common.flags.TunerFlags; import javax.inject.Inject; /** Creates a {@link TunerSessionFactory}. */ public class TunerSessionFactoryImpl implements TunerSessionFactory { - private final Exoplayer2Flags mExoplayer2Flags; + private final TunerFlags mTunerFlags; private final ConcurrentDvrPlaybackFlags mConcurrentDvrPlaybackFlags; private final TsDataSourceManager.Factory mTsDataSourceManagerFactory; @Inject public TunerSessionFactoryImpl( - Exoplayer2Flags exoplayer2Flags, + TunerFlags tunerFlags, ConcurrentDvrPlaybackFlags concurrentDvrPlaybackFlags, TsDataSourceManager.Factory tsDataSourceManagerFactory) { - mExoplayer2Flags = exoplayer2Flags; + mTunerFlags = tunerFlags; mConcurrentDvrPlaybackFlags = concurrentDvrPlaybackFlags; mTsDataSourceManagerFactory = tsDataSourceManagerFactory; } @@ -32,7 +32,7 @@ public class TunerSessionFactoryImpl implements TunerSessionFactory { Context context, ChannelDataManager channelDataManager, SessionReleasedCallback releasedCallback) { - return mExoplayer2Flags.enabled() + return mTunerFlags.useExoplayerV2() ? new TunerSessionExoV2( context, channelDataManager, |