Commit cf1a15a1 authored by Amin Hassani's avatar Amin Hassani Committed by Commit Bot

Deprecate end-of-life status

Chrome OS does not use end of life status anymore. It has been replaced
with end of life date.

Bug: 1005511
Test: cq passes
Change-Id: I0bbd438852a9243016e5e06881625da0a5149282
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1891467
Commit-Queue: Amin Hassani <ahassani@chromium.org>
Reviewed-by: default avatarIvan Šandrk <isandrk@chromium.org>
Reviewed-by: default avatarJames Cook <jamescook@chromium.org>
Cr-Commit-Position: refs/heads/master@{#712179}
parent d77dbc1e
...@@ -71,11 +71,10 @@ void UpdateRequiredScreen::Show() { ...@@ -71,11 +71,10 @@ void UpdateRequiredScreen::Show() {
view_->SetUIState(UpdateRequiredView::UPDATE_REQUIRED_MESSAGE); view_->SetUIState(UpdateRequiredView::UPDATE_REQUIRED_MESSAGE);
view_->Show(); view_->Show();
} }
version_updater_->GetEolStatus(
base::BindOnce(&UpdateRequiredScreen::OnGetEndOfLifeStatus,
weak_factory_.GetWeakPtr()));
} }
// TODO(crbug/1020616): Get end-of-life information and update the UI based on
// that.
} }
void UpdateRequiredScreen::Hide() { void UpdateRequiredScreen::Hide() {
...@@ -282,15 +281,6 @@ void UpdateRequiredScreen::HideErrorMessage() { ...@@ -282,15 +281,6 @@ void UpdateRequiredScreen::HideErrorMessage() {
histogram_helper_->OnErrorHide(); histogram_helper_->OnErrorHide();
} }
void UpdateRequiredScreen::OnGetEndOfLifeStatus(
update_engine::EndOfLifeStatus status) {
if (status == update_engine::EndOfLifeStatus::kEol) {
EnsureScreenIsShown();
if (view_)
view_->SetUIState(UpdateRequiredView::EOL);
}
}
void UpdateRequiredScreen::OnConnectRequested() { void UpdateRequiredScreen::OnConnectRequested() {
if (version_updater_->update_info().state == if (version_updater_->update_info().state ==
VersionUpdater::State::STATE_ERROR) { VersionUpdater::State::STATE_ERROR) {
......
...@@ -80,8 +80,6 @@ class UpdateRequiredScreen : public BaseScreen, ...@@ -80,8 +80,6 @@ class UpdateRequiredScreen : public BaseScreen,
void HideErrorMessage(); void HideErrorMessage();
void OnGetEndOfLifeStatus(update_engine::EndOfLifeStatus status);
// The user requested an attempt to connect to the network should be made. // The user requested an attempt to connect to the network should be made.
void OnConnectRequested(); void OnConnectRequested();
......
...@@ -139,20 +139,6 @@ void VersionUpdater::StartExitUpdate(Result result) { ...@@ -139,20 +139,6 @@ void VersionUpdater::StartExitUpdate(Result result) {
Init(); Init();
} }
void VersionUpdater::GetEolStatus(EolStatusCallback callback) {
// Request the End of Life (Auto Update Expiration) status. Bind to a weak_ptr
// bound method rather than passing |callback| directly so that |callback|
// does not outlive |this|.
DBusThreadManager::Get()->GetUpdateEngineClient()->GetEolStatus(
base::BindOnce(&VersionUpdater::OnGetEolStatus,
weak_ptr_factory_.GetWeakPtr(), std::move(callback)));
}
void VersionUpdater::OnGetEolStatus(EolStatusCallback callback,
update_engine::EndOfLifeStatus status) {
std::move(callback).Run(status);
}
base::OneShotTimer* VersionUpdater::GetRebootTimerForTesting() { base::OneShotTimer* VersionUpdater::GetRebootTimerForTesting() {
return &reboot_timer_; return &reboot_timer_;
} }
......
...@@ -95,10 +95,6 @@ class VersionUpdater : public UpdateEngineClient::Observer, ...@@ -95,10 +95,6 @@ class VersionUpdater : public UpdateEngineClient::Observer,
virtual void DelayErrorMessage() = 0; virtual void DelayErrorMessage() = 0;
}; };
// Callback type for |GetEolStatus|.
using EolStatusCallback =
base::OnceCallback<void(update_engine::EndOfLifeStatus status)>;
explicit VersionUpdater(VersionUpdater::Delegate* delegate); explicit VersionUpdater(VersionUpdater::Delegate* delegate);
~VersionUpdater() override; ~VersionUpdater() override;
...@@ -116,9 +112,6 @@ class VersionUpdater : public UpdateEngineClient::Observer, ...@@ -116,9 +112,6 @@ class VersionUpdater : public UpdateEngineClient::Observer,
const UpdateInfo& update_info() { return update_info_; } const UpdateInfo& update_info() { return update_info_; }
// Has the device already reached its End of Life (Auto Update Expiration)?
void GetEolStatus(EolStatusCallback callback);
void set_tick_clock_for_testing(const base::TickClock* tick_clock) { void set_tick_clock_for_testing(const base::TickClock* tick_clock) {
tick_clock_ = tick_clock; tick_clock_ = tick_clock;
} }
...@@ -132,10 +125,6 @@ class VersionUpdater : public UpdateEngineClient::Observer, ...@@ -132,10 +125,6 @@ class VersionUpdater : public UpdateEngineClient::Observer,
void UpdateStatusChangedForTesting(const update_engine::StatusResult& status); void UpdateStatusChangedForTesting(const update_engine::StatusResult& status);
private: private:
// Callback from UpdateEngineClient::GetEolStatus().
void OnGetEolStatus(EolStatusCallback callback,
update_engine::EndOfLifeStatus status);
void RequestUpdateCheck(); void RequestUpdateCheck();
// UpdateEngineClient::Observer implementation: // UpdateEngineClient::Observer implementation:
......
...@@ -79,12 +79,6 @@ void FakeUpdateEngineClient::GetChannel(bool get_current_channel, ...@@ -79,12 +79,6 @@ void FakeUpdateEngineClient::GetChannel(bool get_current_channel,
FROM_HERE, base::BindOnce(callback, std::string())); FROM_HERE, base::BindOnce(callback, std::string()));
} }
void FakeUpdateEngineClient::GetEolStatus(GetEolStatusCallback callback) {
base::ThreadTaskRunnerHandle::Get()->PostTask(
FROM_HERE, base::BindOnce(std::move(callback),
update_engine::EndOfLifeStatus::kSupported));
}
void FakeUpdateEngineClient::GetEolInfo(GetEolInfoCallback callback) { void FakeUpdateEngineClient::GetEolInfo(GetEolInfoCallback callback) {
UpdateEngineClient::EolInfo eol_info; UpdateEngineClient::EolInfo eol_info;
eol_info.eol_date = eol_date_; eol_info.eol_date = eol_date_;
......
...@@ -37,7 +37,6 @@ class COMPONENT_EXPORT(CHROMEOS_DBUS) FakeUpdateEngineClient ...@@ -37,7 +37,6 @@ class COMPONENT_EXPORT(CHROMEOS_DBUS) FakeUpdateEngineClient
bool is_powerwash_allowed) override; bool is_powerwash_allowed) override;
void GetChannel(bool get_current_channel, void GetChannel(bool get_current_channel,
const GetChannelCallback& callback) override; const GetChannelCallback& callback) override;
void GetEolStatus(GetEolStatusCallback callback) override;
void GetEolInfo(GetEolInfoCallback callback) override; void GetEolInfo(GetEolInfoCallback callback) override;
void SetUpdateOverCellularPermission(bool allowed, void SetUpdateOverCellularPermission(bool allowed,
const base::Closure& callback) override; const base::Closure& callback) override;
......
...@@ -188,17 +188,6 @@ class UpdateEngineClientImpl : public UpdateEngineClient { ...@@ -188,17 +188,6 @@ class UpdateEngineClientImpl : public UpdateEngineClient {
weak_ptr_factory_.GetWeakPtr(), callback)); weak_ptr_factory_.GetWeakPtr(), callback));
} }
void GetEolStatus(GetEolStatusCallback callback) override {
dbus::MethodCall method_call(update_engine::kUpdateEngineInterface,
update_engine::kGetEolStatus);
VLOG(1) << "Requesting to get end of life status";
update_engine_proxy_->CallMethod(
&method_call, dbus::ObjectProxy::TIMEOUT_USE_DEFAULT,
base::BindOnce(&UpdateEngineClientImpl::OnGetEolStatus,
weak_ptr_factory_.GetWeakPtr(), std::move(callback)));
}
void GetEolInfo(GetEolInfoCallback callback) override { void GetEolInfo(GetEolInfoCallback callback) override {
dbus::MethodCall method_call(update_engine::kUpdateEngineInterface, dbus::MethodCall method_call(update_engine::kUpdateEngineInterface,
update_engine::kGetStatusAdvanced); update_engine::kGetStatusAdvanced);
...@@ -412,38 +401,8 @@ class UpdateEngineClientImpl : public UpdateEngineClient { ...@@ -412,38 +401,8 @@ class UpdateEngineClientImpl : public UpdateEngineClient {
callback.Run(channel); callback.Run(channel);
} }
// TODO(crbug.com/1005511): Deprecate with GetEolStatus(). // Called when a response for GetStatusAdvanced() is
// Called when a response for GetEolStatus() is received. // received.
void OnGetEolStatus(GetEolStatusCallback callback, dbus::Response* response) {
if (!response) {
LOG(ERROR) << "Failed to request getting eol status";
std::move(callback).Run(update_engine::EndOfLifeStatus::kSupported);
return;
}
dbus::MessageReader reader(response);
int status;
if (!reader.PopInt32(&status)) {
LOG(ERROR) << "Incorrect response: " << response->ToString();
std::move(callback).Run(update_engine::EndOfLifeStatus::kSupported);
return;
}
// Validate the value of status
if (status > update_engine::EndOfLifeStatus::kEol ||
status < update_engine::EndOfLifeStatus::kSupported) {
LOG(ERROR) << "Incorrect status value: " << status;
std::move(callback).Run(update_engine::EndOfLifeStatus::kSupported);
return;
}
VLOG(1) << "Eol status received: " << status;
std::move(callback).Run(
static_cast<update_engine::EndOfLifeStatus>(status));
}
// TODO(crbug.com/1005511): Called when a response for GetStatusAdvanced() is
// received instead of a response from GetEolStatus(). A transition is being
// made to handle the deprecation of GetEolStatus() within update_engine.
void OnGetEolInfo(GetEolInfoCallback callback, dbus::Response* response) { void OnGetEolInfo(GetEolInfoCallback callback, dbus::Response* response) {
if (!response) { if (!response) {
LOG(ERROR) << "Failed to request getting eol info."; LOG(ERROR) << "Failed to request getting eol info.";
...@@ -625,11 +584,6 @@ class UpdateEngineClientStubImpl : public UpdateEngineClient { ...@@ -625,11 +584,6 @@ class UpdateEngineClientStubImpl : public UpdateEngineClient {
callback.Run(target_channel_); callback.Run(target_channel_);
} }
// TODO(crbug.com/1005511): Deprecate with GetEolStatus().
void GetEolStatus(GetEolStatusCallback callback) override {
std::move(callback).Run(update_engine::EndOfLifeStatus::kSupported);
}
void GetEolInfo(GetEolInfoCallback callback) override { void GetEolInfo(GetEolInfoCallback callback) override {
std::move(callback).Run(EolInfo()); std::move(callback).Run(EolInfo());
} }
......
...@@ -116,16 +116,6 @@ class COMPONENT_EXPORT(CHROMEOS_DBUS) UpdateEngineClient : public DBusClient { ...@@ -116,16 +116,6 @@ class COMPONENT_EXPORT(CHROMEOS_DBUS) UpdateEngineClient : public DBusClient {
virtual void GetChannel(bool get_current_channel, virtual void GetChannel(bool get_current_channel,
const GetChannelCallback& callback) = 0; const GetChannelCallback& callback) = 0;
// TODO(crbug.com/1005511): Deprecate with GetEolStatus().
// Called once GetEolStatus() is complete. Takes one parameter;
// - EndOfLife Status: the end of life status of the device.
using GetEolStatusCallback =
base::OnceCallback<void(update_engine::EndOfLifeStatus status)>;
// TODO(crbug.com/1005511): Deprecate GetEolStatus() use GetEolInfo().
// Get EndOfLife status of the device and calls |callback| when completed.
virtual void GetEolStatus(GetEolStatusCallback callback) = 0;
// Called once GetStatusAdvanced() is complete. Takes one parameter; // Called once GetStatusAdvanced() is complete. Takes one parameter;
// - EolInfo: Please look at EolInfo for param details, all params related to // - EolInfo: Please look at EolInfo for param details, all params related to
// end-of-life will be place within this struct. // end-of-life will be place within this struct.
......
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