@stream-io/react-native-callingx 0.1.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Callingx.podspec +23 -0
- package/LICENSE +219 -0
- package/README.md +392 -0
- package/android/bin/build/generated/source/buildConfig/debug/io/getstream/rn/callingx/BuildConfig.class +0 -0
- package/android/bin/build/generated/source/codegen/java/io/getstream/rn/callingx/NativeCallingxSpec.class +0 -0
- package/android/bin/build/generated/source/codegen/jni/CMakeLists.txt +28 -0
- package/android/bin/build/generated/source/codegen/jni/CallingxSpec-generated.cpp +167 -0
- package/android/bin/build/generated/source/codegen/jni/CallingxSpec.h +31 -0
- package/android/bin/build/generated/source/codegen/jni/react/renderer/components/CallingxSpec/CallingxSpecJSI-generated.cpp +196 -0
- package/android/bin/build/generated/source/codegen/jni/react/renderer/components/CallingxSpec/CallingxSpecJSI.h +283 -0
- package/android/bin/build/generated/source/codegen/jni/react/renderer/components/CallingxSpec/ComponentDescriptors.cpp +22 -0
- package/android/bin/build/generated/source/codegen/jni/react/renderer/components/CallingxSpec/ComponentDescriptors.h +24 -0
- package/android/bin/build/generated/source/codegen/jni/react/renderer/components/CallingxSpec/EventEmitters.cpp +16 -0
- package/android/bin/build/generated/source/codegen/jni/react/renderer/components/CallingxSpec/EventEmitters.h +17 -0
- package/android/bin/build/generated/source/codegen/jni/react/renderer/components/CallingxSpec/Props.cpp +19 -0
- package/android/bin/build/generated/source/codegen/jni/react/renderer/components/CallingxSpec/Props.h +18 -0
- package/android/bin/build/generated/source/codegen/jni/react/renderer/components/CallingxSpec/ShadowNodes.cpp +17 -0
- package/android/bin/build/generated/source/codegen/jni/react/renderer/components/CallingxSpec/ShadowNodes.h +23 -0
- package/android/bin/build/generated/source/codegen/jni/react/renderer/components/CallingxSpec/States.cpp +16 -0
- package/android/bin/build/generated/source/codegen/jni/react/renderer/components/CallingxSpec/States.h +20 -0
- package/android/bin/build/generated/source/codegen/schema.json +1 -0
- package/android/bin/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/AndroidManifest.xml +33 -0
- package/android/bin/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/output-metadata.json +18 -0
- package/android/bin/build/intermediates/aar_metadata/debug/writeDebugAarMetadata/aar-metadata.properties +6 -0
- package/android/bin/build/intermediates/annotation_processor_list/debug/javaPreCompileDebug/annotationProcessors.json +1 -0
- package/android/bin/build/intermediates/compile_library_classes_jar/debug/bundleLibCompileToJarDebug/classes.jar +0 -0
- package/android/bin/build/intermediates/compile_r_class_jar/debug/generateDebugRFile/R.jar +0 -0
- package/android/bin/build/intermediates/compile_symbol_list/debug/generateDebugRFile/R.txt +3 -0
- package/android/bin/build/intermediates/compiled_local_resources/debug/compileDebugLibraryResources/out/drawable_ic_phone_paused_24.xml.flat +0 -0
- package/android/bin/build/intermediates/compiled_local_resources/debug/compileDebugLibraryResources/out/drawable_ic_round_call_24.xml.flat +0 -0
- package/android/bin/build/intermediates/compiled_local_resources/debug/compileDebugLibraryResources/out/drawable_ic_user.xml.flat +0 -0
- package/android/bin/build/intermediates/incremental/debug/packageDebugResources/compile-file-map.properties +4 -0
- package/android/bin/build/intermediates/incremental/debug/packageDebugResources/merger.xml +2 -0
- package/android/bin/build/intermediates/incremental/mergeDebugAssets/merger.xml +2 -0
- package/android/bin/build/intermediates/incremental/mergeDebugJniLibFolders/merger.xml +2 -0
- package/android/bin/build/intermediates/incremental/mergeDebugShaders/merger.xml +2 -0
- package/android/bin/build/intermediates/java_res/debug/processDebugJavaRes/out/META-INF/stream-io_react-native-callingx_debug.kotlin_module +0 -0
- package/android/bin/build/intermediates/local_only_symbol_list/debug/parseDebugLocalResources/R-def.txt +5 -0
- package/android/bin/build/intermediates/manifest_merge_blame_file/debug/processDebugManifest/manifest-merger-blame-debug-report.txt +60 -0
- package/android/bin/build/intermediates/merged_manifest/debug/processDebugManifest/AndroidManifest.xml +33 -0
- package/android/bin/build/intermediates/navigation_json/debug/extractDeepLinksDebug/navigation.json +1 -0
- package/android/bin/build/intermediates/nested_resources_validation_report/debug/generateDebugResources/nestedResourcesValidationReport.txt +1 -0
- package/android/bin/build/intermediates/packaged_res/debug/packageDebugResources/drawable/ic_phone_paused_24.xml +11 -0
- package/android/bin/build/intermediates/packaged_res/debug/packageDebugResources/drawable/ic_round_call_24.xml +11 -0
- package/android/bin/build/intermediates/packaged_res/debug/packageDebugResources/drawable/ic_user.xml +27 -0
- package/android/bin/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/META-INF/stream-io_react-native-callingx_debug.kotlin_module +0 -0
- package/android/bin/build/intermediates/runtime_library_classes_jar/debug/bundleLibRuntimeToJarDebug/classes.jar +0 -0
- package/android/bin/build/intermediates/symbol_list_with_package_name/debug/generateDebugRFile/package-aware-r.txt +4 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.keystream +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.keystream.len +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.len +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.values.at +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab_i +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab_i.len +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.keystream +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.keystream.len +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.len +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.values.at +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab_i +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab_i.len +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream.len +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.len +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.values.at +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i.len +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab.keystream +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab.keystream.len +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab.len +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab.values.at +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab_i +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab_i.len +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream.len +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.len +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.values.at +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i.len +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab.keystream +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab.keystream.len +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab.len +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab.values.at +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab_i +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab_i.len +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.keystream +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.keystream.len +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.len +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.values +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.values.at +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.values.s +1 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab_i +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab_i.len +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream.len +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.len +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.values.at +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab_i +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab_i.len +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.keystream +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.keystream.len +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.len +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.values.at +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab_i +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab_i.len +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.keystream +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.keystream.len +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.len +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.values.at +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab_i +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab_i.len +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/counters.tab +2 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.keystream +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.keystream.len +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.len +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.values.at +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab_i +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab_i.len +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream.len +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.len +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.values.at +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab_i +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab_i.len +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream.len +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.len +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.values.at +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab_i +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab_i.len +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/last-build.bin +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/classpath-snapshot/shrunk-classpath-snapshot.bin +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/local-state/build-history.bin +0 -0
- package/android/bin/build/outputs/logs/manifest-merger-debug-report.txt +70 -0
- package/android/bin/build/tmp/compileDebugJavaWithJavac/previous-compilation-data.bin +0 -0
- package/android/bin/build/tmp/kotlin-classes/debug/META-INF/stream-io_react-native-callingx_debug.kotlin_module +0 -0
- package/android/bin/build.gradle +81 -0
- package/android/bin/gradle.properties +5 -0
- package/android/bin/local.properties +8 -0
- package/android/bin/src/main/AndroidManifest.xml +30 -0
- package/android/bin/src/main/java/io/getstream/rn/callingx/CallService.kt +396 -0
- package/android/bin/src/main/java/io/getstream/rn/callingx/CallingxModule.kt +639 -0
- package/android/bin/src/main/java/io/getstream/rn/callingx/CallingxPackage.kt +16 -0
- package/android/bin/src/main/java/io/getstream/rn/callingx/HeadlessTaskManager.kt +164 -0
- package/android/bin/src/main/java/io/getstream/rn/callingx/ResourceUtils.kt +60 -0
- package/android/bin/src/main/java/io/getstream/rn/callingx/Utils.kt +23 -0
- package/android/bin/src/main/java/io/getstream/rn/callingx/model/Call.kt +57 -0
- package/android/bin/src/main/java/io/getstream/rn/callingx/model/CallAction.kt +36 -0
- package/android/bin/src/main/java/io/getstream/rn/callingx/notifications/CallNotificationManager.kt +215 -0
- package/android/bin/src/main/java/io/getstream/rn/callingx/notifications/NotificationChannelsManager.kt +113 -0
- package/android/bin/src/main/java/io/getstream/rn/callingx/notifications/NotificationIntentFactory.kt +105 -0
- package/android/bin/src/main/java/io/getstream/rn/callingx/notifications/NotificationReceiverActivity.kt +42 -0
- package/android/bin/src/main/java/io/getstream/rn/callingx/notifications/NotificationReceiverService.kt +56 -0
- package/android/bin/src/main/java/io/getstream/rn/callingx/notifications/NotificationsConfig.kt +116 -0
- package/android/bin/src/main/java/io/getstream/rn/callingx/repo/CallRepository.kt +163 -0
- package/android/bin/src/main/java/io/getstream/rn/callingx/repo/LegacyCallRepository.kt +134 -0
- package/android/bin/src/main/java/io/getstream/rn/callingx/repo/TelecomCallRepository.kt +438 -0
- package/android/bin/src/main/res/drawable/ic_phone_paused_24.xml +11 -0
- package/android/bin/src/main/res/drawable/ic_round_call_24.xml +11 -0
- package/android/bin/src/main/res/drawable/ic_user.xml +27 -0
- package/android/build.gradle +81 -0
- package/android/gradle.properties +5 -0
- package/android/src/main/AndroidManifest.xml +30 -0
- package/android/src/main/java/io/getstream/rn/callingx/CallService.kt +396 -0
- package/android/src/main/java/io/getstream/rn/callingx/CallingxModule.kt +639 -0
- package/android/src/main/java/io/getstream/rn/callingx/CallingxPackage.kt +16 -0
- package/android/src/main/java/io/getstream/rn/callingx/HeadlessTaskManager.kt +164 -0
- package/android/src/main/java/io/getstream/rn/callingx/ResourceUtils.kt +60 -0
- package/android/src/main/java/io/getstream/rn/callingx/Utils.kt +23 -0
- package/android/src/main/java/io/getstream/rn/callingx/model/Call.kt +57 -0
- package/android/src/main/java/io/getstream/rn/callingx/model/CallAction.kt +36 -0
- package/android/src/main/java/io/getstream/rn/callingx/notifications/CallNotificationManager.kt +215 -0
- package/android/src/main/java/io/getstream/rn/callingx/notifications/NotificationChannelsManager.kt +113 -0
- package/android/src/main/java/io/getstream/rn/callingx/notifications/NotificationIntentFactory.kt +105 -0
- package/android/src/main/java/io/getstream/rn/callingx/notifications/NotificationReceiverActivity.kt +42 -0
- package/android/src/main/java/io/getstream/rn/callingx/notifications/NotificationReceiverService.kt +56 -0
- package/android/src/main/java/io/getstream/rn/callingx/notifications/NotificationsConfig.kt +116 -0
- package/android/src/main/java/io/getstream/rn/callingx/repo/CallRepository.kt +163 -0
- package/android/src/main/java/io/getstream/rn/callingx/repo/LegacyCallRepository.kt +134 -0
- package/android/src/main/java/io/getstream/rn/callingx/repo/TelecomCallRepository.kt +438 -0
- package/android/src/main/res/drawable/ic_phone_paused_24.xml +11 -0
- package/android/src/main/res/drawable/ic_round_call_24.xml +11 -0
- package/android/src/main/res/drawable/ic_user.xml +27 -0
- package/dist/module/CallingxModule.js +191 -0
- package/dist/module/CallingxModule.js.map +1 -0
- package/dist/module/EventManager.js +40 -0
- package/dist/module/EventManager.js.map +1 -0
- package/dist/module/index.js +5 -0
- package/dist/module/index.js.map +1 -0
- package/dist/module/package.json +1 -0
- package/dist/module/spec/NativeCallingx.js +8 -0
- package/dist/module/spec/NativeCallingx.js.map +1 -0
- package/dist/module/types.js +4 -0
- package/dist/module/types.js.map +1 -0
- package/dist/module/utils/constants.js +48 -0
- package/dist/module/utils/constants.js.map +1 -0
- package/dist/module/utils/headlessTask.js +37 -0
- package/dist/module/utils/headlessTask.js.map +1 -0
- package/dist/module/utils/permissions.js +86 -0
- package/dist/module/utils/permissions.js.map +1 -0
- package/dist/module/utils/types.js +2 -0
- package/dist/module/utils/types.js.map +1 -0
- package/dist/module/utils/utils.js +6 -0
- package/dist/module/utils/utils.js.map +1 -0
- package/dist/typescript/package.json +1 -0
- package/dist/typescript/src/CallingxModule.d.ts +44 -0
- package/dist/typescript/src/CallingxModule.d.ts.map +1 -0
- package/dist/typescript/src/EventManager.d.ts +11 -0
- package/dist/typescript/src/EventManager.d.ts.map +1 -0
- package/dist/typescript/src/index.d.ts +3 -0
- package/dist/typescript/src/index.d.ts.map +1 -0
- package/dist/typescript/src/spec/NativeCallingx.d.ts +132 -0
- package/dist/typescript/src/spec/NativeCallingx.d.ts.map +1 -0
- package/dist/typescript/src/types.d.ts +249 -0
- package/dist/typescript/src/types.d.ts.map +1 -0
- package/dist/typescript/src/utils/constants.d.ts +8 -0
- package/dist/typescript/src/utils/constants.d.ts.map +1 -0
- package/dist/typescript/src/utils/headlessTask.d.ts +8 -0
- package/dist/typescript/src/utils/headlessTask.d.ts.map +1 -0
- package/dist/typescript/src/utils/permissions.d.ts +8 -0
- package/dist/typescript/src/utils/permissions.d.ts.map +1 -0
- package/dist/typescript/src/utils/types.d.ts +4 -0
- package/dist/typescript/src/utils/types.d.ts.map +1 -0
- package/dist/typescript/src/utils/utils.d.ts +2 -0
- package/dist/typescript/src/utils/utils.d.ts.map +1 -0
- package/ios/AudioSessionManager.swift +46 -0
- package/ios/Callingx.mm +280 -0
- package/ios/CallingxImpl.swift +744 -0
- package/ios/CallingxPublic.h +79 -0
- package/ios/Settings.swift +108 -0
- package/ios/UUIDStorage.swift +124 -0
- package/ios/VoipNotificationsManager.swift +180 -0
- package/package.json +112 -0
- package/react-native.config.js +8 -0
- package/src/CallingxModule.ts +321 -0
- package/src/EventManager.ts +61 -0
- package/src/index.ts +2 -0
- package/src/spec/NativeCallingx.ts +176 -0
- package/src/types.ts +323 -0
- package/src/utils/constants.ts +55 -0
- package/src/utils/headlessTask.ts +52 -0
- package/src/utils/permissions.ts +111 -0
- package/src/utils/types.ts +5 -0
- package/src/utils/utils.ts +6 -0
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
buildscript {
|
|
2
|
+
ext.getExtOrDefault = {name ->
|
|
3
|
+
return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties['Callingx_' + name]
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
repositories {
|
|
7
|
+
google()
|
|
8
|
+
mavenCentral()
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
dependencies {
|
|
12
|
+
classpath "com.android.tools.build:gradle:8.7.2"
|
|
13
|
+
// noinspection DifferentKotlinGradleVersion
|
|
14
|
+
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${getExtOrDefault('kotlinVersion')}"
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
apply plugin: "com.android.library"
|
|
20
|
+
apply plugin: "kotlin-android"
|
|
21
|
+
apply plugin: "kotlin-parcelize"
|
|
22
|
+
|
|
23
|
+
apply plugin: "com.facebook.react"
|
|
24
|
+
|
|
25
|
+
def getExtOrIntegerDefault(name) {
|
|
26
|
+
return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties["Callingx_" + name]).toInteger()
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
android {
|
|
30
|
+
namespace "io.getstream.rn.callingx"
|
|
31
|
+
|
|
32
|
+
compileSdkVersion getExtOrIntegerDefault("compileSdkVersion")
|
|
33
|
+
|
|
34
|
+
defaultConfig {
|
|
35
|
+
minSdkVersion getExtOrIntegerDefault("minSdkVersion")
|
|
36
|
+
targetSdkVersion getExtOrIntegerDefault("targetSdkVersion")
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
buildFeatures {
|
|
40
|
+
buildConfig true
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
buildTypes {
|
|
44
|
+
release {
|
|
45
|
+
minifyEnabled false
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
lint {
|
|
50
|
+
disable "GradleCompatible"
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
compileOptions {
|
|
54
|
+
sourceCompatibility JavaVersion.VERSION_11
|
|
55
|
+
targetCompatibility JavaVersion.VERSION_11
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
sourceSets {
|
|
59
|
+
main {
|
|
60
|
+
java.srcDirs += [
|
|
61
|
+
"generated/java",
|
|
62
|
+
"generated/jni",
|
|
63
|
+
"build/generated/source/codegen/java",
|
|
64
|
+
"build/generated/source/codegen/jni"
|
|
65
|
+
]
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
repositories {
|
|
71
|
+
mavenCentral()
|
|
72
|
+
google()
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
def kotlin_version = getExtOrDefault("kotlinVersion")
|
|
76
|
+
|
|
77
|
+
dependencies {
|
|
78
|
+
implementation "com.facebook.react:react-android"
|
|
79
|
+
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
|
80
|
+
implementation "androidx.core:core-telecom:1.0.1"
|
|
81
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
## This file must *NOT* be checked into Version Control Systems,
|
|
2
|
+
# as it contains information specific to your local configuration.
|
|
3
|
+
#
|
|
4
|
+
# Location of the SDK. This is only used by Gradle.
|
|
5
|
+
# For customization when using a Version Control System, please read the
|
|
6
|
+
# header note.
|
|
7
|
+
#Mon Dec 08 18:11:18 CET 2025
|
|
8
|
+
sdk.dir=/Users/greenfrvr/Library/Android/sdk
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
|
2
|
+
|
|
3
|
+
<uses-permission android:name="android.permission.MANAGE_OWN_CALLS" />
|
|
4
|
+
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
|
|
5
|
+
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
|
|
6
|
+
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_PHONE_CALL" />
|
|
7
|
+
<uses-permission android:name="android.permission.USE_FULL_SCREEN_INTENT" />
|
|
8
|
+
|
|
9
|
+
<application>
|
|
10
|
+
<activity
|
|
11
|
+
android:name="io.getstream.rn.callingx.notifications.NotificationReceiverActivity"
|
|
12
|
+
android:excludeFromRecents="true"
|
|
13
|
+
android:exported="false"
|
|
14
|
+
android:noHistory="true"
|
|
15
|
+
android:taskAffinity=""
|
|
16
|
+
android:theme="@android:style/Theme.Translucent.NoTitleBar" />
|
|
17
|
+
|
|
18
|
+
<service
|
|
19
|
+
android:name="io.getstream.rn.callingx.notifications.NotificationReceiverService"
|
|
20
|
+
android:exported="false" />
|
|
21
|
+
|
|
22
|
+
<service
|
|
23
|
+
android:name="io.getstream.rn.callingx.CallService"
|
|
24
|
+
android:enabled="true"
|
|
25
|
+
android:exported="false"
|
|
26
|
+
android:foregroundServiceType="phoneCall"
|
|
27
|
+
android:stopWithTask="true" />
|
|
28
|
+
|
|
29
|
+
</application>
|
|
30
|
+
</manifest>
|
|
@@ -0,0 +1,396 @@
|
|
|
1
|
+
package io.getstream.rn.callingx
|
|
2
|
+
|
|
3
|
+
import android.app.Service
|
|
4
|
+
import android.content.Intent
|
|
5
|
+
import android.content.pm.ServiceInfo
|
|
6
|
+
import android.net.Uri
|
|
7
|
+
import android.os.Binder
|
|
8
|
+
import android.os.Build
|
|
9
|
+
import android.os.Bundle
|
|
10
|
+
import android.os.IBinder
|
|
11
|
+
import android.telecom.DisconnectCause
|
|
12
|
+
import android.util.Log
|
|
13
|
+
import io.getstream.rn.callingx.model.Call
|
|
14
|
+
import io.getstream.rn.callingx.model.CallAction
|
|
15
|
+
import io.getstream.rn.callingx.notifications.CallNotificationManager
|
|
16
|
+
import io.getstream.rn.callingx.repo.CallRepository
|
|
17
|
+
import io.getstream.rn.callingx.repo.CallRepositoryFactory
|
|
18
|
+
import kotlinx.coroutines.CoroutineScope
|
|
19
|
+
import kotlinx.coroutines.SupervisorJob
|
|
20
|
+
import kotlinx.coroutines.cancel
|
|
21
|
+
import kotlinx.coroutines.launch
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* This service handles the app call logic (show notification, record mic, display audio, etc..). It
|
|
25
|
+
* can get started by the user or by an upcoming push notification to start a call.
|
|
26
|
+
*
|
|
27
|
+
* It holds the call scope used to register a call with the Telecom SDK in our
|
|
28
|
+
* TelecomCallRepository.
|
|
29
|
+
*
|
|
30
|
+
* When registering a call with the Telecom SDK and displaying a CallStyle notification, the SDK
|
|
31
|
+
* will grant you foreground service delegation so there is no need to make this a FGS.
|
|
32
|
+
*
|
|
33
|
+
* Note: you could potentially make this service run in a different process since audio or video
|
|
34
|
+
* calls can consume significant memory, although that would require more complex setup to make it
|
|
35
|
+
* work across multiple process.
|
|
36
|
+
*/
|
|
37
|
+
class CallService : Service(), CallRepository.Listener {
|
|
38
|
+
|
|
39
|
+
companion object {
|
|
40
|
+
private const val TAG = "[Callingx] CallService"
|
|
41
|
+
|
|
42
|
+
internal const val EXTRA_CALL_ID = "extra_call_id"
|
|
43
|
+
internal const val EXTRA_NAME = "extra_name"
|
|
44
|
+
internal const val EXTRA_URI = "extra_uri"
|
|
45
|
+
internal const val EXTRA_IS_VIDEO = "extra_is_video"
|
|
46
|
+
internal const val EXTRA_DISPLAY_TITLE = "displayTitle"
|
|
47
|
+
internal const val EXTRA_DISPLAY_SUBTITLE = "displaySubtitle"
|
|
48
|
+
internal const val EXTRA_DISPLAY_OPTIONS = "display_options"
|
|
49
|
+
// Background task extras
|
|
50
|
+
internal const val EXTRA_TASK_NAME = "task_name"
|
|
51
|
+
internal const val EXTRA_TASK_DATA = "task_data"
|
|
52
|
+
internal const val EXTRA_TASK_TIMEOUT = "task_timeout"
|
|
53
|
+
|
|
54
|
+
internal const val ACTION_INCOMING_CALL = "incoming_call"
|
|
55
|
+
internal const val ACTION_OUTGOING_CALL = "outgoing_call"
|
|
56
|
+
internal const val ACTION_UPDATE_CALL = "update_call"
|
|
57
|
+
internal const val ACTION_START_BACKGROUND_TASK = "start_background_task"
|
|
58
|
+
internal const val ACTION_STOP_BACKGROUND_TASK = "stop_background_task"
|
|
59
|
+
internal const val ACTION_STOP_SERVICE = "stop_service"
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
inner class CallServiceBinder : Binder() {
|
|
63
|
+
fun getService(): CallService = this@CallService
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
private lateinit var headlessJSManager: HeadlessTaskManager
|
|
67
|
+
private lateinit var notificationManager: CallNotificationManager
|
|
68
|
+
private lateinit var callRepository: CallRepository
|
|
69
|
+
|
|
70
|
+
private val binder = CallServiceBinder()
|
|
71
|
+
private val scope: CoroutineScope = CoroutineScope(SupervisorJob())
|
|
72
|
+
|
|
73
|
+
private var isInForeground = false
|
|
74
|
+
|
|
75
|
+
override fun onCreate() {
|
|
76
|
+
super.onCreate()
|
|
77
|
+
debugLog(TAG, "[service] onCreate: TelecomCallService created")
|
|
78
|
+
|
|
79
|
+
notificationManager = CallNotificationManager(applicationContext)
|
|
80
|
+
headlessJSManager = HeadlessTaskManager(applicationContext)
|
|
81
|
+
callRepository = CallRepositoryFactory.create(applicationContext)
|
|
82
|
+
callRepository.setListener(this)
|
|
83
|
+
|
|
84
|
+
sendBroadcastEvent(CallingxModule.SERVICE_READY_ACTION)
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
override fun onDestroy() {
|
|
88
|
+
super.onDestroy()
|
|
89
|
+
debugLog(TAG, "[service] onDestroy: TelecomCallService destroyed")
|
|
90
|
+
|
|
91
|
+
notificationManager.cancelNotifications()
|
|
92
|
+
notificationManager.stopRingtone()
|
|
93
|
+
callRepository.release()
|
|
94
|
+
headlessJSManager.release()
|
|
95
|
+
|
|
96
|
+
if (isInForeground) {
|
|
97
|
+
stopForeground(STOP_FOREGROUND_REMOVE)
|
|
98
|
+
isInForeground = false
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
scope.cancel()
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
override fun onTaskRemoved(rootIntent: Intent?) {
|
|
105
|
+
super.onTaskRemoved(rootIntent)
|
|
106
|
+
debugLog(TAG, "[service] onTaskRemoved: Task removed")
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int {
|
|
110
|
+
debugLog(TAG, "[service] onStartCommand: Received intent with action: ${intent?.action}")
|
|
111
|
+
|
|
112
|
+
if (intent == null || intent.action == null) {
|
|
113
|
+
Log.w(TAG, "[service] onStartCommand: Intent is null, returning START_NOT_STICKY")
|
|
114
|
+
return START_NOT_STICKY
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
when (intent.action) {
|
|
118
|
+
ACTION_INCOMING_CALL -> {
|
|
119
|
+
registerCall(intent, true)
|
|
120
|
+
}
|
|
121
|
+
ACTION_OUTGOING_CALL -> {
|
|
122
|
+
registerCall(intent, false)
|
|
123
|
+
}
|
|
124
|
+
ACTION_START_BACKGROUND_TASK -> {
|
|
125
|
+
if (!isInForeground) {
|
|
126
|
+
debugLog(TAG, "[service] onStartCommand: Starting foreground for background task")
|
|
127
|
+
// for now bg task is intended to be used after a call registered and
|
|
128
|
+
// notification is shown, so we don't need to show a separate notification for
|
|
129
|
+
// bg task
|
|
130
|
+
// startForeground(CallNotificationManager.NOTIFICATION_ID, notification)
|
|
131
|
+
// isInForeground = true
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
startBackgroundTask(intent)
|
|
135
|
+
}
|
|
136
|
+
ACTION_STOP_BACKGROUND_TASK -> {
|
|
137
|
+
stopBackgroundTask()
|
|
138
|
+
}
|
|
139
|
+
ACTION_UPDATE_CALL -> {
|
|
140
|
+
updateCall(intent)
|
|
141
|
+
}
|
|
142
|
+
else -> {
|
|
143
|
+
Log.e(TAG, "[service] onStartCommand: Unknown action: ${intent.action}")
|
|
144
|
+
stopSelf()
|
|
145
|
+
return START_NOT_STICKY
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
return START_STICKY
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
override fun onBind(intent: Intent): IBinder? = binder
|
|
153
|
+
|
|
154
|
+
override fun onUnbind(intent: Intent): Boolean {
|
|
155
|
+
debugLog(TAG, "[service] onUnbind: Service unbound")
|
|
156
|
+
return super.onUnbind(intent)
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
override fun onCallStateChanged(call: Call) {
|
|
160
|
+
debugLog(TAG, "[service] onCallStateChanged: Call state changed: ${call::class.simpleName}")
|
|
161
|
+
when (call) {
|
|
162
|
+
is Call.Registered -> {
|
|
163
|
+
debugLog(
|
|
164
|
+
TAG,
|
|
165
|
+
"[service] updateServiceState: Call registered - Active: ${call.isActive}, OnHold: ${call.isOnHold}, Muted: ${call.isMuted}"
|
|
166
|
+
)
|
|
167
|
+
|
|
168
|
+
if (call.isIncoming()) {
|
|
169
|
+
if (!call.isActive) notificationManager.startRingtone()
|
|
170
|
+
else notificationManager.stopRingtone()
|
|
171
|
+
}
|
|
172
|
+
// Update the call state.
|
|
173
|
+
if (isInForeground) {
|
|
174
|
+
notificationManager.updateCallNotification(call)
|
|
175
|
+
} else {
|
|
176
|
+
debugLog(
|
|
177
|
+
TAG,
|
|
178
|
+
"[service] updateServiceState: Fallback starting foreground for call: ${call.id}"
|
|
179
|
+
)
|
|
180
|
+
//fallback if for some reason startForeground method is not called in onStartCommand method
|
|
181
|
+
val notification = notificationManager.createNotification(call)
|
|
182
|
+
startForeground(CallNotificationManager.NOTIFICATION_ID, notification)
|
|
183
|
+
isInForeground = true
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
is Call.Unregistered -> {
|
|
187
|
+
notificationManager.updateCallNotification(call)
|
|
188
|
+
|
|
189
|
+
if (isInForeground) {
|
|
190
|
+
stopForeground(STOP_FOREGROUND_REMOVE)
|
|
191
|
+
isInForeground = false
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
notificationManager.stopRingtone()
|
|
195
|
+
stopSelf()
|
|
196
|
+
}
|
|
197
|
+
is Call.None -> {
|
|
198
|
+
notificationManager.updateCallNotification(call)
|
|
199
|
+
|
|
200
|
+
if (isInForeground) {
|
|
201
|
+
stopForeground(STOP_FOREGROUND_REMOVE)
|
|
202
|
+
isInForeground = false
|
|
203
|
+
}
|
|
204
|
+
notificationManager.stopRingtone()
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
override fun onIsCallAnswered(callId: String, source: CallRepository.EventSource) {
|
|
210
|
+
sendBroadcastEvent(CallingxModule.CALL_ANSWERED_ACTION) {
|
|
211
|
+
putExtra(CallingxModule.EXTRA_CALL_ID, callId)
|
|
212
|
+
putExtra(CallingxModule.EXTRA_SOURCE, source.name.lowercase())
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
override fun onIsCallDisconnected(
|
|
217
|
+
callId: String?,
|
|
218
|
+
cause: DisconnectCause,
|
|
219
|
+
source: CallRepository.EventSource
|
|
220
|
+
) {
|
|
221
|
+
// we're not passing the callId here to prevent infinite loops
|
|
222
|
+
// callEnd event with callId will sent only when after interaction with notification buttons
|
|
223
|
+
sendBroadcastEvent(CallingxModule.CALL_END_ACTION) {
|
|
224
|
+
if (callId != null) {
|
|
225
|
+
putExtra(CallingxModule.EXTRA_CALL_ID, callId)
|
|
226
|
+
}
|
|
227
|
+
putExtra(CallingxModule.EXTRA_DISCONNECT_CAUSE, getDisconnectCauseString(cause))
|
|
228
|
+
putExtra(CallingxModule.EXTRA_SOURCE, source.name.lowercase())
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
override fun onIsCallInactive(callId: String) {
|
|
233
|
+
sendBroadcastEvent(CallingxModule.CALL_INACTIVE_ACTION) {
|
|
234
|
+
putExtra(CallingxModule.EXTRA_CALL_ID, callId)
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
override fun onIsCallActive(callId: String) {
|
|
239
|
+
sendBroadcastEvent(CallingxModule.CALL_ACTIVE_ACTION) {
|
|
240
|
+
putExtra(CallingxModule.EXTRA_CALL_ID, callId)
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
override fun onCallRegistered(callId: String) {
|
|
245
|
+
sendBroadcastEvent(CallingxModule.CALL_REGISTERED_ACTION) {
|
|
246
|
+
putExtra(CallingxModule.EXTRA_CALL_ID, callId)
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
override fun onMuteCallChanged(callId: String, isMuted: Boolean) {
|
|
251
|
+
sendBroadcastEvent(CallingxModule.CALL_MUTED_ACTION) {
|
|
252
|
+
putExtra(CallingxModule.EXTRA_CALL_ID, callId)
|
|
253
|
+
putExtra(CallingxModule.EXTRA_MUTED, isMuted)
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
override fun onCallEndpointChanged(callId: String, endpoint: String) {
|
|
258
|
+
sendBroadcastEvent(CallingxModule.CALL_ENDPOINT_CHANGED_ACTION) {
|
|
259
|
+
putExtra(CallingxModule.EXTRA_CALL_ID, callId)
|
|
260
|
+
putExtra(CallingxModule.EXTRA_AUDIO_ENDPOINT, endpoint)
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
public fun isCallRegistered(callId: String): Boolean {
|
|
265
|
+
val currentCall = callRepository.currentCall.value
|
|
266
|
+
return currentCall is Call.Registered && currentCall.id == callId
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
public fun hasRegisteredCall(): Boolean {
|
|
270
|
+
val currentCall = callRepository.currentCall.value
|
|
271
|
+
return currentCall is Call.Registered
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
public fun processAction(callId: String, action: CallAction) {
|
|
275
|
+
debugLog(TAG, "[service] processAction: Processing action: ${action::class.simpleName}")
|
|
276
|
+
val currentCall = callRepository.currentCall.value
|
|
277
|
+
if (currentCall is Call.Registered && currentCall.id == callId) {
|
|
278
|
+
currentCall.processAction(action)
|
|
279
|
+
} else {
|
|
280
|
+
Log.e(
|
|
281
|
+
TAG,
|
|
282
|
+
"[service] processAction: Call not registered or not the current call, ignoring action"
|
|
283
|
+
)
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
public fun startBackgroundTask(intent: Intent) {
|
|
288
|
+
val taskName = intent.getStringExtra(EXTRA_TASK_NAME)!!
|
|
289
|
+
val data = intent.getBundleExtra(EXTRA_TASK_DATA)!!
|
|
290
|
+
val timeout = intent.getLongExtra(EXTRA_TASK_TIMEOUT, 0)
|
|
291
|
+
headlessJSManager.startHeadlessTask(taskName, data, timeout)
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
public fun stopBackgroundTask() {
|
|
295
|
+
headlessJSManager.stopHeadlessTask()
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
private fun registerCall(intent: Intent, incoming: Boolean) {
|
|
299
|
+
debugLog(TAG, "[service] registerCall: ${if (incoming) "in" else "out"} call")
|
|
300
|
+
|
|
301
|
+
// If we have an ongoing call ignore command
|
|
302
|
+
if (callRepository.currentCall.value is Call.Registered) {
|
|
303
|
+
Log.w(TAG, "[service] registerCall: Call already registered, ignoring new call request")
|
|
304
|
+
return
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
val callInfo = extractIntentParams(intent)
|
|
308
|
+
val tempCall = callRepository.getTempCall(callInfo, incoming)
|
|
309
|
+
|
|
310
|
+
//it is better to invoke startForeground method synchronously inside onStartCommand method
|
|
311
|
+
if (!isInForeground) {
|
|
312
|
+
debugLog(
|
|
313
|
+
TAG,
|
|
314
|
+
"[service] registerCall: Starting foreground for call: ${callInfo.callId}"
|
|
315
|
+
)
|
|
316
|
+
val notification = notificationManager.createNotification(tempCall)
|
|
317
|
+
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
|
|
318
|
+
startForeground(
|
|
319
|
+
CallNotificationManager.NOTIFICATION_ID,
|
|
320
|
+
notification,
|
|
321
|
+
ServiceInfo.FOREGROUND_SERVICE_TYPE_PHONE_CALL
|
|
322
|
+
)
|
|
323
|
+
} else {
|
|
324
|
+
startForeground(CallNotificationManager.NOTIFICATION_ID, notification)
|
|
325
|
+
}
|
|
326
|
+
isInForeground = true
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
scope.launch {
|
|
330
|
+
try {
|
|
331
|
+
callRepository.registerCall(
|
|
332
|
+
callInfo.callId,
|
|
333
|
+
callInfo.name,
|
|
334
|
+
callInfo.uri,
|
|
335
|
+
incoming,
|
|
336
|
+
callInfo.isVideo,
|
|
337
|
+
callInfo.displayOptions,
|
|
338
|
+
)
|
|
339
|
+
} catch (e: Exception) {
|
|
340
|
+
Log.e(TAG, "[service] registerCall: Error registering call: ${e.message}")
|
|
341
|
+
|
|
342
|
+
if (isInForeground) {
|
|
343
|
+
stopForeground(STOP_FOREGROUND_REMOVE)
|
|
344
|
+
isInForeground = false
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
notificationManager.cancelNotifications()
|
|
348
|
+
notificationManager.stopRingtone()
|
|
349
|
+
stopSelf()
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
private fun updateCall(intent: Intent) {
|
|
355
|
+
val callInfo = extractIntentParams(intent)
|
|
356
|
+
callRepository.updateCall(
|
|
357
|
+
callInfo.callId,
|
|
358
|
+
callInfo.name,
|
|
359
|
+
callInfo.uri,
|
|
360
|
+
callInfo.isVideo,
|
|
361
|
+
callInfo.displayOptions
|
|
362
|
+
)
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
private fun extractIntentParams(intent: Intent): CallInfo {
|
|
366
|
+
val callId = intent.getStringExtra(EXTRA_CALL_ID)!!
|
|
367
|
+
val name = intent.getStringExtra(EXTRA_NAME)!!
|
|
368
|
+
val uri =
|
|
369
|
+
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
|
|
370
|
+
intent.getParcelableExtra(EXTRA_URI, Uri::class.java)!!
|
|
371
|
+
} else {
|
|
372
|
+
@Suppress("DEPRECATION") intent.getParcelableExtra(EXTRA_URI)!!
|
|
373
|
+
}
|
|
374
|
+
val isVideo = intent.getBooleanExtra(EXTRA_IS_VIDEO, false)
|
|
375
|
+
val displayOptions = intent.getBundleExtra(EXTRA_DISPLAY_OPTIONS)
|
|
376
|
+
|
|
377
|
+
return CallInfo(callId, name, uri, isVideo, displayOptions)
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
private fun sendBroadcastEvent(action: String, applyParams: Intent.() -> Unit = {}) {
|
|
381
|
+
val intent =
|
|
382
|
+
Intent(action).apply {
|
|
383
|
+
setPackage(packageName)
|
|
384
|
+
applyParams(this)
|
|
385
|
+
}
|
|
386
|
+
sendBroadcast(intent)
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
data class CallInfo(
|
|
390
|
+
val callId: String,
|
|
391
|
+
val name: String,
|
|
392
|
+
val uri: Uri,
|
|
393
|
+
val isVideo: Boolean,
|
|
394
|
+
val displayOptions: Bundle?,
|
|
395
|
+
)
|
|
396
|
+
}
|