[Tizen] Add a flag to check whether it is forced to enable 98/249198/2 accepted/tizen/6.0/unified/20201209.102052 submit/tizen_6.0/20201208.132335
authorSeoyeon Kim <seoyeon2.kim@samsung.com>
Tue, 8 Dec 2020 12:16:39 +0000 (21:16 +0900)
committerSeoyeon Kim <seoyeon2.kim@samsung.com>
Tue, 8 Dec 2020 12:48:14 +0000 (21:48 +0900)
- If an application controls Accessibility status by itself,
 dali does not have to control Accessibility enabled.

Change-Id: Id47f266dc5bb8f4ce507f6f306abc6eb0e1468a2
Signed-off-by: Seoyeon Kim <seoyeon2.kim@samsung.com>
dali/devel-api/adaptor-framework/accessibility-adaptor.cpp
dali/devel-api/adaptor-framework/accessibility-adaptor.h
dali/internal/accessibility/common/accessibility-adaptor-impl.cpp
dali/internal/accessibility/common/accessibility-adaptor-impl.h
dali/internal/window-system/common/event-handler.cpp

index 685ed9a..6c1166d 100644 (file)
@@ -43,6 +43,7 @@ Vector2 AccessibilityAdaptor::GetReadPosition() const
 
 void AccessibilityAdaptor::EnableAccessibility(bool enabled)
 {
+  SetForcedEnable( true );
   if(enabled)
   {
     Internal::Adaptor::AccessibilityAdaptor::GetImplementation(*this).EnableAccessibility();
@@ -58,6 +59,11 @@ bool AccessibilityAdaptor::IsEnabled() const
   return Internal::Adaptor::AccessibilityAdaptor::GetImplementation(*this).IsEnabled();
 }
 
+void AccessibilityAdaptor::SetForcedEnable( bool forced )
+{
+  Internal::Adaptor::AccessibilityAdaptor::GetImplementation(*this).SetForcedEnable(forced);
+}
+
 void AccessibilityAdaptor::SetActionHandler(AccessibilityActionHandler& handler)
 {
   Internal::Adaptor::AccessibilityAdaptor::GetImplementation(*this).SetActionHandler(handler);
index a138db8..7cc65c3 100644 (file)
@@ -86,6 +86,12 @@ public:
   bool IsEnabled() const;
 
   /**
+   * @brief Sets Accessibility enabled forcibly,
+   * @param forced Whether accessibility sets enabled forcibly
+   */
+  void SetForcedEnable( bool forced );
+
+  /**
    * @brief Set the handler to handle accessibility actions.
    *
    * @param[in] handler The Accessibility action handler.
index aed44c7..1685cac 100644 (file)
@@ -50,7 +50,8 @@ Debug::Filter* gAccessibilityAdaptorLogFilter = Debug::Filter::New(Debug::NoLogg
 AccessibilityAdaptor::AccessibilityAdaptor()
 : mReadPosition(),
   mActionHandler( NULL ),
-  mIsEnabled( false )
+  mIsEnabled( false ),
+  mIsForced( false )
 {
   mAccessibilityGestureDetector = new AccessibilityGestureDetector();
 }
@@ -94,6 +95,16 @@ bool AccessibilityAdaptor::IsEnabled() const
   return mIsEnabled;
 }
 
+void AccessibilityAdaptor::SetForcedEnable( bool forced )
+{
+  mIsForced = forced;
+}
+
+bool AccessibilityAdaptor::IsForcedEnable() const
+{
+  return mIsForced;
+}
+
 Vector2 AccessibilityAdaptor::GetReadPosition() const
 {
   return mReadPosition;
index 29cbb08..b67f506 100644 (file)
@@ -79,6 +79,16 @@ public:
   bool IsEnabled() const;
 
   /**
+   * @copydoc Dali::AccessibilityAdaptor::SetForcedEnable()
+   */
+  void SetForcedEnable( bool forced );
+
+  /**
+   * Whether the accessibility is enabled forcibly or not
+   */
+  bool IsForcedEnable() const;
+
+  /**
    * @copydoc Dali::AccessibilityAdaptor::GetReadPosition() const
    */
   Vector2 GetReadPosition() const;
@@ -256,6 +266,8 @@ protected:
 
   bool mIsEnabled        : 1; ///< enable/disable the accessibility action
 
+  bool mIsForced         : 1; ///< Is the accessibility enabled forcibly
+
 public:
 
   // Helpers for public-api forwarding methods
index f8219a7..f1b5eba 100755 (executable)
@@ -532,12 +532,18 @@ void EventHandler::OnAccessibilityQuickpanelChanged( const unsigned char& info )
   }
 
   if( ( ( info & ( 1 << QUICKPANEL_TYPE_SYSTEM_DEFAULT ) ) && ( info & ( 1 << QUICKPANEL_TYPE_APPS_MENU ) ) ) || // Both QuickPanel and Apps are shown
-      ( info & ( 1 << QUICKPANEL_TYPE_APPS_MENU ) ) || // Only Apps menu (dali application) is shown
       ( info & ( 1 << QUICKPANEL_TYPE_SYSTEM_DEFAULT ) ) ) // QuickPanel is shown
   {
     // dali apps should be disabled.
     accessibilityAdaptor->DisableAccessibility();
   }
+  else if( info & ( 1 << QUICKPANEL_TYPE_APPS_MENU ) ) // Only Apps menu (dali application) is shown
+  {
+    if( !accessibilityAdaptor->IsForcedEnable() ) // It is not in case of that an application controls the accessibility status itself
+    {
+      accessibilityAdaptor->DisableAccessibility();
+    }
+  }
   else
   {
     // dali app should be enabled.