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.js 1.2KB

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