0

Ignore adaptation disconnects.

Change-Id: I4f7508be3145f63a8e4e73762706d0a5c50c1991
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6406473
Auto-Submit: Steven Holte <holte@chromium.org>
Commit-Queue: Steven Holte <holte@chromium.org>
Reviewed-by: Mike Wittman <wittman@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1439560}
This commit is contained in:
Steven Holte 2025-03-28 11:23:43 -07:00 committed by Chromium LUCI CQ
parent 82990c05f9
commit 6e786c79de
3 changed files with 3 additions and 21 deletions

@ -63,9 +63,9 @@ OnDeviceModelAdaptationController::GetOrCreateModelRemote(
adaptation_assets),
base::BindOnce(OnAdaptationAssetsLoaded, weak_ptr_factory_.GetWeakPtr(),
model_remote_.BindNewPipeAndPassReceiver()));
model_remote_.set_disconnect_handler(base::BindOnce(
&OnDeviceModelServiceController::OnModelAdaptationRemoteDisconnected,
controller_));
// Disconnects should only happen on a service crash, and we track those
// elsewhere.
model_remote_.reset_on_disconnect();
model_remote_.reset_on_idle_timeout(
features::GetOnDeviceModelIdleTimeout());
}

@ -414,11 +414,6 @@ void OnDeviceModelServiceController::OnServiceDisconnected(
void OnDeviceModelServiceController::OnBaseModelDisconnected() {
LOG(ERROR) << "Base model disconnected unexpectedly.";
// This could be either a true crash or just a failure to load the model,
// but we handle it the same way in either case.
// Explicitly reset to adaptations remotes to avoid receiving additional
// disconnect errors (though they may have already received them).
model_adaptation_controllers_.clear();
base_model_remote_.reset();
access_controller_->OnDisconnectedFromRemote();
FinishValidation(OnDeviceModelValidationResult::kServiceCrash);
@ -431,16 +426,6 @@ void OnDeviceModelServiceController::OnBaseModelRemoteIdle() {
base_model_remote_.reset();
}
void OnDeviceModelServiceController::OnModelAdaptationRemoteDisconnected() {
LOG(ERROR) << "Model adaptation disconnected unexpectedly.";
// In the event of a service crash, we expect that OnBaseModelDisconnected
// will usually be called first, and prevent this from firing, otherwise this
// may double count the crash.
// TODO: crbug.com/376063340 - Consider tracking these separately and not
// suppressing the disconnect errors.
access_controller_->OnDisconnectedFromRemote();
}
OnDeviceModelServiceController::OnDeviceModelClient::OnDeviceModelClient(
ModelBasedCapabilityKey feature,
base::WeakPtr<OnDeviceModelServiceController> controller,

@ -110,9 +110,6 @@ class OnDeviceModelServiceController
ModelBasedCapabilityKey feature,
std::unique_ptr<OnDeviceModelAdaptationMetadata> adaptation_metadata);
// Called when the model adaptation remote is disconnected.
void OnModelAdaptationRemoteDisconnected();
// Add/remove observers for notifying on-device model availability changes.
void AddOnDeviceModelAvailabilityChangeObserver(
ModelBasedCapabilityKey feature,