[story_options] Accept struct of story deletion policies. Also add new
policy for deleting stories when the last mod is deleted.
TESTED: paved
MF-74 #comment
Change-Id: Ib5349a5840a045b196625b343e303ad231ac5707
diff --git a/public/fidl/fuchsia.modular/story/story_options.fidl b/public/fidl/fuchsia.modular/story/story_options.fidl
index 352886f..6943bd0 100644
--- a/public/fidl/fuchsia.modular/story/story_options.fidl
+++ b/public/fidl/fuchsia.modular/story/story_options.fidl
@@ -4,27 +4,31 @@
library fuchsia.modular;
-using zx;
-
struct StoryOptions {
// Whether or not the story will be hidden on a call to
// StoryProvider#GetStories.
bool kind_of_proto_story;
- // If specified, the framework will enforce a story deletion policy on this
- // story as described in |deletion_policy|. If not specified, the default
- // policy is employed: the story is deleted only when explicitly signaled by
- // a client.
+ // If specified, the framework will delete this story when at least one of
+ // the conditions in the given |deletion_policy| is met. If not specified,
+ // the default policy is employed: the story is deleted only when explicitly
+ // signaled by a client. An explicit signal from the client will always
+ // delete the story regardless of the deletion policy.
StoryDeletionPolicy? deletion_policy;
};
-union StoryDeletionPolicy {
- StoryDeleteAfterLastFocus delete_after_last_focus;
+struct StoryDeletionPolicy {
+ StoryDeleteAfterLastModDeleted? delete_after_last_mod_deleted;
};
-// The story will be deleted after the last time it was focused plus some
-// specified |delay|. If the story is focused again before the delay timer
-// fires, it is reset.
-struct StoryDeleteAfterLastFocus {
- zx.duration delay;
+// The story will be deleted after the last mod is deleted from the story, given
+// that there are no more remaining mods in the story that are about to be
+// launched.
+//
+// NOTE: Stories created without any mods will not be deleted until at least one
+// mod has been added and subsequently deleted.
+struct StoryDeleteAfterLastModDeleted {
+ // FIDL doens't allow empty structs. We want to define policy conditions as
+ // structs so that we can define conditions based on provided values.
+ uint32 dummy;
};