Skip to content

Commit

Permalink
Revert "[signin] Temporary disable IsAllowedForMachineLearningCapabil…
Browse files Browse the repository at this point in the history
…ity"

This reverts commit 6d9bf4b.

Reason for revert: the capability has been enabled on the server

Original change's description:
> [signin] Temporary disable IsAllowedForMachineLearningCapability
>
> IsAllowedForMachineLearningCapability isn't enabled on server yet and
> this causes test failures.
>
> This CL excludes IsAllowedForMachineLearningCapability from
> GetSupportedAccountCapabilityNames() so that it won't be fetched from
> the server at all.
>
> This is a temporary change until IsAllowedForMachineLearningCapability
> is rolled out.
>
> Bug: 1352081
> Change-Id: I8337544d715d738f6f1f7d3ca297d2837c1997f7
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3834483
> Auto-Submit: Alex Ilin <alexilin@chromium.org>
> Commit-Queue: Alex Ilin <alexilin@chromium.org>
> Reviewed-by: Nicolas Dossou-Gbété <dgn@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1036092}

(cherry picked from commit 19a2b3a)

Change-Id: I4eab1b19ec4b109c1be061bbfc263b6d5652a15e
Fixed: 1352081
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3838152
Reviewed-by: Nicolas Dossou-Gbété <dgn@chromium.org>
Commit-Queue: Alex Ilin <alexilin@chromium.org>
Cr-Original-Commit-Position: refs/heads/main@{#1037656}
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3848172
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Auto-Submit: Matteo Ruello <mruel@google.com>
Reviewed-by: Alex Ilin <alexilin@chromium.org>
Cr-Commit-Position: refs/branch-heads/5249@{#39}
Cr-Branched-From: 4f7bea5-refs/heads/main@{#1036826}
  • Loading branch information
Alex Ilin authored and Chromium LUCI CQ committed Aug 23, 2022
1 parent fb2dfd7 commit 739adfd
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,3 @@
const char cpp_label[] = name;
#include "components/signin/internal/identity_manager/account_capabilities_list.h"
#undef ACCOUNT_CAPABILITY

const char kIsAllowedForMachineLearningCapabilityName[] =
"accountcapabilities/g42tslldmfya";
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,4 @@
#include "components/signin/internal/identity_manager/account_capabilities_list.h"
#undef ACCOUNT_CAPABILITY

// TODO(https://crbug.com/1352081): move this capability to
// account_capabilities_list.h once it's ready.
extern const char kIsAllowedForMachineLearningCapabilityName[];

#endif // COMPONENTS_SIGNIN_INTERNAL_IDENTITY_MANAGER_ACCOUNT_CAPABILITIES_CONSTANTS_H_
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ ACCOUNT_CAPABILITY(kIsSubjectToParentalControlsCapabilityName,
IS_SUBJECT_TO_PARENTAL_CONTROLS_CAPABILITY_NAME,
"accountcapabilities/guydolldmfya")

ACCOUNT_CAPABILITY(kIsAllowedForMachineLearningCapabilityName,
IS_ALLOWED_FOR_MACHINE_LEARNING_CAPABILITY_NAME,
"accountcapabilities/g42tslldmfya")

ACCOUNT_CAPABILITY(kCanOfferExtendedChromeSyncPromosCapabilityName,
CAN_OFFER_EXTENDED_CHROME_SYNC_PROMOS_CAPABILITY_NAME,
"accountcapabilities/gi2tklldmfya")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,14 @@ public static AccountCapabilities parseFromCapabilitiesResponse(
AccountCapabilitiesConstants.IS_SUBJECT_TO_PARENTAL_CONTROLS_CAPABILITY_NAME);
}

/**
* @return isAllowedForMachineLearning capability value.
*/
public @Tribool int isAllowedForMachineLearning() {
return getCapabilityByName(
AccountCapabilitiesConstants.IS_ALLOWED_FOR_MACHINE_LEARNING_CAPABILITY_NAME);
}

/**
* @return canRunChromePrivacySandboxTrials capability value.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ public final class AccountCapabilitiesTest {
return capabilities.canRunChromePrivacySandboxTrials();
case AccountCapabilitiesConstants.IS_SUBJECT_TO_PARENTAL_CONTROLS_CAPABILITY_NAME:
return capabilities.isSubjectToParentalControls();
case AccountCapabilitiesConstants.IS_ALLOWED_FOR_MACHINE_LEARNING_CAPABILITY_NAME:
return capabilities.isAllowedForMachineLearning();
case AccountCapabilitiesConstants.CAN_STOP_PARENTAL_SUPERVISION_CAPABILITY_NAME:
return capabilities.canStopParentalSupervision();
case AccountCapabilitiesConstants.CAN_TOGGLE_AUTO_UPDATES_NAME:
Expand Down Expand Up @@ -93,7 +95,11 @@ public static class CapabilitiesTestParams implements ParameterProvider {
.CAN_OFFER_EXTENDED_CHROME_SYNC_PROMOS_CAPABILITY_NAME),
new ParameterSet()
.name("CanToggleAutoUpdates")
.value(AccountCapabilitiesConstants.CAN_TOGGLE_AUTO_UPDATES_NAME));
.value(AccountCapabilitiesConstants.CAN_TOGGLE_AUTO_UPDATES_NAME),
new ParameterSet()
.name("IsAllowedForMachineLearning")
.value(AccountCapabilitiesConstants
.IS_ALLOWED_FOR_MACHINE_LEARNING_CAPABILITY_NAME));

// Returns String value added from Capabilities ParameterSet.
static String getCapabilityName(ParameterSet parameterSet) {
Expand Down

0 comments on commit 739adfd

Please sign in to comment.