var applicationEventListener = new ListenerManager(native, APPLICATION_EVENT_LISTENER);
ApplicationManager.prototype.addAppInfoEventListener = function() {
- privUtils_.warn(
- 'DEPRECATION WARNING: addAppInfoEventListener() is deprecated and will be ' +
+ privUtils_.deprecationWarn(
+ 'addAppInfoEventListener() is deprecated and will be ' +
'removed from next release. ' +
- 'Use tizen.package.setPackageInfoEventListener() instead.'
+ 'Use tizen.package.setPackageInfoEventListener() instead.',
+ '2.4'
);
var args = AV.validateArgs(arguments, [
};
ApplicationManager.prototype.removeAppInfoEventListener = function() {
- privUtils_.warn(
- 'DEPRECATION WARNING: removeAppInfoEventListener() is deprecated and will be ' +
+ privUtils_.deprecationWarn(
+ 'removeAppInfoEventListener() is deprecated and will be ' +
'removed from next release. ' +
- 'Use tizen.package.unsetPackageInfoEventListener() instead.'
+ 'Use tizen.package.unsetPackageInfoEventListener() instead.',
+ '2.4'
);
var args = AV.validateArgs(arguments, [
void ApplicationInstance::ApplicationManagerAddAppInfoEventListener(const picojson::value& args,
picojson::object& out) {
ScopeLogger();
- LoggerW(
- "DEPRECATION WARNING: addAppInfoEventListener() is deprecated and will be removed from next "
- "release. "
- "Use tizen.package.setPackageInfoEventListener() instead.");
+ DEPRECATION_WARN(
+ "addAppInfoEventListener() is deprecated and will be removed from next "
+ "release. Use tizen.package.setPackageInfoEventListener() instead.",
+ "2.4");
manager_.StartAppInfoEventListener(&out);
}
void ApplicationInstance::ApplicationManagerRemoveAppInfoEventListener(const picojson::value& args,
picojson::object& out) {
ScopeLogger();
- LoggerW(
- "DEPRECATION WARNING: removeAppInfoEventListener() is deprecated and will be removed from "
- "next release. "
- "Use tizen.package.unsetPackageInfoEventListener() instead.");
+ DEPRECATION_WARN(
+ "removeAppInfoEventListener() is deprecated and will be removed from "
+ "next release. Use tizen.package.unsetPackageInfoEventListener() instead.",
+ "2.4");
manager_.StopAppInfoEventListener();
ReportSuccess(out);
#include "application_manager.h"
-#include <glib.h>
#include <sys/stat.h>
#include <unistd.h>
#include <thread>
return provider_.GetAllStorages();
}
-std::string FilesystemProvider::GetRealPath(const std::string& path_or_uri) {
+std::string FilesystemProvider::GetRealPath(const std::string& path_or_uri) const {
ScopeLogger();
return FilesystemProviderStorage::Create().GetRealPath(path_or_uri);
}
VirtualRoots GetVirtualPaths();
VirtualStorages GetAllStorages();
- std::string GetRealPath(const std::string& path_or_uri);
+ std::string GetRealPath(const std::string& path_or_uri) const;
std::string GetVirtualPath(const std::string& real_path) const;
private:
return virtual_paths_;
}
-std::string FilesystemProviderStorage::GetRealPath(const std::string& path_or_uri) {
+std::string FilesystemProviderStorage::GetRealPath(const std::string& path_or_uri) const {
ScopeLogger();
std::string realpath;
std::size_t pos = path_or_uri.find(kFileUriPrefix);
virtual VirtualRoots GetVirtualPaths();
virtual VirtualStorages GetAllStorages();
- std::string GetRealPath(const std::string& path_or_uri);
+ std::string GetRealPath(const std::string& path_or_uri) const;
std::string GetVirtualPath(const std::string& real_path) const;
DeviceChangeStateFun GetListener();
#define LOGGER_IF(priority, condition) \
!(condition) ? (void)0 : LogMessageVoidify() & (LOGGER(priority))
+#define DEPRECATION_WARN(log, version) \
+ /* For public code, warning should be always shown */ \
+ LoggerW("DEPRECATION WARNING: %s", log);
+
// This class more or less represents a particular log message.
// You create an instance of LogMessage and then stream stuff to it.
// When you finish streaming to it, ~LogMessage is called and the
void ContentInstance::ContentManagerSetchangelistener(const picojson::value& args,
picojson::object& out) {
ScopeLogger();
- LoggerW(
- "DEPRECATION WARNING: setChangeListener() is deprecated and will be removed from next "
- "release. "
- "Use addChangeListener() instead.");
+ DEPRECATION_WARN(
+ "setChangeListener() is deprecated and will be removed from next "
+ "release. Use addChangeListener() instead.",
+ "3.0");
// CHECK_PRIVILEGE_ACCESS(kPrivilegeContentRead, &out);
CHECK_PRIVILEGE_ACCESS(kPrivilegeContentWrite, &out);
void ContentInstance::ContentManagerUnsetchangelistener(const picojson::value& args,
picojson::object& out) {
ScopeLogger();
- LoggerW(
- "DEPRECATION WARNING: unsetChangeListener() is deprecated and will be removed from next "
- "release. "
- "Use removeChangeListener() instead.");
+ DEPRECATION_WARN(
+ "unsetChangeListener() is deprecated and will be removed from next "
+ "release. Use removeChangeListener() instead.",
+ "3.0");
// CHECK_PRIVILEGE_ACCESS(kPrivilegeContentRead, &out);
CHECK_PRIVILEGE_ACCESS(kPrivilegeContentWrite, &out);
};
ContentManager.prototype.setChangeListener = function(changeCallback) {
- privUtils_.warn(
- 'DEPRECATION WARNING: setChangeListener() is deprecated and will be removed ' +
- 'from next release. Use addChangeListener() instead.'
+ privUtils_.deprecationWarn(
+ 'setChangeListener() is deprecated and will be removed ' +
+ 'from next release. Use addChangeListener() instead.',
+ '3.0'
);
var args = validator_.validateArgs(arguments, [
};
ContentManager.prototype.unsetChangeListener = function() {
- privUtils_.warn(
- 'DEPRECATION WARNING: unsetChangeListener() is deprecated and will be removed ' +
- 'from next release. Use removeChangeListener() instead.'
+ privUtils_.deprecationWarn(
+ 'unsetChangeListener() is deprecated and will be removed ' +
+ 'from next release. Use removeChangeListener() instead.',
+ '3.0'
);
var data = {};
void FilesystemInstance::FileCreateSync(const picojson::value& args, picojson::object& out) {
ScopeLogger();
- LoggerW(
- "DEPRECATION WARNING: File.createFile() is deprecated since Tizen 5.0. Use "
- "FileSystemManager.openFile() instead.");
+ DEPRECATION_WARN(
+ "File.createFile() is deprecated since Tizen 5.0. Use "
+ "FileSystemManager.openFile() instead.",
+ "5.0");
CHECK_PRIVILEGE_ACCESS(kPrivilegeFilesystemWrite, &out);
CHECK_EXIST(args, "location", out)
void FilesystemInstance::FileRename(const picojson::value& args, picojson::object& out) {
ScopeLogger();
- LoggerW(
- "DEPRECATION WARNING: File.moveTo() is deprecated since Tizen 5.0. Use "
- "FileSystemManager.moveFile() or FileSystemManager.moveDirectory() instead.");
+ DEPRECATION_WARN(
+ "File.moveTo() is deprecated since Tizen 5.0. Use "
+ "FileSystemManager.moveFile() or FileSystemManager.moveDirectory() instead.",
+ "5.0");
CHECK_PRIVILEGE_ACCESS(kPrivilegeFilesystemWrite, &out);
CHECK_EXIST(args, "callbackId", out)
void FilesystemInstance::FileReadString(const picojson::value& args, picojson::object& out) {
ScopeLogger();
- LoggerW(
- "DEPRECATION WARNING: This method is deprecated since Tizen 5.0.Use FileHandle.readString() "
- "or FileHandle.readStringNonBlocking() instead.");
+ DEPRECATION_WARN(
+ "This method is deprecated since Tizen 5.0.Use FileHandle.readString() "
+ "or FileHandle.readStringNonBlocking() instead.",
+ "5.0");
CHECK_PRIVILEGE_ACCESS(kPrivilegeFilesystemRead, &out);
CHECK_EXIST(args, "location", out)
void FilesystemInstance::FileReadBytes(const picojson::value& args, picojson::object& out) {
ScopeLogger();
- LoggerW(
- "DEPRECATION WARNING: This method is deprecated since Tizen 5.0. Use FileHandle.readData() "
- "or FileHandle.readDataNonBlocking() instead.");
+ DEPRECATION_WARN(
+ "This method is deprecated since Tizen 5.0. Use FileHandle.readData() "
+ "or FileHandle.readDataNonBlocking() instead.",
+ "5.0");
CHECK_PRIVILEGE_ACCESS(kPrivilegeFilesystemRead, &out);
CHECK_EXIST(args, "location", out)
void FilesystemInstance::FileWriteString(const picojson::value& args, picojson::object& out) {
ScopeLogger();
- LoggerW(
- "DEPRECATION WARNING: FileStream.write() is deprecated since Tizen 5.0. Use "
- "FileHandle.writeString() or FileHandle.writeStringNonBlocking() instead.");
+ DEPRECATION_WARN(
+ "FileStream.write() is deprecated since Tizen 5.0. Use "
+ "FileHandle.writeString() or FileHandle.writeStringNonBlocking() instead.",
+ "5.0");
CHECK_PRIVILEGE_ACCESS(kPrivilegeFilesystemWrite, &out);
CHECK_EXIST(args, "location", out)
void FilesystemInstance::FileWriteBytes(const picojson::value& args, picojson::object& out) {
ScopeLogger();
- LoggerW(
- "DEPRECATION WARNING: FileStream.writeBytes() is deprecated since Tizen 5.0. To read and Use "
- "FileHandle.writeData() or FileHandle.writeDataNonBlocking() instead.");
+ DEPRECATION_WARN(
+ "FileStream.writeBytes() is deprecated since Tizen 5.0. To read and Use "
+ "FileHandle.writeData() or FileHandle.writeDataNonBlocking() instead.",
+ "5.0");
CHECK_PRIVILEGE_ACCESS(kPrivilegeFilesystemWrite, &out);
CHECK_EXIST(args, "location", out)
void FilesystemInstance::FileWriteBase64(const picojson::value& args, picojson::object& out) {
ScopeLogger();
- LoggerW(
- "DEPRECATION WARNING: FileStream.writeBase64() is deprecated since Tizen 5.0. Use "
+ DEPRECATION_WARN(
+ "FileStream.writeBase64() is deprecated since Tizen 5.0. Use "
"FileHandle.writeData() or FileHandle.writeDataNonBlocking() in combination with atob() and "
- "btoa() functions instead.");
+ "btoa() functions instead.",
+ "5.0");
CHECK_PRIVILEGE_ACCESS(kPrivilegeFilesystemWrite, &out);
CHECK_EXIST(args, "location", out)
void FilesystemInstance::FileSystemManagerMakeDirectorySync(const picojson::value& args,
picojson::object& out) {
ScopeLogger();
- LoggerW(
- "DEPRECATION WARNING: File.createDirectory() is deprecated since Tizen 5.0. Use "
- "FileSystemManager.createDirectory() instead.");
+ DEPRECATION_WARN(
+ "File.createDirectory() is deprecated since Tizen 5.0. Use "
+ "FileSystemManager.createDirectory() instead.",
+ "5.0");
CHECK_PRIVILEGE_ACCESS(kPrivilegeFilesystemWrite, &out);
CHECK_EXIST(args, "location", out)
void FilesystemInstance::FileReadDir(const picojson::value& args, picojson::object& out) {
ScopeLogger();
- LoggerW(
- "DEPRECATION WARNING: File.listFiles() is deprecated since Tizen 5.0. Use "
- "FileSystemManager.listDirectory() instead.");
+ DEPRECATION_WARN(
+ "File.listFiles() is deprecated since Tizen 5.0. Use "
+ "FileSystemManager.listDirectory() instead.",
+ "5.0");
CHECK_PRIVILEGE_ACCESS(kPrivilegeFilesystemRead, &out);
CHECK_EXIST(args, "pathToDir", out)
void FilesystemInstance::FileUnlinkFile(const picojson::value& args, picojson::object& out) {
ScopeLogger();
- LoggerW(
- "DEPRECATION WARNING: File.deleteFile() is deprecated since Tizen 5.0. Use "
- "FileSystemManager.deleteFile() instead.");
+ DEPRECATION_WARN(
+ "File.deleteFile() is deprecated since Tizen 5.0. Use "
+ "FileSystemManager.deleteFile() instead.",
+ "5.0");
CHECK_PRIVILEGE_ACCESS(kPrivilegeFilesystemWrite, &out);
CHECK_EXIST(args, "pathToFile", out)
void FilesystemInstance::FileRemoveDirectory(const picojson::value& args, picojson::object& out) {
ScopeLogger();
- LoggerW(
- "DEPRECATION WARNING: File.deleteDirectory() is deprecated since Tizen 5.0. Use "
- "FileSystemManager.deleteDirectory() instead.");
+ DEPRECATION_WARN(
+ "File.deleteDirectory() is deprecated since Tizen 5.0. Use "
+ "FileSystemManager.deleteDirectory() instead.",
+ "5.0");
CHECK_PRIVILEGE_ACCESS(kPrivilegeFilesystemWrite, &out);
CHECK_EXIST(args, "pathToDelete", out)
void FilesystemInstance::FileCopyTo(const picojson::value& args, picojson::object& out) {
ScopeLogger();
- LoggerW(
- "DEPRECATION WARNING: File.copyTo() is deprecated since Tizen 5.0. Use "
- "FileSystemManager.CopyFile() or FileSystemManager.CopyDirectory() instead.");
+ DEPRECATION_WARN(
+ "File.copyTo() is deprecated since Tizen 5.0. Use "
+ "FileSystemManager.copyFile() or FileSystemManager.copyDirectory() instead.",
+ "5.0");
CHECK_PRIVILEGE_ACCESS(kPrivilegeFilesystemWrite, &out);
CHECK_EXIST(args, "callbackId", out)
}
function toURI() {
- privUtils_.warn(
- 'DEPRECATION WARNING: File.toURI() is deprecated since Tizen 5.0. ' +
- 'Use FileSystemManager.toURI() instead.'
+ privUtils_.deprecationWarn(
+ 'File.toURI() is deprecated since Tizen 5.0. ' +
+ 'Use FileSystemManager.toURI() instead.',
+ '5.0'
);
xwalk.utils.checkPrivilegeAccess(xwalk.utils.privilege.FILESYSTEM_READ);
}
function listFiles() {
- privUtils_.warn(
- 'DEPRECATION WARNING: File.listFiles() is deprecated since Tizen 5.0. ' +
- 'Use FileSystemManager.listDirectory() instead.'
+ privUtils_.deprecationWarn(
+ 'File.listFiles() is deprecated since Tizen 5.0. ' +
+ 'Use FileSystemManager.listDirectory() instead.',
+ '5.0'
);
var args = validator_.validateArgs(arguments, [
}
function openStream() {
- privUtils_.warn(
- 'DEPRECATION WARNING: File.openStream() is deprecated since Tizen 5.0. ' +
- 'Use FileHandle interface to read/write operations instead.'
+ privUtils_.deprecationWarn(
+ 'File.openStream() is deprecated since Tizen 5.0. ' +
+ 'Use FileHandle interface to read/write operations instead.',
+ '5.0'
);
var args = validator_.validateArgs(arguments, [
};
function readAsText() {
- privUtils_.warn(
- 'DEPRECATION WARNING: File.readAsText() is deprecated since Tizen 5.0. ' +
- 'Use FileHandle.readString() or FileHandle.readStringNonBlocking() instead.'
+ privUtils_.deprecationWarn(
+ 'File.readAsText() is deprecated since Tizen 5.0. ' +
+ 'Use FileHandle.readString() or FileHandle.readStringNonBlocking() instead.',
+ '5.0'
);
var args = validator_.validateArgs(arguments, [
};
function copyTo() {
- privUtils_.warn(
- 'DEPRECATION WARNING: File.copyTo() is deprecated since Tizen 5.0. ' +
- 'Use FileSystemManager.CopyFile() or FileSystemManager.CopyDirectory() ' +
- 'instead.'
+ privUtils_.deprecationWarn(
+ 'File.copyTo() is deprecated since Tizen 5.0. ' +
+ 'Use FileSystemManager.copyFile() or FileSystemManager.copyDirectory() ' +
+ 'instead.',
+ '5.0'
);
var args = validator_.validateArgs(arguments, [
};
function moveTo() {
- privUtils_.warn(
- 'DEPRECATION WARNING: File.moveTo() is deprecated since Tizen 5.0. ' +
+ privUtils_.deprecationWarn(
+ 'File.moveTo() is deprecated since Tizen 5.0. ' +
'Use FileSystemManager.moveFile() or FileSystemManager.moveDirectory() ' +
- 'instead.'
+ 'instead.',
+ '5.0'
);
var args = validator_.validateArgs(arguments, [
};
function createDirectory() {
- privUtils_.warn(
- 'DEPRECATION WARNING: File.createDirectory() is deprecated since Tizen 5.0. ' +
- 'Use FileSystemManager.createDirectory() instead.'
+ privUtils_.deprecationWarn(
+ 'File.createDirectory() is deprecated since Tizen 5.0. ' +
+ 'Use FileSystemManager.createDirectory() instead.',
+ '5.0'
);
var args = validator_.validateArgs(arguments, [
};
function createFile() {
- privUtils_.warn(
- 'DEPRECATION WARNING: File.createFile() is deprecated since Tizen 5.0. ' +
- 'Use FileSystemManager.createFile() instead.'
+ privUtils_.deprecationWarn(
+ 'File.createFile() is deprecated since Tizen 5.0. ' +
+ 'Use FileSystemManager.createFile() instead.',
+ '5.0'
);
var args = validator_.validateArgs(arguments, [
};
function resolveFile() {
- privUtils_.warn(
- 'DEPRECATION WARNING: File.resolve() is deprecated since Tizen 5.0. ' +
- 'Use FileHandle and FileSystemManager interfaces instead.'
+ privUtils_.deprecationWarn(
+ 'File.resolve() is deprecated since Tizen 5.0. ' +
+ 'Use FileHandle and FileSystemManager interfaces instead.',
+ '5.0'
);
var args = validator_.validateArgs(arguments, [
};
function deleteDirectory() {
- privUtils_.warn(
- 'DEPRECATION WARNING: File.deleteDirectory() is deprecated since Tizen 5.0. ' +
- 'Use FileSystemManager.deleteDirectory() instead.'
+ privUtils_.deprecationWarn(
+ 'File.deleteDirectory() is deprecated since Tizen 5.0. ' +
+ 'Use FileSystemManager.deleteDirectory() instead.',
+ '5.0'
);
var args = validator_.validateArgs(arguments, [
};
function deleteFile() {
- privUtils_.warn(
- 'DEPRECATION WARNING: File.deleteFile() is deprecated since Tizen 5.0. ' +
- 'Use FileSystemManager.deleteFile() instead.'
+ privUtils_.deprecationWarn(
+ 'File.deleteFile() is deprecated since Tizen 5.0. ' +
+ 'Use FileSystemManager.deleteFile() instead.',
+ '5.0'
);
var args = validator_.validateArgs(arguments, [
}
function closeFileStream() {
- privUtils_.warn(
- 'DEPRECATION WARNING: FileStream.close() is deprecated since Tizen 5.0. ' +
- 'Use FileHandle.close() instead.'
+ privUtils_.deprecationWarn(
+ 'FileStream.close() is deprecated since Tizen 5.0. ' +
+ 'Use FileHandle.close() instead.',
+ '5.0'
);
this._closed = true;
}
function read() {
- privUtils_.warn(
- 'DEPRECATION WARNING: FileStream.read() is deprecated since Tizen 5.0. ' +
- 'Use FileHandle.readString() or FileHandle.readStringNonBlocking() instead.'
+ privUtils_.deprecationWarn(
+ 'FileStream.read() is deprecated since Tizen 5.0. ' +
+ 'Use FileHandle.readString() or FileHandle.readStringNonBlocking() instead.',
+ '5.0'
);
var args = validator_.validateArgs(arguments, [
}
FileStream.prototype.readBytes = function() {
- privUtils_.warn(
- 'DEPRECATION WARNING: FileStream.readBytes() is deprecated since Tizen 5.0. ' +
- 'Use FileHandle.readData() or FileHandle.readDataNonBlocking() instead.'
+ privUtils_.deprecationWarn(
+ 'FileStream.readBytes() is deprecated since Tizen 5.0. ' +
+ 'Use FileHandle.readData() or FileHandle.readDataNonBlocking() instead.',
+ '5.0'
);
return readBytes.apply(this, arguments);
};
FileStream.prototype.readBase64 = function() {
- privUtils_.warn(
- 'DEPRECATION WARNING: FileStream.readBase64() is deprecated since Tizen 5.0. ' +
- 'Use FileHandle.readData() or FileHandle.readDataNonBlocking() in ' +
- 'combination with atob() and btoa() functions instead.'
+ privUtils_.deprecationWarn(
+ 'FileStream.readBase64() is deprecated since Tizen 5.0. ' +
+ 'Use FileHandle.readData() or FileHandle.readDataNonBlocking() in combination ' +
+ 'with atob() and btoa() functions instead.',
+ '5.0'
);
return base64_encode(readBytes.apply(this, arguments));
}
function write() {
- privUtils_.warn(
- 'DEPRECATION WARNING: FileStream.write() is deprecated since Tizen 5.0. ' +
- 'Use FileHandle.writeString() or FileHandle.writeStringNonBlocking() instead.'
+ privUtils_.deprecationWarn(
+ 'FileStream.write() is deprecated since Tizen 5.0. ' +
+ 'Use FileHandle.writeString() or FileHandle.writeStringNonBlocking() instead.',
+ '5.0'
);
var args = validator_.validateArgs(arguments, [
};
function writeBytes() {
- privUtils_.warn(
- 'DEPRECATION WARNING: FileStream.writeBytes() is deprecated since Tizen 5.0. ' +
- 'Use FileHandle.writeData() or FileHandle.writeDataNonBlocking() instead.'
+ privUtils_.deprecationWarn(
+ 'FileStream.writeBytes() is deprecated since Tizen 5.0. ' +
+ 'Use FileHandle.writeData() or FileHandle.writeDataNonBlocking() instead.',
+ '5.0'
);
var args = validator_.validateArgs(arguments, [
};
function writeBase64() {
- privUtils_.warn(
- 'DEPRECATION WARNING: FileStream.writeBase64() is deprecated since Tizen 5.0. ' +
- 'Use FileHandle.writeData() or FileHandle.writeDataNonBlocking() in ' +
- 'combination with atob() and btoa() functions instead.'
+ privUtils_.deprecationWarn(
+ 'FileStream.writeBase64() is deprecated since Tizen 5.0. ' +
+ 'Use FileHandle.writeData() or FileHandle.writeDataNonBlocking() in combination ' +
+ 'with atob() and btoa() functions instead.',
+ '5.0'
);
var args = validator_.validateArgs(arguments, [
};
function resolve() {
- privUtils_.warn(
- 'DEPRECATION WARNING: FileSystemManager.resolve() is deprecated since ' +
- 'Tizen 5.0. Use FileHandle and FileSystemManager interfaces instead.'
+ privUtils_.deprecationWarn(
+ 'FileSystemManager.resolve() is deprecated since Tizen 5.0. ' +
+ 'Use FileHandle and FileSystemManager interfaces instead.',
+ '5.0'
);
var args = validator_.validateArgs(arguments, [
void PushInstance::PushRegisterService(const picojson::value& args, picojson::object& out) {
ScopeLogger();
- LoggerW(
- "DEPRECATION WARNING: registerService() is deprecated and will be removed from next release. "
- "Use register() instead.");
+ DEPRECATION_WARN(
+ "registerService() is deprecated and will be removed from next release. "
+ "Use register() instead.",
+ "3.0");
CHECK_PRIVILEGE_ACCESS(kPrivilegePush, &out);
common::PlatformResult result = impl->registerService(args.get("callbackId").get<double>());
void PushInstance::PushUnregisterService(const picojson::value& args, picojson::object& out) {
ScopeLogger();
- LoggerW(
- "DEPRECATION WARNING: unregisterService() is deprecated and will be removed from next "
- "release. Use unregister() instead.");
+ DEPRECATION_WARN(
+ "unregisterService() is deprecated and will be removed from next "
+ "release. Use unregister() instead.",
+ "3.0");
CHECK_PRIVILEGE_ACCESS(kPrivilegePush, &out);
void PushInstance::PushConnectService(const picojson::value& args, picojson::object& out) {
ScopeLogger();
- LoggerW(
- "DEPRECATION WARNING: connectService() is deprecated and will be removed from next release. "
- "Use connect() instead.");
+ DEPRECATION_WARN(
+ "connectService() is deprecated and will be removed from next release. "
+ "Use connect() instead.",
+ "3.0");
CHECK_PRIVILEGE_ACCESS(kPrivilegePush, &out);
void PushInstance::PushDisconnectService(const picojson::value& args, picojson::object& out) {
ScopeLogger();
- LoggerW(
- "DEPRECATION WARNING: disconnectService() is deprecated and will be removed from next "
- "release. Use disconnect() instead.");
+ DEPRECATION_WARN(
+ "disconnectService() is deprecated and will be removed from next "
+ "release. Use disconnect() instead.",
+ "3.0");
CHECK_PRIVILEGE_ACCESS(kPrivilegePush, &out);
#include "sensor_service.h"
-#include <glib.h>
#include <memory>
#include <mutex>
#include <string>
return ret;
}
if (!supported) {
- return LogAndCreateResult(ErrorCode::NOT_SUPPORTED_ERR,
- "Wifi is not supported on this device");
+ return LogAndCreateResult(ErrorCode::NOT_SUPPORTED_ERR, "Wifi is not supported on this device");
}
return PlatformResult(ErrorCode::NO_ERROR);
}
isRemoveable: {
enumerable: true,
get: function() {
- privUtils_.warn(
- 'DEPRECATION WARNING: SystemInfoStorageUnit.isRemoveable is ' +
- 'deprecated and will be removed from next release. ' +
- 'Use SystemInfoStorageUnit.isRemovable instead.'
+ privUtils_.deprecationWarn(
+ 'SystemInfoStorageUnit.isRemoveable is is ' +
+ 'deprecated and will be removed from next release.' +
+ 'Use SystemInfoStorageUnit.isRemovable instead.',
+ '2.1'
);
return _isRemovable;
},
SystemInfo.prototype.getCapabilities = function() {
privUtils_.warn(
- 'DEPRECATION WARNING: getCapabilities() is deprecated and will be removed ' +
- 'from next release. Use getCapability() instead.'
+ 'getCapabilities() is deprecated and will be removed' +
+ 'from next release. Use getCapability() instead.',
+ '2.3'
);
var result = native_.callSync('SystemInfoGetCapabilities', {});
void SysteminfoInstance::SystemInfoGetCapabilities(const picojson::value& args,
picojson::object& out) {
ScopeLogger();
- LoggerW(
- "DEPRECATION WARNING: getCapabilities() is deprecated and will be removed from next release. "
- "Use getCapability() instead.");
+ DEPRECATION_WARN(
+ "getCapabilities() is deprecated and will be removed from next release. "
+ "Use getCapability() instead.",
+ "2.3");
manager_.GetCapabilities(args, &out);
}
const std::string kPropertyIdPeripheral = "PERIPHERAL";
const std::string kPropertyIdMemory = "MEMORY";
const std::string kPropertyIdCameraFlash = "CAMERA_FLASH";
+const std::string kPropertyIdNetProxyNetwork = "NET_PROXY_NETWORK";
const std::string kPropertyIdServiceCountry = "SERVICE_COUNTRY";
#define CHECK_EXIST(args, name, out) \
unsigned long* count) {
ScopeLogger();
- if ("BATTERY" == property || "CPU" == property || "STORAGE" == property ||
- "DISPLAY" == property || "DEVICE_ORIENTATION" == property || "BUILD" == property ||
- "LOCALE" == property || "WIFI_NETWORK" == property || "PERIPHERAL" == property ||
- "MEMORY" == property || "NET_PROXY_NETWORK" == property) {
+ if (kPropertyIdBattery == property || kPropertyIdCpu == property ||
+ kPropertyIdStorage == property || kPropertyIdDisplay == property ||
+ kPropertyIdDeviceOrientation == property || kPropertyIdBuild == property ||
+ kPropertyIdLocale == property || kPropertyIdWifiNetwork == property ||
+ kPropertyIdPeripheral == property || kPropertyIdMemory == property ||
+ kPropertyIdNetProxyNetwork == property) {
*count = kDefaultPropertyCount;
- } else if ("CELLULAR_NETWORK" == property || "SIM" == property || "NETWORK" == property) {
+ } else if (kPropertyIdCellularNetwork == property || kPropertyIdSim == property ||
+ kPropertyIdNetwork == property) {
PlatformResult ret = SysteminfoUtils::CheckTelephonySupport();
if (ret.IsError()) {
*count = 0;
if ("NETWORK" == property && SysteminfoUtils::CheckWifiSupport()) {
- // Telephony is not supported in this case, but WiFi is still supported, thus setting
- // counter to 1.
+ // Telephony is not supported in this case, but WiFi is still supported, thus setting
+ // counter to 1.
*count = 1;
}
} else {
*count = tapi_manager_->GetSimCount();
}
- } else if ("CAMERA_FLASH" == property) {
+ } else if (kPropertyIdCameraFlash == property) {
*count = GetCameraTypesCount();
- } else if ("ETHERNET_NETWORK" == property) {
+ } else if (kPropertyIdEthernetNetwork == property) {
PlatformResult ret = SysteminfoUtils::CheckIfEthernetNetworkSupported();
if (ret.IsError()) {
*count = 0;
#include "common/logger.h"
#include "common/picojson.h"
#include "common/platform_result.h"
+#include "common/tools.h"
namespace extension {
namespace time {
void TimeInstance::TZDateGetTimezoneAbbreviation(const picojson::value& args,
picojson::object& out) {
ScopeLogger();
- LoggerW(
- "DEPRECATION WARNING: getTimezoneAbbreviation() is deprecated and will be removed from next "
- "release.");
+ DEPRECATION_WARN(
+ "getTimezoneAbbreviation() is deprecated and will be removed from next "
+ "release.",
+ "2.1");
if (!args.contains("timezone") || !args.contains("timestamp")) {
LogAndReportError(PlatformResult(ErrorCode::INVALID_VALUES_ERR, "Invalid parameter passed."),
+/*eslint-disable */
/*
MIT License
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
module.exports.typeDetect = module.exports;
},{}]},{},[1])(1)
-});
\ No newline at end of file
+});
+/*eslint-disable */
/*
MIT License
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
Utils.prototype.error = console.error.bind(console);
Utils.prototype.warn = console.warn.bind(console);
Utils.prototype.log = _enableJsLogs ? console.log.bind(console) : function() {};
+var appVersion = undefined; // Used to cache required version of an app
+
+/**
+ * @param {string} msg Message to be logged on warn level.
+ * @param {string} deprecationVersion Version from which the deprecation log must appear.
+ */
+Utils.prototype.deprecationWarn = function(msg, deprecationVersion) {
+ // For public code, warning should be always shown
+ this.warn('DEPRECATION WARNING: ' + msg);
+};
+
+Utils.prototype.assert = console.assert.bind(console);
if (console.assert) {
Utils.prototype.assert = console.assert.bind(console);
} else {
Utils.prototype.assert = function() {
if (false === arguments[0]) {
- console.error("Assertion failed: ", Array.prototype.slice.call(arguments, 1));
+ console.error('Assertion failed: ', Array.prototype.slice.call(arguments, 1));
}
- }
+ };
}
Utils.prototype.global = _global;
* valid_error_names should contain error names defined in the API reference
* for the called function.
*/
-NativeManager.prototype.getErrorObjectAndValidate = function(result,
- valid_error_names,
- default_error) {
- xwalk.utils.assert(Array.isArray(valid_error_names),
- "valid_error_names must be an Array. %s was passed instead",
- typeof valid_error_names);
+NativeManager.prototype.getErrorObjectAndValidate = function(
+ result,
+ valid_error_names,
+ default_error
+) {
+ xwalk.utils.assert(
+ Array.isArray(valid_error_names),
+ 'valid_error_names must be an Array. %s was passed instead',
+ typeof valid_error_names
+ );
var error = new WebAPIException(result.error);
if (valid_error_names.includes(error.name)) {
- return error;
+ return error;
}
return default_error;