[Tizen] Fix to add Capture implementation in file.list
[platform/core/uifw/dali-adaptor.git] / dali / internal / system / tizen / capture-impl-tizen.cpp
old mode 100644 (file)
new mode 100755 (executable)
index 98d6077..0e0ca23
@@ -16,7 +16,7 @@
  */
 
 // CLASS HEADER
-#include <capture-impl.h>
+#include <dali/internal/system/tizen/capture-impl.h>
 
 // EXTERNAL INCLUDES
 #include <dali/public-api/common/vector-wrapper.h>
 #include <dali/integration-api/debug.h>
 #include <fstream>
 #include <string.h>
-#include <cynara-client.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <system_info.h>
 
 // INTERNAL INCLUDES
-#include <adaptor.h>
+#include <dali/integration-api/adaptor.h>
 
 namespace
 {
 unsigned int TIME_OUT_DURATION = 1000;
-const int SMACK_LABEL_LENGTH = 255;
-
-const char* const CYNARA_CHECK_FILE = "/proc/self/attr/current";
-const char* const SCREEN_SHOT_PRIVILEGE = "http://tizen.org/privilege/screenshot";
 }
 
 namespace Dali
@@ -76,12 +68,6 @@ CapturePtr Capture::New()
 {
   CapturePtr pWorker = new Capture();
 
-  if( pWorker->CheckPrivilege( SCREEN_SHOT_PRIVILEGE ) == false )
-  {
-    DALI_LOG_ERROR( "Capture privilege error: permission denied\n" );
-    return NULL;
-  }
-
   return pWorker;
 }
 
@@ -89,12 +75,6 @@ CapturePtr Capture::New( Dali::CameraActor cameraActor )
 {
   CapturePtr pWorker = new Capture( cameraActor );
 
-  if( pWorker->CheckPrivilege( SCREEN_SHOT_PRIVILEGE ) == false )
-  {
-    DALI_LOG_ERROR( "Capture privilege error: permission denied\n" );
-    return NULL;
-  }
-
   return pWorker;
 }
 
@@ -378,52 +358,6 @@ bool Capture::Save()
   return mNativeImageSourcePtr->EncodeToFile( mPath );
 }
 
-bool Capture::CheckPrivilege( const char* privilege ) const
-{
-  cynara* cynara;
-  int fd = 0;
-  int ret = 0;
-  char subjectLabel[SMACK_LABEL_LENGTH + 1] = "";
-  char uid[10] = { 0, };
-  const char* clientSession = "";
-
-  ret = cynara_initialize( &cynara, NULL );
-  if( ret != CYNARA_API_SUCCESS )
-  {
-    return false;
-  }
-
-  fd = open( CYNARA_CHECK_FILE, O_RDONLY );
-  if( fd < 0 )
-  {
-    cynara_finish( cynara );
-    return false;
-  }
-
-  ret = read( fd, subjectLabel, SMACK_LABEL_LENGTH );
-  if( ret < 0 )
-  {
-    close( fd );
-    cynara_finish( cynara );
-    return false;
-  }
-
-  close( fd );
-
-  snprintf( uid, 10, "%d", getuid() );
-
-  ret = cynara_check( cynara, subjectLabel, clientSession, uid, privilege );
-  if( ret != CYNARA_API_ACCESS_ALLOWED )
-  {
-    cynara_finish( cynara );
-    return false;
-  }
-
-  cynara_finish( cynara );
-
-  return true;
-}
-
 }  // End of namespace Adaptor
 
 }  // End of namespace Internal