funcGetSharedUri: any;
funcGetMetadata: any;
funcGetPackageInfo: any;
+ funcPathResolve: any;
constructor() {
this.RefineApplicationApis();
this.RefinePackageApis();
+ this.RefineFilesystemApis()
}
GetServiceId() {
// tizen.application.getCurrentApplication()
this.funcCurrentApplication = global.tizen.application.getCurrentApplication;
global.tizen.application.getCurrentApplication = () => {
- console.log(`getCurrentApplication() : ${this.GetServiceId()}`);
+ console.log(`Routing - getCurrentApplication() : ${this.GetServiceId()}`);
if (this.currentApplication)
return this.currentApplication;
this.currentApplication = this.funcCurrentApplication();
// tizen.application.getCurrentApplication().getRequestedAppControl()
this.funcRequestedAppcontrol = this.currentApplication.getRequestedAppControl;
this.currentApplication.getRequestedAppControl = () => {
- console.log(`getRequestedAppControl() : ${this.GetServiceId()}`);
+ console.log(`Routing - getRequestedAppControl() : ${this.GetServiceId()}`);
if (wrt.tv)
wrt.tv.setCurrentApplication(this.GetServiceId());
return this.funcRequestedAppcontrol();
// tizen.application.getAppInfo()
this.funcGetAppInfo = global.tizen.application.getAppInfo;
global.tizen.application.getAppInfo = (app_id?: string) => {
- console.log(`getAppInfo()`);
+ console.log(`Routing - getAppInfo()`);
if (!app_id)
app_id = this.GetServiceId();
return this.funcGetAppInfo(app_id);
// tizen.application.getAppCerts()
this.funcGetAppcerts = global.tizen.application.getAppCerts;
global.tizen.application.getAppCerts = (app_id?: string) => {
- console.log(`getAppCerts()`);
+ console.log(`Routing - getAppCerts()`);
if (!app_id)
app_id = this.GetServiceId();
return this.funcGetAppcerts(app_id);
// tizen.application.getAppSharedURI()
this.funcGetSharedUri = global.tizen.application.getAppSharedURI;
global.tizen.application.getAppSharedURI = (app_id?: string) => {
- console.log(`getAppSharedURI()`);
+ console.log(`Routing - getAppSharedURI()`);
if (!app_id)
app_id = this.GetServiceId();
return this.funcGetSharedUri(app_id);
// tizen.application.getAppMetaData()
this.funcGetMetadata = global.tizen.application.getAppMetaData;
global.tizen.application.getAppMetaData = (app_id?: string) => {
- console.log(`getAppMetaData()`);
+ console.log(`Routing - getAppMetaData()`);
if (!app_id)
app_id = this.GetServiceId();
return this.funcGetMetadata(app_id);
// tizen.package.getPackageInfo()
this.funcGetPackageInfo = global.tizen.package.getPackageInfo;
global.tizen.package.getPackageInfo = (package_id?: string) => {
- console.log(`getPackageInfo()`);
+ console.log(`Routing - getPackageInfo()`);
if (!package_id)
package_id = this.GetPackageId();
return this.funcGetPackageInfo(package_id);
}
}
+
+ RefineFilesystemApis() {
+ // tizen.filesystem.resolve
+ this.funcPathResolve = global.tizen.filesystem.resolve;
+ global.tizen.filesystem.resolve = (location: string, onSuccess: Function,
+ onError?: Function, mode?: string) => {
+ console.log(`Routing - resolve(${location})`);
+ let service_id = this.GetServiceId();
+ location = wrt.resolveVirtualRoot(service_id, location);
+ this.funcPathResolve(location, onSuccess, onError, mode);
+ }
+ }
}
\ No newline at end of file