Commit b7e5e906 authored by Yuchen Liu's avatar Yuchen Liu Committed by Commit Bot

[Chromecast] Move kEnableChromeAudioManagerAndroid to a feature flag

So that we can control it from the cloud.

Bug: internal b/160753974
Test: Build
Change-Id: I5b29df076727f7c0063836f9ff08cfd1107ad904
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2325169Reviewed-by: default avatarKenneth MacKay <kmackay@chromium.org>
Commit-Queue: Yuchen Liu <yucliu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#792795}
parent 05deac26
...@@ -162,6 +162,12 @@ const base::Feature kEnableSideGesturePassThrough{ ...@@ -162,6 +162,12 @@ const base::Feature kEnableSideGesturePassThrough{
const base::Feature kReduceHeadlessFrameRate{"reduce_headless_frame_rate", const base::Feature kReduceHeadlessFrameRate{"reduce_headless_frame_rate",
base::FEATURE_DISABLED_BY_DEFAULT}; base::FEATURE_DISABLED_BY_DEFAULT};
// Uses AudioManagerAndroid, instead of CastAudioManagerAndroid. This will
// disable lots of Cast features, so it should only be used for development and
// testing.
const base::Feature kEnableChromeAudioManagerAndroid{
"enable_chrome_audio_manager_android", base::FEATURE_DISABLED_BY_DEFAULT};
// End Chromecast Feature definitions. // End Chromecast Feature definitions.
const base::Feature* kFeatures[] = { const base::Feature* kFeatures[] = {
&kAllowUserMediaAccess, &kAllowUserMediaAccess,
...@@ -173,6 +179,7 @@ const base::Feature* kFeatures[] = { ...@@ -173,6 +179,7 @@ const base::Feature* kFeatures[] = {
&kUseQueryableDataBackend, &kUseQueryableDataBackend,
&kEnableSideGesturePassThrough, &kEnableSideGesturePassThrough,
&kReduceHeadlessFrameRate, &kReduceHeadlessFrameRate,
&kEnableChromeAudioManagerAndroid,
}; };
// An iterator for a base::DictionaryValue. Use an alias for brevity in loops. // An iterator for a base::DictionaryValue. Use an alias for brevity in loops.
......
...@@ -32,6 +32,7 @@ extern const base::Feature kEnableGeneralAudienceBrowsing; ...@@ -32,6 +32,7 @@ extern const base::Feature kEnableGeneralAudienceBrowsing;
extern const base::Feature kUseQueryableDataBackend; extern const base::Feature kUseQueryableDataBackend;
extern const base::Feature kEnableSideGesturePassThrough; extern const base::Feature kEnableSideGesturePassThrough;
extern const base::Feature kReduceHeadlessFrameRate; extern const base::Feature kReduceHeadlessFrameRate;
extern const base::Feature kEnableChromeAudioManagerAndroid;
// Get an iterable list of all of the cast features for checking all features as // Get an iterable list of all of the cast features for checking all features as
// a collection. // a collection.
......
...@@ -212,12 +212,6 @@ const char kForceUpdateRemoteUrl[] = "force-update-remote-url"; ...@@ -212,12 +212,6 @@ const char kForceUpdateRemoteUrl[] = "force-update-remote-url";
// means that dummy info will be used. // means that dummy info will be used.
const char kSysInfoFilePath[] = "sys-info-file-path"; const char kSysInfoFilePath[] = "sys-info-file-path";
// Uses AudioManagerAndroid, instead of CastAudioManagerAndroid. This will
// disable lots of Cast features, so it should only be used for development and
// testing.
const char kEnableChromeAudioManagerAndroid[] =
"enable-chrome-audio-manager-android";
} // namespace switches } // namespace switches
namespace chromecast { namespace chromecast {
......
...@@ -101,8 +101,6 @@ extern const char kForceUpdateRemoteUrl[]; ...@@ -101,8 +101,6 @@ extern const char kForceUpdateRemoteUrl[];
extern const char kSysInfoFilePath[]; extern const char kSysInfoFilePath[];
extern const char kEnableChromeAudioManagerAndroid[];
} // namespace switches } // namespace switches
namespace chromecast { namespace chromecast {
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
#include "base/base_switches.h" #include "base/base_switches.h"
#include "base/bind.h" #include "base/bind.h"
#include "base/command_line.h" #include "base/command_line.h"
#include "base/feature_list.h"
#include "base/files/scoped_file.h" #include "base/files/scoped_file.h"
#include "base/i18n/rtl.h" #include "base/i18n/rtl.h"
#include "base/message_loop/message_pump_type.h" #include "base/message_loop/message_pump_type.h"
...@@ -278,8 +279,7 @@ CastContentBrowserClient::CreateAudioManager( ...@@ -278,8 +279,7 @@ CastContentBrowserClient::CreateAudioManager(
ServiceConnector::MakeRemote(kBrowserProcessClientId), ServiceConnector::MakeRemote(kBrowserProcessClientId),
BUILDFLAG(ENABLE_CAST_AUDIO_MANAGER_MIXER)); BUILDFLAG(ENABLE_CAST_AUDIO_MANAGER_MIXER));
#elif defined(OS_ANDROID) #elif defined(OS_ANDROID)
if (GetSwitchValueBoolean(switches::kEnableChromeAudioManagerAndroid, if (base::FeatureList::IsEnabled(kEnableChromeAudioManagerAndroid)) {
false)) {
LOG(INFO) << "Use AudioManagerAndroid instead of CastAudioManagerAndroid."; LOG(INFO) << "Use AudioManagerAndroid instead of CastAudioManagerAndroid.";
return std::make_unique<::media::AudioManagerAndroid>( return std::make_unique<::media::AudioManagerAndroid>(
std::move(audio_thread), audio_log_factory); std::move(audio_thread), audio_log_factory);
......
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 to comment