2 * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 #include <libxml/xpath.h>
19 #include <common/HereConfig.h>
21 #include <app_manager.h>
23 #include <vconf-internal-location-keys.h>
25 #include "here_utils.h"
26 #include "heremaps-check-uc.h"
28 bool heremaps_check_agreement()
30 const char UTC_TPK_APP[] = "org.tizen.capi-maps-service-native-utc";
31 const char ITC_TPK_APP[] = "org.tizen.capi-maps-service-native-itc";
32 const char UTC_APP[] = "core.capi-maps-service-tests";
33 const char ITC_APP[] = "native.capi-maps-service-itc";
37 char *strAppId = NULL;
39 ret = vconf_get_int(VCONFKEY_LOCATION_HEREMAPS_CONSENT, &enabled);
40 MAPS_LOGD("VCONFKEY_LOCATION_HEREMAPS_CONSENT is %d", enabled);
41 if (ret != 0 || enabled == 0) {
43 MAPS_LOGD("Fail to get vconf value");
45 pid_t nProcessId = getpid();
46 ret = app_manager_get_app_id(nProcessId, &strAppId);
47 if (ret != APP_MANAGER_ERROR_NONE) {
48 MAPS_LOGI("Get app_id [%ld]. nRet[%d]", nProcessId, ret);
49 } else if (!strncmp(strAppId, UTC_APP, strlen(UTC_APP)) ||
50 !strncmp(strAppId, ITC_APP, strlen(ITC_APP)) ||
51 !strncmp(strAppId, UTC_TPK_APP, strlen(UTC_TPK_APP)) ||
52 !strncmp(strAppId, ITC_TPK_APP, strlen(ITC_TPK_APP))) {
53 MAPS_LOGD("Requested by tct");