}
if (!permissions.includes("http://tizen.org/privilege/application.launch") &&
!permissions.includes("http://tizen.org/privilege/appmanager.launch")) {
- tizen.application.launch =
- tizen.application.launchAppControl = function() {
+ tizen.application.launch = function() {
console.log('The application.launch and appmanager.launch permission is missing.');
}
}
funcGetSharedUri: any;
funcGetMetadata: any;
funcGetPackageInfo: any;
+ funcRequestLocalMessagePort: any;
+ funcRequestTrustedLocalMessagePort: any;
id: string;
serviceId: string;
this.refineApplicationApis();
this.refinePackageApis();
this.refineFilesystemApis()
+ this.refineMessagePortApis()
this.initAccessControlManager();
this.refineXwalkUtilApis();
}
return this.pkgApiVersion;
}
}
+
+ refineMessagePortApis() {
+ this.funcRequestLocalMessagePort =
+ global.tizen.messageport.requestLocalMessagePort;
+ this.funcRequestTrustedLocalMessagePort =
+ global.tizen.messageport.requestTrustedLocalMessagePort;
+
+ const registerMessagePort = (name: string, portName: string) => {
+ let data_payload = [
+ new global.tizen.ApplicationControlData(name, [ portName ]),
+
+ ];
+ let appControl = new global.tizen.ApplicationControl(
+ "http://tizen.org/appcontrol/operation/default", null, null, null,
+ data_payload, null);
+ global.tizen.application.launchAppControl(appControl, this.serviceId,
+ () => console.log(`'${this.serviceId}::${name}' is requsted`));
+ }
+
+ global.tizen.messageport.requestLocalMessagePort = (portName: string) => {
+ registerMessagePort('requestLocalMessagePort', portName);
+ return this.funcRequestLocalMessagePort(portName);
+ }
+ global.tizen.messageport.requestTrustedLocalMessagePort = (portName: string) => {
+ registerMessagePort('requestTrustedLocalMessagePort', portName);
+ return this.funcRequestLocalMessagePort(portName);
+ }
+ }
}