Remove Accessibility Launcher from settings 29/233429/1
authorArtur Świgoń <a.swigon@samsung.com>
Thu, 14 May 2020 13:37:22 +0000 (15:37 +0200)
committerArtur Świgoń <a.swigon@samsung.com>
Thu, 14 May 2020 13:37:22 +0000 (15:37 +0200)
Change-Id: Ifcbd8d79e2b690f7c6226cb6ed821be4397caa4b

po/en.po
src/model/AccessibilityLauncherModel.cpp [deleted file]
src/model/AccessibilityLauncherModel.hpp [deleted file]
src/presenter/AccessibilityLauncherPagePresenter.cpp [deleted file]
src/presenter/AccessibilityLauncherPagePresenter.hpp [deleted file]
src/presenter/MainPagePresenter.cpp
src/presenter/MainPagePresenter.hpp

index cd643392b46f259e99056ffbbe69e56f02422796..feab158742a1cd79c5c8d6c005bd00d1a9aa7311 100644 (file)
--- a/po/en.po
+++ b/po/en.po
@@ -601,21 +601,6 @@ msgstr "Close your eyes for at least 2.0 seconds to allow the device to recognis
 msgid  "IDS_ACCS_UNIVERSAL_SWITCH_ADD_SWITCH_CAMERA_GROUP_HEAD_MOUTH"
 msgstr "Open mouth"
 
-msgid  "IDS_ACCS_ACCESSIBILITY_LAUNCHER"
-msgstr "Accessibility launcher"
-
-msgid  "IDS_ACCS_ACCESSIBILITY_LAUNCHER_HINT"
-msgstr "Add shortcuts to specific settings and functions."
-
-msgid  "IDS_ACCS_ACCESSIBILITY_LAUNCHER_COMMENT"
-msgstr "Open your accessibility settings by pressing the home key three times in quick succession."
-
-msgid  "IDS_ACCS_ACCESSIBILITY_LAUNCHER_ON"
-msgstr "On"
-
-msgid  "IDS_ACCS_ACCESSIBILITY_LAUNCHER_OFF"
-msgstr "Off"
-
 msgid  "IDS_ACCS_SELECT_ITEMS"
 msgstr "Select items"
 
