2026-09-10 19:12:31 +00:00
|
|
|
// Module ID: 5190
|
|
|
|
|
// Function ID: 5191
|
2026-09-10 05:38:07 +00:00
|
|
|
// Name: NativePermissionManager
|
2026-09-10 19:12:31 +00:00
|
|
|
// Dependencies: [4815, 1074, 1898, 1115, 5191, 573, 5189, 2]
|
2026-07-20 16:05:17 +00:00
|
|
|
|
2026-09-10 19:12:31 +00:00
|
|
|
// Module 5190 (NativePermissionManager)
|
2026-09-10 05:38:07 +00:00
|
|
|
import DispatcherDefault from "Dispatcher" /* 573 */;
|
|
|
|
|
import Constants from "Constants" /* 1074 */;
|
|
|
|
|
import PlatformUtils from "PlatformUtils" /* 1115 */;
|
2026-09-10 19:12:31 +00:00
|
|
|
import NativePermissionConstants from "NativePermissionConstants" /* 4815 */;
|
|
|
|
|
import NativePermissionUtils from "NativePermissionUtils" /* 5189 */;
|
2026-09-10 05:38:07 +00:00
|
|
|
import LifecycleManager from "LifecycleManager" /* 1898 */;
|
|
|
|
|
import size from "module_2" /* 2 */;
|
2026-07-23 10:11:24 +00:00
|
|
|
|
2026-09-10 05:38:07 +00:00
|
|
|
const NativePermissionTypes = NativePermissionConstants.NativePermissionTypes;
|
|
|
|
|
const InputModes = Constants.InputModes;
|
2026-07-29 08:29:29 +00:00
|
|
|
class NativePermissionManager extends tmp2 {
|
2026-07-20 16:05:17 +00:00
|
|
|
}
|
2026-07-29 08:29:29 +00:00
|
|
|
const prototype = NativePermissionManager.prototype;
|
|
|
|
|
prototype["isEnabled"] = function isEnabled() {
|
2026-09-10 05:38:07 +00:00
|
|
|
let isDesktopResult = PlatformUtils.isDesktop();
|
2026-07-29 08:29:29 +00:00
|
|
|
if (isDesktopResult) {
|
2026-09-05 10:56:28 +00:00
|
|
|
isDesktopResult = tmp(1115).isMac();
|
|
|
|
|
const tmpResult = tmp(1115);
|
2026-07-29 08:29:29 +00:00
|
|
|
}
|
|
|
|
|
if (isDesktopResult) {
|
2026-09-10 19:12:31 +00:00
|
|
|
const ProcessArgs = tmp(5191).ProcessArgs;
|
2026-07-29 08:29:29 +00:00
|
|
|
isDesktopResult = !ProcessArgs.isDiscordTestSet();
|
|
|
|
|
}
|
|
|
|
|
return isDesktopResult;
|
|
|
|
|
};
|
|
|
|
|
prototype["_initialize"] = function _initialize() {
|
|
|
|
|
if (this.isEnabled()) {
|
2026-09-10 05:38:07 +00:00
|
|
|
const subscription = DispatcherDefault.subscribe("AUDIO_SET_MODE", this.handleAudioSetMode);
|
2026-07-29 08:29:29 +00:00
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
prototype["_terminate"] = function _terminate() {
|
|
|
|
|
if (this.isEnabled()) {
|
2026-09-10 05:38:07 +00:00
|
|
|
DispatcherDefault.unsubscribe("AUDIO_SET_MODE", this.handleAudioSetMode);
|
2026-07-29 08:29:29 +00:00
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
prototype["handleAudioSetMode"] = function handleAudioSetMode(mode) {
|
|
|
|
|
if (mode.mode === InputModes.PUSH_TO_TALK) {
|
2026-09-10 05:38:07 +00:00
|
|
|
const permission = NativePermissionUtils.default.requestPermission(NativePermissionTypes.INPUT_MONITORING);
|
|
|
|
|
const _default = NativePermissionUtils.default;
|
2026-07-29 08:29:29 +00:00
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
const nativePermissionManager = new NativePermissionManager();
|
2026-09-10 05:38:07 +00:00
|
|
|
const result = size.fileFinishedImporting("modules/native_permissions/NativePermissionManager.tsx");
|
2026-07-20 16:05:17 +00:00
|
|
|
|
2026-07-29 08:29:29 +00:00
|
|
|
export default nativePermissionManager;
|