You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

functions.native.ts 1.2KB

12345678910111213141516171819202122232425262728293031323334
  1. import { NativeModules } from 'react-native';
  2. import DefaultPreference from 'react-native-default-preference';
  3. export * from './functions.any';
  4. const { AudioMode } = NativeModules;
  5. /**
  6. * Handles changes to the `disableCallIntegration` setting.
  7. * On Android (where `AudioMode.setUseConnectionService` is defined) we must update
  8. * the native side too, since audio routing works differently.
  9. *
  10. * @param {boolean} disabled - Whether call integration is disabled or not.
  11. * @returns {void}
  12. */
  13. export function handleCallIntegrationChange(disabled: boolean) {
  14. if (AudioMode.setUseConnectionService) {
  15. AudioMode.setUseConnectionService(!disabled);
  16. }
  17. }
  18. /**
  19. * Handles changes to the `disableCrashReporting` setting.
  20. * Stores the value into platform specific default preference file, so at app
  21. * start-up time it is retrieved on the native side and the crash reporting
  22. * is enabled/disabled.
  23. *
  24. * @param {boolean} disabled - Whether crash reporting is disabled or not.
  25. * @returns {void}
  26. */
  27. export function handleCrashReportingChange(disabled: boolean) {
  28. DefaultPreference.setName('jitsi-default-preferences').then( // @ts-ignore
  29. DefaultPreference.set('isCrashReportingDisabled', disabled.toString()));
  30. }