clean up dbus conf file and log
authorYoungjae Shin <yj99.shin@samsung.com>
Mon, 4 Nov 2019 00:04:48 +0000 (09:04 +0900)
committerYoungjae Shin <yj99.shin@samsung.com>
Wed, 18 Mar 2020 08:53:50 +0000 (17:53 +0900)
12 files changed:
schema/tizen_mode.xsd
supervisor/Mode.cpp
supervisor/Mode.h
supervisor/ModeCareTaker.cpp
supervisor/ModeXMLParser.cpp
supervisor/ModeXMLParser.h
supervisor/ModesXMLTag.cpp
supervisor/ModesXMLTag.h
supervisor/RequestHandler.cpp
supervisor/XMLGenerator.cpp
supervisor/XMLParser.cpp
supervisor/org.tizen.modes.dbus.conf.in

index c05f2b0fb4931ff338653fac2ab319916e9be6e4..2482af8d1f390e0d392e9db2a7f495e520a926cf 100644 (file)
@@ -12,7 +12,6 @@
             </xs:sequence>
             <xs:attribute name="name" type="xs:string" use="required" />
             <xs:attribute name="type" type="o:modeTypeT" use="required" />
-            <xs:attribute name="custom" type="xs:boolean" use="optional" default="false" />
           </xs:complexType>
         </xs:element>
       </xs:sequence>
index 8c5855a02e95c76b154096719c5f79996bf9515f..41ef6fbc51da38033d1fe9bf9f0b0d39dac4aaec 100644 (file)
@@ -20,7 +20,7 @@
 MODES_NAMESPACE_USE;
 
 Mode::Mode()
-       : customized(false), type(MODE_NORMAL)
+       : type(MODE_NORMAL)
 {
 }
 
@@ -79,16 +79,6 @@ Mode::ModeType Mode::getModeType() const
        return type;
 }
 
