blob: d0326691c6ee128846e519a2b66d6aff67a85a4a [file] [log] [blame]
// Copyright 2016 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.
library fuchsia.modular.internal;
using fuchsia.auth;
using fuchsia.modular;
using fuchsia.modular.auth;
using fuchsia.ui.policy;
using fuchsia.ui.views;
/// The basemgr application (there is no `Basemgr` service) requests
/// an instance of this service in order to launch and display a `Sessionmgr`.
[Discoverable] // Created by sessionmgr application.
protocol Sessionmgr {
/// Launches a sessionmgr instance identified by a unique device-local
/// `session_id`. The uniqueness of `session_id` must be guaranteed by the
/// caller, because `sessionmgr` creates an Environment namespace with the
/// given `session_id`, and this will crash if we try to create an
/// environment with a pre-existing name, because the services sessionmgr
/// tries to access won't be available.
///
// TODO(MF-287): Address issues around client-generated session_id and
// initialization pattern of sessionmgr.
Initialize(string session_id,
fuchsia.modular.auth.Account? account,
fuchsia.modular.AppConfig session_shell,
fuchsia.modular.AppConfig story_shell,
bool use_session_shell_for_story_shell_factory,
fuchsia.auth.TokenManager? ledger_token_manager,
fuchsia.auth.TokenManager? agent_token_manager,
SessionContext session_context,
fuchsia.ui.views.ViewToken view_token);
SwapSessionShell(fuchsia.modular.AppConfig session_shell) -> ();
};
/// This interface is provided by basemgr to `Sessionmgr`.
protocol SessionContext {
/// See detailed comments in SessionShellContext.Logout(). Logs out all the
/// users in this session, then shut down the sessionmgr process.
Logout();
/// Restarts the session without logging out the users of the session.
Restart();
/// Shut down the sessionmgr process. This method should be called if the
/// users of the session should remain logged in. Call Logout() if the intent
/// is to also log out the users from the session.
Shutdown();
GetPresentation(request<fuchsia.ui.policy.Presentation> presentation);
};