cromite/build/patches/Disable-Device-Attributes-API.patch
2025-09-29 11:50:52 +02:00

33 lines
1.3 KiB
Diff

From: uazo <uazo@users.noreply.github.com>
Date: Wed, 10 Sep 2025 07:46:17 +0000
Subject: Disable Device Attributes API
License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html
---
chrome/browser/device_api/device_service_impl.cc | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/chrome/browser/device_api/device_service_impl.cc b/chrome/browser/device_api/device_service_impl.cc
--- a/chrome/browser/device_api/device_service_impl.cc
+++ b/chrome/browser/device_api/device_service_impl.cc
@@ -154,6 +154,7 @@ bool IsPermissionsPolicyFeatureEnabled() {
bool IsTrustedContext(content::RenderFrameHost& host,
const url::Origin& origin) {
+ if ((true)) return false;
// Do not create the service for the incognito mode.
if (GetProfile(host)->IsIncognitoProfile()) {
return false;
@@ -349,6 +350,10 @@ void DeviceServiceImpl::GetAnnotatedLocation(
void DeviceServiceImpl::GetDeviceAttribute(
void (DeviceAttributeApi::*method)(DeviceAttributeCallback callback),
DeviceAttributeCallback callback) {
+ if ((true)) {
+ device_attribute_api_->ReportNotAllowedError(std::move(callback));
+ return;
+ }
if (!IsAffiliatedUser()) {
device_attribute_api_->ReportNotAffiliatedError(std::move(callback));
return;
--