Native function are deprecated.
[ACR] TWDAPI-268
Change-Id: I4146362481542c47879413abc59aa2850eb17095
Signed-off-by: Rafal Walczyna <r.walczyna@samsung.com>
int ret = GESTURE_ERROR_NONE;
for (auto& it : m_recognition_default_map) {
+ // gesture_stop_recognition is deprecated since 6.0
ret = gesture_stop_recognition(it.second);
if (GESTURE_ERROR_NONE != ret) {
LoggerE("gesture_stop_recognition() failed");
}
+ // gesture_release is deprecated since 6.0
ret = gesture_release(it.second);
if (GESTURE_ERROR_NONE != ret) {
LoggerE("gesture_release() failed");
}
for (auto& it : m_recognition_always_on_map) {
+ // gesture_stop_recognition is deprecated since 6.0
ret = gesture_stop_recognition(it.second);
if (GESTURE_ERROR_NONE != ret) {
LoggerE("gesture_stop_recognition() failed");
}
+ // gesture_release is deprecated since 6.0
ret = gesture_release(it.second);
if (GESTURE_ERROR_NONE != ret) {
LoggerE("gesture_release() failed");
return result;
}
+ // gesture_is_supported is deprecated since 6.0
int ret = gesture_is_supported(type_e, is_supported);
if (GESTURE_ERROR_NONE != ret) {
return LogAndCreateResult(
ScopeLogger();
gesture_event_e event = GESTURE_EVENT_NONE;
+ // gesture_get_event is deprecated since 6.0
int ret = gesture_get_event(data, &event);
if (GESTURE_ERROR_NONE != ret) {
LoggerE("gesture_get_event() failed, error %d (%s)", ret, get_error_message(ret));
int x = 0;
int y = 0;
+ // gesture_get_tilt is deprecated since 6.0
int ret = gesture_get_tilt(data, &x, &y);
if (GESTURE_ERROR_NONE != ret) {
LoggerE("gesture_get_tilt() failed, error %d (%s)", ret, get_error_message(ret));
gesture_h handle = nullptr;
+ // gesture_create is deprecated since 6.0
int ret = gesture_create(&handle);
if (GESTURE_ERROR_NONE != ret) {
return LogAndCreateResult(
("Creating handle failed, error: %d (%s)", ret, get_error_message(ret)));
}
+ // gesture_start_recognition is deprecated since 6.0
ret = gesture_start_recognition(handle, type, option, callback, this);
if (GESTURE_ERROR_NONE != ret) {
gesture_release(handle);
}
if (handle) {
+ // gesture_stop_recognition is deprecated since 6.0
int ret = gesture_stop_recognition(handle);
if (GESTURE_ERROR_NONE != ret) {
return LogAndCreateResult(
if (HumanActivityType.WRIST_UP === args.type) {
utils_.warn(
'DEPRECATION WARNING: HumanActivityType.WRIST_UP is deprecated since ' +
- 'Tizen 4.0. Use GestureType and addGestureRecognitionListener to ' +
- 'monitor WRIST_UP gesture'
+ 'Tizen 4.0.'
);
}
};
HumanActivityMonitorManager.prototype.addActivityRecognitionListener = function() {
+ utils_.printDeprecationWarningFor(
+ 'HumanActivityMonitorManager.addActivityRecognitionListener()'
+ );
var args = validator_.validateArgs(arguments, [
{ name: 'type', type: types_.ENUM, values: Object.keys(ActivityRecognitionType) },
{ name: 'listener', type: types_.FUNCTION },
};
HumanActivityMonitorManager.prototype.removeActivityRecognitionListener = function() {
+ utils_.printDeprecationWarningFor(
+ 'HumanActivityMonitorManager.removeActivityRecognitionListener()'
+ );
var args = validator_.validateArgs(arguments, [
{ name: 'watchId', type: types_.LONG },
{ name: 'errorCallback', type: types_.FUNCTION, optional: true, nullable: true }
};
HumanActivityMonitorManager.prototype.isGestureSupported = function() {
+ utils_.printDeprecationWarningFor('HumanActivityMonitorManager.isGestureSupported()');
var args = validator_.validateArgs(arguments, [
{
name: 'type',
);
HumanActivityMonitorManager.prototype.addGestureRecognitionListener = function() {
+ utils_.printDeprecationWarningFor(
+ 'HumanActivityMonitorManager.addGestureRecognitionListener()'
+ );
var args = validator_.validateArgs(arguments, [
{
name: 'type',
};
HumanActivityMonitorManager.prototype.removeGestureRecognitionListener = function() {
+ utils_.printDeprecationWarningFor(
+ 'HumanActivityMonitorManager.removeGestureRecognitionListener()'
+ );
var args = validator_.validateArgs(arguments, [
{
name: 'watchId',
using common::PlatformResult;
using common::ErrorCode;
using common::TaskQueue;
+using common::tools::PrintDeprecationWarningFor;
HumanActivityMonitorInstance::HumanActivityMonitorInstance() : gesture_manager_() {
ScopeLogger();
void HumanActivityMonitorInstance::HumanActivityMonitorManagerAddActivityRecognitionListener(
const picojson::value& args, picojson::object& out) {
ScopeLogger();
+ PrintDeprecationWarningFor("HumanActivityMonitorManager.addActivityRecognitionListener()");
+
CHECK_PRIVILEGE_ACCESS(kPrivilegeHealthInfo, &out);
CHECK_EXIST(args, "type", out)
void HumanActivityMonitorInstance::HumanActivityMonitorManagerRemoveActivityRecognitionListener(
const picojson::value& args, picojson::object& out) {
ScopeLogger();
+ PrintDeprecationWarningFor("HumanActivityMonitorManager.removeActivityRecognitionListener()");
+
CHECK_PRIVILEGE_ACCESS(kPrivilegeHealthInfo, &out);
CHECK_EXIST(args, "watchId", out)
void HumanActivityMonitorInstance::GestureManagerIsGestureSupported(const picojson::value& args,
picojson::object& out) {
ScopeLogger();
+ PrintDeprecationWarningFor("HumanActivityMonitorManager.isGestureSupported()");
CHECK_EXIST(args, "type", out)
const auto& type = args.get("type").get<std::string>();
void HumanActivityMonitorInstance::GestureManagerAddGestureRecognitionListener(
const picojson::value& args, picojson::object& out) {
ScopeLogger();
+ PrintDeprecationWarningFor("HumanActivityMonitorManager.addGestureRecognitionListener()");
CHECK_EXIST(args, "type", out)
CHECK_EXIST(args, "alwaysOn", out)
void HumanActivityMonitorInstance::GestureManagerRemoveGestureRecognitionListener(
const picojson::value& args, picojson::object& out) {
ScopeLogger();
+ PrintDeprecationWarningFor("HumanActivityMonitorManager.removeGestureRecognitionListener()");
CHECK_EXIST(args, "type", out)
CHECK_EXIST(args, "alwaysOn", out)
bool supported = false;
+ // gesture_is_supported is deprecated since 6.0
int ret = gesture_is_supported(GESTURE_WRIST_UP, &supported);
if (GESTURE_ERROR_NONE != ret) {
if (ret == GESTURE_ERROR_NOT_SUPPORTED) {
ScopeLogger("type %s", type().c_str());
if (!handle_) {
+ // gesture_create is not supported since 6.0
int ret = gesture_create(&handle_);
if (GESTURE_ERROR_NONE != ret) {
return LogAndCreateResult(
("Failed to create WRIST_UP handle, error: %d (%s)", ret, get_error_message(ret)));
}
+ // gesture_start_recognition is not supported since 6.0
ret = gesture_start_recognition(handle_, GESTURE_WRIST_UP, GESTURE_OPTION_DEFAULT,
OnWristUpEvent, this);
if (GESTURE_ERROR_NONE != ret) {
ScopeLogger("type %s", type().c_str());
if (handle_) {
+ // gesture_stop_recognition is deprecated since 6.0
int ret = gesture_stop_recognition(handle_);
if (GESTURE_ERROR_NONE != ret) {
LoggerE("Failed to stop WRIST_UP detection, error: %d", ret);
}
+ // gesture_release is deprecated since 6.0
ret = gesture_release(handle_);
if (GESTURE_ERROR_NONE != ret) {
LoggerE("Failed to release WRIST_UP handle, error: %d", ret);
}
activity_h handle = nullptr;
+ // activity_create is deprecated since 6.0
int ret = activity_create(&handle);
if (ACTIVITY_ERROR_NONE != ret) {
return LogAndCreateResult(ErrorCode::UNKNOWN_ERR, "Failed to create activity",
~ActivityData() {
if (handle) {
+ // activity_stop_recognition is deprecated since 6.0
activity_stop_recognition(handle);
+ // activity_release is deprecated since 6.0
activity_release(handle);
}
}
activity_accuracy_e accuracy = ACTIVITY_ACCURACY_MID;
+ // activity_get_accuracy is deprecated since 6.0
int ret = activity_get_accuracy(data, &accuracy);
if (ret != ACTIVITY_ERROR_NONE) {
LogAndReportError(PlatformResult(ErrorCode::ABORT_ERR, "System operation has failed"), &obj,
ScopeLogger();
bool supported = false;
+ // activity_is_supported is deprecated since 6.0
int ret = activity_is_supported(type, &supported);
if (ret == ACTIVITY_ERROR_NOT_SUPPORTED || !supported) {