Commit 595263ae authored by Xinghui Lu's avatar Xinghui Lu Committed by Commit Bot

[Android] Change GAIA password reuse pings control from SB to SBER.

For GAIA password pings, it is currently gated by SB
for >=M79 versions. However, since we are not showing warnings
to the users, these pings should instead be gated by SBER.

Bug: 1048440
Change-Id: I248b78388cb2aff093c67e774e31ee0c711c3499
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2036286
Commit-Queue: Xinghui Lu <xinghuilu@chromium.org>
Reviewed-by: default avatarVarun Khaneja <vakh@chromium.org>
Reviewed-by: default avatarBettina Dea <bdea@chromium.org>
Cr-Commit-Position: refs/heads/master@{#738360}
parent 8126ced3
...@@ -1422,7 +1422,14 @@ bool ChromePasswordProtectionService::IsPingingEnabled( ...@@ -1422,7 +1422,14 @@ bool ChromePasswordProtectionService::IsPingingEnabled(
*reason = RequestOutcome::TURNED_OFF_BY_ADMIN; *reason = RequestOutcome::TURNED_OFF_BY_ADMIN;
return false; return false;
} }
// Only saved password reuse warnings are shown on Android, so other types of
// password reuse events should be gated by extended reporting.
#if defined(OS_ANDROID)
return extended_reporting_enabled;
#else
return true; return true;
#endif
} }
// Password field on focus pinging is enabled for !incognito && // Password field on focus pinging is enabled for !incognito &&
......
...@@ -485,7 +485,13 @@ TEST_F(ChromePasswordProtectionServiceTest, ...@@ -485,7 +485,13 @@ TEST_F(ChromePasswordProtectionServiceTest,
// Sync password entry pinging is enabled by default. // Sync password entry pinging is enabled by default.
service_->ConfigService(false /*incognito*/, false /*SBER*/); service_->ConfigService(false /*incognito*/, false /*SBER*/);
// Sync password pings are gated by SBER on Android, because warnings are
// disabled.
#if defined(OS_ANDROID)
EXPECT_FALSE(service_->IsPingingEnabled(
#else
EXPECT_TRUE(service_->IsPingingEnabled( EXPECT_TRUE(service_->IsPingingEnabled(
#endif
LoginReputationClientRequest::PASSWORD_REUSE_EVENT, reused_password_type, LoginReputationClientRequest::PASSWORD_REUSE_EVENT, reused_password_type,
&reason)); &reason));
...@@ -495,7 +501,13 @@ TEST_F(ChromePasswordProtectionServiceTest, ...@@ -495,7 +501,13 @@ TEST_F(ChromePasswordProtectionServiceTest,
&reason)); &reason));
service_->ConfigService(true /*incognito*/, false /*SBER*/); service_->ConfigService(true /*incognito*/, false /*SBER*/);
// Sync password pings are gated by SBER on Android, because warnings are
// disabled.
#if defined(OS_ANDROID)
EXPECT_FALSE(service_->IsPingingEnabled(
#else
EXPECT_TRUE(service_->IsPingingEnabled( EXPECT_TRUE(service_->IsPingingEnabled(
#endif
LoginReputationClientRequest::PASSWORD_REUSE_EVENT, reused_password_type, LoginReputationClientRequest::PASSWORD_REUSE_EVENT, reused_password_type,
&reason)); &reason));
...@@ -511,13 +523,25 @@ TEST_F(ChromePasswordProtectionServiceTest, ...@@ -511,13 +523,25 @@ TEST_F(ChromePasswordProtectionServiceTest,
profile()->GetPrefs()->SetInteger(prefs::kPasswordProtectionWarningTrigger, profile()->GetPrefs()->SetInteger(prefs::kPasswordProtectionWarningTrigger,
PASSWORD_PROTECTION_OFF); PASSWORD_PROTECTION_OFF);
service_->ConfigService(false /*incognito*/, false /*SBER*/); service_->ConfigService(false /*incognito*/, false /*SBER*/);
// Sync password pings are gated by SBER on Android, because warnings are
// disabled.
#if defined(OS_ANDROID)
EXPECT_FALSE(service_->IsPingingEnabled(
#else
EXPECT_TRUE(service_->IsPingingEnabled( EXPECT_TRUE(service_->IsPingingEnabled(
#endif
LoginReputationClientRequest::PASSWORD_REUSE_EVENT, reused_password_type, LoginReputationClientRequest::PASSWORD_REUSE_EVENT, reused_password_type,
&reason)); &reason));
profile()->GetPrefs()->SetInteger(prefs::kPasswordProtectionWarningTrigger, profile()->GetPrefs()->SetInteger(prefs::kPasswordProtectionWarningTrigger,
PASSWORD_REUSE); PASSWORD_REUSE);
// Sync password pings are gated by SBER on Android, because warnings are
// disabled.
#if defined(OS_ANDROID)
EXPECT_FALSE(service_->IsPingingEnabled(
#else
EXPECT_TRUE(service_->IsPingingEnabled( EXPECT_TRUE(service_->IsPingingEnabled(
#endif
LoginReputationClientRequest::PASSWORD_REUSE_EVENT, reused_password_type, LoginReputationClientRequest::PASSWORD_REUSE_EVENT, reused_password_type,
&reason)); &reason));
} }
......
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