forked from bromite/bromite
-
Notifications
You must be signed in to change notification settings - Fork 249
Expand file tree
/
Copy pathdisable-battery-status-updater.patch
More file actions
48 lines (38 loc) · 1.67 KB
/
disable-battery-status-updater.patch
File metadata and controls
48 lines (38 loc) · 1.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
From: Joachim Bauch <jojo@struktur.de>
Date: Tue, 4 Aug 2015 15:15:53 +0200
Subject: disable battery status updater
The W3C Battery Status API[1] has quite a laughable statement:
"The information disclosed has minimal impact on privacy or
fingerprinting, and therefore is exposed without permission grants".
Along comes a paper "The leaking battery, A privacy analysis of the
HTML5 Battery Status API."
Clean up after the W3C and disable the battery status updater which
could be used to identity users[2].
[1] http://www.w3.org/TR/battery-status/
[2] https://eprint.iacr.org/2015/616.pdf
References: https://github.com/iridium-browser/iridium-browser/issues/40
License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
---
services/device/battery/battery_status_service.cc | 12 +-----------
1 file changed, 1 insertion(+), 11 deletions(-)
diff --git a/services/device/battery/battery_status_service.cc b/services/device/battery/battery_status_service.cc
--- a/services/device/battery/battery_status_service.cc
+++ b/services/device/battery/battery_status_service.cc
@@ -43,17 +43,7 @@ base::CallbackListSubscription BatteryStatusService::AddCallback(
if (!battery_fetcher_)
battery_fetcher_ = BatteryStatusManager::Create(update_callback_);
- if (callback_list_.empty()) {
- bool success = battery_fetcher_->StartListeningBatteryChange();
- // On failure pass the default values back.
- if (!success)
- callback.Run(mojom::BatteryStatus());
- }
-
- if (status_updated_) {
- // Send recent status to the new callback if already available.
- callback.Run(status_);
- }
+ callback.Run(mojom::BatteryStatus());
return callback_list_.Add(callback);
}
--