decord/source/modules/messages/BackgroundTaskManager.native.tsx

67 lines
2.2 KiB
TypeScript
Raw Normal View History

2026-07-25 08:10:48 +00:00
// Module ID: 5989
2026-07-27 11:26:19 +00:00
// Function ID: 53265
2026-07-20 16:05:17 +00:00
// Name: startBackgroundTask
2026-07-25 08:10:48 +00:00
// Dependencies: [5, 27, 477, 5990, 5991, 2]
2026-07-20 16:05:17 +00:00
// Exports: backgroundify
2026-07-25 08:10:48 +00:00
// Module 5989 (startBackgroundTask)
2026-07-23 10:11:24 +00:00
import closure_3 from "set";
import { NativeModules } from "get ActivityIndicator";
import set from "set";
import set from "set";
const require = arg1;
2026-07-20 16:05:17 +00:00
function startBackgroundTask(arg0) {
let content;
let title;
2026-07-23 10:11:24 +00:00
let obj = require(477) /* set */;
2026-07-20 16:05:17 +00:00
if (obj.isAndroid()) {
if (null == arg0) {
2026-07-23 10:11:24 +00:00
const promise = new Promise((arg0) => arg0(outer1_5));
2026-07-20 16:05:17 +00:00
return promise;
} else {
({ title, content } = arg0);
2026-07-25 08:10:48 +00:00
obj = { title, content, priority: require(5991) /* ServiceNotificationPriority */.ServiceNotificationPriority.MEDIUM, type: require(5991) /* ServiceNotificationPriority */.ServiceNotificationType.FILE_UPLOAD, usesGateway: false };
return importDefault(5990).addServiceHandler(obj);
2026-07-20 16:05:17 +00:00
}
} else {
const DCDBackgroundTaskManager = NativeModules.DCDBackgroundTaskManager;
return DCDBackgroundTaskManager.startBackgroundTask();
}
}
function endBackgroundTask(closure_3) {
if (closure_3 !== num) {
if (obj.isAndroid()) {
2026-07-25 08:10:48 +00:00
importDefault(5990).removeServiceHandler(closure_3);
const obj2 = importDefault(5990);
2026-07-20 16:05:17 +00:00
} else {
const DCDBackgroundTaskManager = NativeModules.DCDBackgroundTaskManager;
DCDBackgroundTaskManager.endBackgroundTask(closure_3);
}
2026-07-23 10:11:24 +00:00
obj = require(477) /* set */;
2026-07-20 16:05:17 +00:00
}
}
function backgroundify(arg0, arg1) {
2026-07-23 10:11:24 +00:00
let closure_0 = arg0;
let closure_1 = arg1;
2026-07-20 16:05:17 +00:00
return callback(async () => {
2026-07-23 10:11:24 +00:00
let closure_0 = outer2_5;
closure_0 = yield outer2_6(outer1_1);
return outer1_0().finally(() => {
outer3_7(closure_0);
2026-07-20 16:05:17 +00:00
});
});
}
let num = -1;
2026-07-23 10:11:24 +00:00
if (!set.isAndroid()) {
2026-07-20 16:05:17 +00:00
num = NativeModules.DCDBackgroundTaskManager.backgroundTaskIdentifierInvalid;
}
2026-07-23 10:11:24 +00:00
set = { backgroundTaskIdentifierInvalid: num, backgroundify, startBackgroundTask, endBackgroundTask };
const result = set.fileFinishedImporting("modules/messages/BackgroundTaskManager.native.tsx");
2026-07-20 16:05:17 +00:00
2026-07-23 10:11:24 +00:00
export default set;
2026-07-20 16:05:17 +00:00
export const backgroundTaskIdentifierInvalid = num;
export { startBackgroundTask };
export { endBackgroundTask };
export { backgroundify };