function checkSystemInfoApiPrivilege(func: any, permissions: string[]) {
let override_func = func;
- return (type: string, onSuccess: any, onError: any) => {
- if (type === "CELLULAR_NETWORK" && !permissions.includes("http://tizen.org/privilege/telephony")) {
+ return (...args: any[]) => {
+ if (args[0] === "CELLULAR_NETWORK" && !permissions.includes("http://tizen.org/privilege/telephony")) {
console.log('The telephony permission is missing.');
return ;
}
- override_func.call(global.tizen.systeminfo, type, onSuccess, onError);
+ override_func.call(global.tizen.systeminfo, ...args);
}
}