mirror of
https://github.com/morgan9e/helium
synced 2026-04-14 16:34:06 +09:00
62 lines
2.3 KiB
Diff
62 lines
2.3 KiB
Diff
# Disable Google Cloud Messaging (GCM) client
|
|
|
|
--- a/components/gcm_driver/gcm_client_impl.cc
|
|
+++ b/components/gcm_driver/gcm_client_impl.cc
|
|
@@ -432,6 +432,7 @@ void GCMClientImpl::StartGCM() {
|
|
|
|
void GCMClientImpl::InitializeMCSClient() {
|
|
DCHECK(network_connection_tracker_);
|
|
+ return;
|
|
std::vector<GURL> endpoints;
|
|
endpoints.push_back(gservices_settings_.GetMCSMainEndpoint());
|
|
GURL fallback_endpoint = gservices_settings_.GetMCSFallbackEndpoint();
|
|
@@ -611,23 +612,6 @@ void GCMClientImpl::RemoveHeartbeatInter
|
|
|
|
void GCMClientImpl::StartCheckin() {
|
|
DCHECK(io_task_runner_->RunsTasksInCurrentSequence());
|
|
-
|
|
- // Make sure no checkin is in progress.
|
|
- if (checkin_request_)
|
|
- return;
|
|
-
|
|
- checkin_proto::ChromeBuildProto chrome_build_proto;
|
|
- ToCheckinProtoVersion(chrome_build_info_, &chrome_build_proto);
|
|
-
|
|
- CheckinRequest::RequestInfo request_info(
|
|
- device_checkin_info_.android_id, device_checkin_info_.secret,
|
|
- gservices_settings_.digest(), chrome_build_proto);
|
|
- checkin_request_ = std::make_unique<CheckinRequest>(
|
|
- gservices_settings_.GetCheckinURL(), request_info, GetGCMBackoffPolicy(),
|
|
- base::BindOnce(&GCMClientImpl::OnCheckinCompleted,
|
|
- weak_ptr_factory_.GetWeakPtr()),
|
|
- url_loader_factory_, io_task_runner_, &recorder_);
|
|
- checkin_request_->Start();
|
|
}
|
|
|
|
void GCMClientImpl::OnCheckinCompleted(
|
|
@@ -684,24 +668,6 @@ void GCMClientImpl::SetGServicesSettings
|
|
|
|
void GCMClientImpl::SchedulePeriodicCheckin() {
|
|
DCHECK(io_task_runner_->RunsTasksInCurrentSequence());
|
|
-
|
|
- // Make sure no checkin is in progress.
|
|
- if (checkin_request_.get() || !device_checkin_info_.accounts_set)
|
|
- return;
|
|
-
|
|
- // There should be only one periodic checkin pending at a time. Removing
|
|
- // pending periodic checkin to schedule a new one.
|
|
- periodic_checkin_ptr_factory_.InvalidateWeakPtrs();
|
|
-
|
|
- base::TimeDelta time_to_next_checkin = GetTimeToNextCheckin();
|
|
- if (time_to_next_checkin.is_negative())
|
|
- time_to_next_checkin = base::TimeDelta();
|
|
-
|
|
- io_task_runner_->PostDelayedTask(
|
|
- FROM_HERE,
|
|
- base::BindOnce(&GCMClientImpl::StartCheckin,
|
|
- periodic_checkin_ptr_factory_.GetWeakPtr()),
|
|
- time_to_next_checkin);
|
|
}
|
|
|
|
base::TimeDelta GCMClientImpl::GetTimeToNextCheckin() const {
|