[element_manager] `element_manager.cm` use new API
This CL continues the migration of `element_manager` started
in http://fxrev.dev/691451. Now that all OOT clients are migrated
(http://fxrev.dev/691391), `element_manager.cm` refers to the new
manifest used by `new_element_manager.cm`. A subsequent CL will
remove `new_element_manager.cm`.
Bug: 95841
Bug: 100933
Change-Id: I80ea723f14cef14f9de5d36b8ed744e365c77a28
Reviewed-on: https://fuchsia-review.googlesource.com/c/fuchsia/+/693842
Reviewed-by: Yegor Pomortsev <ypomortsev@google.com>
Reviewed-by: John Shamoon <johnshamoon@google.com>
Commit-Queue: Yaneury Fermin <yaneury@google.com>
diff --git a/sdk/cts/tests/fidl/fuchsia.element/meta/reference-session.cml b/sdk/cts/tests/fidl/fuchsia.element/meta/reference-session.cml
index a92f588..e0017af 100644
--- a/sdk/cts/tests/fidl/fuchsia.element/meta/reference-session.cml
+++ b/sdk/cts/tests/fidl/fuchsia.element/meta/reference-session.cml
@@ -24,6 +24,12 @@
startup: "eager",
},
],
+ collections: [
+ {
+ name: "elements",
+ durability: "transient",
+ },
+ ],
capabilities: [
{ protocol: "fuchsia.element.Manager" },
],
@@ -51,6 +57,11 @@
from: "#reference-scenic",
to: "#element_manager",
},
+ {
+ protocol: "fuchsia.component.Realm",
+ from: "framework",
+ to: "#element_manager",
+ },
],
expose: [
{
diff --git a/src/session/bin/element_manager/BUILD.gn b/src/session/bin/element_manager/BUILD.gn
index e7849d8..101a758 100644
--- a/src/session/bin/element_manager/BUILD.gn
+++ b/src/session/bin/element_manager/BUILD.gn
@@ -56,14 +56,6 @@
]
}
-fuchsia_component_manifest("base_manifest") {
- manifest = "meta/base.shard.cml"
-}
-
-fuchsia_structured_config_rust_lib("element_config") {
- cm_label = ":base_manifest"
-}
-
# The Element Manager component is undergoing a breaking change. Previous
# versions consumed the `fuchsia.component.Realm` protocol from the framework.
# However, this behavior has been changed to instead consume the protocol
@@ -78,6 +70,10 @@
manifest = "meta/element_manager.cml"
}
+fuchsia_structured_config_rust_lib("element_config") {
+ cm_label = ":manifest"
+}
+
fuchsia_structured_config_values("sc_values") {
cm_label = ":manifest"
values = {
@@ -90,9 +86,17 @@
deps = [ ":element_manager_bin" ]
}
+# The Element Manager component is undergoing a breaking change. Previous
+# versions consumed the `fuchsia.component.Realm` protocol from the framework.
+# However, this behavior has been changed to instead consume the protocol
+# from parent, delegating the necessary routing to the session. All clients of
+# the Element Manager component are to move to use this version. In order to
+# facilitate this transition, the deprecated version of the component is kept.
+#
+# TODO(http://fxbug.dev/95841): Remove `new_element_manager` related GN targets.
fuchsia_component_manifest("new_element_manager_manifest") {
component_name = "new_element_manager"
- manifest = "meta/new_element_manager.cml"
+ manifest = "meta/element_manager.cml"
}
fuchsia_structured_config_values("new_element_manager_sc_values") {
diff --git a/src/session/bin/element_manager/meta/base.shard.cml b/src/session/bin/element_manager/meta/base.shard.cml
deleted file mode 100644
index a7f31cf..0000000
--- a/src/session/bin/element_manager/meta/base.shard.cml
+++ /dev/null
@@ -1,36 +0,0 @@
-// Copyright 2022 The Fuchsia Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-{
- include: [ "syslog/client.shard.cml" ],
- program: {
- runner: "elf",
- binary: "bin/element_manager",
- },
- capabilities: [
- {
- protocol: [ "fuchsia.element.Manager" ],
- },
- ],
- use: [
- {
- protocol: [
- "fuchsia.element.GraphicalPresenter",
- "fuchsia.sys.Launcher",
- "fuchsia.ui.scenic.Scenic",
- ],
- },
- ],
- expose: [
- {
- protocol: [ "fuchsia.element.Manager" ],
- from: "self",
- },
- ],
- config: {
- elements_collection_name: {
- type: "string",
- max_size: 512,
- },
- },
-}
diff --git a/src/session/bin/element_manager/meta/element_manager.cml b/src/session/bin/element_manager/meta/element_manager.cml
index 62b4931..25ee47df 100644
--- a/src/session/bin/element_manager/meta/element_manager.cml
+++ b/src/session/bin/element_manager/meta/element_manager.cml
@@ -2,33 +2,39 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
{
- include: [ "//src/session/bin/element_manager/meta/base.shard.cml" ],
- collections: [
+ include: [ "syslog/client.shard.cml" ],
+ program: {
+ runner: "elf",
+ binary: "bin/element_manager",
+ },
+ capabilities: [
{
- name: "elements",
- durability: "transient",
+ protocol: [ "fuchsia.element.Manager" ],
},
],
use: [
{
- protocol: "fuchsia.component.Realm",
- from: "framework",
- },
- ],
- offer: [
- {
protocol: [
- "fuchsia.logger.LogSink",
- "fuchsia.media.Audio",
- "fuchsia.sysmem.Allocator",
- "fuchsia.tracing.provider.Registry",
- "fuchsia.ui.composition.Allocator",
- "fuchsia.ui.composition.Flatland",
- "fuchsia.ui.input3.Keyboard",
+ "fuchsia.element.GraphicalPresenter",
+ "fuchsia.sys.Launcher",
"fuchsia.ui.scenic.Scenic",
],
+ },
+ {
+ protocol: "fuchsia.component.Realm",
from: "parent",
- to: "#elements",
},
],
+ expose: [
+ {
+ protocol: [ "fuchsia.element.Manager" ],
+ from: "self",
+ },
+ ],
+ config: {
+ elements_collection_name: {
+ type: "string",
+ max_size: 512,
+ },
+ },
}
diff --git a/src/session/bin/element_manager/meta/new_element_manager.cml b/src/session/bin/element_manager/meta/new_element_manager.cml
deleted file mode 100644
index 44eb64bd..0000000
--- a/src/session/bin/element_manager/meta/new_element_manager.cml
+++ /dev/null
@@ -1,12 +0,0 @@
-// Copyright 2022 The Fuchsia Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-{
- include: [ "//src/session/bin/element_manager/meta/base.shard.cml" ],
- use: [
- {
- protocol: "fuchsia.component.Realm",
- from: "parent",
- },
- ],
-}
diff --git a/src/session/examples/tiles-session/meta/tiles-session-routing.cml b/src/session/examples/tiles-session/meta/tiles-session-routing.cml
index 45d2220..8ed5ea5 100644
--- a/src/session/examples/tiles-session/meta/tiles-session-routing.cml
+++ b/src/session/examples/tiles-session/meta/tiles-session-routing.cml
@@ -45,6 +45,12 @@
startup: "lazy",
},
],
+ collections: [
+ {
+ name: "elements",
+ durability: "transient",
+ },
+ ],
offer: [
{
protocol: [
@@ -70,7 +76,10 @@
"fuchsia.ui.views.ViewRefInstalled",
],
from: "parent",
- to: [ "#scene_manager" ],
+ to: [
+ "#elements",
+ "#scene_manager",
+ ],
},
{
directory: "dev-input-report",
@@ -104,6 +113,11 @@
to: [ "#element_manager" ],
},
{
+ protocol: "fuchsia.component.Realm",
+ from: "framework",
+ to: "#element_manager",
+ },
+ {
protocol: [
"fuchsia.feedback.CrashReporter",
"fuchsia.intl.PropertyProvider",