diff --git a/src/model/AccessibilityLauncherModel.cpp b/src/model/AccessibilityLauncherModel.cpp
deleted file mode 100644 (file)
index fb33032..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Copyright 2019 Samsung Electronics Co., Ltd
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-#include "AccessibilityLauncherModel.hpp"
-
-#include "Singleton.hpp"
-
-#define VCONFKEY_SETAPPL_ACCESSIBILITY_ACCESSIBILITY_LAUNCHER_STATE "db/setting/accessibility/accessibility-launcher"
-#define VCONFKEY_SETAPPL_ACCESSIBILITY_ACCESSIBILITY_LAUNCHER_LAUNCH "db/setting/accessibility/accessibility-launcher/launch"
-
-AccessibilityLauncherModel::AccessibilityLauncherModel()
-{
-       stateHandle_ = Singleton<VConfInterface>::instance().registerAndGet<bool>(VCONFKEY_SETAPPL_ACCESSIBILITY_ACCESSIBILITY_LAUNCHER_STATE, false, [this](auto val) {
-               state_ = val;
-       });
-
-       state_.attach([](auto val) {
-               Singleton<VConfInterface>::instance().set(VCONFKEY_SETAPPL_ACCESSIBILITY_ACCESSIBILITY_LAUNCHER_STATE, val);
-       });
-
-       launchedHandle_ = Singleton<VConfInterface>::instance().registerAndGet<int>(VCONFKEY_SETAPPL_ACCESSIBILITY_ACCESSIBILITY_LAUNCHER_LAUNCH, 0, [this](auto val) {
-               bool a = val & 0x1;
-               if (a != accessibilityLaunched_.value())
-                       accessibilityLaunched_ = a;
-
-               bool sr = val & 0x2;
-               if (sr != screenReaderLaunched_.value())
-                       screenReaderLaunched_ = sr;
-
-               bool us = val & 0x4;
-               if (us != universalSwitchLaunched_.value())
-                       universalSwitchLaunched_ = us;
-       });
-
-       auto calculateLauncherState = [this]() {
-               int a = accessibilityLaunched_.value() ? 0x1 : 0x0;
-               int sr = screenReaderLaunched_.value() ? 0x2 : 0x0;
-               int us = universalSwitchLaunched_.value() ? 0x4 : 0x0;
-
-               return us | sr | a;
-       };
-
-       accessibilityLaunched_.attach([this, calculateLauncherState](auto val) {
-               Singleton<VConfInterface>::instance().set(VCONFKEY_SETAPPL_ACCESSIBILITY_ACCESSIBILITY_LAUNCHER_LAUNCH, calculateLauncherState());
-       });
-       screenReaderLaunched_.attach([this, calculateLauncherState](auto val) {
-               Singleton<VConfInterface>::instance().set(VCONFKEY_SETAPPL_ACCESSIBILITY_ACCESSIBILITY_LAUNCHER_LAUNCH, calculateLauncherState());
-       });
-       universalSwitchLaunched_.attach([this, calculateLauncherState](auto val) {
-               Singleton<VConfInterface>::instance().set(VCONFKEY_SETAPPL_ACCESSIBILITY_ACCESSIBILITY_LAUNCHER_LAUNCH, calculateLauncherState());
-       });
-}
\ No newline at end of file
diff --git a/src/model/AccessibilityLauncherModel.hpp b/src/model/AccessibilityLauncherModel.hpp
deleted file mode 100644 (file)
index 1906bb5..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright 2019 Samsung Electronics Co., Ltd
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-#ifndef ACCESSIBILITY_LAUNCHER_MODEL_HPP
-#define ACCESSIBILITY_LAUNCHER_MODEL_HPP
-
-#include "ObservableProperty.hpp"
-#include "VConf.hpp"
-
-class AccessibilityLauncherModel
-{
-       public:
-       AccessibilityLauncherModel();
-
-       ObservableProperty<bool> state_;
-       ObservableProperty<bool> accessibilityLaunched_;
-       ObservableProperty<bool> screenReaderLaunched_;
-       ObservableProperty<bool> universalSwitchLaunched_;
-
-       private:
-       VConfInterface::CallbackHandle stateHandle_;
-       VConfInterface::CallbackHandle launchedHandle_;
-};
-
-#endif
diff --git a/src/presenter/AccessibilityLauncherPagePresenter.cpp b/src/presenter/AccessibilityLauncherPagePresenter.cpp
deleted file mode 100644 (file)
index e689427..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright 2018 Samsung Electronics Co., Ltd
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
-
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "AccessibilityLauncherPagePresenter.hpp"
-
-#include "AccessibilitySettingLog.hpp"
-#include "AppContext.hpp"
-#include "Button.hpp"
-#include "Genlist.hpp"
-#include "Singleton.hpp"
-#include "VConf.hpp"
-#include "utils.hpp"
-
-#include <app.h>
-#include <string>
-#include <vconf.h>
-
-AccessibilityLauncherPagePresenter::AccessibilityLauncherPagePresenter()
-       : ListPresenter("IDS_ACCS_ACCESSIBILITY_LAUNCHER")
-{
-       model_.state_.attach([this](auto val) {
-               groups_[0].items_[0]->title_ = val ? "IDS_ACCS_ACCESSIBILITY_LAUNCHER_ON" : "IDS_ACCS_ACCESSIBILITY_LAUNCHER_OFF";
-               groups_[0].items_[0]->widgetState_ = val;
-       });
-
-       groups_.emplace_back("");
-
-       groups_.back().items_.push_back(std::make_unique<ListItem>(
-               model_.state_.value() ? "IDS_ACCS_ACCESSIBILITY_LAUNCHER_ON" : "IDS_ACCS_ACCESSIBILITY_LAUNCHER_OFF",
-               std::string{},
-               [this](auto item) {
-                       model_.state_ = item->widgetState_.value();
-               },
-               ListItem::WidgetType::toggle));
-       groups_.back().items_.back()->widgetState_ = model_.state_.value();
-
-       groups_.back().items_.push_back(std::make_unique<ListItem>(std::string{}, "IDS_ACCS_ACCESSIBILITY_LAUNCHER_COMMENT"));
-
-       groups_.emplace_back("");
-
-       groups_.back().items_.push_back(std::make_unique<ListItem>("IDS_ST_BODY_ACCESSIBILITY",
-               std::string{},
-               [this](auto item) { model_.accessibilityLaunched_ = item->widgetState_.value(); },
-               ListItem::WidgetType::toggle));
-       groups_.back().items_.back()->enabled_ = groups_[0].items_[0]->widgetState_.value();
-       groups_.back().items_.push_back(std::make_unique<ListItem>("IDS_ST_MBODY_SCREEN_READER_HTTS",
-               std::string{},
-               [this](auto item) { model_.screenReaderLaunched_ = item->widgetState_.value(); },
-               ListItem::WidgetType::toggle));
-       groups_.back().items_.back()->enabled_ = groups_[0].items_[0]->widgetState_.value();
-       groups_.back().items_.push_back(std::make_unique<ListItem>("IDS_ACCS_UNIVERSAL_SWITCH",
-               std::string{},
-               [this](auto item) { model_.universalSwitchLaunched_ = item->widgetState_.value(); },
-               ListItem::WidgetType::toggle));
-       groups_.back().items_.back()->enabled_ = groups_[0].items_[0]->widgetState_.value();
-
-       groups_[0].items_[0]->widgetState_.attach([this](auto val) {
-               for (auto &it : groups_[1].items_)
-                       it->enabled_ = val;
-       });
-}
diff --git a/src/presenter/AccessibilityLauncherPagePresenter.hpp b/src/presenter/AccessibilityLauncherPagePresenter.hpp
deleted file mode 100644 (file)
index 465dd55..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright 2018 Samsung Electronics Co., Ltd
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
-
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef ACCESSIBILITY_LAUNCHER_PAGE_PRESENTER_HPP
-#define ACCESSIBILITY_LAUNCHER_PAGE_PRESENTER_HPP
-
-#include "AccessibilityLauncherModel.hpp"
-#include "ListPresenter.hpp"
-
-#include <vector>
-
-class AccessibilityLauncherPagePresenter : public ListPresenter
-{
-       public:
-       AccessibilityLauncherPagePresenter();
-
-       private:
-       AccessibilityLauncherModel model_;
-};
-
-#endif
index 19b424987aaf20e314be1861453d2cf09a8f1972..63a503751cf4465ab1df3ec67f6077590aec09b4 100644 (file)
@@ -36,10 +36,6 @@ MainPagePresenter::MainPagePresenter()
                "IDS_ACCS_UNIVERSAL_SWITCH",
                "IDS_ACCS_UNIVERSAL_SWITCH_HINT",
                [this](auto item) { Singleton<AppContext>::instance().push(std::make_unique<UniversalSwitchPagePresenter>()); }));
