X-Git-Url: https://gerrit.akraino.org/r/gitweb?a=blobdiff_plain;f=src%2Ftype3_AndroidCloud%2Fanbox-master%2Fsrc%2Fanbox%2Fapplication%2Fmanager.h;fp=src%2Ftype3_AndroidCloud%2Fanbox-master%2Fsrc%2Fanbox%2Fapplication%2Fmanager.h;h=b05593b9ba17ceebb26f60e37f07879a37e30a26;hb=e26c1ec581be598521517829adba8c8dd23a768f;hp=0000000000000000000000000000000000000000;hpb=6699c1aea74eeb0eb400e6299079f0c7576f716f;p=iec.git diff --git a/src/type3_AndroidCloud/anbox-master/src/anbox/application/manager.h b/src/type3_AndroidCloud/anbox-master/src/anbox/application/manager.h new file mode 100644 index 0000000..b05593b --- /dev/null +++ b/src/type3_AndroidCloud/anbox-master/src/anbox/application/manager.h @@ -0,0 +1,71 @@ +/* + * Copyright (C) 2016 Simon Fels + * + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 3, as published + * by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranties of + * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR + * PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . + * + */ + +#ifndef ANBOX_APPLICATION_MANAGER_H_ +#define ANBOX_APPLICATION_MANAGER_H_ + +#include "anbox/android/intent.h" +#include "anbox/do_not_copy_or_move.h" +#include "anbox/graphics/rect.h" +#include "anbox/wm/stack.h" + +#include + +#include + +namespace anbox { +namespace application { +class Manager : public DoNotCopyOrMove { + public: + virtual void launch(const android::Intent &intent, + const graphics::Rect &launch_bounds = graphics::Rect::Invalid, + const wm::Stack::Id &stack = wm::Stack::Id::Default) = 0; + + virtual core::Property& ready() = 0; +}; + +class RestrictedManager : public Manager { + public: + RestrictedManager( + const std::shared_ptr &other, + const wm::Stack::Id &launch_stack = wm::Stack::Id::Invalid) : + other_(other), + launch_stack_(launch_stack) {} + + virtual ~RestrictedManager() {} + + void launch(const android::Intent &intent, + const graphics::Rect &launch_bounds = graphics::Rect::Invalid, + const wm::Stack::Id &stack = wm::Stack::Id::Default) override { + auto selected_stack = stack; + // If we have a static launch stack set use that one instead of + // the one the caller gave us. + if (launch_stack_ != wm::Stack::Id::Invalid) + selected_stack = launch_stack_; + other_->launch(intent, launch_bounds, selected_stack); + } + + core::Property& ready() override { return other_->ready(); } + + private: + std::shared_ptr other_; + wm::Stack::Id launch_stack_; +}; +} // namespace application +} // namespace anbox + +#endif