Feature out location policy 37/71637/3
authorJaemin Ryu <jm77.ryu@samsung.com>
Thu, 26 May 2016 09:03:10 +0000 (18:03 +0900)
committerseolhee, kim <s414.kim@samsung.com>
Thu, 26 May 2016 09:38:13 +0000 (18:38 +0900)
Change-Id: I9f912126e17fc17ddc5eb775247a5d4429178c75
Signed-off-by: Jaemin Ryu <jm77.ryu@samsung.com>
server/common.cmake
server/location.cpp [new file with mode: 0644]
server/mobile.cmake
server/restriction.cpp
server/wearable.cmake

index b2ba753..252be79 100644 (file)
 #
 
 SET(POLICY      ${POLICY}
+                location.cpp
                 password.cpp
 )
 
 SET(DEPENDENCY  ${DEPENDENCY}
+                capi-location-manager
                 auth-fw-admin
 )
diff --git a/server/location.cpp b/server/location.cpp
new file mode 100644 (file)
index 0000000..d02700a
--- /dev/null
@@ -0,0 +1,49 @@
+/*
+ *  Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *  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 "restriction.hxx"
+#include "policy-helper.h"
+#include "audit/logger.h"
+
+#define CONSTRUCTOR __attribute__ ((constructor))
+
+namespace DevicePolicyManager {
+
+extern RestrictionPolicy restrictionPolicy;
+
+static void CONSTRUCTOR ContributeRestrictionPolicy()
+{
+       PolicyControlContext& context = Server::instance();
+
+       context.registerParametricMethod(&restrictionPolicy, (int)(RestrictionPolicy::setLocationState)(int));
+       context.registerNonparametricMethod(&restrictionPolicy, (int)(RestrictionPolicy::getLocationState));
+
+       context.createNotification("location");
+}
+
+int RestrictionPolicy::setLocationState(int enable)
+{
+    SetPolicyAllowed(context, "location", enable);
+    return 0;
+}
+
+int RestrictionPolicy::getLocationState()
+{
+    return IsPolicyAllowed(context, "location");
+}
+
+
+} // namespace DevicePolicyManager
index 95470a2..614f0b3 100644 (file)
@@ -15,6 +15,7 @@
 #
 
 SET(POLICY      ${POLICY}
+                location.cpp
                 password.cpp
                 zone.cpp
                                zone/app-proxy.cpp
index 2dd3396..cda8e5b 100644 (file)
@@ -45,8 +45,6 @@ RestrictionPolicy::RestrictionPolicy(PolicyControlContext& ctxt) :
     context.registerNonparametricMethod(this, (int)(RestrictionPolicy::getUsbTetheringState));
        context.registerParametricMethod(this, (int)(RestrictionPolicy::setExternalStorageState)(int));
        context.registerNonparametricMethod(this, (int)(RestrictionPolicy::getExternalStorageState));
-       context.registerParametricMethod(this, (int)(RestrictionPolicy::setLocationState)(int));
-       context.registerNonparametricMethod(this, (int)(RestrictionPolicy::getLocationState));
        context.registerParametricMethod(this, (int)(RestrictionPolicy::setWifiState)(bool));
        context.registerNonparametricMethod(this, (bool)(RestrictionPolicy::getWifiState));
        context.registerParametricMethod(this, (int)(RestrictionPolicy::setWifiHotspotState)(bool));
@@ -58,7 +56,6 @@ RestrictionPolicy::RestrictionPolicy(PolicyControlContext& ctxt) :
        context.createNotification("clipboard");
        context.createNotification("external-storage");
        context.createNotification("microphone");
-       context.createNotification("location");
        context.createNotification("settings-changes");
        context.createNotification("usb-debugging");
     context.createNotification("usb-tethering");
@@ -156,17 +153,6 @@ int RestrictionPolicy::getExternalStorageState()
     return IsPolicyAllowed(context, "external-storage");
 }
 
-int RestrictionPolicy::setLocationState(int enable)
-{
-    SetPolicyAllowed(context, "location", enable);
-    return 0;
-}
-
-int RestrictionPolicy::getLocationState()
-{
-    return IsPolicyAllowed(context, "location");
-}
-
 int RestrictionPolicy::setWifiState(bool enable)
 {
     SetPolicyAllowed(context, "wifi", enable);
index 103b2df..9e1cb64 100644 (file)
 #
 
 SET(POLICY      ${POLICY}
+                location.cpp
                 password.cpp
 )
 
 SET(DEPENDENCY  ${DEPENDENCY}
+                capi-location-manager
                 auth-fw-admin
 )