diff options
Diffstat (limited to 'chromium/chromeos/services')
21 files changed, 266 insertions, 75 deletions
diff --git a/chromium/chromeos/services/BUILD.gn b/chromium/chromeos/services/BUILD.gn index b9cd9776ede..3ed8fc8e746 100644 --- a/chromium/chromeos/services/BUILD.gn +++ b/chromium/chromeos/services/BUILD.gn @@ -22,6 +22,7 @@ source_set("unit_tests") { testonly = true deps = [ "//chromeos/services/device_sync:unit_tests", + "//chromeos/services/ime:unit_tests", "//chromeos/services/machine_learning/public/cpp:unit_tests", "//chromeos/services/multidevice_setup:unit_tests", "//chromeos/services/secure_channel:unit_tests", @@ -37,7 +38,7 @@ source_set("unit_tests") { # target below. service_test("chromeos_services_unittests") { deps = [ - "//chromeos/services/ime:unit_tests", + "//chromeos/services/ime:services_unittests", ] if (enable_cros_assistant) { diff --git a/chromium/chromeos/services/assistant/BUILD.gn b/chromium/chromeos/services/assistant/BUILD.gn index 75af4beddd1..01a1f89ff90 100644 --- a/chromium/chromeos/services/assistant/BUILD.gn +++ b/chromium/chromeos/services/assistant/BUILD.gn @@ -68,9 +68,13 @@ source_set("lib") { ] deps += [ + "//chromeos/assistant/internal", "//chromeos/assistant/internal:build_libassistant", "//chromeos/assistant/internal/action", "//chromeos/assistant/internal/proto/google3", + "//chromeos/resources", + "//chromeos/services/assistant/public/proto", + "//chromeos/strings", "//libassistant/contrib/core", "//libassistant/contrib/platform/audio", "//libassistant/shared/internal_api/c:api_wrappers_entrypoint", @@ -101,6 +105,7 @@ source_set("tests") { "//base/test:test_support", "//chromeos", "//mojo/public/cpp/bindings:bindings", + "//services/device/public/mojom", "//services/identity/public/mojom", "//services/service_manager/public/cpp", "//services/service_manager/public/cpp:service_test_support", @@ -116,6 +121,8 @@ source_set("tests") { "platform/audio_output_provider_impl_unittest.cc", "platform/system_provider_impl_unittest.cc", ] + + deps += [ "//libassistant/shared/public" ] } } diff --git a/chromium/chromeos/services/assistant/public/mojom/assistant.mojom b/chromium/chromeos/services/assistant/public/mojom/assistant.mojom index a9438f73ff5..a1963d3d72e 100644 --- a/chromium/chromeos/services/assistant/public/mojom/assistant.mojom +++ b/chromium/chromeos/services/assistant/public/mojom/assistant.mojom @@ -26,9 +26,10 @@ interface Assistant { // Starts a new Assistant voice interaction. StartVoiceInteraction(); - // Stops the active Assistant interaction. If there is no active interaction, - // this method is a no-op. - StopActiveInteraction(); + // Stops the active Assistant interaction and cancel the conversation if + // |cancel_conversation|. If there is no active interaction, this method + // is a no-op. + StopActiveInteraction(bool cancel_conversation); // Send text query to assistant. Result will be returned through registered // |AssistantInteractionSubscriber|. @@ -57,6 +58,10 @@ interface Assistant { // voice queries, and may also be used in standalone screen context // interactions (see StartCachedScreenContextInteraction()). CacheScreenContext() => (); + + // Invoked when accessibility status is changed. Note that though + // accessibility status has changed, |spoken_feedback_enabled| may not have. + OnAccessibilityStatusChanged(bool spoken_feedback_enabled); }; // Subscribes to assistant's interaction event. These events are server driven @@ -71,8 +76,8 @@ interface AssistantInteractionSubscriber { // Assistant interaction has ended with the specified |resolution|. OnInteractionFinished(AssistantInteractionResolution resolution); - // Assistant got Html response from server. - OnHtmlResponse(string response); + // Assistant got Html response with fallback text from server. + OnHtmlResponse(string response, string fallback); // Assistant got suggestions response from server. OnSuggestionsResponse(array<AssistantSuggestion> response); @@ -134,26 +139,6 @@ interface Client { ax.mojom.AssistantTree? structure); }; -// Interface for assistant to call into browser for audio input related -// functions. -interface AudioInput { - // Registers audio input observer. We assume dual-channel, 16kHz and signed - // 32-bit int interleaved format. Audio stream starts recording as soon as - // the first observer is added. And will stop recording if last observer is - // closed. - AddObserver(AudioInputObserver observer); -}; - -// Observer for assistant to receive audio input data. -interface AudioInputObserver { - // Notifies that audio frames are available. - // TODO(muyuanli): Use data pipe. - OnAudioInputFramesAvailable(array<int32> buffer, uint32 frame_count, - mojo_base.mojom.TimeTicks timestamp); - // Notifies that audio input stream is closed. - OnAudioInputClosed(); -}; - // Interface for assistant to call into browser to perform device actions. interface DeviceActions { // Enables or disables WiFi. @@ -161,6 +146,17 @@ interface DeviceActions { // Enables or disables Bluetooth. SetBluetoothEnabled(bool enabled); + + // Gets the current screen brightness level (0-1.0). + // The level is set to 0 in the event of an error. + GetScreenBrightnessLevel() => (bool success, double level); + + // Sets the screen brightness level (0-1.0). If |gradual| is true, the + // transition will be animated. + SetScreenBrightnessLevel(double level, bool gradual); + + // Enables or disables Night Light. + SetNightLightEnabled(bool enabled); }; // Enumeration of possible completions for an Assistant interaction. diff --git a/chromium/chromeos/services/assistant/public/mojom/assistant_audio_decoder.mojom b/chromium/chromeos/services/assistant/public/mojom/assistant_audio_decoder.mojom index 009bb5b8edc..0421b2e5258 100644 --- a/chromium/chromeos/services/assistant/public/mojom/assistant_audio_decoder.mojom +++ b/chromium/chromeos/services/assistant/public/mojom/assistant_audio_decoder.mojom @@ -18,12 +18,15 @@ interface AssistantAudioDecoderFactory { interface AssistantAudioDecoder { // Reads the audio data format. OpenDecoder() => (bool success, - int32 bytes_per_sample, - int32 samples_per_second, - int32 channels); + uint32 bytes_per_sample, + uint32 samples_per_second, + uint32 channels); // Reads the audio data and decodes. Decode(); + + // Close decoder to clean up. + CloseDecoder() => (); }; // Interface for assistant audio decoder service to call into client. @@ -35,5 +38,5 @@ interface AssistantAudioDecoderClient { // Interface used to read data from the calling process. interface AssistantMediaDataSource { - Read(int32 size) => (array<uint8> data); + Read(uint32 size) => (array<uint8> data); }; diff --git a/chromium/chromeos/services/device_sync/BUILD.gn b/chromium/chromeos/services/device_sync/BUILD.gn index db010aba9c7..d0f6f8f093c 100644 --- a/chromium/chromeos/services/device_sync/BUILD.gn +++ b/chromium/chromeos/services/device_sync/BUILD.gn @@ -34,6 +34,7 @@ static_library("device_sync") { "//base", "//chromeos/components/proximity_auth/logging", "//chromeos/services/device_sync/public/mojom", + "//components/gcm_driver", "//net", "//services/identity/public/cpp", "//services/preferences/public/cpp", diff --git a/chromium/chromeos/services/device_sync/public/mojom/device_sync.mojom b/chromium/chromeos/services/device_sync/public/mojom/device_sync.mojom index 06f1e3f06df..f2d68a1f0b0 100644 --- a/chromium/chromeos/services/device_sync/public/mojom/device_sync.mojom +++ b/chromium/chromeos/services/device_sync/public/mojom/device_sync.mojom @@ -48,6 +48,11 @@ enum NetworkRequestResult { // Successful network request. kSuccess, + // The network request itself was successful, but it did not produce the + // expected result (e.g., called SetSoftwareFeatureState(), but the call did + // not result in the feature state changing). + kRequestSucceededButUnexpectedResult, + // Service was not yet initialized; could not complete request. kServiceNotYetInitialized, diff --git a/chromium/chromeos/services/ime/BUILD.gn b/chromium/chromeos/services/ime/BUILD.gn index 173d82e43d3..e170d6ce55f 100644 --- a/chromium/chromeos/services/ime/BUILD.gn +++ b/chromium/chromeos/services/ime/BUILD.gn @@ -20,6 +20,7 @@ source_set("lib") { deps = [ "//base", "//chromeos/services/ime/public/cpp:buildflags", + "//chromeos/services/ime/public/cpp:rulebased", "//chromeos/services/ime/public/mojom", "//services/service_manager/public/cpp", "//services/service_manager/public/mojom", @@ -41,6 +42,13 @@ service_manifest("manifest") { source_set("unit_tests") { testonly = true deps = [ + "//chromeos/services/ime/public/cpp:rulebased_unit_tests", + ] +} + +source_set("services_unittests") { + testonly = true + deps = [ ":lib", "//base", "//chromeos/services/ime/public/mojom", diff --git a/chromium/chromeos/services/ime/public/cpp/BUILD.gn b/chromium/chromeos/services/ime/public/cpp/BUILD.gn index 520a0d2cec1..9e6eee46197 100644 --- a/chromium/chromeos/services/ime/public/cpp/BUILD.gn +++ b/chromium/chromeos/services/ime/public/cpp/BUILD.gn @@ -14,13 +14,42 @@ buildflag_header("buildflags") { ] } -source_set("features") { +source_set("rulebased") { sources = [ - "features.cc", - "features.h", + "rulebased/def/ar.h", + "rulebased/def/ckb_ar.h", + "rulebased/def/ckb_en.h", + "rulebased/def/fa.h", + "rulebased/def/km.h", + "rulebased/def/lo.h", + "rulebased/def/ne_inscript.h", + "rulebased/def/ru_phone_aatseel.h", + "rulebased/def/ru_phone_yazhert.h", + "rulebased/def/ta_inscript.h", + "rulebased/def/ta_typewriter.h", + "rulebased/def/th.h", + "rulebased/def/th_pattajoti.h", + "rulebased/def/th_tis.h", + "rulebased/engine.cc", + "rulebased/engine.h", + "rulebased/rules_data.cc", + "rulebased/rules_data.h", ] deps = [ "//base", ] } + +source_set("rulebased_unit_tests") { + testonly = true + deps = [ + ":rulebased", + "//base", + "//testing/gmock", + "//testing/gtest:gtest", + ] + sources = [ + "rulebased/rulebased_unittest.cc", + ] +} diff --git a/chromium/chromeos/services/machine_learning/public/mojom/graph_executor.mojom b/chromium/chromeos/services/machine_learning/public/mojom/graph_executor.mojom index caafb772f05..787dff09336 100644 --- a/chromium/chromeos/services/machine_learning/public/mojom/graph_executor.mojom +++ b/chromium/chromeos/services/machine_learning/public/mojom/graph_executor.mojom @@ -11,6 +11,19 @@ module chromeos.machine_learning.mojom; import "chromeos/services/machine_learning/public/mojom/tensor.mojom"; +enum ExecuteResult { + OK = 0, + INPUT_MISSING_ERROR, + UNKNOWN_INPUT_ERROR, + INPUT_TYPE_ERROR, + INPUT_SHAPE_ERROR, + INPUT_FORMAT_ERROR, + OUTPUT_MISSING_ERROR, + UNKNOWN_OUTPUT_ERROR, + DUPLICATE_OUTPUT_ERROR, + EXECUTION_ERROR, +}; + // API for performing inference on a TensorFlow graph. A given graph can be // executed multiple times with a single instance of GraphExecutor. interface GraphExecutor { @@ -18,5 +31,5 @@ interface GraphExecutor { // graph. The returned |outputs| are the values for the nodes specified in // |output_names|. Execute(map<string, Tensor> inputs, array<string> output_names) - => (array<Tensor> outputs); + => (ExecuteResult result, array<Tensor>? outputs); }; diff --git a/chromium/chromeos/services/machine_learning/public/mojom/machine_learning_service.mojom b/chromium/chromeos/services/machine_learning/public/mojom/machine_learning_service.mojom index 13e7166f901..6ce9f5e9bcf 100644 --- a/chromium/chromeos/services/machine_learning/public/mojom/machine_learning_service.mojom +++ b/chromium/chromeos/services/machine_learning/public/mojom/machine_learning_service.mojom @@ -13,8 +13,14 @@ module chromeos.machine_learning.mojom; import "chromeos/services/machine_learning/public/mojom/model.mojom"; +enum LoadModelResult { + OK = 0, + MODEL_SPEC_ERROR, + LOAD_MODEL_ERROR, +}; + // Top-level interface between Chromium and the ML Service daemon. interface MachineLearningService { // The ModelId inside ModelSpec is used to specify the model to be loaded. - LoadModel(ModelSpec spec, Model& request); + LoadModel(ModelSpec spec, Model& request) => (LoadModelResult result); }; diff --git a/chromium/chromeos/services/machine_learning/public/mojom/model.mojom b/chromium/chromeos/services/machine_learning/public/mojom/model.mojom index 473313f085e..959ace787a9 100644 --- a/chromium/chromeos/services/machine_learning/public/mojom/model.mojom +++ b/chromium/chromeos/services/machine_learning/public/mojom/model.mojom @@ -15,8 +15,13 @@ import "chromeos/services/machine_learning/public/mojom/graph_executor.mojom"; enum ModelId { UNKNOWN, - TAB_DISCARDER, - POWER_MANAGER + TEST_MODEL, // Only available in tests. +}; + +enum CreateGraphExecutorResult { + OK = 0, + MODEL_INTERPRETATION_ERROR, + MEMORY_ALLOCATION_ERROR, }; struct ModelSpec { @@ -27,5 +32,6 @@ struct ModelSpec { // interface pipe. The Model interface pipe can be used to acquire multiple // separate GraphExecutor instances. interface Model { - CreateGraphExecutor(GraphExecutor& request); + CreateGraphExecutor(GraphExecutor& request) => + (CreateGraphExecutorResult result); }; diff --git a/chromium/chromeos/services/machine_learning/public/mojom/tensor.mojom b/chromium/chromeos/services/machine_learning/public/mojom/tensor.mojom index 7828b55931e..786eaac24b3 100644 --- a/chromium/chromeos/services/machine_learning/public/mojom/tensor.mojom +++ b/chromium/chromeos/services/machine_learning/public/mojom/tensor.mojom @@ -13,22 +13,29 @@ module chromeos.machine_learning.mojom; -// Corresponds to tensorflow.BytesList protobuf: struct StringList { array<string> value; }; -// Corresponds to tensorflow.FloatList protobuf: -struct FloatList { +struct FloatList { array<double> value; }; -// Corresponds to tensorflow.Int64List protobuf: struct Int64List { array<int64> value; }; -// Corresponds to tensorflow.Feature protobuf: +// The union of all supported tensor types. Supporting a new type comprises the +// following: +// - Adding a new struct above (e.g. BoolList), +// - Adding this new struct to the union below, +// - Adding template specializations for the new type to +// platform2/ml/tensor_view.{h,cc}. +// - Updating platform2/ml/graph_executor_impl.cc to use a TensorView of the +// new type. +// +// TODO(chromium:836098): add new types (e.g. uint8, bool) as they become +// useful. union ValueList { StringList string_list; FloatList float_list; diff --git a/chromium/chromeos/services/media_perception/public/mojom/BUILD.gn b/chromium/chromeos/services/media_perception/public/mojom/BUILD.gn index 23b62e6a689..a51e3a76ed2 100644 --- a/chromium/chromeos/services/media_perception/public/mojom/BUILD.gn +++ b/chromium/chromeos/services/media_perception/public/mojom/BUILD.gn @@ -6,7 +6,8 @@ import("//mojo/public/tools/bindings/mojom.gni") mojom("mojom") { sources = [ - "connector.mojom", + "media_perception.mojom", + "media_perception_service.mojom", ] public_deps = [ diff --git a/chromium/chromeos/services/media_perception/public/mojom/connector.mojom b/chromium/chromeos/services/media_perception/public/mojom/connector.mojom deleted file mode 100644 index 929709c088e..00000000000 --- a/chromium/chromeos/services/media_perception/public/mojom/connector.mojom +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright 2018 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -module chromeos.media_perception.mojom; - -import "services/video_capture/public/mojom/device_factory.mojom"; - -interface Connector { - // Interface for a process running outside of Chrome to connect to the - // video capture service directly via a Mojo pipe set up through a - // DeviceFactory request. - ConnectToVideoCaptureService(video_capture.mojom.DeviceFactory& request); -}; diff --git a/chromium/chromeos/services/media_perception/public/mojom/media_perception.mojom b/chromium/chromeos/services/media_perception/public/mojom/media_perception.mojom new file mode 100644 index 00000000000..8747054137d --- /dev/null +++ b/chromium/chromeos/services/media_perception/public/mojom/media_perception.mojom @@ -0,0 +1,8 @@ +// Copyright 2018 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +module chromeos.media_perception.mojom; + +interface MediaPerception { +}; diff --git a/chromium/chromeos/services/media_perception/public/mojom/media_perception_service.mojom b/chromium/chromeos/services/media_perception/public/mojom/media_perception_service.mojom new file mode 100644 index 00000000000..12151a5d6ce --- /dev/null +++ b/chromium/chromeos/services/media_perception/public/mojom/media_perception_service.mojom @@ -0,0 +1,29 @@ +// Copyright 2018 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. +// +// Next MinVersion: 1 + +module chromeos.media_perception.mojom; + +import "chromeos/services/media_perception/public/mojom/media_perception.mojom"; +import "services/video_capture/public/mojom/device_factory.mojom"; + +// Used to establish two-way communication between a client and the media +// perception service. +interface MediaPerceptionService { + GetController@0(MediaPerceptionController& request, + MediaPerceptionControllerClient client); +}; + +interface MediaPerceptionController { + // Used by the client to establish a MediaPerception pipe. + ActivateMediaPerception@0(MediaPerception& request); +}; + +interface MediaPerceptionControllerClient { + // Interface for the service to connect to the Video Capture Service + // directly via a Mojo pipe set up through a DeviceFactory request. + ConnectToVideoCaptureService@0(video_capture.mojom.DeviceFactory& request); +}; + diff --git a/chromium/chromeos/services/multidevice_setup/BUILD.gn b/chromium/chromeos/services/multidevice_setup/BUILD.gn index 91fbd954c3f..cab1d1d9b20 100644 --- a/chromium/chromeos/services/multidevice_setup/BUILD.gn +++ b/chromium/chromeos/services/multidevice_setup/BUILD.gn @@ -14,6 +14,8 @@ static_library("multidevice_setup") { "account_status_change_delegate_notifier.h", "account_status_change_delegate_notifier_impl.cc", "account_status_change_delegate_notifier_impl.h", + "android_sms_app_installing_status_observer.cc", + "android_sms_app_installing_status_observer.h", "device_reenroller.cc", "device_reenroller.h", "eligible_host_devices_provider.h", @@ -23,10 +25,15 @@ static_library("multidevice_setup") { "feature_state_manager.h", "feature_state_manager_impl.cc", "feature_state_manager_impl.h", + "grandfathered_easy_unlock_host_disabler.cc", + "grandfathered_easy_unlock_host_disabler.h", "host_backend_delegate.cc", "host_backend_delegate.h", "host_backend_delegate_impl.cc", "host_backend_delegate_impl.h", + "host_device_timestamp_manager.h", + "host_device_timestamp_manager_impl.cc", + "host_device_timestamp_manager_impl.h", "host_status_provider.cc", "host_status_provider.h", "host_status_provider_impl.cc", @@ -43,9 +50,10 @@ static_library("multidevice_setup") { "multidevice_setup_initializer.h", "multidevice_setup_service.cc", "multidevice_setup_service.h", - "setup_flow_completion_recorder.h", - "setup_flow_completion_recorder_impl.cc", - "setup_flow_completion_recorder_impl.h", + "privileged_host_device_setter_base.cc", + "privileged_host_device_setter_base.h", + "privileged_host_device_setter_impl.cc", + "privileged_host_device_setter_impl.h", ] deps = [ @@ -55,7 +63,9 @@ static_library("multidevice_setup") { "//chromeos/services/device_sync/public/mojom", "//chromeos/services/multidevice_setup/proto", "//chromeos/services/multidevice_setup/public/cpp:android_sms_app_helper_delegate", + "//chromeos/services/multidevice_setup/public/cpp:android_sms_pairing_state_tracker", "//chromeos/services/multidevice_setup/public/cpp:auth_token_validator", + "//chromeos/services/multidevice_setup/public/cpp:oobe_completion_tracker", "//chromeos/services/multidevice_setup/public/cpp:prefs", "//chromeos/services/multidevice_setup/public/mojom", "//chromeos/services/secure_channel/public/cpp/client", @@ -88,14 +98,14 @@ static_library("test_support") { "fake_feature_state_observer.h", "fake_host_backend_delegate.cc", "fake_host_backend_delegate.h", + "fake_host_device_timestamp_manager.cc", + "fake_host_device_timestamp_manager.h", "fake_host_status_observer.cc", "fake_host_status_observer.h", "fake_host_status_provider.cc", "fake_host_status_provider.h", "fake_host_verifier.cc", "fake_host_verifier.h", - "fake_setup_flow_completion_recorder.cc", - "fake_setup_flow_completion_recorder.h", ] deps = [ @@ -113,15 +123,18 @@ source_set("unit_tests") { sources = [ "account_status_change_delegate_notifier_impl_unittest.cc", + "android_sms_app_installing_status_observer_unittest.cc", "device_reenroller_unittest.cc", "eligible_host_devices_provider_impl_unittest.cc", "feature_state_manager_impl_unittest.cc", + "grandfathered_easy_unlock_host_disabler_unittest.cc", "host_backend_delegate_impl_unittest.cc", + "host_device_timestamp_manager_impl_unittest.cc", "host_status_provider_impl_unittest.cc", "host_verifier_impl_unittest.cc", "multidevice_setup_impl_unittest.cc", "multidevice_setup_service_unittest.cc", - "setup_flow_completion_recorder_impl_unittest.cc", + "privileged_host_device_setter_impl_unittest.cc", ] deps = [ @@ -130,6 +143,7 @@ source_set("unit_tests") { "//base", "//base/test:test_support", "//chromeos/services/device_sync/public/cpp:test_support", + "//chromeos/services/multidevice_setup/public/cpp:oobe_completion_tracker", "//chromeos/services/multidevice_setup/public/cpp:prefs", "//chromeos/services/multidevice_setup/public/cpp:test_support", "//chromeos/services/multidevice_setup/public/cpp:unit_tests", diff --git a/chromium/chromeos/services/multidevice_setup/public/cpp/BUILD.gn b/chromium/chromeos/services/multidevice_setup/public/cpp/BUILD.gn index 4d36b56ff45..cf222523aeb 100644 --- a/chromium/chromeos/services/multidevice_setup/public/cpp/BUILD.gn +++ b/chromium/chromeos/services/multidevice_setup/public/cpp/BUILD.gn @@ -35,7 +35,18 @@ source_set("android_sms_app_helper_delegate") { "android_sms_app_helper_delegate.h", ] - public_deps = [ + deps = [ + "//base", + ] +} + +source_set("android_sms_pairing_state_tracker") { + sources = [ + "android_sms_pairing_state_tracker.cc", + "android_sms_pairing_state_tracker.h", + ] + + deps = [ "//base", ] } @@ -48,10 +59,37 @@ source_set("prefs") { deps = [ "//base", + "//chromeos/services/multidevice_setup/public/mojom", "//components/prefs:prefs", ] } +source_set("first_run_field_trial") { + sources = [ + "first_run_field_trial.cc", + "first_run_field_trial.h", + ] + + deps = [ + "//base", + "//chromeos", + "//components/variations/proto", + "//components/variations/service", + ] +} + +source_set("oobe_completion_tracker") { + sources = [ + "oobe_completion_tracker.cc", + "oobe_completion_tracker.h", + ] + + deps = [ + "//base", + "//components/keyed_service/core", + ] +} + source_set("url_provider") { sources = [ "url_provider.cc", @@ -70,16 +108,21 @@ static_library("test_support") { sources = [ "fake_android_sms_app_helper_delegate.cc", "fake_android_sms_app_helper_delegate.h", + "fake_android_sms_pairing_state_tracker.cc", + "fake_android_sms_pairing_state_tracker.h", "fake_auth_token_validator.cc", "fake_auth_token_validator.h", "fake_multidevice_setup.cc", "fake_multidevice_setup.h", "fake_multidevice_setup_client.cc", "fake_multidevice_setup_client.h", + "fake_privileged_host_device_setter.cc", + "fake_privileged_host_device_setter.h", ] public_deps = [ ":android_sms_app_helper_delegate", + ":android_sms_pairing_state_tracker", ":auth_token_validator", ":cpp", "//chromeos/services/multidevice_setup", diff --git a/chromium/chromeos/services/multidevice_setup/public/mojom/multidevice_setup.mojom b/chromium/chromeos/services/multidevice_setup/public/mojom/multidevice_setup.mojom index 01b762b547b..94e32b29d08 100644 --- a/chromium/chromeos/services/multidevice_setup/public/mojom/multidevice_setup.mojom +++ b/chromium/chromeos/services/multidevice_setup/public/mojom/multidevice_setup.mojom @@ -78,7 +78,11 @@ enum FeatureState { // The feature has been enabled by the user, but it is still unavailable // because the entire Better Together suite has been disabled by the user. - kUnavailableSuiteDisabled + kUnavailableSuiteDisabled, + + // The feature still requires further setup to be ready for use (e.g., Android + // Messages requires a separate pairing flow after unified setup). + kFurtherSetupRequired, }; interface AccountStatusChangeDelegate { @@ -87,17 +91,24 @@ interface AccountStatusChangeDelegate { // called if the current user has not yet set up MultiDevice features. OnPotentialHostExistsForNewUser(); + // Callback which indicates that the account left the state of having a + // potential host ready for setup. Note that it is called both when a host is + // set and when there are simply no host devices (i.e. neither potential nor + // set) on the account anymore. This function is only called if the current + // user has not yet set up MultiDevice features and received backend + // confirmation. + OnNoLongerNewUser(); + // Callback which indicates that the currently-connected MultiDevice host has // changed. This likely means that the user has changed MultiDevice settings // on another device. This function is only called if the current user has - // already set up MultiDevice features. Note: |new_host_device_name| is - // expected to be a UTF-8 string. + // already set up MultiDevice features. OnConnectedHostSwitchedForExistingUser(string new_host_device_name); // Callback which indicates that a new Chromebook was added to the account of // the current user. This function is only called if the current user has // already set up MultiDevice features. - OnNewChromebookAddedForExistingUser(); + OnNewChromebookAddedForExistingUser(string new_host_device_name); }; interface HostStatusObserver { @@ -114,8 +125,8 @@ interface FeatureStateObserver { }; // Provides an API to the MultiDevice Setup flow. Designed to be exposed -// primarily to the MultiDevice setup flow at chrome://multidevice-setup (normal -// usage) as well as the ProximityAuth debug WebUI page at +// primarily to the MultiDevice setup flow at chrome://multidevice-setup and +// chrome://oobe (normal usage) as well as the ProximityAuth debug WebUI page at // chrome://proximity-auth (debugging only). interface MultiDeviceSetup { // Registers the "account status change" delegate to be used by the service. @@ -136,16 +147,16 @@ interface MultiDeviceSetup { GetEligibleHostDevices() => (array<chromeos.device_sync.mojom.RemoteDevice> eligible_host_devices); - // Sets the host associated with the provided public key as the host device + // Sets the host associated with the provided device ID as the host device // for this account. The provided auth token must be valid in order to prove // that the user is authenticated. If called when there is no current host or // when the current host is a different device from the one passed, this // function initiates a connection to the back-end and attempts to set the // host. When called with the same device that is already the host, this // function is a no-op. Returns a success boolean; this function will fail if - // the provided public key does not correspond to an eligible host device on + // the provided device ID does not correspond to an eligible host device on // the account, or the provided auth token is invalid. - SetHostDevice(string public_key, string auth_token) => (bool success); + SetHostDevice(string device_id, string auth_token) => (bool success); // Removes the currently-set host as the multi-device host for this account. // If there was no host set to begin with, this function is a no-op. @@ -190,3 +201,12 @@ interface MultiDeviceSetup { // During normal usage, events are triggered internally within the service. TriggerEventForDebugging(EventTypeForDebugging type) => (bool success); }; + +// Provides an API for setting a MultiDevice host without the need to provide an +// auth token. This interface should only be used in circumstances when the user +// has just entered their password. +interface PrivilegedHostDeviceSetter { + // Same functionality as MultiDeviceSetup's SetHostDevice() function above, + // except that no auth token is required. + SetHostDevice(string device_id) => (bool success); +}; diff --git a/chromium/chromeos/services/secure_channel/BUILD.gn b/chromium/chromeos/services/secure_channel/BUILD.gn index 1fea8aeaa34..27039ef751f 100644 --- a/chromium/chromeos/services/secure_channel/BUILD.gn +++ b/chromium/chromeos/services/secure_channel/BUILD.gn @@ -78,6 +78,7 @@ static_library("secure_channel") { "multiplexed_channel.h", "multiplexed_channel_impl.cc", "multiplexed_channel_impl.h", + "pending_ble_connection_request_base.h", "pending_ble_initiator_connection_request.cc", "pending_ble_initiator_connection_request.h", "pending_ble_listener_connection_request.cc", @@ -210,6 +211,7 @@ source_set("unit_tests") { "connection_attempt_base_unittest.cc", "error_tolerant_ble_advertisement_impl_unittest.cc", "multiplexed_channel_impl_unittest.cc", + "pending_ble_connection_request_base_unittest.cc", "pending_ble_initiator_connection_request_unittest.cc", "pending_ble_listener_connection_request_unittest.cc", "pending_connection_manager_impl_unittest.cc", diff --git a/chromium/chromeos/services/secure_channel/public/mojom/secure_channel.mojom b/chromium/chromeos/services/secure_channel/public/mojom/secure_channel.mojom index 94261694ece..f58a8c40bda 100644 --- a/chromium/chromeos/services/secure_channel/public/mojom/secure_channel.mojom +++ b/chromium/chromeos/services/secure_channel/public/mojom/secure_channel.mojom @@ -34,7 +34,13 @@ enum ConnectionAttemptFailureReason { REMOTE_DEVICE_INVALID_PSK, // Timeouts occurred trying to contact the remote device. - TIMEOUT_FINDING_DEVICE + TIMEOUT_FINDING_DEVICE, + + // The local Bluetooth adapter is disabled (turned off). + ADAPTER_DISABLED, + + // The local Bluetooth adapter is not present. + ADAPTER_NOT_PRESENT }; enum ConnectionCreationDetail { |