-       groups_.back().items_.push_back(std::make_unique<ListItem>(
-               "IDS_ACCS_ACCESSIBILITY_LAUNCHER",
-               "IDS_ACCS_ACCESSIBILITY_LAUNCHER_HINT",
-               [this](auto item) { Singleton<AppContext>::instance().push(std::make_unique<AccessibilityLauncherPagePresenter>()); }));
 
        onPopCallback_ = [this]() {
                screenReaderStateHandle_ = {};
index 707e76fac4cc7d5f9883e9354f2d272ae98e8d49..7e0fb45a8fc5490251c8bc3de9111bbccde09c41 100644 (file)
@@ -16,7 +16,6 @@
 #ifndef MAIN_PAGE_PRESENTER_HPP
 #define MAIN_PAGE_PRESENTER_HPP
 
-#include "AccessibilityLauncherPagePresenter.hpp"
 #include "ListPresenter.hpp"
 #include "ScreenReaderModel.hpp"
 #include "UniversalSwitchPagePresenter.hpp"
@@ -28,7 +27,6 @@ class MainPagePresenter : public ListPresenter
        MainPagePresenter();
 
        private:
-       std::unique_ptr<AccessibilityLauncherPagePresenter> accessibilityLauncherPage_;
        VConfInterface::CallbackHandle screenReaderStateHandle_;
        ScreenReaderModel model_;
 };