var T = xwalk.utils.type;
var Converter = xwalk.utils.converter;
var AV = xwalk.utils.validator;
+var Privilege = xwalk.utils.privilege;
var native = new xwalk.utils.NativeManager(extension);
};
ApplicationManager.prototype.kill = function() {
+ xwalk.utils.checkPrivilegeAccess(Privilege.APPMANAGER_KILL);
+
var args = AV.validateMethod(arguments, [
{
name : 'contextId',
};
ApplicationManager.prototype.launch = function() {
+ xwalk.utils.checkPrivilegeAccess(Privilege.APPLICATION_LAUNCH);
+
var args = AV.validateMethod(arguments, [
{
name : 'id',
};
ApplicationManager.prototype.launchAppControl = function() {
+ xwalk.utils.checkPrivilegeAccess(Privilege.APPLICATION_LAUNCH);
+
var args = AV.validateMethod(arguments, [
{
name : 'appControl',
};
ApplicationManager.prototype.getAppCerts = function() {
+ xwalk.utils.checkPrivilegeAccess(Privilege.APPMANAGER_CERTIFICATE);
+
var args = AV.validateMethod(arguments, [
{
name : 'id',
};
ApplicationManager.prototype.getAppMetaData = function() {
+ xwalk.utils.checkPrivilegeAccess(Privilege.APPLICATION_INFO);
+
var args = AV.validateMethod(arguments, [
{
name : 'id',
var sizeException;
function sizeGetter() {
+ xwalk.utils.checkPrivilegeAccess(Privilege.APPLICATION_INFO);
if (undefined === size) {
var callArgs = { packageId : this.packageId }; // jshint ignore:line
var result = native.callSync('ApplicationInformation_getSize', callArgs);
namespace extension {
namespace application {
-namespace {
-// The privileges that are required in Application API
-const std::string kPrivilegeAppManagerCertificate = "http://tizen.org/privilege/appmanager.certificate";
-const std::string kPrivilegeAppManagerKill = "http://tizen.org/privilege/appmanager.kill";
-const std::string kPrivilegeApplicationInfo = "http://tizen.org/privilege/application.info";
-const std::string kPrivilegeApplicationLaunch = "http://tizen.org/privilege/application.launch";
-} // namespace
-
using namespace common;
ApplicationInstance::ApplicationInstance(const std::string& app_id) :
void ApplicationInstance::GetAppCerts(const picojson::value& args, picojson::object& out) {
LoggerD("Entered");
- CHECK_PRIVILEGE_ACCESS(kPrivilegeAppManagerCertificate, &out);
-
std::string app_id = app_id_;
const auto& id = args.get("id");
if (id.is<std::string>()) {
void ApplicationInstance::GetAppMetaData(const picojson::value& args, picojson::object& out) {
LoggerD("Entered");
- CHECK_PRIVILEGE_ACCESS(kPrivilegeApplicationInfo, &out);
-
std::string app_id = app_id_;
const auto& id = args.get("id");
if (id.is<std::string>()) {
void ApplicationInstance::GetSize(const picojson::value& args, picojson::object& out) {
LoggerD("Entered");
- CHECK_PRIVILEGE_ACCESS(kPrivilegeApplicationInfo, &out);
-
manager_.GetApplicationInformationSize(args, &out);
}
void ApplicationInstance::Kill(const picojson::value& args, picojson::object& out) {
LoggerD("Entered");
- CHECK_PRIVILEGE_ACCESS(kPrivilegeAppManagerKill, &out);
-
manager_.Kill(args);
}
void ApplicationInstance::Launch(const picojson::value& args, picojson::object& out) {
LoggerD("Entered");
- CHECK_PRIVILEGE_ACCESS(kPrivilegeApplicationLaunch, &out);
-
manager_.Launch(args);
}
void ApplicationInstance::LaunchAppControl(const picojson::value& args, picojson::object& out) {
LoggerD("Entered");
- CHECK_PRIVILEGE_ACCESS(kPrivilegeApplicationLaunch, &out);
-
manager_.LaunchAppControl(args);
}