-void Mode::setCustomized(bool data)
-{
-       customized = data;
-}
-
-bool Mode::getCustomized() const
-{
-       return customized;
-}
-
 int Mode::apply()
 {
        std::list<std::shared_ptr<Action>>::iterator it;
index 7cdf99b51872aa657030465ae59ded9d8bb1f393..909f941cafe8ca3cc47851c0ab2a9f8bd2032fd7 100644 (file)
@@ -40,9 +40,6 @@ public:
        void setModeType(int val);
        ModeType getModeType() const;
 
-       void setCustomized(bool data);
-       bool getCustomized() const;
-
        void addAction(Action *action);
        std::list<std::shared_ptr<Action>> getActionList() const;
 
@@ -55,7 +52,6 @@ public:
        int applyOneShot();
        void undo();
 private:
-       bool customized;
        std::string name;
        ModeType type;
        std::list<std::shared_ptr<Action>> actionList;
index 0a9745023820e07c8fc9b2d8a3720d52e9e82f1f..acfc1756ef92a5e6f341565dfa3d47730a23a2f0 100644 (file)
@@ -70,7 +70,7 @@ bool ModeCareTaker::isSavedMode(const std::string &name)
 {
        auto found = savedModes.find(name);
        if (savedModes.end() != found) {
-               ERR("Mode(%s) is already applied", name.c_str());
+               INFO("Mode(%s) is Saved Mode", name.c_str());
                return true;
        }
 
index 1d61977573bc1502a1eae8567097d59d1070630c..9ad693e168626ee839936aae076b76b85d118b26 100644 (file)
@@ -96,7 +96,6 @@ void ModeXMLParser::parseMode(xmlNodePtr node)
 {
        mode.setName(extractModeName(node));
        mode.setModeType(extractModeType(node));
-       mode.setCustomized(extractModeCustom(node));
 }
 
 std::string ModeXMLParser::extractModeName(xmlNodePtr node)
@@ -109,12 +108,6 @@ std::string ModeXMLParser::extractModeType(xmlNodePtr node)
        return extractValueOfTag(node, ModesXMLTag::TYPE);
 }
 
-bool ModeXMLParser::extractModeCustom(xmlNodePtr node)
-{
-       std::string data = extractValueOfTag(node, ModesXMLTag::CUSTOM);
-       return ("yes" == data);
-}
-
 void ModeXMLParser::parseUndo(xmlNodePtr node)
 {
        Action *action = parseActionInfo(node);
index 3419a0ad918a1bec818300b1ecc485a69afd8966..9d792cf84dc62468f9bfeaf46585b566015be443 100644 (file)
@@ -38,7 +38,6 @@ private:
        void parseMode(xmlNodePtr node);
        std::string extractModeName(xmlNodePtr node);
        std::string extractModeType(xmlNodePtr node);
-       bool extractModeCustom(xmlNodePtr node);
        void parseActionAttr(xmlNodePtr node, Action *action);
        void parseAction(xmlNodePtr node);
        void parseUndo(xmlNodePtr node);
index f1b8e9b5b5834bddf3ad35acbcd848f628181617..e1a25f18f3d8285216c756b535695d1a3aecaffd 100644 (file)
@@ -30,7 +30,6 @@ const xmlChar* const ModesXMLTag::CUR_VERSION = (xmlChar*)"6.0";
 const xmlChar* const ModesXMLTag::MODE = (xmlChar*)"mode";
 const xmlChar* const ModesXMLTag::NAME = (xmlChar*)"name";
 const xmlChar* const ModesXMLTag::TYPE = (xmlChar*)"type";
-const xmlChar* const ModesXMLTag::CUSTOM = (xmlChar*)"custom";
 //Action
 const xmlChar* const ModesXMLTag::ACTION = (xmlChar*)"action";
 const xmlChar* const ModesXMLTag::UNDO = (xmlChar*)"undo";
index c88db3a8e75b05107e483f81c5ea239c3b93bd54..d880faa38884942f3b0d478a2682972cf3572e68 100644 (file)
@@ -33,7 +33,6 @@ struct ModesXMLTag {
        static const xmlChar* const MODE;
        static const xmlChar* const NAME;
        static const xmlChar* const TYPE;
-       static const xmlChar* const CUSTOM;
 //Action
        static const xmlChar* const ACTION;
        static const xmlChar* const UNDO;
index 8cf7a5410f473f0b5f3a17af676aa3606e55d4c8..2c87dad451f5c9a73f69318530a94fd2834ec50d 100644 (file)
@@ -127,7 +127,6 @@ Mode RequestHandler::getModefromData(GVariant *inData)
 
        mode.setName(modeName);
        mode.setModeType(type);
-       mode.setCustomized(true);
        g_free(modeName);
 
        g_variant_get(actionList, MODES_DBUS_ACTION_LIST_SIG, &iter);
index 302a341530a6f720d342a5d1d23af5682c58d4e6..1336e72d66f9f6a6a42251d35a5a4c567691a16b 100644 (file)
@@ -84,7 +84,6 @@ void XMLGenerator::makeModeXML(const std::string &filename, const Mode &mode)
 
        xmlSetProp(modeNode, ModesXMLTag::NAME, (xmlChar*)modeName.c_str());
        xmlSetProp(modeNode, ModesXMLTag::TYPE, (xmlChar*)modeType.c_str());
-       xmlSetProp(modeNode, ModesXMLTag::CUSTOM, (xmlChar*)((mode.getCustomized())? "yes": "no"));
        xmlAddChild(rootNode, modeNode);
 
        std::list<std::shared_ptr<Action>> actionList = mode.getActionList();
index bd0d5d82397f6b84219aafdff682899d163512a9..6798860b09d1361c15070cc7548536677e028970 100644 (file)
@@ -94,7 +94,7 @@ std::string XMLParser::extractValueOfTag(xmlNodePtr node, const xmlChar *tag)
 
        value = (char*)xmlGetProp(node, tag);
        if (value == NULL) {
-               ERR("attribute(%s) is NULL. ", tag);
+               WARN("attribute(%s) is NULL. ", tag);
                return std::string();
        }
 
index f16bed8dd82785c8729ac72e0b475ea12257dba3..e178abbf859638db4b7bcc3ac44d150b59884a09 100644 (file)
@@ -9,16 +9,16 @@
        <policy group="system_fw">
                <allow own="@DBUS_INTERFACE@"/>
                <allow send_destination="@DBUS_INTERFACE@"/>
-       </policy>
+               <allow send_type="signal" send_path="/org/tizen/modes/dbus" send_interface="@DBUS_INTERFACE@"/>
+        </policy>
 
        <policy context="default">
                <deny own="@DBUS_INTERFACE@"/>
                <deny send_destination="@DBUS_INTERFACE@" send_type="method_call"/>
-               <allow send_destination="@DBUS_INTERFACE@" send_path="/org/tizen/modes/dbus" send_interface="@DBUS_INTERFACE@" send_member="applyMode"/>
-               <allow send_destination="@DBUS_INTERFACE@" send_path="/org/tizen/modes/dbus" send_interface="@DBUS_INTERFACE@" send_member="undoMode"/>
-               <allow send_destination="@DBUS_INTERFACE@" send_path="/org/tizen/modes/dbus" send_interface="@DBUS_INTERFACE@" send_member="registerMode"/>
-               <allow send_destination="@DBUS_INTERFACE@" send_path="/org/tizen/modes/dbus" send_interface="@DBUS_INTERFACE@" send_member="getModes"/>
-               <allow send_type="signal" send_path="/org/tizen/modes/dbus" send_interface="@DBUS_INTERFACE@" send_member="changedMode"/>
+
+               <allow send_destination="@DBUS_INTERFACE@" send_path="/org/tizen/modes/dbus" send_interface="@DBUS_INTERFACE@"/>
+
+               <deny send_type="signal" send_path="/org/tizen/modes/dbus" send_interface="@DBUS_INTERFACE@"/>
                <allow send_destination="@DBUS_INTERFACE@" send_interface="org.freedesktop.DBus.Properties" send_member="GetAll"/>
        </policy>
 </busconfig>