diff --git a/.editorconfig b/.editorconfig
index 140cc085c5..231d35cfe4 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -1,901 +1,901 @@
-[*]
-charset = utf-8
-end_of_line = lf
-indent_size = 4
-indent_style = space
-insert_final_newline = true
-max_line_length = 160
-tab_width = 4
-ij_continuation_indent_size = 8
-ij_formatter_off_tag = @formatter:off
-ij_formatter_on_tag = @formatter:on
-ij_formatter_tags_enabled = false
-ij_smart_tabs = false
-ij_visual_guides = none
-ij_wrap_on_typing = false
-
-[*.java]
-ij_java_align_consecutive_assignments = false
-ij_java_align_consecutive_variable_declarations = false
-ij_java_align_group_field_declarations = false
-ij_java_align_multiline_annotation_parameters = false
-ij_java_align_multiline_array_initializer_expression = false
-ij_java_align_multiline_assignment = false
-ij_java_align_multiline_binary_operation = false
-ij_java_align_multiline_chained_methods = false
-ij_java_align_multiline_extends_list = false
-ij_java_align_multiline_for = true
-ij_java_align_multiline_method_parentheses = false
-ij_java_align_multiline_parameters = true
-ij_java_align_multiline_parameters_in_calls = false
-ij_java_align_multiline_parenthesized_expression = false
-ij_java_align_multiline_records = true
-ij_java_align_multiline_resources = true
-ij_java_align_multiline_ternary_operation = false
-ij_java_align_multiline_text_blocks = false
-ij_java_align_multiline_throws_list = false
-ij_java_align_subsequent_simple_methods = false
-ij_java_align_throws_keyword = false
-ij_java_annotation_parameter_wrap = off
-ij_java_array_initializer_new_line_after_left_brace = false
-ij_java_array_initializer_right_brace_on_new_line = false
-ij_java_array_initializer_wrap = off
-ij_java_assert_statement_colon_on_next_line = false
-ij_java_assert_statement_wrap = off
-ij_java_assignment_wrap = off
-ij_java_binary_operation_sign_on_next_line = false
-ij_java_binary_operation_wrap = off
-ij_java_blank_lines_after_anonymous_class_header = 0
-ij_java_blank_lines_after_class_header = 0
-ij_java_blank_lines_after_imports = 1
-ij_java_blank_lines_after_package = 1
-ij_java_blank_lines_around_class = 1
-ij_java_blank_lines_around_field = 0
-ij_java_blank_lines_around_field_in_interface = 0
-ij_java_blank_lines_around_initializer = 1
-ij_java_blank_lines_around_method = 1
-ij_java_blank_lines_around_method_in_interface = 1
-ij_java_blank_lines_before_class_end = 0
-ij_java_blank_lines_before_imports = 1
-ij_java_blank_lines_before_method_body = 0
-ij_java_blank_lines_before_package = 0
-ij_java_block_brace_style = end_of_line
-ij_java_block_comment_at_first_column = true
-ij_java_builder_methods = none
-ij_java_call_parameters_new_line_after_left_paren = false
-ij_java_call_parameters_right_paren_on_new_line = false
-ij_java_call_parameters_wrap = off
-ij_java_case_statement_on_separate_line = true
-ij_java_catch_on_new_line = false
-ij_java_class_annotation_wrap = split_into_lines
-ij_java_class_brace_style = end_of_line
-ij_java_class_count_to_use_import_on_demand = 99
-ij_java_class_names_in_javadoc = 1
-ij_java_do_not_indent_top_level_class_members = false
-ij_java_do_not_wrap_after_single_annotation = false
-ij_java_do_while_brace_force = never
-ij_java_doc_add_blank_line_after_description = true
-ij_java_doc_add_blank_line_after_param_comments = false
-ij_java_doc_add_blank_line_after_return = false
-ij_java_doc_add_p_tag_on_empty_lines = true
-ij_java_doc_align_exception_comments = true
-ij_java_doc_align_param_comments = true
-ij_java_doc_do_not_wrap_if_one_line = false
-ij_java_doc_enable_formatting = true
-ij_java_doc_enable_leading_asterisks = true
-ij_java_doc_indent_on_continuation = false
-ij_java_doc_keep_empty_lines = true
-ij_java_doc_keep_empty_parameter_tag = true
-ij_java_doc_keep_empty_return_tag = true
-ij_java_doc_keep_empty_throws_tag = true
-ij_java_doc_keep_invalid_tags = true
-ij_java_doc_param_description_on_new_line = false
-ij_java_doc_preserve_line_breaks = false
-ij_java_doc_use_throws_not_exception_tag = true
-ij_java_else_on_new_line = false
-ij_java_enum_constants_wrap = off
-ij_java_extends_keyword_wrap = off
-ij_java_extends_list_wrap = off
-ij_java_field_annotation_wrap = split_into_lines
-ij_java_finally_on_new_line = false
-ij_java_for_brace_force = never
-ij_java_for_statement_new_line_after_left_paren = false
-ij_java_for_statement_right_paren_on_new_line = false
-ij_java_for_statement_wrap = off
-ij_java_generate_final_locals = false
-ij_java_generate_final_parameters = false
-ij_java_if_brace_force = never
-ij_java_imports_layout = $android.**,$androidx.**,$com.**,$junit.**,$net.**,$org.**,$java.**,$javax.**,$*,|,android.**,|,androidx.**,|,com.**,|,junit.**,|,net.**,|,org.**,|,java.**,|,javax.**,|,*,|
-ij_java_indent_case_from_switch = true
-ij_java_insert_inner_class_imports = false
-ij_java_insert_override_annotation = true
-ij_java_keep_blank_lines_before_right_brace = 2
-ij_java_keep_blank_lines_between_package_declaration_and_header = 2
-ij_java_keep_blank_lines_in_code = 2
-ij_java_keep_blank_lines_in_declarations = 2
-ij_java_keep_builder_methods_indents = false
-ij_java_keep_control_statement_in_one_line = true
-ij_java_keep_first_column_comment = true
-ij_java_keep_indents_on_empty_lines = false
-ij_java_keep_line_breaks = true
-ij_java_keep_multiple_expressions_in_one_line = false
-ij_java_keep_simple_blocks_in_one_line = false
-ij_java_keep_simple_classes_in_one_line = false
-ij_java_keep_simple_lambdas_in_one_line = false
-ij_java_keep_simple_methods_in_one_line = false
-ij_java_label_indent_absolute = false
-ij_java_label_indent_size = 0
-ij_java_lambda_brace_style = end_of_line
-ij_java_layout_static_imports_separately = true
-ij_java_line_comment_add_space = false
-ij_java_line_comment_at_first_column = true
-ij_java_method_annotation_wrap = split_into_lines
-ij_java_method_brace_style = end_of_line
-ij_java_method_call_chain_wrap = off
-ij_java_method_parameters_new_line_after_left_paren = false
-ij_java_method_parameters_right_paren_on_new_line = false
-ij_java_method_parameters_wrap = off
-ij_java_modifier_list_wrap = false
-ij_java_names_count_to_use_import_on_demand = 99
-ij_java_new_line_after_lparen_in_record_header = false
-ij_java_parameter_annotation_wrap = off
-ij_java_parentheses_expression_new_line_after_left_paren = false
-ij_java_parentheses_expression_right_paren_on_new_line = false
-ij_java_place_assignment_sign_on_next_line = false
-ij_java_prefer_longer_names = true
-ij_java_prefer_parameters_wrap = false
-ij_java_record_components_wrap = normal
-ij_java_repeat_synchronized = true
-ij_java_replace_instanceof_and_cast = false
-ij_java_replace_null_check = true
-ij_java_replace_sum_lambda_with_method_ref = true
-ij_java_resource_list_new_line_after_left_paren = false
-ij_java_resource_list_right_paren_on_new_line = false
-ij_java_resource_list_wrap = off
-ij_java_rparen_on_new_line_in_record_header = false
-ij_java_space_after_closing_angle_bracket_in_type_argument = false
-ij_java_space_after_colon = true
-ij_java_space_after_comma = true
-ij_java_space_after_comma_in_type_arguments = true
-ij_java_space_after_for_semicolon = true
-ij_java_space_after_quest = true
-ij_java_space_after_type_cast = true
-ij_java_space_before_annotation_array_initializer_left_brace = false
-ij_java_space_before_annotation_parameter_list = false
-ij_java_space_before_array_initializer_left_brace = false
-ij_java_space_before_catch_keyword = true
-ij_java_space_before_catch_left_brace = true
-ij_java_space_before_catch_parentheses = true
-ij_java_space_before_class_left_brace = true
-ij_java_space_before_colon = true
-ij_java_space_before_colon_in_foreach = true
-ij_java_space_before_comma = false
-ij_java_space_before_do_left_brace = true
-ij_java_space_before_else_keyword = true
-ij_java_space_before_else_left_brace = true
-ij_java_space_before_finally_keyword = true
-ij_java_space_before_finally_left_brace = true
-ij_java_space_before_for_left_brace = true
-ij_java_space_before_for_parentheses = true
-ij_java_space_before_for_semicolon = false
-ij_java_space_before_if_left_brace = true
-ij_java_space_before_if_parentheses = true
-ij_java_space_before_method_call_parentheses = false
-ij_java_space_before_method_left_brace = true
-ij_java_space_before_method_parentheses = false
-ij_java_space_before_opening_angle_bracket_in_type_parameter = false
-ij_java_space_before_quest = true
-ij_java_space_before_switch_left_brace = true
-ij_java_space_before_switch_parentheses = true
-ij_java_space_before_synchronized_left_brace = true
-ij_java_space_before_synchronized_parentheses = true
-ij_java_space_before_try_left_brace = true
-ij_java_space_before_try_parentheses = true
-ij_java_space_before_type_parameter_list = false
-ij_java_space_before_while_keyword = true
-ij_java_space_before_while_left_brace = true
-ij_java_space_before_while_parentheses = true
-ij_java_space_inside_one_line_enum_braces = false
-ij_java_space_within_empty_array_initializer_braces = false
-ij_java_space_within_empty_method_call_parentheses = false
-ij_java_space_within_empty_method_parentheses = false
-ij_java_spaces_around_additive_operators = true
-ij_java_spaces_around_assignment_operators = true
-ij_java_spaces_around_bitwise_operators = true
-ij_java_spaces_around_equality_operators = true
-ij_java_spaces_around_lambda_arrow = true
-ij_java_spaces_around_logical_operators = true
-ij_java_spaces_around_method_ref_dbl_colon = false
-ij_java_spaces_around_multiplicative_operators = true
-ij_java_spaces_around_relational_operators = true
-ij_java_spaces_around_shift_operators = true
-ij_java_spaces_around_type_bounds_in_type_parameters = true
-ij_java_spaces_around_unary_operator = false
-ij_java_spaces_within_angle_brackets = false
-ij_java_spaces_within_annotation_parentheses = false
-ij_java_spaces_within_array_initializer_braces = false
-ij_java_spaces_within_braces = false
-ij_java_spaces_within_brackets = false
-ij_java_spaces_within_cast_parentheses = false
-ij_java_spaces_within_catch_parentheses = false
-ij_java_spaces_within_for_parentheses = false
-ij_java_spaces_within_if_parentheses = false
-ij_java_spaces_within_method_call_parentheses = false
-ij_java_spaces_within_method_parentheses = false
-ij_java_spaces_within_parentheses = false
-ij_java_spaces_within_record_header = false
-ij_java_spaces_within_switch_parentheses = false
-ij_java_spaces_within_synchronized_parentheses = false
-ij_java_spaces_within_try_parentheses = false
-ij_java_spaces_within_while_parentheses = false
-ij_java_special_else_if_treatment = true
-ij_java_subclass_name_suffix = Impl
-ij_java_ternary_operation_signs_on_next_line = false
-ij_java_ternary_operation_wrap = off
-ij_java_test_name_suffix = Test
-ij_java_throws_keyword_wrap = off
-ij_java_throws_list_wrap = off
-ij_java_use_external_annotations = false
-ij_java_use_fq_class_names = false
-ij_java_use_relative_indents = false
-ij_java_use_single_class_imports = true
-ij_java_variable_annotation_wrap = off
-ij_java_visibility = public
-ij_java_while_brace_force = never
-ij_java_while_on_new_line = false
-ij_java_wrap_comments = false
-ij_java_wrap_first_method_in_call_chain = false
-ij_java_wrap_long_lines = false
-
-[*.properties]
-ij_properties_align_group_field_declarations = false
-ij_properties_keep_blank_lines = false
-ij_properties_key_value_delimiter = equals
-ij_properties_spaces_around_key_value_delimiter = false
-
-[.editorconfig]
-ij_editorconfig_align_group_field_declarations = false
-ij_editorconfig_space_after_colon = false
-ij_editorconfig_space_after_comma = true
-ij_editorconfig_space_before_colon = false
-ij_editorconfig_space_before_comma = false
-ij_editorconfig_spaces_around_assignment_operators = true
-
-[{*.ant,*.fxml,*.jhm,*.jnlp,*.jrxml,*.rng,*.tld,*.wsdl,*.xml,*.xsd,*.xsl,*.xslt,*.xul}]
-ij_continuation_indent_size = 4
-ij_xml_align_attributes = false
-ij_xml_align_text = false
-ij_xml_attribute_wrap = normal
-ij_xml_block_comment_at_first_column = true
-ij_xml_keep_blank_lines = 2
-ij_xml_keep_indents_on_empty_lines = false
-ij_xml_keep_line_breaks = false
-ij_xml_keep_line_breaks_in_text = true
-ij_xml_keep_whitespaces = false
-ij_xml_keep_whitespaces_around_cdata = preserve
-ij_xml_keep_whitespaces_inside_cdata = false
-ij_xml_line_comment_at_first_column = true
-ij_xml_space_after_tag_name = false
-ij_xml_space_around_equals_in_attribute = false
-ij_xml_space_inside_empty_tag = true
-ij_xml_text_wrap = normal
-ij_xml_use_custom_settings = true
-
-[{*.bash,*.sh,*.zsh}]
-indent_size = 2
-tab_width = 2
-ij_shell_binary_ops_start_line = false
-ij_shell_keep_column_alignment_padding = false
-ij_shell_minify_program = false
-ij_shell_redirect_followed_by_space = false
-ij_shell_switch_cases_indented = false
-ij_shell_use_unix_line_separator = true
-
-[{*.c,*.c++,*.cc,*.cp,*.cpp,*.cu,*.cuh,*.cxx,*.h,*.h++,*.hh,*.hp,*.hpp,*.hxx,*.i,*.icc,*.ii,*.inl,*.ino,*.ipp,*.m,*.mm,*.pch,*.tcc,*.tpp}]
-ij_c_add_brief_tag = false
-ij_c_add_getter_prefix = true
-ij_c_add_setter_prefix = true
-ij_c_align_dictionary_pair_values = false
-ij_c_align_group_field_declarations = false
-ij_c_align_init_list_in_columns = true
-ij_c_align_multiline_array_initializer_expression = true
-ij_c_align_multiline_assignment = true
-ij_c_align_multiline_binary_operation = true
-ij_c_align_multiline_chained_methods = false
-ij_c_align_multiline_for = true
-ij_c_align_multiline_ternary_operation = true
-ij_c_array_initializer_comma_on_next_line = false
-ij_c_array_initializer_new_line_after_left_brace = false
-ij_c_array_initializer_right_brace_on_new_line = false
-ij_c_array_initializer_wrap = normal
-ij_c_assignment_wrap = off
-ij_c_binary_operation_sign_on_next_line = false
-ij_c_binary_operation_wrap = normal
-ij_c_blank_lines_after_class_header = 0
-ij_c_blank_lines_after_imports = 1
-ij_c_blank_lines_around_class = 1
-ij_c_blank_lines_around_field = 0
-ij_c_blank_lines_around_field_in_interface = 0
-ij_c_blank_lines_around_method = 1
-ij_c_blank_lines_around_method_in_interface = 1
-ij_c_blank_lines_around_namespace = 0
-ij_c_blank_lines_around_properties_in_declaration = 0
-ij_c_blank_lines_around_properties_in_interface = 0
-ij_c_blank_lines_before_imports = 1
-ij_c_blank_lines_before_method_body = 0
-ij_c_block_brace_placement = end_of_line
-ij_c_block_brace_style = end_of_line
-ij_c_block_comment_at_first_column = true
-ij_c_catch_on_new_line = false
-ij_c_class_brace_style = end_of_line
-ij_c_class_constructor_init_list_align_multiline = true
-ij_c_class_constructor_init_list_comma_on_next_line = false
-ij_c_class_constructor_init_list_new_line_after_colon = never
-ij_c_class_constructor_init_list_new_line_before_colon = if_long
-ij_c_class_constructor_init_list_wrap = normal
-ij_c_copy_is_deep = false
-ij_c_create_interface_for_categories = true
-ij_c_declare_generated_methods = true
-ij_c_description_include_member_names = true
-ij_c_discharged_short_ternary_operator = false
-ij_c_do_not_add_breaks = false
-ij_c_do_while_brace_force = never
-ij_c_else_on_new_line = false
-ij_c_enum_constants_comma_on_next_line = false
-ij_c_enum_constants_wrap = on_every_item
-ij_c_for_brace_force = never
-ij_c_for_statement_new_line_after_left_paren = false
-ij_c_for_statement_right_paren_on_new_line = false
-ij_c_for_statement_wrap = off
-ij_c_function_brace_placement = end_of_line
-ij_c_function_call_arguments_align_multiline = true
-ij_c_function_call_arguments_align_multiline_pars = false
-ij_c_function_call_arguments_comma_on_next_line = false
-ij_c_function_call_arguments_new_line_after_lpar = false
-ij_c_function_call_arguments_new_line_before_rpar = false
-ij_c_function_call_arguments_wrap = normal
-ij_c_function_non_top_after_return_type_wrap = normal
-ij_c_function_parameters_align_multiline = true
-ij_c_function_parameters_align_multiline_pars = false
-ij_c_function_parameters_comma_on_next_line = false
-ij_c_function_parameters_new_line_after_lpar = false
-ij_c_function_parameters_new_line_before_rpar = false
-ij_c_function_parameters_wrap = normal
-ij_c_function_top_after_return_type_wrap = normal
-ij_c_generate_additional_eq_operators = true
-ij_c_generate_additional_rel_operators = true
-ij_c_generate_class_constructor = true
-ij_c_generate_comparison_operators_use_std_tie = false
-ij_c_generate_instance_variables_for_properties = ask
-ij_c_generate_operators_as_members = true
-ij_c_header_guard_style_pattern = ${PROJECT_NAME}_${FILE_NAME}_${EXT}
-ij_c_if_brace_force = never
-ij_c_in_line_short_ternary_operator = true
-ij_c_indent_block_comment = true
-ij_c_indent_c_struct_members = 4
-ij_c_indent_case_from_switch = true
-ij_c_indent_class_members = 4
-ij_c_indent_directive_as_code = false
-ij_c_indent_implementation_members = 0
-ij_c_indent_inside_code_block = 4
-ij_c_indent_interface_members = 0
-ij_c_indent_interface_members_except_ivars_block = false
-ij_c_indent_namespace_members = 4
-ij_c_indent_preprocessor_directive = 0
-ij_c_indent_visibility_keywords = 0
-ij_c_insert_override = true
-ij_c_insert_virtual_with_override = false
-ij_c_introduce_auto_vars = false
-ij_c_introduce_const_params = false
-ij_c_introduce_const_vars = false
-ij_c_introduce_generate_property = false
-ij_c_introduce_generate_synthesize = true
-ij_c_introduce_globals_to_header = true
-ij_c_introduce_prop_to_private_category = false
-ij_c_introduce_static_consts = true
-ij_c_introduce_use_ns_types = false
-ij_c_ivars_prefix = _
-ij_c_keep_blank_lines_before_end = 2
-ij_c_keep_blank_lines_before_right_brace = 2
-ij_c_keep_blank_lines_in_code = 2
-ij_c_keep_blank_lines_in_declarations = 2
-ij_c_keep_case_expressions_in_one_line = false
-ij_c_keep_control_statement_in_one_line = true
-ij_c_keep_directive_at_first_column = true
-ij_c_keep_first_column_comment = true
-ij_c_keep_line_breaks = true
-ij_c_keep_nested_namespaces_in_one_line = false
-ij_c_keep_simple_blocks_in_one_line = true
-ij_c_keep_simple_methods_in_one_line = true
-ij_c_keep_structures_in_one_line = false
-ij_c_lambda_capture_list_align_multiline = false
-ij_c_lambda_capture_list_align_multiline_bracket = false
-ij_c_lambda_capture_list_comma_on_next_line = false
-ij_c_lambda_capture_list_new_line_after_lbracket = false
-ij_c_lambda_capture_list_new_line_before_rbracket = false
-ij_c_lambda_capture_list_wrap = off
-ij_c_line_comment_add_space = false
-ij_c_line_comment_at_first_column = true
-ij_c_method_brace_placement = end_of_line
-ij_c_method_call_arguments_align_by_colons = true
-ij_c_method_call_arguments_align_multiline = false
-ij_c_method_call_arguments_special_dictionary_pairs_treatment = true
-ij_c_method_call_arguments_wrap = off
-ij_c_method_call_chain_wrap = off
-ij_c_method_parameters_align_by_colons = true
-ij_c_method_parameters_align_multiline = false
-ij_c_method_parameters_wrap = off
-ij_c_namespace_brace_placement = end_of_line
-ij_c_parentheses_expression_new_line_after_left_paren = false
-ij_c_parentheses_expression_right_paren_on_new_line = false
-ij_c_place_assignment_sign_on_next_line = false
-ij_c_property_nonatomic = true
-ij_c_put_ivars_to_implementation = true
-ij_c_refactor_compatibility_aliases_and_classes = true
-ij_c_refactor_properties_and_ivars = true
-ij_c_release_style = ivar
-ij_c_retain_object_parameters_in_constructor = true
-ij_c_semicolon_after_method_signature = false
-ij_c_shift_operation_align_multiline = true
-ij_c_shift_operation_wrap = normal
-ij_c_show_non_virtual_functions = false
-ij_c_space_after_colon = true
-ij_c_space_after_colon_in_selector = false
-ij_c_space_after_comma = true
-ij_c_space_after_cup_in_blocks = false
-ij_c_space_after_dictionary_literal_colon = true
-ij_c_space_after_for_semicolon = true
-ij_c_space_after_init_list_colon = true
-ij_c_space_after_method_parameter_type_parentheses = false
-ij_c_space_after_method_return_type_parentheses = false
-ij_c_space_after_pointer_in_declaration = false
-ij_c_space_after_quest = true
-ij_c_space_after_reference_in_declaration = false
-ij_c_space_after_reference_in_rvalue = false
-ij_c_space_after_structures_rbrace = true
-ij_c_space_after_superclass_colon = true
-ij_c_space_after_type_cast = true
-ij_c_space_after_visibility_sign_in_method_declaration = true
-ij_c_space_before_autorelease_pool_lbrace = true
-ij_c_space_before_catch_keyword = true
-ij_c_space_before_catch_left_brace = true
-ij_c_space_before_catch_parentheses = true
-ij_c_space_before_category_parentheses = true
-ij_c_space_before_chained_send_message = true
-ij_c_space_before_class_left_brace = true
-ij_c_space_before_colon = true
-ij_c_space_before_comma = false
-ij_c_space_before_dictionary_literal_colon = false
-ij_c_space_before_do_left_brace = true
-ij_c_space_before_else_keyword = true
-ij_c_space_before_else_left_brace = true
-ij_c_space_before_for_left_brace = true
-ij_c_space_before_for_parentheses = true
-ij_c_space_before_for_semicolon = false
-ij_c_space_before_if_left_brace = true
-ij_c_space_before_if_parentheses = true
-ij_c_space_before_init_list = false
-ij_c_space_before_init_list_colon = true
-ij_c_space_before_method_call_parentheses = false
-ij_c_space_before_method_left_brace = true
-ij_c_space_before_method_parentheses = false
-ij_c_space_before_namespace_lbrace = true
-ij_c_space_before_pointer_in_declaration = true
-ij_c_space_before_property_attributes_parentheses = false
-ij_c_space_before_protocols_brackets = true
-ij_c_space_before_quest = true
-ij_c_space_before_reference_in_declaration = true
-ij_c_space_before_superclass_colon = true
-ij_c_space_before_switch_left_brace = true
-ij_c_space_before_switch_parentheses = true
-ij_c_space_before_template_call_lt = false
-ij_c_space_before_template_declaration_lt = false
-ij_c_space_before_try_left_brace = true
-ij_c_space_before_while_keyword = true
-ij_c_space_before_while_left_brace = true
-ij_c_space_before_while_parentheses = true
-ij_c_space_between_adjacent_brackets = false
-ij_c_space_between_operator_and_punctuator = false
-ij_c_space_within_empty_array_initializer_braces = false
-ij_c_spaces_around_additive_operators = true
-ij_c_spaces_around_assignment_operators = true
-ij_c_spaces_around_bitwise_operators = true
-ij_c_spaces_around_equality_operators = true
-ij_c_spaces_around_lambda_arrow = true
-ij_c_spaces_around_logical_operators = true
-ij_c_spaces_around_multiplicative_operators = true
-ij_c_spaces_around_pm_operators = false
-ij_c_spaces_around_relational_operators = true
-ij_c_spaces_around_shift_operators = true
-ij_c_spaces_around_unary_operator = false
-ij_c_spaces_within_array_initializer_braces = false
-ij_c_spaces_within_braces = true
-ij_c_spaces_within_brackets = false
-ij_c_spaces_within_cast_parentheses = false
-ij_c_spaces_within_catch_parentheses = false
-ij_c_spaces_within_category_parentheses = false
-ij_c_spaces_within_empty_braces = false
-ij_c_spaces_within_empty_function_call_parentheses = false
-ij_c_spaces_within_empty_function_declaration_parentheses = false
-ij_c_spaces_within_empty_lambda_capture_list_bracket = false
-ij_c_spaces_within_empty_template_call_ltgt = false
-ij_c_spaces_within_empty_template_declaration_ltgt = false
-ij_c_spaces_within_for_parentheses = false
-ij_c_spaces_within_function_call_parentheses = false
-ij_c_spaces_within_function_declaration_parentheses = false
-ij_c_spaces_within_if_parentheses = false
-ij_c_spaces_within_lambda_capture_list_bracket = false
-ij_c_spaces_within_method_parameter_type_parentheses = false
-ij_c_spaces_within_method_return_type_parentheses = false
-ij_c_spaces_within_parentheses = false
-ij_c_spaces_within_property_attributes_parentheses = false
-ij_c_spaces_within_protocols_brackets = false
-ij_c_spaces_within_send_message_brackets = false
-ij_c_spaces_within_switch_parentheses = false
-ij_c_spaces_within_template_call_ltgt = false
-ij_c_spaces_within_template_declaration_ltgt = false
-ij_c_spaces_within_template_double_gt = true
-ij_c_spaces_within_while_parentheses = false
-ij_c_special_else_if_treatment = true
-ij_c_superclass_list_after_colon = never
-ij_c_superclass_list_align_multiline = true
-ij_c_superclass_list_before_colon = if_long
-ij_c_superclass_list_comma_on_next_line = false
-ij_c_superclass_list_wrap = on_every_item
-ij_c_tag_prefix_of_block_comment = at
-ij_c_tag_prefix_of_line_comment = back_slash
-ij_c_template_call_arguments_align_multiline = false
-ij_c_template_call_arguments_align_multiline_pars = false
-ij_c_template_call_arguments_comma_on_next_line = false
-ij_c_template_call_arguments_new_line_after_lt = false
-ij_c_template_call_arguments_new_line_before_gt = false
-ij_c_template_call_arguments_wrap = off
-ij_c_template_declaration_function_body_indent = false
-ij_c_template_declaration_function_wrap = split_into_lines
-ij_c_template_declaration_struct_body_indent = false
-ij_c_template_declaration_struct_wrap = split_into_lines
-ij_c_template_parameters_align_multiline = false
-ij_c_template_parameters_align_multiline_pars = false
-ij_c_template_parameters_comma_on_next_line = false
-ij_c_template_parameters_new_line_after_lt = false
-ij_c_template_parameters_new_line_before_gt = false
-ij_c_template_parameters_wrap = off
-ij_c_ternary_operation_signs_on_next_line = true
-ij_c_ternary_operation_wrap = normal
-ij_c_type_qualifiers_placement = before
-ij_c_use_modern_casts = true
-ij_c_use_setters_in_constructor = true
-ij_c_while_brace_force = never
-ij_c_while_on_new_line = false
-ij_c_wrap_property_declaration = off
-
-[{*.cmake,CMakeLists.txt}]
-ij_cmake_align_multiline_parameters_in_calls = false
-ij_cmake_force_commands_case = 2
-ij_cmake_keep_blank_lines_in_code = 2
-ij_cmake_space_before_for_parentheses = true
-ij_cmake_space_before_if_parentheses = true
-ij_cmake_space_before_method_call_parentheses = false
-ij_cmake_space_before_method_parentheses = false
-ij_cmake_space_before_while_parentheses = true
-ij_cmake_spaces_within_for_parentheses = false
-ij_cmake_spaces_within_if_parentheses = false
-ij_cmake_spaces_within_method_call_parentheses = false
-ij_cmake_spaces_within_method_parentheses = false
-ij_cmake_spaces_within_while_parentheses = false
-
-[{*.gant,*.gradle,*.groovy,*.gy}]
-ij_groovy_align_group_field_declarations = false
-ij_groovy_align_multiline_array_initializer_expression = false
-ij_groovy_align_multiline_assignment = false
-ij_groovy_align_multiline_binary_operation = false
-ij_groovy_align_multiline_chained_methods = false
-ij_groovy_align_multiline_extends_list = false
-ij_groovy_align_multiline_for = true
-ij_groovy_align_multiline_list_or_map = true
-ij_groovy_align_multiline_method_parentheses = false
-ij_groovy_align_multiline_parameters = true
-ij_groovy_align_multiline_parameters_in_calls = false
-ij_groovy_align_multiline_resources = true
-ij_groovy_align_multiline_ternary_operation = false
-ij_groovy_align_multiline_throws_list = false
-ij_groovy_align_named_args_in_map = true
-ij_groovy_align_throws_keyword = false
-ij_groovy_array_initializer_new_line_after_left_brace = false
-ij_groovy_array_initializer_right_brace_on_new_line = false
-ij_groovy_array_initializer_wrap = off
-ij_groovy_assert_statement_wrap = off
-ij_groovy_assignment_wrap = off
-ij_groovy_binary_operation_wrap = off
-ij_groovy_blank_lines_after_class_header = 0
-ij_groovy_blank_lines_after_imports = 1
-ij_groovy_blank_lines_after_package = 1
-ij_groovy_blank_lines_around_class = 1
-ij_groovy_blank_lines_around_field = 0
-ij_groovy_blank_lines_around_field_in_interface = 0
-ij_groovy_blank_lines_around_method = 1
-ij_groovy_blank_lines_around_method_in_interface = 1
-ij_groovy_blank_lines_before_imports = 1
-ij_groovy_blank_lines_before_method_body = 0
-ij_groovy_blank_lines_before_package = 0
-ij_groovy_block_brace_style = end_of_line
-ij_groovy_block_comment_at_first_column = true
-ij_groovy_call_parameters_new_line_after_left_paren = false
-ij_groovy_call_parameters_right_paren_on_new_line = false
-ij_groovy_call_parameters_wrap = off
-ij_groovy_catch_on_new_line = false
-ij_groovy_class_annotation_wrap = split_into_lines
-ij_groovy_class_brace_style = end_of_line
-ij_groovy_class_count_to_use_import_on_demand = 5
-ij_groovy_do_while_brace_force = never
-ij_groovy_else_on_new_line = false
-ij_groovy_enum_constants_wrap = off
-ij_groovy_extends_keyword_wrap = off
-ij_groovy_extends_list_wrap = off
-ij_groovy_field_annotation_wrap = split_into_lines
-ij_groovy_finally_on_new_line = false
-ij_groovy_for_brace_force = never
-ij_groovy_for_statement_new_line_after_left_paren = false
-ij_groovy_for_statement_right_paren_on_new_line = false
-ij_groovy_for_statement_wrap = off
-ij_groovy_if_brace_force = never
-ij_groovy_import_annotation_wrap = 2
-ij_groovy_imports_layout = *,|,javax.**,java.**,|,$*
-ij_groovy_indent_case_from_switch = true
-ij_groovy_indent_label_blocks = true
-ij_groovy_insert_inner_class_imports = false
-ij_groovy_keep_blank_lines_before_right_brace = 2
-ij_groovy_keep_blank_lines_in_code = 2
-ij_groovy_keep_blank_lines_in_declarations = 2
-ij_groovy_keep_control_statement_in_one_line = true
-ij_groovy_keep_first_column_comment = true
-ij_groovy_keep_indents_on_empty_lines = false
-ij_groovy_keep_line_breaks = true
-ij_groovy_keep_multiple_expressions_in_one_line = false
-ij_groovy_keep_simple_blocks_in_one_line = false
-ij_groovy_keep_simple_classes_in_one_line = true
-ij_groovy_keep_simple_lambdas_in_one_line = true
-ij_groovy_keep_simple_methods_in_one_line = true
-ij_groovy_label_indent_absolute = false
-ij_groovy_label_indent_size = 0
-ij_groovy_lambda_brace_style = end_of_line
-ij_groovy_layout_static_imports_separately = true
-ij_groovy_line_comment_add_space = false
-ij_groovy_line_comment_at_first_column = true
-ij_groovy_method_annotation_wrap = split_into_lines
-ij_groovy_method_brace_style = end_of_line
-ij_groovy_method_call_chain_wrap = off
-ij_groovy_method_parameters_new_line_after_left_paren = false
-ij_groovy_method_parameters_right_paren_on_new_line = false
-ij_groovy_method_parameters_wrap = off
-ij_groovy_modifier_list_wrap = false
-ij_groovy_names_count_to_use_import_on_demand = 3
-ij_groovy_parameter_annotation_wrap = off
-ij_groovy_parentheses_expression_new_line_after_left_paren = false
-ij_groovy_parentheses_expression_right_paren_on_new_line = false
-ij_groovy_prefer_parameters_wrap = false
-ij_groovy_resource_list_new_line_after_left_paren = false
-ij_groovy_resource_list_right_paren_on_new_line = false
-ij_groovy_resource_list_wrap = off
-ij_groovy_space_after_assert_separator = true
-ij_groovy_space_after_colon = true
-ij_groovy_space_after_comma = true
-ij_groovy_space_after_comma_in_type_arguments = true
-ij_groovy_space_after_for_semicolon = true
-ij_groovy_space_after_quest = true
-ij_groovy_space_after_type_cast = true
-ij_groovy_space_before_annotation_parameter_list = false
-ij_groovy_space_before_array_initializer_left_brace = false
-ij_groovy_space_before_assert_separator = false
-ij_groovy_space_before_catch_keyword = true
-ij_groovy_space_before_catch_left_brace = true
-ij_groovy_space_before_catch_parentheses = true
-ij_groovy_space_before_class_left_brace = true
-ij_groovy_space_before_closure_left_brace = true
-ij_groovy_space_before_colon = true
-ij_groovy_space_before_comma = false
-ij_groovy_space_before_do_left_brace = true
-ij_groovy_space_before_else_keyword = true
-ij_groovy_space_before_else_left_brace = true
-ij_groovy_space_before_finally_keyword = true
-ij_groovy_space_before_finally_left_brace = true
-ij_groovy_space_before_for_left_brace = true
-ij_groovy_space_before_for_parentheses = true
-ij_groovy_space_before_for_semicolon = false
-ij_groovy_space_before_if_left_brace = true
-ij_groovy_space_before_if_parentheses = true
-ij_groovy_space_before_method_call_parentheses = false
-ij_groovy_space_before_method_left_brace = true
-ij_groovy_space_before_method_parentheses = false
-ij_groovy_space_before_quest = true
-ij_groovy_space_before_switch_left_brace = true
-ij_groovy_space_before_switch_parentheses = true
-ij_groovy_space_before_synchronized_left_brace = true
-ij_groovy_space_before_synchronized_parentheses = true
-ij_groovy_space_before_try_left_brace = true
-ij_groovy_space_before_try_parentheses = true
-ij_groovy_space_before_while_keyword = true
-ij_groovy_space_before_while_left_brace = true
-ij_groovy_space_before_while_parentheses = true
-ij_groovy_space_in_named_argument = true
-ij_groovy_space_in_named_argument_before_colon = false
-ij_groovy_space_within_empty_array_initializer_braces = false
-ij_groovy_space_within_empty_method_call_parentheses = false
-ij_groovy_spaces_around_additive_operators = true
-ij_groovy_spaces_around_assignment_operators = true
-ij_groovy_spaces_around_bitwise_operators = true
-ij_groovy_spaces_around_equality_operators = true
-ij_groovy_spaces_around_lambda_arrow = true
-ij_groovy_spaces_around_logical_operators = true
-ij_groovy_spaces_around_multiplicative_operators = true
-ij_groovy_spaces_around_regex_operators = true
-ij_groovy_spaces_around_relational_operators = true
-ij_groovy_spaces_around_shift_operators = true
-ij_groovy_spaces_within_annotation_parentheses = false
-ij_groovy_spaces_within_array_initializer_braces = false
-ij_groovy_spaces_within_braces = true
-ij_groovy_spaces_within_brackets = false
-ij_groovy_spaces_within_cast_parentheses = false
-ij_groovy_spaces_within_catch_parentheses = false
-ij_groovy_spaces_within_for_parentheses = false
-ij_groovy_spaces_within_gstring_injection_braces = false
-ij_groovy_spaces_within_if_parentheses = false
-ij_groovy_spaces_within_list_or_map = false
-ij_groovy_spaces_within_method_call_parentheses = false
-ij_groovy_spaces_within_method_parentheses = false
-ij_groovy_spaces_within_parentheses = false
-ij_groovy_spaces_within_switch_parentheses = false
-ij_groovy_spaces_within_synchronized_parentheses = false
-ij_groovy_spaces_within_try_parentheses = false
-ij_groovy_spaces_within_tuple_expression = false
-ij_groovy_spaces_within_while_parentheses = false
-ij_groovy_special_else_if_treatment = true
-ij_groovy_ternary_operation_wrap = off
-ij_groovy_throws_keyword_wrap = off
-ij_groovy_throws_list_wrap = off
-ij_groovy_use_flying_geese_braces = false
-ij_groovy_use_fq_class_names = false
-ij_groovy_use_fq_class_names_in_javadoc = true
-ij_groovy_use_relative_indents = false
-ij_groovy_use_single_class_imports = true
-ij_groovy_variable_annotation_wrap = off
-ij_groovy_while_brace_force = never
-ij_groovy_while_on_new_line = false
-ij_groovy_wrap_long_lines = false
-
-[{*.gradle.kts,*.kt,*.kts,*.main.kts}]
-ij_kotlin_align_in_columns_case_branch = true
-ij_kotlin_align_multiline_binary_operation = false
-ij_kotlin_align_multiline_extends_list = false
-ij_kotlin_align_multiline_method_parentheses = false
-ij_kotlin_align_multiline_parameters = true
-ij_kotlin_align_multiline_parameters_in_calls = false
-ij_kotlin_allow_trailing_comma = false
-ij_kotlin_allow_trailing_comma_on_call_site = false
-ij_kotlin_assignment_wrap = off
-ij_kotlin_blank_lines_after_class_header = 0
-ij_kotlin_blank_lines_around_block_when_branches = 0
-ij_kotlin_blank_lines_before_declaration_with_comment_or_annotation_on_separate_line = 1
-ij_kotlin_block_comment_at_first_column = true
-ij_kotlin_call_parameters_new_line_after_left_paren = false
-ij_kotlin_call_parameters_right_paren_on_new_line = false
-ij_kotlin_call_parameters_wrap = off
-ij_kotlin_catch_on_new_line = false
-ij_kotlin_class_annotation_wrap = off
-ij_kotlin_code_style_defaults = KOTLIN_OFFICIAL
-ij_kotlin_continuation_indent_for_chained_calls = true
-ij_kotlin_continuation_indent_for_expression_bodies = true
-ij_kotlin_continuation_indent_in_argument_lists = true
-ij_kotlin_continuation_indent_in_elvis = true
-ij_kotlin_continuation_indent_in_if_conditions = true
-ij_kotlin_continuation_indent_in_parameter_lists = true
-ij_kotlin_continuation_indent_in_supertype_lists = true
-ij_kotlin_else_on_new_line = false
-ij_kotlin_enum_constants_wrap = off
-ij_kotlin_extends_list_wrap = off
-ij_kotlin_field_annotation_wrap = normal
-ij_kotlin_finally_on_new_line = false
-ij_kotlin_if_rparen_on_new_line = false
-ij_kotlin_import_nested_classes = false
-ij_kotlin_imports_layout = *,java.**,javax.**,kotlin.**,^
-ij_kotlin_insert_whitespaces_in_simple_one_line_method = true
-ij_kotlin_keep_blank_lines_before_right_brace = 0
-ij_kotlin_keep_blank_lines_in_code = 1
-ij_kotlin_keep_blank_lines_in_declarations = 1
-ij_kotlin_keep_first_column_comment = true
-ij_kotlin_keep_indents_on_empty_lines = false
-ij_kotlin_keep_line_breaks = true
-ij_kotlin_lbrace_on_next_line = false
-ij_kotlin_line_comment_add_space = false
-ij_kotlin_line_comment_at_first_column = true
-ij_kotlin_method_annotation_wrap = split_into_lines
-ij_kotlin_method_call_chain_wrap = off
-ij_kotlin_method_parameters_new_line_after_left_paren = false
-ij_kotlin_method_parameters_right_paren_on_new_line = false
-ij_kotlin_method_parameters_wrap = off
-ij_kotlin_name_count_to_use_star_import = 2147483647
-ij_kotlin_name_count_to_use_star_import_for_members = 2147483647
-ij_kotlin_packages_to_use_import_on_demand = kotlinx.android.synthetic.**
-ij_kotlin_parameter_annotation_wrap = off
-ij_kotlin_space_after_comma = true
-ij_kotlin_space_after_extend_colon = true
-ij_kotlin_space_after_type_colon = true
-ij_kotlin_space_before_catch_parentheses = true
-ij_kotlin_space_before_comma = false
-ij_kotlin_space_before_extend_colon = true
-ij_kotlin_space_before_for_parentheses = true
-ij_kotlin_space_before_if_parentheses = true
-ij_kotlin_space_before_lambda_arrow = true
-ij_kotlin_space_before_type_colon = false
-ij_kotlin_space_before_when_parentheses = true
-ij_kotlin_space_before_while_parentheses = true
-ij_kotlin_spaces_around_additive_operators = true
-ij_kotlin_spaces_around_assignment_operators = true
-ij_kotlin_spaces_around_equality_operators = true
-ij_kotlin_spaces_around_function_type_arrow = true
-ij_kotlin_spaces_around_logical_operators = true
-ij_kotlin_spaces_around_multiplicative_operators = true
-ij_kotlin_spaces_around_range = false
-ij_kotlin_spaces_around_relational_operators = true
-ij_kotlin_spaces_around_unary_operator = false
-ij_kotlin_spaces_around_when_arrow = true
-ij_kotlin_use_custom_formatting_for_modifiers = true
-ij_kotlin_variable_annotation_wrap = off
-ij_kotlin_while_on_new_line = false
-ij_kotlin_wrap_elvis_expressions = 1
-ij_kotlin_wrap_expression_body_functions = 0
-ij_kotlin_wrap_first_method_in_call_chain = false
-
-[{*.har,*.json}]
-indent_size = 2
-ij_json_keep_blank_lines_in_code = 0
-ij_json_keep_indents_on_empty_lines = false
-ij_json_keep_line_breaks = true
-ij_json_space_after_colon = true
-ij_json_space_after_comma = true
-ij_json_space_before_colon = true
-ij_json_space_before_comma = false
-ij_json_spaces_within_braces = false
-ij_json_spaces_within_brackets = false
-ij_json_wrap_long_lines = false
-
-[{*.htm,*.html,*.sht,*.shtm,*.shtml}]
-ij_html_add_new_line_before_tags = body,div,p,form,h1,h2,h3
-ij_html_align_attributes = true
-ij_html_align_text = false
-ij_html_attribute_wrap = normal
-ij_html_block_comment_at_first_column = true
-ij_html_do_not_align_children_of_min_lines = 0
-ij_html_do_not_break_if_inline_tags = title,h1,h2,h3,h4,h5,h6,p
-ij_html_do_not_indent_children_of_tags = html,body,thead,tbody,tfoot
-ij_html_enforce_quotes = false
-ij_html_inline_tags = a,abbr,acronym,b,basefont,bdo,big,br,cite,cite,code,dfn,em,font,i,img,input,kbd,label,q,s,samp,select,small,span,strike,strong,sub,sup,textarea,tt,u,var
-ij_html_keep_blank_lines = 2
-ij_html_keep_indents_on_empty_lines = false
-ij_html_keep_line_breaks = true
-ij_html_keep_line_breaks_in_text = true
-ij_html_keep_whitespaces = false
-ij_html_keep_whitespaces_inside = span,pre,textarea
-ij_html_line_comment_at_first_column = true
-ij_html_new_line_after_last_attribute = never
-ij_html_new_line_before_first_attribute = never
-ij_html_quote_style = double
-ij_html_remove_new_line_before_tags = br
-ij_html_space_after_tag_name = false
-ij_html_space_around_equality_in_attribute = false
-ij_html_space_inside_empty_tag = false
-ij_html_text_wrap = normal
-ij_html_uniform_ident = false
-
-[{*.yaml,*.yml}]
-indent_size = 2
-ij_yaml_align_values_properties = do_not_align
-ij_yaml_autoinsert_sequence_marker = true
-ij_yaml_block_mapping_on_new_line = false
-ij_yaml_indent_sequence_value = true
-ij_yaml_keep_indents_on_empty_lines = false
-ij_yaml_keep_line_breaks = true
-ij_yaml_sequence_on_new_line = false
-ij_yaml_space_before_colon = false
-ij_yaml_spaces_within_braces = true
-ij_yaml_spaces_within_brackets = true
+[*]
+charset = utf-8
+end_of_line = lf
+indent_size = 4
+indent_style = space
+insert_final_newline = true
+max_line_length = 160
+tab_width = 4
+ij_continuation_indent_size = 8
+ij_formatter_off_tag = @formatter:off
+ij_formatter_on_tag = @formatter:on
+ij_formatter_tags_enabled = false
+ij_smart_tabs = false
+ij_visual_guides = none
+ij_wrap_on_typing = false
+
+[*.java]
+ij_java_align_consecutive_assignments = false
+ij_java_align_consecutive_variable_declarations = false
+ij_java_align_group_field_declarations = false
+ij_java_align_multiline_annotation_parameters = false
+ij_java_align_multiline_array_initializer_expression = false
+ij_java_align_multiline_assignment = false
+ij_java_align_multiline_binary_operation = false
+ij_java_align_multiline_chained_methods = false
+ij_java_align_multiline_extends_list = false
+ij_java_align_multiline_for = true
+ij_java_align_multiline_method_parentheses = false
+ij_java_align_multiline_parameters = true
+ij_java_align_multiline_parameters_in_calls = false
+ij_java_align_multiline_parenthesized_expression = false
+ij_java_align_multiline_records = true
+ij_java_align_multiline_resources = true
+ij_java_align_multiline_ternary_operation = false
+ij_java_align_multiline_text_blocks = false
+ij_java_align_multiline_throws_list = false
+ij_java_align_subsequent_simple_methods = false
+ij_java_align_throws_keyword = false
+ij_java_annotation_parameter_wrap = off
+ij_java_array_initializer_new_line_after_left_brace = false
+ij_java_array_initializer_right_brace_on_new_line = false
+ij_java_array_initializer_wrap = off
+ij_java_assert_statement_colon_on_next_line = false
+ij_java_assert_statement_wrap = off
+ij_java_assignment_wrap = off
+ij_java_binary_operation_sign_on_next_line = false
+ij_java_binary_operation_wrap = off
+ij_java_blank_lines_after_anonymous_class_header = 0
+ij_java_blank_lines_after_class_header = 0
+ij_java_blank_lines_after_imports = 1
+ij_java_blank_lines_after_package = 1
+ij_java_blank_lines_around_class = 1
+ij_java_blank_lines_around_field = 0
+ij_java_blank_lines_around_field_in_interface = 0
+ij_java_blank_lines_around_initializer = 1
+ij_java_blank_lines_around_method = 1
+ij_java_blank_lines_around_method_in_interface = 1
+ij_java_blank_lines_before_class_end = 0
+ij_java_blank_lines_before_imports = 1
+ij_java_blank_lines_before_method_body = 0
+ij_java_blank_lines_before_package = 0
+ij_java_block_brace_style = end_of_line
+ij_java_block_comment_at_first_column = true
+ij_java_builder_methods = none
+ij_java_call_parameters_new_line_after_left_paren = false
+ij_java_call_parameters_right_paren_on_new_line = false
+ij_java_call_parameters_wrap = off
+ij_java_case_statement_on_separate_line = true
+ij_java_catch_on_new_line = false
+ij_java_class_annotation_wrap = split_into_lines
+ij_java_class_brace_style = end_of_line
+ij_java_class_count_to_use_import_on_demand = 99
+ij_java_class_names_in_javadoc = 1
+ij_java_do_not_indent_top_level_class_members = false
+ij_java_do_not_wrap_after_single_annotation = false
+ij_java_do_while_brace_force = never
+ij_java_doc_add_blank_line_after_description = true
+ij_java_doc_add_blank_line_after_param_comments = false
+ij_java_doc_add_blank_line_after_return = false
+ij_java_doc_add_p_tag_on_empty_lines = true
+ij_java_doc_align_exception_comments = true
+ij_java_doc_align_param_comments = true
+ij_java_doc_do_not_wrap_if_one_line = false
+ij_java_doc_enable_formatting = true
+ij_java_doc_enable_leading_asterisks = true
+ij_java_doc_indent_on_continuation = false
+ij_java_doc_keep_empty_lines = true
+ij_java_doc_keep_empty_parameter_tag = true
+ij_java_doc_keep_empty_return_tag = true
+ij_java_doc_keep_empty_throws_tag = true
+ij_java_doc_keep_invalid_tags = true
+ij_java_doc_param_description_on_new_line = false
+ij_java_doc_preserve_line_breaks = false
+ij_java_doc_use_throws_not_exception_tag = true
+ij_java_else_on_new_line = false
+ij_java_enum_constants_wrap = off
+ij_java_extends_keyword_wrap = off
+ij_java_extends_list_wrap = off
+ij_java_field_annotation_wrap = split_into_lines
+ij_java_finally_on_new_line = false
+ij_java_for_brace_force = never
+ij_java_for_statement_new_line_after_left_paren = false
+ij_java_for_statement_right_paren_on_new_line = false
+ij_java_for_statement_wrap = off
+ij_java_generate_final_locals = false
+ij_java_generate_final_parameters = false
+ij_java_if_brace_force = never
+ij_java_imports_layout = $android.**,$androidx.**,$com.**,$junit.**,$net.**,$org.**,$java.**,$javax.**,$*,|,android.**,|,androidx.**,|,com.**,|,junit.**,|,net.**,|,org.**,|,java.**,|,javax.**,|,*,|
+ij_java_indent_case_from_switch = true
+ij_java_insert_inner_class_imports = false
+ij_java_insert_override_annotation = true
+ij_java_keep_blank_lines_before_right_brace = 2
+ij_java_keep_blank_lines_between_package_declaration_and_header = 2
+ij_java_keep_blank_lines_in_code = 2
+ij_java_keep_blank_lines_in_declarations = 2
+ij_java_keep_builder_methods_indents = false
+ij_java_keep_control_statement_in_one_line = true
+ij_java_keep_first_column_comment = true
+ij_java_keep_indents_on_empty_lines = false
+ij_java_keep_line_breaks = true
+ij_java_keep_multiple_expressions_in_one_line = false
+ij_java_keep_simple_blocks_in_one_line = false
+ij_java_keep_simple_classes_in_one_line = false
+ij_java_keep_simple_lambdas_in_one_line = false
+ij_java_keep_simple_methods_in_one_line = false
+ij_java_label_indent_absolute = false
+ij_java_label_indent_size = 0
+ij_java_lambda_brace_style = end_of_line
+ij_java_layout_static_imports_separately = true
+ij_java_line_comment_add_space = false
+ij_java_line_comment_at_first_column = true
+ij_java_method_annotation_wrap = split_into_lines
+ij_java_method_brace_style = end_of_line
+ij_java_method_call_chain_wrap = off
+ij_java_method_parameters_new_line_after_left_paren = false
+ij_java_method_parameters_right_paren_on_new_line = false
+ij_java_method_parameters_wrap = off
+ij_java_modifier_list_wrap = false
+ij_java_names_count_to_use_import_on_demand = 99
+ij_java_new_line_after_lparen_in_record_header = false
+ij_java_parameter_annotation_wrap = off
+ij_java_parentheses_expression_new_line_after_left_paren = false
+ij_java_parentheses_expression_right_paren_on_new_line = false
+ij_java_place_assignment_sign_on_next_line = false
+ij_java_prefer_longer_names = true
+ij_java_prefer_parameters_wrap = false
+ij_java_record_components_wrap = normal
+ij_java_repeat_synchronized = true
+ij_java_replace_instanceof_and_cast = false
+ij_java_replace_null_check = true
+ij_java_replace_sum_lambda_with_method_ref = true
+ij_java_resource_list_new_line_after_left_paren = false
+ij_java_resource_list_right_paren_on_new_line = false
+ij_java_resource_list_wrap = off
+ij_java_rparen_on_new_line_in_record_header = false
+ij_java_space_after_closing_angle_bracket_in_type_argument = false
+ij_java_space_after_colon = true
+ij_java_space_after_comma = true
+ij_java_space_after_comma_in_type_arguments = true
+ij_java_space_after_for_semicolon = true
+ij_java_space_after_quest = true
+ij_java_space_after_type_cast = true
+ij_java_space_before_annotation_array_initializer_left_brace = false
+ij_java_space_before_annotation_parameter_list = false
+ij_java_space_before_array_initializer_left_brace = false
+ij_java_space_before_catch_keyword = true
+ij_java_space_before_catch_left_brace = true
+ij_java_space_before_catch_parentheses = true
+ij_java_space_before_class_left_brace = true
+ij_java_space_before_colon = true
+ij_java_space_before_colon_in_foreach = true
+ij_java_space_before_comma = false
+ij_java_space_before_do_left_brace = true
+ij_java_space_before_else_keyword = true
+ij_java_space_before_else_left_brace = true
+ij_java_space_before_finally_keyword = true
+ij_java_space_before_finally_left_brace = true
+ij_java_space_before_for_left_brace = true
+ij_java_space_before_for_parentheses = true
+ij_java_space_before_for_semicolon = false
+ij_java_space_before_if_left_brace = true
+ij_java_space_before_if_parentheses = true
+ij_java_space_before_method_call_parentheses = false
+ij_java_space_before_method_left_brace = true
+ij_java_space_before_method_parentheses = false
+ij_java_space_before_opening_angle_bracket_in_type_parameter = false
+ij_java_space_before_quest = true
+ij_java_space_before_switch_left_brace = true
+ij_java_space_before_switch_parentheses = true
+ij_java_space_before_synchronized_left_brace = true
+ij_java_space_before_synchronized_parentheses = true
+ij_java_space_before_try_left_brace = true
+ij_java_space_before_try_parentheses = true
+ij_java_space_before_type_parameter_list = false
+ij_java_space_before_while_keyword = true
+ij_java_space_before_while_left_brace = true
+ij_java_space_before_while_parentheses = true
+ij_java_space_inside_one_line_enum_braces = false
+ij_java_space_within_empty_array_initializer_braces = false
+ij_java_space_within_empty_method_call_parentheses = false
+ij_java_space_within_empty_method_parentheses = false
+ij_java_spaces_around_additive_operators = true
+ij_java_spaces_around_assignment_operators = true
+ij_java_spaces_around_bitwise_operators = true
+ij_java_spaces_around_equality_operators = true
+ij_java_spaces_around_lambda_arrow = true
+ij_java_spaces_around_logical_operators = true
+ij_java_spaces_around_method_ref_dbl_colon = false
+ij_java_spaces_around_multiplicative_operators = true
+ij_java_spaces_around_relational_operators = true
+ij_java_spaces_around_shift_operators = true
+ij_java_spaces_around_type_bounds_in_type_parameters = true
+ij_java_spaces_around_unary_operator = false
+ij_java_spaces_within_angle_brackets = false
+ij_java_spaces_within_annotation_parentheses = false
+ij_java_spaces_within_array_initializer_braces = false
+ij_java_spaces_within_braces = false
+ij_java_spaces_within_brackets = false
+ij_java_spaces_within_cast_parentheses = false
+ij_java_spaces_within_catch_parentheses = false
+ij_java_spaces_within_for_parentheses = false
+ij_java_spaces_within_if_parentheses = false
+ij_java_spaces_within_method_call_parentheses = false
+ij_java_spaces_within_method_parentheses = false
+ij_java_spaces_within_parentheses = false
+ij_java_spaces_within_record_header = false
+ij_java_spaces_within_switch_parentheses = false
+ij_java_spaces_within_synchronized_parentheses = false
+ij_java_spaces_within_try_parentheses = false
+ij_java_spaces_within_while_parentheses = false
+ij_java_special_else_if_treatment = true
+ij_java_subclass_name_suffix = Impl
+ij_java_ternary_operation_signs_on_next_line = false
+ij_java_ternary_operation_wrap = off
+ij_java_test_name_suffix = Test
+ij_java_throws_keyword_wrap = off
+ij_java_throws_list_wrap = off
+ij_java_use_external_annotations = false
+ij_java_use_fq_class_names = false
+ij_java_use_relative_indents = false
+ij_java_use_single_class_imports = true
+ij_java_variable_annotation_wrap = off
+ij_java_visibility = public
+ij_java_while_brace_force = never
+ij_java_while_on_new_line = false
+ij_java_wrap_comments = false
+ij_java_wrap_first_method_in_call_chain = false
+ij_java_wrap_long_lines = false
+
+[*.properties]
+ij_properties_align_group_field_declarations = false
+ij_properties_keep_blank_lines = false
+ij_properties_key_value_delimiter = equals
+ij_properties_spaces_around_key_value_delimiter = false
+
+[.editorconfig]
+ij_editorconfig_align_group_field_declarations = false
+ij_editorconfig_space_after_colon = false
+ij_editorconfig_space_after_comma = true
+ij_editorconfig_space_before_colon = false
+ij_editorconfig_space_before_comma = false
+ij_editorconfig_spaces_around_assignment_operators = true
+
+[{*.ant,*.fxml,*.jhm,*.jnlp,*.jrxml,*.rng,*.tld,*.wsdl,*.xml,*.xsd,*.xsl,*.xslt,*.xul}]
+ij_continuation_indent_size = 4
+ij_xml_align_attributes = false
+ij_xml_align_text = false
+ij_xml_attribute_wrap = normal
+ij_xml_block_comment_at_first_column = true
+ij_xml_keep_blank_lines = 2
+ij_xml_keep_indents_on_empty_lines = false
+ij_xml_keep_line_breaks = false
+ij_xml_keep_line_breaks_in_text = true
+ij_xml_keep_whitespaces = false
+ij_xml_keep_whitespaces_around_cdata = preserve
+ij_xml_keep_whitespaces_inside_cdata = false
+ij_xml_line_comment_at_first_column = true
+ij_xml_space_after_tag_name = false
+ij_xml_space_around_equals_in_attribute = false
+ij_xml_space_inside_empty_tag = true
+ij_xml_text_wrap = normal
+ij_xml_use_custom_settings = true
+
+[{*.bash,*.sh,*.zsh}]
+indent_size = 2
+tab_width = 2
+ij_shell_binary_ops_start_line = false
+ij_shell_keep_column_alignment_padding = false
+ij_shell_minify_program = false
+ij_shell_redirect_followed_by_space = false
+ij_shell_switch_cases_indented = false
+ij_shell_use_unix_line_separator = true
+
+[{*.c,*.c++,*.cc,*.cp,*.cpp,*.cu,*.cuh,*.cxx,*.h,*.h++,*.hh,*.hp,*.hpp,*.hxx,*.i,*.icc,*.ii,*.inl,*.ino,*.ipp,*.m,*.mm,*.pch,*.tcc,*.tpp}]
+ij_c_add_brief_tag = false
+ij_c_add_getter_prefix = true
+ij_c_add_setter_prefix = true
+ij_c_align_dictionary_pair_values = false
+ij_c_align_group_field_declarations = false
+ij_c_align_init_list_in_columns = true
+ij_c_align_multiline_array_initializer_expression = true
+ij_c_align_multiline_assignment = true
+ij_c_align_multiline_binary_operation = true
+ij_c_align_multiline_chained_methods = false
+ij_c_align_multiline_for = true
+ij_c_align_multiline_ternary_operation = true
+ij_c_array_initializer_comma_on_next_line = false
+ij_c_array_initializer_new_line_after_left_brace = false
+ij_c_array_initializer_right_brace_on_new_line = false
+ij_c_array_initializer_wrap = normal
+ij_c_assignment_wrap = off
+ij_c_binary_operation_sign_on_next_line = false
+ij_c_binary_operation_wrap = normal
+ij_c_blank_lines_after_class_header = 0
+ij_c_blank_lines_after_imports = 1
+ij_c_blank_lines_around_class = 1
+ij_c_blank_lines_around_field = 0
+ij_c_blank_lines_around_field_in_interface = 0
+ij_c_blank_lines_around_method = 1
+ij_c_blank_lines_around_method_in_interface = 1
+ij_c_blank_lines_around_namespace = 0
+ij_c_blank_lines_around_properties_in_declaration = 0
+ij_c_blank_lines_around_properties_in_interface = 0
+ij_c_blank_lines_before_imports = 1
+ij_c_blank_lines_before_method_body = 0
+ij_c_block_brace_placement = end_of_line
+ij_c_block_brace_style = end_of_line
+ij_c_block_comment_at_first_column = true
+ij_c_catch_on_new_line = false
+ij_c_class_brace_style = end_of_line
+ij_c_class_constructor_init_list_align_multiline = true
+ij_c_class_constructor_init_list_comma_on_next_line = false
+ij_c_class_constructor_init_list_new_line_after_colon = never
+ij_c_class_constructor_init_list_new_line_before_colon = if_long
+ij_c_class_constructor_init_list_wrap = normal
+ij_c_copy_is_deep = false
+ij_c_create_interface_for_categories = true
+ij_c_declare_generated_methods = true
+ij_c_description_include_member_names = true
+ij_c_discharged_short_ternary_operator = false
+ij_c_do_not_add_breaks = false
+ij_c_do_while_brace_force = never
+ij_c_else_on_new_line = false
+ij_c_enum_constants_comma_on_next_line = false
+ij_c_enum_constants_wrap = on_every_item
+ij_c_for_brace_force = never
+ij_c_for_statement_new_line_after_left_paren = false
+ij_c_for_statement_right_paren_on_new_line = false
+ij_c_for_statement_wrap = off
+ij_c_function_brace_placement = end_of_line
+ij_c_function_call_arguments_align_multiline = true
+ij_c_function_call_arguments_align_multiline_pars = false
+ij_c_function_call_arguments_comma_on_next_line = false
+ij_c_function_call_arguments_new_line_after_lpar = false
+ij_c_function_call_arguments_new_line_before_rpar = false
+ij_c_function_call_arguments_wrap = normal
+ij_c_function_non_top_after_return_type_wrap = normal
+ij_c_function_parameters_align_multiline = true
+ij_c_function_parameters_align_multiline_pars = false
+ij_c_function_parameters_comma_on_next_line = false
+ij_c_function_parameters_new_line_after_lpar = false
+ij_c_function_parameters_new_line_before_rpar = false
+ij_c_function_parameters_wrap = normal
+ij_c_function_top_after_return_type_wrap = normal
+ij_c_generate_additional_eq_operators = true
+ij_c_generate_additional_rel_operators = true
+ij_c_generate_class_constructor = true
+ij_c_generate_comparison_operators_use_std_tie = false
+ij_c_generate_instance_variables_for_properties = ask
+ij_c_generate_operators_as_members = true
+ij_c_header_guard_style_pattern = ${PROJECT_NAME}_${FILE_NAME}_${EXT}
+ij_c_if_brace_force = never
+ij_c_in_line_short_ternary_operator = true
+ij_c_indent_block_comment = true
+ij_c_indent_c_struct_members = 4
+ij_c_indent_case_from_switch = true
+ij_c_indent_class_members = 4
+ij_c_indent_directive_as_code = false
+ij_c_indent_implementation_members = 0
+ij_c_indent_inside_code_block = 4
+ij_c_indent_interface_members = 0
+ij_c_indent_interface_members_except_ivars_block = false
+ij_c_indent_namespace_members = 4
+ij_c_indent_preprocessor_directive = 0
+ij_c_indent_visibility_keywords = 0
+ij_c_insert_override = true
+ij_c_insert_virtual_with_override = false
+ij_c_introduce_auto_vars = false
+ij_c_introduce_const_params = false
+ij_c_introduce_const_vars = false
+ij_c_introduce_generate_property = false
+ij_c_introduce_generate_synthesize = true
+ij_c_introduce_globals_to_header = true
+ij_c_introduce_prop_to_private_category = false
+ij_c_introduce_static_consts = true
+ij_c_introduce_use_ns_types = false
+ij_c_ivars_prefix = _
+ij_c_keep_blank_lines_before_end = 2
+ij_c_keep_blank_lines_before_right_brace = 2
+ij_c_keep_blank_lines_in_code = 2
+ij_c_keep_blank_lines_in_declarations = 2
+ij_c_keep_case_expressions_in_one_line = false
+ij_c_keep_control_statement_in_one_line = true
+ij_c_keep_directive_at_first_column = true
+ij_c_keep_first_column_comment = true
+ij_c_keep_line_breaks = true
+ij_c_keep_nested_namespaces_in_one_line = false
+ij_c_keep_simple_blocks_in_one_line = true
+ij_c_keep_simple_methods_in_one_line = true
+ij_c_keep_structures_in_one_line = false
+ij_c_lambda_capture_list_align_multiline = false
+ij_c_lambda_capture_list_align_multiline_bracket = false
+ij_c_lambda_capture_list_comma_on_next_line = false
+ij_c_lambda_capture_list_new_line_after_lbracket = false
+ij_c_lambda_capture_list_new_line_before_rbracket = false
+ij_c_lambda_capture_list_wrap = off
+ij_c_line_comment_add_space = false
+ij_c_line_comment_at_first_column = true
+ij_c_method_brace_placement = end_of_line
+ij_c_method_call_arguments_align_by_colons = true
+ij_c_method_call_arguments_align_multiline = false
+ij_c_method_call_arguments_special_dictionary_pairs_treatment = true
+ij_c_method_call_arguments_wrap = off
+ij_c_method_call_chain_wrap = off
+ij_c_method_parameters_align_by_colons = true
+ij_c_method_parameters_align_multiline = false
+ij_c_method_parameters_wrap = off
+ij_c_namespace_brace_placement = end_of_line
+ij_c_parentheses_expression_new_line_after_left_paren = false
+ij_c_parentheses_expression_right_paren_on_new_line = false
+ij_c_place_assignment_sign_on_next_line = false
+ij_c_property_nonatomic = true
+ij_c_put_ivars_to_implementation = true
+ij_c_refactor_compatibility_aliases_and_classes = true
+ij_c_refactor_properties_and_ivars = true
+ij_c_release_style = ivar
+ij_c_retain_object_parameters_in_constructor = true
+ij_c_semicolon_after_method_signature = false
+ij_c_shift_operation_align_multiline = true
+ij_c_shift_operation_wrap = normal
+ij_c_show_non_virtual_functions = false
+ij_c_space_after_colon = true
+ij_c_space_after_colon_in_selector = false
+ij_c_space_after_comma = true
+ij_c_space_after_cup_in_blocks = false
+ij_c_space_after_dictionary_literal_colon = true
+ij_c_space_after_for_semicolon = true
+ij_c_space_after_init_list_colon = true
+ij_c_space_after_method_parameter_type_parentheses = false
+ij_c_space_after_method_return_type_parentheses = false
+ij_c_space_after_pointer_in_declaration = false
+ij_c_space_after_quest = true
+ij_c_space_after_reference_in_declaration = false
+ij_c_space_after_reference_in_rvalue = false
+ij_c_space_after_structures_rbrace = true
+ij_c_space_after_superclass_colon = true
+ij_c_space_after_type_cast = true
+ij_c_space_after_visibility_sign_in_method_declaration = true
+ij_c_space_before_autorelease_pool_lbrace = true
+ij_c_space_before_catch_keyword = true
+ij_c_space_before_catch_left_brace = true
+ij_c_space_before_catch_parentheses = true
+ij_c_space_before_category_parentheses = true
+ij_c_space_before_chained_send_message = true
+ij_c_space_before_class_left_brace = true
+ij_c_space_before_colon = true
+ij_c_space_before_comma = false
+ij_c_space_before_dictionary_literal_colon = false
+ij_c_space_before_do_left_brace = true
+ij_c_space_before_else_keyword = true
+ij_c_space_before_else_left_brace = true
+ij_c_space_before_for_left_brace = true
+ij_c_space_before_for_parentheses = true
+ij_c_space_before_for_semicolon = false
+ij_c_space_before_if_left_brace = true
+ij_c_space_before_if_parentheses = true
+ij_c_space_before_init_list = false
+ij_c_space_before_init_list_colon = true
+ij_c_space_before_method_call_parentheses = false
+ij_c_space_before_method_left_brace = true
+ij_c_space_before_method_parentheses = false
+ij_c_space_before_namespace_lbrace = true
+ij_c_space_before_pointer_in_declaration = true
+ij_c_space_before_property_attributes_parentheses = false
+ij_c_space_before_protocols_brackets = true
+ij_c_space_before_quest = true
+ij_c_space_before_reference_in_declaration = true
+ij_c_space_before_superclass_colon = true
+ij_c_space_before_switch_left_brace = true
+ij_c_space_before_switch_parentheses = true
+ij_c_space_before_template_call_lt = false
+ij_c_space_before_template_declaration_lt = false
+ij_c_space_before_try_left_brace = true
+ij_c_space_before_while_keyword = true
+ij_c_space_before_while_left_brace = true
+ij_c_space_before_while_parentheses = true
+ij_c_space_between_adjacent_brackets = false
+ij_c_space_between_operator_and_punctuator = false
+ij_c_space_within_empty_array_initializer_braces = false
+ij_c_spaces_around_additive_operators = true
+ij_c_spaces_around_assignment_operators = true
+ij_c_spaces_around_bitwise_operators = true
+ij_c_spaces_around_equality_operators = true
+ij_c_spaces_around_lambda_arrow = true
+ij_c_spaces_around_logical_operators = true
+ij_c_spaces_around_multiplicative_operators = true
+ij_c_spaces_around_pm_operators = false
+ij_c_spaces_around_relational_operators = true
+ij_c_spaces_around_shift_operators = true
+ij_c_spaces_around_unary_operator = false
+ij_c_spaces_within_array_initializer_braces = false
+ij_c_spaces_within_braces = true
+ij_c_spaces_within_brackets = false
+ij_c_spaces_within_cast_parentheses = false
+ij_c_spaces_within_catch_parentheses = false
+ij_c_spaces_within_category_parentheses = false
+ij_c_spaces_within_empty_braces = false
+ij_c_spaces_within_empty_function_call_parentheses = false
+ij_c_spaces_within_empty_function_declaration_parentheses = false
+ij_c_spaces_within_empty_lambda_capture_list_bracket = false
+ij_c_spaces_within_empty_template_call_ltgt = false
+ij_c_spaces_within_empty_template_declaration_ltgt = false
+ij_c_spaces_within_for_parentheses = false
+ij_c_spaces_within_function_call_parentheses = false
+ij_c_spaces_within_function_declaration_parentheses = false
+ij_c_spaces_within_if_parentheses = false
+ij_c_spaces_within_lambda_capture_list_bracket = false
+ij_c_spaces_within_method_parameter_type_parentheses = false
+ij_c_spaces_within_method_return_type_parentheses = false
+ij_c_spaces_within_parentheses = false
+ij_c_spaces_within_property_attributes_parentheses = false
+ij_c_spaces_within_protocols_brackets = false
+ij_c_spaces_within_send_message_brackets = false
+ij_c_spaces_within_switch_parentheses = false
+ij_c_spaces_within_template_call_ltgt = false
+ij_c_spaces_within_template_declaration_ltgt = false
+ij_c_spaces_within_template_double_gt = true
+ij_c_spaces_within_while_parentheses = false
+ij_c_special_else_if_treatment = true
+ij_c_superclass_list_after_colon = never
+ij_c_superclass_list_align_multiline = true
+ij_c_superclass_list_before_colon = if_long
+ij_c_superclass_list_comma_on_next_line = false
+ij_c_superclass_list_wrap = on_every_item
+ij_c_tag_prefix_of_block_comment = at
+ij_c_tag_prefix_of_line_comment = back_slash
+ij_c_template_call_arguments_align_multiline = false
+ij_c_template_call_arguments_align_multiline_pars = false
+ij_c_template_call_arguments_comma_on_next_line = false
+ij_c_template_call_arguments_new_line_after_lt = false
+ij_c_template_call_arguments_new_line_before_gt = false
+ij_c_template_call_arguments_wrap = off
+ij_c_template_declaration_function_body_indent = false
+ij_c_template_declaration_function_wrap = split_into_lines
+ij_c_template_declaration_struct_body_indent = false
+ij_c_template_declaration_struct_wrap = split_into_lines
+ij_c_template_parameters_align_multiline = false
+ij_c_template_parameters_align_multiline_pars = false
+ij_c_template_parameters_comma_on_next_line = false
+ij_c_template_parameters_new_line_after_lt = false
+ij_c_template_parameters_new_line_before_gt = false
+ij_c_template_parameters_wrap = off
+ij_c_ternary_operation_signs_on_next_line = true
+ij_c_ternary_operation_wrap = normal
+ij_c_type_qualifiers_placement = before
+ij_c_use_modern_casts = true
+ij_c_use_setters_in_constructor = true
+ij_c_while_brace_force = never
+ij_c_while_on_new_line = false
+ij_c_wrap_property_declaration = off
+
+[{*.cmake,CMakeLists.txt}]
+ij_cmake_align_multiline_parameters_in_calls = false
+ij_cmake_force_commands_case = 2
+ij_cmake_keep_blank_lines_in_code = 2
+ij_cmake_space_before_for_parentheses = true
+ij_cmake_space_before_if_parentheses = true
+ij_cmake_space_before_method_call_parentheses = false
+ij_cmake_space_before_method_parentheses = false
+ij_cmake_space_before_while_parentheses = true
+ij_cmake_spaces_within_for_parentheses = false
+ij_cmake_spaces_within_if_parentheses = false
+ij_cmake_spaces_within_method_call_parentheses = false
+ij_cmake_spaces_within_method_parentheses = false
+ij_cmake_spaces_within_while_parentheses = false
+
+[{*.gant,*.gradle,*.groovy,*.gy}]
+ij_groovy_align_group_field_declarations = false
+ij_groovy_align_multiline_array_initializer_expression = false
+ij_groovy_align_multiline_assignment = false
+ij_groovy_align_multiline_binary_operation = false
+ij_groovy_align_multiline_chained_methods = false
+ij_groovy_align_multiline_extends_list = false
+ij_groovy_align_multiline_for = true
+ij_groovy_align_multiline_list_or_map = true
+ij_groovy_align_multiline_method_parentheses = false
+ij_groovy_align_multiline_parameters = true
+ij_groovy_align_multiline_parameters_in_calls = false
+ij_groovy_align_multiline_resources = true
+ij_groovy_align_multiline_ternary_operation = false
+ij_groovy_align_multiline_throws_list = false
+ij_groovy_align_named_args_in_map = true
+ij_groovy_align_throws_keyword = false
+ij_groovy_array_initializer_new_line_after_left_brace = false
+ij_groovy_array_initializer_right_brace_on_new_line = false
+ij_groovy_array_initializer_wrap = off
+ij_groovy_assert_statement_wrap = off
+ij_groovy_assignment_wrap = off
+ij_groovy_binary_operation_wrap = off
+ij_groovy_blank_lines_after_class_header = 0
+ij_groovy_blank_lines_after_imports = 1
+ij_groovy_blank_lines_after_package = 1
+ij_groovy_blank_lines_around_class = 1
+ij_groovy_blank_lines_around_field = 0
+ij_groovy_blank_lines_around_field_in_interface = 0
+ij_groovy_blank_lines_around_method = 1
+ij_groovy_blank_lines_around_method_in_interface = 1
+ij_groovy_blank_lines_before_imports = 1
+ij_groovy_blank_lines_before_method_body = 0
+ij_groovy_blank_lines_before_package = 0
+ij_groovy_block_brace_style = end_of_line
+ij_groovy_block_comment_at_first_column = true
+ij_groovy_call_parameters_new_line_after_left_paren = false
+ij_groovy_call_parameters_right_paren_on_new_line = false
+ij_groovy_call_parameters_wrap = off
+ij_groovy_catch_on_new_line = false
+ij_groovy_class_annotation_wrap = split_into_lines
+ij_groovy_class_brace_style = end_of_line
+ij_groovy_class_count_to_use_import_on_demand = 5
+ij_groovy_do_while_brace_force = never
+ij_groovy_else_on_new_line = false
+ij_groovy_enum_constants_wrap = off
+ij_groovy_extends_keyword_wrap = off
+ij_groovy_extends_list_wrap = off
+ij_groovy_field_annotation_wrap = split_into_lines
+ij_groovy_finally_on_new_line = false
+ij_groovy_for_brace_force = never
+ij_groovy_for_statement_new_line_after_left_paren = false
+ij_groovy_for_statement_right_paren_on_new_line = false
+ij_groovy_for_statement_wrap = off
+ij_groovy_if_brace_force = never
+ij_groovy_import_annotation_wrap = 2
+ij_groovy_imports_layout = *,|,javax.**,java.**,|,$*
+ij_groovy_indent_case_from_switch = true
+ij_groovy_indent_label_blocks = true
+ij_groovy_insert_inner_class_imports = false
+ij_groovy_keep_blank_lines_before_right_brace = 2
+ij_groovy_keep_blank_lines_in_code = 2
+ij_groovy_keep_blank_lines_in_declarations = 2
+ij_groovy_keep_control_statement_in_one_line = true
+ij_groovy_keep_first_column_comment = true
+ij_groovy_keep_indents_on_empty_lines = false
+ij_groovy_keep_line_breaks = true
+ij_groovy_keep_multiple_expressions_in_one_line = false
+ij_groovy_keep_simple_blocks_in_one_line = false
+ij_groovy_keep_simple_classes_in_one_line = true
+ij_groovy_keep_simple_lambdas_in_one_line = true
+ij_groovy_keep_simple_methods_in_one_line = true
+ij_groovy_label_indent_absolute = false
+ij_groovy_label_indent_size = 0
+ij_groovy_lambda_brace_style = end_of_line
+ij_groovy_layout_static_imports_separately = true
+ij_groovy_line_comment_add_space = false
+ij_groovy_line_comment_at_first_column = true
+ij_groovy_method_annotation_wrap = split_into_lines
+ij_groovy_method_brace_style = end_of_line
+ij_groovy_method_call_chain_wrap = off
+ij_groovy_method_parameters_new_line_after_left_paren = false
+ij_groovy_method_parameters_right_paren_on_new_line = false
+ij_groovy_method_parameters_wrap = off
+ij_groovy_modifier_list_wrap = false
+ij_groovy_names_count_to_use_import_on_demand = 3
+ij_groovy_parameter_annotation_wrap = off
+ij_groovy_parentheses_expression_new_line_after_left_paren = false
+ij_groovy_parentheses_expression_right_paren_on_new_line = false
+ij_groovy_prefer_parameters_wrap = false
+ij_groovy_resource_list_new_line_after_left_paren = false
+ij_groovy_resource_list_right_paren_on_new_line = false
+ij_groovy_resource_list_wrap = off
+ij_groovy_space_after_assert_separator = true
+ij_groovy_space_after_colon = true
+ij_groovy_space_after_comma = true
+ij_groovy_space_after_comma_in_type_arguments = true
+ij_groovy_space_after_for_semicolon = true
+ij_groovy_space_after_quest = true
+ij_groovy_space_after_type_cast = true
+ij_groovy_space_before_annotation_parameter_list = false
+ij_groovy_space_before_array_initializer_left_brace = false
+ij_groovy_space_before_assert_separator = false
+ij_groovy_space_before_catch_keyword = true
+ij_groovy_space_before_catch_left_brace = true
+ij_groovy_space_before_catch_parentheses = true
+ij_groovy_space_before_class_left_brace = true
+ij_groovy_space_before_closure_left_brace = true
+ij_groovy_space_before_colon = true
+ij_groovy_space_before_comma = false
+ij_groovy_space_before_do_left_brace = true
+ij_groovy_space_before_else_keyword = true
+ij_groovy_space_before_else_left_brace = true
+ij_groovy_space_before_finally_keyword = true
+ij_groovy_space_before_finally_left_brace = true
+ij_groovy_space_before_for_left_brace = true
+ij_groovy_space_before_for_parentheses = true
+ij_groovy_space_before_for_semicolon = false
+ij_groovy_space_before_if_left_brace = true
+ij_groovy_space_before_if_parentheses = true
+ij_groovy_space_before_method_call_parentheses = false
+ij_groovy_space_before_method_left_brace = true
+ij_groovy_space_before_method_parentheses = false
+ij_groovy_space_before_quest = true
+ij_groovy_space_before_switch_left_brace = true
+ij_groovy_space_before_switch_parentheses = true
+ij_groovy_space_before_synchronized_left_brace = true
+ij_groovy_space_before_synchronized_parentheses = true
+ij_groovy_space_before_try_left_brace = true
+ij_groovy_space_before_try_parentheses = true
+ij_groovy_space_before_while_keyword = true
+ij_groovy_space_before_while_left_brace = true
+ij_groovy_space_before_while_parentheses = true
+ij_groovy_space_in_named_argument = true
+ij_groovy_space_in_named_argument_before_colon = false
+ij_groovy_space_within_empty_array_initializer_braces = false
+ij_groovy_space_within_empty_method_call_parentheses = false
+ij_groovy_spaces_around_additive_operators = true
+ij_groovy_spaces_around_assignment_operators = true
+ij_groovy_spaces_around_bitwise_operators = true
+ij_groovy_spaces_around_equality_operators = true
+ij_groovy_spaces_around_lambda_arrow = true
+ij_groovy_spaces_around_logical_operators = true
+ij_groovy_spaces_around_multiplicative_operators = true
+ij_groovy_spaces_around_regex_operators = true
+ij_groovy_spaces_around_relational_operators = true
+ij_groovy_spaces_around_shift_operators = true
+ij_groovy_spaces_within_annotation_parentheses = false
+ij_groovy_spaces_within_array_initializer_braces = false
+ij_groovy_spaces_within_braces = true
+ij_groovy_spaces_within_brackets = false
+ij_groovy_spaces_within_cast_parentheses = false
+ij_groovy_spaces_within_catch_parentheses = false
+ij_groovy_spaces_within_for_parentheses = false
+ij_groovy_spaces_within_gstring_injection_braces = false
+ij_groovy_spaces_within_if_parentheses = false
+ij_groovy_spaces_within_list_or_map = false
+ij_groovy_spaces_within_method_call_parentheses = false
+ij_groovy_spaces_within_method_parentheses = false
+ij_groovy_spaces_within_parentheses = false
+ij_groovy_spaces_within_switch_parentheses = false
+ij_groovy_spaces_within_synchronized_parentheses = false
+ij_groovy_spaces_within_try_parentheses = false
+ij_groovy_spaces_within_tuple_expression = false
+ij_groovy_spaces_within_while_parentheses = false
+ij_groovy_special_else_if_treatment = true
+ij_groovy_ternary_operation_wrap = off
+ij_groovy_throws_keyword_wrap = off
+ij_groovy_throws_list_wrap = off
+ij_groovy_use_flying_geese_braces = false
+ij_groovy_use_fq_class_names = false
+ij_groovy_use_fq_class_names_in_javadoc = true
+ij_groovy_use_relative_indents = false
+ij_groovy_use_single_class_imports = true
+ij_groovy_variable_annotation_wrap = off
+ij_groovy_while_brace_force = never
+ij_groovy_while_on_new_line = false
+ij_groovy_wrap_long_lines = false
+
+[{*.gradle.kts,*.kt,*.kts,*.main.kts}]
+ij_kotlin_align_in_columns_case_branch = false
+ij_kotlin_align_multiline_binary_operation = false
+ij_kotlin_align_multiline_extends_list = false
+ij_kotlin_align_multiline_method_parentheses = false
+ij_kotlin_align_multiline_parameters = true
+ij_kotlin_align_multiline_parameters_in_calls = false
+ij_kotlin_allow_trailing_comma = false
+ij_kotlin_allow_trailing_comma_on_call_site = false
+ij_kotlin_assignment_wrap = off
+ij_kotlin_blank_lines_after_class_header = 0
+ij_kotlin_blank_lines_around_block_when_branches = 0
+ij_kotlin_blank_lines_before_declaration_with_comment_or_annotation_on_separate_line = 1
+ij_kotlin_block_comment_at_first_column = true
+ij_kotlin_call_parameters_new_line_after_left_paren = false
+ij_kotlin_call_parameters_right_paren_on_new_line = false
+ij_kotlin_call_parameters_wrap = off
+ij_kotlin_catch_on_new_line = false
+ij_kotlin_class_annotation_wrap = off
+ij_kotlin_code_style_defaults = KOTLIN_OFFICIAL
+ij_kotlin_continuation_indent_for_chained_calls = true
+ij_kotlin_continuation_indent_for_expression_bodies = true
+ij_kotlin_continuation_indent_in_argument_lists = true
+ij_kotlin_continuation_indent_in_elvis = true
+ij_kotlin_continuation_indent_in_if_conditions = true
+ij_kotlin_continuation_indent_in_parameter_lists = true
+ij_kotlin_continuation_indent_in_supertype_lists = true
+ij_kotlin_else_on_new_line = false
+ij_kotlin_enum_constants_wrap = off
+ij_kotlin_extends_list_wrap = off
+ij_kotlin_field_annotation_wrap = normal
+ij_kotlin_finally_on_new_line = false
+ij_kotlin_if_rparen_on_new_line = false
+ij_kotlin_import_nested_classes = false
+ij_kotlin_imports_layout = *,java.**,javax.**,kotlin.**,^
+ij_kotlin_insert_whitespaces_in_simple_one_line_method = true
+ij_kotlin_keep_blank_lines_before_right_brace = 0
+ij_kotlin_keep_blank_lines_in_code = 1
+ij_kotlin_keep_blank_lines_in_declarations = 1
+ij_kotlin_keep_first_column_comment = true
+ij_kotlin_keep_indents_on_empty_lines = false
+ij_kotlin_keep_line_breaks = true
+ij_kotlin_lbrace_on_next_line = false
+ij_kotlin_line_comment_add_space = false
+ij_kotlin_line_comment_at_first_column = true
+ij_kotlin_method_annotation_wrap = split_into_lines
+ij_kotlin_method_call_chain_wrap = off
+ij_kotlin_method_parameters_new_line_after_left_paren = true
+ij_kotlin_method_parameters_right_paren_on_new_line = true
+ij_kotlin_method_parameters_wrap = off
+ij_kotlin_name_count_to_use_star_import = 2147483647
+ij_kotlin_name_count_to_use_star_import_for_members = 2147483647
+ij_kotlin_packages_to_use_import_on_demand = kotlinx.android.synthetic.**
+ij_kotlin_parameter_annotation_wrap = off
+ij_kotlin_space_after_comma = true
+ij_kotlin_space_after_extend_colon = true
+ij_kotlin_space_after_type_colon = true
+ij_kotlin_space_before_catch_parentheses = true
+ij_kotlin_space_before_comma = false
+ij_kotlin_space_before_extend_colon = true
+ij_kotlin_space_before_for_parentheses = true
+ij_kotlin_space_before_if_parentheses = true
+ij_kotlin_space_before_lambda_arrow = true
+ij_kotlin_space_before_type_colon = false
+ij_kotlin_space_before_when_parentheses = true
+ij_kotlin_space_before_while_parentheses = true
+ij_kotlin_spaces_around_additive_operators = true
+ij_kotlin_spaces_around_assignment_operators = true
+ij_kotlin_spaces_around_equality_operators = true
+ij_kotlin_spaces_around_function_type_arrow = true
+ij_kotlin_spaces_around_logical_operators = true
+ij_kotlin_spaces_around_multiplicative_operators = true
+ij_kotlin_spaces_around_range = false
+ij_kotlin_spaces_around_relational_operators = true
+ij_kotlin_spaces_around_unary_operator = false
+ij_kotlin_spaces_around_when_arrow = true
+ij_kotlin_use_custom_formatting_for_modifiers = true
+ij_kotlin_variable_annotation_wrap = off
+ij_kotlin_while_on_new_line = false
+ij_kotlin_wrap_elvis_expressions = 1
+ij_kotlin_wrap_expression_body_functions = 0
+ij_kotlin_wrap_first_method_in_call_chain = false
+
+[{*.har,*.json}]
+indent_size = 2
+ij_json_keep_blank_lines_in_code = 0
+ij_json_keep_indents_on_empty_lines = false
+ij_json_keep_line_breaks = true
+ij_json_space_after_colon = true
+ij_json_space_after_comma = true
+ij_json_space_before_colon = true
+ij_json_space_before_comma = false
+ij_json_spaces_within_braces = false
+ij_json_spaces_within_brackets = false
+ij_json_wrap_long_lines = false
+
+[{*.htm,*.html,*.sht,*.shtm,*.shtml}]
+ij_html_add_new_line_before_tags = body,div,p,form,h1,h2,h3
+ij_html_align_attributes = true
+ij_html_align_text = false
+ij_html_attribute_wrap = normal
+ij_html_block_comment_at_first_column = true
+ij_html_do_not_align_children_of_min_lines = 0
+ij_html_do_not_break_if_inline_tags = title,h1,h2,h3,h4,h5,h6,p
+ij_html_do_not_indent_children_of_tags = html,body,thead,tbody,tfoot
+ij_html_enforce_quotes = false
+ij_html_inline_tags = a,abbr,acronym,b,basefont,bdo,big,br,cite,cite,code,dfn,em,font,i,img,input,kbd,label,q,s,samp,select,small,span,strike,strong,sub,sup,textarea,tt,u,var
+ij_html_keep_blank_lines = 2
+ij_html_keep_indents_on_empty_lines = false
+ij_html_keep_line_breaks = true
+ij_html_keep_line_breaks_in_text = true
+ij_html_keep_whitespaces = false
+ij_html_keep_whitespaces_inside = span,pre,textarea
+ij_html_line_comment_at_first_column = true
+ij_html_new_line_after_last_attribute = never
+ij_html_new_line_before_first_attribute = never
+ij_html_quote_style = double
+ij_html_remove_new_line_before_tags = br
+ij_html_space_after_tag_name = false
+ij_html_space_around_equality_in_attribute = false
+ij_html_space_inside_empty_tag = false
+ij_html_text_wrap = normal
+ij_html_uniform_ident = false
+
+[{*.yaml,*.yml}]
+indent_size = 2
+ij_yaml_align_values_properties = do_not_align
+ij_yaml_autoinsert_sequence_marker = true
+ij_yaml_block_mapping_on_new_line = false
+ij_yaml_indent_sequence_value = true
+ij_yaml_keep_indents_on_empty_lines = false
+ij_yaml_keep_line_breaks = true
+ij_yaml_sequence_on_new_line = false
+ij_yaml_space_before_colon = false
+ij_yaml_spaces_within_braces = true
+ij_yaml_spaces_within_brackets = true
diff --git a/.github/ISSUE_TEMPLATE/bug.yml b/.github/ISSUE_TEMPLATE/bug.yml
index a7daaac14b..1ab5d835b2 100644
--- a/.github/ISSUE_TEMPLATE/bug.yml
+++ b/.github/ISSUE_TEMPLATE/bug.yml
@@ -73,3 +73,14 @@ body:
- 'No'
validations:
required: true
+ - type: dropdown
+ id: pr
+ attributes:
+ label: Are you willing to provide a PR?
+ description: |
+ Providing a PR can drastically speed up the process of fixing this bug. Don't worry, it's still OK to answer 'No' :).
+ options:
+ - 'Yes'
+ - 'No'
+ validations:
+ required: true
diff --git a/.github/ISSUE_TEMPLATE/enhancement.yml b/.github/ISSUE_TEMPLATE/enhancement.yml
index 71adce718e..2dd968951f 100644
--- a/.github/ISSUE_TEMPLATE/enhancement.yml
+++ b/.github/ISSUE_TEMPLATE/enhancement.yml
@@ -34,3 +34,14 @@ body:
placeholder: Is there anything else you'd like to add?
validations:
required: false
+ - type: dropdown
+ id: pr
+ attributes:
+ label: Are you willing to provide a PR?
+ description: |
+ Don't worry, it's still OK to answer 'No' :).
+ options:
+ - 'Yes'
+ - 'No'
+ validations:
+ required: true
diff --git a/.github/ISSUE_TEMPLATE/release.yml b/.github/ISSUE_TEMPLATE/release.yml
index 7cb47fa952..f012900752 100644
--- a/.github/ISSUE_TEMPLATE/release.yml
+++ b/.github/ISSUE_TEMPLATE/release.yml
@@ -49,24 +49,34 @@ body:
### Once tested and validated internally
- - [ ] Create a new beta release on the GooglePlay console and upload the 4 signed Apks.
+ - [ ] Create a new open testing release on the GooglePlay console and upload the 4 signed Apks.
- [ ] Check that the version codes are correct
- [ ] Copy the fastlane change to the GooglePlay console in the section en-GB.
- - [ ] Push to beta release to 100% of the users
- - [ ] Notify the F-Droid team so that they can schedule the publication on F-Droid
+ - [ ] Push the open testing release to 100% of the users
+ - [ ] Notify the F-Droid team [here](https://matrix.to/#/!LAAuJLQXYHjMNWKrCK:matrix.org?via=matrix.org&via=bubu1.eu&via=lant.uk) so that they can schedule the publication on F-Droid
+ - [ ] The application is available to the PlayStore testers (live). Google can take between 1 hour and up to 7 days to approve the release.
+ - [ ] The application is available to the F-Droid users.
- ### Once Live on PlayStore
+ ### Once open testing is live on PlayStore
- [ ] Ping the Android public room and update its topic
- - [ ] Add an entry in the internal diary
- ### After at least 2 days
+ ### Once Live on F-Droid
+
+ - [ ] Update the Android public room topic
+
+ ### After at least 2 days (generally next Monday)
- [ ] Check the [rageshakes](https://github.com/matrix-org/element-android-rageshakes/issues)
- [ ] Check the crash reports on the GooglePlay console
- [ ] Check the Android Element room for any reported issues on the new version
- - [ ] If all is OK, push to production and notify Markus (Bubu) to release the F-Droid version
- - [ ] Ping the Android public room and update its topic with the new available version
+ - [ ] If all is OK, promote the open testing release to production. Generally using a 100% roll out, but can be a smaller value depending on the release content.
+ - [ ] The application is available to the PlayStore users (live). Google can take (again!) between 1 hour and up to 7 days to approve the release.
+
+ ### Once production is live on PlayStore
+
+ - [ ] Ping the Android public room and update its topic
+ - [ ] Add an entry in the internal diary
### Android SDK2
diff --git a/.github/workflows/post-pr.yml b/.github/workflows/post-pr.yml
index 8fe51eb8d5..49669e4201 100644
--- a/.github/workflows/post-pr.yml
+++ b/.github/workflows/post-pr.yml
@@ -29,200 +29,6 @@ jobs:
steps:
- run: echo "Run those tests!" # no-op success
- # Run Android Tests
- integration-tests:
- name: Matrix SDK - Running Integration Tests
- needs: should-i-run
- runs-on: macos-latest
- strategy:
- fail-fast: false
- matrix:
- api-level: [ 28 ]
- steps:
- - uses: actions/checkout@v3
- - uses: gradle/wrapper-validation-action@v1
- - uses: actions/setup-java@v3
- with:
- distribution: 'adopt'
- java-version: 11
- - name: Set up Python 3.8
- uses: actions/setup-python@v3
- with:
- python-version: 3.8
- - uses: actions/cache@v3
- with:
- path: |
- ~/.gradle/caches
- ~/.gradle/wrapper
- key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
- restore-keys: |
- ${{ runner.os }}-gradle-
- - name: Start synapse server
- uses: michaelkaye/setup-matrix-synapse@v1.0.3
- with:
- uploadLogs: true
- httpPort: 8080
- disableRateLimiting: true
- public_baseurl: "http://10.0.2.2:8080/"
- # package: org.matrix.android.sdk.session
- - name: Run integration tests for Matrix SDK [org.matrix.android.sdk.session] API[${{ matrix.api-level }}]
- uses: reactivecircus/android-emulator-runner@v2
- with:
- api-level: ${{ matrix.api-level }}
- arch: x86
- profile: Nexus 5X
- force-avd-creation: false
- emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
- emulator-build: 7425822
- script: |
- adb root
- adb logcat -c
- touch emulator-session.log
- chmod 777 emulator-session.log
- adb logcat >> emulator-session.log &
- ./gradlew $CI_GRADLE_ARG_PROPERTIES -Pandroid.testInstrumentationRunnerArguments.package='org.matrix.android.sdk.session' matrix-sdk-android:connectedDebugAndroidTest
- - name: Read Results [org.matrix.android.sdk.session]
- if: always()
- id: get-comment-body-session
- run: python3 ./tools/ci/render_test_output.py session ./matrix-sdk-android/build/outputs/androidTest-results/connected/*.xml
- - name: Remove adb logcat
- if: always()
- run: pkill -9 adb
- - name: Run integration tests for Matrix SDK [org.matrix.android.sdk.account] API[${{ matrix.api-level }}]
- if: always()
- uses: reactivecircus/android-emulator-runner@v2
- with:
- api-level: ${{ matrix.api-level }}
- arch: x86
- profile: Nexus 5X
- force-avd-creation: false
- emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
- emulator-build: 7425822
- script: |
- adb root
- adb logcat -c
- touch emulator-account.log
- chmod 777 emulator-account.log
- adb logcat >> emulator-account.log &
- ./gradlew $CI_GRADLE_ARG_PROPERTIES -Pandroid.testInstrumentationRunnerArguments.package='org.matrix.android.sdk.account' matrix-sdk-android:connectedDebugAndroidTest
- - name: Read Results [org.matrix.android.sdk.account]
- if: always()
- id: get-comment-body-account
- run: python3 ./tools/ci/render_test_output.py account ./matrix-sdk-android/build/outputs/androidTest-results/connected/*.xml
- - name: Remove adb logcat
- if: always()
- run: pkill -9 adb
- # package: org.matrix.android.sdk.internal
- - name: Run integration tests for Matrix SDK [org.matrix.android.sdk.internal] API[${{ matrix.api-level }}]
- if: always()
- uses: reactivecircus/android-emulator-runner@v2
- with:
- api-level: ${{ matrix.api-level }}
- arch: x86
- profile: Nexus 5X
- force-avd-creation: false
- emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
- emulator-build: 7425822
- script: |
- adb root
- adb logcat -c
- touch emulator-internal.log
- chmod 777 emulator-internal.log
- adb logcat >> emulator-internal.log &
- ./gradlew $CI_GRADLE_ARG_PROPERTIES -Pandroid.testInstrumentationRunnerArguments.package='org.matrix.android.sdk.internal' matrix-sdk-android:connectedDebugAndroidTest
- - name: Read Results [org.matrix.android.sdk.internal]
- if: always()
- id: get-comment-body-internal
- run: python3 ./tools/ci/render_test_output.py internal ./matrix-sdk-android/build/outputs/androidTest-results/connected/*.xml
- - name: Remove adb logcat
- if: always()
- run: pkill -9 adb
- # package: org.matrix.android.sdk.ordering
- - name: Run integration tests for Matrix SDK [org.matrix.android.sdk.ordering] API[${{ matrix.api-level }}]
- if: always()
- uses: reactivecircus/android-emulator-runner@v2
- with:
- api-level: ${{ matrix.api-level }}
- arch: x86
- profile: Nexus 5X
- force-avd-creation: false
- emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
- emulator-build: 7425822
- script: |
- adb root
- adb logcat -c
- touch emulator-ordering.log
- chmod 777 emulator-ordering.log
- adb logcat >> emulator-ordering.log &
- ./gradlew $CI_GRADLE_ARG_PROPERTIES -Pandroid.testInstrumentationRunnerArguments.package='org.matrix.android.sdk.ordering' matrix-sdk-android:connectedDebugAndroidTest
- - name: Read Results [org.matrix.android.sdk.ordering]
- if: always()
- id: get-comment-body-ordering
- run: python3 ./tools/ci/render_test_output.py ordering ./matrix-sdk-android/build/outputs/androidTest-results/connected/*.xml
- - name: Remove adb logcat
- if: always()
- run: pkill -9 adb
- # package: class PermalinkParserTest
- - name: Run integration tests for Matrix SDK class [org.matrix.android.sdk.PermalinkParserTest] API[${{ matrix.api-level }}]
- if: always()
- uses: reactivecircus/android-emulator-runner@v2
- with:
- api-level: ${{ matrix.api-level }}
- arch: x86
- profile: Nexus 5X
- force-avd-creation: false
- emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
- emulator-build: 7425822
- script: |
- adb root
- adb logcat -c
- touch emulator-permalink.log
- chmod 777 emulator-permalink.log
- adb logcat >> emulator-permalink.log &
- ./gradlew $CI_GRADLE_ARG_PROPERTIES -Pandroid.testInstrumentationRunnerArguments.class='org.matrix.android.sdk.PermalinkParserTest' matrix-sdk-android:connectedDebugAndroidTest
- - name: Read Results [org.matrix.android.sdk.PermalinkParserTest]
- if: always()
- id: get-comment-body-permalink
- run: python3 ./tools/ci/render_test_output.py permalink ./matrix-sdk-android/build/outputs/androidTest-results/connected/*.xml
- - name: Remove adb logcat
- if: always()
- run: pkill -9 adb
- # package: class PermalinkParserTest
- - name: Find Comment
- if: always() && github.event_name == 'pull_request'
- uses: peter-evans/find-comment@v2
- id: fc
- with:
- issue-number: ${{ github.event.pull_request.number }}
- comment-author: 'github-actions[bot]'
- body-includes: Integration Tests Results
- - name: Publish results to PR
- if: always() && github.event_name == 'pull_request'
- uses: peter-evans/create-or-update-comment@v2
- with:
- comment-id: ${{ steps.fc.outputs.comment-id }}
- issue-number: ${{ github.event.pull_request.number }}
- body: |
- ### Matrix SDK
- ## Integration Tests Results:
- - `[org.matrix.android.sdk.session]`
${{ steps.get-comment-body-session.outputs.session }}
- - `[org.matrix.android.sdk.account]`
${{ steps.get-comment-body-account.outputs.account }}
- - `[org.matrix.android.sdk.internal]`
${{ steps.get-comment-body-internal.outputs.internal }}
- - `[org.matrix.android.sdk.ordering]`
${{ steps.get-comment-body-ordering.outputs.ordering }}
- - `[org.matrix.android.sdk.PermalinkParserTest]`
${{ steps.get-comment-body-permalink.outputs.permalink }}
- edit-mode: replace
- - name: Upload Test Report Log
- uses: actions/upload-artifact@v3
- if: always()
- with:
- name: integrationtest-error-results
- path: |
- emulator-permalink.log
- emulator-internal.log
- emulator-ordering.log
- emulator-account.log
- emulator-session.log
-
ui-tests:
name: UI Tests (Synapse)
needs: should-i-run
@@ -282,42 +88,13 @@ jobs:
emulator.log
failure_screenshots/
- codecov-units:
- name: Unit tests with code coverage
- needs: should-i-run
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v3
- - uses: actions/setup-java@v3
- with:
- distribution: 'adopt'
- java-version: '11'
- - uses: actions/cache@v3
- with:
- path: |
- ~/.gradle/caches
- ~/.gradle/wrapper
- key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
- restore-keys: |
- ${{ runner.os }}-gradle-
- - run: ./gradlew allCodeCoverageReport $CI_GRADLE_ARG_PROPERTIES
- - name: Upload Codecov data
- uses: actions/upload-artifact@v3
- if: always()
- with:
- name: codecov-xml
- path: |
- build/reports/jacoco/allCodeCoverageReport/allCodeCoverageReport.xml
-
# Notify the channel about delayed failures
notify:
name: Notify matrix
runs-on: ubuntu-latest
needs:
- should-i-run
- - integration-tests
- ui-tests
- - codecov-units
if: always() && (needs.should-i-run.result == 'success' ) && ((needs.codecov-units.result != 'success' ) || (needs.ui-tests.result != 'success') || (needs.integration-tests.result != 'success'))
# No concurrency required, runs every time on a schedule.
steps:
diff --git a/.github/workflows/sonarqube.yml b/.github/workflows/sonarqube.yml
deleted file mode 100644
index 6809751d91..0000000000
--- a/.github/workflows/sonarqube.yml
+++ /dev/null
@@ -1,81 +0,0 @@
-name: Sonarqube nightly
-
-on:
- schedule:
- - cron: '0 20 * * *'
-
-# Enrich gradle.properties for CI/CD
-env:
- CI_GRADLE_ARG_PROPERTIES: >
- -Porg.gradle.jvmargs=-Xmx4g
- -Porg.gradle.parallel=false
-jobs:
- codecov-units:
- name: Unit tests with code coverage
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v3
- - uses: actions/setup-java@v3
- with:
- distribution: 'adopt'
- java-version: '11'
- - uses: actions/cache@v3
- with:
- path: |
- ~/.gradle/caches
- ~/.gradle/wrapper
- key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
- restore-keys: |
- ${{ runner.os }}-gradle-
- - run: ./gradlew allCodeCoverageReport $CI_GRADLE_ARG_PROPERTIES
- - name: Upload Codecov data
- uses: actions/upload-artifact@v3
- if: always()
- with:
- name: codecov-xml
- path: |
- build/reports/jacoco/allCodeCoverageReport/allCodeCoverageReport.xml
-
- sonarqube:
- name: Sonarqube upload
- runs-on: ubuntu-latest
- needs:
- - codecov-units
- steps:
- - uses: actions/checkout@v3
- - uses: actions/setup-java@v3
- with:
- distribution: 'adopt'
- java-version: '11'
- - uses: actions/cache@v3
- with:
- path: |
- ~/.gradle/caches
- ~/.gradle/wrapper
- key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
- restore-keys: |
- ${{ runner.os }}-gradle-
- - uses: actions/download-artifact@v3
- with:
- name: codecov-xml # will restore to allCodeCoverageReport.xml by default; we restore to the same location in following tasks
- - run: mkdir -p build/reports/jacoco/allCodeCoverageReport/
- - run: mv allCodeCoverageReport.xml build/reports/jacoco/allCodeCoverageReport/
- - run: ./gradlew sonarqube $CI_GRADLE_ARG_PROPERTIES
- env:
- ORG_GRADLE_PROJECT_SONAR_LOGIN: ${{ secrets.SONAR_TOKEN }}
-
-# Notify the channel about sonarqube failures
- notify:
- name: Notify matrix
- runs-on: ubuntu-latest
- needs:
- - sonarqube
- - codecov-units
- if: always() && (needs.sonarqube.result != 'success' || needs.codecov-units.result != 'success')
- steps:
- - uses: michaelkaye/matrix-hookshot-action@v1.0.0
- with:
- github_token: ${{ secrets.GITHUB_TOKEN }}
- hookshot_url: ${{ secrets.ELEMENT_ANDROID_HOOKSHOT_URL }}
- text_template: "Sonarqube run (on ${{ github.ref }}): {{#each job_statuses }}{{#with this }}{{#if completed }} {{name}} {{conclusion}} at {{completed_at}}, {{/if}}{{/with}}{{/each}}"
- html_template: "Sonarqube run (on ${{ github.ref }}): {{#each job_statuses }}{{#with this }}{{#if completed }}
{{icon conclusion}} {{name}} {{conclusion}} at {{completed_at}} [details]{{/if}}{{/with}}{{/each}}"
diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml
index 3e8de8979c..f8d7f2ec33 100644
--- a/.github/workflows/tests.yml
+++ b/.github/workflows/tests.yml
@@ -12,73 +12,100 @@ env:
-Porg.gradle.parallel=false
jobs:
- # Build Android Tests
- build-android-tests:
- name: Build Android Tests
- runs-on: ubuntu-latest
- concurrency:
- group: ${{ github.ref == 'refs/heads/main' && format('unit-tests-main-{0}', github.sha) || github.ref == 'refs/heads/develop' && format('unit-tests-develop-{0}', github.sha) || format('build-android-tests-{0}', github.ref) }}
- cancel-in-progress: true
- steps:
- - uses: actions/checkout@v3
- - uses: actions/setup-java@v3
- with:
- distribution: 'adopt'
- java-version: 11
- - uses: actions/cache@v3
- with:
- path: |
- ~/.gradle/caches
- ~/.gradle/wrapper
- key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
- restore-keys: |
- ${{ runner.os }}-gradle-
- - name: Build Android Tests
- run: ./gradlew clean assembleAndroidTest $CI_GRADLE_ARG_PROPERTIES --stacktrace
-
- unit-tests:
- name: Run Unit Tests
- runs-on: ubuntu-latest
+ tests:
+ name: Runs all tests
+ runs-on: macos-latest # for the emulator
# Allow all jobs on main and develop. Just one per PR.
concurrency:
group: ${{ github.ref == 'refs/heads/main' && format('unit-tests-main-{0}', github.sha) || github.ref == 'refs/heads/develop' && format('unit-tests-develop-{0}', github.sha) || format('unit-tests-{0}', github.ref) }}
cancel-in-progress: true
steps:
- uses: actions/checkout@v3
- - uses: actions/cache@v3
with:
- path: |
- ~/.gradle/caches
- ~/.gradle/wrapper
- key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
- restore-keys: |
- ${{ runner.os }}-gradle-
- - name: Run unit tests
- run: ./gradlew clean test $CI_GRADLE_ARG_PROPERTIES --stacktrace
+ fetch-depth: 0
+ - uses: actions/setup-java@v3
+ with:
+ distribution: 'adopt'
+ java-version: '11'
+ - uses: gradle/gradle-build-action@v2
+ - uses: actions/setup-python@v3
+ with:
+ python-version: 3.8
+ - uses: michaelkaye/setup-matrix-synapse@v1.0.3
+ with:
+ uploadLogs: true
+ httpPort: 8080
+ disableRateLimiting: true
+ public_baseurl: "http://10.0.2.2:8080/"
+ - name: Run all the codecoverage tests at once
+ id: tests
+ uses: reactivecircus/android-emulator-runner@v2
+ continue-on-error: true
+ with:
+ api-level: 28
+ arch: x86
+ profile: Nexus 5X
+ force-avd-creation: false
+ emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
+ disable-animations: true
+ emulator-build: 7425822
+ script: ./gradlew theCodeCoverageReport -Pandroid.testInstrumentationRunnerArguments.notPackage=im.vector.app.ui --stacktrace $CI_GRADLE_ARG_PROPERTIES
+# NB: continue-on-error marks steps.tests.conclusion = 'success' but leaves stes.tests.outcome = 'failure'
+ - name: Run all the codecoverage tests at once (retry if emulator failed)
+ uses: reactivecircus/android-emulator-runner@v2
+ if: always() && steps.tests.outcome == 'failure' # don't run if previous step succeeded.
+ with:
+ api-level: 28
+ arch: x86
+ profile: Nexus 5X
+ force-avd-creation: false
+ emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
+ disable-animations: true
+ emulator-build: 7425822
+ script: ./gradlew theCodeCoverageReport -Pandroid.testInstrumentationRunnerArguments.notPackage=im.vector.app.ui --stacktrace $CI_GRADLE_ARG_PROPERTIES
+ - run: ./gradlew sonarqube $CI_GRADLE_ARG_PROPERTIES
+ if: always() # we may have failed a previous step and retried, that's OK
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
+ SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
+ ORG_GRADLE_PROJECT_SONAR_LOGIN: ${{ secrets.SONAR_TOKEN }}
+
- name: Format unit test results
if: always()
run: python3 ./tools/ci/render_test_output.py unit ./**/build/test-results/**/*.xml
- - name: Publish Unit Test Results
- uses: EnricoMi/publish-unit-test-result-action@v1
- if: always() &&
- github.event.sender.login != 'dependabot[bot]' &&
- ( github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository )
- with:
- files: ./**/build/test-results/**/*.xml
-# Notify the channel about runs against develop or main that have failures, as PRs should have caught these first.
- notify:
- runs-on: ubuntu-latest
- needs:
- - unit-tests
- - build-android-tests
- if: ${{ (github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/main' ) && failure() }}
- steps:
- - uses: michaelkaye/matrix-hookshot-action@v0.3.0
- with:
- github_token: ${{ secrets.GITHUB_TOKEN }}
- matrix_access_token: ${{ secrets.ELEMENT_ANDROID_NOTIFICATION_ACCESS_TOKEN }}
- matrix_room_id: ${{ secrets.ELEMENT_ANDROID_INTERNAL_ROOM_ID }}
- text_template: "Build is broken for ${{ github.ref }}: {{#each job_statuses }}{{#with this }}{{#if completed }}{{name}} {{conclusion}} at {{completed_at}}, {{/if}}{{/with}}{{/each}}"
- html_template: "Build is broken for ${{ github.ref }}: {{#each job_statuses }}{{#with this }}{{#if completed }}
{{icon conclusion }} {{name}} {{conclusion}} at {{completed_at}} [details]{{/if}}{{/with}}{{/each}}"
+# can't be run on macos due to containers.
+# - name: Publish Unit Test Results
+# uses: EnricoMi/publish-unit-test-result-action@v1
+# if: always() &&
+# github.event.sender.login != 'dependabot[bot]' &&
+# ( github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository )
+# with:
+# files: ./**/build/test-results/**/*.xml
+
+# Unneeded as part of the test suite above, kept around in case we want to re-enable them.
+#
+# # Build Android Tests
+# build-android-tests:
+# name: Build Android Tests
+# runs-on: ubuntu-latest
+# concurrency:
+# group: ${{ github.ref == 'refs/heads/main' && format('unit-tests-main-{0}', github.sha) || github.ref == 'refs/heads/develop' && format('unit-tests-develop-{0}', github.sha) || format('build-android-tests-{0}', github.ref) }}
+# cancel-in-progress: true
+# steps:
+# - uses: actions/checkout@v3
+# - uses: actions/setup-java@v3
+# with:
+# distribution: 'adopt'
+# java-version: 11
+# - uses: actions/cache@v3
+# with:
+# path: |
+# ~/.gradle/caches
+# ~/.gradle/wrapper
+# key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
+# restore-keys: |
+# ${{ runner.os }}-gradle-
+# - name: Build Android Tests
+# run: ./gradlew clean assembleAndroidTest $CI_GRADLE_ARG_PROPERTIES --stacktrace
diff --git a/.github/workflows/triage-labelled.yml b/.github/workflows/triage-labelled.yml
index 82d5931ce7..c49b33d582 100644
--- a/.github/workflows/triage-labelled.yml
+++ b/.github/workflows/triage-labelled.yml
@@ -9,15 +9,15 @@ jobs:
name: Add Z-Labs label for features behind labs flags
runs-on: ubuntu-latest
if: >
- contains(github.event.issue.labels.*.name, 'A-Maths') ||
- contains(github.event.issue.labels.*.name, 'A-Message-Pinning') ||
- contains(github.event.issue.labels.*.name, 'A-Polls') ||
- contains(github.event.issue.labels.*.name, 'A-Location-Sharing') ||
- contains(github.event.issue.labels.*.name, 'A-Message-Bubbles') ||
- contains(github.event.issue.labels.*.name, 'Z-IA') ||
- contains(github.event.issue.labels.*.name, 'A-Themes-Custom') ||
- contains(github.event.issue.labels.*.name, 'A-E2EE-Dehydration') ||
- contains(github.event.issue.labels.*.name, 'A-Tags')
+ contains(github.event.issue.labels.*.name, 'A-Maths') ||
+ contains(github.event.issue.labels.*.name, 'A-Message-Pinning') ||
+ contains(github.event.issue.labels.*.name, 'A-Polls') ||
+ contains(github.event.issue.labels.*.name, 'A-Location-Sharing') ||
+ contains(github.event.issue.labels.*.name, 'A-Message-Bubbles') ||
+ contains(github.event.issue.labels.*.name, 'Z-IA') ||
+ contains(github.event.issue.labels.*.name, 'A-Themes-Custom') ||
+ contains(github.event.issue.labels.*.name, 'A-E2EE-Dehydration') ||
+ contains(github.event.issue.labels.*.name, 'A-Tags')
steps:
- uses: actions/github-script@v5
with:
@@ -79,7 +79,7 @@ jobs:
name: X-Needs-Product to Design project board
runs-on: ubuntu-latest
if: >
- contains(github.event.issue.labels.*.name, 'X-Needs-Product')
+ contains(github.event.issue.labels.*.name, 'X-Needs-Product')
steps:
- uses: octokit/graphql-action@v2.x
id: add_to_project
@@ -105,10 +105,7 @@ jobs:
# Skip in forks
if: >
github.repository == 'vector-im/element-android' &&
- (contains(github.event.issue.labels.*.name, 'A-Spaces') ||
- contains(github.event.issue.labels.*.name, 'A-Space-Settings') ||
- contains(github.event.issue.labels.*.name, 'A-Subspaces') ||
- contains(github.event.issue.labels.*.name, 'Z-IA'))
+ (contains(github.event.issue.labels.*.name, 'Team: Delight'))
steps:
- uses: octokit/graphql-action@v2.x
with:
@@ -201,7 +198,7 @@ jobs:
env:
PROJECT_ID: "PN_kwDOAM0swc3m-g"
GITHUB_TOKEN: ${{ secrets.ELEMENT_BOT_TOKEN }}
-
+
move_ftue_issues:
name: Z-FTUE to Mobile FTUE board
runs-on: ubuntu-latest
diff --git a/.github/workflows/triage-priority-bugs.yml b/.github/workflows/triage-priority-bugs.yml
index 70c337e748..6cde154370 100644
--- a/.github/workflows/triage-priority-bugs.yml
+++ b/.github/workflows/triage-priority-bugs.yml
@@ -14,10 +14,7 @@ jobs:
!contains(github.event.issue.labels.*.name, 'A-E2EE-Cross-Signing') &&
!contains(github.event.issue.labels.*.name, 'A-E2EE-Dehydration') &&
!contains(github.event.issue.labels.*.name, 'A-E2EE-Key-Backup') &&
- !contains(github.event.issue.labels.*.name, 'A-E2EE-SAS-Verification') &&
- !contains(github.event.issue.labels.*.name, 'A-Spaces') &&
- !contains(github.event.issue.labels.*.name, 'A-Spaces-Settings') &&
- !contains(github.event.issue.labels.*.name, 'A-Subspaces')) &&
+ !contains(github.event.issue.labels.*.name, 'A-E2EE-SAS-Verification')) &&
(contains(github.event.issue.labels.*.name, 'T-Defect') &&
contains(github.event.issue.labels.*.name, 'S-Critical') &&
(contains(github.event.issue.labels.*.name, 'O-Frequent') ||
diff --git a/CHANGES.md b/CHANGES.md
index 60497402e9..e2991a122b 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -1,3 +1,43 @@
+Changes in Element v1.4.22 (2022-06-14)
+=======================================
+
+Features ✨
+----------
+ - Make read receipt avatar list more compact ([#5970](https://github.com/vector-im/element-android/issues/5970))
+ - Allow .well-known configuration to override key sharing mode ([#6147](https://github.com/vector-im/element-android/issues/6147))
+ - Re-organize location settings flags ([#6244](https://github.com/vector-im/element-android/issues/6244))
+ - Add report action for live location messages ([#6280](https://github.com/vector-im/element-android/issues/6280))
+
+Bugfixes 🐛
+----------
+ - Fix cases of missing, swapped, or duplicated messages ([#5528](https://github.com/vector-im/element-android/issues/5528))
+ - Fix wrong status of live location sharing in timeline ([#6209](https://github.com/vector-im/element-android/issues/6209))
+ - Fix StackOverflowError while recording voice message ([#6222](https://github.com/vector-im/element-android/issues/6222))
+ - Text cropped: "Secure backup" ([#6232](https://github.com/vector-im/element-android/issues/6232))
+ - Fix copyright attributions of map views ([#6247](https://github.com/vector-im/element-android/issues/6247))
+ - Fix flickering bottom bar of live location item ([#6264](https://github.com/vector-im/element-android/issues/6264))
+
+In development 🚧
+----------------
+ - FTUE - Adds Sign Up tracking ([#5285](https://github.com/vector-im/element-android/issues/5285))
+
+SDK API changes ⚠️
+------------------
+ - Some methods from `Session` have been moved to a new `SyncService`, that you can retrieve from a `Session`.
+ - `SyncStatusService` method has been moved to the new `SyncService`
+ - `InitSyncStep` have been moved and renamed to `InitialSyncStep`
+ - `SyncStatusService.Status` has been renamed to `SyncRequestState`
+ - The existing `SyncService` has been renamed to `SyncAndroidService` because of name clash with the new SDK Service ([#6029](https://github.com/vector-im/element-android/issues/6029))
+ - Allows `AuthenticationService.getLoginFlow` to fail without resetting state from previously successful calls ([#6093](https://github.com/vector-im/element-android/issues/6093))
+ - Allows new passwords to be passed at the point of confirmation when resetting a password ([#6169](https://github.com/vector-im/element-android/issues/6169))
+
+Other changes
+-------------
+ - Adds support for parsing homeserver versions without a patch number ([#6017](https://github.com/vector-im/element-android/issues/6017))
+ - Updating exit onboarding dialog copy formatting to match iOS ([#6087](https://github.com/vector-im/element-android/issues/6087))
+ - Disables when arrow alignment in code style ([#6126](https://github.com/vector-im/element-android/issues/6126))
+
+
Changes in Element 1.4.20 (2022-06-13)
======================================
diff --git a/README.md b/README.md
index 54dfb7b288..7acb5aa638 100644
--- a/README.md
+++ b/README.md
@@ -1,9 +1,9 @@
[![Buildkite](https://badge.buildkite.com/ad0065c1b70f557cd3b1d3d68f9c2154010f83c4d6f71706a9.svg?branch=develop)](https://buildkite.com/matrix-dot-org/element-android/builds?branch=develop)
[![Weblate](https://translate.element.io/widgets/element-android/-/svg-badge.svg)](https://translate.element.io/engage/element-android/?utm_source=widget)
[![Element Android Matrix room #element-android:matrix.org](https://img.shields.io/matrix/element-android:matrix.org.svg?label=%23element-android:matrix.org&logo=matrix&server_fqdn=matrix.org)](https://matrix.to/#/#element-android:matrix.org)
-[![Quality Gate](https://sonarcloud.io/api/project_badges/measure?project=im.vector.app.android&metric=alert_status)](https://sonarcloud.io/dashboard?id=im.vector.app.android)
-[![Vulnerabilities](https://sonarcloud.io/api/project_badges/measure?project=im.vector.app.android&metric=vulnerabilities)](https://sonarcloud.io/dashboard?id=im.vector.app.android)
-[![Bugs](https://sonarcloud.io/api/project_badges/measure?project=im.vector.app.android&metric=bugs)](https://sonarcloud.io/dashboard?id=im.vector.app.android)
+[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=vector-im_element-android&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=vector-im_element-android)
+[![Vulnerabilities](https://sonarcloud.io/api/project_badges/measure?project=vector-im_element-android&metric=vulnerabilities)](https://sonarcloud.io/summary/new_code?id=vector-im_element-android)
+[![Bugs](https://sonarcloud.io/api/project_badges/measure?project=vector-im_element-android&metric=bugs)](https://sonarcloud.io/summary/new_code?id=vector-im_element-android)
# Element Android
diff --git a/build.gradle b/build.gradle
index 635db83e14..2cb67b7795 100644
--- a/build.gradle
+++ b/build.gradle
@@ -25,7 +25,7 @@ buildscript {
classpath libs.gradle.kotlinPlugin
classpath libs.gradle.hiltPlugin
classpath 'com.google.gms:google-services:4.3.10'
- classpath 'org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:3.3'
+ classpath 'org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:3.4.0.2513'
classpath 'com.google.android.gms:oss-licenses-plugin:0.10.5'
classpath "com.likethesalad.android:stem-plugin:2.1.1"
classpath 'org.owasp:dependency-check-gradle:7.1.0.1'
@@ -43,7 +43,7 @@ plugins {
id "io.gitlab.arturbosch.detekt" version "1.20.0"
// Dependency Analysis
- id 'com.autonomousapps.dependency-analysis' version "1.4.0"
+ id 'com.autonomousapps.dependency-analysis' version "1.5.0"
}
// https://github.com/jeremylong/DependencyCheck
@@ -180,8 +180,8 @@ apply plugin: 'org.sonarqube'
sonarqube {
properties {
- property "sonar.projectName", "Element-Android"
- property "sonar.projectKey", "im.vector.app.android"
+ property "sonar.projectName", "element-android"
+ property "sonar.projectKey", "vector-im_element-android"
property "sonar.host.url", "https://sonarcloud.io"
property "sonar.projectVersion", project(":vector").android.defaultConfig.versionName
property "sonar.sourceEncoding", "UTF-8"
@@ -191,7 +191,7 @@ sonarqube {
property "sonar.links.issue", "https://github.com/vector-im/element-android/issues"
property "sonar.organization", "new_vector_ltd_organization"
property "sonar.java.coveragePlugin", "jacoco"
- property "sonar.coverage.jacoco.xmlReportPaths", "${project.buildDir}/reports/jacoco/allCodeCoverageReport/allCodeCoverageReport.xml"
+ property "sonar.coverage.jacoco.xmlReportPaths", "${project.buildDir}/reports/jacoco/theCodeCoverageReport/theCodeCoverageReport.xml"
property "sonar.login", project.hasProperty("SONAR_LOGIN") ? SONAR_LOGIN : "invalid"
}
}
diff --git a/coverage.gradle b/coverage.gradle
index b62ce0b4a0..fc69ce7e90 100644
--- a/coverage.gradle
+++ b/coverage.gradle
@@ -1,8 +1,33 @@
-def excludes = [ ]
+def excludes = [
+// dependency injection graph
+'**/*Module.*',
+'**/*Module*.*',
+
+// Framework entry points
+'**/*Activity*',
+'**/*Fragment*',
+'**/*Application*',
+
+// We would like to exclude android widgets as well but our naming is inconsistent
+
+// Proof of concept
+'**/*Login2*',
+
+// Generated
+'**/*JsonAdapter*',
+'**/*Item.*',
+'**/*$Holder.*',
+'**/*ViewHolder.*',
+'**/*View.*',
+'**/*BottomSheet.*'
+]
def initializeReport(report, projects, classExcludes) {
projects.each { project -> project.apply plugin: 'jacoco' }
- report.executionData { fileTree(rootProject.rootDir.absolutePath).include("**/build/jacoco/*.exec") }
+ report.executionData { fileTree(rootProject.rootDir.absolutePath).include(
+ "**/build/outputs/unit_test_code_coverage/**/*.exec",
+ "**/build/outputs/code_coverage/**/coverage.ec"
+ ) }
report.reports {
xml.enabled true
@@ -18,11 +43,13 @@ def initializeReport(report, projects, classExcludes) {
switch (project) {
case { project.plugins.hasPlugin("com.android.application") }:
androidClassDirs.add("${project.buildDir}/tmp/kotlin-classes/gplayDebug")
+ androidSourceDirs.add("${project.buildDir}/generated/source/kapt/gplayDebug")
androidSourceDirs.add("${project.projectDir}/src/main/kotlin")
androidSourceDirs.add("${project.projectDir}/src/main/java")
break
case { project.plugins.hasPlugin("com.android.library") }:
androidClassDirs.add("${project.buildDir}/tmp/kotlin-classes/debug")
+ androidSourceDirs.add("${project.buildDir}/generated/source/kapt/debug")
androidSourceDirs.add("${project.projectDir}/src/main/kotlin")
androidSourceDirs.add("${project.projectDir}/src/main/java")
break
@@ -43,13 +70,18 @@ def collectProjects(predicate) {
return subprojects.findAll { it.buildFile.isFile() && predicate(it) }
}
-task allCodeCoverageReport(type: JacocoReport) {
+task theCodeCoverageReport(type: JacocoReport) {
outputs.upToDateWhen { false }
rootProject.apply plugin: 'jacoco'
- // to limit projects in a specific report, add
- // def excludedProjects = [ ... ]
- // def projects = collectProjects { !excludedProjects.contains(it.name) }
- def projects = collectProjects { true }
- dependsOn { projects*.test }
+ tasks.withType(Test) {
+ jacoco.includeNoLocationClasses = true
+ }
+ def projects = collectProjects { ['vector','matrix-sdk-android'].contains(it.name) }
+ dependsOn {
+ [':vector:testGplayDebugUnitTest'] +
+ [':vector:connectedGplayDebugAndroidTest'] +
+ [':matrix-sdk-android:testDebugUnitTest'] +
+ [':matrix-sdk-android:connectedDebugAndroidTest']
+ }
initializeReport(it, projects, excludes)
}
diff --git a/dependencies.gradle b/dependencies.gradle
index 35ab909cf4..451ad4449b 100644
--- a/dependencies.gradle
+++ b/dependencies.gradle
@@ -49,8 +49,8 @@ ext.libs = [
],
androidx : [
'activity' : "androidx.activity:activity:1.4.0",
- 'appCompat' : "androidx.appcompat:appcompat:1.4.1",
- 'core' : "androidx.core:core-ktx:1.7.0",
+ 'appCompat' : "androidx.appcompat:appcompat:1.4.2",
+ 'core' : "androidx.core:core-ktx:1.8.0",
'recyclerview' : "androidx.recyclerview:recyclerview:1.2.1",
'exifinterface' : "androidx.exifinterface:exifinterface:1.3.3",
'fragmentKtx' : "androidx.fragment:fragment-ktx:1.4.1",
@@ -78,7 +78,7 @@ ext.libs = [
'transition' : "androidx.transition:transition:1.2.0",
],
google : [
- 'material' : "com.google.android.material:material:1.6.0"
+ 'material' : "com.google.android.material:material:1.6.1"
],
dagger : [
'dagger' : "com.google.dagger:dagger:$dagger",
diff --git a/fastlane/README.md b/fastlane/README.md
index 7fea7afdd5..dc33f422d6 100644
--- a/fastlane/README.md
+++ b/fastlane/README.md
@@ -1,64 +1,49 @@
fastlane documentation
-----
-
+================
# Installation
Make sure you have the latest version of the Xcode command line tools installed:
-```sh
+```
xcode-select --install
```
-For _fastlane_ installation instructions, see [Installing _fastlane_](https://docs.fastlane.tools/#installing-fastlane)
+Install _fastlane_ using
+```
+[sudo] gem install fastlane -NV
+```
+or alternatively using `brew install fastlane`
# Available Actions
-
## Android
-
### android test
-
-```sh
-[bundle exec] fastlane android test
```
-
+fastlane android test
+```
Runs all the tests
-
### android beta
-
-```sh
-[bundle exec] fastlane android beta
```
-
+fastlane android beta
+```
Submit a new Beta Build to Crashlytics Beta
-
### android deploy
-
-```sh
-[bundle exec] fastlane android deploy
```
-
+fastlane android deploy
+```
Deploy a new version to the Google Play
-
### android deployMeta
-
-```sh
-[bundle exec] fastlane android deployMeta
```
-
+fastlane android deployMeta
+```
Deploy Google Play metadata
-
### android getVersionCode
-
-```sh
-[bundle exec] fastlane android getVersionCode
```
-
+fastlane android getVersionCode
+```
Get version code
----
This README.md is auto-generated and will be re-generated every time [_fastlane_](https://fastlane.tools) is run.
-
-More information about _fastlane_ can be found on [fastlane.tools](https://fastlane.tools).
-
-The documentation of _fastlane_ can be found on [docs.fastlane.tools](https://docs.fastlane.tools).
+More information about fastlane can be found on [fastlane.tools](https://fastlane.tools).
+The documentation of fastlane can be found on [docs.fastlane.tools](https://docs.fastlane.tools).
diff --git a/fastlane/metadata/android/cs-CZ/changelogs/40104160.txt b/fastlane/metadata/android/cs-CZ/changelogs/40104160.txt
new file mode 100644
index 0000000000..922d4dc76b
--- /dev/null
+++ b/fastlane/metadata/android/cs-CZ/changelogs/40104160.txt
@@ -0,0 +1,2 @@
+Hlavní změny v této verzi: Vylepšena správa šifrovaných zpráv. Opravy různých chyb a vylepšení stability.
+Úplný seznam změn: https://github.com/vector-im/element-android/releases
diff --git a/fastlane/metadata/android/en-US/changelogs/40104220.txt b/fastlane/metadata/android/en-US/changelogs/40104220.txt
new file mode 100644
index 0000000000..61db61727a
--- /dev/null
+++ b/fastlane/metadata/android/en-US/changelogs/40104220.txt
@@ -0,0 +1,2 @@
+Main changes in this version: Various bug fixes and stability improvements.
+Full changelog: https://github.com/vector-im/element-android/releases
diff --git a/fastlane/metadata/android/et/changelogs/40104160.txt b/fastlane/metadata/android/et/changelogs/40104160.txt
new file mode 100644
index 0000000000..aa5a341dd3
--- /dev/null
+++ b/fastlane/metadata/android/et/changelogs/40104160.txt
@@ -0,0 +1,2 @@
+Põhilised muutused selles versioonis: krüptitud sõnumite parem haldus, lisaks pisiparandused ja stabiilsust parandavad kohendused.
+Kogu ingliskeelne muudatuste logi: https://github.com/vector-im/element-android/releases
diff --git a/fastlane/metadata/android/fa/changelogs/40104160.txt b/fastlane/metadata/android/fa/changelogs/40104160.txt
new file mode 100644
index 0000000000..1687ba2419
--- /dev/null
+++ b/fastlane/metadata/android/fa/changelogs/40104160.txt
@@ -0,0 +1,2 @@
+تغییرات عمده در این نگارش: مدیریت بهتر پیامهای رمزگذاشته. رفع اشکالهای مختلف و بهبودهای پایداری.
+گزارش دگرگونی کامل: https://github.com/vector-im/element-android/releases
diff --git a/fastlane/metadata/android/fr-FR/changelogs/40104160.txt b/fastlane/metadata/android/fr-FR/changelogs/40104160.txt
new file mode 100644
index 0000000000..6a19c6ea39
--- /dev/null
+++ b/fastlane/metadata/android/fr-FR/changelogs/40104160.txt
@@ -0,0 +1,2 @@
+Principaux changements pour cette version : Meilleure gestion des messages chiffrés. Plusieurs corrections de bogues et d’améliorations de stabilité.
+Intégralité des changements : https://github.com/vector-im/element-android/releases
diff --git a/fastlane/metadata/android/id/changelogs/40104160.txt b/fastlane/metadata/android/id/changelogs/40104160.txt
new file mode 100644
index 0000000000..8f248ffed4
--- /dev/null
+++ b/fastlane/metadata/android/id/changelogs/40104160.txt
@@ -0,0 +1,2 @@
+Perubahan utama dalam versi ini: Pengelolaan pesan terenkripsi lebih baik. Banyak perbaikan kutu dan perbaikan stabilitas.
+Catatan perubahan lanjutan: https://github.com/vector-im/element-android/releases
diff --git a/fastlane/metadata/android/it-IT/changelogs/40104160.txt b/fastlane/metadata/android/it-IT/changelogs/40104160.txt
new file mode 100644
index 0000000000..943a42de99
--- /dev/null
+++ b/fastlane/metadata/android/it-IT/changelogs/40104160.txt
@@ -0,0 +1,2 @@
+Modifiche principali in questa versione: migliorata la gestione dei messaggi cifrati. Varie correzioni e miglioramenti della stabilità.
+Cronologia completa: https://github.com/vector-im/element-android/releases
diff --git a/fastlane/metadata/android/iw-IL/title.txt b/fastlane/metadata/android/iw-IL/title.txt
index d8849a5023..56ae517696 100644
--- a/fastlane/metadata/android/iw-IL/title.txt
+++ b/fastlane/metadata/android/iw-IL/title.txt
@@ -1 +1 @@
-אלמנט (בעבר Riot.im)
+אלמנט - התכתבות מאובטחת
diff --git a/fastlane/metadata/android/pl-PL/changelogs/40101060.txt b/fastlane/metadata/android/pl-PL/changelogs/40101060.txt
new file mode 100644
index 0000000000..17af495632
--- /dev/null
+++ b/fastlane/metadata/android/pl-PL/changelogs/40101060.txt
@@ -0,0 +1,2 @@
+Główne zmiany w tej wesji: poprawki dla wesji 1.1.5
+Pełna lista zmian: https://github.com/vector-im/element-android/releases/tag/v1.1.6
diff --git a/fastlane/metadata/android/pl-PL/changelogs/40101070.txt b/fastlane/metadata/android/pl-PL/changelogs/40101070.txt
new file mode 100644
index 0000000000..2959ba88e0
--- /dev/null
+++ b/fastlane/metadata/android/pl-PL/changelogs/40101070.txt
@@ -0,0 +1,2 @@
+Główne zmiany w tej wersji: Eksperymentalne wsparcie dla przestrzeni, Kompresowanie video przed wysłaniem.
+Pełna lista zmian: https://github.com/vector-im/element-android/releases/tag/v1.1.7
diff --git a/fastlane/metadata/android/pl-PL/changelogs/40101080.txt b/fastlane/metadata/android/pl-PL/changelogs/40101080.txt
new file mode 100644
index 0000000000..95f77a0f25
--- /dev/null
+++ b/fastlane/metadata/android/pl-PL/changelogs/40101080.txt
@@ -0,0 +1,2 @@
+Główne zmiany w tej wersji: Poprawki w przestrzeniach
+Pełna lista zmian https://github.com/vector-im/element-android/releases/tag/v1.1.8
diff --git a/fastlane/metadata/android/pl-PL/changelogs/40101090.txt b/fastlane/metadata/android/pl-PL/changelogs/40101090.txt
new file mode 100644
index 0000000000..0bc111fa70
--- /dev/null
+++ b/fastlane/metadata/android/pl-PL/changelogs/40101090.txt
@@ -0,0 +1,2 @@
+Główne zmiany w tej wersji: Dodano wsparcie dla sieci gitter.im .
+Pełna lista zmian: https://github.com/vector-im/element-android/releases/tag/v1.1.9
diff --git a/fastlane/metadata/android/pl-PL/changelogs/40101100.txt b/fastlane/metadata/android/pl-PL/changelogs/40101100.txt
new file mode 100644
index 0000000000..2eace7771d
--- /dev/null
+++ b/fastlane/metadata/android/pl-PL/changelogs/40101100.txt
@@ -0,0 +1,2 @@
+Główne zmiany w tej wersji: Nowe funkcje dla przestrzeni i aktualizacja motywu i stylu.
+Pełna lista zmian: https://github.com/vector-im/element-android/releases/tag/v1.1.10
diff --git a/fastlane/metadata/android/pl-PL/changelogs/40101110.txt b/fastlane/metadata/android/pl-PL/changelogs/40101110.txt
new file mode 100644
index 0000000000..5afc3ca5a7
--- /dev/null
+++ b/fastlane/metadata/android/pl-PL/changelogs/40101110.txt
@@ -0,0 +1,2 @@
+Główne zmiany w tej wersji: Dodano nowe funkcje do przestrzeni i zaktualizowano motyw i styl aplikacji. (poprawki błędóœ dla wesji 1.1.10)
+Pełna lista zmian: https://github.com/vector-im/element-android/releases/tag/v1.1.11
diff --git a/fastlane/metadata/android/pl-PL/changelogs/40104160.txt b/fastlane/metadata/android/pl-PL/changelogs/40104160.txt
new file mode 100644
index 0000000000..104ed45352
--- /dev/null
+++ b/fastlane/metadata/android/pl-PL/changelogs/40104160.txt
@@ -0,0 +1,2 @@
+Główne zmiany w tej wersji: Lepsze zarządzanie zaszyfrowanymi wiadomościami. , Poprawki błędów i stabilności.
+Pełna lista zmian: https://github.com/vector-im/element-android/releases
diff --git a/fastlane/metadata/android/pt-BR/changelogs/40104160.txt b/fastlane/metadata/android/pt-BR/changelogs/40104160.txt
new file mode 100644
index 0000000000..eec5dca30f
--- /dev/null
+++ b/fastlane/metadata/android/pt-BR/changelogs/40104160.txt
@@ -0,0 +1,2 @@
+Principais mudanças nesta versão: Melhor gerenciamento de mensagens encriptadas. Vários consertos de bugs e melhorias de estabilidade.
+Changelog completo: https://github.com/vector-im/element-android/releases
diff --git a/fastlane/metadata/android/sk/changelogs/40104160.txt b/fastlane/metadata/android/sk/changelogs/40104160.txt
new file mode 100644
index 0000000000..e6e2f45c32
--- /dev/null
+++ b/fastlane/metadata/android/sk/changelogs/40104160.txt
@@ -0,0 +1,2 @@
+Hlavné zmeny v tejto verzii: Lepšia spravovanie zašifrovaných správ. Rôzne opravy chýb a vylepšenia stability.
+Úplný zoznam zmien: https://github.com/vector-im/element-android/releases
diff --git a/fastlane/metadata/android/sv-SE/changelogs/40104160.txt b/fastlane/metadata/android/sv-SE/changelogs/40104160.txt
new file mode 100644
index 0000000000..cf7eda6ef8
--- /dev/null
+++ b/fastlane/metadata/android/sv-SE/changelogs/40104160.txt
@@ -0,0 +1,2 @@
+Huvudsakliga ändringar i den här versionen: Bättre hantering av krypterade meddelanden. Diverse buggfixar och stabilitetsförbättringar.
+Full ändringslogg: https://github.com/vector-im/element-android/releases
diff --git a/fastlane/metadata/android/uk/changelogs/40104160.txt b/fastlane/metadata/android/uk/changelogs/40104160.txt
new file mode 100644
index 0000000000..33ad65f75c
--- /dev/null
+++ b/fastlane/metadata/android/uk/changelogs/40104160.txt
@@ -0,0 +1,2 @@
+Основні зміни в цій версії: Поліпшено керування зашифрованими повідомленнями. Усунуто різні вади й поліпшено стабільність.
+Вичерпний перелік змін: https://github.com/vector-im/element-android/releases
diff --git a/fastlane/metadata/android/zh-TW/changelogs/40104160.txt b/fastlane/metadata/android/zh-TW/changelogs/40104160.txt
new file mode 100644
index 0000000000..0e64d36868
--- /dev/null
+++ b/fastlane/metadata/android/zh-TW/changelogs/40104160.txt
@@ -0,0 +1,2 @@
+此版本中的主要變動:對於被加密的訊息有更好的管理方式。多個臭蟲修復與穩定性改善。
+完整的變更紀錄:https://github.com/vector-im/element-android/releases
diff --git a/library/attachment-viewer/src/main/java/im/vector/lib/attachmentviewer/AttachmentViewerActivity.kt b/library/attachment-viewer/src/main/java/im/vector/lib/attachmentviewer/AttachmentViewerActivity.kt
index 21af114c26..764cf8419a 100644
--- a/library/attachment-viewer/src/main/java/im/vector/lib/attachmentviewer/AttachmentViewerActivity.kt
+++ b/library/attachment-viewer/src/main/java/im/vector/lib/attachmentviewer/AttachmentViewerActivity.kt
@@ -271,7 +271,7 @@ abstract class AttachmentViewerActivity : AppCompatActivity(), AttachmentEventLi
directionDetector.handleTouchEvent(event)
return when (swipeDirection) {
- SwipeDirection.Up, SwipeDirection.Down -> {
+ SwipeDirection.Up, SwipeDirection.Down -> {
if (isSwipeToDismissAllowed && !wasScaled && isImagePagerIdle) {
swipeDismissHandler.onTouch(views.rootContainer, event)
} else true
@@ -279,7 +279,7 @@ abstract class AttachmentViewerActivity : AppCompatActivity(), AttachmentEventLi
SwipeDirection.Left, SwipeDirection.Right -> {
views.attachmentPager.dispatchTouchEvent(event)
}
- else -> true
+ else -> true
}
}
diff --git a/library/attachment-viewer/src/main/java/im/vector/lib/attachmentviewer/AttachmentsAdapter.kt b/library/attachment-viewer/src/main/java/im/vector/lib/attachmentviewer/AttachmentsAdapter.kt
index 4805a1186b..77ddb27c63 100644
--- a/library/attachment-viewer/src/main/java/im/vector/lib/attachmentviewer/AttachmentsAdapter.kt
+++ b/library/attachment-viewer/src/main/java/im/vector/lib/attachmentviewer/AttachmentsAdapter.kt
@@ -42,18 +42,18 @@ class AttachmentsAdapter : RecyclerView.Adapter() {
val inflater = LayoutInflater.from(parent.context)
val itemView = inflater.inflate(viewType, parent, false)
return when (viewType) {
- R.layout.item_image_attachment -> ZoomableImageViewHolder(itemView)
+ R.layout.item_image_attachment -> ZoomableImageViewHolder(itemView)
R.layout.item_animated_image_attachment -> AnimatedImageViewHolder(itemView)
- R.layout.item_video_attachment -> VideoViewHolder(itemView)
- else -> UnsupportedViewHolder(itemView)
+ R.layout.item_video_attachment -> VideoViewHolder(itemView)
+ else -> UnsupportedViewHolder(itemView)
}
}
override fun getItemViewType(position: Int): Int {
val info = attachmentSourceProvider!!.getAttachmentInfoAt(position)
return when (info) {
- is AttachmentInfo.Image -> R.layout.item_image_attachment
- is AttachmentInfo.Video -> R.layout.item_video_attachment
+ is AttachmentInfo.Image -> R.layout.item_image_attachment
+ is AttachmentInfo.Video -> R.layout.item_video_attachment
is AttachmentInfo.AnimatedImage -> R.layout.item_animated_image_attachment
// is AttachmentInfo.Audio -> TODO()
// is AttachmentInfo.File -> TODO()
@@ -68,13 +68,13 @@ class AttachmentsAdapter : RecyclerView.Adapter() {
attachmentSourceProvider?.getAttachmentInfoAt(position)?.let {
holder.bind(it)
when (it) {
- is AttachmentInfo.Image -> {
+ is AttachmentInfo.Image -> {
attachmentSourceProvider?.loadImage((holder as ZoomableImageViewHolder).target, it)
}
is AttachmentInfo.AnimatedImage -> {
attachmentSourceProvider?.loadImage((holder as AnimatedImageViewHolder).target, it)
}
- is AttachmentInfo.Video -> {
+ is AttachmentInfo.Video -> {
attachmentSourceProvider?.loadVideo((holder as VideoViewHolder).target, it)
}
// else -> {
diff --git a/library/attachment-viewer/src/main/java/im/vector/lib/attachmentviewer/SwipeDirection.kt b/library/attachment-viewer/src/main/java/im/vector/lib/attachmentviewer/SwipeDirection.kt
index 7948f37ae8..7816a5a2cc 100644
--- a/library/attachment-viewer/src/main/java/im/vector/lib/attachmentviewer/SwipeDirection.kt
+++ b/library/attachment-viewer/src/main/java/im/vector/lib/attachmentviewer/SwipeDirection.kt
@@ -27,12 +27,12 @@ sealed class SwipeDirection {
companion object {
fun fromAngle(angle: Double): SwipeDirection {
return when (angle) {
- in 0.0..45.0 -> Right
- in 45.0..135.0 -> Up
+ in 0.0..45.0 -> Right
+ in 45.0..135.0 -> Up
in 135.0..225.0 -> Left
in 225.0..315.0 -> Down
in 315.0..360.0 -> Right
- else -> NotDetected
+ else -> NotDetected
}
}
}
diff --git a/library/attachment-viewer/src/main/java/im/vector/lib/attachmentviewer/SwipeDirectionDetector.kt b/library/attachment-viewer/src/main/java/im/vector/lib/attachmentviewer/SwipeDirectionDetector.kt
index 6575248b2d..7b72637c06 100644
--- a/library/attachment-viewer/src/main/java/im/vector/lib/attachmentviewer/SwipeDirectionDetector.kt
+++ b/library/attachment-viewer/src/main/java/im/vector/lib/attachmentviewer/SwipeDirectionDetector.kt
@@ -33,7 +33,7 @@ class SwipeDirectionDetector(
fun handleTouchEvent(event: MotionEvent) {
when (event.action) {
- MotionEvent.ACTION_DOWN -> {
+ MotionEvent.ACTION_DOWN -> {
startX = event.x
startY = event.y
}
@@ -45,7 +45,7 @@ class SwipeDirectionDetector(
startX = startY
isDetected = false
}
- MotionEvent.ACTION_MOVE -> if (!isDetected && getEventDistance(event) > touchSlop) {
+ MotionEvent.ACTION_MOVE -> if (!isDetected && getEventDistance(event) > touchSlop) {
isDetected = true
onDirectionDetected(getDirection(startX, startY, event.x, event.y))
}
diff --git a/library/attachment-viewer/src/main/java/im/vector/lib/attachmentviewer/SwipeToDismissHandler.kt b/library/attachment-viewer/src/main/java/im/vector/lib/attachmentviewer/SwipeToDismissHandler.kt
index ca2c28b498..7a83ee28d4 100644
--- a/library/attachment-viewer/src/main/java/im/vector/lib/attachmentviewer/SwipeToDismissHandler.kt
+++ b/library/attachment-viewer/src/main/java/im/vector/lib/attachmentviewer/SwipeToDismissHandler.kt
@@ -44,7 +44,7 @@ class SwipeToDismissHandler(
@SuppressLint("ClickableViewAccessibility")
override fun onTouch(v: View, event: MotionEvent): Boolean {
when (event.action) {
- MotionEvent.ACTION_DOWN -> {
+ MotionEvent.ACTION_DOWN -> {
if (swipeView.hitRect.contains(event.x.toInt(), event.y.toInt())) {
isTracking = true
}
@@ -58,7 +58,7 @@ class SwipeToDismissHandler(
}
return true
}
- MotionEvent.ACTION_MOVE -> {
+ MotionEvent.ACTION_MOVE -> {
if (isTracking) {
val translationY = event.y - startY
swipeView.translationY = translationY
@@ -66,7 +66,7 @@ class SwipeToDismissHandler(
}
return true
}
- else -> {
+ else -> {
return false
}
}
@@ -79,8 +79,8 @@ class SwipeToDismissHandler(
private fun onTrackingEnd(parentHeight: Int) {
val animateTo = when {
swipeView.translationY < -translationLimit -> -parentHeight.toFloat()
- swipeView.translationY > translationLimit -> parentHeight.toFloat()
- else -> 0f
+ swipeView.translationY > translationLimit -> parentHeight.toFloat()
+ else -> 0f
}
if (animateTo != 0f && !shouldAnimateDismiss()) {
diff --git a/library/attachment-viewer/src/main/java/im/vector/lib/attachmentviewer/VideoViewHolder.kt b/library/attachment-viewer/src/main/java/im/vector/lib/attachmentviewer/VideoViewHolder.kt
index 12213a8786..92d28d26c9 100644
--- a/library/attachment-viewer/src/main/java/im/vector/lib/attachmentviewer/VideoViewHolder.kt
+++ b/library/attachment-viewer/src/main/java/im/vector/lib/attachmentviewer/VideoViewHolder.kt
@@ -146,7 +146,7 @@ class VideoViewHolder constructor(itemView: View) :
wasPaused = true
views.videoView.pause()
}
- is AttachmentCommands.SeekTo -> {
+ is AttachmentCommands.SeekTo -> {
val duration = views.videoView.duration
if (duration > 0) {
val seekDuration = duration * (commands.percentProgress / 100f)
diff --git a/library/jsonviewer/src/main/java/org/billcarsonfr/jsonviewer/JSonViewerEpoxyController.kt b/library/jsonviewer/src/main/java/org/billcarsonfr/jsonviewer/JSonViewerEpoxyController.kt
index 9f8093f801..24b9f2ec26 100644
--- a/library/jsonviewer/src/main/java/org/billcarsonfr/jsonviewer/JSonViewerEpoxyController.kt
+++ b/library/jsonviewer/src/main/java/org/billcarsonfr/jsonviewer/JSonViewerEpoxyController.kt
@@ -43,7 +43,7 @@ internal class JSonViewerEpoxyController(private val context: Context) :
text(async.error.localizedMessage?.toEpoxyCharSequence())
}
}
- else -> {
+ else -> {
async.invoke()?.let {
buildRec(it, 0, "")
}
@@ -98,7 +98,7 @@ internal class JSonViewerEpoxyController(private val context: Context) :
}
}
}
- is JSonViewerArray -> {
+ is JSonViewerArray -> {
if (model.isExpanded) {
open(id, model.key, model.index, depth, false, model)
model.items.forEach {
@@ -137,7 +137,7 @@ internal class JSonViewerEpoxyController(private val context: Context) :
}
}
}
- is JSonViewerLeaf -> {
+ is JSonViewerLeaf -> {
valueItem {
id(id)
depth(depth)
@@ -172,12 +172,12 @@ internal class JSonViewerEpoxyController(private val context: Context) :
private fun valueToSpan(leaf: JSonViewerLeaf): Span {
val host = this
return when (leaf.type) {
- JSONType.STRING -> {
+ JSONType.STRING -> {
span("\"${leaf.stringRes}\"") {
textColor = host.styleProvider.stringColor
}
}
- JSONType.NUMBER -> {
+ JSONType.NUMBER -> {
span(leaf.stringRes) {
textColor = host.styleProvider.numberColor
}
@@ -187,7 +187,7 @@ internal class JSonViewerEpoxyController(private val context: Context) :
textColor = host.styleProvider.booleanColor
}
}
- JSONType.NULL -> {
+ JSONType.NULL -> {
span("null") {
textColor = host.styleProvider.booleanColor
}
diff --git a/library/jsonviewer/src/main/java/org/billcarsonfr/jsonviewer/JSonViewerModel.kt b/library/jsonviewer/src/main/java/org/billcarsonfr/jsonviewer/JSonViewerModel.kt
index 6940e79e3f..2492b5454c 100644
--- a/library/jsonviewer/src/main/java/org/billcarsonfr/jsonviewer/JSonViewerModel.kt
+++ b/library/jsonviewer/src/main/java/org/billcarsonfr/jsonviewer/JSonViewerModel.kt
@@ -82,7 +82,7 @@ internal object ModelParser {
}
parent.addChild(objectComposed)
}
- is JSONArray -> {
+ is JSONArray -> {
val objectComposed = JSonViewerArray(key, index, obj)
.apply { isExpanded = initialOpenDepth == -1 || depth <= initialOpenDepth }
objectComposed.depth = depth
@@ -91,25 +91,25 @@ internal object ModelParser {
}
parent.addChild(objectComposed)
}
- is String -> {
+ is String -> {
JSonViewerLeaf(key, index, obj, JSONType.STRING).let {
it.depth = depth
parent.addChild(it)
}
}
- is Number -> {
+ is Number -> {
JSonViewerLeaf(key, index, obj.toString(), JSONType.NUMBER).let {
it.depth = depth
parent.addChild(it)
}
}
- is Boolean -> {
+ is Boolean -> {
JSonViewerLeaf(key, index, obj.toString(), JSONType.BOOLEAN).let {
it.depth = depth
parent.addChild(it)
}
}
- else -> {
+ else -> {
if (obj == JSONObject.NULL) {
JSonViewerLeaf(key, index, "null", JSONType.NULL).let {
it.depth = depth
diff --git a/library/multipicker/src/main/java/im/vector/lib/multipicker/FilePicker.kt b/library/multipicker/src/main/java/im/vector/lib/multipicker/FilePicker.kt
index 13ef5aa637..928fdf894c 100644
--- a/library/multipicker/src/main/java/im/vector/lib/multipicker/FilePicker.kt
+++ b/library/multipicker/src/main/java/im/vector/lib/multipicker/FilePicker.kt
@@ -48,7 +48,7 @@ class FilePicker : Picker() {
type.isMimeTypeVideo() -> selectedUri.toMultiPickerVideoType(context)
type.isMimeTypeImage() -> selectedUri.toMultiPickerImageType(context)
type.isMimeTypeAudio() -> selectedUri.toMultiPickerAudioType(context)
- else -> {
+ else -> {
// Other files
context.contentResolver.query(selectedUri, null, null, null, null)
?.use { cursor ->
diff --git a/library/multipicker/src/main/java/im/vector/lib/multipicker/MultiPicker.kt b/library/multipicker/src/main/java/im/vector/lib/multipicker/MultiPicker.kt
index e7883c9e53..9377345886 100644
--- a/library/multipicker/src/main/java/im/vector/lib/multipicker/MultiPicker.kt
+++ b/library/multipicker/src/main/java/im/vector/lib/multipicker/MultiPicker.kt
@@ -31,15 +31,15 @@ class MultiPicker private constructor() {
@Suppress("UNCHECKED_CAST")
fun get(type: MultiPicker): T {
return when (type) {
- IMAGE -> ImagePicker() as T
- VIDEO -> VideoPicker() as T
- MEDIA -> MediaPicker() as T
- FILE -> FilePicker() as T
- AUDIO -> AudioPicker() as T
- CONTACT -> ContactPicker() as T
- CAMERA -> CameraPicker() as T
+ IMAGE -> ImagePicker() as T
+ VIDEO -> VideoPicker() as T
+ MEDIA -> MediaPicker() as T
+ FILE -> FilePicker() as T
+ AUDIO -> AudioPicker() as T
+ CONTACT -> ContactPicker() as T
+ CAMERA -> CameraPicker() as T
CAMERA_VIDEO -> CameraVideoPicker() as T
- else -> throw IllegalArgumentException("Unsupported type $type")
+ else -> throw IllegalArgumentException("Unsupported type $type")
}
}
}
diff --git a/library/ui-styles/src/main/res/values/dimens_font.xml b/library/ui-styles/src/main/res/values/dimens_font.xml
index 1b5a826acb..ad8f012a16 100644
--- a/library/ui-styles/src/main/res/values/dimens_font.xml
+++ b/library/ui-styles/src/main/res/values/dimens_font.xml
@@ -7,7 +7,8 @@
14sp
12sp
10sp
+ 8sp
14sp
-
\ No newline at end of file
+
diff --git a/library/ui-styles/src/main/res/values/styles_location.xml b/library/ui-styles/src/main/res/values/styles_location.xml
index 9d9fc862f6..6777450a63 100644
--- a/library/ui-styles/src/main/res/values/styles_location.xml
+++ b/library/ui-styles/src/main/res/values/styles_location.xml
@@ -40,4 +40,9 @@
- center
+
+
diff --git a/library/ui-styles/src/main/res/values/styles_text_view.xml b/library/ui-styles/src/main/res/values/styles_text_view.xml
index 77e32da345..0dcaf30f48 100644
--- a/library/ui-styles/src/main/res/values/styles_text_view.xml
+++ b/library/ui-styles/src/main/res/values/styles_text_view.xml
@@ -48,4 +48,9 @@
- 16sp
-
\ No newline at end of file
+
+
+
diff --git a/library/ui-styles/src/main/res/values/text_appearances.xml b/library/ui-styles/src/main/res/values/text_appearances.xml
index 8e30dd00d6..1e60e05acf 100644
--- a/library/ui-styles/src/main/res/values/text_appearances.xml
+++ b/library/ui-styles/src/main/res/values/text_appearances.xml
@@ -85,4 +85,11 @@
- 0.02
+
+
diff --git a/matrix-sdk-android-flow/src/main/java/org/matrix/android/sdk/flow/FlowSession.kt b/matrix-sdk-android-flow/src/main/java/org/matrix/android/sdk/flow/FlowSession.kt
index 2839e6ab61..1086928dc6 100644
--- a/matrix-sdk-android-flow/src/main/java/org/matrix/android/sdk/flow/FlowSession.kt
+++ b/matrix-sdk-android-flow/src/main/java/org/matrix/android/sdk/flow/FlowSession.kt
@@ -88,7 +88,7 @@ class FlowSession(private val session: Session) {
}
fun liveSyncState(): Flow {
- return session.getSyncStateLive().asFlow()
+ return session.syncService().getSyncStateLive().asFlow()
}
fun livePushers(): Flow> {
diff --git a/matrix-sdk-android/build.gradle b/matrix-sdk-android/build.gradle
index 3829063836..45e411533b 100644
--- a/matrix-sdk-android/build.gradle
+++ b/matrix-sdk-android/build.gradle
@@ -56,7 +56,7 @@ android {
// that the app's state is completely cleared between tests.
testInstrumentationRunnerArguments clearPackageData: 'true'
- buildConfigField "String", "SDK_VERSION", "\"1.4.20\""
+ buildConfigField "String", "SDK_VERSION", "\"1.4.22\""
buildConfigField "String", "GIT_SDK_REVISION", "\"${gitRevision()}\""
buildConfigField "String", "GIT_SDK_REVISION_UNIX_DATE", "\"${gitRevisionUnixDate()}\""
@@ -74,6 +74,7 @@ android {
buildTypes {
debug {
+ testCoverageEnabled true
// Set to true to log privacy or sensible data, such as token
buildConfigField "boolean", "LOG_PRIVATE_DATA", project.property("vector.debugPrivateData")
// Set to BODY instead of NONE to enable logging
@@ -151,7 +152,7 @@ dependencies {
// - https://github.com/square/okhttp/issues/3278
// - https://github.com/square/okhttp/issues/4455
// - https://github.com/square/okhttp/issues/3146
- implementation(platform("com.squareup.okhttp3:okhttp-bom:4.9.3"))
+ implementation(platform("com.squareup.okhttp3:okhttp-bom:4.10.0"))
implementation 'com.squareup.okhttp3:okhttp'
implementation 'com.squareup.okhttp3:logging-interceptor'
@@ -175,7 +176,7 @@ dependencies {
implementation libs.androidx.work
// olm lib is now hosted in MavenCentral
- implementation 'org.matrix.android:olm-sdk:3.2.11'
+ implementation 'org.matrix.android:olm-sdk:3.2.12'
// DI
implementation libs.dagger.dagger
@@ -192,7 +193,7 @@ dependencies {
implementation libs.apache.commonsImaging
// Phone number https://github.com/google/libphonenumber
- implementation 'com.googlecode.libphonenumber:libphonenumber:8.12.49'
+ implementation 'com.googlecode.libphonenumber:libphonenumber:8.12.50'
testImplementation libs.tests.junit
// Note: version sticks to 1.9.2 due to https://github.com/mockk/mockk/issues/281
diff --git a/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/InstrumentedTest.kt b/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/InstrumentedTest.kt
index a763766821..f08f0a28ed 100644
--- a/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/InstrumentedTest.kt
+++ b/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/InstrumentedTest.kt
@@ -19,10 +19,14 @@ package org.matrix.android.sdk
import android.content.Context
import androidx.test.core.app.ApplicationProvider
import org.junit.Rule
+import org.matrix.android.sdk.common.RetryTestRule
import org.matrix.android.sdk.test.shared.createTimberTestRule
interface InstrumentedTest {
+ @Rule
+ fun retryTestRule() = RetryTestRule(3)
+
@Rule
fun timberTestRule() = createTimberTestRule()
diff --git a/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/common/CommonTestHelper.kt b/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/common/CommonTestHelper.kt
index fdfaceeb4d..7dafe33935 100644
--- a/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/common/CommonTestHelper.kt
+++ b/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/common/CommonTestHelper.kt
@@ -137,11 +137,11 @@ class CommonTestHelper private constructor(context: Context) {
fun syncSession(session: Session, timeout: Long = TestConstants.timeOutMillis * 10) {
val lock = CountDownLatch(1)
coroutineScope.launch {
- session.startSync(true)
- val syncLiveData = session.getSyncStateLive()
+ session.syncService().startSync(true)
+ val syncLiveData = session.syncService().getSyncStateLive()
val syncObserver = object : Observer {
override fun onChanged(t: SyncState?) {
- if (session.hasAlreadySynced()) {
+ if (session.syncService().hasAlreadySynced()) {
lock.countDown()
syncLiveData.removeObserver(this)
}
@@ -160,10 +160,10 @@ class CommonTestHelper private constructor(context: Context) {
fun clearCacheAndSync(session: Session, timeout: Long = TestConstants.timeOutMillis) {
waitWithLatch(timeout) { latch ->
session.clearCache()
- val syncLiveData = session.getSyncStateLive()
+ val syncLiveData = session.syncService().getSyncStateLive()
val syncObserver = object : Observer {
override fun onChanged(t: SyncState?) {
- if (session.hasAlreadySynced()) {
+ if (session.syncService().hasAlreadySynced()) {
Timber.v("Clear cache and synced")
syncLiveData.removeObserver(this)
latch.countDown()
@@ -171,7 +171,7 @@ class CommonTestHelper private constructor(context: Context) {
}
}
syncLiveData.observeForever(syncObserver)
- session.startSync(true)
+ session.syncService().startSync(true)
}
}
@@ -252,7 +252,8 @@ class CommonTestHelper private constructor(context: Context) {
message: String,
numberOfMessages: Int,
rootThreadEventId: String,
- timeout: Long = TestConstants.timeOutMillis): List {
+ timeout: Long = TestConstants.timeOutMillis
+ ): List {
val timeline = room.timelineService().createTimeline(null, TimelineSettings(10))
timeline.start()
val sentEvents = sendTextMessagesBatched(timeline, room, message, numberOfMessages, timeout, rootThreadEventId)
@@ -272,9 +273,11 @@ class CommonTestHelper private constructor(context: Context) {
* @param testParams test params about the session
* @return the session associated with the newly created account
*/
- private fun createAccount(userNamePrefix: String,
- password: String,
- testParams: SessionTestParams): Session {
+ private fun createAccount(
+ userNamePrefix: String,
+ password: String,
+ testParams: SessionTestParams
+ ): Session {
val session = createAccountAndSync(
userNamePrefix + "_" + accountNumber++ + "_" + UUID.randomUUID(),
password,
@@ -294,9 +297,11 @@ class CommonTestHelper private constructor(context: Context) {
* @param testParams test params about the session
* @return the session associated with the existing account
*/
- fun logIntoAccount(userId: String,
- password: String,
- testParams: SessionTestParams): Session {
+ fun logIntoAccount(
+ userId: String,
+ password: String,
+ testParams: SessionTestParams
+ ): Session {
val session = logAccountAndSync(userId, password, testParams)
assertNotNull(session)
return session.also {
@@ -311,9 +316,11 @@ class CommonTestHelper private constructor(context: Context) {
* @param password the password
* @param sessionTestParams parameters for the test
*/
- private fun createAccountAndSync(userName: String,
- password: String,
- sessionTestParams: SessionTestParams): Session {
+ private fun createAccountAndSync(
+ userName: String,
+ password: String,
+ sessionTestParams: SessionTestParams
+ ): Session {
val hs = createHomeServerConfig()
runBlockingTest {
@@ -349,9 +356,11 @@ class CommonTestHelper private constructor(context: Context) {
* @param password the password
* @param sessionTestParams session test params
*/
- private fun logAccountAndSync(userName: String,
- password: String,
- sessionTestParams: SessionTestParams): Session {
+ private fun logAccountAndSync(
+ userName: String,
+ password: String,
+ sessionTestParams: SessionTestParams
+ ): Session {
val hs = createHomeServerConfig()
runBlockingTest {
@@ -377,8 +386,10 @@ class CommonTestHelper private constructor(context: Context) {
* @param userName the account username
* @param password the password
*/
- fun logAccountWithError(userName: String,
- password: String): Throwable {
+ fun logAccountWithError(
+ userName: String,
+ password: String
+ ): Throwable {
val hs = createHomeServerConfig()
runBlockingTest {
diff --git a/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/common/CryptoTestData.kt b/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/common/CryptoTestData.kt
index b6bedbd719..41d0d3a7e8 100644
--- a/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/common/CryptoTestData.kt
+++ b/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/common/CryptoTestData.kt
@@ -18,8 +18,10 @@ package org.matrix.android.sdk.common
import org.matrix.android.sdk.api.session.Session
-data class CryptoTestData(val roomId: String,
- val sessions: List) {
+data class CryptoTestData(
+ val roomId: String,
+ val sessions: List
+) {
val firstSession: Session
get() = sessions.first()
diff --git a/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/common/MockOkHttpInterceptor.kt b/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/common/MockOkHttpInterceptor.kt
index b6d833a77c..6dfee2f18f 100644
--- a/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/common/MockOkHttpInterceptor.kt
+++ b/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/common/MockOkHttpInterceptor.kt
@@ -73,9 +73,11 @@ class MockOkHttpInterceptor : TestInterceptor {
/**
* Simple rule that reply with the given body for any request that matches the match param
*/
- class SimpleRule(match: String,
- private val code: Int = HttpsURLConnection.HTTP_OK,
- private val body: String = "{}") : Rule(match) {
+ class SimpleRule(
+ match: String,
+ private val code: Int = HttpsURLConnection.HTTP_OK,
+ private val body: String = "{}"
+ ) : Rule(match) {
override fun process(originalRequest: Request): Response? {
return Response.Builder()
diff --git a/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/common/TestMatrixCallback.kt b/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/common/TestMatrixCallback.kt
index 9f6d6eb136..a007d684e3 100644
--- a/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/common/TestMatrixCallback.kt
+++ b/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/common/TestMatrixCallback.kt
@@ -27,8 +27,10 @@ import java.util.concurrent.CountDownLatch
* @param onlySuccessful true to fail if an error occurs. This is the default behavior
* @param
*/
-open class TestMatrixCallback(private val countDownLatch: CountDownLatch,
- private val onlySuccessful: Boolean = true) : MatrixCallback {
+open class TestMatrixCallback(
+ private val countDownLatch: CountDownLatch,
+ private val onlySuccessful: Boolean = true
+) : MatrixCallback {
@CallSuper
override fun onSuccess(data: T) {
diff --git a/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/common/TestMatrixComponent.kt b/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/common/TestMatrixComponent.kt
index 525e168cf1..daf6b73313 100644
--- a/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/common/TestMatrixComponent.kt
+++ b/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/common/TestMatrixComponent.kt
@@ -47,7 +47,9 @@ internal interface TestMatrixComponent : MatrixComponent {
@Component.Factory
interface Factory {
- fun create(@BindsInstance context: Context,
- @BindsInstance matrixConfiguration: MatrixConfiguration): TestMatrixComponent
+ fun create(
+ @BindsInstance context: Context,
+ @BindsInstance matrixConfiguration: MatrixConfiguration
+ ): TestMatrixComponent
}
}
diff --git a/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/internal/crypto/AttachmentEncryptionTest.kt b/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/internal/crypto/AttachmentEncryptionTest.kt
index f5f585a1e0..17c7c28d81 100644
--- a/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/internal/crypto/AttachmentEncryptionTest.kt
+++ b/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/internal/crypto/AttachmentEncryptionTest.kt
@@ -22,6 +22,7 @@ import androidx.test.ext.junit.runners.AndroidJUnit4
import org.junit.Assert.assertEquals
import org.junit.Assert.assertNotEquals
import org.junit.FixMethodOrder
+import org.junit.Ignore
import org.junit.Test
import org.junit.runner.RunWith
import org.junit.runners.MethodSorters
@@ -40,6 +41,7 @@ import java.util.UUID
@Suppress("SpellCheckingInspection")
@RunWith(AndroidJUnit4::class)
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
+@Ignore
class AttachmentEncryptionTest {
private fun checkDecryption(input: String, encryptedFileInfo: EncryptedFileInfo): String {
diff --git a/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/internal/crypto/CryptoStoreTest.kt b/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/internal/crypto/CryptoStoreTest.kt
index cd6c146f03..dbc6929e34 100644
--- a/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/internal/crypto/CryptoStoreTest.kt
+++ b/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/internal/crypto/CryptoStoreTest.kt
@@ -22,6 +22,7 @@ import org.junit.Assert.assertEquals
import org.junit.Assert.assertNotEquals
import org.junit.Assert.assertNull
import org.junit.Before
+import org.junit.Ignore
import org.junit.Rule
import org.junit.Test
import org.junit.runner.RunWith
@@ -37,6 +38,7 @@ import org.matrix.olm.OlmSession
private const val DUMMY_DEVICE_KEY = "DeviceKey"
@RunWith(AndroidJUnit4::class)
+@Ignore
class CryptoStoreTest : InstrumentedTest {
@get:Rule val rule = RetryTestRule(3)
diff --git a/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/internal/crypto/E2eeSanityTests.kt b/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/internal/crypto/E2eeSanityTests.kt
index 010383dab8..5a61eee7fe 100644
--- a/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/internal/crypto/E2eeSanityTests.kt
+++ b/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/internal/crypto/E2eeSanityTests.kt
@@ -626,7 +626,7 @@ class E2eeSanityTests : InstrumentedTest {
// we can release this latch?
oldCompleteLatch.countDown()
}
- else -> Unit
+ else -> Unit
}
}
})
@@ -653,17 +653,17 @@ class E2eeSanityTests : InstrumentedTest {
IncomingSasVerificationTransaction.UxState.SHOW_ACCEPT -> {
// no need to accept as there was a request first it will auto accept
}
- IncomingSasVerificationTransaction.UxState.SHOW_SAS -> {
+ IncomingSasVerificationTransaction.UxState.SHOW_SAS -> {
if (matchOnce) {
sasTx.userHasVerifiedShortCode()
newCode = sasTx.getDecimalCodeRepresentation()
matchOnce = false
}
}
- IncomingSasVerificationTransaction.UxState.VERIFIED -> {
+ IncomingSasVerificationTransaction.UxState.VERIFIED -> {
newCompleteLatch.countDown()
}
- else -> Unit
+ else -> Unit
}
}
})
diff --git a/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/internal/crypto/ExportEncryptionTest.kt b/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/internal/crypto/ExportEncryptionTest.kt
index c2d8f4fb35..bddb31fc92 100644
--- a/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/internal/crypto/ExportEncryptionTest.kt
+++ b/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/internal/crypto/ExportEncryptionTest.kt
@@ -21,6 +21,7 @@ import org.junit.Assert.assertEquals
import org.junit.Assert.assertTrue
import org.junit.Assert.fail
import org.junit.FixMethodOrder
+import org.junit.Ignore
import org.junit.Test
import org.junit.runner.RunWith
import org.junit.runners.MethodSorters
@@ -30,6 +31,7 @@ import org.junit.runners.MethodSorters
*/
@RunWith(AndroidJUnit4::class)
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
+@Ignore
class ExportEncryptionTest {
@Test
@@ -83,7 +85,8 @@ class ExportEncryptionTest {
@Test
fun checkExportDecrypt1() {
val password = "password"
- val input = "-----BEGIN MEGOLM SESSION DATA-----\nAXNhbHRzYWx0c2FsdHNhbHSIiIiIiIiIiIiIiIiIiIiIAAAACmIRUW2OjZ3L2l6j9h0lHlV3M2dx\n" + "cissyYBxjsfsAndErh065A8=\n-----END MEGOLM SESSION DATA-----"
+ val input = "-----BEGIN MEGOLM SESSION DATA-----\nAXNhbHRzYWx0c2FsdHNhbHSIiIiIiIiIiIiIiIiIiIiIAAAACmIRUW2OjZ3L2l6j9h0lHlV3M2dx\n" +
+ "cissyYBxjsfsAndErh065A8=\n-----END MEGOLM SESSION DATA-----"
val expectedString = "plain"
var decodedString: String? = null
@@ -103,7 +106,8 @@ class ExportEncryptionTest {
@Test
fun checkExportDecrypt2() {
val password = "betterpassword"
- val input = "-----BEGIN MEGOLM SESSION DATA-----\nAW1vcmVzYWx0bW9yZXNhbHT//////////wAAAAAAAAAAAAAD6KyBpe1Niv5M5NPm4ZATsJo5nghk\n" + "KYu63a0YQ5DRhUWEKk7CcMkrKnAUiZny\n-----END MEGOLM SESSION DATA-----"
+ val input = "-----BEGIN MEGOLM SESSION DATA-----\nAW1vcmVzYWx0bW9yZXNhbHT//////////wAAAAAAAAAAAAAD6KyBpe1Niv5M5NPm4ZATsJo5nghk\n" +
+ "KYu63a0YQ5DRhUWEKk7CcMkrKnAUiZny\n-----END MEGOLM SESSION DATA-----"
val expectedString = "Hello, World"
var decodedString: String? = null
@@ -123,7 +127,8 @@ class ExportEncryptionTest {
@Test
fun checkExportDecrypt3() {
val password = "SWORDFISH"
- val input = "-----BEGIN MEGOLM SESSION DATA-----\nAXllc3NhbHR5Z29vZG5lc3P//////////wAAAAAAAAAAAAAD6OIW+Je7gwvjd4kYrb+49gKCfExw\n" + "MgJBMD4mrhLkmgAngwR1pHjbWXaoGybtiAYr0moQ93GrBQsCzPbvl82rZhaXO3iH5uHo/RCEpOqp\nPgg29363BGR+/Ripq/VCLKGNbw==\n-----END MEGOLM SESSION DATA-----"
+ val input = "-----BEGIN MEGOLM SESSION DATA-----\nAXllc3NhbHR5Z29vZG5lc3P//////////wAAAAAAAAAAAAAD6OIW+Je7gwvjd4kYrb+49gKCfExw\n" +
+ "MgJBMD4mrhLkmgAngwR1pHjbWXaoGybtiAYr0moQ93GrBQsCzPbvl82rZhaXO3iH5uHo/RCEpOqp\nPgg29363BGR+/Ripq/VCLKGNbw==\n-----END MEGOLM SESSION DATA-----"
val expectedString = "alphanumericallyalphanumericallyalphanumericallyalphanumerically"
var decodedString: String? = null
@@ -202,7 +207,8 @@ class ExportEncryptionTest {
@Test
fun checkExportEncrypt4() {
- val password = "passwordpasswordpasswordpasswordpasswordpasswordpasswordpasswordpasswordpasswordpasswordpasswordpasswordpasswordpasswordpassword" + "passwordpasswordpasswordpasswordpasswordpasswordpasswordpasswordpasswordpasswordpasswordpasswordpasswordpasswordpasswordpassword"
+ val password = "passwordpasswordpasswordpasswordpasswordpasswordpasswordpasswordpasswordpasswordpasswordpasswordpasswordpasswordpasswordpassword" +
+ "passwordpasswordpasswordpasswordpasswordpasswordpasswordpasswordpasswordpasswordpasswordpasswordpasswordpasswordpasswordpassword"
val expectedString = "alphanumericallyalphanumericallyalphanumericallyalphanumerically"
var decodedString: String? = null
diff --git a/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/internal/crypto/UnwedgingTest.kt b/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/internal/crypto/UnwedgingTest.kt
index 5fe7376184..e8a474a54a 100644
--- a/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/internal/crypto/UnwedgingTest.kt
+++ b/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/internal/crypto/UnwedgingTest.kt
@@ -21,6 +21,7 @@ import org.amshove.kluent.shouldBe
import org.junit.Assert
import org.junit.Before
import org.junit.FixMethodOrder
+import org.junit.Ignore
import org.junit.Test
import org.junit.runner.RunWith
import org.junit.runners.MethodSorters
@@ -59,6 +60,7 @@ import kotlin.coroutines.resume
*/
@RunWith(AndroidJUnit4::class)
@FixMethodOrder(MethodSorters.JVM)
+@Ignore
class UnwedgingTest : InstrumentedTest {
private lateinit var messagesReceivedByBob: List
diff --git a/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/internal/crypto/crosssigning/XSigningTest.kt b/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/internal/crypto/crosssigning/XSigningTest.kt
index 05790bfb7d..8cb38ddc87 100644
--- a/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/internal/crypto/crosssigning/XSigningTest.kt
+++ b/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/internal/crypto/crosssigning/XSigningTest.kt
@@ -25,6 +25,7 @@ import org.junit.Assert.assertNull
import org.junit.Assert.assertTrue
import org.junit.Assert.fail
import org.junit.FixMethodOrder
+import org.junit.Ignore
import org.junit.Test
import org.junit.runner.RunWith
import org.junit.runners.MethodSorters
@@ -47,6 +48,7 @@ import kotlin.coroutines.resume
@RunWith(AndroidJUnit4::class)
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
@LargeTest
+@Ignore
class XSigningTest : InstrumentedTest {
@Test
diff --git a/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/internal/crypto/gossiping/KeyShareTests.kt b/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/internal/crypto/gossiping/KeyShareTests.kt
index b16e4b82eb..7bb53e139c 100644
--- a/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/internal/crypto/gossiping/KeyShareTests.kt
+++ b/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/internal/crypto/gossiping/KeyShareTests.kt
@@ -25,6 +25,7 @@ import org.amshove.kluent.internal.assertEquals
import org.junit.Assert
import org.junit.Assert.assertNull
import org.junit.FixMethodOrder
+import org.junit.Ignore
import org.junit.Rule
import org.junit.Test
import org.junit.runner.RunWith
@@ -50,6 +51,7 @@ import org.matrix.android.sdk.mustFail
@RunWith(AndroidJUnit4::class)
@FixMethodOrder(MethodSorters.JVM)
@LargeTest
+@Ignore
class KeyShareTests : InstrumentedTest {
@get:Rule val rule = RetryTestRule(3)
@@ -422,7 +424,7 @@ class KeyShareTests : InstrumentedTest {
// /!\ Stop initial alice session syncing so that it can't reply
aliceSession.cryptoService().enableKeyGossiping(false)
- aliceSession.stopSync()
+ aliceSession.syncService().stopSync()
// Let's now try to request
aliceNewSession.cryptoService().reRequestRoomKeyForEvent(sentEvents.first().root)
@@ -445,7 +447,7 @@ class KeyShareTests : InstrumentedTest {
// let's wake up alice
aliceSession.cryptoService().enableKeyGossiping(true)
- aliceSession.startSync(true)
+ aliceSession.syncService().startSync(true)
// We should now get a reply from first session
commonTestHelper.waitWithLatch { latch ->
diff --git a/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/internal/crypto/gossiping/WithHeldTests.kt b/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/internal/crypto/gossiping/WithHeldTests.kt
index 0aac4297e4..ae420a09b3 100644
--- a/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/internal/crypto/gossiping/WithHeldTests.kt
+++ b/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/internal/crypto/gossiping/WithHeldTests.kt
@@ -21,6 +21,7 @@ import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.LargeTest
import org.junit.Assert
import org.junit.FixMethodOrder
+import org.junit.Ignore
import org.junit.Rule
import org.junit.Test
import org.junit.runner.RunWith
@@ -46,6 +47,7 @@ import org.matrix.android.sdk.mustFail
@RunWith(AndroidJUnit4::class)
@FixMethodOrder(MethodSorters.JVM)
@LargeTest
+@Ignore
class WithHeldTests : InstrumentedTest {
@get:Rule val rule = RetryTestRule(3)
diff --git a/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/internal/crypto/keysbackup/KeysBackupTest.kt b/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/internal/crypto/keysbackup/KeysBackupTest.kt
index c6e17e8c44..fb498e0de5 100644
--- a/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/internal/crypto/keysbackup/KeysBackupTest.kt
+++ b/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/internal/crypto/keysbackup/KeysBackupTest.kt
@@ -24,6 +24,7 @@ import org.junit.Assert.assertNotNull
import org.junit.Assert.assertNull
import org.junit.Assert.assertTrue
import org.junit.FixMethodOrder
+import org.junit.Ignore
import org.junit.Rule
import org.junit.Test
import org.junit.runner.RunWith
@@ -55,6 +56,7 @@ import java.util.concurrent.CountDownLatch
@RunWith(AndroidJUnit4::class)
@FixMethodOrder(MethodSorters.JVM)
@LargeTest
+@Ignore
class KeysBackupTest : InstrumentedTest {
@get:Rule val rule = RetryTestRule(3)
diff --git a/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/internal/crypto/keysbackup/KeysBackupTestHelper.kt b/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/internal/crypto/keysbackup/KeysBackupTestHelper.kt
index 4eccdfad1f..38f94c5103 100644
--- a/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/internal/crypto/keysbackup/KeysBackupTestHelper.kt
+++ b/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/internal/crypto/keysbackup/KeysBackupTestHelper.kt
@@ -33,7 +33,8 @@ import java.util.concurrent.CountDownLatch
internal class KeysBackupTestHelper(
private val testHelper: CommonTestHelper,
- private val cryptoTestHelper: CryptoTestHelper) {
+ private val cryptoTestHelper: CryptoTestHelper
+) {
fun waitForKeybackUpBatching() {
Thread.sleep(400)
@@ -96,8 +97,10 @@ internal class KeysBackupTestHelper(
)
}
- fun prepareAndCreateKeysBackupData(keysBackup: KeysBackupService,
- password: String? = null): PrepareKeysBackupDataResult {
+ fun prepareAndCreateKeysBackupData(
+ keysBackup: KeysBackupService,
+ password: String? = null
+ ): PrepareKeysBackupDataResult {
val stateObserver = StateObserver(keysBackup)
val megolmBackupCreationInfo = testHelper.doSync {
@@ -169,9 +172,11 @@ internal class KeysBackupTestHelper(
* - The new device must have the same count of megolm keys
* - Alice must have the same keys on both devices
*/
- fun checkRestoreSuccess(testData: KeysBackupScenarioData,
- total: Int,
- imported: Int) {
+ fun checkRestoreSuccess(
+ testData: KeysBackupScenarioData,
+ total: Int,
+ imported: Int
+ ) {
// - Imported keys number must be correct
Assert.assertEquals(testData.aliceKeys.size, total)
Assert.assertEquals(total, imported)
diff --git a/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/internal/crypto/keysbackup/PrepareKeysBackupDataResult.kt b/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/internal/crypto/keysbackup/PrepareKeysBackupDataResult.kt
index 31bd3c9cce..9ee10eddcf 100644
--- a/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/internal/crypto/keysbackup/PrepareKeysBackupDataResult.kt
+++ b/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/internal/crypto/keysbackup/PrepareKeysBackupDataResult.kt
@@ -18,5 +18,7 @@ package org.matrix.android.sdk.internal.crypto.keysbackup
import org.matrix.android.sdk.api.session.crypto.keysbackup.MegolmBackupCreationInfo
-data class PrepareKeysBackupDataResult(val megolmBackupCreationInfo: MegolmBackupCreationInfo,
- val version: String)
+data class PrepareKeysBackupDataResult(
+ val megolmBackupCreationInfo: MegolmBackupCreationInfo,
+ val version: String
+)
diff --git a/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/internal/crypto/keysbackup/StateObserver.kt b/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/internal/crypto/keysbackup/StateObserver.kt
index 80e54d82ec..6c97774547 100644
--- a/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/internal/crypto/keysbackup/StateObserver.kt
+++ b/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/internal/crypto/keysbackup/StateObserver.kt
@@ -27,9 +27,11 @@ import java.util.concurrent.CountDownLatch
* This class observe the state change of a KeysBackup object and provide a method to check the several state change
* It checks all state transitions and detected forbidden transition
*/
-internal class StateObserver(private val keysBackup: KeysBackupService,
- private val latch: CountDownLatch? = null,
- private val expectedStateChange: Int = -1) : KeysBackupStateListener {
+internal class StateObserver(
+ private val keysBackup: KeysBackupService,
+ private val latch: CountDownLatch? = null,
+ private val expectedStateChange: Int = -1
+) : KeysBackupStateListener {
private val allowedStateTransitions = listOf(
KeysBackupState.BackingUp to KeysBackupState.ReadyToBackUp,
diff --git a/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/internal/crypto/verification/SASTest.kt b/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/internal/crypto/verification/SASTest.kt
index c4d9ba4ee3..c2e74abc59 100644
--- a/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/internal/crypto/verification/SASTest.kt
+++ b/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/internal/crypto/verification/SASTest.kt
@@ -52,6 +52,7 @@ import java.util.concurrent.CountDownLatch
@RunWith(AndroidJUnit4::class)
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
+@Ignore
class SASTest : InstrumentedTest {
@Test
@@ -264,14 +265,16 @@ class SASTest : InstrumentedTest {
assertEquals("Request should be cancelled with m.unknown_method", CancelCode.UnknownMethod.value, cancelReq.code)
}
- private fun fakeBobStart(bobSession: Session,
- aliceUserID: String?,
- aliceDevice: String?,
- tid: String,
- protocols: List = SASDefaultVerificationTransaction.KNOWN_AGREEMENT_PROTOCOLS,
- hashes: List = SASDefaultVerificationTransaction.KNOWN_HASHES,
- mac: List = SASDefaultVerificationTransaction.KNOWN_MACS,
- codes: List = SASDefaultVerificationTransaction.KNOWN_SHORT_CODES) {
+ private fun fakeBobStart(
+ bobSession: Session,
+ aliceUserID: String?,
+ aliceDevice: String?,
+ tid: String,
+ protocols: List = SASDefaultVerificationTransaction.KNOWN_AGREEMENT_PROTOCOLS,
+ hashes: List = SASDefaultVerificationTransaction.KNOWN_HASHES,
+ mac: List = SASDefaultVerificationTransaction.KNOWN_MACS,
+ codes: List = SASDefaultVerificationTransaction.KNOWN_SHORT_CODES
+ ) {
val startMessage = KeyVerificationStart(
fromDevice = bobSession.cryptoService().getMyDevice().deviceId,
method = VerificationMethod.SAS.toValue(),
@@ -412,7 +415,7 @@ class SASTest : InstrumentedTest {
OutgoingSasVerificationTransaction.UxState.SHOW_SAS -> {
aliceSASLatch.countDown()
}
- else -> Unit
+ else -> Unit
}
}
}
@@ -426,7 +429,7 @@ class SASTest : InstrumentedTest {
IncomingSasVerificationTransaction.UxState.SHOW_ACCEPT -> {
tx.performAccept()
}
- else -> Unit
+ else -> Unit
}
if (uxState === IncomingSasVerificationTransaction.UxState.SHOW_SAS) {
bobSASLatch.countDown()
@@ -476,7 +479,7 @@ class SASTest : InstrumentedTest {
aliceSASLatch.countDown()
}
}
- else -> Unit
+ else -> Unit
}
}
}
@@ -496,16 +499,16 @@ class SASTest : InstrumentedTest {
tx.performAccept()
}
}
- IncomingSasVerificationTransaction.UxState.SHOW_SAS -> {
+ IncomingSasVerificationTransaction.UxState.SHOW_SAS -> {
if (matchOnce) {
matchOnce = false
tx.userHasVerifiedShortCode()
}
}
- IncomingSasVerificationTransaction.UxState.VERIFIED -> {
+ IncomingSasVerificationTransaction.UxState.VERIFIED -> {
bobSASLatch.countDown()
}
- else -> Unit
+ else -> Unit
}
}
}
diff --git a/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/internal/crypto/verification/qrcode/VerificationTest.kt b/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/internal/crypto/verification/qrcode/VerificationTest.kt
index 462f47cafc..3f22906965 100644
--- a/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/internal/crypto/verification/qrcode/VerificationTest.kt
+++ b/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/internal/crypto/verification/qrcode/VerificationTest.kt
@@ -19,6 +19,7 @@ package org.matrix.android.sdk.internal.crypto.verification.qrcode
import androidx.test.ext.junit.runners.AndroidJUnit4
import org.amshove.kluent.shouldBe
import org.junit.FixMethodOrder
+import org.junit.Ignore
import org.junit.Test
import org.junit.runner.RunWith
import org.junit.runners.MethodSorters
@@ -41,6 +42,7 @@ import kotlin.coroutines.resume
@RunWith(AndroidJUnit4::class)
@FixMethodOrder(MethodSorters.JVM)
+@Ignore
class VerificationTest : InstrumentedTest {
data class ExpectedResult(
@@ -151,10 +153,12 @@ class VerificationTest : InstrumentedTest {
// TODO Add tests without SAS
- private fun doTest(aliceSupportedMethods: List,
- bobSupportedMethods: List,
- expectedResultForAlice: ExpectedResult,
- expectedResultForBob: ExpectedResult) = runCryptoTest(context()) { cryptoTestHelper, testHelper ->
+ private fun doTest(
+ aliceSupportedMethods: List,
+ bobSupportedMethods: List,
+ expectedResultForAlice: ExpectedResult,
+ expectedResultForBob: ExpectedResult
+ ) = runCryptoTest(context()) { cryptoTestHelper, testHelper ->
val cryptoTestData = cryptoTestHelper.doE2ETestWithAliceAndBobInARoom()
val aliceSession = cryptoTestData.firstSession
diff --git a/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/internal/session/room/send/MarkdownParserTest.kt b/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/internal/session/room/send/MarkdownParserTest.kt
index acb23bf723..0560cfec95 100644
--- a/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/internal/session/room/send/MarkdownParserTest.kt
+++ b/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/internal/session/room/send/MarkdownParserTest.kt
@@ -289,9 +289,11 @@ class MarkdownParserTest : InstrumentedTest {
markdownParser.parse(text).expect(text, null)
}
- private fun testType(name: String,
- markdownPattern: String,
- htmlExpectedTag: String) {
+ private fun testType(
+ name: String,
+ markdownPattern: String,
+ htmlExpectedTag: String
+ ) {
// Test simple case
"$markdownPattern$name$markdownPattern"
.let {
@@ -376,10 +378,12 @@ class MarkdownParserTest : InstrumentedTest {
}
}
- private fun testTypeNewLines(name: String,
- markdownPattern: String,
- htmlExpectedTag: String,
- softBreak: String = "
") {
+ private fun testTypeNewLines(
+ name: String,
+ markdownPattern: String,
+ htmlExpectedTag: String,
+ softBreak: String = "
"
+ ) {
// With new line inside the block
"$markdownPattern$name\n$name$markdownPattern"
.let {
diff --git a/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/internal/session/room/send/TestPermalinkService.kt b/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/internal/session/room/send/TestPermalinkService.kt
index 2f9a5e0a73..3a267ec694 100644
--- a/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/internal/session/room/send/TestPermalinkService.kt
+++ b/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/internal/session/room/send/TestPermalinkService.kt
@@ -44,7 +44,7 @@ class TestPermalinkService : PermalinkService {
override fun createMentionSpanTemplate(type: PermalinkService.SpanTemplateType, forceMatrixTo: Boolean): String {
return when (type) {
- HTML -> "%2\$s"
+ HTML -> "%2\$s"
MARKDOWN -> "[%2\$s](https://matrix.to/#/%1\$s)"
}
}
diff --git a/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/session/room/threads/ThreadMessagingTest.kt b/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/session/room/threads/ThreadMessagingTest.kt
index 1ffcc2a3e6..45bd38870d 100644
--- a/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/session/room/threads/ThreadMessagingTest.kt
+++ b/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/session/room/threads/ThreadMessagingTest.kt
@@ -83,7 +83,7 @@ class ThreadMessagingTest : InstrumentedTest {
val timeline = aliceRoom.timelineService().createTimeline(null, TimelineSettings(30))
timeline.start()
- aliceSession.startSync(true)
+ aliceSession.syncService().startSync(true)
run {
val lock = CountDownLatch(1)
val eventsListener = commonTestHelper.createEventListener(lock) { snapshot ->
@@ -97,7 +97,7 @@ class ThreadMessagingTest : InstrumentedTest {
timeline.addListener(eventsListener)
commonTestHelper.await(lock, 600_000)
}
- aliceSession.stopSync()
+ aliceSession.syncService().stopSync()
}
@Test
@@ -144,7 +144,7 @@ class ThreadMessagingTest : InstrumentedTest {
val timeline = aliceRoom.timelineService().createTimeline(null, TimelineSettings(30))
timeline.start()
- aliceSession.startSync(true)
+ aliceSession.syncService().startSync(true)
run {
val lock = CountDownLatch(1)
val eventsListener = commonTestHelper.createEventListener(lock) { snapshot ->
@@ -156,9 +156,9 @@ class ThreadMessagingTest : InstrumentedTest {
timeline.addListener(eventsListener)
commonTestHelper.await(lock, 600_000)
}
- aliceSession.stopSync()
+ aliceSession.syncService().stopSync()
- bobSession.startSync(true)
+ bobSession.syncService().startSync(true)
run {
val lock = CountDownLatch(1)
val eventsListener = commonTestHelper.createEventListener(lock) { snapshot ->
@@ -170,7 +170,7 @@ class ThreadMessagingTest : InstrumentedTest {
timeline.addListener(eventsListener)
commonTestHelper.await(lock, 600_000)
}
- bobSession.stopSync()
+ bobSession.syncService().stopSync()
}
@Test
@@ -217,7 +217,7 @@ class ThreadMessagingTest : InstrumentedTest {
val timeline = aliceRoom.timelineService().createTimeline(null, TimelineSettings(30))
timeline.start()
- aliceSession.startSync(true)
+ aliceSession.syncService().startSync(true)
run {
val lock = CountDownLatch(1)
val eventsListener = commonTestHelper.createEventListener(lock) { snapshot ->
@@ -233,7 +233,7 @@ class ThreadMessagingTest : InstrumentedTest {
timeline.addListener(eventsListener)
commonTestHelper.await(lock, 600_000)
}
- aliceSession.stopSync()
+ aliceSession.syncService().stopSync()
}
@Test
@@ -314,7 +314,7 @@ class ThreadMessagingTest : InstrumentedTest {
val timeline = aliceRoom.timelineService().createTimeline(null, TimelineSettings(30))
timeline.start()
- aliceSession.startSync(true)
+ aliceSession.syncService().startSync(true)
run {
val lock = CountDownLatch(1)
val eventsListener = commonTestHelper.createEventListener(lock) { snapshot ->
@@ -338,6 +338,6 @@ class ThreadMessagingTest : InstrumentedTest {
timeline.addListener(eventsListener)
commonTestHelper.await(lock, 600_000)
}
- aliceSession.stopSync()
+ aliceSession.syncService().stopSync()
}
}
diff --git a/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/session/room/timeline/ChunkEntityTest.kt b/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/session/room/timeline/ChunkEntityTest.kt
index 94b2ba55a3..986d58741c 100644
--- a/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/session/room/timeline/ChunkEntityTest.kt
+++ b/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/session/room/timeline/ChunkEntityTest.kt
@@ -154,9 +154,11 @@ internal class ChunkEntityTest : InstrumentedTest {
}
}
- private fun ChunkEntity.addAll(roomId: String,
- events: List,
- direction: PaginationDirection) {
+ private fun ChunkEntity.addAll(
+ roomId: String,
+ events: List,
+ direction: PaginationDirection
+ ) {
events.forEach { event ->
val fakeEvent = event.toEntity(roomId, SendState.SYNCED, clock.epochMillis()).let {
realm.copyToRealm(it)
diff --git a/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/session/room/timeline/FakeTokenChunkEvent.kt b/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/session/room/timeline/FakeTokenChunkEvent.kt
index 657f622c5b..2e9478ba7e 100644
--- a/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/session/room/timeline/FakeTokenChunkEvent.kt
+++ b/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/session/room/timeline/FakeTokenChunkEvent.kt
@@ -19,8 +19,9 @@ package org.matrix.android.sdk.session.room.timeline
import org.matrix.android.sdk.api.session.events.model.Event
import org.matrix.android.sdk.internal.session.room.timeline.TokenChunkEvent
-internal data class FakeTokenChunkEvent(override val start: String?,
- override val end: String?,
- override val events: List = emptyList(),
- override val stateEvents: List = emptyList()
+internal data class FakeTokenChunkEvent(
+ override val start: String?,
+ override val end: String?,
+ override val events: List = emptyList(),
+ override val stateEvents: List = emptyList()
) : TokenChunkEvent
diff --git a/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/session/room/timeline/PollAggregationTest.kt b/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/session/room/timeline/PollAggregationTest.kt
index 2b72ecc52a..a37d2ce015 100644
--- a/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/session/room/timeline/PollAggregationTest.kt
+++ b/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/session/room/timeline/PollAggregationTest.kt
@@ -57,7 +57,7 @@ class PollAggregationTest : InstrumentedTest {
// Bob creates a poll
roomFromBobPOV.sendService().sendPoll(PollType.DISCLOSED, pollQuestion, pollOptions)
- aliceSession.startSync(true)
+ aliceSession.syncService().startSync(true)
val aliceTimeline = roomFromAlicePOV.timelineService().createTimeline(null, TimelineSettings(30))
aliceTimeline.start()
@@ -77,7 +77,7 @@ class PollAggregationTest : InstrumentedTest {
}
when (lock.count.toInt()) {
- TOTAL_TEST_COUNT -> {
+ TOTAL_TEST_COUNT -> {
// Poll has just been created.
testInitialPollConditions(pollContent, pollSummary)
lock.countDown()
@@ -119,7 +119,7 @@ class PollAggregationTest : InstrumentedTest {
testEndedPoll(pollSummary)
lock.countDown()
}
- else -> {
+ else -> {
fail("Lock count ${lock.count} didn't handled.")
}
}
@@ -133,7 +133,7 @@ class PollAggregationTest : InstrumentedTest {
aliceTimeline.removeAllListeners()
- aliceSession.stopSync()
+ aliceSession.syncService().stopSync()
aliceTimeline.dispose()
}
diff --git a/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/session/room/timeline/RoomDataHelper.kt b/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/session/room/timeline/RoomDataHelper.kt
index 8a4429db45..53585ae82a 100644
--- a/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/session/room/timeline/RoomDataHelper.kt
+++ b/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/session/room/timeline/RoomDataHelper.kt
@@ -41,11 +41,12 @@ object RoomDataHelper {
}
}
- private fun createFakeEvent(type: String,
- content: Content? = null,
- prevContent: Content? = null,
- sender: String = FAKE_TEST_SENDER,
- stateKey: String? = null
+ private fun createFakeEvent(
+ type: String,
+ content: Content? = null,
+ prevContent: Content? = null,
+ sender: String = FAKE_TEST_SENDER,
+ stateKey: String? = null
): Event {
return Event(
type = type,
diff --git a/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/session/room/timeline/TimelinePreviousLastForwardTest.kt b/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/session/room/timeline/TimelinePreviousLastForwardTest.kt
index 3ff4572add..03ab6e6767 100644
--- a/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/session/room/timeline/TimelinePreviousLastForwardTest.kt
+++ b/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/session/room/timeline/TimelinePreviousLastForwardTest.kt
@@ -88,7 +88,7 @@ class TimelinePreviousLastForwardTest : InstrumentedTest {
}
// Bob stop to sync
- bobSession.stopSync()
+ bobSession.syncService().stopSync()
val firstMessage = "First messages from Alice"
// Alice sends 30 messages
@@ -101,7 +101,7 @@ class TimelinePreviousLastForwardTest : InstrumentedTest {
.eventId
// Bob start to sync
- bobSession.startSync(true)
+ bobSession.syncService().startSync(true)
run {
val lock = CountDownLatch(1)
@@ -125,7 +125,7 @@ class TimelinePreviousLastForwardTest : InstrumentedTest {
}
// Bob stop to sync
- bobSession.stopSync()
+ bobSession.syncService().stopSync()
val secondMessage = "Second messages from Alice"
// Alice sends again 30 messages
@@ -136,7 +136,7 @@ class TimelinePreviousLastForwardTest : InstrumentedTest {
)
// Bob start to sync
- bobSession.startSync(true)
+ bobSession.syncService().startSync(true)
run {
val lock = CountDownLatch(1)
diff --git a/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/session/room/timeline/TimelineSimpleBackPaginationTest.kt b/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/session/room/timeline/TimelineSimpleBackPaginationTest.kt
index 7ed0be927c..59b3b14532 100644
--- a/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/session/room/timeline/TimelineSimpleBackPaginationTest.kt
+++ b/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/session/room/timeline/TimelineSimpleBackPaginationTest.kt
@@ -20,6 +20,7 @@ import androidx.test.filters.LargeTest
import kotlinx.coroutines.runBlocking
import org.amshove.kluent.internal.assertEquals
import org.junit.FixMethodOrder
+import org.junit.Ignore
import org.junit.Test
import org.junit.runner.RunWith
import org.junit.runners.JUnit4
@@ -38,6 +39,7 @@ import org.matrix.android.sdk.common.TestConstants
@RunWith(JUnit4::class)
@FixMethodOrder(MethodSorters.JVM)
@LargeTest
+@Ignore
class TimelineSimpleBackPaginationTest : InstrumentedTest {
@Test
diff --git a/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/session/room/timeline/TimelineWithManyMembersTest.kt b/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/session/room/timeline/TimelineWithManyMembersTest.kt
index 87f404b0f1..27ea0e1c3c 100644
--- a/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/session/room/timeline/TimelineWithManyMembersTest.kt
+++ b/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/session/room/timeline/TimelineWithManyMembersTest.kt
@@ -71,7 +71,7 @@ class TimelineWithManyMembersTest : InstrumentedTest {
val timelineForCurrentMember = roomForCurrentMember.timelineService().createTimeline(null, TimelineSettings(30))
timelineForCurrentMember.start()
- session.startSync(true)
+ session.syncService().startSync(true)
run {
val lock = CountDownLatch(1)
@@ -92,7 +92,7 @@ class TimelineWithManyMembersTest : InstrumentedTest {
timelineForCurrentMember.addListener(eventsListener)
commonTestHelper.await(lock, 600_000)
}
- session.stopSync()
+ session.syncService().stopSync()
}
}
}
diff --git a/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/session/space/SpaceCreationTest.kt b/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/session/space/SpaceCreationTest.kt
index 0d8a9058a2..0cc0ef57c4 100644
--- a/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/session/space/SpaceCreationTest.kt
+++ b/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/session/space/SpaceCreationTest.kt
@@ -22,6 +22,7 @@ import kotlinx.coroutines.runBlocking
import org.junit.Assert.assertEquals
import org.junit.Assert.assertNotNull
import org.junit.FixMethodOrder
+import org.junit.Ignore
import org.junit.Test
import org.junit.runner.RunWith
import org.junit.runners.JUnit4
@@ -98,6 +99,7 @@ class SpaceCreationTest : InstrumentedTest {
}
@Test
+ @Ignore
fun testJoinSimplePublicSpace() = runSessionTest(context()) { commonTestHelper ->
val aliceSession = commonTestHelper.createAccount("alice", SessionTestParams(true))
diff --git a/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/session/space/SpaceHierarchyTest.kt b/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/session/space/SpaceHierarchyTest.kt
index f16cd91e36..5396251438 100644
--- a/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/session/space/SpaceHierarchyTest.kt
+++ b/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/session/space/SpaceHierarchyTest.kt
@@ -387,9 +387,10 @@ class SpaceHierarchyTest : InstrumentedTest {
val roomIds: List
)
- private fun createPublicSpace(session: Session,
- spaceName: String,
- childInfo: List>
+ private fun createPublicSpace(
+ session: Session,
+ spaceName: String,
+ childInfo: List>
/** Name, auto-join, canonical*/
): TestSpaceCreationResult {
var spaceId = ""
@@ -416,9 +417,10 @@ class SpaceHierarchyTest : InstrumentedTest {
return TestSpaceCreationResult(spaceId, roomIds)
}
- private fun createPrivateSpace(session: Session,
- spaceName: String,
- childInfo: List>
+ private fun createPrivateSpace(
+ session: Session,
+ spaceName: String,
+ childInfo: List>
/** Name, auto-join, canonical*/
): TestSpaceCreationResult {
var spaceId = ""
diff --git a/matrix-sdk-android/src/main/java/org/commonmark/ext/maths/InlineMaths.kt b/matrix-sdk-android/src/main/java/org/commonmark/ext/maths/InlineMaths.kt
index 3fe8d15696..556579942b 100644
--- a/matrix-sdk-android/src/main/java/org/commonmark/ext/maths/InlineMaths.kt
+++ b/matrix-sdk-android/src/main/java/org/commonmark/ext/maths/InlineMaths.kt
@@ -26,14 +26,14 @@ internal class InlineMaths(private val delimiter: InlineDelimiter) : CustomNode(
override fun getOpeningDelimiter(): String {
return when (delimiter) {
- InlineDelimiter.SINGLE_DOLLAR -> "$"
+ InlineDelimiter.SINGLE_DOLLAR -> "$"
InlineDelimiter.ROUND_BRACKET_ESCAPED -> "\\("
}
}
override fun getClosingDelimiter(): String {
return when (delimiter) {
- InlineDelimiter.SINGLE_DOLLAR -> "$"
+ InlineDelimiter.SINGLE_DOLLAR -> "$"
InlineDelimiter.ROUND_BRACKET_ESCAPED -> "\\)"
}
}
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/auth/AuthenticationService.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/auth/AuthenticationService.kt
index 629d947bb3..5ae70e1978 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/auth/AuthenticationService.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/auth/AuthenticationService.kt
@@ -28,9 +28,11 @@ import org.matrix.android.sdk.api.session.Session
* This interface defines methods to authenticate or to create an account to a matrix server.
*/
interface AuthenticationService {
+
/**
* Request the supported login flows for this homeserver.
- * This is the first method to call to be able to get a wizard to login or to create an account
+ * This is the first method to call to be able to get a wizard to login or to create an account.
+ * @param homeServerConnectionConfig contains the homeserver URL to login to, a wellKnown lookup will be attempted.
*/
suspend fun getLoginFlow(homeServerConnectionConfig: HomeServerConnectionConfig): LoginFlowResult
@@ -93,14 +95,18 @@ interface AuthenticationService {
/**
* Create a session after a SSO successful login.
*/
- suspend fun createSessionFromSso(homeServerConnectionConfig: HomeServerConnectionConfig,
- credentials: Credentials): Session
+ suspend fun createSessionFromSso(
+ homeServerConnectionConfig: HomeServerConnectionConfig,
+ credentials: Credentials
+ ): Session
/**
* Perform a wellknown request, using the domain from the matrixId.
*/
- suspend fun getWellKnownData(matrixId: String,
- homeServerConnectionConfig: HomeServerConnectionConfig?): WellknownResult
+ suspend fun getWellKnownData(
+ matrixId: String,
+ homeServerConnectionConfig: HomeServerConnectionConfig?
+ ): WellknownResult
/**
* Authenticate with a matrixId and a password.
@@ -111,9 +117,11 @@ interface AuthenticationService {
* @param initialDeviceName the initial device name
* @param deviceId the device id, optional. If not provided or null, the server will generate one.
*/
- suspend fun directAuthentication(homeServerConnectionConfig: HomeServerConnectionConfig,
- matrixId: String,
- password: String,
- initialDeviceName: String,
- deviceId: String? = null): Session
+ suspend fun directAuthentication(
+ homeServerConnectionConfig: HomeServerConnectionConfig,
+ matrixId: String,
+ password: String,
+ initialDeviceName: String,
+ deviceId: String? = null
+ ): Session
}
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/auth/converter.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/auth/converter.kt
index 80630bc4e7..e2f16ceee8 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/auth/converter.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/auth/converter.kt
@@ -41,8 +41,10 @@ import org.matrix.android.sdk.api.auth.registration.TermPolicies
* @param userLanguage the user language
* @param defaultLanguage the default language to use if the user language is not found for a policy in registrationFlowResponse
*/
-fun TermPolicies.toLocalizedLoginTerms(userLanguage: String,
- defaultLanguage: String = "en"): List {
+fun TermPolicies.toLocalizedLoginTerms(
+ userLanguage: String,
+ defaultLanguage: String = "en"
+): List {
val result = ArrayList()
val policies = get("policies")
@@ -67,8 +69,8 @@ fun TermPolicies.toLocalizedLoginTerms(userLanguage: String,
// Search for language
policy.keys.forEach { policyKey ->
when (policyKey) {
- "version" -> Unit // Ignore
- userLanguage -> {
+ "version" -> Unit // Ignore
+ userLanguage -> {
// We found the data for the user language
userLanguageUrlAndName = extractUrlAndName(policy[policyKey])
}
@@ -76,7 +78,7 @@ fun TermPolicies.toLocalizedLoginTerms(userLanguage: String,
// We found default language
defaultLanguageUrlAndName = extractUrlAndName(policy[policyKey])
}
- else -> {
+ else -> {
if (firstUrlAndName == null) {
// Get at least some data
firstUrlAndName = extractUrlAndName(policy[policyKey])
@@ -87,7 +89,7 @@ fun TermPolicies.toLocalizedLoginTerms(userLanguage: String,
// Copy found language data by priority
when {
- userLanguageUrlAndName != null -> {
+ userLanguageUrlAndName != null -> {
localizedFlowDataLoginTermsLocalizedUrl = userLanguageUrlAndName!!.url
localizedFlowDataLoginTermsLocalizedName = userLanguageUrlAndName!!.name
}
@@ -95,7 +97,7 @@ fun TermPolicies.toLocalizedLoginTerms(userLanguage: String,
localizedFlowDataLoginTermsLocalizedUrl = defaultLanguageUrlAndName!!.url
localizedFlowDataLoginTermsLocalizedName = defaultLanguageUrlAndName!!.name
}
- firstUrlAndName != null -> {
+ firstUrlAndName != null -> {
localizedFlowDataLoginTermsLocalizedUrl = firstUrlAndName!!.url
localizedFlowDataLoginTermsLocalizedName = firstUrlAndName!!.name
}
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/auth/data/SsoIdentityProvider.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/auth/data/SsoIdentityProvider.kt
index a0733dda97..773f5a8cc4 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/auth/data/SsoIdentityProvider.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/auth/data/SsoIdentityProvider.kt
@@ -66,17 +66,17 @@ data class SsoIdentityProvider(
private fun toPriority(): Int {
return when (brand) {
// We are on Android, so user is more likely to have a Google account
- BRAND_GOOGLE -> 5
+ BRAND_GOOGLE -> 5
// Facebook is also an important SSO provider
BRAND_FACEBOOK -> 4
// Twitter is more for professionals
- BRAND_TWITTER -> 3
+ BRAND_TWITTER -> 3
// Here it's very for techie people
BRAND_GITHUB,
- BRAND_GITLAB -> 2
+ BRAND_GITLAB -> 2
// And finally, if the account has been created with an iPhone...
- BRAND_APPLE -> 1
- else -> 0
+ BRAND_APPLE -> 1
+ else -> 0
}
}
}
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/auth/login/LoginWizard.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/auth/login/LoginWizard.kt
index 3232025de3..5b8d2328c7 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/auth/login/LoginWizard.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/auth/login/LoginWizard.kt
@@ -39,10 +39,12 @@ interface LoginWizard {
* @param deviceId the device id, optional. If not provided or null, the server will generate one.
* @return a [Session] if the login is successful
*/
- suspend fun login(login: String,
- password: String,
- initialDeviceName: String,
- deviceId: String? = null): Session
+ suspend fun login(
+ login: String,
+ password: String,
+ initialDeviceName: String,
+ deviceId: String? = null
+ ): Session
/**
* Exchange a login token to an access token.
@@ -63,14 +65,14 @@ interface LoginWizard {
* [resetPasswordMailConfirmed] is successfully called.
*
* @param email an email previously associated to the account the user wants the password to be reset.
- * @param newPassword the desired new password
*/
- suspend fun resetPassword(email: String,
- newPassword: String)
+ suspend fun resetPassword(email: String)
/**
* Confirm the new password, once the user has checked their email
* When this method succeed, tha account password will be effectively modified.
+ *
+ * @param newPassword the desired new password
*/
- suspend fun resetPasswordMailConfirmed()
+ suspend fun resetPasswordMailConfirmed(newPassword: String)
}
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/auth/registration/RegistrationFlowResponse.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/auth/registration/RegistrationFlowResponse.kt
index 1252e93b84..98542d2086 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/auth/registration/RegistrationFlowResponse.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/auth/registration/RegistrationFlowResponse.kt
@@ -88,15 +88,15 @@ fun RegistrationFlowResponse.toFlowResult(): FlowResult {
val isMandatory = flows?.all { type in it.stages.orEmpty() } == true
val stage = when (type) {
- LoginFlowTypes.RECAPTCHA -> Stage.ReCaptcha(
+ LoginFlowTypes.RECAPTCHA -> Stage.ReCaptcha(
isMandatory, ((params?.get(type) as? Map<*, *>)?.get("public_key") as? String)
?: ""
)
- LoginFlowTypes.DUMMY -> Stage.Dummy(isMandatory)
- LoginFlowTypes.TERMS -> Stage.Terms(isMandatory, params?.get(type) as? TermPolicies ?: emptyMap())
+ LoginFlowTypes.DUMMY -> Stage.Dummy(isMandatory)
+ LoginFlowTypes.TERMS -> Stage.Terms(isMandatory, params?.get(type) as? TermPolicies ?: emptyMap())
LoginFlowTypes.EMAIL_IDENTITY -> Stage.Email(isMandatory)
- LoginFlowTypes.MSISDN -> Stage.Msisdn(isMandatory)
- else -> Stage.Other(isMandatory, type, (params?.get(type) as? Map<*, *>))
+ LoginFlowTypes.MSISDN -> Stage.Msisdn(isMandatory)
+ else -> Stage.Other(isMandatory, type, (params?.get(type) as? Map<*, *>))
}
if (type in completedStages.orEmpty()) {
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/auth/registration/RegistrationWizard.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/auth/registration/RegistrationWizard.kt
index 14d26bf2b3..995fd27ace 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/auth/registration/RegistrationWizard.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/auth/registration/RegistrationWizard.kt
@@ -54,9 +54,11 @@ interface RegistrationWizard {
* @param password the desired password
* @param initialDeviceDisplayName the device display name
*/
- suspend fun createAccount(userName: String?,
- password: String?,
- initialDeviceDisplayName: String?): RegistrationResult
+ suspend fun createAccount(
+ userName: String?,
+ password: String?,
+ initialDeviceDisplayName: String?
+ ): RegistrationResult
/**
* Perform the "m.login.recaptcha" stage.
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/auth/wellknown/WellknownResult.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/auth/wellknown/WellknownResult.kt
index 56257db79c..ea5570db1c 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/auth/wellknown/WellknownResult.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/auth/wellknown/WellknownResult.kt
@@ -26,9 +26,11 @@ sealed class WellknownResult {
* Retrieve the specific piece of information from the user in a way which fits within the existing client user experience,
* if the client is inclined to do so. Failure can take place instead if no good user experience for this is possible at this point.
*/
- data class Prompt(val homeServerUrl: String,
- val identityServerUrl: String?,
- val wellKnown: WellKnown) : WellknownResult()
+ data class Prompt(
+ val homeServerUrl: String,
+ val identityServerUrl: String?,
+ val wellKnown: WellKnown
+ ) : WellknownResult()
/**
* Stop the current auto-discovery mechanism. If no more auto-discovery mechanisms are available,
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/extensions/Strings.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/extensions/Strings.kt
index 5e1350e327..9f979098f8 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/extensions/Strings.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/extensions/Strings.kt
@@ -19,7 +19,7 @@ package org.matrix.android.sdk.api.extensions
fun CharSequence.ensurePrefix(prefix: CharSequence): CharSequence {
return when {
startsWith(prefix) -> this
- else -> "$prefix$this"
+ else -> "$prefix$this"
}
}
@@ -27,3 +27,8 @@ fun CharSequence.ensurePrefix(prefix: CharSequence): CharSequence {
* Append a new line and then the provided string.
*/
fun StringBuilder.appendNl(str: String) = append("\n").append(str)
+
+/**
+ * Returns null if the string is empty.
+ */
+fun String.ensureNotEmpty() = ifEmpty { null }
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/network/ssl/Fingerprint.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/network/ssl/Fingerprint.kt
index 93e93fd292..2fc04013f9 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/network/ssl/Fingerprint.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/network/ssl/Fingerprint.kt
@@ -36,7 +36,7 @@ data class Fingerprint(
internal fun matchesCert(cert: X509Certificate): Boolean {
val o: Fingerprint? = when (hashType) {
HashType.SHA256 -> newSha256Fingerprint(cert)
- HashType.SHA1 -> newSha1Fingerprint(cert)
+ HashType.SHA1 -> newSha1Fingerprint(cert)
}
return equals(o)
}
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/Session.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/Session.kt
index 2f1ae8cd87..b3a629094c 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/Session.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/Session.kt
@@ -17,8 +17,6 @@
package org.matrix.android.sdk.api.session
import androidx.annotation.MainThread
-import androidx.lifecycle.LiveData
-import kotlinx.coroutines.flow.SharedFlow
import okhttp3.OkHttpClient
import org.matrix.android.sdk.api.MatrixCoroutineDispatchers
import org.matrix.android.sdk.api.auth.data.SessionParams
@@ -37,7 +35,6 @@ import org.matrix.android.sdk.api.session.file.FileService
import org.matrix.android.sdk.api.session.group.GroupService
import org.matrix.android.sdk.api.session.homeserver.HomeServerCapabilitiesService
import org.matrix.android.sdk.api.session.identity.IdentityService
-import org.matrix.android.sdk.api.session.initsync.SyncStatusService
import org.matrix.android.sdk.api.session.integrationmanager.IntegrationManagerService
import org.matrix.android.sdk.api.session.media.MediaService
import org.matrix.android.sdk.api.session.openid.OpenIdService
@@ -55,8 +52,7 @@ import org.matrix.android.sdk.api.session.signout.SignOutService
import org.matrix.android.sdk.api.session.space.SpaceService
import org.matrix.android.sdk.api.session.statistics.StatisticsListener
import org.matrix.android.sdk.api.session.sync.FilterService
-import org.matrix.android.sdk.api.session.sync.SyncState
-import org.matrix.android.sdk.api.session.sync.model.SyncResponse
+import org.matrix.android.sdk.api.session.sync.SyncService
import org.matrix.android.sdk.api.session.terms.TermsService
import org.matrix.android.sdk.api.session.thirdparty.ThirdPartyService
import org.matrix.android.sdk.api.session.typing.TypingUsersTracker
@@ -98,59 +94,11 @@ interface Session {
@MainThread
fun open()
- /**
- * Requires a one time background sync.
- */
- fun requireBackgroundSync()
-
- /**
- * Launches infinite self rescheduling background syncs via the WorkManager.
- *
- * While dozing, syncs will only occur during maintenance windows.
- * For reliability it's recommended to also start a long running foreground service
- * along with disabling battery optimizations.
- */
- fun startAutomaticBackgroundSync(timeOutInSeconds: Long, repeatDelayInSeconds: Long)
-
- fun stopAnyBackgroundSync()
-
- /**
- * This method start the sync thread.
- */
- fun startSync(fromForeground: Boolean)
-
- /**
- * This method stop the sync thread.
- */
- fun stopSync()
-
/**
* Clear cache of the session.
*/
suspend fun clearCache()
- /**
- * This method allows to listen the sync state.
- * @return a [LiveData] of [SyncState].
- */
- fun getSyncStateLive(): LiveData
-
- /**
- * This method returns the current sync state.
- * @return the current [SyncState].
- */
- fun getSyncState(): SyncState
-
- /**
- * This method returns a flow of SyncResponse. New value will be pushed through the sync thread.
- */
- fun syncFlow(): SharedFlow
-
- /**
- * This methods return true if an initial sync has been processed.
- */
- fun hasAlreadySynced(): Boolean
-
/**
* This method allow to close a session. It does stop some services.
*/
@@ -247,9 +195,9 @@ interface Session {
fun termsService(): TermsService
/**
- * Returns the SyncStatusService associated with the session.
+ * Returns the SyncService associated with the session.
*/
- fun syncStatusService(): SyncStatusService
+ fun syncService(): SyncService
/**
* Returns the SecureStorageService associated with the session.
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/account/AccountService.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/account/AccountService.kt
index 1f28dbd8af..e3d52adfc5 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/account/AccountService.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/account/AccountService.kt
@@ -27,8 +27,10 @@ interface AccountService {
* @param password Current password.
* @param newPassword New password
*/
- suspend fun changePassword(password: String,
- newPassword: String)
+ suspend fun changePassword(
+ password: String,
+ newPassword: String
+ )
/**
* Deactivate the account.
@@ -46,6 +48,8 @@ interface AccountService {
* an incomplete view of conversations
* @param userInteractiveAuthInterceptor see [UserInteractiveAuthInterceptor]
*/
- suspend fun deactivateAccount(eraseAllData: Boolean,
- userInteractiveAuthInterceptor: UserInteractiveAuthInterceptor)
+ suspend fun deactivateAccount(
+ eraseAllData: Boolean,
+ userInteractiveAuthInterceptor: UserInteractiveAuthInterceptor
+ )
}
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/call/MxCall.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/call/MxCall.kt
index e13f7310e0..c87ac3c821 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/call/MxCall.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/call/MxCall.kt
@@ -91,10 +91,12 @@ interface MxCall : MxCallDetail {
* Send a m.call.replaces event to initiate call transfer.
* See [org.matrix.android.sdk.api.session.room.model.call.CallReplacesContent] for documentation about the parameters
*/
- suspend fun transfer(targetUserId: String,
- targetRoomId: String?,
- createCallId: String?,
- awaitCallId: String?)
+ suspend fun transfer(
+ targetUserId: String,
+ targetRoomId: String?,
+ createCallId: String?,
+ awaitCallId: String?
+ )
fun addListener(listener: StateListener)
fun removeListener(listener: StateListener)
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/CryptoService.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/CryptoService.kt
index 35f3ab3162..9cc87b6f71 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/CryptoService.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/CryptoService.kt
@@ -88,9 +88,11 @@ interface CryptoService {
fun getDeviceTrackingStatus(userId: String): Int
- suspend fun importRoomKeys(roomKeysAsArray: ByteArray,
- password: String,
- progressListener: ProgressListener?): ImportRoomKeysResult
+ suspend fun importRoomKeys(
+ roomKeysAsArray: ByteArray,
+ password: String,
+ progressListener: ProgressListener?
+ ): ImportRoomKeysResult
suspend fun exportRoomKeys(password: String): ByteArray
@@ -119,10 +121,12 @@ interface CryptoService {
fun isRoomEncrypted(roomId: String): Boolean
// TODO This could be removed from this interface
- fun encryptEventContent(eventContent: Content,
- eventType: String,
- roomId: String,
- callback: MatrixCallback)
+ fun encryptEventContent(
+ eventContent: Content,
+ eventType: String,
+ roomId: String,
+ callback: MatrixCallback
+ )
fun discardOutboundSession(roomId: String)
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/MXCryptoError.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/MXCryptoError.kt
index 0b5bbe3bbd..94ee7ba403 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/MXCryptoError.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/MXCryptoError.kt
@@ -25,12 +25,14 @@ import org.matrix.olm.OlmException
*/
sealed class MXCryptoError : Throwable() {
- data class Base(val errorType: ErrorType,
- val technicalMessage: String,
- /**
- * Describe the error with more details.
- */
- val detailedErrorDescription: String? = null) : MXCryptoError()
+ data class Base(
+ val errorType: ErrorType,
+ val technicalMessage: String,
+ /**
+ * Describe the error with more details.
+ */
+ val detailedErrorDescription: String? = null
+ ) : MXCryptoError()
data class OlmError(val olmException: OlmException) : MXCryptoError()
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/OutgoingKeyRequest.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/OutgoingKeyRequest.kt
index 855f17a34f..7202be7a21 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/OutgoingKeyRequest.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/OutgoingKeyRequest.kt
@@ -26,7 +26,7 @@ data class RequestReply(
)
sealed class RequestResult {
- data class Success(val chainIndex: Int) : RequestResult()
+ data class Success(val chainIndex: Int) : RequestResult()
data class Failure(val code: WithHeldCode) : RequestResult()
}
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/crosssigning/CrossSigningService.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/crosssigning/CrossSigningService.kt
index 5439389096..69f314f76f 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/crosssigning/CrossSigningService.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/crosssigning/CrossSigningService.kt
@@ -37,14 +37,18 @@ interface CrossSigningService {
* Initialize cross signing for this user.
* Users needs to enter credentials
*/
- fun initializeCrossSigning(uiaInterceptor: UserInteractiveAuthInterceptor?,
- callback: MatrixCallback)
+ fun initializeCrossSigning(
+ uiaInterceptor: UserInteractiveAuthInterceptor?,
+ callback: MatrixCallback
+ )
fun isCrossSigningInitialized(): Boolean = getMyCrossSigningKeys() != null
- fun checkTrustFromPrivateKeys(masterKeyPrivateKey: String?,
- uskKeyPrivateKey: String?,
- sskPrivateKey: String?): UserTrustResult
+ fun checkTrustFromPrivateKeys(
+ masterKeyPrivateKey: String?,
+ uskKeyPrivateKey: String?,
+ sskPrivateKey: String?
+ ): UserTrustResult
fun getUserCrossSigningKeys(otherUserId: String): MXCrossSigningInfo?
@@ -60,20 +64,26 @@ interface CrossSigningService {
fun allPrivateKeysKnown(): Boolean
- fun trustUser(otherUserId: String,
- callback: MatrixCallback)
+ fun trustUser(
+ otherUserId: String,
+ callback: MatrixCallback
+ )
fun markMyMasterKeyAsTrusted()
/**
* Sign one of your devices and upload the signature.
*/
- fun trustDevice(deviceId: String,
- callback: MatrixCallback)
+ fun trustDevice(
+ deviceId: String,
+ callback: MatrixCallback
+ )
- fun checkDeviceTrust(otherUserId: String,
- otherDeviceId: String,
- locallyTrusted: Boolean?): DeviceTrustResult
+ fun checkDeviceTrust(
+ otherUserId: String,
+ otherDeviceId: String,
+ locallyTrusted: Boolean?
+ ): DeviceTrustResult
// FIXME Those method do not have to be in the service
fun onSecretMSKGossip(mskPrivateKey: String)
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/keysbackup/KeysBackupLastVersionResult.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/keysbackup/KeysBackupLastVersionResult.kt
index a7e985cea9..92510bb52e 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/keysbackup/KeysBackupLastVersionResult.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/keysbackup/KeysBackupLastVersionResult.kt
@@ -24,5 +24,5 @@ sealed interface KeysBackupLastVersionResult {
fun KeysBackupLastVersionResult.toKeysVersionResult(): KeysVersionResult? = when (this) {
is KeysBackupLastVersionResult.KeysBackup -> keysVersionResult
- KeysBackupLastVersionResult.NoKeysBackup -> null
+ KeysBackupLastVersionResult.NoKeysBackup -> null
}
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/keysbackup/KeysBackupService.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/keysbackup/KeysBackupService.kt
index dc8b03eaae..8745003f9f 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/keysbackup/KeysBackupService.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/keysbackup/KeysBackupService.kt
@@ -36,8 +36,10 @@ interface KeysBackupService {
* @param keysBackupCreationInfo the info object from [prepareKeysBackupVersion].
* @param callback Asynchronous callback
*/
- fun createKeysBackupVersion(keysBackupCreationInfo: MegolmBackupCreationInfo,
- callback: MatrixCallback)
+ fun createKeysBackupVersion(
+ keysBackupCreationInfo: MegolmBackupCreationInfo,
+ callback: MatrixCallback
+ )
/**
* Facility method to get the total number of locally stored keys.
@@ -55,8 +57,10 @@ interface KeysBackupService {
* @param progressListener the callback to follow the progress
* @param callback the main callback
*/
- fun backupAllGroupSessions(progressListener: ProgressListener?,
- callback: MatrixCallback?)
+ fun backupAllGroupSessions(
+ progressListener: ProgressListener?,
+ callback: MatrixCallback?
+ )
/**
* Check trust on a key backup version.
@@ -64,8 +68,10 @@ interface KeysBackupService {
* @param keysBackupVersion the backup version to check.
* @param callback block called when the operations completes.
*/
- fun getKeysBackupTrust(keysBackupVersion: KeysVersionResult,
- callback: MatrixCallback)
+ fun getKeysBackupTrust(
+ keysBackupVersion: KeysVersionResult,
+ callback: MatrixCallback
+ )
/**
* Return the current progress of the backup.
@@ -79,8 +85,10 @@ interface KeysBackupService {
* @param version the backup version
* @param callback
*/
- fun getVersion(version: String,
- callback: MatrixCallback)
+ fun getVersion(
+ version: String,
+ callback: MatrixCallback
+ )
/**
* This method fetches the last backup version on the server, then compare to the currently backup version use.
@@ -114,9 +122,11 @@ interface KeysBackupService {
* @param progressListener a progress listener, as generating private key from password may take a while
* @param callback Asynchronous callback
*/
- fun prepareKeysBackupVersion(password: String?,
- progressListener: ProgressListener?,
- callback: MatrixCallback)
+ fun prepareKeysBackupVersion(
+ password: String?,
+ progressListener: ProgressListener?,
+ callback: MatrixCallback
+ )
/**
* Delete a keys backup version. It will delete all backed up keys on the server, and the backup itself.
@@ -125,8 +135,10 @@ interface KeysBackupService {
* @param version the backup version to delete.
* @param callback Asynchronous callback
*/
- fun deleteBackup(version: String,
- callback: MatrixCallback?)
+ fun deleteBackup(
+ version: String,
+ callback: MatrixCallback?
+ )
/**
* Ask if the backup on the server contains keys that we may do not have locally.
@@ -142,9 +154,11 @@ interface KeysBackupService {
* @param trust the trust to set to the keys backup.
* @param callback block called when the operations completes.
*/
- fun trustKeysBackupVersion(keysBackupVersion: KeysVersionResult,
- trust: Boolean,
- callback: MatrixCallback)
+ fun trustKeysBackupVersion(
+ keysBackupVersion: KeysVersionResult,
+ trust: Boolean,
+ callback: MatrixCallback
+ )
/**
* Set trust on a keys backup version.
@@ -153,9 +167,11 @@ interface KeysBackupService {
* @param recoveryKey the recovery key to challenge with the key backup public key.
* @param callback block called when the operations completes.
*/
- fun trustKeysBackupVersionWithRecoveryKey(keysBackupVersion: KeysVersionResult,
- recoveryKey: String,
- callback: MatrixCallback)
+ fun trustKeysBackupVersionWithRecoveryKey(
+ keysBackupVersion: KeysVersionResult,
+ recoveryKey: String,
+ callback: MatrixCallback
+ )
/**
* Set trust on a keys backup version.
@@ -164,9 +180,11 @@ interface KeysBackupService {
* @param password the pass phrase to challenge with the keyBackupVersion public key.
* @param callback block called when the operations completes.
*/
- fun trustKeysBackupVersionWithPassphrase(keysBackupVersion: KeysVersionResult,
- password: String,
- callback: MatrixCallback)
+ fun trustKeysBackupVersionWithPassphrase(
+ keysBackupVersion: KeysVersionResult,
+ password: String,
+ callback: MatrixCallback
+ )
/**
* Restore a backup with a recovery key from a given backup version stored on the homeserver.
@@ -178,11 +196,14 @@ interface KeysBackupService {
* @param stepProgressListener the step progress listener
* @param callback Callback. It provides the number of found keys and the number of successfully imported keys.
*/
- fun restoreKeysWithRecoveryKey(keysVersionResult: KeysVersionResult,
- recoveryKey: String, roomId: String?,
- sessionId: String?,
- stepProgressListener: StepProgressListener?,
- callback: MatrixCallback)
+ fun restoreKeysWithRecoveryKey(
+ keysVersionResult: KeysVersionResult,
+ recoveryKey: String,
+ roomId: String?,
+ sessionId: String?,
+ stepProgressListener: StepProgressListener?,
+ callback: MatrixCallback
+ )
/**
* Restore a backup with a password from a given backup version stored on the homeserver.
@@ -194,12 +215,14 @@ interface KeysBackupService {
* @param stepProgressListener the step progress listener
* @param callback Callback. It provides the number of found keys and the number of successfully imported keys.
*/
- fun restoreKeyBackupWithPassword(keysBackupVersion: KeysVersionResult,
- password: String,
- roomId: String?,
- sessionId: String?,
- stepProgressListener: StepProgressListener?,
- callback: MatrixCallback)
+ fun restoreKeyBackupWithPassword(
+ keysBackupVersion: KeysVersionResult,
+ password: String,
+ roomId: String?,
+ sessionId: String?,
+ stepProgressListener: StepProgressListener?,
+ callback: MatrixCallback
+ )
val keysBackupVersion: KeysVersionResult?
@@ -216,8 +239,10 @@ interface KeysBackupService {
fun isValidRecoveryKeyForCurrentVersion(recoveryKey: String, callback: MatrixCallback)
- fun computePrivateKey(passphrase: String,
- privateKeySalt: String,
- privateKeyIterations: Int,
- progressListener: ProgressListener): ByteArray
+ fun computePrivateKey(
+ passphrase: String,
+ privateKeySalt: String,
+ privateKeyIterations: Int,
+ progressListener: ProgressListener
+ ): ByteArray
}
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/keysbackup/KeysBackupVersionTrustSignature.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/keysbackup/KeysBackupVersionTrustSignature.kt
index 7127c8d3f4..afbf45ac70 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/keysbackup/KeysBackupVersionTrustSignature.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/keysbackup/KeysBackupVersionTrustSignature.kt
@@ -40,7 +40,8 @@ sealed class KeysBackupVersionTrustSignature {
/**
* Flag to indicate the signature from this device is valid.
*/
- val valid: Boolean) : KeysBackupVersionTrustSignature()
+ val valid: Boolean
+ ) : KeysBackupVersionTrustSignature()
data class UserSignature(
val keyId: String?,
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/verification/EmojiRepresentation.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/verification/EmojiRepresentation.kt
index 2c1bf9ff4d..5402471e46 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/verification/EmojiRepresentation.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/verification/EmojiRepresentation.kt
@@ -19,7 +19,8 @@ package org.matrix.android.sdk.api.session.crypto.verification
import androidx.annotation.DrawableRes
import androidx.annotation.StringRes
-data class EmojiRepresentation(val emoji: String,
- @StringRes val nameResId: Int,
- @DrawableRes val drawableRes: Int? = null
+data class EmojiRepresentation(
+ val emoji: String,
+ @StringRes val nameResId: Int,
+ @DrawableRes val drawableRes: Int? = null
)
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/verification/VerificationService.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/verification/VerificationService.kt
index 321ec73094..ee93f14992 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/verification/VerificationService.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/verification/VerificationService.kt
@@ -46,54 +46,68 @@ interface VerificationService {
fun getExistingVerificationRequestInRoom(roomId: String, tid: String?): PendingVerificationRequest?
- fun beginKeyVerification(method: VerificationMethod,
- otherUserId: String,
- otherDeviceId: String,
- transactionId: String?): String?
+ fun beginKeyVerification(
+ method: VerificationMethod,
+ otherUserId: String,
+ otherDeviceId: String,
+ transactionId: String?
+ ): String?
/**
* Request key verification with another user via room events (instead of the to-device API).
*/
- fun requestKeyVerificationInDMs(methods: List,
- otherUserId: String,
- roomId: String,
- localId: String? = LocalEcho.createLocalEchoId()): PendingVerificationRequest
+ fun requestKeyVerificationInDMs(
+ methods: List,
+ otherUserId: String,
+ roomId: String,
+ localId: String? = LocalEcho.createLocalEchoId()
+ ): PendingVerificationRequest
fun cancelVerificationRequest(request: PendingVerificationRequest)
/**
* Request a key verification from another user using toDevice events.
*/
- fun requestKeyVerification(methods: List,
- otherUserId: String,
- otherDevices: List?): PendingVerificationRequest
+ fun requestKeyVerification(
+ methods: List,
+ otherUserId: String,
+ otherDevices: List?
+ ): PendingVerificationRequest
- fun declineVerificationRequestInDMs(otherUserId: String,
- transactionId: String,
- roomId: String)
+ fun declineVerificationRequestInDMs(
+ otherUserId: String,
+ transactionId: String,
+ roomId: String
+ )
// Only SAS method is supported for the moment
// TODO Parameter otherDeviceId should be removed in this case
- fun beginKeyVerificationInDMs(method: VerificationMethod,
- transactionId: String,
- roomId: String,
- otherUserId: String,
- otherDeviceId: String): String
+ fun beginKeyVerificationInDMs(
+ method: VerificationMethod,
+ transactionId: String,
+ roomId: String,
+ otherUserId: String,
+ otherDeviceId: String
+ ): String
/**
* Returns false if the request is unknown.
*/
- fun readyPendingVerificationInDMs(methods: List,
- otherUserId: String,
- roomId: String,
- transactionId: String): Boolean
+ fun readyPendingVerificationInDMs(
+ methods: List,
+ otherUserId: String,
+ roomId: String,
+ transactionId: String
+ ): Boolean
/**
* Returns false if the request is unknown.
*/
- fun readyPendingVerification(methods: List,
- otherUserId: String,
- transactionId: String): Boolean
+ fun readyPendingVerification(
+ methods: List,
+ otherUserId: String,
+ transactionId: String
+ ): Boolean
interface Listener {
/**
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/events/EventService.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/events/EventService.kt
index 297f277497..7f275bf952 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/events/EventService.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/events/EventService.kt
@@ -24,6 +24,8 @@ interface EventService {
* Ask the homeserver for an event content. The SDK will try to decrypt it if it is possible
* The result will not be stored into cache
*/
- suspend fun getEvent(roomId: String,
- eventId: String): Event
+ suspend fun getEvent(
+ roomId: String,
+ eventId: String
+ ): Event
}
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/events/model/Event.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/events/model/Event.kt
index 7124d8a1a3..7f9ab4c6dd 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/events/model/Event.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/events/model/Event.kt
@@ -212,13 +212,13 @@ data class Event(
return when {
isReplyRenderedInThread() || isQuote() -> ContentUtils.extractUsefulTextFromReply(text)
- isFileMessage() -> "sent a file."
- isAudioMessage() -> "sent an audio file."
- isImageMessage() -> "sent an image."
- isVideoMessage() -> "sent a video."
- isSticker() -> "sent a sticker"
- isPoll() -> getPollQuestion() ?: "created a poll."
- else -> text
+ isFileMessage() -> "sent a file."
+ isAudioMessage() -> "sent an audio file."
+ isImageMessage() -> "sent an image."
+ isVideoMessage() -> "sent a video."
+ isSticker() -> "sent a sticker"
+ isPoll() -> getPollQuestion() ?: "created a poll."
+ else -> text
}
}
@@ -318,35 +318,35 @@ fun Event.isTextMessage(): Boolean {
MessageType.MSGTYPE_TEXT,
MessageType.MSGTYPE_EMOTE,
MessageType.MSGTYPE_NOTICE -> true
- else -> false
+ else -> false
}
}
fun Event.isImageMessage(): Boolean {
return when (getMsgType()) {
MessageType.MSGTYPE_IMAGE -> true
- else -> false
+ else -> false
}
}
fun Event.isVideoMessage(): Boolean {
return when (getMsgType()) {
MessageType.MSGTYPE_VIDEO -> true
- else -> false
+ else -> false
}
}
fun Event.isAudioMessage(): Boolean {
return when (getMsgType()) {
MessageType.MSGTYPE_AUDIO -> true
- else -> false
+ else -> false
}
}
fun Event.isFileMessage(): Boolean {
return when (getMsgType()) {
MessageType.MSGTYPE_FILE -> true
- else -> false
+ else -> false
}
}
@@ -356,14 +356,14 @@ fun Event.isAttachmentMessage(): Boolean {
MessageType.MSGTYPE_AUDIO,
MessageType.MSGTYPE_VIDEO,
MessageType.MSGTYPE_FILE -> true
- else -> false
+ else -> false
}
}
fun Event.isLocationMessage(): Boolean {
return when (getMsgType()) {
MessageType.MSGTYPE_LOCATION -> true
- else -> false
+ else -> false
}
}
@@ -378,9 +378,9 @@ fun Event.getRelationContent(): RelationDefaultContent? {
content.toModel()?.relatesTo ?: run {
// Special cases when there is only a local msgtype for some event types
when (getClearType()) {
- EventType.STICKER -> getClearContent().toModel()?.relatesTo
+ EventType.STICKER -> getClearContent().toModel()?.relatesTo
in EventType.BEACON_LOCATION_DATA -> getClearContent().toModel()?.relatesTo
- else -> null
+ else -> null
}
}
}
@@ -427,3 +427,6 @@ fun Event.getPollContent(): MessagePollContent? {
fun Event.supportsNotification() =
this.getClearType() in EventType.MESSAGE + EventType.POLL_START + EventType.STATE_ROOM_BEACON_INFO
+
+fun Event.isContentReportable() =
+ this.getClearType() in EventType.MESSAGE + EventType.STATE_ROOM_BEACON_INFO
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/events/model/content/RoomKeyWithHeldContent.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/events/model/content/RoomKeyWithHeldContent.kt
index d58c3614a7..fb8b65c4f2 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/events/model/content/RoomKeyWithHeldContent.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/events/model/content/RoomKeyWithHeldContent.kt
@@ -98,12 +98,12 @@ enum class WithHeldCode(val value: String) {
companion object {
fun fromCode(code: String?): WithHeldCode? {
return when (code) {
- BLACKLISTED.value -> BLACKLISTED
- UNVERIFIED.value -> UNVERIFIED
+ BLACKLISTED.value -> BLACKLISTED
+ UNVERIFIED.value -> UNVERIFIED
UNAUTHORISED.value -> UNAUTHORISED
- UNAVAILABLE.value -> UNAVAILABLE
- NO_OLM.value -> NO_OLM
- else -> null
+ UNAVAILABLE.value -> UNAVAILABLE
+ NO_OLM.value -> NO_OLM
+ else -> null
}
}
}
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/file/FileService.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/file/FileService.kt
index a7c81136e3..ca6c889cb8 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/file/FileService.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/file/FileService.kt
@@ -44,10 +44,12 @@ interface FileService {
* Download a file if necessary and ensure that if the file is encrypted, the file is decrypted.
* Result will be a decrypted file, stored in the cache folder. url parameter will be used to create unique filename to avoid name collision.
*/
- suspend fun downloadFile(fileName: String,
- mimeType: String?,
- url: String?,
- elementToDecrypt: ElementToDecrypt?): File
+ suspend fun downloadFile(
+ fileName: String,
+ mimeType: String?,
+ url: String?,
+ elementToDecrypt: ElementToDecrypt?
+ ): File
suspend fun downloadFile(messageContent: MessageWithAttachmentContent): File =
downloadFile(
@@ -57,10 +59,11 @@ interface FileService {
elementToDecrypt = messageContent.encryptedFileInfo?.toElementToDecrypt()
)
- fun isFileInCache(mxcUrl: String?,
- fileName: String,
- mimeType: String?,
- elementToDecrypt: ElementToDecrypt?
+ fun isFileInCache(
+ mxcUrl: String?,
+ fileName: String,
+ mimeType: String?,
+ elementToDecrypt: ElementToDecrypt?
): Boolean
fun isFileInCache(messageContent: MessageWithAttachmentContent) =
@@ -75,10 +78,12 @@ interface FileService {
* Use this URI and pass it to intent using flag Intent.FLAG_GRANT_READ_URI_PERMISSION
* (if not other app won't be able to access it).
*/
- fun getTemporarySharableURI(mxcUrl: String?,
- fileName: String,
- mimeType: String?,
- elementToDecrypt: ElementToDecrypt?): Uri?
+ fun getTemporarySharableURI(
+ mxcUrl: String?,
+ fileName: String,
+ mimeType: String?,
+ elementToDecrypt: ElementToDecrypt?
+ ): Uri?
fun getTemporarySharableURI(messageContent: MessageWithAttachmentContent): Uri? =
getTemporarySharableURI(
@@ -92,10 +97,12 @@ interface FileService {
* Get information on the given file.
* Mimetype should be the same one as passed to downloadFile (limitation for now)
*/
- fun fileState(mxcUrl: String?,
- fileName: String,
- mimeType: String?,
- elementToDecrypt: ElementToDecrypt?): FileState
+ fun fileState(
+ mxcUrl: String?,
+ fileName: String,
+ mimeType: String?,
+ elementToDecrypt: ElementToDecrypt?
+ ): FileState
fun fileState(messageContent: MessageWithAttachmentContent): FileState =
fileState(
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/homeserver/HomeServerCapabilities.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/homeserver/HomeServerCapabilities.kt
index 5b06fdacae..c78fb9cf79 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/homeserver/HomeServerCapabilities.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/homeserver/HomeServerCapabilities.kt
@@ -81,13 +81,13 @@ data class HomeServerCapabilities(
val versionCap = roomVersions.supportedVersion.firstOrNull { it.version == preferred }
return when {
- versionCap == null -> {
+ versionCap == null -> {
RoomCapabilitySupport.UNKNOWN
}
versionCap.status == RoomVersionStatus.STABLE -> {
RoomCapabilitySupport.SUPPORTED
}
- else -> {
+ else -> {
RoomCapabilitySupport.SUPPORTED_UNSTABLE
}
}
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/identity/ThreePid.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/identity/ThreePid.kt
index 42d777849b..6bcf576824 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/identity/ThreePid.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/identity/ThreePid.kt
@@ -27,7 +27,7 @@ sealed class ThreePid(open val value: String) {
internal fun ThreePid.toMedium(): String {
return when (this) {
- is ThreePid.Email -> ThirdPartyIdentifier.MEDIUM_EMAIL
+ is ThreePid.Email -> ThirdPartyIdentifier.MEDIUM_EMAIL
is ThreePid.Msisdn -> ThirdPartyIdentifier.MEDIUM_MSISDN
}
}
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/initsync/SyncStatusService.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/initsync/SyncStatusService.kt
deleted file mode 100644
index 7006e11751..0000000000
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/initsync/SyncStatusService.kt
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright 2020 The Matrix.org Foundation C.I.C.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.matrix.android.sdk.api.session.initsync
-
-import androidx.lifecycle.LiveData
-
-interface SyncStatusService {
-
- fun getSyncStatusLive(): LiveData
-
- sealed class Status {
- /**
- * For initial sync.
- */
- abstract class InitialSyncStatus : Status()
-
- object Idle : InitialSyncStatus()
- data class InitialSyncProgressing(
- val initSyncStep: InitSyncStep,
- val percentProgress: Int = 0
- ) : InitialSyncStatus()
-
- /**
- * For incremental sync.
- */
- abstract class IncrementalSyncStatus : Status()
-
- object IncrementalSyncIdle : IncrementalSyncStatus()
- data class IncrementalSyncParsing(
- val rooms: Int,
- val toDevice: Int
- ) : IncrementalSyncStatus()
-
- object IncrementalSyncError : IncrementalSyncStatus()
- object IncrementalSyncDone : IncrementalSyncStatus()
- }
-}
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/permalinks/MatrixPermalinkSpan.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/permalinks/MatrixPermalinkSpan.kt
index 48b30dfa21..9c71c081be 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/permalinks/MatrixPermalinkSpan.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/permalinks/MatrixPermalinkSpan.kt
@@ -25,8 +25,10 @@ import org.matrix.android.sdk.api.session.permalinks.MatrixPermalinkSpan.Callbac
* @property url the permalink url tied to the span
* @property callback the callback to use.
*/
-class MatrixPermalinkSpan(private val url: String,
- private val callback: Callback? = null) : ClickableSpan() {
+class MatrixPermalinkSpan(
+ private val url: String,
+ private val callback: Callback? = null
+) : ClickableSpan() {
interface Callback {
fun onUrlClicked(url: String)
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/permalinks/MatrixToConverter.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/permalinks/MatrixToConverter.kt
index a904e89681..c418b59df4 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/permalinks/MatrixToConverter.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/permalinks/MatrixToConverter.kt
@@ -38,12 +38,12 @@ object MatrixToConverter {
// URL is already a matrix.to
uriString.startsWith(PermalinkService.MATRIX_TO_URL_BASE) -> uri
// Web or client url
- SUPPORTED_PATHS.any { it in uriString } -> {
+ SUPPORTED_PATHS.any { it in uriString } -> {
val path = SUPPORTED_PATHS.first { it in uriString }
Uri.parse(PermalinkService.MATRIX_TO_URL_BASE + uriString.substringAfter(path))
}
// URL is not supported
- else -> null
+ else -> null
}
}
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/permalinks/PermalinkParser.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/permalinks/PermalinkParser.kt
index 9d078dc4b2..0168b7ac3a 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/permalinks/PermalinkParser.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/permalinks/PermalinkParser.kt
@@ -67,10 +67,10 @@ object PermalinkParser {
val identifier = params.getOrNull(0)
val extraParameter = params.getOrNull(1)
return when {
- identifier.isNullOrEmpty() -> PermalinkData.FallbackLink(uri)
- MatrixPatterns.isUserId(identifier) -> PermalinkData.UserLink(userId = identifier)
- MatrixPatterns.isGroupId(identifier) -> PermalinkData.GroupLink(groupId = identifier)
- MatrixPatterns.isRoomId(identifier) -> {
+ identifier.isNullOrEmpty() -> PermalinkData.FallbackLink(uri)
+ MatrixPatterns.isUserId(identifier) -> PermalinkData.UserLink(userId = identifier)
+ MatrixPatterns.isGroupId(identifier) -> PermalinkData.GroupLink(groupId = identifier)
+ MatrixPatterns.isRoomId(identifier) -> {
handleRoomIdCase(fragment, identifier, matrixToUri, extraParameter, viaQueryParameters)
}
MatrixPatterns.isRoomAlias(identifier) -> {
@@ -81,7 +81,7 @@ object PermalinkParser {
viaParameters = viaQueryParameters
)
}
- else -> PermalinkData.FallbackLink(uri)
+ else -> PermalinkData.FallbackLink(uri)
}
}
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/profile/ProfileService.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/profile/ProfileService.kt
index 095f2ef7c2..4c00c76459 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/profile/ProfileService.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/profile/ProfileService.kt
@@ -107,8 +107,10 @@ interface ProfileService {
/**
* Finalize adding a 3Pids. Call this method once the user has validated that he owns the ThreePid.
*/
- suspend fun finalizeAddingThreePid(threePid: ThreePid,
- userInteractiveAuthInterceptor: UserInteractiveAuthInterceptor)
+ suspend fun finalizeAddingThreePid(
+ threePid: ThreePid,
+ userInteractiveAuthInterceptor: UserInteractiveAuthInterceptor
+ )
/**
* Cancel adding a threepid. It will remove locally stored data about this ThreePid.
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/pushers/PushersService.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/pushers/PushersService.kt
index 396f13ce46..d7958ea3cd 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/pushers/PushersService.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/pushers/PushersService.kt
@@ -58,12 +58,14 @@ interface PushersService {
* email pushers since we don't want to stop other accounts notifying to the same email address.
* @throws [InvalidParameterException] if a parameter is not correct
*/
- suspend fun addEmailPusher(email: String,
- lang: String,
- emailBranding: String,
- appDisplayName: String,
- deviceDisplayName: String,
- append: Boolean = true)
+ suspend fun addEmailPusher(
+ email: String,
+ lang: String,
+ emailBranding: String,
+ appDisplayName: String,
+ deviceDisplayName: String,
+ append: Boolean = true
+ )
/**
* Directly ask the push gateway to send a push to this device.
@@ -75,10 +77,12 @@ interface PushersService {
* @param pushkey the FCM token
* @param eventId the eventId which will be sent in the Push message. Use a fake eventId.
*/
- suspend fun testPush(url: String,
- appId: String,
- pushkey: String,
- eventId: String)
+ suspend fun testPush(
+ url: String,
+ appId: String,
+ pushkey: String,
+ eventId: String
+ )
/**
* Remove a registered pusher.
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/pushrules/Action.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/pushrules/Action.kt
index 2b2930c1ba..6122aae972 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/pushrules/Action.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/pushrules/Action.kt
@@ -71,15 +71,15 @@ sealed class Action {
fun List.toJson(): List {
return map { action ->
when (action) {
- is Action.Notify -> Action.ACTION_NOTIFY
+ is Action.Notify -> Action.ACTION_NOTIFY
is Action.DoNotNotify -> Action.ACTION_DONT_NOTIFY
- is Action.Sound -> {
+ is Action.Sound -> {
mapOf(
Action.ACTION_OBJECT_SET_TWEAK_KEY to Action.ACTION_OBJECT_SET_TWEAK_VALUE_SOUND,
Action.ACTION_OBJECT_VALUE_KEY to action.sound
)
}
- is Action.Highlight -> {
+ is Action.Highlight -> {
mapOf(
Action.ACTION_OBJECT_SET_TWEAK_KEY to Action.ACTION_OBJECT_SET_TWEAK_VALUE_HIGHLIGHT,
Action.ACTION_OBJECT_VALUE_KEY to action.highlight
@@ -94,11 +94,11 @@ fun PushRule.getActions(): List {
actions.forEach { actionStrOrObj ->
when (actionStrOrObj) {
- Action.ACTION_NOTIFY -> Action.Notify
+ Action.ACTION_NOTIFY -> Action.Notify
Action.ACTION_DONT_NOTIFY -> Action.DoNotNotify
- is Map<*, *> -> {
+ is Map<*, *> -> {
when (actionStrOrObj[Action.ACTION_OBJECT_SET_TWEAK_KEY]) {
- Action.ACTION_OBJECT_SET_TWEAK_VALUE_SOUND -> {
+ Action.ACTION_OBJECT_SET_TWEAK_VALUE_SOUND -> {
(actionStrOrObj[Action.ACTION_OBJECT_VALUE_KEY] as? String)?.let { stringValue ->
Action.Sound(stringValue)
}
@@ -112,13 +112,13 @@ fun PushRule.getActions(): List {
// When the value is not there, default is true, says the spec
?: Action.Highlight(true)
}
- else -> {
+ else -> {
Timber.w("Unsupported set_tweak value ${actionStrOrObj[Action.ACTION_OBJECT_SET_TWEAK_KEY]}")
null
}
}
}
- else -> {
+ else -> {
Timber.w("Unsupported action type $actionStrOrObj")
null
}
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/pushrules/ConditionResolver.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/pushrules/ConditionResolver.kt
index f8a930f987..d64ee5f777 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/pushrules/ConditionResolver.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/pushrules/ConditionResolver.kt
@@ -22,15 +22,23 @@ import org.matrix.android.sdk.api.session.events.model.Event
* This class as all required context needed to evaluate rules
*/
interface ConditionResolver {
- fun resolveEventMatchCondition(event: Event,
- condition: EventMatchCondition): Boolean
+ fun resolveEventMatchCondition(
+ event: Event,
+ condition: EventMatchCondition
+ ): Boolean
- fun resolveRoomMemberCountCondition(event: Event,
- condition: RoomMemberCountCondition): Boolean
+ fun resolveRoomMemberCountCondition(
+ event: Event,
+ condition: RoomMemberCountCondition
+ ): Boolean
- fun resolveSenderNotificationPermissionCondition(event: Event,
- condition: SenderNotificationPermissionCondition): Boolean
+ fun resolveSenderNotificationPermissionCondition(
+ event: Event,
+ condition: SenderNotificationPermissionCondition
+ ): Boolean
- fun resolveContainsDisplayNameCondition(event: Event,
- condition: ContainsDisplayNameCondition): Boolean
+ fun resolveContainsDisplayNameCondition(
+ event: Event,
+ condition: ContainsDisplayNameCondition
+ ): Boolean
}
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/pushrules/ContainsDisplayNameCondition.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/pushrules/ContainsDisplayNameCondition.kt
index 69dd14ddc2..0bf14345b9 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/pushrules/ContainsDisplayNameCondition.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/pushrules/ContainsDisplayNameCondition.kt
@@ -39,7 +39,7 @@ class ContainsDisplayNameCondition : Condition {
// EventType.ENCRYPTED -> {
// event.root.getClearContent()?.toModel()
// }
- else -> null
+ else -> null
} ?: return false
return message.body.caseInsensitiveFind(displayName)
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/pushrules/Kind.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/pushrules/Kind.kt
index 463f3c2a73..bba6fe6026 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/pushrules/Kind.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/pushrules/Kind.kt
@@ -27,11 +27,11 @@ enum class Kind(val value: String) {
fun fromString(value: String): Kind {
return when (value) {
- "event_match" -> EventMatch
- "contains_display_name" -> ContainsDisplayName
- "room_member_count" -> RoomMemberCount
+ "event_match" -> EventMatch
+ "contains_display_name" -> ContainsDisplayName
+ "room_member_count" -> RoomMemberCount
"sender_notification_permission" -> SenderNotificationPermission
- else -> Unrecognised
+ else -> Unrecognised
}
}
}
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/pushrules/PushRuleService.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/pushrules/PushRuleService.kt
index 7ffbc89559..8f9c25fd30 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/pushrules/PushRuleService.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/pushrules/PushRuleService.kt
@@ -51,8 +51,10 @@ interface PushRuleService {
// fun fulfilledBingRule(event: Event, rules: List): PushRule?
- fun resolveSenderNotificationPermissionCondition(event: Event,
- condition: SenderNotificationPermissionCondition): Boolean
+ fun resolveSenderNotificationPermissionCondition(
+ event: Event,
+ condition: SenderNotificationPermissionCondition
+ ): Boolean
interface PushRuleListener {
fun onEvents(pushEvents: PushEvents)
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/pushrules/RoomMemberCountCondition.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/pushrules/RoomMemberCountCondition.kt
index 6973ff1372..db097fd92c 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/pushrules/RoomMemberCountCondition.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/pushrules/RoomMemberCountCondition.kt
@@ -47,8 +47,8 @@ class RoomMemberCountCondition(
val numMembers = room.membershipService().getNumberOfJoinedMembers()
return when (prefix) {
- "<" -> numMembers < count
- ">" -> numMembers > count
+ "<" -> numMembers < count
+ ">" -> numMembers > count
"<=" -> numMembers <= count
">=" -> numMembers >= count
else -> numMembers == count
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/pushrules/rest/PushCondition.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/pushrules/rest/PushCondition.kt
index 1fc8329535..ec0936e4c8 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/pushrules/rest/PushCondition.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/pushrules/rest/PushCondition.kt
@@ -61,7 +61,7 @@ data class PushCondition(
fun asExecutableCondition(rule: PushRule): Condition? {
return when (Kind.fromString(kind)) {
- Kind.EventMatch -> {
+ Kind.EventMatch -> {
if (key != null && pattern != null) {
EventMatchCondition(key, pattern, rule.ruleId == RuleIds.RULE_ID_CONTAIN_USER_NAME)
} else {
@@ -69,10 +69,10 @@ data class PushCondition(
null
}
}
- Kind.ContainsDisplayName -> {
+ Kind.ContainsDisplayName -> {
ContainsDisplayNameCondition()
}
- Kind.RoomMemberCount -> {
+ Kind.RoomMemberCount -> {
if (iz.isNullOrEmpty()) {
Timber.e("Malformed ROOM_MEMBER_COUNT condition")
null
@@ -88,7 +88,7 @@ data class PushCondition(
SenderNotificationPermissionCondition(key)
}
}
- Kind.Unrecognised -> {
+ Kind.Unrecognised -> {
Timber.e("Unknown kind $kind")
null
}
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/room/RoomDirectoryService.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/room/RoomDirectoryService.kt
index cb70603e66..77092c4811 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/room/RoomDirectoryService.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/room/RoomDirectoryService.kt
@@ -28,8 +28,10 @@ interface RoomDirectoryService {
/**
* Get rooms from directory.
*/
- suspend fun getPublicRooms(server: String?,
- publicRoomsParams: PublicRoomsParams): PublicRoomsResponse
+ suspend fun getPublicRooms(
+ server: String?,
+ publicRoomsParams: PublicRoomsParams
+ ): PublicRoomsResponse
/**
* Get the visibility of a room in the directory.
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/room/RoomService.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/room/RoomService.kt
index 1e022ef02a..5dfb8961e3 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/room/RoomService.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/room/RoomService.kt
@@ -60,9 +60,11 @@ interface RoomService {
* @param reason optional reason for joining the room
* @param viaServers the servers to attempt to join the room through. One of the servers must be participating in the room.
*/
- suspend fun joinRoom(roomIdOrAlias: String,
- reason: String? = null,
- viaServers: List = emptyList())
+ suspend fun joinRoom(
+ roomIdOrAlias: String,
+ reason: String? = null,
+ viaServers: List = emptyList()
+ )
/**
* @param roomId the roomId of the room to join
@@ -107,15 +109,19 @@ interface RoomService {
* Get a snapshot list of room summaries.
* @return the immutable list of [RoomSummary]
*/
- fun getRoomSummaries(queryParams: RoomSummaryQueryParams,
- sortOrder: RoomSortOrder = RoomSortOrder.NONE): List
+ fun getRoomSummaries(
+ queryParams: RoomSummaryQueryParams,
+ sortOrder: RoomSortOrder = RoomSortOrder.NONE
+ ): List
/**
* Get a live list of room summaries. This list is refreshed as soon as the data changes.
* @return the [LiveData] of List[RoomSummary]
*/
- fun getRoomSummariesLive(queryParams: RoomSummaryQueryParams,
- sortOrder: RoomSortOrder = RoomSortOrder.ACTIVITY): LiveData>
+ fun getRoomSummariesLive(
+ queryParams: RoomSummaryQueryParams,
+ sortOrder: RoomSortOrder = RoomSortOrder.ACTIVITY
+ ): LiveData>
/**
* Get a snapshot list of Breadcrumbs.
@@ -145,8 +151,10 @@ interface RoomService {
/**
* Resolve a room alias to a room ID.
*/
- suspend fun getRoomIdByAlias(roomAlias: String,
- searchOnServer: Boolean): Optional
+ suspend fun getRoomIdByAlias(
+ roomAlias: String,
+ searchOnServer: Boolean
+ ): Optional
/**
* Delete a room alias.
@@ -211,9 +219,11 @@ interface RoomService {
/**
* TODO Doc.
*/
- fun getPagedRoomSummariesLive(queryParams: RoomSummaryQueryParams,
- pagedListConfig: PagedList.Config = defaultPagedListConfig,
- sortOrder: RoomSortOrder = RoomSortOrder.ACTIVITY): LiveData>
+ fun getPagedRoomSummariesLive(
+ queryParams: RoomSummaryQueryParams,
+ pagedListConfig: PagedList.Config = defaultPagedListConfig,
+ sortOrder: RoomSortOrder = RoomSortOrder.ACTIVITY
+ ): LiveData>
/**
* Get's a live paged list from a filter that can be dynamically updated.
@@ -255,8 +265,10 @@ interface RoomService {
/**
* Returns all the children of this space, as LiveData.
*/
- fun getFlattenRoomSummaryChildrenOfLive(spaceId: String?,
- memberships: List = Membership.activeMemberships()): LiveData>
+ fun getFlattenRoomSummaryChildrenOfLive(
+ spaceId: String?,
+ memberships: List = Membership.activeMemberships()
+ ): LiveData>
/**
* Refreshes the RoomSummary LatestPreviewContent for the given @param roomId.
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/room/model/PowerLevelsContent.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/room/model/PowerLevelsContent.kt
index 8ef94b2896..0329828130 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/room/model/PowerLevelsContent.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/room/model/PowerLevelsContent.kt
@@ -95,8 +95,8 @@ data class PowerLevelsContent(
// the first implementation was a string value
is String -> value.toInt()
is Double -> value.toInt()
- is Int -> value
- else -> Role.Moderator.value
+ is Int -> value
+ else -> Role.Moderator.value
}
}
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/room/model/RoomGuestAccessContent.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/room/model/RoomGuestAccessContent.kt
index ba274325bc..7dd853d75d 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/room/model/RoomGuestAccessContent.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/room/model/RoomGuestAccessContent.kt
@@ -30,9 +30,9 @@ data class RoomGuestAccessContent(
@Json(name = "guest_access") val guestAccessStr: String? = null
) {
val guestAccess: GuestAccess? = when (guestAccessStr) {
- "can_join" -> GuestAccess.CanJoin
+ "can_join" -> GuestAccess.CanJoin
"forbidden" -> GuestAccess.Forbidden
- else -> {
+ else -> {
Timber.w("Invalid value for GuestAccess: `$guestAccessStr`")
null
}
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/room/model/RoomHistoryVisibilityContent.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/room/model/RoomHistoryVisibilityContent.kt
index da5c90ff05..39b4722c0c 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/room/model/RoomHistoryVisibilityContent.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/room/model/RoomHistoryVisibilityContent.kt
@@ -26,10 +26,10 @@ data class RoomHistoryVisibilityContent(
) {
val historyVisibility: RoomHistoryVisibility? = when (historyVisibilityStr) {
"world_readable" -> RoomHistoryVisibility.WORLD_READABLE
- "shared" -> RoomHistoryVisibility.SHARED
- "invited" -> RoomHistoryVisibility.INVITED
- "joined" -> RoomHistoryVisibility.JOINED
- else -> {
+ "shared" -> RoomHistoryVisibility.SHARED
+ "invited" -> RoomHistoryVisibility.INVITED
+ "joined" -> RoomHistoryVisibility.JOINED
+ else -> {
Timber.w("Invalid value for RoomHistoryVisibility: `$historyVisibilityStr`")
null
}
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/room/model/RoomJoinRulesContent.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/room/model/RoomJoinRulesContent.kt
index 3b338a36cd..dbe21b1633 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/room/model/RoomJoinRulesContent.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/room/model/RoomJoinRulesContent.kt
@@ -36,12 +36,12 @@ data class RoomJoinRulesContent(
@Json(name = "allow") val allowList: List? = null
) {
val joinRules: RoomJoinRules? = when (joinRulesStr) {
- "public" -> RoomJoinRules.PUBLIC
- "invite" -> RoomJoinRules.INVITE
- "knock" -> RoomJoinRules.KNOCK
- "private" -> RoomJoinRules.PRIVATE
+ "public" -> RoomJoinRules.PUBLIC
+ "invite" -> RoomJoinRules.INVITE
+ "knock" -> RoomJoinRules.KNOCK
+ "private" -> RoomJoinRules.PRIVATE
"restricted" -> RoomJoinRules.RESTRICTED
- else -> {
+ else -> {
Timber.w("Invalid value for RoomJoinRules: `$joinRulesStr`")
null
}
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/room/model/message/MessageVerificationAcceptContent.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/room/model/message/MessageVerificationAcceptContent.kt
index 27619cf0a9..33f61648dc 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/room/model/message/MessageVerificationAcceptContent.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/room/model/message/MessageVerificationAcceptContent.kt
@@ -40,12 +40,14 @@ internal data class MessageVerificationAcceptContent(
companion object : VerificationInfoAcceptFactory {
- override fun create(tid: String,
- keyAgreementProtocol: String,
- hash: String,
- commitment: String,
- messageAuthenticationCode: String,
- shortAuthenticationStrings: List): VerificationInfoAccept {
+ override fun create(
+ tid: String,
+ keyAgreementProtocol: String,
+ hash: String,
+ commitment: String,
+ messageAuthenticationCode: String,
+ shortAuthenticationStrings: List
+ ): VerificationInfoAccept {
return MessageVerificationAcceptContent(
hash,
keyAgreementProtocol,
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/room/model/relation/RelationService.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/room/model/relation/RelationService.kt
index 02c597ee63..d34ea3c7d3 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/room/model/relation/RelationService.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/room/model/relation/RelationService.kt
@@ -58,16 +58,20 @@ interface RelationService {
* @param targetEventId the id of the event being reacted
* @param reaction the reaction (preferably emoji)
*/
- fun sendReaction(targetEventId: String,
- reaction: String): Cancelable
+ fun sendReaction(
+ targetEventId: String,
+ reaction: String
+ ): Cancelable
/**
* Undo a reaction (emoji) to the targetedEvent.
* @param targetEventId the id of the event being reacted
* @param reaction the reaction (preferably emoji)
*/
- suspend fun undoReaction(targetEventId: String,
- reaction: String): Cancelable
+ suspend fun undoReaction(
+ targetEventId: String,
+ reaction: String
+ ): Cancelable
/**
* Edit a poll.
@@ -76,10 +80,12 @@ interface RelationService {
* @param question The edited question
* @param options The edited options
*/
- fun editPoll(targetEvent: TimelineEvent,
- pollType: PollType,
- question: String,
- options: List): Cancelable
+ fun editPoll(
+ targetEvent: TimelineEvent,
+ pollType: PollType,
+ question: String,
+ options: List
+ ): Cancelable
/**
* Edit a text message body. Limited to "m.text" contentType.
@@ -89,11 +95,13 @@ interface RelationService {
* @param newBodyAutoMarkdown true to parse markdown on the new body
* @param compatibilityBodyText The text that will appear on clients that don't support yet edition
*/
- fun editTextMessage(targetEvent: TimelineEvent,
- msgType: String,
- newBodyText: CharSequence,
- newBodyAutoMarkdown: Boolean,
- compatibilityBodyText: String = "* $newBodyText"): Cancelable
+ fun editTextMessage(
+ targetEvent: TimelineEvent,
+ msgType: String,
+ newBodyText: CharSequence,
+ newBodyAutoMarkdown: Boolean,
+ compatibilityBodyText: String = "* $newBodyText"
+ ): Cancelable
/**
* Edit a reply. This is a special case because replies contains fallback text as a prefix.
@@ -103,10 +111,12 @@ interface RelationService {
* @param newBodyText The edited body (stripped from in reply to content)
* @param compatibilityBodyText The text that will appear on clients that don't support yet edition
*/
- fun editReply(replyToEdit: TimelineEvent,
- originalTimelineEvent: TimelineEvent,
- newBodyText: String,
- compatibilityBodyText: String = "* $newBodyText"): Cancelable
+ fun editReply(
+ replyToEdit: TimelineEvent,
+ originalTimelineEvent: TimelineEvent,
+ newBodyText: String,
+ compatibilityBodyText: String = "* $newBodyText"
+ ): Cancelable
/**
* Get the edit history of the given event.
@@ -127,11 +137,12 @@ interface RelationService {
* @param showInThread If true, relation will be added to the reply in order to be visible from within threads
* @param rootThreadEventId If show in thread is true then we need the rootThreadEventId to generate the relation
*/
- fun replyToMessage(eventReplied: TimelineEvent,
- replyText: CharSequence,
- autoMarkdown: Boolean = false,
- showInThread: Boolean = false,
- rootThreadEventId: String? = null
+ fun replyToMessage(
+ eventReplied: TimelineEvent,
+ replyText: CharSequence,
+ autoMarkdown: Boolean = false,
+ showInThread: Boolean = false,
+ rootThreadEventId: String? = null
): Cancelable?
/**
@@ -159,10 +170,12 @@ interface RelationService {
* @param formattedText The formatted body using MessageType#FORMAT_MATRIX_HTML
* @param eventReplied the event referenced by the reply within a thread
*/
- fun replyInThread(rootThreadEventId: String,
- replyInThreadText: CharSequence,
- msgType: String = MessageType.MSGTYPE_TEXT,
- autoMarkdown: Boolean = false,
- formattedText: String? = null,
- eventReplied: TimelineEvent? = null): Cancelable?
+ fun replyInThread(
+ rootThreadEventId: String,
+ replyInThreadText: CharSequence,
+ msgType: String = MessageType.MSGTYPE_TEXT,
+ autoMarkdown: Boolean = false,
+ formattedText: String? = null,
+ eventReplied: TimelineEvent? = null
+ ): Cancelable?
}
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/room/powerlevels/Role.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/room/powerlevels/Role.kt
index 5fe9bf6993..c5cc573458 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/room/powerlevels/Role.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/room/powerlevels/Role.kt
@@ -32,11 +32,11 @@ sealed class Role(open val value: Int) : Comparable {
// Order matters, default value should be checked after defined roles
fun fromValue(value: Int, default: Int): Role {
return when (value) {
- Admin.value -> Admin
+ Admin.value -> Admin
Moderator.value -> Moderator
Default.value,
- default -> Default
- else -> Custom(value)
+ default -> Default
+ else -> Custom(value)
}
}
}
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/room/send/SendService.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/room/send/SendService.kt
index c2e3ded2fa..661c3be5bd 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/room/send/SendService.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/room/send/SendService.kt
@@ -76,10 +76,12 @@ interface SendService {
* @param rootThreadEventId when this param is not null, the Media will be sent in this specific thread
* @return a [Cancelable]
*/
- fun sendMedia(attachment: ContentAttachmentData,
- compressBeforeSending: Boolean,
- roomIds: Set,
- rootThreadEventId: String? = null): Cancelable
+ fun sendMedia(
+ attachment: ContentAttachmentData,
+ compressBeforeSending: Boolean,
+ roomIds: Set,
+ rootThreadEventId: String? = null
+ ): Cancelable
/**
* Method to send a list of media asynchronously.
@@ -90,10 +92,12 @@ interface SendService {
* @param rootThreadEventId when this param is not null, all the Media will be sent in this specific thread
* @return a [Cancelable]
*/
- fun sendMedias(attachments: List,
- compressBeforeSending: Boolean,
- roomIds: Set,
- rootThreadEventId: String? = null): Cancelable
+ fun sendMedias(
+ attachments: List,
+ compressBeforeSending: Boolean,
+ roomIds: Set,
+ rootThreadEventId: String? = null
+ ): Cancelable
/**
* Send a poll to the room.
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/room/send/UserDraft.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/room/send/UserDraft.kt
index 4ede1a66fc..e16405b3c0 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/room/send/UserDraft.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/room/send/UserDraft.kt
@@ -33,7 +33,7 @@ sealed interface UserDraft {
fun isValid(): Boolean {
return when (this) {
is Regular -> content.isNotBlank()
- else -> true
+ else -> true
}
}
}
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/room/sender/SenderInfo.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/room/sender/SenderInfo.kt
index 4c308c355a..d629df8b16 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/room/sender/SenderInfo.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/room/sender/SenderInfo.kt
@@ -29,9 +29,9 @@ data class SenderInfo(
) {
val disambiguatedDisplayName: String
get() = when {
- displayName == null -> userId
+ displayName == null -> userId
displayName.replaceSpaceChars().isBlank() -> "$displayName ($userId)"
- isUniqueDisplayName -> displayName
- else -> "$displayName ($userId)"
+ isUniqueDisplayName -> displayName
+ else -> "$displayName ($userId)"
}
}
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/room/threads/model/ThreadEditions.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/room/threads/model/ThreadEditions.kt
index c8353cf0de..dc9cc886e9 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/room/threads/model/ThreadEditions.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/room/threads/model/ThreadEditions.kt
@@ -16,5 +16,7 @@
package org.matrix.android.sdk.api.session.room.threads.model
-data class ThreadEditions(var rootThreadEdition: String? = null,
- var latestThreadEdition: String? = null)
+data class ThreadEditions(
+ var rootThreadEdition: String? = null,
+ var latestThreadEdition: String? = null
+)
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/room/threads/model/ThreadSummary.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/room/threads/model/ThreadSummary.kt
index 1ef972e889..0b1aea1966 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/room/threads/model/ThreadSummary.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/room/threads/model/ThreadSummary.kt
@@ -22,12 +22,14 @@ import org.matrix.android.sdk.api.session.room.sender.SenderInfo
/**
* The main thread Summary model, mainly used to display the thread list.
*/
-data class ThreadSummary(val roomId: String,
- val rootEvent: Event?,
- val latestEvent: Event?,
- val rootEventId: String,
- val rootThreadSenderInfo: SenderInfo,
- val latestThreadSenderInfo: SenderInfo,
- val isUserParticipating: Boolean,
- val numberOfThreads: Int,
- val threadEditions: ThreadEditions = ThreadEditions())
+data class ThreadSummary(
+ val roomId: String,
+ val rootEvent: Event?,
+ val latestEvent: Event?,
+ val rootEventId: String,
+ val rootThreadSenderInfo: SenderInfo,
+ val latestThreadSenderInfo: SenderInfo,
+ val isUserParticipating: Boolean,
+ val numberOfThreads: Int,
+ val threadEditions: ThreadEditions = ThreadEditions()
+)
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/room/timeline/TimelineEvent.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/room/timeline/TimelineEvent.kt
index d4ade9b5b9..9d8c8a13bd 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/room/timeline/TimelineEvent.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/room/timeline/TimelineEvent.kt
@@ -139,11 +139,11 @@ fun TimelineEvent.getEditedEventId(): String? {
*/
fun TimelineEvent.getLastMessageContent(): MessageContent? {
return when (root.getClearType()) {
- EventType.STICKER -> root.getClearContent().toModel()
- in EventType.POLL_START -> (annotations?.editSummary?.latestContent ?: root.getClearContent()).toModel()
+ EventType.STICKER -> root.getClearContent().toModel()
+ in EventType.POLL_START -> (annotations?.editSummary?.latestContent ?: root.getClearContent()).toModel()
in EventType.STATE_ROOM_BEACON_INFO -> (annotations?.editSummary?.latestContent ?: root.getClearContent()).toModel()
- in EventType.BEACON_LOCATION_DATA -> (annotations?.editSummary?.latestContent ?: root.getClearContent()).toModel()
- else -> (annotations?.editSummary?.latestContent ?: root.getClearContent()).toModel()
+ in EventType.BEACON_LOCATION_DATA -> (annotations?.editSummary?.latestContent ?: root.getClearContent()).toModel()
+ else -> (annotations?.editSummary?.latestContent ?: root.getClearContent()).toModel()
}
}
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/search/SearchService.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/search/SearchService.kt
index bc1c9e5769..ffb8b1ca4d 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/search/SearchService.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/search/SearchService.kt
@@ -33,12 +33,14 @@ interface SearchService {
* @param afterLimit how many events after the result are returned.
* @param includeProfile requests that the server returns the historic profile information for the users that sent the events that were returned.
*/
- suspend fun search(searchTerm: String,
- roomId: String,
- nextBatch: String?,
- orderByRecent: Boolean,
- limit: Int,
- beforeLimit: Int,
- afterLimit: Int,
- includeProfile: Boolean): SearchResult
+ suspend fun search(
+ searchTerm: String,
+ roomId: String,
+ nextBatch: String?,
+ orderByRecent: Boolean,
+ limit: Int,
+ beforeLimit: Int,
+ afterLimit: Int,
+ includeProfile: Boolean
+ ): SearchResult
}
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/securestorage/SharedSecretStorageService.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/securestorage/SharedSecretStorageService.kt
index 929463563f..bdbbd3ea84 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/securestorage/SharedSecretStorageService.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/securestorage/SharedSecretStorageService.kt
@@ -44,10 +44,12 @@ interface SharedSecretStorageService {
*
* @return key creation info
*/
- suspend fun generateKey(keyId: String,
- key: SsssKeySpec?,
- keyName: String,
- keySigner: KeySigner?): SsssKeyCreationInfo
+ suspend fun generateKey(
+ keyId: String,
+ key: SsssKeySpec?,
+ keyName: String,
+ keySigner: KeySigner?
+ ): SsssKeyCreationInfo
/**
* Generates a SSSS key using the given passphrase.
@@ -61,11 +63,13 @@ interface SharedSecretStorageService {
*
* @return key creation info
*/
- suspend fun generateKeyWithPassphrase(keyId: String,
- keyName: String,
- passphrase: String,
- keySigner: KeySigner,
- progressListener: ProgressListener?): SsssKeyCreationInfo
+ suspend fun generateKeyWithPassphrase(
+ keyId: String,
+ keyName: String,
+ passphrase: String,
+ keySigner: KeySigner,
+ progressListener: ProgressListener?
+ ): SsssKeyCreationInfo
fun getKey(keyId: String): KeyInfoResult
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/space/Space.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/space/Space.kt
index c990388628..61c03e08fc 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/space/Space.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/space/Space.kt
@@ -31,11 +31,13 @@ interface Space {
*/
fun spaceSummary(): RoomSummary?
- suspend fun addChildren(roomId: String,
- viaServers: List?,
- order: String?,
+ suspend fun addChildren(
+ roomId: String,
+ viaServers: List?,
+ order: String?,
// autoJoin: Boolean = false,
- suggested: Boolean? = false)
+ suggested: Boolean? = false
+ )
fun getChildInfo(roomId: String): SpaceChildContent?
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/space/SpaceService.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/space/SpaceService.kt
index 38e55664d2..c7a6405014 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/space/SpaceService.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/space/SpaceService.kt
@@ -37,11 +37,13 @@ interface SpaceService {
/**
* Just a shortcut for space creation for ease of use.
*/
- suspend fun createSpace(name: String,
- topic: String?,
- avatarUri: Uri?,
- isPublic: Boolean,
- roomAliasLocalPart: String? = null): String
+ suspend fun createSpace(
+ name: String,
+ topic: String?,
+ avatarUri: Uri?,
+ isPublic: Boolean,
+ roomAliasLocalPart: String? = null
+ ): String
/**
* Get a space from a spaceId.
@@ -68,25 +70,33 @@ interface SpaceService {
* then the parameters given for suggested_only and max_depth must be the same.
* @param knownStateList when paginating, pass back the m.space.child state events
*/
- suspend fun querySpaceChildren(spaceId: String,
- suggestedOnly: Boolean? = null,
- limit: Int? = null,
- from: String? = null,
- knownStateList: List? = null): SpaceHierarchyData
+ suspend fun querySpaceChildren(
+ spaceId: String,
+ suggestedOnly: Boolean? = null,
+ limit: Int? = null,
+ from: String? = null,
+ knownStateList: List? = null
+ ): SpaceHierarchyData
/**
* Get a live list of space summaries. This list is refreshed as soon as the data changes.
* @return the [LiveData] of List[SpaceSummary]
*/
- fun getSpaceSummariesLive(queryParams: SpaceSummaryQueryParams,
- sortOrder: RoomSortOrder = RoomSortOrder.NONE): LiveData>
+ fun getSpaceSummariesLive(
+ queryParams: SpaceSummaryQueryParams,
+ sortOrder: RoomSortOrder = RoomSortOrder.NONE
+ ): LiveData>
- fun getSpaceSummaries(spaceSummaryQueryParams: SpaceSummaryQueryParams,
- sortOrder: RoomSortOrder = RoomSortOrder.NONE): List
+ fun getSpaceSummaries(
+ spaceSummaryQueryParams: SpaceSummaryQueryParams,
+ sortOrder: RoomSortOrder = RoomSortOrder.NONE
+ ): List
- suspend fun joinSpace(spaceIdOrAlias: String,
- reason: String? = null,
- viaServers: List = emptyList()): JoinSpaceResult
+ suspend fun joinSpace(
+ spaceIdOrAlias: String,
+ reason: String? = null,
+ viaServers: List = emptyList()
+ ): JoinSpaceResult
suspend fun rejectInvite(spaceId: String, reason: String?)
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/statistics/StatisticEvent.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/statistics/StatisticEvent.kt
index 76755517ce..d9c7772393 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/statistics/StatisticEvent.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/statistics/StatisticEvent.kt
@@ -23,15 +23,19 @@ sealed interface StatisticEvent {
/**
* Initial sync request, response downloading, and treatment (parsing and storage) of response.
*/
- data class InitialSyncRequest(val requestDurationMs: Int,
- val downloadDurationMs: Int,
- val treatmentDurationMs: Int,
- val nbOfJoinedRooms: Int) : StatisticEvent
+ data class InitialSyncRequest(
+ val requestDurationMs: Int,
+ val downloadDurationMs: Int,
+ val treatmentDurationMs: Int,
+ val nbOfJoinedRooms: Int
+ ) : StatisticEvent
/**
* Incremental sync event.
*/
- data class SyncTreatment(val durationMs: Int,
- val afterPause: Boolean,
- val nbOfJoinedRooms: Int) : StatisticEvent
+ data class SyncTreatment(
+ val durationMs: Int,
+ val afterPause: Boolean,
+ val nbOfJoinedRooms: Int
+ ) : StatisticEvent
}
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/initsync/InitSyncStep.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/sync/InitialSyncStep.kt
similarity index 91%
rename from matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/initsync/InitSyncStep.kt
rename to matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/sync/InitialSyncStep.kt
index 901c1b2ffb..407585b003 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/initsync/InitSyncStep.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/sync/InitialSyncStep.kt
@@ -14,9 +14,9 @@
* limitations under the License.
*/
-package org.matrix.android.sdk.api.session.initsync
+package org.matrix.android.sdk.api.session.sync
-enum class InitSyncStep {
+enum class InitialSyncStep {
ServerComputing,
Downloading,
ImportingAccount,
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/sync/SyncRequestState.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/sync/SyncRequestState.kt
new file mode 100644
index 0000000000..4e932d49de
--- /dev/null
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/sync/SyncRequestState.kt
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2022 The Matrix.org Foundation C.I.C.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.matrix.android.sdk.api.session.sync
+
+sealed interface SyncRequestState {
+ /**
+ * For initial sync.
+ */
+ interface InitialSyncRequestState : SyncRequestState
+
+ object Idle : InitialSyncRequestState
+ data class InitialSyncProgressing(
+ val initialSyncStep: InitialSyncStep,
+ val percentProgress: Int = 0
+ ) : InitialSyncRequestState
+
+ /**
+ * For incremental sync.
+ */
+ interface IncrementalSyncRequestState : SyncRequestState
+
+ object IncrementalSyncIdle : IncrementalSyncRequestState
+ data class IncrementalSyncParsing(
+ val rooms: Int,
+ val toDevice: Int
+ ) : IncrementalSyncRequestState
+
+ object IncrementalSyncError : IncrementalSyncRequestState
+ object IncrementalSyncDone : IncrementalSyncRequestState
+}
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/sync/SyncService.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/sync/SyncService.kt
new file mode 100644
index 0000000000..5b2bf651af
--- /dev/null
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/sync/SyncService.kt
@@ -0,0 +1,76 @@
+/*
+ * Copyright 2022 The Matrix.org Foundation C.I.C.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.matrix.android.sdk.api.session.sync
+
+import androidx.lifecycle.LiveData
+import kotlinx.coroutines.flow.SharedFlow
+import org.matrix.android.sdk.api.session.sync.model.SyncResponse
+
+interface SyncService {
+ /**
+ * This method start the sync thread.
+ */
+ fun startSync(fromForeground: Boolean)
+
+ /**
+ * This method stop the sync thread.
+ */
+ fun stopSync()
+
+ /**
+ * Requires a one time background sync.
+ */
+ fun requireBackgroundSync()
+
+ /**
+ * Launches infinite self rescheduling background syncs via the WorkManager.
+ *
+ * While dozing, syncs will only occur during maintenance windows.
+ * For reliability it's recommended to also start a long running foreground service
+ * along with disabling battery optimizations.
+ */
+ fun startAutomaticBackgroundSync(timeOutInSeconds: Long, repeatDelayInSeconds: Long)
+
+ fun stopAnyBackgroundSync()
+
+ /**
+ * This method returns the current sync state.
+ * @return the current [SyncState].
+ */
+ fun getSyncState(): SyncState
+
+ /**
+ * This method allows to listen the sync state.
+ * @return a [LiveData] of [SyncState].
+ */
+ fun getSyncStateLive(): LiveData
+
+ /**
+ * Get the [SyncRequestState] as a LiveData.
+ */
+ fun getSyncRequestStateLive(): LiveData
+
+ /**
+ * This method returns a flow of SyncResponse. New value will be pushed through the sync thread.
+ */
+ fun syncFlow(): SharedFlow
+
+ /**
+ * This methods return true if an initial sync has been processed.
+ */
+ fun hasAlreadySynced(): Boolean
+}
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/sync/job/SyncService.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/sync/job/SyncAndroidService.kt
similarity index 97%
rename from matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/sync/job/SyncService.kt
rename to matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/sync/job/SyncAndroidService.kt
index ac81be2174..8dee633b9c 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/sync/job/SyncService.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/sync/job/SyncAndroidService.kt
@@ -46,7 +46,7 @@ import java.util.concurrent.atomic.AtomicBoolean
* in order to be able to perform a sync even if the app is not running.
* The and must be declared in the Manifest or the app using the SDK
*/
-abstract class SyncService : Service() {
+abstract class SyncAndroidService : Service() {
private var sessionId: String? = null
private var mIsSelfDestroyed: Boolean = false
@@ -84,7 +84,7 @@ abstract class SyncService : Service() {
stopMe()
}
}
- else -> {
+ else -> {
val isInit = initialize(intent)
onStart(isInitialSync)
if (isInit) {
@@ -158,9 +158,9 @@ abstract class SyncService : Service() {
// never do that in foreground, let the syncThread work
syncTask.execute(params)
// Start sync if we were doing an initial sync and the syncThread is not launched yet
- if (isInitialSync && session.getSyncState() == SyncState.Idle) {
+ if (isInitialSync && session.syncService().getSyncState() == SyncState.Idle) {
val isForeground = !backgroundDetectionObserver.isInBackground
- session.startSync(isForeground)
+ session.syncService().startSync(isForeground)
}
stopMe()
} catch (throwable: Throwable) {
@@ -210,7 +210,7 @@ abstract class SyncService : Service() {
session = sessionComponent.session()
sessionId = safeSessionId
syncTask = sessionComponent.syncTask()
- isInitialSync = !session.hasAlreadySynced()
+ isInitialSync = !session.syncService().hasAlreadySynced()
networkConnectivityChecker = sessionComponent.networkConnectivityChecker()
taskExecutor = sessionComponent.taskExecutor()
coroutineDispatchers = sessionComponent.coroutineDispatchers()
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/sync/model/RoomSyncUnreadNotifications.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/sync/model/RoomSyncUnreadNotifications.kt
index 6618bceacd..09273f56e6 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/sync/model/RoomSyncUnreadNotifications.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/sync/model/RoomSyncUnreadNotifications.kt
@@ -38,4 +38,5 @@ data class RoomSyncUnreadNotifications(
/**
* The number of highlighted unread messages (subset of notifications).
*/
- @Json(name = "highlight_count") val highlightCount: Int? = null)
+ @Json(name = "highlight_count") val highlightCount: Int? = null
+)
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/terms/TermsResponse.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/terms/TermsResponse.kt
index 9a30b4d764..ae728326cc 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/terms/TermsResponse.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/terms/TermsResponse.kt
@@ -30,8 +30,10 @@ data class TermsResponse(
val policies: JsonDict? = null
) {
- fun getLocalizedTerms(userLanguage: String,
- defaultLanguage: String = "en"): List {
+ fun getLocalizedTerms(
+ userLanguage: String,
+ defaultLanguage: String = "en"
+ ): List {
return policies?.map {
val tos = policies[it.key] as? Map<*, *> ?: return@map null
((tos[userLanguage] ?: tos[defaultLanguage]) as? Map<*, *>)?.let { termsMap ->
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/terms/TermsService.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/terms/TermsService.kt
index 6c357b2224..1ddce763d1 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/terms/TermsService.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/terms/TermsService.kt
@@ -24,10 +24,12 @@ interface TermsService {
suspend fun getTerms(serviceType: ServiceType, baseUrl: String): GetTermsResponse
- suspend fun agreeToTerms(serviceType: ServiceType,
- baseUrl: String,
- agreedUrls: List,
- token: String?)
+ suspend fun agreeToTerms(
+ serviceType: ServiceType,
+ baseUrl: String,
+ agreedUrls: List,
+ token: String?
+ )
/**
* Get the homeserver terms, from the register API.
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/util/MatrixItem.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/util/MatrixItem.kt
index 8a29d00380..26dd31dc2d 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/util/MatrixItem.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/util/MatrixItem.kt
@@ -33,9 +33,11 @@ sealed class MatrixItem(
open val displayName: String?,
open val avatarUrl: String?
) {
- data class UserItem(override val id: String,
- override val displayName: String? = null,
- override val avatarUrl: String? = null) :
+ data class UserItem(
+ override val id: String,
+ override val displayName: String? = null,
+ override val avatarUrl: String? = null
+ ) :
MatrixItem(id, displayName?.removeSuffix(IRC_PATTERN), avatarUrl) {
init {
@@ -45,10 +47,12 @@ sealed class MatrixItem(
override fun updateAvatar(newAvatar: String?) = copy(avatarUrl = newAvatar)
}
- data class EveryoneInRoomItem(override val id: String,
- override val displayName: String = NOTIFY_EVERYONE,
- override val avatarUrl: String? = null,
- val roomDisplayName: String? = null) :
+ data class EveryoneInRoomItem(
+ override val id: String,
+ override val displayName: String = NOTIFY_EVERYONE,
+ override val avatarUrl: String? = null,
+ val roomDisplayName: String? = null
+ ) :
MatrixItem(id, displayName, avatarUrl) {
init {
if (BuildConfig.DEBUG) checkId()
@@ -57,9 +61,11 @@ sealed class MatrixItem(
override fun updateAvatar(newAvatar: String?) = copy(avatarUrl = newAvatar)
}
- data class EventItem(override val id: String,
- override val displayName: String? = null,
- override val avatarUrl: String? = null) :
+ data class EventItem(
+ override val id: String,
+ override val displayName: String? = null,
+ override val avatarUrl: String? = null
+ ) :
MatrixItem(id, displayName, avatarUrl) {
init {
if (BuildConfig.DEBUG) checkId()
@@ -68,9 +74,11 @@ sealed class MatrixItem(
override fun updateAvatar(newAvatar: String?) = copy(avatarUrl = newAvatar)
}
- data class RoomItem(override val id: String,
- override val displayName: String? = null,
- override val avatarUrl: String? = null) :
+ data class RoomItem(
+ override val id: String,
+ override val displayName: String? = null,
+ override val avatarUrl: String? = null
+ ) :
MatrixItem(id, displayName, avatarUrl) {
init {
if (BuildConfig.DEBUG) checkId()
@@ -79,9 +87,11 @@ sealed class MatrixItem(
override fun updateAvatar(newAvatar: String?) = copy(avatarUrl = newAvatar)
}
- data class SpaceItem(override val id: String,
- override val displayName: String? = null,
- override val avatarUrl: String? = null) :
+ data class SpaceItem(
+ override val id: String,
+ override val displayName: String? = null,
+ override val avatarUrl: String? = null
+ ) :
MatrixItem(id, displayName, avatarUrl) {
init {
if (BuildConfig.DEBUG) checkId()
@@ -90,9 +100,11 @@ sealed class MatrixItem(
override fun updateAvatar(newAvatar: String?) = copy(avatarUrl = newAvatar)
}
- data class RoomAliasItem(override val id: String,
- override val displayName: String? = null,
- override val avatarUrl: String? = null) :
+ data class RoomAliasItem(
+ override val id: String,
+ override val displayName: String? = null,
+ override val avatarUrl: String? = null
+ ) :
MatrixItem(id, displayName, avatarUrl) {
init {
if (BuildConfig.DEBUG) checkId()
@@ -101,9 +113,11 @@ sealed class MatrixItem(
override fun updateAvatar(newAvatar: String?) = copy(avatarUrl = newAvatar)
}
- data class GroupItem(override val id: String,
- override val displayName: String? = null,
- override val avatarUrl: String? = null) :
+ data class GroupItem(
+ override val id: String,
+ override val displayName: String? = null,
+ override val avatarUrl: String? = null
+ ) :
MatrixItem(id, displayName, avatarUrl) {
init {
if (BuildConfig.DEBUG) checkId()
@@ -124,20 +138,20 @@ sealed class MatrixItem(
* Return the prefix as defined in the matrix spec (and not extracted from the id).
*/
private fun getIdPrefix() = when (this) {
- is UserItem -> '@'
- is EventItem -> '$'
+ is UserItem -> '@'
+ is EventItem -> '$'
is SpaceItem,
is RoomItem,
is EveryoneInRoomItem -> '!'
- is RoomAliasItem -> '#'
- is GroupItem -> '+'
+ is RoomAliasItem -> '#'
+ is GroupItem -> '+'
}
fun firstLetterOfDisplayName(): String {
val displayName = when (this) {
// use the room display name for the notify everyone item
is EveryoneInRoomItem -> roomDisplayName
- else -> displayName
+ else -> displayName
}
return (displayName?.takeIf { it.isNotBlank() } ?: id)
.let { dn ->
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/SessionManager.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/SessionManager.kt
index 934d61de45..bd2dac9e3c 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/SessionManager.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/SessionManager.kt
@@ -27,8 +27,10 @@ import org.matrix.android.sdk.internal.session.SessionComponent
import javax.inject.Inject
@MatrixScope
-internal class SessionManager @Inject constructor(private val matrixComponent: MatrixComponent,
- private val sessionParamsStore: SessionParamsStore) {
+internal class SessionManager @Inject constructor(
+ private val matrixComponent: MatrixComponent,
+ private val sessionParamsStore: SessionParamsStore
+) {
// SessionId -> SessionComponent
private val sessionComponents = HashMap()
@@ -53,7 +55,7 @@ internal class SessionManager @Inject constructor(private val matrixComponent: M
fun stopSession(sessionId: String) {
val sessionComponent = sessionComponents[sessionId] ?: throw RuntimeException("You don't have a session for id $sessionId")
- sessionComponent.session().stopSync()
+ sessionComponent.session().syncService().stopSync()
}
fun getOrCreateSessionComponent(sessionParams: SessionParams): SessionComponent {
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/auth/AuthAPI.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/auth/AuthAPI.kt
index 46fa63334c..ea4502824e 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/auth/AuthAPI.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/auth/AuthAPI.kt
@@ -98,15 +98,19 @@ internal interface AuthAPI {
* https://github.com/matrix-org/matrix-doc/pull/2290
*/
@POST(NetworkConstants.URI_API_PREFIX_PATH_R0 + "register/{threePid}/requestToken")
- suspend fun add3Pid(@Path("threePid") threePid: String,
- @Body params: AddThreePidRegistrationParams): AddThreePidRegistrationResponse
+ suspend fun add3Pid(
+ @Path("threePid") threePid: String,
+ @Body params: AddThreePidRegistrationParams
+ ): AddThreePidRegistrationResponse
/**
* Validate 3pid.
*/
@POST
- suspend fun validate3Pid(@Url url: String,
- @Body params: ValidationCodeBody): SuccessResult
+ suspend fun validate3Pid(
+ @Url url: String,
+ @Body params: ValidationCodeBody
+ ): SuccessResult
/**
* Get the supported login flow.
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/auth/AuthModule.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/auth/AuthModule.kt
index 298e116199..ddb70be906 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/auth/AuthModule.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/auth/AuthModule.kt
@@ -46,9 +46,11 @@ internal abstract class AuthModule {
@JvmStatic
@Provides
@AuthDatabase
- fun providesRealmConfiguration(context: Context,
- realmKeysUtils: RealmKeysUtils,
- authRealmMigration: AuthRealmMigration): RealmConfiguration {
+ fun providesRealmConfiguration(
+ context: Context,
+ realmKeysUtils: RealmKeysUtils,
+ authRealmMigration: AuthRealmMigration
+ ): RealmConfiguration {
val old = File(context.filesDir, "matrix-sdk-auth")
if (old.exists()) {
old.renameTo(File(context.filesDir, "matrix-sdk-auth.realm"))
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/auth/DefaultAuthenticationService.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/auth/DefaultAuthenticationService.kt
index fe78ccc75a..61a423669c 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/auth/DefaultAuthenticationService.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/auth/DefaultAuthenticationService.kt
@@ -130,16 +130,7 @@ internal class DefaultAuthenticationService @Inject constructor(
?.trim { it == '/' }
}
- /**
- * This is the entry point of the authentication service.
- * homeServerConnectionConfig contains a homeserver URL probably entered by the user, which can be a
- * valid homeserver API url, the url of Element Web, or anything else.
- */
override suspend fun getLoginFlow(homeServerConnectionConfig: HomeServerConnectionConfig): LoginFlowResult {
- pendingSessionData = null
-
- pendingSessionStore.delete()
-
val result = runCatching {
getLoginFlowInternal(homeServerConnectionConfig)
}
@@ -290,7 +281,7 @@ internal class DefaultAuthenticationService @Inject constructor(
getLoginFlowResult(newAuthAPI, versions, wellknownResult.homeServerUrl)
}
- else -> throw Failure.OtherServerError("", HttpsURLConnection.HTTP_NOT_FOUND /* 404 */)
+ else -> throw Failure.OtherServerError("", HttpsURLConnection.HTTP_NOT_FOUND /* 404 */)
}
}
@@ -367,13 +358,17 @@ internal class DefaultAuthenticationService @Inject constructor(
pendingSessionStore.delete()
}
- override suspend fun createSessionFromSso(homeServerConnectionConfig: HomeServerConnectionConfig,
- credentials: Credentials): Session {
+ override suspend fun createSessionFromSso(
+ homeServerConnectionConfig: HomeServerConnectionConfig,
+ credentials: Credentials
+ ): Session {
return sessionCreator.createSession(credentials, homeServerConnectionConfig)
}
- override suspend fun getWellKnownData(matrixId: String,
- homeServerConnectionConfig: HomeServerConnectionConfig?): WellknownResult {
+ override suspend fun getWellKnownData(
+ matrixId: String,
+ homeServerConnectionConfig: HomeServerConnectionConfig?
+ ): WellknownResult {
if (!MatrixPatterns.isUserId(matrixId)) {
throw MatrixIdFailure.InvalidMatrixId
}
@@ -391,11 +386,13 @@ internal class DefaultAuthenticationService @Inject constructor(
.withHomeServerUri("https://dummy.org")
.build()
- override suspend fun directAuthentication(homeServerConnectionConfig: HomeServerConnectionConfig,
- matrixId: String,
- password: String,
- initialDeviceName: String,
- deviceId: String?): Session {
+ override suspend fun directAuthentication(
+ homeServerConnectionConfig: HomeServerConnectionConfig,
+ matrixId: String,
+ password: String,
+ initialDeviceName: String,
+ deviceId: String?
+ ): Session {
return directLoginTask.execute(
DirectLoginTask.Params(
homeServerConnectionConfig = homeServerConnectionConfig,
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/auth/data/PasswordLoginParams.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/auth/data/PasswordLoginParams.kt
index 5be480f633..5f0a2298cb 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/auth/data/PasswordLoginParams.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/auth/data/PasswordLoginParams.kt
@@ -31,7 +31,8 @@ internal data class PasswordLoginParams(
@Json(name = "password") val password: String,
@Json(name = "type") override val type: String,
@Json(name = "initial_device_display_name") val deviceDisplayName: String?,
- @Json(name = "device_id") val deviceId: String?) : LoginParams {
+ @Json(name = "device_id") val deviceId: String?
+) : LoginParams {
companion object {
private const val IDENTIFIER_KEY_TYPE = "type"
@@ -47,10 +48,12 @@ internal data class PasswordLoginParams(
private const val IDENTIFIER_KEY_COUNTRY = "country"
private const val IDENTIFIER_KEY_PHONE = "phone"
- fun userIdentifier(user: String,
- password: String,
- deviceDisplayName: String?,
- deviceId: String?): PasswordLoginParams {
+ fun userIdentifier(
+ user: String,
+ password: String,
+ deviceDisplayName: String?,
+ deviceId: String?
+ ): PasswordLoginParams {
return PasswordLoginParams(
identifier = mapOf(
IDENTIFIER_KEY_TYPE to IDENTIFIER_KEY_TYPE_USER,
@@ -63,11 +66,13 @@ internal data class PasswordLoginParams(
)
}
- fun thirdPartyIdentifier(medium: String,
- address: String,
- password: String,
- deviceDisplayName: String?,
- deviceId: String?): PasswordLoginParams {
+ fun thirdPartyIdentifier(
+ medium: String,
+ address: String,
+ password: String,
+ deviceDisplayName: String?,
+ deviceId: String?
+ ): PasswordLoginParams {
return PasswordLoginParams(
identifier = mapOf(
IDENTIFIER_KEY_TYPE to IDENTIFIER_KEY_TYPE_THIRD_PARTY,
@@ -81,11 +86,13 @@ internal data class PasswordLoginParams(
)
}
- fun phoneIdentifier(country: String,
- phone: String,
- password: String,
- deviceDisplayName: String?,
- deviceId: String?): PasswordLoginParams {
+ fun phoneIdentifier(
+ country: String,
+ phone: String,
+ password: String,
+ deviceDisplayName: String?,
+ deviceId: String?
+ ): PasswordLoginParams {
return PasswordLoginParams(
identifier = mapOf(
IDENTIFIER_KEY_TYPE to IDENTIFIER_KEY_TYPE_PHONE,
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/auth/db/RealmPendingSessionStore.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/auth/db/RealmPendingSessionStore.kt
index 13f26e321d..aae8ff8419 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/auth/db/RealmPendingSessionStore.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/auth/db/RealmPendingSessionStore.kt
@@ -23,9 +23,10 @@ import org.matrix.android.sdk.internal.database.awaitTransaction
import org.matrix.android.sdk.internal.di.AuthDatabase
import javax.inject.Inject
-internal class RealmPendingSessionStore @Inject constructor(private val mapper: PendingSessionMapper,
- @AuthDatabase
- private val realmConfiguration: RealmConfiguration
+internal class RealmPendingSessionStore @Inject constructor(
+ private val mapper: PendingSessionMapper,
+ @AuthDatabase
+ private val realmConfiguration: RealmConfiguration
) : PendingSessionStore {
override suspend fun savePendingSessionData(pendingSessionData: PendingSessionData) {
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/auth/db/RealmSessionParamsStore.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/auth/db/RealmSessionParamsStore.kt
index 235ef6b709..4c3e3ca824 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/auth/db/RealmSessionParamsStore.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/auth/db/RealmSessionParamsStore.kt
@@ -28,9 +28,10 @@ import org.matrix.android.sdk.internal.di.AuthDatabase
import timber.log.Timber
import javax.inject.Inject
-internal class RealmSessionParamsStore @Inject constructor(private val mapper: SessionParamsMapper,
- @AuthDatabase
- private val realmConfiguration: RealmConfiguration
+internal class RealmSessionParamsStore @Inject constructor(
+ private val mapper: SessionParamsMapper,
+ @AuthDatabase
+ private val realmConfiguration: RealmConfiguration
) : SessionParamsStore {
override fun getLast(): SessionParams? {
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/auth/login/DefaultLoginWizard.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/auth/login/DefaultLoginWizard.kt
index 0583951138..20b056f1c7 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/auth/login/DefaultLoginWizard.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/auth/login/DefaultLoginWizard.kt
@@ -52,10 +52,12 @@ internal class DefaultLoginWizard(
return getProfileTask.execute(GetProfileTask.Params(matrixId))
}
- override suspend fun login(login: String,
- password: String,
- initialDeviceName: String,
- deviceId: String?): Session {
+ override suspend fun login(
+ login: String,
+ password: String,
+ initialDeviceName: String,
+ deviceId: String?
+ ): Session {
val loginParams = if (Patterns.EMAIL_ADDRESS.matcher(login).matches()) {
PasswordLoginParams.thirdPartyIdentifier(
medium = ThreePidMedium.EMAIL,
@@ -101,7 +103,7 @@ internal class DefaultLoginWizard(
return sessionCreator.createSession(credentials, pendingSessionData.homeServerConnectionConfig)
}
- override suspend fun resetPassword(email: String, newPassword: String) {
+ override suspend fun resetPassword(email: String) {
val param = RegisterAddThreePidTask.Params(
RegisterThreePid.Email(email),
pendingSessionData.clientSecret,
@@ -115,18 +117,16 @@ internal class DefaultLoginWizard(
authAPI.resetPassword(AddThreePidRegistrationParams.from(param))
}
- pendingSessionData = pendingSessionData.copy(resetPasswordData = ResetPasswordData(newPassword, result))
+ pendingSessionData = pendingSessionData.copy(resetPasswordData = ResetPasswordData(result))
.also { pendingSessionStore.savePendingSessionData(it) }
}
- override suspend fun resetPasswordMailConfirmed() {
- val safeResetPasswordData = pendingSessionData.resetPasswordData
- ?: throw IllegalStateException("developer error, no reset password in progress")
-
+ override suspend fun resetPasswordMailConfirmed(newPassword: String) {
+ val resetPasswordData = pendingSessionData.resetPasswordData ?: throw IllegalStateException("Developer error - Must call resetPassword first")
val param = ResetPasswordMailConfirmed.create(
pendingSessionData.clientSecret,
- safeResetPasswordData.addThreePidRegistrationResponse.sid,
- safeResetPasswordData.newPassword
+ resetPasswordData.addThreePidRegistrationResponse.sid,
+ newPassword
)
executeRequest(null) {
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/auth/login/DirectLoginTask.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/auth/login/DirectLoginTask.kt
index 28706c7e80..c9311867c8 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/auth/login/DirectLoginTask.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/auth/login/DirectLoginTask.kt
@@ -73,7 +73,7 @@ internal class DefaultDirectLoginTask @Inject constructor(
homeServerUrl,
throwable.fingerprint
)
- else -> throwable
+ else -> throwable
}
}
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/auth/login/ResetPasswordData.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/auth/login/ResetPasswordData.kt
index a65ec38d6d..87a7b346dc 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/auth/login/ResetPasswordData.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/auth/login/ResetPasswordData.kt
@@ -24,6 +24,5 @@ import org.matrix.android.sdk.internal.auth.registration.AddThreePidRegistration
*/
@JsonClass(generateAdapter = true)
internal data class ResetPasswordData(
- val newPassword: String,
val addThreePidRegistrationResponse: AddThreePidRegistrationResponse
)
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/auth/registration/AddThreePidRegistrationParams.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/auth/registration/AddThreePidRegistrationParams.kt
index 2f05864d3b..f0cb6ebd6d 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/auth/registration/AddThreePidRegistrationParams.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/auth/registration/AddThreePidRegistrationParams.kt
@@ -84,7 +84,7 @@ internal data class AddThreePidRegistrationParams(
companion object {
fun from(params: RegisterAddThreePidTask.Params): AddThreePidRegistrationParams {
return when (params.threePid) {
- is RegisterThreePid.Email -> AddThreePidRegistrationParams(
+ is RegisterThreePid.Email -> AddThreePidRegistrationParams(
email = params.threePid.email,
clientSecret = params.clientSecret,
sendAttempt = params.sendAttempt
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/auth/registration/DefaultRegistrationWizard.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/auth/registration/DefaultRegistrationWizard.kt
index 345f4097db..d6ec0297b4 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/auth/registration/DefaultRegistrationWizard.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/auth/registration/DefaultRegistrationWizard.kt
@@ -51,12 +51,12 @@ internal class DefaultRegistrationWizard(
override fun getCurrentThreePid(): String? {
return when (val threePid = pendingSessionData.currentThreePidData?.threePid) {
- is RegisterThreePid.Email -> threePid.email
+ is RegisterThreePid.Email -> threePid.email
is RegisterThreePid.Msisdn -> {
// Take formatted msisdn if provided by the server
pendingSessionData.currentThreePidData?.addThreePidRegistrationResponse?.formattedMsisdn?.takeIf { it.isNotBlank() } ?: threePid.msisdn
}
- null -> null
+ null -> null
}
}
@@ -67,9 +67,11 @@ internal class DefaultRegistrationWizard(
return performRegistrationRequest(params)
}
- override suspend fun createAccount(userName: String?,
- password: String?,
- initialDeviceDisplayName: String?): RegistrationResult {
+ override suspend fun createAccount(
+ userName: String?,
+ password: String?,
+ initialDeviceDisplayName: String?
+ ): RegistrationResult {
val params = RegistrationParams(
username = userName,
password = password,
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/auth/registration/RegisterAddThreePidTask.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/auth/registration/RegisterAddThreePidTask.kt
index 54a8ba0e6c..b84ed61361 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/auth/registration/RegisterAddThreePidTask.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/auth/registration/RegisterAddThreePidTask.kt
@@ -41,7 +41,7 @@ internal class DefaultRegisterAddThreePidTask(
private fun RegisterThreePid.toPath(): String {
return when (this) {
- is RegisterThreePid.Email -> "email"
+ is RegisterThreePid.Email -> "email"
is RegisterThreePid.Msisdn -> "msisdn"
}
}
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/auth/registration/ThreePidData.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/auth/registration/ThreePidData.kt
index c8f71af306..dde0a44ea0 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/auth/registration/ThreePidData.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/auth/registration/ThreePidData.kt
@@ -40,11 +40,13 @@ internal data class ThreePidData(
}
companion object {
- fun from(threePid: RegisterThreePid,
- addThreePidRegistrationResponse: AddThreePidRegistrationResponse,
- registrationParams: RegistrationParams): ThreePidData {
+ fun from(
+ threePid: RegisterThreePid,
+ addThreePidRegistrationResponse: AddThreePidRegistrationResponse,
+ registrationParams: RegistrationParams
+ ): ThreePidData {
return when (threePid) {
- is RegisterThreePid.Email ->
+ is RegisterThreePid.Email ->
ThreePidData(threePid.email, "", "", addThreePidRegistrationResponse, registrationParams)
is RegisterThreePid.Msisdn ->
ThreePidData("", threePid.msisdn, threePid.countryCode, addThreePidRegistrationResponse, registrationParams)
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/auth/registration/UIAExt.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/auth/registration/UIAExt.kt
index 9b135c347d..8118f9faff 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/auth/registration/UIAExt.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/auth/registration/UIAExt.kt
@@ -35,9 +35,11 @@ import kotlin.coroutines.suspendCoroutine
* @return UiaResult if UIA handled, failed or cancelled
*
*/
-internal suspend fun handleUIA(failure: Throwable,
- interceptor: UserInteractiveAuthInterceptor,
- retryBlock: suspend (UIABaseAuth) -> Unit): UiaResult {
+internal suspend fun handleUIA(
+ failure: Throwable,
+ interceptor: UserInteractiveAuthInterceptor,
+ retryBlock: suspend (UIABaseAuth) -> Unit
+): UiaResult {
Timber.d("## UIA: check error ${failure.message}")
val flowResponse = failure.toRegistrationFlowResponse()
?: return UiaResult.FAILURE.also {
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/auth/version/HomeServerVersion.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/auth/version/HomeServerVersion.kt
index 815f8de2de..cd38b68a85 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/auth/version/HomeServerVersion.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/auth/version/HomeServerVersion.kt
@@ -16,6 +16,8 @@
package org.matrix.android.sdk.internal.auth.version
+import org.matrix.android.sdk.api.extensions.ensureNotEmpty
+
/**
* Values will take the form "rX.Y.Z".
* Ref: https://matrix.org/docs/spec/client_server/latest#get-matrix-client-versions
@@ -33,19 +35,19 @@ internal data class HomeServerVersion(
minor < other.minor -> -1
patch > other.patch -> 1
patch < other.patch -> -1
- else -> 0
+ else -> 0
}
}
companion object {
- internal val pattern = Regex("""[r|v](\d+)\.(\d+)\.(\d+)""")
+ internal val pattern = Regex("""[r|v](\d+)\.(\d+)(?:\.(\d+))?""")
internal fun parse(value: String): HomeServerVersion? {
val result = pattern.matchEntire(value) ?: return null
return HomeServerVersion(
major = result.groupValues[1].toInt(),
minor = result.groupValues[2].toInt(),
- patch = result.groupValues[3].toInt()
+ patch = result.groupValues.getOrNull(index = 3)?.ensureNotEmpty()?.toInt() ?: 0
)
}
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/CryptoModule.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/CryptoModule.kt
index 2265526484..c69a859016 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/CryptoModule.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/CryptoModule.kt
@@ -110,10 +110,12 @@ internal abstract class CryptoModule {
@Provides
@CryptoDatabase
@SessionScope
- fun providesRealmConfiguration(@SessionFilesDirectory directory: File,
- @UserMd5 userMd5: String,
- realmKeysUtils: RealmKeysUtils,
- realmCryptoStoreMigration: RealmCryptoStoreMigration): RealmConfiguration {
+ fun providesRealmConfiguration(
+ @SessionFilesDirectory directory: File,
+ @UserMd5 userMd5: String,
+ realmKeysUtils: RealmKeysUtils,
+ realmCryptoStoreMigration: RealmCryptoStoreMigration
+ ): RealmConfiguration {
return RealmConfiguration.Builder()
.directory(directory)
.apply {
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/DefaultCryptoService.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/DefaultCryptoService.kt
index 824478f1d3..719f366518 100755
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/DefaultCryptoService.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/DefaultCryptoService.kt
@@ -188,8 +188,8 @@ internal class DefaultCryptoService @Inject constructor(
fun onStateEvent(roomId: String, event: Event) {
when (event.type) {
- EventType.STATE_ROOM_ENCRYPTION -> onRoomEncryptionEvent(roomId, event)
- EventType.STATE_ROOM_MEMBER -> onRoomMembershipEvent(roomId, event)
+ EventType.STATE_ROOM_ENCRYPTION -> onRoomEncryptionEvent(roomId, event)
+ EventType.STATE_ROOM_MEMBER -> onRoomMembershipEvent(roomId, event)
EventType.STATE_ROOM_HISTORY_VISIBILITY -> onRoomHistoryVisibilityEvent(roomId, event)
}
}
@@ -198,8 +198,8 @@ internal class DefaultCryptoService @Inject constructor(
// handle state events
if (event.isStateEvent()) {
when (event.type) {
- EventType.STATE_ROOM_ENCRYPTION -> onRoomEncryptionEvent(roomId, event)
- EventType.STATE_ROOM_MEMBER -> onRoomMembershipEvent(roomId, event)
+ EventType.STATE_ROOM_ENCRYPTION -> onRoomEncryptionEvent(roomId, event)
+ EventType.STATE_ROOM_MEMBER -> onRoomMembershipEvent(roomId, event)
EventType.STATE_ROOM_HISTORY_VISIBILITY -> onRoomHistoryVisibilityEvent(roomId, event)
}
}
@@ -592,10 +592,12 @@ internal class DefaultCryptoService @Inject constructor(
* @param membersId list of members to start tracking their devices
* @return true if the operation succeeds.
*/
- private suspend fun setEncryptionInRoom(roomId: String,
- algorithm: String?,
- inhibitDeviceQuery: Boolean,
- membersId: List): Boolean {
+ private suspend fun setEncryptionInRoom(
+ roomId: String,
+ algorithm: String?,
+ inhibitDeviceQuery: Boolean,
+ membersId: List
+ ): Boolean {
// If we already have encryption in this room, we should ignore this event
// (for now at least. Maybe we should alert the user somehow?)
val existingAlgorithm = cryptoStore.getRoomAlgorithm(roomId)
@@ -618,8 +620,8 @@ internal class DefaultCryptoService @Inject constructor(
val alg: IMXEncrypting? = when (algorithm) {
MXCRYPTO_ALGORITHM_MEGOLM -> megolmEncryptionFactory.create(roomId)
- MXCRYPTO_ALGORITHM_OLM -> olmEncryptionFactory.create(roomId)
- else -> null
+ MXCRYPTO_ALGORITHM_OLM -> olmEncryptionFactory.create(roomId)
+ else -> null
}
if (alg != null) {
@@ -691,10 +693,12 @@ internal class DefaultCryptoService @Inject constructor(
* @param roomId the room identifier the event will be sent.
* @param callback the asynchronous callback
*/
- override fun encryptEventContent(eventContent: Content,
- eventType: String,
- roomId: String,
- callback: MatrixCallback) {
+ override fun encryptEventContent(
+ eventContent: Content,
+ eventType: String,
+ roomId: String,
+ callback: MatrixCallback
+ ) {
// moved to crypto scope to have uptodate values
cryptoCoroutineScope.launch(coroutineDispatchers.crypto) {
val userIds = getRoomUserIds(roomId)
@@ -796,10 +800,10 @@ internal class DefaultCryptoService @Inject constructor(
// Keys are imported directly, not waiting for end of sync
onRoomKeyEvent(event)
}
- EventType.REQUEST_SECRET -> {
+ EventType.REQUEST_SECRET -> {
secretShareManager.handleSecretRequest(event)
}
- EventType.ROOM_KEY_REQUEST -> {
+ EventType.ROOM_KEY_REQUEST -> {
event.getClearContent().toModel()?.let { req ->
// We'll always get these because we send room key requests to
// '*' (ie. 'all devices') which includes the sending device,
@@ -811,13 +815,13 @@ internal class DefaultCryptoService @Inject constructor(
}
}
}
- EventType.SEND_SECRET -> {
+ EventType.SEND_SECRET -> {
onSecretSendReceived(event)
}
- EventType.ROOM_KEY_WITHHELD -> {
+ EventType.ROOM_KEY_WITHHELD -> {
onKeyWithHeldReceived(event)
}
- else -> {
+ else -> {
// ignore
}
}
@@ -879,10 +883,12 @@ internal class DefaultCryptoService @Inject constructor(
/**
* Returns true if handled by SDK, otherwise should be sent to application layer.
*/
- private fun handleSDKLevelGossip(secretName: String?,
- secretValue: String): Boolean {
+ private fun handleSDKLevelGossip(
+ secretName: String?,
+ secretValue: String
+ ): Boolean {
return when (secretName) {
- MASTER_KEY_SSSS_NAME -> {
+ MASTER_KEY_SSSS_NAME -> {
crossSigningService.onSecretMSKGossip(secretValue)
true
}
@@ -898,7 +904,7 @@ internal class DefaultCryptoService @Inject constructor(
keysBackupService.onSecretKeyGossip(secretValue)
true
}
- else -> false
+ else -> false
}
}
@@ -1022,9 +1028,11 @@ internal class DefaultCryptoService @Inject constructor(
* @param progressListener the progress listener
* @return the result ImportRoomKeysResult
*/
- override suspend fun importRoomKeys(roomKeysAsArray: ByteArray,
- password: String,
- progressListener: ProgressListener?): ImportRoomKeysResult {
+ override suspend fun importRoomKeys(
+ roomKeysAsArray: ByteArray,
+ password: String,
+ progressListener: ProgressListener?
+ ): ImportRoomKeysResult {
return withContext(coroutineDispatchers.crypto) {
Timber.tag(loggerTag.value).v("importRoomKeys starts")
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/DeviceListManager.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/DeviceListManager.kt
index 18b815b3d8..4f3900adb9 100755
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/DeviceListManager.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/DeviceListManager.kt
@@ -231,8 +231,8 @@ internal class DeviceListManager @Inject constructor(
for ((k, value) in failures) {
val statusCode = when (val status = value["status"]) {
is Double -> status.toInt()
- is Int -> status.toInt()
- else -> 0
+ is Int -> status.toInt()
+ else -> 0
}
if (statusCode == 503) {
synchronized(notReadyToRetryHS) {
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/InboundGroupSessionStore.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/InboundGroupSessionStore.kt
index 28ddf291b2..e4d322cadd 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/InboundGroupSessionStore.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/InboundGroupSessionStore.kt
@@ -44,7 +44,8 @@ private val loggerTag = LoggerTag("InboundGroupSessionStore", LoggerTag.CRYPTO)
internal class InboundGroupSessionStore @Inject constructor(
private val store: IMXCryptoStore,
private val cryptoCoroutineScope: CoroutineScope,
- private val coroutineDispatchers: MatrixCoroutineDispatchers) {
+ private val coroutineDispatchers: MatrixCoroutineDispatchers
+) {
private data class CacheKey(
val sessionId: String,
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/IncomingKeyRequestManager.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/IncomingKeyRequestManager.kt
index 13f2fb861a..7f36224dae 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/IncomingKeyRequestManager.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/IncomingKeyRequestManager.kt
@@ -135,7 +135,7 @@ internal class IncomingKeyRequestManager @Inject constructor(
// just add to the buffer
incomingRequestBuffer.add(validMegolmRequest)
}
- MegolmRequestAction.Cancel -> {
+ MegolmRequestAction.Cancel -> {
// ignore, we can't cancel as it's not known (probably already processed)
// still notify app layer if it was passed up previously
IncomingRoomKeyRequest.fromRestRequest(senderId, request, clock)?.let { iReq ->
@@ -159,7 +159,7 @@ internal class IncomingKeyRequestManager @Inject constructor(
MegolmRequestAction.Request -> {
// it's already in buffer, nop keep existing
}
- MegolmRequestAction.Cancel -> {
+ MegolmRequestAction.Cancel -> {
// discard the request in buffer
incomingRequestBuffer.remove(existing)
outgoingRequestScope.launch(coroutineDispatchers.computation) {
@@ -369,9 +369,11 @@ internal class IncomingKeyRequestManager @Inject constructor(
shareMegolmKey(validReq, requestingDevice, null)
}
- private suspend fun shareMegolmKey(validRequest: ValidMegolmRequestBody,
- requestingDevice: CryptoDeviceInfo,
- chainIndex: Long?): Boolean {
+ private suspend fun shareMegolmKey(
+ validRequest: ValidMegolmRequestBody,
+ requestingDevice: CryptoDeviceInfo,
+ chainIndex: Long?
+ ): Boolean {
Timber.tag(loggerTag.value)
.d("try to re-share Megolm Key at index $chainIndex for ${validRequest.shortDbgString()}")
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/MXCryptoAlgorithms.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/MXCryptoAlgorithms.kt
index 5a5ee9e696..14b0e8e125 100755
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/MXCryptoAlgorithms.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/MXCryptoAlgorithms.kt
@@ -32,7 +32,7 @@ internal object MXCryptoAlgorithms {
return when (algorithm) {
MXCRYPTO_ALGORITHM_MEGOLM,
MXCRYPTO_ALGORITHM_OLM -> true
- else -> false
+ else -> false
}
}
@@ -47,7 +47,7 @@ internal object MXCryptoAlgorithms {
return when (algorithm) {
MXCRYPTO_ALGORITHM_MEGOLM,
MXCRYPTO_ALGORITHM_OLM -> true
- else -> false
+ else -> false
}
}
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/MXOlmDevice.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/MXOlmDevice.kt
index 1d25d82549..24b6fd166f 100755
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/MXOlmDevice.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/MXOlmDevice.kt
@@ -600,13 +600,15 @@ internal class MXOlmDevice @Inject constructor(
* @param exportFormat true if the megolm keys are in export format
* @return true if the operation succeeds.
*/
- fun addInboundGroupSession(sessionId: String,
- sessionKey: String,
- roomId: String,
- senderKey: String,
- forwardingCurve25519KeyChain: List,
- keysClaimed: Map,
- exportFormat: Boolean): AddSessionResult {
+ fun addInboundGroupSession(
+ sessionId: String,
+ sessionKey: String,
+ roomId: String,
+ senderKey: String,
+ forwardingCurve25519KeyChain: List,
+ keysClaimed: Map,
+ exportFormat: Boolean
+ ): AddSessionResult {
val candidateSession = OlmInboundGroupSessionWrapper2(sessionKey, exportFormat)
val existingSessionHolder = tryOrNull { getInboundGroupSession(sessionId, senderKey, roomId) }
val existingSession = existingSessionHolder?.wrapper
@@ -762,12 +764,14 @@ internal class MXOlmDevice @Inject constructor(
* @return the decrypting result. Null if the sessionId is unknown.
*/
@Throws(MXCryptoError::class)
- suspend fun decryptGroupMessage(body: String,
- roomId: String,
- timeline: String?,
- eventId: String,
- sessionId: String,
- senderKey: String): OlmDecryptionResult {
+ suspend fun decryptGroupMessage(
+ body: String,
+ roomId: String,
+ timeline: String?,
+ eventId: String,
+ sessionId: String,
+ senderKey: String
+ ): OlmDecryptionResult {
val sessionHolder = getInboundGroupSession(sessionId, senderKey, roomId)
val wrapper = sessionHolder.wrapper
val inboundGroupSession = wrapper.olmInboundGroupSession
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/ObjectSigner.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/ObjectSigner.kt
index ab562d954a..3f4b633ea0 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/ObjectSigner.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/ObjectSigner.kt
@@ -19,8 +19,10 @@ package org.matrix.android.sdk.internal.crypto
import org.matrix.android.sdk.api.auth.data.Credentials
import javax.inject.Inject
-internal class ObjectSigner @Inject constructor(private val credentials: Credentials,
- private val olmDevice: MXOlmDevice) {
+internal class ObjectSigner @Inject constructor(
+ private val credentials: Credentials,
+ private val olmDevice: MXOlmDevice
+) {
/**
* Sign Object.
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/OutgoingKeyRequestManager.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/OutgoingKeyRequestManager.kt
index d7652d0771..6b22cc09d6 100755
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/OutgoingKeyRequestManager.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/OutgoingKeyRequestManager.kt
@@ -71,7 +71,8 @@ internal class OutgoingKeyRequestManager @Inject constructor(
private val inboundGroupSessionStore: InboundGroupSessionStore,
private val sendToDeviceTask: SendToDeviceTask,
private val deviceListManager: DeviceListManager,
- private val perSessionBackupQueryRateLimiter: PerSessionBackupQueryRateLimiter) {
+ private val perSessionBackupQueryRateLimiter: PerSessionBackupQueryRateLimiter
+) {
private val dispatcher = Executors.newSingleThreadExecutor().asCoroutineDispatcher()
private val outgoingRequestScope = CoroutineScope(SupervisorJob() + dispatcher)
@@ -180,13 +181,15 @@ internal class OutgoingKeyRequestManager @Inject constructor(
}
}
- fun onRoomKeyForwarded(sessionId: String,
- algorithm: String,
- roomId: String,
- senderKey: String,
- fromDevice: String?,
- fromIndex: Int,
- event: Event) {
+ fun onRoomKeyForwarded(
+ sessionId: String,
+ algorithm: String,
+ roomId: String,
+ senderKey: String,
+ fromDevice: String?,
+ fromIndex: Int,
+ event: Event
+ ) {
Timber.tag(loggerTag.value).d("Key forwarded for $sessionId from ${event.senderId}|$fromDevice at index $fromIndex")
outgoingRequestScope.launch {
sequencer.post {
@@ -208,12 +211,14 @@ internal class OutgoingKeyRequestManager @Inject constructor(
}
}
- fun onRoomKeyWithHeld(sessionId: String,
- algorithm: String,
- roomId: String,
- senderKey: String,
- fromDevice: String?,
- event: Event) {
+ fun onRoomKeyWithHeld(
+ sessionId: String,
+ algorithm: String,
+ roomId: String,
+ senderKey: String,
+ fromDevice: String?,
+ event: Event
+ ) {
outgoingRequestScope.launch {
sequencer.post {
Timber.tag(loggerTag.value).d("Withheld received for $sessionId from ${event.senderId}|$fromDevice")
@@ -294,19 +299,19 @@ internal class OutgoingKeyRequestManager @Inject constructor(
}
knownRequest.forEach { request ->
when (request.state) {
- OutgoingRoomKeyRequestState.UNSENT -> {
+ OutgoingRoomKeyRequestState.UNSENT -> {
if (request.fromIndex >= localKnownChainIndex) {
// we have a good index we can cancel
cryptoStore.deleteOutgoingRoomKeyRequest(request.requestId)
}
}
- OutgoingRoomKeyRequestState.SENT -> {
+ OutgoingRoomKeyRequestState.SENT -> {
// It was already sent, and index satisfied we can cancel
if (request.fromIndex >= localKnownChainIndex) {
cryptoStore.updateOutgoingRoomKeyRequestState(request.requestId, OutgoingRoomKeyRequestState.CANCELLATION_PENDING)
}
}
- OutgoingRoomKeyRequestState.CANCELLATION_PENDING -> {
+ OutgoingRoomKeyRequestState.CANCELLATION_PENDING -> {
// It is already marked to be cancelled
}
OutgoingRoomKeyRequestState.CANCELLATION_PENDING_AND_WILL_RESEND -> {
@@ -315,7 +320,7 @@ internal class OutgoingKeyRequestManager @Inject constructor(
cryptoStore.updateOutgoingRoomKeyRequestState(request.requestId, OutgoingRoomKeyRequestState.CANCELLATION_PENDING)
}
}
- OutgoingRoomKeyRequestState.SENT_THEN_CANCELED -> {
+ OutgoingRoomKeyRequestState.SENT_THEN_CANCELED -> {
// was already canceled
// if we need a better index, should we resend?
}
@@ -346,14 +351,14 @@ internal class OutgoingKeyRequestManager @Inject constructor(
val existing = cryptoStore.getOutgoingRoomKeyRequest(requestBody)
Timber.tag(loggerTag.value).v("Queueing key request exiting is ${existing?.state}")
when (existing?.state) {
- null -> {
+ null -> {
// create a new one
cryptoStore.getOrAddOutgoingRoomKeyRequest(requestBody, recipients, fromIndex)
}
- OutgoingRoomKeyRequestState.UNSENT -> {
+ OutgoingRoomKeyRequestState.UNSENT -> {
// nothing it's new or not yet handled
}
- OutgoingRoomKeyRequestState.SENT -> {
+ OutgoingRoomKeyRequestState.SENT -> {
// it was already requested
Timber.tag(loggerTag.value).d("The session ${requestBody.sessionId} is already requested")
if (force) {
@@ -366,7 +371,7 @@ internal class OutgoingKeyRequestManager @Inject constructor(
}
}
}
- OutgoingRoomKeyRequestState.CANCELLATION_PENDING -> {
+ OutgoingRoomKeyRequestState.CANCELLATION_PENDING -> {
// request is canceled only if I got the keys so what to do here...
if (force) {
cryptoStore.updateOutgoingRoomKeyRequestState(existing.requestId, OutgoingRoomKeyRequestState.CANCELLATION_PENDING_AND_WILL_RESEND)
@@ -375,7 +380,7 @@ internal class OutgoingKeyRequestManager @Inject constructor(
OutgoingRoomKeyRequestState.CANCELLATION_PENDING_AND_WILL_RESEND -> {
// It's already going to resend
}
- OutgoingRoomKeyRequestState.SENT_THEN_CANCELED -> {
+ OutgoingRoomKeyRequestState.SENT_THEN_CANCELED -> {
if (force) {
cryptoStore.deleteOutgoingRoomKeyRequest(existing.requestId)
cryptoStore.getOrAddOutgoingRoomKeyRequest(requestBody, recipients, fromIndex)
@@ -396,11 +401,11 @@ internal class OutgoingKeyRequestManager @Inject constructor(
measureTimeMillis {
toProcess.forEach {
when (it.state) {
- OutgoingRoomKeyRequestState.UNSENT -> handleUnsentRequest(it)
- OutgoingRoomKeyRequestState.CANCELLATION_PENDING -> handleRequestToCancel(it)
+ OutgoingRoomKeyRequestState.UNSENT -> handleUnsentRequest(it)
+ OutgoingRoomKeyRequestState.CANCELLATION_PENDING -> handleRequestToCancel(it)
OutgoingRoomKeyRequestState.CANCELLATION_PENDING_AND_WILL_RESEND -> handleRequestToCancelWillResend(it)
OutgoingRoomKeyRequestState.SENT_THEN_CANCELED,
- OutgoingRoomKeyRequestState.SENT -> {
+ OutgoingRoomKeyRequestState.SENT -> {
// these are filtered out
}
}
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/RoomDecryptorProvider.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/RoomDecryptorProvider.kt
index a80bafbe79..d37e60d289 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/RoomDecryptorProvider.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/RoomDecryptorProvider.kt
@@ -85,7 +85,7 @@ internal class RoomDecryptorProvider @Inject constructor(
}
}
}
- else -> olmDecryptionFactory.create()
+ else -> olmDecryptionFactory.create()
}
if (!roomId.isNullOrEmpty()) {
synchronized(roomDecryptors) {
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/RoomEncryptorsStore.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/RoomEncryptorsStore.kt
index 1a8c160d9c..9f6714cc45 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/RoomEncryptorsStore.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/RoomEncryptorsStore.kt
@@ -49,8 +49,8 @@ internal class RoomEncryptorsStore @Inject constructor(
} else {
val alg: IMXEncrypting? = when (cryptoStore.getRoomAlgorithm(roomId)) {
MXCRYPTO_ALGORITHM_MEGOLM -> megolmEncryptionFactory.create(roomId)
- MXCRYPTO_ALGORITHM_OLM -> olmEncryptionFactory.create(roomId)
- else -> null
+ MXCRYPTO_ALGORITHM_OLM -> olmEncryptionFactory.create(roomId)
+ else -> null
}
alg?.let { roomEncryptors.put(roomId, it) }
return@synchronized alg
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/SecretShareManager.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/SecretShareManager.kt
index 6fb6914206..a79e1a8901 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/SecretShareManager.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/SecretShareManager.kt
@@ -150,14 +150,14 @@ internal class SecretShareManager @Inject constructor(
// we can share the secret
val secretValue = when (secretName) {
- MASTER_KEY_SSSS_NAME -> cryptoStore.getCrossSigningPrivateKeys()?.master
+ MASTER_KEY_SSSS_NAME -> cryptoStore.getCrossSigningPrivateKeys()?.master
SELF_SIGNING_KEY_SSSS_NAME -> cryptoStore.getCrossSigningPrivateKeys()?.selfSigned
USER_SIGNING_KEY_SSSS_NAME -> cryptoStore.getCrossSigningPrivateKeys()?.user
KEYBACKUP_SECRET_SSSS_NAME -> cryptoStore.getKeyBackupRecoveryKeyInfo()?.recoveryKey
?.let {
extractCurveKeyFromRecoveryKey(it)?.toBase64NoPadding()
}
- else -> null
+ else -> null
}
if (secretValue == null) {
Timber.tag(loggerTag.value)
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/actions/EnsureOlmSessionsForDevicesAction.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/actions/EnsureOlmSessionsForDevicesAction.kt
index c728f1b682..c263192fee 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/actions/EnsureOlmSessionsForDevicesAction.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/actions/EnsureOlmSessionsForDevicesAction.kt
@@ -39,7 +39,8 @@ private val loggerTag = LoggerTag("EnsureOlmSessionsForDevicesAction", LoggerTag
internal class EnsureOlmSessionsForDevicesAction @Inject constructor(
private val olmDevice: MXOlmDevice,
private val coroutineDispatchers: MatrixCoroutineDispatchers,
- private val oneTimeKeysForUsersDeviceTask: ClaimOneTimeKeysForUsersDeviceTask) {
+ private val oneTimeKeysForUsersDeviceTask: ClaimOneTimeKeysForUsersDeviceTask
+) {
private val ensureMutex = Mutex()
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/actions/EnsureOlmSessionsForUsersAction.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/actions/EnsureOlmSessionsForUsersAction.kt
index 4c5720daf2..da09524668 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/actions/EnsureOlmSessionsForUsersAction.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/actions/EnsureOlmSessionsForUsersAction.kt
@@ -23,9 +23,11 @@ import org.matrix.android.sdk.internal.crypto.store.IMXCryptoStore
import timber.log.Timber
import javax.inject.Inject
-internal class EnsureOlmSessionsForUsersAction @Inject constructor(private val olmDevice: MXOlmDevice,
- private val cryptoStore: IMXCryptoStore,
- private val ensureOlmSessionsForDevicesAction: EnsureOlmSessionsForDevicesAction) {
+internal class EnsureOlmSessionsForUsersAction @Inject constructor(
+ private val olmDevice: MXOlmDevice,
+ private val cryptoStore: IMXCryptoStore,
+ private val ensureOlmSessionsForDevicesAction: EnsureOlmSessionsForDevicesAction
+) {
/**
* Try to make sure we have established olm sessions for the given users.
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/actions/MegolmSessionDataImporter.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/actions/MegolmSessionDataImporter.kt
index 67d73c21ed..f6ab96aee6 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/actions/MegolmSessionDataImporter.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/actions/MegolmSessionDataImporter.kt
@@ -33,11 +33,12 @@ import javax.inject.Inject
private val loggerTag = LoggerTag("MegolmSessionDataImporter", LoggerTag.CRYPTO)
-internal class MegolmSessionDataImporter @Inject constructor(private val olmDevice: MXOlmDevice,
- private val roomDecryptorProvider: RoomDecryptorProvider,
- private val outgoingKeyRequestManager: OutgoingKeyRequestManager,
- private val cryptoStore: IMXCryptoStore,
- private val clock: Clock,
+internal class MegolmSessionDataImporter @Inject constructor(
+ private val olmDevice: MXOlmDevice,
+ private val roomDecryptorProvider: RoomDecryptorProvider,
+ private val outgoingKeyRequestManager: OutgoingKeyRequestManager,
+ private val cryptoStore: IMXCryptoStore,
+ private val clock: Clock,
) {
/**
@@ -50,9 +51,11 @@ internal class MegolmSessionDataImporter @Inject constructor(private val olmDevi
* @return import room keys result
*/
@WorkerThread
- fun handle(megolmSessionsData: List,
- fromBackup: Boolean,
- progressListener: ProgressListener?): ImportRoomKeysResult {
+ fun handle(
+ megolmSessionsData: List,
+ fromBackup: Boolean,
+ progressListener: ProgressListener?
+ ): ImportRoomKeysResult {
val t0 = clock.epochMillis()
val totalNumbersOfKeys = megolmSessionsData.size
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/actions/MessageEncrypter.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/actions/MessageEncrypter.kt
index 919e38c391..eff2132820 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/actions/MessageEncrypter.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/actions/MessageEncrypter.kt
@@ -36,7 +36,8 @@ internal class MessageEncrypter @Inject constructor(
private val userId: String,
@DeviceId
private val deviceId: String?,
- private val olmDevice: MXOlmDevice) {
+ private val olmDevice: MXOlmDevice
+) {
/**
* Encrypt an event payload for a list of devices.
* This method must be called from the getCryptoHandler() thread.
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/actions/SetDeviceVerificationAction.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/actions/SetDeviceVerificationAction.kt
index 60181138fb..6028b1a5a2 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/actions/SetDeviceVerificationAction.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/actions/SetDeviceVerificationAction.kt
@@ -26,7 +26,8 @@ import javax.inject.Inject
internal class SetDeviceVerificationAction @Inject constructor(
private val cryptoStore: IMXCryptoStore,
@UserId private val userId: String,
- private val defaultKeysBackupService: DefaultKeysBackupService) {
+ private val defaultKeysBackupService: DefaultKeysBackupService
+) {
fun handle(trustLevel: DeviceTrustLevel, userId: String, deviceId: String) {
val device = cryptoStore.getUserDevice(userId, deviceId)
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/algorithms/IMXGroupEncryption.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/algorithms/IMXGroupEncryption.kt
index 8cf01f1972..9ec78f37cf 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/algorithms/IMXGroupEncryption.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/algorithms/IMXGroupEncryption.kt
@@ -45,8 +45,10 @@ internal interface IMXGroupEncryption {
*
* @return true in case of success
*/
- suspend fun reshareKey(groupSessionId: String,
- userId: String,
- deviceId: String,
- senderKey: String): Boolean
+ suspend fun reshareKey(
+ groupSessionId: String,
+ userId: String,
+ deviceId: String,
+ senderKey: String
+ ): Boolean
}
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/algorithms/megolm/MXMegolmDecryption.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/algorithms/megolm/MXMegolmDecryption.kt
index 722462bf0e..141d6f74cd 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/algorithms/megolm/MXMegolmDecryption.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/algorithms/megolm/MXMegolmDecryption.kt
@@ -149,7 +149,8 @@ internal class MXMegolmDecryption(
throw MXCryptoError.Base(
MXCryptoError.ErrorType.KEYS_WITHHELD,
withHeldInfo.code?.value ?: "",
- withHeldInfo.reason)
+ withHeldInfo.reason
+ )
}
if (requestKeysOnFail) {
@@ -249,9 +250,9 @@ internal class MXMegolmDecryption(
)
when (addSessionResult) {
- is MXOlmDevice.AddSessionResult.Imported -> addSessionResult.ratchetIndex
+ is MXOlmDevice.AddSessionResult.Imported -> addSessionResult.ratchetIndex
is MXOlmDevice.AddSessionResult.NotImportedHigherIndex -> addSessionResult.newIndex
- else -> null
+ else -> null
}?.let { index ->
if (event.getClearType() == EventType.FORWARDED_ROOM_KEY) {
val fromDevice = (event.content?.get("sender_key") as? String)?.let { senderDeviceIdentityKey ->
@@ -268,7 +269,8 @@ internal class MXMegolmDecryption(
senderKey = senderKey,
fromIndex = index,
fromDevice = fromDevice,
- event = event)
+ event = event
+ )
cryptoStore.saveIncomingForwardKeyAuditTrail(
roomId = roomKeyContent.roomId,
@@ -277,7 +279,8 @@ internal class MXMegolmDecryption(
algorithm = roomKeyContent.algorithm ?: "",
userId = event.senderId ?: "",
deviceId = fromDevice ?: "",
- chainIndex = index.toLong())
+ chainIndex = index.toLong()
+ )
// The index is used to decide if we cancel sent request or if we wait for a better key
outgoingKeyRequestManager.postCancelRequestForSessionIfNeeded(roomKeyContent.sessionId, roomKeyContent.roomId, senderKey, index)
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/algorithms/megolm/MXMegolmDecryptionFactory.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/algorithms/megolm/MXMegolmDecryptionFactory.kt
index 096773a959..81a6fb28c0 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/algorithms/megolm/MXMegolmDecryptionFactory.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/algorithms/megolm/MXMegolmDecryptionFactory.kt
@@ -35,6 +35,7 @@ internal class MXMegolmDecryptionFactory @Inject constructor(
olmDevice,
outgoingKeyRequestManager,
cryptoStore,
- eventsManager)
+ eventsManager
+ )
}
}
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/algorithms/megolm/MXMegolmEncryption.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/algorithms/megolm/MXMegolmEncryption.kt
index 8b4e9df607..7bfbae6edf 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/algorithms/megolm/MXMegolmEncryption.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/algorithms/megolm/MXMegolmEncryption.kt
@@ -84,9 +84,11 @@ internal class MXMegolmEncryption(
private var sessionRotationPeriodMsgs: Int = 100
private var sessionRotationPeriodMs: Int = 7 * 24 * 3600 * 1000
- override suspend fun encryptEventContent(eventContent: Content,
- eventType: String,
- userIds: List): Content {
+ override suspend fun encryptEventContent(
+ eventContent: Content,
+ eventType: String,
+ userIds: List
+ ): Content {
val ts = clock.epochMillis()
Timber.tag(loggerTag.value).v("encryptEventContent : getDevicesInRoom")
val devices = getDevicesInRoom(userIds)
@@ -201,8 +203,10 @@ internal class MXMegolmEncryption(
* @param session the session info
* @param devicesByUsers the devices map
*/
- private suspend fun shareKey(session: MXOutboundSessionInfo,
- devicesByUsers: Map>) {
+ private suspend fun shareKey(
+ session: MXOutboundSessionInfo,
+ devicesByUsers: Map>
+ ) {
// nothing to send, the task is done
if (devicesByUsers.isEmpty()) {
Timber.tag(loggerTag.value).v("shareKey() : nothing more to do")
@@ -230,8 +234,10 @@ internal class MXMegolmEncryption(
* @param session the session info
* @param devicesByUser the devices map
*/
- private suspend fun shareUserDevicesKey(session: MXOutboundSessionInfo,
- devicesByUser: Map>) {
+ private suspend fun shareUserDevicesKey(
+ session: MXOutboundSessionInfo,
+ devicesByUser: Map>
+ ) {
val sessionKey = olmDevice.getSessionKey(session.sessionId)
val chainIndex = olmDevice.getMessageIndex(session.sessionId)
@@ -321,10 +327,12 @@ internal class MXMegolmEncryption(
}
}
- private suspend fun notifyKeyWithHeld(targets: List,
- sessionId: String,
- senderKey: String?,
- code: WithHeldCode) {
+ private suspend fun notifyKeyWithHeld(
+ targets: List,
+ sessionId: String,
+ senderKey: String?,
+ code: WithHeldCode
+ ) {
Timber.tag(loggerTag.value).d(
"notifyKeyWithHeld() :sending withheld for session:$sessionId and code $code to" +
" ${targets.joinToString { "${it.userId}|${it.deviceId}" }}"
@@ -435,10 +443,12 @@ internal class MXMegolmEncryption(
}
}
- override suspend fun reshareKey(groupSessionId: String,
- userId: String,
- deviceId: String,
- senderKey: String): Boolean {
+ override suspend fun reshareKey(
+ groupSessionId: String,
+ userId: String,
+ deviceId: String,
+ senderKey: String
+ ): Boolean {
Timber.tag(loggerTag.value).i("process reshareKey for $groupSessionId to $userId:$deviceId")
val deviceInfo = cryptoStore.getUserDevice(userId, deviceId) ?: return false
.also { Timber.tag(loggerTag.value).w("reshareKey: Device not found") }
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/algorithms/megolm/SharedWithHelper.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/algorithms/megolm/SharedWithHelper.kt
index 61ad345c62..30fd403ce8 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/algorithms/megolm/SharedWithHelper.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/algorithms/megolm/SharedWithHelper.kt
@@ -23,7 +23,8 @@ import org.matrix.android.sdk.internal.crypto.store.IMXCryptoStore
internal class SharedWithHelper(
private val roomId: String,
private val sessionId: String,
- private val cryptoStore: IMXCryptoStore) {
+ private val cryptoStore: IMXCryptoStore
+) {
fun sharedWithDevices(): MXUsersDevicesMap {
return cryptoStore.getSharedWithInfo(roomId, sessionId)
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/algorithms/olm/MXOlmDecryption.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/algorithms/olm/MXOlmDecryption.kt
index 23c8f0e905..219cadac46 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/algorithms/olm/MXOlmDecryption.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/algorithms/olm/MXOlmDecryption.kt
@@ -38,7 +38,8 @@ internal class MXOlmDecryption(
// The olm device interface
private val olmDevice: MXOlmDevice,
// the matrix userId
- private val userId: String) :
+ private val userId: String
+) :
IMXDecrypting {
@Throws(MXCryptoError::class)
@@ -190,9 +191,9 @@ internal class MXOlmDecryption(
val messageBody = message["body"] as? String ?: return null
val messageType = when (val typeAsVoid = message["type"]) {
is Double -> typeAsVoid.toInt()
- is Int -> typeAsVoid
- is Long -> typeAsVoid.toInt()
- else -> return null
+ is Int -> typeAsVoid
+ is Long -> typeAsVoid.toInt()
+ else -> return null
}
// Try each session in turn
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/algorithms/olm/MXOlmDecryptionFactory.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/algorithms/olm/MXOlmDecryptionFactory.kt
index d5c5e85e41..a50ac8ca8a 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/algorithms/olm/MXOlmDecryptionFactory.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/algorithms/olm/MXOlmDecryptionFactory.kt
@@ -20,8 +20,10 @@ import org.matrix.android.sdk.internal.crypto.MXOlmDevice
import org.matrix.android.sdk.internal.di.UserId
import javax.inject.Inject
-internal class MXOlmDecryptionFactory @Inject constructor(private val olmDevice: MXOlmDevice,
- @UserId private val userId: String) {
+internal class MXOlmDecryptionFactory @Inject constructor(
+ private val olmDevice: MXOlmDevice,
+ @UserId private val userId: String
+) {
fun create(): MXOlmDecryption {
return MXOlmDecryption(
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/algorithms/olm/MXOlmEncryption.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/algorithms/olm/MXOlmEncryption.kt
index bde1d65093..fb70e23b03 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/algorithms/olm/MXOlmEncryption.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/algorithms/olm/MXOlmEncryption.kt
@@ -32,7 +32,8 @@ internal class MXOlmEncryption(
private val cryptoStore: IMXCryptoStore,
private val messageEncrypter: MessageEncrypter,
private val deviceListManager: DeviceListManager,
- private val ensureOlmSessionsForUsersAction: EnsureOlmSessionsForUsersAction) :
+ private val ensureOlmSessionsForUsersAction: EnsureOlmSessionsForUsersAction
+) :
IMXEncrypting {
override suspend fun encryptEventContent(eventContent: Content, eventType: String, userIds: List): Content {
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/algorithms/olm/MXOlmEncryptionFactory.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/algorithms/olm/MXOlmEncryptionFactory.kt
index 44e55900e4..012886203e 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/algorithms/olm/MXOlmEncryptionFactory.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/algorithms/olm/MXOlmEncryptionFactory.kt
@@ -24,12 +24,14 @@ import org.matrix.android.sdk.internal.crypto.actions.MessageEncrypter
import org.matrix.android.sdk.internal.crypto.store.IMXCryptoStore
import javax.inject.Inject
-internal class MXOlmEncryptionFactory @Inject constructor(private val olmDevice: MXOlmDevice,
- private val cryptoStore: IMXCryptoStore,
- private val messageEncrypter: MessageEncrypter,
- private val deviceListManager: DeviceListManager,
- private val coroutineDispatchers: MatrixCoroutineDispatchers,
- private val ensureOlmSessionsForUsersAction: EnsureOlmSessionsForUsersAction) {
+internal class MXOlmEncryptionFactory @Inject constructor(
+ private val olmDevice: MXOlmDevice,
+ private val cryptoStore: IMXCryptoStore,
+ private val messageEncrypter: MessageEncrypter,
+ private val deviceListManager: DeviceListManager,
+ private val coroutineDispatchers: MatrixCoroutineDispatchers,
+ private val ensureOlmSessionsForUsersAction: EnsureOlmSessionsForUsersAction
+) {
fun create(roomId: String): MXOlmEncryption {
return MXOlmEncryption(
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/api/CryptoApi.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/api/CryptoApi.kt
index f5ead35933..d5a8bdfd7c 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/api/CryptoApi.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/api/CryptoApi.kt
@@ -117,9 +117,11 @@ internal interface CryptoApi {
* @param body the body
*/
@PUT(NetworkConstants.URI_API_PREFIX_PATH_R0 + "sendToDevice/{eventType}/{txnId}")
- suspend fun sendToDevice(@Path("eventType") eventType: String,
- @Path("txnId") transactionId: String,
- @Body body: SendToDeviceBody)
+ suspend fun sendToDevice(
+ @Path("eventType") eventType: String,
+ @Path("txnId") transactionId: String,
+ @Body body: SendToDeviceBody
+ )
/**
* Delete a device.
@@ -129,8 +131,10 @@ internal interface CryptoApi {
* @param params the deletion parameters
*/
@HTTP(path = NetworkConstants.URI_API_PREFIX_PATH_R0 + "devices/{device_id}", method = "DELETE", hasBody = true)
- suspend fun deleteDevice(@Path("device_id") deviceId: String,
- @Body params: DeleteDeviceParams)
+ suspend fun deleteDevice(
+ @Path("device_id") deviceId: String,
+ @Body params: DeleteDeviceParams
+ )
/**
* Update the device information.
@@ -140,8 +144,10 @@ internal interface CryptoApi {
* @param params the params
*/
@PUT(NetworkConstants.URI_API_PREFIX_PATH_R0 + "devices/{device_id}")
- suspend fun updateDeviceInfo(@Path("device_id") deviceId: String,
- @Body params: UpdateDeviceInfoBody)
+ suspend fun updateDeviceInfo(
+ @Path("device_id") deviceId: String,
+ @Body params: UpdateDeviceInfoBody
+ )
/**
* Get the update devices list from two sync token.
@@ -151,6 +157,8 @@ internal interface CryptoApi {
* @param newToken the up-to token.
*/
@GET(NetworkConstants.URI_API_PREFIX_PATH_R0 + "keys/changes")
- suspend fun getKeyChanges(@Query("from") oldToken: String,
- @Query("to") newToken: String): KeyChangesResponse
+ suspend fun getKeyChanges(
+ @Query("from") oldToken: String,
+ @Query("to") newToken: String
+ ): KeyChangesResponse
}
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/attachments/MXEncryptedAttachments.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/attachments/MXEncryptedAttachments.kt
index 7ff08cd127..37c8e755ff 100755
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/attachments/MXEncryptedAttachments.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/attachments/MXEncryptedAttachments.kt
@@ -41,10 +41,12 @@ internal object MXEncryptedAttachments {
private const val SECRET_KEY_SPEC_ALGORITHM = "AES"
private const val MESSAGE_DIGEST_ALGORITHM = "SHA-256"
- fun encrypt(clearStream: InputStream,
- outputFile: File,
- clock: Clock,
- progress: ((current: Int, total: Int) -> Unit)): EncryptedFileInfo {
+ fun encrypt(
+ clearStream: InputStream,
+ outputFile: File,
+ clock: Clock,
+ progress: ((current: Int, total: Int) -> Unit)
+ ): EncryptedFileInfo {
val t0 = clock.epochMillis()
val secureRandom = SecureRandom()
val initVectorBytes = ByteArray(16) { 0.toByte() }
@@ -236,10 +238,11 @@ internal object MXEncryptedAttachments {
* @param clock a clock to retrieve current time
* @return true in case of success, false in case of error
*/
- fun decryptAttachment(attachmentStream: InputStream?,
- elementToDecrypt: ElementToDecrypt?,
- outputStream: OutputStream,
- clock: Clock
+ fun decryptAttachment(
+ attachmentStream: InputStream?,
+ elementToDecrypt: ElementToDecrypt?,
+ outputStream: OutputStream,
+ clock: Clock
): Boolean {
// sanity checks
if (null == attachmentStream || elementToDecrypt == null) {
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/crosssigning/CrossSigningOlm.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/crosssigning/CrossSigningOlm.kt
index 4fa355cd2a..3218b99948 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/crosssigning/CrossSigningOlm.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/crosssigning/CrossSigningOlm.kt
@@ -53,13 +53,13 @@ internal class CrossSigningOlm @Inject constructor(
fun signObject(type: KeyType, strToSign: String): Map {
val myKeys = cryptoStore.getMyCrossSigningInfo()
val pubKey = when (type) {
- KeyType.SELF -> myKeys?.selfSigningKey()
- KeyType.USER -> myKeys?.userKey()
+ KeyType.SELF -> myKeys?.selfSigningKey()
+ KeyType.USER -> myKeys?.userKey()
KeyType.MASTER -> myKeys?.masterKey()
}?.unpaddedBase64PublicKey
val pkSigning = when (type) {
- KeyType.SELF -> selfSigningPkSigning
- KeyType.USER -> userPkSigning
+ KeyType.SELF -> selfSigningPkSigning
+ KeyType.USER -> userPkSigning
KeyType.MASTER -> masterPkSigning
}
if (pubKey == null || pkSigning == null) {
@@ -76,8 +76,8 @@ internal class CrossSigningOlm @Inject constructor(
?: throw NoSuchElementException("Cross Signing not configured")
val myUserID = myKeys.userId
val pubKey = when (type) {
- KeyType.SELF -> myKeys.selfSigningKey()
- KeyType.USER -> myKeys.userKey()
+ KeyType.SELF -> myKeys.selfSigningKey()
+ KeyType.USER -> myKeys.userKey()
KeyType.MASTER -> myKeys.masterKey()
}?.unpaddedBase64PublicKey ?: throw NoSuchElementException("Cross Signing not configured")
val signaturesMadeByMyKey = signatures[myUserID] // Signatures made by me
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/crosssigning/DefaultCrossSigningService.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/crosssigning/DefaultCrossSigningService.kt
index 6c198abc2e..e466def1a1 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/crosssigning/DefaultCrossSigningService.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/crosssigning/DefaultCrossSigningService.kt
@@ -261,9 +261,10 @@ internal class DefaultCrossSigningService @Inject constructor(
}
}
- override fun checkTrustFromPrivateKeys(masterKeyPrivateKey: String?,
- uskKeyPrivateKey: String?,
- sskPrivateKey: String?
+ override fun checkTrustFromPrivateKeys(
+ masterKeyPrivateKey: String?,
+ uskKeyPrivateKey: String?,
+ sskPrivateKey: String?
): UserTrustResult {
val mxCrossSigningInfo = getMyCrossSigningKeys() ?: return UserTrustResult.CrossSigningNotConfigured(userId)
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/crosssigning/UpdateTrustWorker.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/crosssigning/UpdateTrustWorker.kt
index 74f0f5745d..f1dc060e10 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/crosssigning/UpdateTrustWorker.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/crosssigning/UpdateTrustWorker.kt
@@ -149,7 +149,7 @@ internal class UpdateTrustWorker(context: Context, params: WorkerParameters, ses
val trusts = otherInfos.mapValues { entry ->
when (entry.key) {
myUserId -> myTrustResult
- else -> {
+ else -> {
crossSigningService.checkOtherMSKTrusted(myCrossSigningInfo, entry.value).also {
Timber.v("## CrossSigning - user:${entry.key} result:$it")
}
@@ -276,10 +276,12 @@ internal class UpdateTrustWorker(context: Context, params: WorkerParameters, ses
}
}
- private fun computeRoomShield(myCrossSigningInfo: MXCrossSigningInfo?,
- cryptoRealm: Realm,
- activeMemberUserIds: List,
- roomSummaryEntity: RoomSummaryEntity): RoomEncryptionTrustLevel {
+ private fun computeRoomShield(
+ myCrossSigningInfo: MXCrossSigningInfo?,
+ cryptoRealm: Realm,
+ activeMemberUserIds: List,
+ roomSummaryEntity: RoomSummaryEntity
+ ): RoomEncryptionTrustLevel {
Timber.v("## CrossSigning - computeRoomShield ${roomSummaryEntity.roomId} -> ${activeMemberUserIds.logLimit()}")
// The set of “all users” depends on the type of room:
// For regular / topic rooms which have more than 2 members (including yourself) are considered when decorating a room
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/keysbackup/DefaultKeysBackupService.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/keysbackup/DefaultKeysBackupService.kt
index efd3bca824..5eaa106af3 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/keysbackup/DefaultKeysBackupService.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/keysbackup/DefaultKeysBackupService.kt
@@ -151,9 +151,11 @@ internal class DefaultKeysBackupService @Inject constructor(
keysBackupStateManager.removeListener(listener)
}
- override fun prepareKeysBackupVersion(password: String?,
- progressListener: ProgressListener?,
- callback: MatrixCallback) {
+ override fun prepareKeysBackupVersion(
+ password: String?,
+ progressListener: ProgressListener?,
+ callback: MatrixCallback
+ ) {
cryptoCoroutineScope.launch(coroutineDispatchers.io) {
try {
val olmPkDecryption = OlmPkDecryption()
@@ -227,8 +229,10 @@ internal class DefaultKeysBackupService @Inject constructor(
}
}
- override fun createKeysBackupVersion(keysBackupCreationInfo: MegolmBackupCreationInfo,
- callback: MatrixCallback) {
+ override fun createKeysBackupVersion(
+ keysBackupCreationInfo: MegolmBackupCreationInfo,
+ callback: MatrixCallback
+ ) {
@Suppress("UNCHECKED_CAST")
val createKeysBackupVersionBody = CreateKeysBackupVersionBody(
algorithm = keysBackupCreationInfo.algorithm,
@@ -318,7 +322,7 @@ internal class DefaultKeysBackupService @Inject constructor(
// val hashServer = keysBackupData?.backupLastServerHash
return when {
- totalNumberOfKeysLocally < totalNumberOfKeysServer -> {
+ totalNumberOfKeysLocally < totalNumberOfKeysServer -> {
// Server contains more keys than this device
true
}
@@ -327,7 +331,7 @@ internal class DefaultKeysBackupService @Inject constructor(
// TODO We have not found any algorithm to determine if a restore is recommended here. Return false for the moment
false
}
- else -> false
+ else -> false
}
}
@@ -339,8 +343,10 @@ internal class DefaultKeysBackupService @Inject constructor(
return cryptoStore.inboundGroupSessionsCount(true)
}
- override fun backupAllGroupSessions(progressListener: ProgressListener?,
- callback: MatrixCallback?) {
+ override fun backupAllGroupSessions(
+ progressListener: ProgressListener?,
+ callback: MatrixCallback?
+ ) {
if (!isEnabled() || backupOlmPkEncryption == null || keysBackupVersion == null) {
callback?.onFailure(Throwable("Backup not enabled"))
return
@@ -391,8 +397,10 @@ internal class DefaultKeysBackupService @Inject constructor(
})
}
- override fun getKeysBackupTrust(keysBackupVersion: KeysVersionResult,
- callback: MatrixCallback) {
+ override fun getKeysBackupTrust(
+ keysBackupVersion: KeysVersionResult,
+ callback: MatrixCallback
+ ) {
// TODO Validate with François that this is correct
object : Task {
override suspend fun execute(params: KeysVersionResult): KeysBackupVersionTrust {
@@ -499,9 +507,11 @@ internal class DefaultKeysBackupService @Inject constructor(
)
}
- override fun trustKeysBackupVersion(keysBackupVersion: KeysVersionResult,
- trust: Boolean,
- callback: MatrixCallback) {
+ override fun trustKeysBackupVersion(
+ keysBackupVersion: KeysVersionResult,
+ trust: Boolean,
+ callback: MatrixCallback
+ ) {
Timber.v("trustKeyBackupVersion: $trust, version ${keysBackupVersion.version}")
// Get auth data to update it
@@ -583,9 +593,11 @@ internal class DefaultKeysBackupService @Inject constructor(
}
}
- override fun trustKeysBackupVersionWithRecoveryKey(keysBackupVersion: KeysVersionResult,
- recoveryKey: String,
- callback: MatrixCallback) {
+ override fun trustKeysBackupVersionWithRecoveryKey(
+ keysBackupVersion: KeysVersionResult,
+ recoveryKey: String,
+ callback: MatrixCallback
+ ) {
Timber.v("trustKeysBackupVersionWithRecoveryKey: version ${keysBackupVersion.version}")
cryptoCoroutineScope.launch(coroutineDispatchers.io) {
@@ -602,9 +614,11 @@ internal class DefaultKeysBackupService @Inject constructor(
}
}
- override fun trustKeysBackupVersionWithPassphrase(keysBackupVersion: KeysVersionResult,
- password: String,
- callback: MatrixCallback) {
+ override fun trustKeysBackupVersionWithPassphrase(
+ keysBackupVersion: KeysVersionResult,
+ password: String,
+ callback: MatrixCallback
+ ) {
Timber.v("trustKeysBackupVersionWithPassphrase: version ${keysBackupVersion.version}")
cryptoCoroutineScope.launch(coroutineDispatchers.io) {
@@ -701,12 +715,14 @@ internal class DefaultKeysBackupService @Inject constructor(
progressListener.onProgress(backedUpKeys, total)
}
- override fun restoreKeysWithRecoveryKey(keysVersionResult: KeysVersionResult,
- recoveryKey: String,
- roomId: String?,
- sessionId: String?,
- stepProgressListener: StepProgressListener?,
- callback: MatrixCallback) {
+ override fun restoreKeysWithRecoveryKey(
+ keysVersionResult: KeysVersionResult,
+ recoveryKey: String,
+ roomId: String?,
+ sessionId: String?,
+ stepProgressListener: StepProgressListener?,
+ callback: MatrixCallback
+ ) {
Timber.v("restoreKeysWithRecoveryKey: From backup version: ${keysVersionResult.version}")
cryptoCoroutineScope.launch(coroutineDispatchers.io) {
@@ -800,12 +816,14 @@ internal class DefaultKeysBackupService @Inject constructor(
}
}
- override fun restoreKeyBackupWithPassword(keysBackupVersion: KeysVersionResult,
- password: String,
- roomId: String?,
- sessionId: String?,
- stepProgressListener: StepProgressListener?,
- callback: MatrixCallback) {
+ override fun restoreKeyBackupWithPassword(
+ keysBackupVersion: KeysVersionResult,
+ password: String,
+ roomId: String?,
+ sessionId: String?,
+ stepProgressListener: StepProgressListener?,
+ callback: MatrixCallback
+ ) {
Timber.v("[MXKeyBackup] restoreKeyBackup with password: From backup version: ${keysBackupVersion.version}")
cryptoCoroutineScope.launch(coroutineDispatchers.io) {
@@ -853,9 +871,11 @@ internal class DefaultKeysBackupService @Inject constructor(
* Same method as [RoomKeysRestClient.getRoomKey] except that it accepts nullable
* parameters and always returns a KeysBackupData object through the Callback.
*/
- private suspend fun getKeys(sessionId: String?,
- roomId: String?,
- version: String): KeysBackupData {
+ private suspend fun getKeys(
+ sessionId: String?,
+ roomId: String?,
+ version: String
+ ): KeysBackupData {
return if (roomId != null && sessionId != null) {
// Get key for the room and for the session
val data = getRoomSessionDataTask.execute(GetRoomSessionDataTask.Params(roomId, sessionId, version))
@@ -909,7 +929,7 @@ internal class DefaultKeysBackupService @Inject constructor(
*/
fun maybeBackupKeys() {
when {
- isStuck() -> {
+ isStuck() -> {
// If not already done, or in error case, check for a valid backup version on the homeserver.
// If there is one, maybeBackupKeys will be called again.
checkAndStartKeysBackup()
@@ -927,14 +947,16 @@ internal class DefaultKeysBackupService @Inject constructor(
uiHandler.post { backupKeys() }
}
}
- else -> {
+ else -> {
Timber.v("maybeBackupKeys: Skip it because state: ${getState()}")
}
}
}
- override fun getVersion(version: String,
- callback: MatrixCallback) {
+ override fun getVersion(
+ version: String,
+ callback: MatrixCallback
+ ) {
getKeysBackupVersionTask
.configureWith(version) {
this.callback = object : MatrixCallback {
@@ -970,7 +992,7 @@ internal class DefaultKeysBackupService @Inject constructor(
override fun onSuccess(data: KeysBackupLastVersionResult) {
val localBackupVersion = keysBackupVersion?.version
when (data) {
- KeysBackupLastVersionResult.NoKeysBackup -> {
+ KeysBackupLastVersionResult.NoKeysBackup -> {
if (localBackupVersion == null) {
// No backup on the server, and backup is not active
callback.onSuccess(true)
@@ -1173,10 +1195,12 @@ internal class DefaultKeysBackupService @Inject constructor(
}
}
- override fun computePrivateKey(passphrase: String,
- privateKeySalt: String,
- privateKeyIterations: Int,
- progressListener: ProgressListener): ByteArray {
+ override fun computePrivateKey(
+ passphrase: String,
+ privateKeySalt: String,
+ privateKeyIterations: Int,
+ progressListener: ProgressListener
+ ): ByteArray {
return deriveKey(passphrase, privateKeySalt, privateKeyIterations, progressListener)
}
@@ -1354,7 +1378,7 @@ internal class DefaultKeysBackupService @Inject constructor(
// Do not stay in KeysBackupState.WrongBackUpVersion but check what is available on the homeserver
checkAndStartKeysBackup()
}
- else ->
+ else ->
// Come back to the ready state so that we will retry on the next received key
keysBackupStateManager.state = KeysBackupState.ReadyToBackUp
}
@@ -1476,8 +1500,10 @@ internal class DefaultKeysBackupService @Inject constructor(
get() = cryptoStore
@VisibleForTesting
- fun createFakeKeysBackupVersion(keysBackupCreationInfo: MegolmBackupCreationInfo,
- callback: MatrixCallback) {
+ fun createFakeKeysBackupVersion(
+ keysBackupCreationInfo: MegolmBackupCreationInfo,
+ callback: MatrixCallback
+ ) {
@Suppress("UNCHECKED_CAST")
val createKeysBackupVersionBody = CreateKeysBackupVersionBody(
algorithm = keysBackupCreationInfo.algorithm,
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/keysbackup/KeysBackupPassword.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/keysbackup/KeysBackupPassword.kt
index f821fdcf6d..8560eb5fc1 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/keysbackup/KeysBackupPassword.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/keysbackup/KeysBackupPassword.kt
@@ -49,8 +49,9 @@ internal data class GeneratePrivateKeyResult(
* @return a {privateKey, salt, iterations} tuple.
*/
@WorkerThread
-internal fun generatePrivateKeyWithPassword(password: String,
- progressListener: ProgressListener?
+internal fun generatePrivateKeyWithPassword(
+ password: String,
+ progressListener: ProgressListener?
): GeneratePrivateKeyResult {
val salt = generateSalt()
val iterations = DEFAULT_ITERATION
@@ -70,10 +71,12 @@ internal fun generatePrivateKeyWithPassword(password: String,
* @return a private key.
*/
@WorkerThread
-internal fun retrievePrivateKeyWithPassword(password: String,
- salt: String,
- iterations: Int,
- progressListener: ProgressListener? = null): ByteArray {
+internal fun retrievePrivateKeyWithPassword(
+ password: String,
+ salt: String,
+ iterations: Int,
+ progressListener: ProgressListener? = null
+): ByteArray {
return deriveKey(password, salt, iterations, progressListener)
}
@@ -88,10 +91,12 @@ internal fun retrievePrivateKeyWithPassword(password: String,
* @return a private key.
*/
@WorkerThread
-internal fun deriveKey(password: String,
- salt: String,
- iterations: Int,
- progressListener: ProgressListener?): ByteArray {
+internal fun deriveKey(
+ password: String,
+ salt: String,
+ iterations: Int,
+ progressListener: ProgressListener?
+): ByteArray {
// Note: copied and adapted from MXMegolmExportEncryption
// based on https://en.wikipedia.org/wiki/PBKDF2 algorithm
// it is simpler than the generic algorithm because the expected key length is equal to the mac key length.
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/keysbackup/api/RoomKeysApi.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/keysbackup/api/RoomKeysApi.kt
index d9c63b46ab..48a735018a 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/keysbackup/api/RoomKeysApi.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/keysbackup/api/RoomKeysApi.kt
@@ -71,8 +71,10 @@ internal interface RoomKeysApi {
* @param updateKeysBackupVersionBody the body
*/
@PUT(NetworkConstants.URI_API_PREFIX_PATH_UNSTABLE + "room_keys/version/{version}")
- suspend fun updateKeysBackupVersion(@Path("version") version: String,
- @Body updateKeysBackupVersionBody: UpdateKeysBackupVersionBody)
+ suspend fun updateKeysBackupVersion(
+ @Path("version") version: String,
+ @Body updateKeysBackupVersionBody: UpdateKeysBackupVersionBody
+ )
/* ==========================================================================================
* Storing keys
@@ -93,10 +95,12 @@ internal interface RoomKeysApi {
* @param keyBackupData the data to send
*/
@PUT(NetworkConstants.URI_API_PREFIX_PATH_UNSTABLE + "room_keys/keys/{roomId}/{sessionId}")
- suspend fun storeRoomSessionData(@Path("roomId") roomId: String,
- @Path("sessionId") sessionId: String,
- @Query("version") version: String,
- @Body keyBackupData: KeyBackupData): BackupKeysResult
+ suspend fun storeRoomSessionData(
+ @Path("roomId") roomId: String,
+ @Path("sessionId") sessionId: String,
+ @Query("version") version: String,
+ @Body keyBackupData: KeyBackupData
+ ): BackupKeysResult
/**
* Store several keys for the given room, using the given backup version.
@@ -106,9 +110,11 @@ internal interface RoomKeysApi {
* @param roomKeysBackupData the data to send
*/
@PUT(NetworkConstants.URI_API_PREFIX_PATH_UNSTABLE + "room_keys/keys/{roomId}")
- suspend fun storeRoomSessionsData(@Path("roomId") roomId: String,
- @Query("version") version: String,
- @Body roomKeysBackupData: RoomKeysBackupData): BackupKeysResult
+ suspend fun storeRoomSessionsData(
+ @Path("roomId") roomId: String,
+ @Query("version") version: String,
+ @Body roomKeysBackupData: RoomKeysBackupData
+ ): BackupKeysResult
/**
* Store several keys, using the given backup version.
@@ -117,8 +123,10 @@ internal interface RoomKeysApi {
* @param keysBackupData the data to send
*/
@PUT(NetworkConstants.URI_API_PREFIX_PATH_UNSTABLE + "room_keys/keys")
- suspend fun storeSessionsData(@Query("version") version: String,
- @Body keysBackupData: KeysBackupData): BackupKeysResult
+ suspend fun storeSessionsData(
+ @Query("version") version: String,
+ @Body keysBackupData: KeysBackupData
+ ): BackupKeysResult
/* ==========================================================================================
* Retrieving keys
@@ -132,9 +140,11 @@ internal interface RoomKeysApi {
* @param version the version of the backup, or empty String to retrieve the last version
*/
@GET(NetworkConstants.URI_API_PREFIX_PATH_UNSTABLE + "room_keys/keys/{roomId}/{sessionId}")
- suspend fun getRoomSessionData(@Path("roomId") roomId: String,
- @Path("sessionId") sessionId: String,
- @Query("version") version: String): KeyBackupData
+ suspend fun getRoomSessionData(
+ @Path("roomId") roomId: String,
+ @Path("sessionId") sessionId: String,
+ @Query("version") version: String
+ ): KeyBackupData
/**
* Retrieve all the keys for the given room from the backup.
@@ -143,8 +153,10 @@ internal interface RoomKeysApi {
* @param version the version of the backup, or empty String to retrieve the last version
*/
@GET(NetworkConstants.URI_API_PREFIX_PATH_UNSTABLE + "room_keys/keys/{roomId}")
- suspend fun getRoomSessionsData(@Path("roomId") roomId: String,
- @Query("version") version: String): RoomKeysBackupData
+ suspend fun getRoomSessionsData(
+ @Path("roomId") roomId: String,
+ @Query("version") version: String
+ ): RoomKeysBackupData
/**
* Retrieve all the keys from the backup.
@@ -162,16 +174,20 @@ internal interface RoomKeysApi {
* Deletes keys from the backup.
*/
@DELETE(NetworkConstants.URI_API_PREFIX_PATH_UNSTABLE + "room_keys/keys/{roomId}/{sessionId}")
- suspend fun deleteRoomSessionData(@Path("roomId") roomId: String,
- @Path("sessionId") sessionId: String,
- @Query("version") version: String)
+ suspend fun deleteRoomSessionData(
+ @Path("roomId") roomId: String,
+ @Path("sessionId") sessionId: String,
+ @Query("version") version: String
+ )
/**
* Deletes keys from the backup.
*/
@DELETE(NetworkConstants.URI_API_PREFIX_PATH_UNSTABLE + "room_keys/keys/{roomId}")
- suspend fun deleteRoomSessionsData(@Path("roomId") roomId: String,
- @Query("version") version: String)
+ suspend fun deleteRoomSessionsData(
+ @Path("roomId") roomId: String,
+ @Query("version") version: String
+ )
/**
* Deletes keys from the backup.
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/model/rest/KeyVerificationAccept.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/model/rest/KeyVerificationAccept.kt
index 9fdeda01c9..85ba1762d3 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/model/rest/KeyVerificationAccept.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/model/rest/KeyVerificationAccept.kt
@@ -69,12 +69,14 @@ internal data class KeyVerificationAccept(
override fun toSendToDeviceObject() = this
companion object : VerificationInfoAcceptFactory {
- override fun create(tid: String,
- keyAgreementProtocol: String,
- hash: String,
- commitment: String,
- messageAuthenticationCode: String,
- shortAuthenticationStrings: List): VerificationInfoAccept {
+ override fun create(
+ tid: String,
+ keyAgreementProtocol: String,
+ hash: String,
+ commitment: String,
+ messageAuthenticationCode: String,
+ shortAuthenticationStrings: List
+ ): VerificationInfoAccept {
return KeyVerificationAccept(
transactionId = tid,
keyAgreementProtocol = keyAgreementProtocol,
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/model/rest/VerificationMethodValues.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/model/rest/VerificationMethodValues.kt
index c07434f586..afe6191bf7 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/model/rest/VerificationMethodValues.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/model/rest/VerificationMethodValues.kt
@@ -28,7 +28,7 @@ internal const val VERIFICATION_METHOD_RECIPROCATE = "m.reciprocate.v1"
internal fun VerificationMethod.toValue(): String {
return when (this) {
- VerificationMethod.SAS -> VERIFICATION_METHOD_SAS
+ VerificationMethod.SAS -> VERIFICATION_METHOD_SAS
VerificationMethod.QR_CODE_SCAN -> VERIFICATION_METHOD_QR_CODE_SCAN
VerificationMethod.QR_CODE_SHOW -> VERIFICATION_METHOD_QR_CODE_SHOW
}
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/secrets/DefaultSharedSecretStorageService.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/secrets/DefaultSharedSecretStorageService.kt
index 0daaec11a1..ddb048a912 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/secrets/DefaultSharedSecretStorageService.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/secrets/DefaultSharedSecretStorageService.kt
@@ -63,10 +63,12 @@ internal class DefaultSharedSecretStorageService @Inject constructor(
private val cryptoCoroutineScope: CoroutineScope
) : SharedSecretStorageService {
- override suspend fun generateKey(keyId: String,
- key: SsssKeySpec?,
- keyName: String,
- keySigner: KeySigner?): SsssKeyCreationInfo {
+ override suspend fun generateKey(
+ keyId: String,
+ key: SsssKeySpec?,
+ keyName: String,
+ keySigner: KeySigner?
+ ): SsssKeyCreationInfo {
return withContext(cryptoCoroutineScope.coroutineContext + coroutineDispatchers.computation) {
val bytes = (key as? RawBytesKeySpec)?.privateKey
?: ByteArray(32).also {
@@ -95,11 +97,13 @@ internal class DefaultSharedSecretStorageService @Inject constructor(
}
}
- override suspend fun generateKeyWithPassphrase(keyId: String,
- keyName: String,
- passphrase: String,
- keySigner: KeySigner,
- progressListener: ProgressListener?): SsssKeyCreationInfo {
+ override suspend fun generateKeyWithPassphrase(
+ keyId: String,
+ keyName: String,
+ passphrase: String,
+ keySigner: KeySigner,
+ progressListener: ProgressListener?
+ ): SsssKeyCreationInfo {
return withContext(cryptoCoroutineScope.coroutineContext + coroutineDispatchers.computation) {
val privatePart = generatePrivateKeyWithPassword(passphrase, progressListener)
@@ -175,7 +179,7 @@ internal class DefaultSharedSecretStorageService @Inject constructor(
throw SharedSecretStorageError.UnknownAlgorithm(key.keyInfo.content.algorithm ?: "")
}
}
- is KeyInfoResult.Error -> throw key.error
+ is KeyInfoResult.Error -> throw key.error
}
}
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/store/IMXCryptoStore.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/store/IMXCryptoStore.kt
index 9b1c785059..b18de34329 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/store/IMXCryptoStore.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/store/IMXCryptoStore.kt
@@ -192,10 +192,12 @@ internal interface IMXCryptoStore {
*/
fun storeUserDevices(userId: String, devices: Map?)
- fun storeUserCrossSigningKeys(userId: String,
- masterKey: CryptoCrossSigningKey?,
- selfSigningKey: CryptoCrossSigningKey?,
- userSigningKey: CryptoCrossSigningKey?)
+ fun storeUserCrossSigningKeys(
+ userId: String,
+ masterKey: CryptoCrossSigningKey?,
+ selfSigningKey: CryptoCrossSigningKey?,
+ userSigningKey: CryptoCrossSigningKey?
+ )
/**
* Retrieve the known devices for a user.
@@ -392,7 +394,8 @@ internal interface IMXCryptoStore {
algorithm: String,
senderKey: String,
fromDevice: String?,
- event: Event)
+ event: Event
+ )
fun deleteOutgoingRoomKeyRequest(requestId: String)
fun deleteOutgoingRoomKeyRequestInState(state: OutgoingRoomKeyRequestState)
@@ -479,8 +482,14 @@ internal interface IMXCryptoStore {
fun addWithHeldMegolmSession(withHeldContent: RoomKeyWithHeldContent)
fun getWithHeldMegolmSession(roomId: String, sessionId: String): RoomKeyWithHeldContent?
- fun markedSessionAsShared(roomId: String?, sessionId: String, userId: String, deviceId: String,
- deviceIdentityKey: String, chainIndex: Int)
+ fun markedSessionAsShared(
+ roomId: String?,
+ sessionId: String,
+ userId: String,
+ deviceId: String,
+ deviceIdentityKey: String,
+ chainIndex: Int
+ )
/**
* Query for information on this session sharing history.
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/store/db/RealmCryptoStore.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/store/db/RealmCryptoStore.kt
index 533ab70bba..c56e4d320b 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/store/db/RealmCryptoStore.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/store/db/RealmCryptoStore.kt
@@ -322,10 +322,12 @@ internal class RealmCryptoStore @Inject constructor(
}
}
- override fun storeUserCrossSigningKeys(userId: String,
- masterKey: CryptoCrossSigningKey?,
- selfSigningKey: CryptoCrossSigningKey?,
- userSigningKey: CryptoCrossSigningKey?) {
+ override fun storeUserCrossSigningKeys(
+ userId: String,
+ masterKey: CryptoCrossSigningKey?,
+ selfSigningKey: CryptoCrossSigningKey?,
+ userSigningKey: CryptoCrossSigningKey?
+ ) {
doRealmTransaction(realmConfiguration) { realm ->
UserEntity.getOrCreate(realm, userId)
.let { userEntity ->
@@ -1154,9 +1156,11 @@ internal class RealmCryptoStore @Inject constructor(
}
}
- override fun getOrAddOutgoingRoomKeyRequest(requestBody: RoomKeyRequestBody,
- recipients: Map>,
- fromIndex: Int): OutgoingKeyRequest {
+ override fun getOrAddOutgoingRoomKeyRequest(
+ requestBody: RoomKeyRequestBody,
+ recipients: Map>,
+ fromIndex: Int
+ ): OutgoingKeyRequest {
// Insert the request and return the one passed in parameter
lateinit var request: OutgoingKeyRequest
doRealmTransaction(realmConfiguration) { realm ->
@@ -1220,12 +1224,14 @@ internal class RealmCryptoStore @Inject constructor(
}
}
- override fun updateOutgoingRoomKeyReply(roomId: String,
- sessionId: String,
- algorithm: String,
- senderKey: String,
- fromDevice: String?,
- event: Event) {
+ override fun updateOutgoingRoomKeyReply(
+ roomId: String,
+ sessionId: String,
+ algorithm: String,
+ senderKey: String,
+ fromDevice: String?,
+ event: Event
+ ) {
doRealmTransaction(realmConfiguration) { realm ->
realm.where()
.equalTo(OutgoingKeyRequestEntityFields.ROOM_ID, roomId)
@@ -1266,7 +1272,8 @@ internal class RealmCryptoStore @Inject constructor(
senderKey: String,
algorithm: String,
fromUser: String,
- fromDevice: String) {
+ fromDevice: String
+ ) {
monarchy.writeAsync { realm ->
val now = clock.epochMillis()
realm.createObject().apply {
@@ -1288,13 +1295,15 @@ internal class RealmCryptoStore @Inject constructor(
}
}
- override fun saveWithheldAuditTrail(roomId: String,
- sessionId: String,
- senderKey: String,
- algorithm: String,
- code: WithHeldCode,
- userId: String,
- deviceId: String) {
+ override fun saveWithheldAuditTrail(
+ roomId: String,
+ sessionId: String,
+ senderKey: String,
+ algorithm: String,
+ code: WithHeldCode,
+ userId: String,
+ deviceId: String
+ ) {
monarchy.writeAsync { realm ->
val now = clock.epochMillis()
realm.createObject().apply {
@@ -1316,34 +1325,39 @@ internal class RealmCryptoStore @Inject constructor(
}
}
- override fun saveForwardKeyAuditTrail(roomId: String,
- sessionId: String,
- senderKey: String,
- algorithm: String,
- userId: String,
- deviceId: String,
- chainIndex: Long?) {
+ override fun saveForwardKeyAuditTrail(
+ roomId: String,
+ sessionId: String,
+ senderKey: String,
+ algorithm: String,
+ userId: String,
+ deviceId: String,
+ chainIndex: Long?
+ ) {
saveForwardKeyTrail(roomId, sessionId, senderKey, algorithm, userId, deviceId, chainIndex, false)
}
- override fun saveIncomingForwardKeyAuditTrail(roomId: String,
- sessionId: String,
- senderKey: String,
- algorithm: String,
- userId: String,
- deviceId: String,
- chainIndex: Long?) {
+ override fun saveIncomingForwardKeyAuditTrail(
+ roomId: String,
+ sessionId: String,
+ senderKey: String,
+ algorithm: String,
+ userId: String,
+ deviceId: String,
+ chainIndex: Long?
+ ) {
saveForwardKeyTrail(roomId, sessionId, senderKey, algorithm, userId, deviceId, chainIndex, true)
}
- private fun saveForwardKeyTrail(roomId: String,
- sessionId: String,
- senderKey: String,
- algorithm: String,
- userId: String,
- deviceId: String,
- chainIndex: Long?,
- incoming: Boolean
+ private fun saveForwardKeyTrail(
+ roomId: String,
+ sessionId: String,
+ senderKey: String,
+ algorithm: String,
+ userId: String,
+ deviceId: String,
+ chainIndex: Long?,
+ incoming: Boolean
) {
monarchy.writeAsync { realm ->
val now = clock.epochMillis()
@@ -1617,12 +1631,14 @@ internal class RealmCryptoStore @Inject constructor(
}
}
- override fun markedSessionAsShared(roomId: String?,
- sessionId: String,
- userId: String,
- deviceId: String,
- deviceIdentityKey: String,
- chainIndex: Int) {
+ override fun markedSessionAsShared(
+ roomId: String?,
+ sessionId: String,
+ userId: String,
+ deviceId: String,
+ deviceIdentityKey: String,
+ chainIndex: Int
+ ) {
doRealmTransaction(realmConfiguration) { realm ->
SharedSessionEntity.create(
realm = realm,
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/store/db/migration/MigrateCryptoTo004.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/store/db/migration/MigrateCryptoTo004.kt
index e5bdd2aa9b..0a986892d9 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/store/db/migration/MigrateCryptoTo004.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/store/db/migration/MigrateCryptoTo004.kt
@@ -104,10 +104,10 @@ internal class MigrateCryptoTo004(realm: DynamicRealm) : RealmMigrator(realm, 4)
val trustLevel = realm.createObject("TrustLevelEntity")
when (oldDevice.verified) {
- MXDeviceInfo.DEVICE_VERIFICATION_UNKNOWN -> {
+ MXDeviceInfo.DEVICE_VERIFICATION_UNKNOWN -> {
obj.setNull(DeviceInfoEntityFields.TRUST_LEVEL_ENTITY.`$`)
}
- MXDeviceInfo.DEVICE_VERIFICATION_BLOCKED -> {
+ MXDeviceInfo.DEVICE_VERIFICATION_BLOCKED -> {
trustLevel.setNull(TrustLevelEntityFields.LOCALLY_VERIFIED)
trustLevel.setNull(TrustLevelEntityFields.CROSS_SIGNED_VERIFIED)
obj.setBoolean(DeviceInfoEntityFields.IS_BLOCKED, oldDevice.isBlocked)
@@ -118,7 +118,7 @@ internal class MigrateCryptoTo004(realm: DynamicRealm) : RealmMigrator(realm, 4)
trustLevel.setBoolean(TrustLevelEntityFields.CROSS_SIGNED_VERIFIED, false)
obj.setObject(DeviceInfoEntityFields.TRUST_LEVEL_ENTITY.`$`, trustLevel)
}
- MXDeviceInfo.DEVICE_VERIFICATION_VERIFIED -> {
+ MXDeviceInfo.DEVICE_VERIFICATION_VERIFIED -> {
trustLevel.setBoolean(TrustLevelEntityFields.LOCALLY_VERIFIED, true)
trustLevel.setBoolean(TrustLevelEntityFields.CROSS_SIGNED_VERIFIED, false)
obj.setObject(DeviceInfoEntityFields.TRUST_LEVEL_ENTITY.`$`, trustLevel)
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/store/db/model/AuditTrailMapper.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/store/db/model/AuditTrailMapper.kt
index 80ae4a8d0d..fe8e9f1db7 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/store/db/model/AuditTrailMapper.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/store/db/model/AuditTrailMapper.kt
@@ -30,7 +30,7 @@ internal object AuditTrailMapper {
fun map(entity: AuditTrailEntity): AuditTrail? {
val contentJson = entity.contentJson ?: return null
return when (entity.type) {
- TrailType.OutgoingKeyForward.name -> {
+ TrailType.OutgoingKeyForward.name -> {
val info = tryOrNull {
MoshiProvider.providesMoshi().adapter(ForwardInfo::class.java).fromJson(contentJson)
} ?: return null
@@ -50,7 +50,7 @@ internal object AuditTrailMapper {
info = info
)
}
- TrailType.IncomingKeyRequest.name -> {
+ TrailType.IncomingKeyRequest.name -> {
val info = tryOrNull {
MoshiProvider.providesMoshi().adapter(IncomingKeyRequestInfo::class.java).fromJson(contentJson)
} ?: return null
@@ -60,7 +60,7 @@ internal object AuditTrailMapper {
info = info
)
}
- TrailType.IncomingKeyForward.name -> {
+ TrailType.IncomingKeyForward.name -> {
val info = tryOrNull {
MoshiProvider.providesMoshi().adapter(ForwardInfo::class.java).fromJson(contentJson)
} ?: return null
@@ -70,7 +70,7 @@ internal object AuditTrailMapper {
info = info
)
}
- else -> {
+ else -> {
AuditTrail(
ageLocalTs = entity.ageLocalTs ?: 0,
type = TrailType.Unknown,
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/store/db/model/OlmInboundGroupSessionEntity.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/store/db/model/OlmInboundGroupSessionEntity.kt
index 83671b28d9..a4f6c279ac 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/store/db/model/OlmInboundGroupSessionEntity.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/store/db/model/OlmInboundGroupSessionEntity.kt
@@ -33,7 +33,8 @@ internal open class OlmInboundGroupSessionEntity(
// olmInboundGroupSessionData contains Json
var olmInboundGroupSessionData: String? = null,
// Indicate if the key has been backed up to the homeserver
- var backedUp: Boolean = false) :
+ var backedUp: Boolean = false
+) :
RealmObject() {
fun getInboundGroupSession(): OlmInboundGroupSessionWrapper2? {
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/store/db/model/OlmSessionEntity.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/store/db/model/OlmSessionEntity.kt
index 1a637d76c4..9f010db288 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/store/db/model/OlmSessionEntity.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/store/db/model/OlmSessionEntity.kt
@@ -25,11 +25,13 @@ import org.matrix.olm.OlmSession
internal fun OlmSessionEntity.Companion.createPrimaryKey(sessionId: String, deviceKey: String) = "$sessionId|$deviceKey"
// olmSessionData is a serialized OlmSession
-internal open class OlmSessionEntity(@PrimaryKey var primaryKey: String = "",
- var sessionId: String? = null,
- var deviceKey: String? = null,
- var olmSessionData: String? = null,
- var lastReceivedMessageTs: Long = 0) :
+internal open class OlmSessionEntity(
+ @PrimaryKey var primaryKey: String = "",
+ var sessionId: String? = null,
+ var deviceKey: String? = null,
+ var olmSessionData: String? = null,
+ var lastReceivedMessageTs: Long = 0
+) :
RealmObject() {
fun getOlmSession(): OlmSession? {
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/store/db/model/OutgoingKeyRequestEntity.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/store/db/model/OutgoingKeyRequestEntity.kt
index 7a8ba18809..854d148b76 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/store/db/model/OutgoingKeyRequestEntity.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/store/db/model/OutgoingKeyRequestEntity.kt
@@ -117,7 +117,7 @@ internal open class OutgoingKeyRequestEntity(
private fun eventToResult(event: Event): RequestResult? {
return when (event.getClearType()) {
- EventType.ROOM_KEY_WITHHELD -> {
+ EventType.ROOM_KEY_WITHHELD -> {
event.content.toModel()?.code?.let {
RequestResult.Failure(it)
}
@@ -125,7 +125,7 @@ internal open class OutgoingKeyRequestEntity(
EventType.FORWARDED_ROOM_KEY -> {
RequestResult.Success((event.content?.get("chain_index") as? Number)?.toInt() ?: 0)
}
- else -> null
+ else -> null
}
}
}
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/store/db/query/SharedSessionQueries.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/store/db/query/SharedSessionQueries.kt
index 8bf9794375..85dd50c88e 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/store/db/query/SharedSessionQueries.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/store/db/query/SharedSessionQueries.kt
@@ -24,12 +24,14 @@ import org.matrix.android.sdk.api.crypto.MXCRYPTO_ALGORITHM_MEGOLM
import org.matrix.android.sdk.internal.crypto.store.db.model.SharedSessionEntity
import org.matrix.android.sdk.internal.crypto.store.db.model.SharedSessionEntityFields
-internal fun SharedSessionEntity.Companion.get(realm: Realm,
- roomId: String?,
- sessionId: String,
- userId: String,
- deviceId: String,
- deviceIdentityKey: String?): SharedSessionEntity? {
+internal fun SharedSessionEntity.Companion.get(
+ realm: Realm,
+ roomId: String?,
+ sessionId: String,
+ userId: String,
+ deviceId: String,
+ deviceIdentityKey: String?
+): SharedSessionEntity? {
return realm.where()
.equalTo(SharedSessionEntityFields.ROOM_ID, roomId)
.equalTo(SharedSessionEntityFields.SESSION_ID, sessionId)
@@ -48,12 +50,15 @@ internal fun SharedSessionEntity.Companion.get(realm: Realm, roomId: String?, se
.findAll()
}
-internal fun SharedSessionEntity.Companion.create(realm: Realm, roomId: String?,
- sessionId: String,
- userId: String,
- deviceId: String,
- deviceIdentityKey: String,
- chainIndex: Int): SharedSessionEntity {
+internal fun SharedSessionEntity.Companion.create(
+ realm: Realm,
+ roomId: String?,
+ sessionId: String,
+ userId: String,
+ deviceId: String,
+ deviceIdentityKey: String,
+ chainIndex: Int
+): SharedSessionEntity {
return realm.createObject().apply {
this.roomId = roomId
this.algorithm = MXCRYPTO_ALGORITHM_MEGOLM
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/tasks/EncryptEventTask.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/tasks/EncryptEventTask.kt
index 394c618968..a4b4cd0761 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/tasks/EncryptEventTask.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/tasks/EncryptEventTask.kt
@@ -31,10 +31,11 @@ import org.matrix.android.sdk.internal.task.Task
import javax.inject.Inject
internal interface EncryptEventTask : Task {
- data class Params(val roomId: String,
- val event: Event,
- /**Do not encrypt these keys, keep them as is in encrypted content (e.g. m.relates_to)*/
- val keepKeys: List? = null
+ data class Params(
+ val roomId: String,
+ val event: Event,
+ /**Do not encrypt these keys, keep them as is in encrypted content (e.g. m.relates_to)*/
+ val keepKeys: List? = null
)
}
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/tasks/RedactEventTask.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/tasks/RedactEventTask.kt
index d6a7f3c6a0..56bdc8cae8 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/tasks/RedactEventTask.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/tasks/RedactEventTask.kt
@@ -32,7 +32,8 @@ internal interface RedactEventTask : Task {
internal class DefaultRedactEventTask @Inject constructor(
private val roomAPI: RoomAPI,
- private val globalErrorReceiver: GlobalErrorReceiver) : RedactEventTask {
+ private val globalErrorReceiver: GlobalErrorReceiver
+) : RedactEventTask {
override suspend fun execute(params: RedactEventTask.Params): String {
val response = executeRequest(globalErrorReceiver) {
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/tasks/SendEventTask.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/tasks/SendEventTask.kt
index 50efe51bc1..fbd9d245d9 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/tasks/SendEventTask.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/tasks/SendEventTask.kt
@@ -39,7 +39,8 @@ internal class DefaultSendEventTask @Inject constructor(
private val encryptEventTask: EncryptEventTask,
private val loadRoomMembersTask: LoadRoomMembersTask,
private val roomAPI: RoomAPI,
- private val globalErrorReceiver: GlobalErrorReceiver) : SendEventTask {
+ private val globalErrorReceiver: GlobalErrorReceiver
+) : SendEventTask {
override suspend fun execute(params: SendEventTask.Params): String {
try {
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/tasks/SendVerificationMessageTask.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/tasks/SendVerificationMessageTask.kt
index 7c52c62d92..944f41d488 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/tasks/SendVerificationMessageTask.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/tasks/SendVerificationMessageTask.kt
@@ -37,7 +37,8 @@ internal class DefaultSendVerificationMessageTask @Inject constructor(
private val encryptEventTask: EncryptEventTask,
private val roomAPI: RoomAPI,
private val cryptoSessionInfoProvider: CryptoSessionInfoProvider,
- private val globalErrorReceiver: GlobalErrorReceiver) : SendVerificationMessageTask {
+ private val globalErrorReceiver: GlobalErrorReceiver
+) : SendVerificationMessageTask {
override suspend fun execute(params: SendVerificationMessageTask.Params): String {
val event = handleEncryption(params)
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/verification/DefaultIncomingSASDefaultVerificationTransaction.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/verification/DefaultIncomingSASDefaultVerificationTransaction.kt
index a9d5cf1191..6b3bb1e641 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/verification/DefaultIncomingSASDefaultVerificationTransaction.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/verification/DefaultIncomingSASDefaultVerificationTransaction.kt
@@ -60,26 +60,26 @@ internal class DefaultIncomingSASDefaultVerificationTransaction(
override val uxState: IncomingSasVerificationTransaction.UxState
get() {
return when (val immutableState = state) {
- is VerificationTxState.OnStarted -> IncomingSasVerificationTransaction.UxState.SHOW_ACCEPT
+ is VerificationTxState.OnStarted -> IncomingSasVerificationTransaction.UxState.SHOW_ACCEPT
is VerificationTxState.SendingAccept,
is VerificationTxState.Accepted,
is VerificationTxState.OnKeyReceived,
is VerificationTxState.SendingKey,
- is VerificationTxState.KeySent -> IncomingSasVerificationTransaction.UxState.WAIT_FOR_KEY_AGREEMENT
+ is VerificationTxState.KeySent -> IncomingSasVerificationTransaction.UxState.WAIT_FOR_KEY_AGREEMENT
is VerificationTxState.ShortCodeReady -> IncomingSasVerificationTransaction.UxState.SHOW_SAS
is VerificationTxState.ShortCodeAccepted,
is VerificationTxState.SendingMac,
is VerificationTxState.MacSent,
- is VerificationTxState.Verifying -> IncomingSasVerificationTransaction.UxState.WAIT_FOR_VERIFICATION
- is VerificationTxState.Verified -> IncomingSasVerificationTransaction.UxState.VERIFIED
- is VerificationTxState.Cancelled -> {
+ is VerificationTxState.Verifying -> IncomingSasVerificationTransaction.UxState.WAIT_FOR_VERIFICATION
+ is VerificationTxState.Verified -> IncomingSasVerificationTransaction.UxState.VERIFIED
+ is VerificationTxState.Cancelled -> {
if (immutableState.byMe) {
IncomingSasVerificationTransaction.UxState.CANCELLED_BY_ME
} else {
IncomingSasVerificationTransaction.UxState.CANCELLED_BY_OTHER
}
}
- else -> IncomingSasVerificationTransaction.UxState.UNKNOWN
+ else -> IncomingSasVerificationTransaction.UxState.UNKNOWN
}
}
@@ -232,7 +232,7 @@ internal class DefaultIncomingSASDefaultVerificationTransaction(
val sasInfo = "MATRIX_KEY_VERIFICATION_SAS|$otherUserId|$otherDeviceId|$otherKey|$userId|$deviceId|${getSAS().publicKey}|$transactionId"
return getSAS().generateShortCode(sasInfo, 6)
}
- else -> {
+ else -> {
// Protocol has been checked earlier
throw IllegalArgumentException()
}
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/verification/DefaultOutgoingSASDefaultVerificationTransaction.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/verification/DefaultOutgoingSASDefaultVerificationTransaction.kt
index ddb8ed232b..f1cf1b7547 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/verification/DefaultOutgoingSASDefaultVerificationTransaction.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/verification/DefaultOutgoingSASDefaultVerificationTransaction.kt
@@ -57,27 +57,27 @@ internal class DefaultOutgoingSASDefaultVerificationTransaction(
override val uxState: OutgoingSasVerificationTransaction.UxState
get() {
return when (val immutableState = state) {
- is VerificationTxState.None -> OutgoingSasVerificationTransaction.UxState.WAIT_FOR_START
+ is VerificationTxState.None -> OutgoingSasVerificationTransaction.UxState.WAIT_FOR_START
is VerificationTxState.SendingStart,
is VerificationTxState.Started,
is VerificationTxState.OnAccepted,
is VerificationTxState.SendingKey,
is VerificationTxState.KeySent,
- is VerificationTxState.OnKeyReceived -> OutgoingSasVerificationTransaction.UxState.WAIT_FOR_KEY_AGREEMENT
+ is VerificationTxState.OnKeyReceived -> OutgoingSasVerificationTransaction.UxState.WAIT_FOR_KEY_AGREEMENT
is VerificationTxState.ShortCodeReady -> OutgoingSasVerificationTransaction.UxState.SHOW_SAS
is VerificationTxState.ShortCodeAccepted,
is VerificationTxState.SendingMac,
is VerificationTxState.MacSent,
- is VerificationTxState.Verifying -> OutgoingSasVerificationTransaction.UxState.WAIT_FOR_VERIFICATION
- is VerificationTxState.Verified -> OutgoingSasVerificationTransaction.UxState.VERIFIED
- is VerificationTxState.Cancelled -> {
+ is VerificationTxState.Verifying -> OutgoingSasVerificationTransaction.UxState.WAIT_FOR_VERIFICATION
+ is VerificationTxState.Verified -> OutgoingSasVerificationTransaction.UxState.VERIFIED
+ is VerificationTxState.Cancelled -> {
if (immutableState.byMe) {
OutgoingSasVerificationTransaction.UxState.CANCELLED_BY_OTHER
} else {
OutgoingSasVerificationTransaction.UxState.CANCELLED_BY_ME
}
}
- else -> OutgoingSasVerificationTransaction.UxState.UNKNOWN
+ else -> OutgoingSasVerificationTransaction.UxState.UNKNOWN
}
}
@@ -224,7 +224,7 @@ internal class DefaultOutgoingSASDefaultVerificationTransaction(
val sasInfo = "MATRIX_KEY_VERIFICATION_SAS|$userId|$deviceId|${getSAS().publicKey}|$otherUserId|$otherDeviceId|$otherKey|$transactionId"
return getSAS().generateShortCode(sasInfo, 6)
}
- else -> {
+ else -> {
// Protocol has been checked earlier
throw IllegalArgumentException()
}
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/verification/DefaultVerificationService.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/verification/DefaultVerificationService.kt
index af48283767..1a04ee0302 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/verification/DefaultVerificationService.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/verification/DefaultVerificationService.kt
@@ -129,31 +129,31 @@ internal class DefaultVerificationService @Inject constructor(
Timber.d("## SAS onToDeviceEvent ${event.getClearType()}")
cryptoCoroutineScope.launch(coroutineDispatchers.dmVerif) {
when (event.getClearType()) {
- EventType.KEY_VERIFICATION_START -> {
+ EventType.KEY_VERIFICATION_START -> {
onStartRequestReceived(event)
}
- EventType.KEY_VERIFICATION_CANCEL -> {
+ EventType.KEY_VERIFICATION_CANCEL -> {
onCancelReceived(event)
}
- EventType.KEY_VERIFICATION_ACCEPT -> {
+ EventType.KEY_VERIFICATION_ACCEPT -> {
onAcceptReceived(event)
}
- EventType.KEY_VERIFICATION_KEY -> {
+ EventType.KEY_VERIFICATION_KEY -> {
onKeyReceived(event)
}
- EventType.KEY_VERIFICATION_MAC -> {
+ EventType.KEY_VERIFICATION_MAC -> {
onMacReceived(event)
}
- EventType.KEY_VERIFICATION_READY -> {
+ EventType.KEY_VERIFICATION_READY -> {
onReadyReceived(event)
}
- EventType.KEY_VERIFICATION_DONE -> {
+ EventType.KEY_VERIFICATION_DONE -> {
onDoneReceived(event)
}
MessageType.MSGTYPE_VERIFICATION_REQUEST -> {
onRequestReceived(event)
}
- else -> {
+ else -> {
// ignore
}
}
@@ -163,7 +163,7 @@ internal class DefaultVerificationService @Inject constructor(
fun onRoomEvent(event: Event) {
cryptoCoroutineScope.launch(coroutineDispatchers.dmVerif) {
when (event.getClearType()) {
- EventType.KEY_VERIFICATION_START -> {
+ EventType.KEY_VERIFICATION_START -> {
onRoomStartRequestReceived(event)
}
EventType.KEY_VERIFICATION_CANCEL -> {
@@ -173,24 +173,24 @@ internal class DefaultVerificationService @Inject constructor(
EventType.KEY_VERIFICATION_ACCEPT -> {
onRoomAcceptReceived(event)
}
- EventType.KEY_VERIFICATION_KEY -> {
+ EventType.KEY_VERIFICATION_KEY -> {
onRoomKeyRequestReceived(event)
}
- EventType.KEY_VERIFICATION_MAC -> {
+ EventType.KEY_VERIFICATION_MAC -> {
onRoomMacReceived(event)
}
- EventType.KEY_VERIFICATION_READY -> {
+ EventType.KEY_VERIFICATION_READY -> {
onRoomReadyReceived(event)
}
- EventType.KEY_VERIFICATION_DONE -> {
+ EventType.KEY_VERIFICATION_DONE -> {
onRoomDoneReceived(event)
}
- EventType.MESSAGE -> {
+ EventType.MESSAGE -> {
if (MessageType.MSGTYPE_VERIFICATION_REQUEST == event.getClearContent().toModel()?.msgType) {
onRoomRequestReceived(event)
}
}
- else -> {
+ else -> {
// ignore
}
}
@@ -472,9 +472,11 @@ internal class DefaultVerificationService @Inject constructor(
/**
* Return a CancelCode to make the caller cancel the verification. Else return null
*/
- private suspend fun handleStart(otherUserId: String?,
- startReq: ValidVerificationInfoStart,
- txConfigure: (DefaultVerificationTransaction) -> Unit): CancelCode? {
+ private suspend fun handleStart(
+ otherUserId: String?,
+ startReq: ValidVerificationInfoStart,
+ txConfigure: (DefaultVerificationTransaction) -> Unit
+ ): CancelCode? {
Timber.d("## SAS onStartRequestReceived $startReq")
if (otherUserId?.let { checkKeysAreDownloaded(it, startReq.fromDevice) } != null) {
val tid = startReq.transactionId
@@ -505,9 +507,9 @@ internal class DefaultVerificationService @Inject constructor(
}
when (startReq) {
- is ValidVerificationInfoStart.SasVerificationInfoStart -> {
+ is ValidVerificationInfoStart.SasVerificationInfoStart -> {
when (existing) {
- is SasVerificationTransaction -> {
+ is SasVerificationTransaction -> {
// should cancel both!
Timber.v("## SAS onStartRequestReceived - Request exist with same id ${startReq.transactionId}")
existing.cancel(CancelCode.UnexpectedMessage)
@@ -517,7 +519,7 @@ internal class DefaultVerificationService @Inject constructor(
is QrCodeVerificationTransaction -> {
// Nothing to do?
}
- null -> {
+ null -> {
getExistingTransactionsForUser(otherUserId)
?.filterIsInstance(SasVerificationTransaction::class.java)
?.takeIf { it.isNotEmpty() }
@@ -589,8 +591,10 @@ internal class DefaultVerificationService @Inject constructor(
}
// TODO Refacto: It could just return a boolean
- private suspend fun checkKeysAreDownloaded(otherUserId: String,
- otherDeviceId: String): MXUsersDevicesMap? {
+ private suspend fun checkKeysAreDownloaded(
+ otherUserId: String,
+ otherDeviceId: String
+ ): MXUsersDevicesMap? {
return try {
var keys = deviceListManager.downloadKeys(listOf(otherUserId), false)
if (keys.getUserDeviceIds(otherUserId)?.contains(otherDeviceId) == true) {
@@ -899,9 +903,11 @@ internal class DefaultVerificationService @Inject constructor(
}
}
- private fun handleReadyReceived(senderId: String,
- readyReq: ValidVerificationInfoReady,
- transportCreator: (DefaultVerificationTransaction) -> VerificationTransport) {
+ private fun handleReadyReceived(
+ senderId: String,
+ readyReq: ValidVerificationInfoReady,
+ transportCreator: (DefaultVerificationTransaction) -> VerificationTransport
+ ) {
val existingRequest = getExistingVerificationRequests(senderId).find { it.transactionId == readyReq.transactionId }
if (existingRequest == null) {
Timber.e("## SAS Received Ready for unknown request txId:${readyReq.transactionId} fromDevice ${readyReq.fromDevice}")
@@ -939,7 +945,7 @@ internal class DefaultVerificationService @Inject constructor(
updatePendingRequest(
existingRequest.copy(
- readyInfo = readyReq
+ readyInfo = readyReq
)
)
@@ -967,12 +973,12 @@ internal class DefaultVerificationService @Inject constructor(
}
return when {
- userId != otherUserId ->
+ userId != otherUserId ->
createQrCodeDataForDistinctUser(requestId, otherUserId)
crossSigningService.isCrossSigningVerified() ->
// This is a self verification and I am the old device (Osborne2)
createQrCodeDataForVerifiedDevice(requestId, otherDeviceId)
- else ->
+ else ->
// This is a self verification and I am the new device (Dynabook)
createQrCodeDataForUnVerifiedDevice(requestId)
}
@@ -1158,10 +1164,12 @@ internal class DefaultVerificationService @Inject constructor(
}
}
- override fun requestKeyVerificationInDMs(methods: List,
- otherUserId: String,
- roomId: String,
- localId: String?): PendingVerificationRequest {
+ override fun requestKeyVerificationInDMs(
+ methods: List,
+ otherUserId: String,
+ roomId: String,
+ localId: String?
+ ): PendingVerificationRequest {
Timber.i("## SAS Requesting verification to user: $otherUserId in room $roomId")
val requestsForUser = pendingRequests.getOrPut(otherUserId) { mutableListOf() }
@@ -1328,11 +1336,13 @@ internal class DefaultVerificationService @Inject constructor(
dispatchRequestUpdated(updated)
}
- override fun beginKeyVerificationInDMs(method: VerificationMethod,
- transactionId: String,
- roomId: String,
- otherUserId: String,
- otherDeviceId: String): String {
+ override fun beginKeyVerificationInDMs(
+ method: VerificationMethod,
+ transactionId: String,
+ roomId: String,
+ otherUserId: String,
+ otherDeviceId: String
+ ): String {
if (method == VerificationMethod.SAS) {
val tx = DefaultOutgoingSASDefaultVerificationTransaction(
setDeviceVerificationAction,
@@ -1357,10 +1367,12 @@ internal class DefaultVerificationService @Inject constructor(
}
}
- override fun readyPendingVerificationInDMs(methods: List,
- otherUserId: String,
- roomId: String,
- transactionId: String): Boolean {
+ override fun readyPendingVerificationInDMs(
+ methods: List,
+ otherUserId: String,
+ roomId: String,
+ transactionId: String
+ ): Boolean {
Timber.v("## SAS readyPendingVerificationInDMs $otherUserId room:$roomId tx:$transactionId")
// Let's find the related request
val existingRequest = getExistingVerificationRequest(otherUserId, transactionId)
@@ -1399,9 +1411,11 @@ internal class DefaultVerificationService @Inject constructor(
}
}
- override fun readyPendingVerification(methods: List,
- otherUserId: String,
- transactionId: String): Boolean {
+ override fun readyPendingVerification(
+ methods: List,
+ otherUserId: String,
+ transactionId: String
+ ): Boolean {
Timber.v("## SAS readyPendingVerification $otherUserId tx:$transactionId")
// Let's find the related request
val existingRequest = getExistingVerificationRequest(otherUserId, transactionId)
@@ -1445,7 +1459,8 @@ internal class DefaultVerificationService @Inject constructor(
otherDeviceId: String,
otherUserMethods: List?,
methods: List,
- transportCreator: (DefaultVerificationTransaction) -> VerificationTransport): List {
+ transportCreator: (DefaultVerificationTransaction) -> VerificationTransport
+ ): List {
if (otherUserMethods.isNullOrEmpty()) {
return emptyList()
}
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/verification/DefaultVerificationTransaction.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/verification/DefaultVerificationTransaction.kt
index 27bc764395..9d19fd137e 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/verification/DefaultVerificationTransaction.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/verification/DefaultVerificationTransaction.kt
@@ -37,7 +37,8 @@ internal abstract class DefaultVerificationTransaction(
override val transactionId: String,
override val otherUserId: String,
override var otherDeviceId: String? = null,
- override val isIncoming: Boolean) : VerificationTransaction {
+ override val isIncoming: Boolean
+) : VerificationTransaction {
lateinit var transport: VerificationTransport
@@ -55,9 +56,12 @@ internal abstract class DefaultVerificationTransaction(
listeners.remove(listener)
}
- protected fun trust(canTrustOtherUserMasterKey: Boolean,
- toVerifyDeviceIds: List,
- eventuallyMarkMyMasterKeyAsTrusted: Boolean, autoDone: Boolean = true) {
+ protected fun trust(
+ canTrustOtherUserMasterKey: Boolean,
+ toVerifyDeviceIds: List,
+ eventuallyMarkMyMasterKeyAsTrusted: Boolean,
+ autoDone: Boolean = true
+ ) {
Timber.d("## Verification: trust ($otherUserId,$otherDeviceId) , verifiedDevices:$toVerifyDeviceIds")
Timber.d("## Verification: trust Mark myMSK trusted $eventuallyMarkMyMasterKeyAsTrusted")
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/verification/SASDefaultVerificationTransaction.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/verification/SASDefaultVerificationTransaction.kt
index 68dd57478e..1cbaff059a 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/verification/SASDefaultVerificationTransaction.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/verification/SASDefaultVerificationTransaction.kt
@@ -314,11 +314,13 @@ internal abstract class SASDefaultVerificationTransaction(
transport.cancelTransaction(transactionId, otherUserId, otherDeviceId ?: "", code)
}
- protected fun sendToOther(type: String,
- keyToDevice: VerificationInfo,
- nextState: VerificationTxState,
- onErrorReason: CancelCode,
- onDone: (() -> Unit)?) {
+ protected fun sendToOther(
+ type: String,
+ keyToDevice: VerificationInfo,
+ nextState: VerificationTxState,
+ onErrorReason: CancelCode,
+ onDone: (() -> Unit)?
+ ) {
transport.sendToOther(type, keyToDevice, nextState, onErrorReason, onDone)
}
@@ -331,11 +333,11 @@ internal abstract class SASDefaultVerificationTransaction(
if (shortCodeBytes!!.size < 5) return null
return getDecimalCodeRepresentation(shortCodeBytes!!)
}
- SasMode.EMOJI -> {
+ SasMode.EMOJI -> {
if (shortCodeBytes!!.size < 6) return null
return getEmojiCodeRepresentation(shortCodeBytes!!).joinToString(" ") { it.emoji }
}
- else -> return null
+ else -> return null
}
}
@@ -360,8 +362,8 @@ internal abstract class SASDefaultVerificationTransaction(
private fun macUsingAgreedMethod(message: String, info: String): String? {
return when (accepted?.messageAuthenticationCode?.lowercase(Locale.ROOT)) {
SAS_MAC_SHA256_LONGKDF -> getSAS().calculateMacLongKdf(message, info)
- SAS_MAC_SHA256 -> getSAS().calculateMac(message, info)
- else -> null
+ SAS_MAC_SHA256 -> getSAS().calculateMac(message, info)
+ else -> null
}
}
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/verification/VerificationEmoji.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/verification/VerificationEmoji.kt
index eb1819fe6a..cff3591771 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/verification/VerificationEmoji.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/verification/VerificationEmoji.kt
@@ -20,69 +20,69 @@ import org.matrix.android.sdk.api.session.crypto.verification.EmojiRepresentatio
internal fun getEmojiForCode(code: Int): EmojiRepresentation {
return when (code % 64) {
- 0 -> EmojiRepresentation("🐶", R.string.verification_emoji_dog, R.drawable.ic_verification_dog)
- 1 -> EmojiRepresentation("🐱", R.string.verification_emoji_cat, R.drawable.ic_verification_cat)
- 2 -> EmojiRepresentation("🦁", R.string.verification_emoji_lion, R.drawable.ic_verification_lion)
- 3 -> EmojiRepresentation("🐎", R.string.verification_emoji_horse, R.drawable.ic_verification_horse)
- 4 -> EmojiRepresentation("🦄", R.string.verification_emoji_unicorn, R.drawable.ic_verification_unicorn)
- 5 -> EmojiRepresentation("🐷", R.string.verification_emoji_pig, R.drawable.ic_verification_pig)
- 6 -> EmojiRepresentation("🐘", R.string.verification_emoji_elephant, R.drawable.ic_verification_elephant)
- 7 -> EmojiRepresentation("🐰", R.string.verification_emoji_rabbit, R.drawable.ic_verification_rabbit)
- 8 -> EmojiRepresentation("🐼", R.string.verification_emoji_panda, R.drawable.ic_verification_panda)
- 9 -> EmojiRepresentation("🐓", R.string.verification_emoji_rooster, R.drawable.ic_verification_rooster)
- 10 -> EmojiRepresentation("🐧", R.string.verification_emoji_penguin, R.drawable.ic_verification_penguin)
- 11 -> EmojiRepresentation("🐢", R.string.verification_emoji_turtle, R.drawable.ic_verification_turtle)
- 12 -> EmojiRepresentation("🐟", R.string.verification_emoji_fish, R.drawable.ic_verification_fish)
- 13 -> EmojiRepresentation("🐙", R.string.verification_emoji_octopus, R.drawable.ic_verification_octopus)
- 14 -> EmojiRepresentation("🦋", R.string.verification_emoji_butterfly, R.drawable.ic_verification_butterfly)
- 15 -> EmojiRepresentation("🌷", R.string.verification_emoji_flower, R.drawable.ic_verification_flower)
- 16 -> EmojiRepresentation("🌳", R.string.verification_emoji_tree, R.drawable.ic_verification_tree)
- 17 -> EmojiRepresentation("🌵", R.string.verification_emoji_cactus, R.drawable.ic_verification_cactus)
- 18 -> EmojiRepresentation("🍄", R.string.verification_emoji_mushroom, R.drawable.ic_verification_mushroom)
- 19 -> EmojiRepresentation("🌏", R.string.verification_emoji_globe, R.drawable.ic_verification_globe)
- 20 -> EmojiRepresentation("🌙", R.string.verification_emoji_moon, R.drawable.ic_verification_moon)
- 21 -> EmojiRepresentation("☁️", R.string.verification_emoji_cloud, R.drawable.ic_verification_cloud)
- 22 -> EmojiRepresentation("🔥", R.string.verification_emoji_fire, R.drawable.ic_verification_fire)
- 23 -> EmojiRepresentation("🍌", R.string.verification_emoji_banana, R.drawable.ic_verification_banana)
- 24 -> EmojiRepresentation("🍎", R.string.verification_emoji_apple, R.drawable.ic_verification_apple)
- 25 -> EmojiRepresentation("🍓", R.string.verification_emoji_strawberry, R.drawable.ic_verification_strawberry)
- 26 -> EmojiRepresentation("🌽", R.string.verification_emoji_corn, R.drawable.ic_verification_corn)
- 27 -> EmojiRepresentation("🍕", R.string.verification_emoji_pizza, R.drawable.ic_verification_pizza)
- 28 -> EmojiRepresentation("🎂", R.string.verification_emoji_cake, R.drawable.ic_verification_cake)
- 29 -> EmojiRepresentation("❤️", R.string.verification_emoji_heart, R.drawable.ic_verification_heart)
- 30 -> EmojiRepresentation("🙂", R.string.verification_emoji_smiley, R.drawable.ic_verification_smiley)
- 31 -> EmojiRepresentation("🤖", R.string.verification_emoji_robot, R.drawable.ic_verification_robot)
- 32 -> EmojiRepresentation("🎩", R.string.verification_emoji_hat, R.drawable.ic_verification_hat)
- 33 -> EmojiRepresentation("👓", R.string.verification_emoji_glasses, R.drawable.ic_verification_glasses)
- 34 -> EmojiRepresentation("🔧", R.string.verification_emoji_spanner, R.drawable.ic_verification_spanner)
- 35 -> EmojiRepresentation("🎅", R.string.verification_emoji_santa, R.drawable.ic_verification_santa)
- 36 -> EmojiRepresentation("👍", R.string.verification_emoji_thumbs_up, R.drawable.ic_verification_thumbs_up)
- 37 -> EmojiRepresentation("☂️", R.string.verification_emoji_umbrella, R.drawable.ic_verification_umbrella)
- 38 -> EmojiRepresentation("⌛", R.string.verification_emoji_hourglass, R.drawable.ic_verification_hourglass)
- 39 -> EmojiRepresentation("⏰", R.string.verification_emoji_clock, R.drawable.ic_verification_clock)
- 40 -> EmojiRepresentation("🎁", R.string.verification_emoji_gift, R.drawable.ic_verification_gift)
- 41 -> EmojiRepresentation("💡", R.string.verification_emoji_light_bulb, R.drawable.ic_verification_light_bulb)
- 42 -> EmojiRepresentation("📕", R.string.verification_emoji_book, R.drawable.ic_verification_book)
- 43 -> EmojiRepresentation("✏️", R.string.verification_emoji_pencil, R.drawable.ic_verification_pencil)
- 44 -> EmojiRepresentation("📎", R.string.verification_emoji_paperclip, R.drawable.ic_verification_paperclip)
- 45 -> EmojiRepresentation("✂️", R.string.verification_emoji_scissors, R.drawable.ic_verification_scissors)
- 46 -> EmojiRepresentation("🔒", R.string.verification_emoji_lock, R.drawable.ic_verification_lock)
- 47 -> EmojiRepresentation("🔑", R.string.verification_emoji_key, R.drawable.ic_verification_key)
- 48 -> EmojiRepresentation("🔨", R.string.verification_emoji_hammer, R.drawable.ic_verification_hammer)
- 49 -> EmojiRepresentation("☎️", R.string.verification_emoji_telephone, R.drawable.ic_verification_phone)
- 50 -> EmojiRepresentation("🏁", R.string.verification_emoji_flag, R.drawable.ic_verification_flag)
- 51 -> EmojiRepresentation("🚂", R.string.verification_emoji_train, R.drawable.ic_verification_train)
- 52 -> EmojiRepresentation("🚲", R.string.verification_emoji_bicycle, R.drawable.ic_verification_bicycle)
- 53 -> EmojiRepresentation("✈️", R.string.verification_emoji_aeroplane, R.drawable.ic_verification_aeroplane)
- 54 -> EmojiRepresentation("🚀", R.string.verification_emoji_rocket, R.drawable.ic_verification_rocket)
- 55 -> EmojiRepresentation("🏆", R.string.verification_emoji_trophy, R.drawable.ic_verification_trophy)
- 56 -> EmojiRepresentation("⚽", R.string.verification_emoji_ball, R.drawable.ic_verification_ball)
- 57 -> EmojiRepresentation("🎸", R.string.verification_emoji_guitar, R.drawable.ic_verification_guitar)
- 58 -> EmojiRepresentation("🎺", R.string.verification_emoji_trumpet, R.drawable.ic_verification_trumpet)
- 59 -> EmojiRepresentation("🔔", R.string.verification_emoji_bell, R.drawable.ic_verification_bell)
- 60 -> EmojiRepresentation("⚓", R.string.verification_emoji_anchor, R.drawable.ic_verification_anchor)
- 61 -> EmojiRepresentation("🎧", R.string.verification_emoji_headphones, R.drawable.ic_verification_headphones)
- 62 -> EmojiRepresentation("📁", R.string.verification_emoji_folder, R.drawable.ic_verification_folder)
+ 0 -> EmojiRepresentation("🐶", R.string.verification_emoji_dog, R.drawable.ic_verification_dog)
+ 1 -> EmojiRepresentation("🐱", R.string.verification_emoji_cat, R.drawable.ic_verification_cat)
+ 2 -> EmojiRepresentation("🦁", R.string.verification_emoji_lion, R.drawable.ic_verification_lion)
+ 3 -> EmojiRepresentation("🐎", R.string.verification_emoji_horse, R.drawable.ic_verification_horse)
+ 4 -> EmojiRepresentation("🦄", R.string.verification_emoji_unicorn, R.drawable.ic_verification_unicorn)
+ 5 -> EmojiRepresentation("🐷", R.string.verification_emoji_pig, R.drawable.ic_verification_pig)
+ 6 -> EmojiRepresentation("🐘", R.string.verification_emoji_elephant, R.drawable.ic_verification_elephant)
+ 7 -> EmojiRepresentation("🐰", R.string.verification_emoji_rabbit, R.drawable.ic_verification_rabbit)
+ 8 -> EmojiRepresentation("🐼", R.string.verification_emoji_panda, R.drawable.ic_verification_panda)
+ 9 -> EmojiRepresentation("🐓", R.string.verification_emoji_rooster, R.drawable.ic_verification_rooster)
+ 10 -> EmojiRepresentation("🐧", R.string.verification_emoji_penguin, R.drawable.ic_verification_penguin)
+ 11 -> EmojiRepresentation("🐢", R.string.verification_emoji_turtle, R.drawable.ic_verification_turtle)
+ 12 -> EmojiRepresentation("🐟", R.string.verification_emoji_fish, R.drawable.ic_verification_fish)
+ 13 -> EmojiRepresentation("🐙", R.string.verification_emoji_octopus, R.drawable.ic_verification_octopus)
+ 14 -> EmojiRepresentation("🦋", R.string.verification_emoji_butterfly, R.drawable.ic_verification_butterfly)
+ 15 -> EmojiRepresentation("🌷", R.string.verification_emoji_flower, R.drawable.ic_verification_flower)
+ 16 -> EmojiRepresentation("🌳", R.string.verification_emoji_tree, R.drawable.ic_verification_tree)
+ 17 -> EmojiRepresentation("🌵", R.string.verification_emoji_cactus, R.drawable.ic_verification_cactus)
+ 18 -> EmojiRepresentation("🍄", R.string.verification_emoji_mushroom, R.drawable.ic_verification_mushroom)
+ 19 -> EmojiRepresentation("🌏", R.string.verification_emoji_globe, R.drawable.ic_verification_globe)
+ 20 -> EmojiRepresentation("🌙", R.string.verification_emoji_moon, R.drawable.ic_verification_moon)
+ 21 -> EmojiRepresentation("☁️", R.string.verification_emoji_cloud, R.drawable.ic_verification_cloud)
+ 22 -> EmojiRepresentation("🔥", R.string.verification_emoji_fire, R.drawable.ic_verification_fire)
+ 23 -> EmojiRepresentation("🍌", R.string.verification_emoji_banana, R.drawable.ic_verification_banana)
+ 24 -> EmojiRepresentation("🍎", R.string.verification_emoji_apple, R.drawable.ic_verification_apple)
+ 25 -> EmojiRepresentation("🍓", R.string.verification_emoji_strawberry, R.drawable.ic_verification_strawberry)
+ 26 -> EmojiRepresentation("🌽", R.string.verification_emoji_corn, R.drawable.ic_verification_corn)
+ 27 -> EmojiRepresentation("🍕", R.string.verification_emoji_pizza, R.drawable.ic_verification_pizza)
+ 28 -> EmojiRepresentation("🎂", R.string.verification_emoji_cake, R.drawable.ic_verification_cake)
+ 29 -> EmojiRepresentation("❤️", R.string.verification_emoji_heart, R.drawable.ic_verification_heart)
+ 30 -> EmojiRepresentation("🙂", R.string.verification_emoji_smiley, R.drawable.ic_verification_smiley)
+ 31 -> EmojiRepresentation("🤖", R.string.verification_emoji_robot, R.drawable.ic_verification_robot)
+ 32 -> EmojiRepresentation("🎩", R.string.verification_emoji_hat, R.drawable.ic_verification_hat)
+ 33 -> EmojiRepresentation("👓", R.string.verification_emoji_glasses, R.drawable.ic_verification_glasses)
+ 34 -> EmojiRepresentation("🔧", R.string.verification_emoji_spanner, R.drawable.ic_verification_spanner)
+ 35 -> EmojiRepresentation("🎅", R.string.verification_emoji_santa, R.drawable.ic_verification_santa)
+ 36 -> EmojiRepresentation("👍", R.string.verification_emoji_thumbs_up, R.drawable.ic_verification_thumbs_up)
+ 37 -> EmojiRepresentation("☂️", R.string.verification_emoji_umbrella, R.drawable.ic_verification_umbrella)
+ 38 -> EmojiRepresentation("⌛", R.string.verification_emoji_hourglass, R.drawable.ic_verification_hourglass)
+ 39 -> EmojiRepresentation("⏰", R.string.verification_emoji_clock, R.drawable.ic_verification_clock)
+ 40 -> EmojiRepresentation("🎁", R.string.verification_emoji_gift, R.drawable.ic_verification_gift)
+ 41 -> EmojiRepresentation("💡", R.string.verification_emoji_light_bulb, R.drawable.ic_verification_light_bulb)
+ 42 -> EmojiRepresentation("📕", R.string.verification_emoji_book, R.drawable.ic_verification_book)
+ 43 -> EmojiRepresentation("✏️", R.string.verification_emoji_pencil, R.drawable.ic_verification_pencil)
+ 44 -> EmojiRepresentation("📎", R.string.verification_emoji_paperclip, R.drawable.ic_verification_paperclip)
+ 45 -> EmojiRepresentation("✂️", R.string.verification_emoji_scissors, R.drawable.ic_verification_scissors)
+ 46 -> EmojiRepresentation("🔒", R.string.verification_emoji_lock, R.drawable.ic_verification_lock)
+ 47 -> EmojiRepresentation("🔑", R.string.verification_emoji_key, R.drawable.ic_verification_key)
+ 48 -> EmojiRepresentation("🔨", R.string.verification_emoji_hammer, R.drawable.ic_verification_hammer)
+ 49 -> EmojiRepresentation("☎️", R.string.verification_emoji_telephone, R.drawable.ic_verification_phone)
+ 50 -> EmojiRepresentation("🏁", R.string.verification_emoji_flag, R.drawable.ic_verification_flag)
+ 51 -> EmojiRepresentation("🚂", R.string.verification_emoji_train, R.drawable.ic_verification_train)
+ 52 -> EmojiRepresentation("🚲", R.string.verification_emoji_bicycle, R.drawable.ic_verification_bicycle)
+ 53 -> EmojiRepresentation("✈️", R.string.verification_emoji_aeroplane, R.drawable.ic_verification_aeroplane)
+ 54 -> EmojiRepresentation("🚀", R.string.verification_emoji_rocket, R.drawable.ic_verification_rocket)
+ 55 -> EmojiRepresentation("🏆", R.string.verification_emoji_trophy, R.drawable.ic_verification_trophy)
+ 56 -> EmojiRepresentation("⚽", R.string.verification_emoji_ball, R.drawable.ic_verification_ball)
+ 57 -> EmojiRepresentation("🎸", R.string.verification_emoji_guitar, R.drawable.ic_verification_guitar)
+ 58 -> EmojiRepresentation("🎺", R.string.verification_emoji_trumpet, R.drawable.ic_verification_trumpet)
+ 59 -> EmojiRepresentation("🔔", R.string.verification_emoji_bell, R.drawable.ic_verification_bell)
+ 60 -> EmojiRepresentation("⚓", R.string.verification_emoji_anchor, R.drawable.ic_verification_anchor)
+ 61 -> EmojiRepresentation("🎧", R.string.verification_emoji_headphones, R.drawable.ic_verification_headphones)
+ 62 -> EmojiRepresentation("📁", R.string.verification_emoji_folder, R.drawable.ic_verification_folder)
/* 63 */ else -> EmojiRepresentation("📌", R.string.verification_emoji_pin, R.drawable.ic_verification_pin)
}
}
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/verification/VerificationInfoAccept.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/verification/VerificationInfoAccept.kt
index 3ddb0ca758..0b9287cb05 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/verification/VerificationInfoAccept.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/verification/VerificationInfoAccept.kt
@@ -63,12 +63,14 @@ internal interface VerificationInfoAccept : VerificationInfo): VerificationInfoAccept
+ fun create(
+ tid: String,
+ keyAgreementProtocol: String,
+ hash: String,
+ commitment: String,
+ messageAuthenticationCode: String,
+ shortAuthenticationStrings: List
+ ): VerificationInfoAccept
}
internal data class ValidVerificationInfoAccept(
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/verification/VerificationInfoStart.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/verification/VerificationInfoStart.kt
index d71bd7359e..66591fe00f 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/verification/VerificationInfoStart.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/verification/VerificationInfoStart.kt
@@ -68,7 +68,7 @@ internal interface VerificationInfoStart : VerificationInfo {
+ VERIFICATION_METHOD_SAS -> {
val validKeyAgreementProtocols = keyAgreementProtocols?.takeIf { it.isNotEmpty() } ?: return null
val validHashes = hashes?.takeIf { it.contains("sha256") } ?: return null
val validMessageAuthenticationCodes = messageAuthenticationCodes
@@ -98,14 +98,15 @@ internal interface VerificationInfoStart : VerificationInfo null
+ else -> null
}
}
}
internal sealed class ValidVerificationInfoStart(
open val transactionId: String,
- open val fromDevice: String) {
+ open val fromDevice: String
+) {
data class SasVerificationInfoStart(
override val transactionId: String,
override val fromDevice: String,
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/verification/VerificationMessageProcessor.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/verification/VerificationMessageProcessor.kt
index 303b6c5839..9f123f0c08 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/verification/VerificationMessageProcessor.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/verification/VerificationMessageProcessor.kt
@@ -131,7 +131,7 @@ internal class VerificationMessageProcessor @Inject constructor(
EventType.KEY_VERIFICATION_DONE -> {
verificationService.onRoomEvent(event)
}
- EventType.MESSAGE -> {
+ EventType.MESSAGE -> {
if (MessageType.MSGTYPE_VERIFICATION_REQUEST == event.getClearContent().toModel()?.msgType) {
verificationService.onRoomRequestReceived(event)
}
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/verification/VerificationTransport.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/verification/VerificationTransport.kt
index 69dec12ef3..5314c23870 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/verification/VerificationTransport.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/verification/VerificationTransport.kt
@@ -28,11 +28,13 @@ internal interface VerificationTransport {
/**
* Sends a message.
*/
- fun sendToOther(type: String,
- verificationInfo: VerificationInfo,
- nextState: VerificationTxState,
- onErrorReason: CancelCode,
- onDone: (() -> Unit)?)
+ fun sendToOther(
+ type: String,
+ verificationInfo: VerificationInfo,
+ nextState: VerificationTxState,
+ onErrorReason: CancelCode,
+ onDone: (() -> Unit)?
+ )
/**
* @param supportedMethods list of supported method by this client
@@ -42,65 +44,85 @@ internal interface VerificationTransport {
* @param toDevices list of device Ids
* @param callback will be called with eventId and ValidVerificationInfoRequest in case of success
*/
- fun sendVerificationRequest(supportedMethods: List,
- localId: String,
- otherUserId: String,
- roomId: String?,
- toDevices: List?,
- callback: (String?, ValidVerificationInfoRequest?) -> Unit)
+ fun sendVerificationRequest(
+ supportedMethods: List,
+ localId: String,
+ otherUserId: String,
+ roomId: String?,
+ toDevices: List?,
+ callback: (String?, ValidVerificationInfoRequest?) -> Unit
+ )
- fun cancelTransaction(transactionId: String,
- otherUserId: String,
- otherUserDeviceId: String?,
- code: CancelCode)
+ fun cancelTransaction(
+ transactionId: String,
+ otherUserId: String,
+ otherUserDeviceId: String?,
+ code: CancelCode
+ )
- fun cancelTransaction(transactionId: String,
- otherUserId: String,
- otherUserDeviceIds: List,
- code: CancelCode)
+ fun cancelTransaction(
+ transactionId: String,
+ otherUserId: String,
+ otherUserDeviceIds: List,
+ code: CancelCode
+ )
- fun done(transactionId: String,
- onDone: (() -> Unit)?)
+ fun done(
+ transactionId: String,
+ onDone: (() -> Unit)?
+ )
/**
* Creates an accept message suitable for this transport.
*/
- fun createAccept(tid: String,
- keyAgreementProtocol: String,
- hash: String,
- commitment: String,
- messageAuthenticationCode: String,
- shortAuthenticationStrings: List): VerificationInfoAccept
+ fun createAccept(
+ tid: String,
+ keyAgreementProtocol: String,
+ hash: String,
+ commitment: String,
+ messageAuthenticationCode: String,
+ shortAuthenticationStrings: List