2019-10-18 14:30:59 +00:00
|
|
|
import { NativeModules } from 'react-native';
|
2020-05-07 21:05:48 +00:00
|
|
|
import DefaultPreference from 'react-native-default-preference';
|
|
|
|
|
2019-10-18 14:30:59 +00:00
|
|
|
export * from './functions.any';
|
|
|
|
|
|
|
|
const { AudioMode } = NativeModules;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Handles changes to the `disableCallIntegration` setting.
|
|
|
|
* On Android (where `AudioMode.setUseConnectionService` is defined) we must update
|
|
|
|
* the native side too, since audio routing works differently.
|
|
|
|
*
|
|
|
|
* @param {boolean} disabled - Whether call integration is disabled or not.
|
|
|
|
* @returns {void}
|
|
|
|
*/
|
|
|
|
export function handleCallIntegrationChange(disabled: boolean) {
|
|
|
|
if (AudioMode.setUseConnectionService) {
|
|
|
|
AudioMode.setUseConnectionService(!disabled);
|
|
|
|
}
|
|
|
|
}
|
2020-05-07 21:05:48 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Handles changes to the `disableCrashReporting` setting.
|
|
|
|
* Stores the value into platform specific default preference file, so at app
|
|
|
|
* start-up time it is retrieved on the native side and the crash reporting
|
|
|
|
* is enabled/disabled.
|
|
|
|
*
|
|
|
|
* @param {boolean} disabled - Whether crash reporting is disabled or not.
|
|
|
|
* @returns {void}
|
|
|
|
*/
|
|
|
|
export function handleCrashReportingChange(disabled: boolean) {
|
2022-09-14 07:54:56 +00:00
|
|
|
DefaultPreference.setName('jitsi-default-preferences').then( // @ts-ignore
|
2020-05-07 21:05:48 +00:00
|
|
|
DefaultPreference.set('isCrashReportingDisabled', disabled.toString()));
|
|
|
|
}
|