Commit 8cd248b0 authored by Wenzhao Zang's avatar Wenzhao Zang Committed by Commit Bot

cros: Start bluetooth logging service only for certain boards

Bug: 872403
Change-Id: Idcaa05e31b7b039cb957d21b95e06d494727669e
Reviewed-on: https://chromium-review.googlesource.com/1195882
Commit-Queue: Wenzhao (Colin) Zang <wzang@chromium.org>
Commit-Queue: Rahul Chaturvedi <rkc@chromium.org>
Reviewed-by: default avatarRahul Chaturvedi <rkc@chromium.org>
Cr-Commit-Position: refs/heads/master@{#587326}
parent ebbd1d02
......@@ -190,12 +190,19 @@ base::WeakPtr<ExternalPrinters> GetExternalPrinters(
return ExternalPrintersFactory::Get()->GetForAccountId(account_id);
}
// Starts bluetooth logging service for accounts ending with |kGoogleDotCom|.
// Starts bluetooth logging service for accounts ending with |kGoogleDotCom|
// and certain devices.
void MaybeStartBluetoothLogging(const AccountId& account_id) {
if (!base::EndsWith(account_id.GetUserEmail(), kGoogleDotCom,
base::CompareCase::INSENSITIVE_ASCII)) {
return;
}
const std::vector<std::string> board =
base::SplitString(base::SysInfo::GetLsbReleaseBoard(), "-",
base::TRIM_WHITESPACE, base::SPLIT_WANT_NONEMPTY);
const std::string board_name = board[0];
if (board_name != "eve" && board_name != "nocturne")
return;
chromeos::DBusThreadManager::Get()
->GetUpstartClient()
->StartBluetoothLogging();
......
......@@ -15,6 +15,7 @@
#include "extensions/browser/api/feedback_private/feedback_private_api.h"
#if defined(OS_CHROMEOS)
#include "base/sys_info.h"
#include "chrome/browser/signin/signin_manager_factory.h"
#include "components/signin/core/browser/signin_manager.h"
#endif
......@@ -42,6 +43,14 @@ bool IsFromUserInteraction(FeedbackSource source) {
return false;
}
}
bool IsBluetoothLoggingAllowedByBoard() {
const std::vector<std::string> board =
base::SplitString(base::SysInfo::GetLsbReleaseBoard(), "-",
base::TRIM_WHITESPACE, base::SPLIT_WANT_NONEMPTY);
const std::string board_name = board[0];
return board_name == "eve" || board_name == "nocturne";
}
#endif
}
......@@ -81,7 +90,7 @@ void ShowFeedbackPage(Browser* browser,
if (signin_manager &&
base::EndsWith(signin_manager->GetAuthenticatedAccountInfo().email,
kGoogleDotCom, base::CompareCase::INSENSITIVE_ASCII) &&
IsFromUserInteraction(source)) {
IsFromUserInteraction(source) && IsBluetoothLoggingAllowedByBoard()) {
flow = feedback_private::FeedbackFlow::FEEDBACK_FLOW_GOOGLEINTERNAL;
}
#endif
......
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