Compare commits
39 Commits
f0b25f0760
...
039afc3213
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
039afc3213 | ||
|
|
2848bf3f84 | ||
|
|
70d5007e57 | ||
|
|
0965ba5984 | ||
|
|
1347bcf4df | ||
|
|
b57c41709d | ||
|
|
8af12822f8 | ||
|
|
6161d0fca1 | ||
|
|
aad904a01b | ||
|
|
2f9b1386f8 | ||
|
|
82c6ca9602 | ||
|
|
bc5b8a2d4f | ||
|
|
777797fa53 | ||
|
|
de315b7623 | ||
|
|
cf93bb5c3d | ||
|
|
a7f581e01b | ||
|
|
5d53470df3 | ||
|
|
cc819dae0b | ||
|
|
29980d714f | ||
|
|
8900099676 | ||
|
|
49c3d392ad | ||
|
|
817de4cf62 | ||
|
|
b0f8c82e37 | ||
|
|
81920e8179 | ||
|
|
3e8c4c36c6 | ||
|
|
e891b3615d | ||
|
|
96af708145 | ||
|
|
7091eb1724 | ||
|
|
2247f9f97d | ||
|
|
47b44bbd3e | ||
|
|
8a3204f485 | ||
|
|
f962801737 | ||
|
|
364eb68f5f | ||
|
|
93b5e63726 | ||
|
|
846cede0c2 | ||
|
|
842c0b5dd2 | ||
|
|
5bfddff502 | ||
|
|
55830d1d7a | ||
|
|
98492677cc |
@@ -33,6 +33,7 @@ messaging_java_defaults {
|
||||
soong_config_variables: {
|
||||
build_variant_eng: {
|
||||
optimize: {
|
||||
keep_runtime_invisible_annotations: true,
|
||||
proguard_flags_files: [
|
||||
"proguard.flags",
|
||||
"proguard-test.flags",
|
||||
@@ -40,6 +41,7 @@ messaging_java_defaults {
|
||||
},
|
||||
conditions_default: {
|
||||
optimize: {
|
||||
keep_runtime_invisible_annotations: true,
|
||||
proguard_flags_files: [
|
||||
"proguard.flags",
|
||||
"proguard-release.flags",
|
||||
|
||||
1
OWNERS
1
OWNERS
@@ -1,4 +1,3 @@
|
||||
# Default code reviewers picked from top 3 or more developers.
|
||||
# Please update this list if you find better candidates.
|
||||
tomtaylor@google.com
|
||||
rtenneti@google.com
|
||||
|
||||
@@ -15,20 +15,49 @@
|
||||
#
|
||||
# Keep enough data for stack traces
|
||||
-renamesourcefileattribute SourceFile
|
||||
-keepattributes SourceFile,LineNumberTable,*Annotation*
|
||||
-keepattributes SourceFile,
|
||||
LineNumberTable,
|
||||
RuntimeVisibleAnnotations,
|
||||
RuntimeVisibleParameterAnnotations,
|
||||
RuntimeVisibleTypeAnnotations,
|
||||
AnnotationDefault
|
||||
|
||||
-keep class com.android.messaging.* { *; }
|
||||
-keep class com.android.messaging.*.* { *; }
|
||||
-keep class com.android.messaging.*.*.* { *; }
|
||||
|
||||
-keep public class * extends android.app.Activity
|
||||
-keep public class * extends android.app.Application
|
||||
-keep public class * extends android.app.Service
|
||||
-keep public class * extends android.content.BroadcastReceiver
|
||||
-keep public class * extends android.content.ContentProvider
|
||||
-keep public class * extends android.app.backup.BackupAgentHelper
|
||||
-keep public class * extends android.preference.Preference
|
||||
-keep public class * extends androidx.fragment.app.Fragment
|
||||
# TODO(b/373579455): Evaluate if <init> needs to be kept.
|
||||
-keep public class * extends android.app.Activity {
|
||||
void <init>();
|
||||
}
|
||||
# TODO(b/373579455): Evaluate if <init> needs to be kept.
|
||||
-keep public class * extends android.app.Application {
|
||||
void <init>();
|
||||
}
|
||||
# TODO(b/373579455): Evaluate if <init> needs to be kept.
|
||||
-keep public class * extends android.app.Service {
|
||||
void <init>();
|
||||
}
|
||||
# TODO(b/373579455): Evaluate if <init> needs to be kept.
|
||||
-keep public class * extends android.content.BroadcastReceiver {
|
||||
void <init>();
|
||||
}
|
||||
# TODO(b/373579455): Evaluate if <init> needs to be kept.
|
||||
-keep public class * extends android.content.ContentProvider {
|
||||
void <init>();
|
||||
}
|
||||
# TODO(b/373579455): Evaluate if <init> needs to be kept.
|
||||
-keep public class * extends android.app.backup.BackupAgentHelper {
|
||||
void <init>();
|
||||
}
|
||||
# TODO(b/373579455): Evaluate if <init> needs to be kept.
|
||||
-keep public class * extends android.preference.Preference {
|
||||
void <init>();
|
||||
}
|
||||
# TODO(b/373579455): Evaluate if <init> needs to be kept.
|
||||
-keep public class * extends androidx.fragment.app.Fragment {
|
||||
void <init>();
|
||||
}
|
||||
-keep public class com.android.vcard.* { *; }
|
||||
|
||||
-keep class androidx.collection.* { *; }
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright (C) 2015 The Android Open Source Project
|
||||
Copyright (C) 2025 The LineageOS Project
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
@@ -20,8 +21,8 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingTop="16dp"
|
||||
android:paddingLeft="24dp"
|
||||
android:paddingRight="24dp"
|
||||
android:paddingStart="24dp"
|
||||
android:paddingEnd="24dp"
|
||||
android:singleLine="true"
|
||||
android:maxLines="1"
|
||||
android:hint="@string/enter_phone_number_hint"
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright (C) 2015 The Android Open Source Project
|
||||
Copyright (C) 2025 The LineageOS Project
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
@@ -19,7 +20,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:paddingLeft="@dimen/fastscroll_preview_padding"
|
||||
android:paddingRight="@dimen/fastscroll_preview_padding"
|
||||
android:paddingStart="@dimen/fastscroll_preview_padding"
|
||||
android:paddingEnd="@dimen/fastscroll_preview_padding"
|
||||
android:textColor="@color/fastscroll_preview_text_color"
|
||||
android:textSize="@dimen/fastscroll_preview_text_size" />
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright (C) 2015 The Android Open Source Project
|
||||
Copyright (C) 2025 The LineageOS Project
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
@@ -35,8 +36,8 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginLeft="@dimen/list_empty_text_left_right_margin"
|
||||
android:layout_marginRight="@dimen/list_empty_text_left_right_margin"
|
||||
android:layout_marginStart="@dimen/list_empty_text_left_right_margin"
|
||||
android:layout_marginEnd="@dimen/list_empty_text_left_right_margin"
|
||||
android:layout_marginTop="@dimen/list_empty_text_top_margin"
|
||||
style="@style/ListEmptyText"/>
|
||||
</com.android.messaging.ui.ListEmptyView>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright (C) 2015 The Android Open Source Project
|
||||
Copyright (C) 2025 The LineageOS Project
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
@@ -20,8 +21,8 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/settings_list_item_height"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingLeft="16dp"
|
||||
android:paddingRight="16dp"
|
||||
android:paddingStart="16dp"
|
||||
android:paddingEnd="16dp"
|
||||
android:background="?android:attr/selectableItemBackground" >
|
||||
|
||||
<TextView
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright (C) 2015 The Android Open Source Project
|
||||
Copyright (C) 2025 The LineageOS Project
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
@@ -52,8 +53,8 @@
|
||||
<TextView
|
||||
android:id="@+id/snack_bar_action"
|
||||
style="@style/SnackBarText"
|
||||
android:paddingLeft="@dimen/snack_bar_left_right_margin"
|
||||
android:paddingRight="@dimen/snack_bar_left_right_margin"
|
||||
android:paddingStart="@dimen/snack_bar_left_right_margin"
|
||||
android:paddingEnd="@dimen/snack_bar_left_right_margin"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center_vertical"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright (C) 2015 The Android Open Source Project
|
||||
Copyright (C) 2024 The LineageOS Project
|
||||
Copyright (C) 2024-2025 The LineageOS Project
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
@@ -27,8 +27,8 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="48dp"
|
||||
android:orientation="horizontal"
|
||||
android:paddingLeft="10dip"
|
||||
android:paddingRight="10dip"
|
||||
android:paddingStart="10dip"
|
||||
android:paddingEnd="10dip"
|
||||
android:layout_alignParentTop="true">
|
||||
<TextView
|
||||
android:id="@+id/widget_label"
|
||||
@@ -82,8 +82,8 @@
|
||||
android:gravity="center_vertical"
|
||||
android:visibility="gone"
|
||||
android:singleLine="false"
|
||||
android:paddingRight="20dp"
|
||||
android:paddingLeft="20dp"
|
||||
android:paddingEnd="20dp"
|
||||
android:paddingStart="20dp"
|
||||
android:paddingBottom="20dp"
|
||||
android:text="@string/tap_to_configure" />
|
||||
<ImageView
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright (C) 2015 The Android Open Source Project
|
||||
Copyright (C) 2025 The LineageOS Project
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
@@ -26,7 +27,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/widget_header_height"
|
||||
android:orientation="horizontal"
|
||||
android:paddingLeft="8dip"
|
||||
android:paddingStart="8dip"
|
||||
android:background="@drawable/widget_top_background"
|
||||
android:gravity="center_vertical">
|
||||
<TextView
|
||||
@@ -45,7 +46,7 @@
|
||||
android:src="@drawable/ic_add_white"
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
android:contentDescription="@string/widget_new_conversation_content_description"
|
||||
android:paddingRight="8dip"
|
||||
android:paddingEnd="8dip"
|
||||
android:paddingBottom="4dip" />
|
||||
</LinearLayout>
|
||||
<ImageView
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright (C) 2015 The Android Open Source Project
|
||||
Copyright (C) 2024 The LineageOS Project
|
||||
Copyright (C) 2024-2025 The LineageOS Project
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
@@ -21,8 +21,8 @@
|
||||
android:id="@+id/widget_conversation_list_item"
|
||||
android:layout_width="match_parent"
|
||||
style="@style/WidgetConversationListItemStyle"
|
||||
android:paddingLeft="8dip"
|
||||
android:paddingRight="8dip" >
|
||||
android:paddingStart="8dip"
|
||||
android:paddingEnd="8dip" >
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/avatarFrame"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright (C) 2015 The Android Open Source Project
|
||||
Copyright (C) 2024 The LineageOS Project
|
||||
Copyright (C) 2024-2025 The LineageOS Project
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
@@ -22,8 +22,8 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingBottom="8dp"
|
||||
android:paddingLeft="8dip"
|
||||
android:paddingRight="8dip" >
|
||||
android:paddingStart="8dip"
|
||||
android:paddingEnd="8dip" >
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/avatarFrame"
|
||||
@@ -75,8 +75,8 @@
|
||||
android:textAppearance="?android:attr/textAppearanceSmallInverse"
|
||||
android:textSize="16sp"
|
||||
android:paddingTop="6dp"
|
||||
android:paddingLeft="6dp"
|
||||
android:paddingRight="6dp"
|
||||
android:paddingStart="6dp"
|
||||
android:paddingEnd="6dp"
|
||||
android:layout_marginBottom="3dip"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:textColor="@color/widget_incoming_text_color"
|
||||
@@ -84,8 +84,8 @@
|
||||
|
||||
<TextView android:id="@+id/date"
|
||||
style="@style/WidgetConversationItemDate"
|
||||
android:paddingLeft="6dp"
|
||||
android:paddingRight="6dp"
|
||||
android:paddingStart="6dp"
|
||||
android:paddingEnd="6dp"
|
||||
android:layout_marginBottom="9dip"
|
||||
android:textSize="12sp"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright (C) 2015 The Android Open Source Project
|
||||
Copyright (C) 2024 The LineageOS Project
|
||||
Copyright (C) 2024-2025 The LineageOS Project
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
@@ -22,8 +22,8 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingBottom="8dp"
|
||||
android:paddingLeft="8dip"
|
||||
android:paddingRight="8dip" >
|
||||
android:paddingStart="8dip"
|
||||
android:paddingEnd="8dip" >
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/avatarFrame"
|
||||
@@ -75,8 +75,8 @@
|
||||
android:textAppearance="?android:attr/textAppearanceSmallInverse"
|
||||
android:textSize="16sp"
|
||||
android:paddingTop="6dp"
|
||||
android:paddingLeft="6dp"
|
||||
android:paddingRight="6dp"
|
||||
android:paddingStart="6dp"
|
||||
android:paddingEnd="6dp"
|
||||
android:layout_marginBottom="3dip"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:textColor="@color/widget_outgoing_text_color"
|
||||
@@ -84,8 +84,8 @@
|
||||
|
||||
<TextView android:id="@+id/date"
|
||||
style="@style/WidgetConversationItemDate"
|
||||
android:paddingLeft="6dp"
|
||||
android:paddingRight="6dp"
|
||||
android:paddingStart="6dp"
|
||||
android:paddingEnd="6dp"
|
||||
android:layout_marginBottom="9dip"
|
||||
android:textSize="12sp"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
22
res/values-ckb/cm_strings.xml
Normal file
22
res/values-ckb/cm_strings.xml
Normal file
@@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright (C) 2015 The Android Open Source Project
|
||||
|
||||
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.
|
||||
-->
|
||||
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
|
||||
<string name="swipe_to_delete_conversation_pref_title">لادان بۆ سڕینەوە</string>
|
||||
<string name="swipe_to_delete_conversation_pref_summary">لادان بەلای ڕاستا بۆ سڕینەوەی گفتوگۆ</string>
|
||||
<string name="notification_channel_messages_title">پەیامەکان</string>
|
||||
<string name="start_chat">دەستپێکردنی چات</string>
|
||||
</resources>
|
||||
@@ -18,4 +18,5 @@
|
||||
<string name="swipe_to_delete_conversation_pref_title">Odsunutím smazat</string>
|
||||
<string name="swipe_to_delete_conversation_pref_summary">Odsunutím vpravo smazat konverzaci</string>
|
||||
<string name="notification_channel_messages_title">Zprávy</string>
|
||||
<string name="start_chat">Zahájit chat</string>
|
||||
</resources>
|
||||
|
||||
@@ -18,4 +18,5 @@
|
||||
<string name="swipe_to_delete_conversation_pref_title">Usap untuk menghapus</string>
|
||||
<string name="swipe_to_delete_conversation_pref_summary">Usap ke kanan untuk menghapus percakapan</string>
|
||||
<string name="notification_channel_messages_title">Pesan</string>
|
||||
<string name="start_chat">Mulai obrolan</string>
|
||||
</resources>
|
||||
|
||||
@@ -17,4 +17,6 @@
|
||||
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
|
||||
<string name="swipe_to_delete_conversation_pref_title">החלק כדי למחוק</string>
|
||||
<string name="swipe_to_delete_conversation_pref_summary">החלק ימינה כדי למחוק שיחה</string>
|
||||
<string name="notification_channel_messages_title">הודעות</string>
|
||||
<string name="start_chat">התחלת צ\'אט</string>
|
||||
</resources>
|
||||
|
||||
@@ -18,4 +18,5 @@
|
||||
<string name="swipe_to_delete_conversation_pref_title">გადასმით წაშლა</string>
|
||||
<string name="swipe_to_delete_conversation_pref_summary">თითის მარჯვნივ გადასმა, საუბრის წასაშლელად</string>
|
||||
<string name="notification_channel_messages_title">შეტყობინებები</string>
|
||||
<string name="start_chat">მიმოწერის დაწყება</string>
|
||||
</resources>
|
||||
|
||||
@@ -1,252 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright (C) 2015 The Android Open Source Project
|
||||
Copyright (C) 2024-2025 The LineageOS Project
|
||||
|
||||
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.
|
||||
-->
|
||||
<resources>
|
||||
<style name="AttachmentPreviewCloseButtonStyle">
|
||||
<item name="android:gravity">start</item>
|
||||
</style>
|
||||
|
||||
<style name="ComposeMessageViewAttachMediaButtonStyle">
|
||||
<item name="android:paddingStart">@dimen/compose_message_attachment_padding_sides</item>
|
||||
<item name="android:paddingEnd">@dimen/compose_message_attachment_padding_sides</item>
|
||||
<item name="android:background">?android:attr/selectableItemBackgroundBorderless</item>
|
||||
</style>
|
||||
|
||||
<style name="ConversationComposeSendText">
|
||||
<item name="android:textColor">@color/compose_send_text_color</item>
|
||||
<item name="android:singleLine">false</item>
|
||||
<item name="android:textSize">@dimen/conversation_compose_send_text_size</item>
|
||||
<item name="android:gravity">center_vertical</item>
|
||||
<item name="android:fontFamily">sans-serif</item>
|
||||
<item name="android:paddingStart">@dimen/compose_message_text_box_padding_side</item>
|
||||
<item name="android:paddingEnd">@dimen/compose_message_text_box_padding_side</item>
|
||||
<item name="android:minHeight">@dimen/conversation_message_contact_icon_size</item>
|
||||
<item name="android:maxLines">4</item>
|
||||
<item name="android:background">@null</item>
|
||||
<item name="android:scrollHorizontally">false</item>
|
||||
<item name="android:textCursorDrawable">@null</item>
|
||||
<item name="android:inputType">textShortMessage|textAutoCorrect|textCapSentences|textMultiLine</item>
|
||||
</style>
|
||||
|
||||
<style name="ConversationComposeSubjectText" parent="ConversationComposeSendText">
|
||||
<item name="android:paddingStart">18dp</item>
|
||||
<item name="android:gravity">start|center_vertical</item>
|
||||
<item name="android:layout_marginStart">@dimen/compose_message_subject_cancel_left_margin</item>
|
||||
</style>
|
||||
|
||||
<style name="ContactListItemViewStyle">
|
||||
<item name="android:paddingStart">16dp</item>
|
||||
</style>
|
||||
|
||||
<style name="ContactListItemLinearLayoutStyle">
|
||||
<item name="android:paddingStart">12dp</item>
|
||||
<item name="android:paddingEnd">24dp</item>
|
||||
</style>
|
||||
|
||||
<style name="ConversationListItemViewPaddingStyle">
|
||||
<item name="android:paddingStart">@dimen/conversation_list_item_view_padding</item>
|
||||
<item name="android:paddingEnd">@dimen/conversation_list_item_view_padding</item>
|
||||
</style>
|
||||
|
||||
<style name="ConversationListItemViewTextStyle">
|
||||
<item name="android:includeFontPadding">false</item>
|
||||
<item name="android:textSize">14sp</item>
|
||||
<item name="android:background">@null</item>
|
||||
<item name="android:textAlignment">viewStart</item>
|
||||
<item name="android:textColor">@color/conversation_list_details</item>
|
||||
</style>
|
||||
|
||||
<style name="ConversationListItemViewConversationNameStyle" parent="ConversationListItemViewTextStyle">
|
||||
<item name="android:textSize">16sp</item>
|
||||
<item name="android:textColor">@color/conversation_list_name</item>
|
||||
</style>
|
||||
|
||||
<style name="ComposeMessageViewFrameLayoutStyle">
|
||||
<item name="android:paddingEnd">@dimen/compose_message_send_button_padding_right</item>
|
||||
</style>
|
||||
|
||||
<style name="BugleActionBarTitleTextStyle" parent="@style/TextAppearance.AppCompat.Widget.ActionBar.Title">
|
||||
<item name="android:textColor">@color/action_bar_title_text_color</item>
|
||||
<item name="android:textSize">@dimen/action_bar_text_size</item>
|
||||
<item name="android:lines">1</item>
|
||||
<item name="android:textAlignment">viewStart</item>
|
||||
</style>
|
||||
|
||||
<style name="AttachmentPreviewAttachmentStyle">
|
||||
<item name="android:layout_marginStart">10dp</item>
|
||||
</style>
|
||||
|
||||
<style name="AudioAttachmentViewPlayPauseButtonStyle">
|
||||
<item name="android:layout_marginEnd">16dp</item>
|
||||
</style>
|
||||
|
||||
<style name="ComposeMessageViewDraftViewStyle">
|
||||
<item name="android:layout_marginStart">53dp</item>
|
||||
<item name="android:layout_marginEnd">63dp</item>
|
||||
</style>
|
||||
|
||||
<style name="AudioAttachmentTimerText">
|
||||
<item name="android:textSize">@dimen/audio_attachment_text_size</item>
|
||||
<item name="android:textColor">@color/audio_attachment_timer_text_color</item>
|
||||
<item name="android:layout_marginEnd">16dp</item>
|
||||
</style>
|
||||
|
||||
<style name="ConversationMessageText">
|
||||
<item name="android:background">@null</item>
|
||||
<item name="android:textAlignment">viewStart</item>
|
||||
</style>
|
||||
|
||||
<style name="ConversationMessageViewStyle">
|
||||
<item name="android:paddingStart">12dp</item>
|
||||
<item name="android:paddingEnd">12dp</item>
|
||||
</style>
|
||||
|
||||
<style name="SnackBarMessageWrapper">
|
||||
<item name="android:layout_marginStart">@dimen/snack_bar_left_right_margin</item>
|
||||
<item name="android:layout_marginEnd">0dp</item>
|
||||
</style>
|
||||
|
||||
<style name="SubjectViewStyle">
|
||||
<item name="android:paddingStart">@dimen/compose_message_subject_left_padding</item>
|
||||
<item name="android:paddingEnd">@dimen/compose_message_subject_right_padding</item>
|
||||
</style>
|
||||
|
||||
<style name="SmsDeliverdBadge">
|
||||
<item name="android:layout_marginStart">4dp</item>
|
||||
</style>
|
||||
|
||||
<style name="ChipDeleteIconStyle">
|
||||
<item name="android:paddingStart">8dp</item>
|
||||
</style>
|
||||
|
||||
<style name="ChipIconStyle">
|
||||
<item name="android:layout_marginEnd">12dp</item>
|
||||
</style>
|
||||
|
||||
<style name="SimSelectorItem">
|
||||
<item name="android:textSize">@dimen/sim_selector_text_size</item>
|
||||
<item name="android:textColor">@color/sim_selector_text_primary</item>
|
||||
<item name="android:background">@null</item>
|
||||
<item name="android:layout_gravity">end</item>
|
||||
</style>
|
||||
|
||||
<style name="SimSelectorItemDetail">
|
||||
<item name="android:textSize">@dimen/sim_selector_detail_text_size</item>
|
||||
<item name="android:textColor">@color/sim_selector_text_secondary</item>
|
||||
<item name="android:background">@null</item>
|
||||
<item name="android:layout_gravity">end</item>
|
||||
</style>
|
||||
|
||||
<style name="SimSelectorItemLinearLayoutStyle">
|
||||
<item name="android:paddingEnd">12dp</item>
|
||||
</style>
|
||||
|
||||
<style name="MessageSimIndicator">
|
||||
<item name="android:textSize">@dimen/conversation_status_text_size</item>
|
||||
<item name="android:layout_marginStart">4dp</item>
|
||||
</style>
|
||||
|
||||
<style name="ComposeMessageViewMessageBodySizeStyle">
|
||||
<item name="android:textColor">@color/message_body_size_text_color</item>
|
||||
<item name="android:textSize">@dimen/message_body_size_text_size</item>
|
||||
<item name="android:fontFamily">sans-serif</item>
|
||||
<item name="android:layout_gravity">end|center_vertical</item>
|
||||
<item name="android:paddingEnd">@dimen/compose_message_text_box_padding_side</item>
|
||||
</style>
|
||||
|
||||
<style name="MmsIndicatorStyle">
|
||||
<item name="android:textColor">@color/mms_indicator_color</item>
|
||||
<item name="android:textSize">@dimen/mms_indicator_size</item>
|
||||
<item name="android:fontFamily">sans-serif</item>
|
||||
<item name="android:background">@null</item>
|
||||
<item name="android:paddingEnd">@dimen/compose_message_send_button_padding_right</item>
|
||||
<item name="android:paddingTop">@dimen/compose_message_mms_indicator_padding_top</item>
|
||||
<item name="android:layout_gravity">center_horizontal</item>
|
||||
</style>
|
||||
|
||||
<style name="AttachmentGridItemViewCheckBoxStyle">
|
||||
<item name="android:paddingEnd">4dp</item>
|
||||
</style>
|
||||
|
||||
<style name="ParticipantListItem">
|
||||
<item name="android:textSize">@dimen/participant_list_text_size</item>
|
||||
<item name="android:textColor">@color/participant_list_text_primary</item>
|
||||
<item name="android:background">@null</item>
|
||||
<item name="android:layout_gravity">start|center_vertical</item>
|
||||
</style>
|
||||
|
||||
<style name="WidgetConversationItemFailed">
|
||||
<item name="android:layout_gravity">bottom|end</item>
|
||||
</style>
|
||||
|
||||
<style name="WidgetConversationItemIncomingAvatarShadow">
|
||||
<item name="android:layout_marginStart">4dp</item>
|
||||
</style>
|
||||
|
||||
<style name="WidgetConversationItemOutgoingAvatarShadow">
|
||||
<item name="android:layout_marginStart">-4dp</item>
|
||||
</style>
|
||||
|
||||
<style name="WidgetConversationItemDate">
|
||||
<item name="android:layout_marginEnd">8dp</item>
|
||||
<item name="android:layout_marginStart">5dp</item>
|
||||
<item name="android:layout_alignParentStart">true</item>
|
||||
</style>
|
||||
|
||||
<style name="WidgetConversationItemWidget">
|
||||
<item name="android:layout_marginEnd">8dp</item>
|
||||
<item name="android:layout_marginStart">5dp</item>
|
||||
<item name="android:layout_alignParentStart">true</item>
|
||||
</style>
|
||||
|
||||
<style name="WidgetConversationListItemBody">
|
||||
<item name="android:layout_toEndOf">@id/avatarFrame</item>
|
||||
</style>
|
||||
|
||||
<style name="WidgetLoading">
|
||||
<item name="android:layout_marginStart">16dp</item>
|
||||
</style>
|
||||
|
||||
<style name="WidgetConversationItemBodyIncoming">
|
||||
<item name="android:layout_toEndOf">@id/avatarFrame</item>
|
||||
</style>
|
||||
|
||||
<style name="WidgetConversationItemBodyOutgoing">
|
||||
<item name="android:layout_toStartOf">@id/avatarFrame</item>
|
||||
</style>
|
||||
|
||||
<style name="WidgetConversationItemAttachment">
|
||||
<item name="android:layout_gravity">bottom|end</item>
|
||||
</style>
|
||||
|
||||
<style name="WidgetConversationItemAvatarOutgoing">
|
||||
<item name="android:layout_marginEnd">8dp</item>
|
||||
<item name="android:layout_alignParentEnd">true</item>
|
||||
</style>
|
||||
|
||||
<style name="WidgetConversationListItemFrom">
|
||||
<item name="android:layout_marginEnd">5dp</item>
|
||||
<item name="android:layout_alignParentStart">true</item>
|
||||
</style>
|
||||
|
||||
<style name="WidgetConversationListItemDate">
|
||||
<item name="android:layout_marginEnd">8dp</item>
|
||||
<item name="android:layout_marginStart">5dp</item>
|
||||
<item name="android:layout_gravity">start</item>
|
||||
</style>
|
||||
|
||||
</resources>
|
||||
@@ -1,7 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright (C) 2015 The Android Open Source Project
|
||||
Copyright (C) 2025 The LineageOS Project
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
@@ -15,10 +14,9 @@
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
<androidx.fragment.app.FragmentContainerView
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:name="com.android.messaging.ui.conversationlist.ConversationListFragment"
|
||||
android:id="@+id/conversation_list_fragment"
|
||||
android:theme="@style/Theme.MaterialComponents.Light.DarkActionBar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
|
||||
<string name="swipe_to_delete_conversation_pref_title">Sveip for å sletta</string>
|
||||
<string name="swipe_to_delete_conversation_pref_summary">Sveip til høgre for å sletta ein samtale</string>
|
||||
<string name="notification_channel_messages_title">Meldingar</string>
|
||||
<string name="start_chat">Start samtale</string>
|
||||
</resources>
|
||||
22
res/values-sc-rIT/cm_strings.xml
Normal file
22
res/values-sc-rIT/cm_strings.xml
Normal file
@@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright (C) 2015 The Android Open Source Project
|
||||
|
||||
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.
|
||||
-->
|
||||
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
|
||||
<string name="swipe_to_delete_conversation_pref_title">Iscurre pro cantzellare</string>
|
||||
<string name="swipe_to_delete_conversation_pref_summary">Iscurre a dereta pro cantzellare una resonada</string>
|
||||
<string name="notification_channel_messages_title">Messàgios</string>
|
||||
<string name="start_chat">Avia sa tzarrada</string>
|
||||
</resources>
|
||||
@@ -17,4 +17,6 @@
|
||||
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
|
||||
<string name="swipe_to_delete_conversation_pref_title">سۈرۈلسە ئۆچۈرىدۇ</string>
|
||||
<string name="swipe_to_delete_conversation_pref_summary">دىئالوگنى ئۆچۈرۈش ئۈچۈن ئوڭغا سىيرىڭ</string>
|
||||
<string name="notification_channel_messages_title">ئۇچۇر</string>
|
||||
<string name="start_chat">سۆھبەت باشلا</string>
|
||||
</resources>
|
||||
|
||||
@@ -95,6 +95,7 @@
|
||||
<item name="android:textColor">@color/action_bar_title_text_color</item>
|
||||
<item name="android:textSize">@dimen/action_bar_text_size</item>
|
||||
<item name="android:lines">1</item>
|
||||
<item name="android:textAlignment">viewStart</item>
|
||||
</style>
|
||||
|
||||
<style name="ConversationActionBarTitleTextStyle" parent="BugleActionBarTitleTextStyle">
|
||||
@@ -107,6 +108,7 @@
|
||||
|
||||
<style name="ConversationMessageText">
|
||||
<item name="android:background">@null</item>
|
||||
<item name="android:textAlignment">viewStart</item>
|
||||
</style>
|
||||
|
||||
<style name="ConversationMessage" parent="ConversationMessageText">
|
||||
@@ -135,9 +137,9 @@
|
||||
<item name="android:textSize">@dimen/conversation_compose_send_text_size</item>
|
||||
<item name="android:gravity">center_vertical</item>
|
||||
<item name="android:fontFamily">sans-serif</item>
|
||||
<item name="android:paddingLeft">@dimen/compose_message_text_box_padding_side</item>
|
||||
<item name="android:paddingRight">@dimen/compose_message_text_box_padding_side</item>
|
||||
<item name="android:layout_marginRight">8dp</item>
|
||||
<item name="android:paddingStart">@dimen/compose_message_text_box_padding_side</item>
|
||||
<item name="android:paddingEnd">@dimen/compose_message_text_box_padding_side</item>
|
||||
<item name="android:layout_marginEnd">8dp</item>
|
||||
<item name="android:minHeight">@dimen/conversation_message_contact_icon_size</item>
|
||||
<item name="android:maxLines">4</item>
|
||||
<item name="android:background">@null</item>
|
||||
@@ -148,8 +150,9 @@
|
||||
</style>
|
||||
|
||||
<style name="ConversationComposeSubjectText" parent="ConversationComposeSendText">
|
||||
<item name="android:paddingLeft">18dp</item>
|
||||
<item name="android:layout_marginLeft">@dimen/compose_message_subject_cancel_left_margin</item>
|
||||
<item name="android:paddingStart">18dp</item>
|
||||
<item name="android:gravity">start|center_vertical</item>
|
||||
<item name="android:layout_marginStart">@dimen/compose_message_subject_cancel_left_margin</item>
|
||||
</style>
|
||||
|
||||
<style name="ContactListItem">
|
||||
@@ -173,8 +176,8 @@
|
||||
<item name="android:textColor">@color/compose_contact_text</item>
|
||||
<item name="android:textColorHint">@color/compose_contact_faint_text</item>
|
||||
<item name="android:fontFamily">sans-serif</item>
|
||||
<item name="android:paddingLeft">4dp</item>
|
||||
<item name="android:paddingRight">4dp</item>
|
||||
<item name="android:paddingStart">4dp</item>
|
||||
<item name="android:paddingEnd">4dp</item>
|
||||
</style>
|
||||
|
||||
<style name="PagerTabHeader">
|
||||
@@ -208,7 +211,7 @@
|
||||
<style name="AudioAttachmentTimerText">
|
||||
<item name="android:textSize">@dimen/audio_attachment_text_size</item>
|
||||
<item name="android:textColor">@color/audio_attachment_timer_text_color</item>
|
||||
<item name="android:layout_marginRight">16dp</item>
|
||||
<item name="android:layout_marginEnd">16dp</item>
|
||||
</style>
|
||||
|
||||
<style name="AudioAttachmentViewStyle">
|
||||
@@ -247,35 +250,35 @@
|
||||
<item name="android:textColor">@color/notification_subject_color</item>
|
||||
</style>
|
||||
|
||||
<!-- Styles to support RTL for pre API 17 -->
|
||||
<style name="AttachmentPreviewCloseButtonStyle">
|
||||
<item name="android:gravity">left</item>
|
||||
<item name="android:gravity">start</item>
|
||||
</style>
|
||||
|
||||
<style name="ComposeMessageViewAttachMediaButtonStyle">
|
||||
<item name="android:paddingLeft">@dimen/compose_message_attachment_padding_sides</item>
|
||||
<item name="android:paddingRight">@dimen/compose_message_attachment_padding_sides</item>
|
||||
<item name="android:paddingStart">@dimen/compose_message_attachment_padding_sides</item>
|
||||
<item name="android:paddingEnd">@dimen/compose_message_attachment_padding_sides</item>
|
||||
<item name="android:background">?android:attr/selectableItemBackgroundBorderless</item>
|
||||
</style>
|
||||
|
||||
<style name="ContactListItemViewStyle">
|
||||
<item name="android:paddingLeft">16dp</item>
|
||||
<item name="android:paddingStart">16dp</item>
|
||||
</style>
|
||||
|
||||
<style name="ContactListItemLinearLayoutStyle">
|
||||
<item name="android:paddingLeft">12dp</item>
|
||||
<item name="android:paddingRight">24dp</item>
|
||||
<item name="android:paddingStart">12dp</item>
|
||||
<item name="android:paddingEnd">24dp</item>
|
||||
</style>
|
||||
|
||||
<style name="ConversationListItemViewPaddingStyle">
|
||||
<item name="android:paddingLeft">@dimen/conversation_list_item_view_padding</item>
|
||||
<item name="android:paddingRight">@dimen/conversation_list_item_view_padding</item>
|
||||
<item name="android:paddingStart">@dimen/conversation_list_item_view_padding</item>
|
||||
<item name="android:paddingEnd">@dimen/conversation_list_item_view_padding</item>
|
||||
</style>
|
||||
|
||||
<style name="ConversationListItemViewTextStyle">
|
||||
<item name="android:includeFontPadding">false</item>
|
||||
<item name="android:textSize">14sp</item>
|
||||
<item name="android:background">@null</item>
|
||||
<item name="android:textAlignment">viewStart</item>
|
||||
<item name="android:textColor">@color/conversation_list_details</item>
|
||||
</style>
|
||||
|
||||
@@ -285,37 +288,37 @@
|
||||
</style>
|
||||
|
||||
<style name="ComposeMessageViewFrameLayoutStyle">
|
||||
<item name="android:paddingRight">@dimen/compose_message_send_button_padding_right</item>
|
||||
<item name="android:paddingEnd">@dimen/compose_message_send_button_padding_right</item>
|
||||
</style>
|
||||
|
||||
<style name="AttachmentPreviewAttachmentStyle">
|
||||
<item name="android:layout_marginLeft">10dp</item>
|
||||
<item name="android:layout_marginStart">10dp</item>
|
||||
</style>
|
||||
|
||||
<style name="AudioAttachmentViewPlayPauseButtonStyle">
|
||||
<item name="android:layout_marginRight">16dp</item>
|
||||
<item name="android:layout_marginEnd">16dp</item>
|
||||
</style>
|
||||
|
||||
<style name="ComposeMessageViewDraftViewStyle">
|
||||
<item name="android:layout_marginLeft">53dp</item>
|
||||
<item name="android:layout_marginRight">63dp</item>
|
||||
<item name="android:layout_marginStart">53dp</item>
|
||||
<item name="android:layout_marginEnd">63dp</item>
|
||||
</style>
|
||||
|
||||
<style name="ConversationMessageViewStyle">
|
||||
<item name="android:paddingLeft">12dp</item>
|
||||
<item name="android:paddingRight">12dp</item>
|
||||
<item name="android:paddingStart">12dp</item>
|
||||
<item name="android:paddingEnd">12dp</item>
|
||||
</style>
|
||||
|
||||
<style name="SubjectViewStyle">
|
||||
<item name="android:paddingLeft">@dimen/compose_message_subject_left_padding</item>
|
||||
<item name="android:paddingRight">@dimen/compose_message_subject_right_padding</item>
|
||||
<item name="android:paddingStart">@dimen/compose_message_subject_left_padding</item>
|
||||
<item name="android:paddingEnd">@dimen/compose_message_subject_right_padding</item>
|
||||
</style>
|
||||
|
||||
<style name="ParticipantListItem">
|
||||
<item name="android:textSize">@dimen/participant_list_text_size</item>
|
||||
<item name="android:textColor">@color/participant_list_text_primary</item>
|
||||
<item name="android:background">@null</item>
|
||||
<item name="android:layout_gravity">left|center_vertical</item>
|
||||
<item name="android:layout_gravity">start|center_vertical</item>
|
||||
</style>
|
||||
|
||||
<style name="AddContactConfirmationTextStyle">
|
||||
@@ -351,8 +354,8 @@
|
||||
<item name="android:textColor">@color/message_body_size_text_color</item>
|
||||
<item name="android:textSize">@dimen/message_body_size_text_size</item>
|
||||
<item name="android:fontFamily">sans-serif</item>
|
||||
<item name="android:layout_gravity">right|center_vertical</item>
|
||||
<item name="android:paddingRight">@dimen/compose_message_text_box_padding_side</item>
|
||||
<item name="android:layout_gravity">end|center_vertical</item>
|
||||
<item name="android:paddingEnd">@dimen/compose_message_text_box_padding_side</item>
|
||||
</style>
|
||||
|
||||
<style name="MmsIndicatorStyle">
|
||||
@@ -360,7 +363,7 @@
|
||||
<item name="android:textSize">@dimen/mms_indicator_size</item>
|
||||
<item name="android:fontFamily">sans-serif</item>
|
||||
<item name="android:background">@null</item>
|
||||
<item name="android:paddingRight">@dimen/compose_message_send_button_padding_right</item>
|
||||
<item name="android:paddingEnd">@dimen/compose_message_send_button_padding_right</item>
|
||||
<item name="android:paddingTop">@dimen/compose_message_mms_indicator_padding_top</item>
|
||||
<item name="android:layout_gravity">center_horizontal</item>
|
||||
</style>
|
||||
@@ -371,8 +374,8 @@
|
||||
</style>
|
||||
|
||||
<style name="SnackBarMessageWrapper">
|
||||
<item name="android:layout_marginLeft">@dimen/snack_bar_left_right_margin</item>
|
||||
<item name="android:layout_marginRight">0dp</item>
|
||||
<item name="android:layout_marginStart">@dimen/snack_bar_left_right_margin</item>
|
||||
<item name="android:layout_marginEnd">0dp</item>
|
||||
</style>
|
||||
|
||||
<style name="SnackBarText">
|
||||
@@ -382,38 +385,38 @@
|
||||
</style>
|
||||
|
||||
<style name="SmsDeliverdBadge">
|
||||
<item name="android:layout_marginLeft">4dp</item>
|
||||
<item name="android:layout_marginStart">4dp</item>
|
||||
</style>
|
||||
|
||||
<style name="ChipDeleteIconStyle">
|
||||
<item name="android:paddingLeft">8dp</item>
|
||||
<item name="android:paddingStart">8dp</item>
|
||||
</style>
|
||||
|
||||
<style name="ChipIconStyle">
|
||||
<item name="android:layout_marginRight">12dp</item>
|
||||
<item name="android:layout_marginEnd">12dp</item>
|
||||
</style>
|
||||
|
||||
<style name="SimSelectorItem">
|
||||
<item name="android:textSize">@dimen/sim_selector_text_size</item>
|
||||
<item name="android:textColor">@color/sim_selector_text_primary</item>
|
||||
<item name="android:background">@null</item>
|
||||
<item name="android:layout_gravity">right</item>
|
||||
<item name="android:layout_gravity">end</item>
|
||||
</style>
|
||||
|
||||
<style name="SimSelectorItemDetail">
|
||||
<item name="android:textSize">@dimen/sim_selector_detail_text_size</item>
|
||||
<item name="android:textColor">@color/sim_selector_text_secondary</item>
|
||||
<item name="android:background">@null</item>
|
||||
<item name="android:layout_gravity">right</item>
|
||||
<item name="android:layout_gravity">end</item>
|
||||
</style>
|
||||
|
||||
<style name="SimSelectorItemLinearLayoutStyle">
|
||||
<item name="android:paddingRight">12dp</item>
|
||||
<item name="android:paddingEnd">12dp</item>
|
||||
</style>
|
||||
|
||||
<style name="MessageSimIndicator">
|
||||
<item name="android:textSize">@dimen/conversation_status_text_size</item>
|
||||
<item name="android:layout_marginLeft">4dp</item>
|
||||
<item name="android:layout_marginStart">4dp</item>
|
||||
</style>
|
||||
|
||||
<style name="ColorAccentBlueOverrideStyle">
|
||||
@@ -442,8 +445,8 @@
|
||||
<item name="android:layout_marginLeft">20dp</item>
|
||||
<item name="android:layout_marginRight">20dp</item>
|
||||
<item name="android:layout_marginTop">16dp</item>
|
||||
<item name="android:paddingLeft">10dp</item>
|
||||
<item name="android:paddingRight">10dp</item>
|
||||
<item name="android:paddingStart">10dp</item>
|
||||
<item name="android:paddingEnd">10dp</item>
|
||||
<item name="android:background">?android:attr/selectableItemBackground</item>
|
||||
</style>
|
||||
|
||||
@@ -480,63 +483,63 @@
|
||||
</style>
|
||||
|
||||
<style name="WidgetConversationItemAvatarOutgoing">
|
||||
<item name="android:layout_marginRight">8dp</item>
|
||||
<item name="android:layout_alignParentRight">true</item>
|
||||
<item name="android:layout_marginEnd">8dp</item>
|
||||
<item name="android:layout_alignParentEnd">true</item>
|
||||
</style>
|
||||
|
||||
<style name="WidgetConversationItemBodyIncoming">
|
||||
<item name="android:layout_toRightOf">@id/avatarFrame</item>
|
||||
<item name="android:layout_toEndOf">@id/avatarFrame</item>
|
||||
</style>
|
||||
|
||||
<style name="WidgetConversationItemBodyOutgoing">
|
||||
<item name="android:layout_toLeftOf">@id/avatarFrame</item>
|
||||
<item name="android:layout_toStartOf">@id/avatarFrame</item>
|
||||
</style>
|
||||
|
||||
<style name="WidgetConversationItemIncomingAvatarShadow">
|
||||
<item name="android:layout_marginLeft">4dp</item>
|
||||
<item name="android:layout_marginStart">4dp</item>
|
||||
</style>
|
||||
|
||||
<style name="WidgetConversationItemOutgoingAvatarShadow">
|
||||
<item name="android:layout_marginLeft">-4dp</item>
|
||||
<item name="android:layout_marginStart">-4dp</item>
|
||||
</style>
|
||||
|
||||
<style name="WidgetConversationItemDate">
|
||||
<item name="android:layout_marginRight">8dp</item>
|
||||
<item name="android:layout_marginLeft">5dp</item>
|
||||
<item name="android:layout_alignParentLeft">true</item>
|
||||
<item name="android:layout_marginEnd">8dp</item>
|
||||
<item name="android:layout_marginStart">5dp</item>
|
||||
<item name="android:layout_alignParentStart">true</item>
|
||||
</style>
|
||||
|
||||
<style name="WidgetConversationItemFailed">
|
||||
<item name="android:layout_gravity">bottom|right</item>
|
||||
<item name="android:layout_gravity">bottom|end</item>
|
||||
</style>
|
||||
|
||||
<style name="WidgetConversationItemAttachment">
|
||||
<item name="android:layout_gravity">bottom|right</item>
|
||||
<item name="android:layout_gravity">bottom|end</item>
|
||||
</style>
|
||||
|
||||
<style name="WidgetConversationItemWidget">
|
||||
<item name="android:layout_marginRight">8dp</item>
|
||||
<item name="android:layout_marginLeft">5dp</item>
|
||||
<item name="android:layout_alignParentLeft">true</item>
|
||||
<item name="android:layout_marginEnd">8dp</item>
|
||||
<item name="android:layout_marginStart">5dp</item>
|
||||
<item name="android:layout_alignParentStart">true</item>
|
||||
</style>
|
||||
|
||||
<style name="WidgetConversationListItemBody">
|
||||
<item name="android:layout_toRightOf">@id/avatarFrame</item>
|
||||
<item name="android:layout_toEndOf">@id/avatarFrame</item>
|
||||
</style>
|
||||
|
||||
<style name="WidgetConversationListItemFrom">
|
||||
<item name="android:layout_marginRight">5dp</item>
|
||||
<item name="android:layout_alignParentLeft">true</item>
|
||||
<item name="android:layout_marginEnd">5dp</item>
|
||||
<item name="android:layout_alignParentStart">true</item>
|
||||
</style>
|
||||
|
||||
<style name="WidgetConversationListItemDate">
|
||||
<item name="android:layout_marginRight">8dp</item>
|
||||
<item name="android:layout_marginLeft">5dp</item>
|
||||
<item name="android:layout_gravity">right</item>
|
||||
<item name="android:layout_marginEnd">8dp</item>
|
||||
<item name="android:layout_marginStart">5dp</item>
|
||||
<item name="android:layout_gravity">end</item>
|
||||
</style>
|
||||
|
||||
<style name="WidgetLoading">
|
||||
<item name="android:layout_marginLeft">16dp</item>
|
||||
<item name="android:layout_marginStart">16dp</item>
|
||||
</style>
|
||||
|
||||
<style name="WidgetConversationListItemStyle">
|
||||
@@ -549,8 +552,8 @@
|
||||
</style>
|
||||
|
||||
<style name="PromoScreenTextStyle">
|
||||
<item name="android:paddingLeft">40dp</item>
|
||||
<item name="android:paddingRight">40dp</item>
|
||||
<item name="android:paddingStart">40dp</item>
|
||||
<item name="android:paddingEnd">40dp</item>
|
||||
<item name="android:textSize">16sp</item>
|
||||
<item name="android:textColor">@android:color/white</item>
|
||||
<item name="android:fontFamily">roboto-regular</item>
|
||||
@@ -568,9 +571,7 @@
|
||||
<item name="android:gravity">center</item>
|
||||
</style>
|
||||
<style name="DirectoryHeaderStyle">
|
||||
<item name="android:paddingLeft">@dimen/directory_header_padding_start</item>
|
||||
<item name="android:paddingStart">@dimen/directory_header_padding_start</item>
|
||||
<item name="android:paddingRight">@dimen/directory_header_padding_end</item>
|
||||
<item name="android:paddingEnd">@dimen/directory_header_padding_end</item>
|
||||
<item name="android:paddingTop">@dimen/directory_header_padding_top</item>
|
||||
<item name="android:paddingBottom">@dimen/directory_header_padding_bottom</item>
|
||||
|
||||
3284
res/xml/apns.xml
3284
res/xml/apns.xml
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Copyright (C) 2015 The Android Open Source Project
|
||||
* Copyright (C) 2024 The LineageOS Project
|
||||
* Copyright (C) 2024-2025 The LineageOS Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -18,8 +18,6 @@
|
||||
package android.support.v7.mms;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.Resources;
|
||||
import android.content.res.XmlResourceParser;
|
||||
import android.database.Cursor;
|
||||
import android.database.sqlite.SQLiteException;
|
||||
import android.net.Uri;
|
||||
@@ -28,8 +26,6 @@ import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.util.SparseArray;
|
||||
|
||||
import com.android.messaging.R;
|
||||
|
||||
import java.net.URI;
|
||||
import java.net.URISyntaxException;
|
||||
import java.util.ArrayList;
|
||||
@@ -112,95 +108,6 @@ class DefaultApnSettingsLoader implements ApnSettingsLoader {
|
||||
public void setSuccess() {
|
||||
// Do nothing
|
||||
}
|
||||
|
||||
public boolean equals(final BaseApn other) {
|
||||
return TextUtils.equals(mMmsc, other.getMmsc()) &&
|
||||
TextUtils.equals(mMmsProxy, other.getMmsProxy()) &&
|
||||
mMmsProxyPort == other.getMmsProxyPort();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* An in-memory implementation of an APN. These APNs are organized into an in-memory list.
|
||||
* The order of the list can be changed by the setSuccess method.
|
||||
*/
|
||||
private static class MemoryApn implements Apn {
|
||||
/**
|
||||
* Create an in-memory APN loaded from resources
|
||||
*
|
||||
* @param apns the in-memory APN list
|
||||
* @param typesIn the APN type field
|
||||
* @param mmscIn the APN mmsc field
|
||||
* @param proxyIn the APN mmsproxy field
|
||||
* @param portIn the APN mmsport field
|
||||
* @return an in-memory APN instance, null if there is invalid parameter
|
||||
*/
|
||||
public static MemoryApn from(final List<Apn> apns, final String typesIn,
|
||||
final String mmscIn, final String proxyIn, final String portIn) {
|
||||
if (apns == null) {
|
||||
return null;
|
||||
}
|
||||
final BaseApn base = BaseApn.from(typesIn, mmscIn, proxyIn, portIn);
|
||||
if (base == null) {
|
||||
return null;
|
||||
}
|
||||
for (final Apn apn : apns) {
|
||||
if (apn instanceof MemoryApn && ((MemoryApn) apn).equals(base)) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
return new MemoryApn(apns, base);
|
||||
}
|
||||
|
||||
private final List<Apn> mApns;
|
||||
private final BaseApn mBase;
|
||||
|
||||
public MemoryApn(final List<Apn> apns, final BaseApn base) {
|
||||
mApns = apns;
|
||||
mBase = base;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMmsc() {
|
||||
return mBase.getMmsc();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMmsProxy() {
|
||||
return mBase.getMmsProxy();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMmsProxyPort() {
|
||||
return mBase.getMmsProxyPort();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSuccess() {
|
||||
// If this is being marked as a successful APN, move it to the top of the list so
|
||||
// next time it will be tried first
|
||||
boolean moved = false;
|
||||
synchronized (mApns) {
|
||||
if (mApns.get(0) != this) {
|
||||
mApns.remove(this);
|
||||
mApns.add(0, this);
|
||||
moved = true;
|
||||
}
|
||||
}
|
||||
if (moved) {
|
||||
Log.d(MmsService.TAG, "Set APN ["
|
||||
+ "MMSC=" + getMmsc() + ", "
|
||||
+ "PROXY=" + getMmsProxy() + ", "
|
||||
+ "PORT=" + getMmsProxyPort() + "] to be first");
|
||||
}
|
||||
}
|
||||
|
||||
public boolean equals(final BaseApn other) {
|
||||
if (other == null) {
|
||||
return false;
|
||||
}
|
||||
return mBase.equals(other);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -222,14 +129,6 @@ class DefaultApnSettingsLoader implements ApnSettingsLoader {
|
||||
private static final int COLUMN_MMSPROXY = 2;
|
||||
private static final int COLUMN_MMSPORT = 3;
|
||||
|
||||
private static final String APN_MCC = "mcc";
|
||||
private static final String APN_MNC = "mnc";
|
||||
private static final String APN_APN = "apn";
|
||||
private static final String APN_TYPE = "type";
|
||||
private static final String APN_MMSC = "mmsc";
|
||||
private static final String APN_MMSPROXY = "mmsproxy";
|
||||
private static final String APN_MMSPORT = "mmsport";
|
||||
|
||||
private final Context mContext;
|
||||
|
||||
// Cached APNs for subIds
|
||||
@@ -263,16 +162,6 @@ class DefaultApnSettingsLoader implements ApnSettingsLoader {
|
||||
private void loadLocked(final int subId, final String apnName, final List<Apn> apns) {
|
||||
// Try system APN table first
|
||||
loadFromSystem(subId, apnName, apns);
|
||||
if (apns.size() > 0) {
|
||||
return;
|
||||
}
|
||||
// Try loading from apns.xml in resources
|
||||
loadFromResources(subId, apnName, apns);
|
||||
if (apns.size() > 0) {
|
||||
return;
|
||||
}
|
||||
// Try resources but without APN name
|
||||
loadFromResources(subId, null/*apnName*/, apns);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -384,48 +273,6 @@ class DefaultApnSettingsLoader implements ApnSettingsLoader {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Find matching APNs using builtin APN list resource
|
||||
*
|
||||
* @param subId the SIM subId
|
||||
* @param apnName the APN name to match
|
||||
* @param apns the list for returning results
|
||||
*/
|
||||
private void loadFromResources(final int subId, final String apnName, final List<Apn> apns) {
|
||||
Log.i(MmsService.TAG, "Loading APNs from resources, apnName=" + apnName);
|
||||
final int[] mccMnc = Utils.getMccMnc(mContext, subId);
|
||||
if (mccMnc[0] == 0) {
|
||||
Log.w(MmsService.TAG, "Can not get valid mcc/mnc from system");
|
||||
return;
|
||||
}
|
||||
// MCC/MNC is good, loading/querying APNs from XML
|
||||
try (XmlResourceParser xml = mContext.getResources().getXml(R.xml.apns)) {
|
||||
new ApnsXmlParser(xml, apnValues -> {
|
||||
final String mcc = trimWithNullCheck(apnValues.getAsString(APN_MCC));
|
||||
final String mnc = trimWithNullCheck(apnValues.getAsString(APN_MNC));
|
||||
final String apn = trimWithNullCheck(apnValues.getAsString(APN_APN));
|
||||
try {
|
||||
if (mccMnc[0] == Integer.parseInt(mcc) &&
|
||||
mccMnc[1] == Integer.parseInt(mnc) &&
|
||||
(TextUtils.isEmpty(apnName) || apnName.equalsIgnoreCase(apn))) {
|
||||
final String type = apnValues.getAsString(APN_TYPE);
|
||||
final String mmsc = apnValues.getAsString(APN_MMSC);
|
||||
final String mmsproxy = apnValues.getAsString(APN_MMSPROXY);
|
||||
final String mmsport = apnValues.getAsString(APN_MMSPORT);
|
||||
final Apn newApn = MemoryApn.from(apns, type, mmsc, mmsproxy, mmsport);
|
||||
if (newApn != null) {
|
||||
apns.add(newApn);
|
||||
}
|
||||
}
|
||||
} catch (final NumberFormatException e) {
|
||||
// Ignore
|
||||
}
|
||||
}).parse();
|
||||
} catch (final Resources.NotFoundException e) {
|
||||
Log.w(MmsService.TAG, "Can not get apns.xml " + e);
|
||||
}
|
||||
}
|
||||
|
||||
private static String trimWithNullCheck(final String value) {
|
||||
return value != null ? value.trim() : null;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Copyright (C) 2015 The Android Open Source Project
|
||||
* Copyright (C) 2024 The LineageOS Project
|
||||
* Copyright (C) 2024-2025 The LineageOS Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -24,7 +24,6 @@ import android.content.Intent;
|
||||
import android.content.IntentFilter;
|
||||
import android.content.res.Configuration;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.support.v7.mms.CarrierConfigValuesLoader;
|
||||
import android.support.v7.mms.MmsManager;
|
||||
import android.telephony.CarrierConfigManager;
|
||||
@@ -33,18 +32,15 @@ import androidx.annotation.NonNull;
|
||||
|
||||
import com.android.messaging.datamodel.DataModel;
|
||||
import com.android.messaging.receiver.SmsReceiver;
|
||||
import com.android.messaging.sms.ApnDatabase;
|
||||
import com.android.messaging.sms.BugleApnSettingsLoader;
|
||||
import com.android.messaging.sms.BugleUserAgentInfoLoader;
|
||||
import com.android.messaging.sms.MmsConfig;
|
||||
import com.android.messaging.ui.ConversationDrawables;
|
||||
import com.android.messaging.util.BuglePrefsKeys;
|
||||
import com.android.messaging.util.DebugUtils;
|
||||
import com.android.messaging.util.LogUtil;
|
||||
import com.android.messaging.util.PhoneUtils;
|
||||
import com.android.messaging.util.Trace;
|
||||
|
||||
import java.io.File;
|
||||
import java.lang.Thread.UncaughtExceptionHandler;
|
||||
|
||||
/**
|
||||
@@ -84,14 +80,10 @@ public class BugleApplication extends Application implements UncaughtExceptionHa
|
||||
final CarrierConfigValuesLoader carrierConfigValuesLoader =
|
||||
factory.getCarrierConfigValuesLoader();
|
||||
|
||||
maybeStartProfiling();
|
||||
|
||||
BugleApplication.updateAppConfig(context);
|
||||
|
||||
// Initialize MMS lib
|
||||
initMmsLib(context, carrierConfigValuesLoader);
|
||||
// Initialize APN database
|
||||
ApnDatabase.initializeAppContext(context);
|
||||
// Fixup messages in flight if we crashed and send any pending
|
||||
dataModel.onApplicationCreated();
|
||||
// Register carrier config change receiver
|
||||
@@ -155,27 +147,6 @@ public class BugleApplication extends Application implements UncaughtExceptionHa
|
||||
}
|
||||
}
|
||||
|
||||
private void maybeStartProfiling() {
|
||||
// App startup profiling support. To use it:
|
||||
// adb shell setprop log.tag.BugleProfile DEBUG
|
||||
// # Start the app, wait for a 30s, download trace file:
|
||||
// adb pull /data/data/com.android.messaging/cache/startup.trace /tmp
|
||||
// # Open trace file (using adt/tools/traceview)
|
||||
if (android.util.Log.isLoggable(LogUtil.PROFILE_TAG, android.util.Log.DEBUG)) {
|
||||
// Start method tracing with a big enough buffer and let it run for 30s.
|
||||
// Note we use a logging tag as we don't want to wait for gservices to start up.
|
||||
final File file = DebugUtils.getDebugFile("startup.trace", true);
|
||||
android.os.Debug.startMethodTracing(file.getAbsolutePath(), 160 * 1024 * 1024);
|
||||
new Handler(Looper.getMainLooper()).postDelayed(() -> {
|
||||
android.os.Debug.stopMethodTracing();
|
||||
// Allow world to see trace file
|
||||
DebugUtils.ensureReadable(file);
|
||||
LogUtil.d(LogUtil.PROFILE_TAG, "Tracing complete - "
|
||||
+ file.getAbsolutePath());
|
||||
}, 30000);
|
||||
}
|
||||
}
|
||||
|
||||
private void maybeHandleSharedPrefsUpgrade(final Factory factory) {
|
||||
final int existingVersion = factory.getApplicationPrefs().getInt(
|
||||
BuglePrefsKeys.SHARED_PREFERENCES_VERSION,
|
||||
|
||||
@@ -66,6 +66,4 @@ public abstract class Factory {
|
||||
public abstract BugleCarrierConfigValuesLoader getCarrierConfigValuesLoader();
|
||||
// Note this needs to run from any thread
|
||||
public abstract void reclaimMemory();
|
||||
|
||||
public abstract void onActivityResume();
|
||||
}
|
||||
|
||||
@@ -199,10 +199,6 @@ class FactoryImpl extends Factory {
|
||||
mMemoryCacheManager.reclaimMemory();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivityResume() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public MediaUtil getMediaUtil() {
|
||||
return mMediaUtil;
|
||||
|
||||
@@ -234,14 +234,6 @@ public abstract class MessageNotificationState extends NotificationState {
|
||||
mParticipantCount = participantCount;
|
||||
}
|
||||
|
||||
public int getLatestMessageNotificationType() {
|
||||
final MessageLineInfo messageLineInfo = getLatestMessageLineInfo();
|
||||
if (messageLineInfo == null) {
|
||||
return BugleNotifications.LOCAL_SMS_NOTIFICATION;
|
||||
}
|
||||
return messageLineInfo.mNotificationType;
|
||||
}
|
||||
|
||||
public String getLatestMessageId() {
|
||||
final MessageLineInfo messageLineInfo = getLatestMessageLineInfo();
|
||||
if (messageLineInfo == null) {
|
||||
@@ -362,7 +354,6 @@ public abstract class MessageNotificationState extends NotificationState {
|
||||
if (!(convInfo.mLineInfos.get(0) instanceof MessageLineInfo)) {
|
||||
continue;
|
||||
}
|
||||
setPeopleForConversation(convInfo.mConversationId);
|
||||
final ConversationInfoList list = new ConversationInfoList(
|
||||
convInfo.mTotalMessageCount, Lists.newArrayList(convInfo));
|
||||
mChildren.add(new BundledMessageNotificationState(list, i));
|
||||
@@ -452,8 +443,6 @@ public abstract class MessageNotificationState extends NotificationState {
|
||||
super(convList);
|
||||
// This conversation has been accepted.
|
||||
final ConversationLineInfo convInfo = convList.mConvInfos.get(0);
|
||||
setAvatarUrlsForConversation(convInfo.mConversationId);
|
||||
setPeopleForConversation(convInfo.mConversationId);
|
||||
|
||||
final Context context = Factory.get().getApplicationContext();
|
||||
MessageLineInfo messageInfo = (MessageLineInfo) convInfo.mLineInfos.get(0);
|
||||
@@ -476,7 +465,7 @@ public abstract class MessageNotificationState extends NotificationState {
|
||||
final String attachment = context.getString(message);
|
||||
final SpannableStringBuilder spanBuilder = new SpannableStringBuilder();
|
||||
if (!TextUtils.isEmpty(mContent)) {
|
||||
spanBuilder.append(mContent).append(System.getProperty("line.separator"));
|
||||
spanBuilder.append(mContent).append(System.lineSeparator());
|
||||
}
|
||||
final int start = spanBuilder.length();
|
||||
spanBuilder.append(attachment);
|
||||
@@ -917,7 +906,7 @@ public abstract class MessageNotificationState extends NotificationState {
|
||||
Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||
if (!TextUtils.isEmpty(text)) {
|
||||
// Now add the actual message text below the subject header.
|
||||
spanBuilder.append(System.getProperty("line.separator") + text);
|
||||
spanBuilder.append(System.lineSeparator() + text);
|
||||
}
|
||||
text = spanBuilder;
|
||||
}
|
||||
@@ -1059,18 +1048,6 @@ public abstract class MessageNotificationState extends NotificationState {
|
||||
return mTitle;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getLatestMessageNotificationType() {
|
||||
// This function is called to determine whether the most recent notification applies
|
||||
// to an sms conversation or a hangout conversation. We have different ringtone/vibrate
|
||||
// settings for both types of conversations.
|
||||
if (mConvList.mConvInfos.size() > 0) {
|
||||
final ConversationLineInfo convInfo = mConvList.mConvInfos.get(0);
|
||||
return convInfo.getLatestMessageNotificationType();
|
||||
}
|
||||
return BugleNotifications.LOCAL_SMS_NOTIFICATION;
|
||||
}
|
||||
|
||||
protected CharSequence getTicker() {
|
||||
return BugleNotifications.buildColonSeparatedMessage(
|
||||
mTickerSender != null ? mTickerSender : mTitle,
|
||||
|
||||
@@ -94,12 +94,6 @@ public abstract class NotificationState {
|
||||
*/
|
||||
protected abstract NotificationCompat.Style build(NotificationCompat.Builder builder);
|
||||
|
||||
protected void setAvatarUrlsForConversation(final String conversationId) {
|
||||
}
|
||||
|
||||
protected void setPeopleForConversation(final String conversationId) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Reserves request codes for this notification type. By default 2 codes are reserved, one for
|
||||
* the main intent and another for the cancel intent. Override this function to reserve more.
|
||||
@@ -108,10 +102,6 @@ public abstract class NotificationState {
|
||||
return NUM_REQUEST_CODES_NEEDED;
|
||||
}
|
||||
|
||||
public int getContentIntentRequestCode() {
|
||||
return mBaseRequestCode + CONTENT_INTENT_REQUEST_CODE_OFFSET;
|
||||
}
|
||||
|
||||
public int getClearIntentRequestCode() {
|
||||
return mBaseRequestCode + CLEAR_INTENT_REQUEST_CODE_OFFSET;
|
||||
}
|
||||
@@ -121,14 +111,6 @@ public abstract class NotificationState {
|
||||
*/
|
||||
public abstract int getIcon();
|
||||
|
||||
/**
|
||||
* @return the type of notification that should be used from {@link RealTimeChatNotifications}
|
||||
* so that the proper ringtone and vibrate settings can be used.
|
||||
*/
|
||||
public int getLatestMessageNotificationType() {
|
||||
return BugleNotifications.LOCAL_SMS_NOTIFICATION;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the notification priority level for this notification.
|
||||
*/
|
||||
|
||||
@@ -203,17 +203,11 @@ public class ActionServiceImpl extends JobIntentService {
|
||||
mBackgroundWorker = DataModel.get().getBackgroundWorkerForActionService();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
}
|
||||
|
||||
/**
|
||||
* Queue intent to the ActionService.
|
||||
*/
|
||||
private static void startServiceWithIntent(final Intent intent) {
|
||||
final Context context = Factory.get().getApplicationContext();
|
||||
final int opcode = intent.getIntExtra(EXTRA_OP_CODE, 0);
|
||||
intent.setClass(context, ActionServiceImpl.class);
|
||||
enqueueWork(context, intent);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Copyright (C) 2015 The Android Open Source Project
|
||||
* Copyright (C) 2024 The LineageOS Project
|
||||
* Copyright (C) 2024-2025 The LineageOS Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -660,7 +660,7 @@ public class MessageData implements Parcelable {
|
||||
}
|
||||
|
||||
public final String getMessageText() {
|
||||
final String separator = System.getProperty("line.separator");
|
||||
final String separator = System.lineSeparator();
|
||||
final StringBuilder text = new StringBuilder();
|
||||
for (final MessagePartData part : mParts) {
|
||||
if (!part.isAttachment() && !TextUtils.isEmpty(part.getText())) {
|
||||
@@ -678,7 +678,7 @@ public class MessageData implements Parcelable {
|
||||
* appends a text part
|
||||
*/
|
||||
public final void consolidateText() {
|
||||
final String separator = System.getProperty("line.separator");
|
||||
final String separator = System.lineSeparator();
|
||||
final StringBuilder captionText = new StringBuilder();
|
||||
MessagePartData firstTextPart = null;
|
||||
int firstTextPartIndex = -1;
|
||||
|
||||
@@ -27,11 +27,6 @@ import java.util.List;
|
||||
public class CustomVCardEntryConstructor implements VCardInterpreter {
|
||||
|
||||
public interface EntryHandler {
|
||||
/**
|
||||
* Called when the parsing started.
|
||||
*/
|
||||
void onStart();
|
||||
|
||||
/**
|
||||
* The method called when one vCard entry is created. Children come before their parent in
|
||||
* nested vCard files.
|
||||
@@ -86,9 +81,6 @@ public class CustomVCardEntryConstructor implements VCardInterpreter {
|
||||
|
||||
@Override
|
||||
public void onVCardStarted() {
|
||||
for (EntryHandler entryHandler : mEntryHandlers) {
|
||||
entryHandler.onStart();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -248,10 +248,6 @@ public class VCardRequest implements MediaRequest<VCardResource> {
|
||||
mSignal = signal;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStart() {
|
||||
}
|
||||
|
||||
@Override
|
||||
@DoesNotRunOnMainThread
|
||||
public void onEntryCreated(final CustomVCardEntry entry) {
|
||||
|
||||
@@ -1,190 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2015 The Android Open Source Project
|
||||
* Copyright (C) 2024-2025 The LineageOS Project
|
||||
*
|
||||
* 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 com.android.messaging.sms;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.Resources;
|
||||
import android.content.res.XmlResourceParser;
|
||||
import android.database.sqlite.SQLiteDatabase;
|
||||
import android.database.sqlite.SQLiteOpenHelper;
|
||||
import android.provider.Telephony;
|
||||
import android.util.Log;
|
||||
|
||||
import com.android.messaging.R;
|
||||
import com.android.messaging.datamodel.data.ParticipantData;
|
||||
import com.android.messaging.util.LogUtil;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
/*
|
||||
* Database helper class for looking up APNs. This database has a single table
|
||||
* which stores the APNs that are initially created from an xml file.
|
||||
*/
|
||||
public class ApnDatabase extends SQLiteOpenHelper {
|
||||
private static final int DB_VERSION = 3; // added sub_id columns
|
||||
|
||||
private static final String TAG = LogUtil.BUGLE_TAG;
|
||||
|
||||
private static final boolean DEBUG = false;
|
||||
|
||||
private static Context sContext;
|
||||
private static ApnDatabase sApnDatabase;
|
||||
|
||||
private static final String APN_DATABASE_NAME = "apn.db";
|
||||
|
||||
/** table for carrier APN's */
|
||||
public static final String APN_TABLE = "apn";
|
||||
|
||||
// APN table
|
||||
private static final String APN_TABLE_SQL =
|
||||
"CREATE TABLE " + APN_TABLE +
|
||||
"(_id INTEGER PRIMARY KEY," +
|
||||
Telephony.Carriers.NAME + " TEXT," +
|
||||
Telephony.Carriers.NUMERIC + " TEXT," +
|
||||
Telephony.Carriers.MCC + " TEXT," +
|
||||
Telephony.Carriers.MNC + " TEXT," +
|
||||
Telephony.Carriers.APN + " TEXT," +
|
||||
Telephony.Carriers.USER + " TEXT," +
|
||||
Telephony.Carriers.SERVER + " TEXT," +
|
||||
Telephony.Carriers.PASSWORD + " TEXT," +
|
||||
Telephony.Carriers.PROXY + " TEXT," +
|
||||
Telephony.Carriers.PORT + " TEXT," +
|
||||
Telephony.Carriers.MMSPROXY + " TEXT," +
|
||||
Telephony.Carriers.MMSPORT + " TEXT," +
|
||||
Telephony.Carriers.MMSC + " TEXT," +
|
||||
Telephony.Carriers.AUTH_TYPE + " INTEGER," +
|
||||
Telephony.Carriers.TYPE + " TEXT," +
|
||||
Telephony.Carriers.CURRENT + " INTEGER," +
|
||||
Telephony.Carriers.PROTOCOL + " TEXT," +
|
||||
Telephony.Carriers.ROAMING_PROTOCOL + " TEXT," +
|
||||
Telephony.Carriers.CARRIER_ENABLED + " BOOLEAN," +
|
||||
Telephony.Carriers.BEARER + " INTEGER," +
|
||||
Telephony.Carriers.MVNO_TYPE + " TEXT," +
|
||||
Telephony.Carriers.MVNO_MATCH_DATA + " TEXT," +
|
||||
Telephony.Carriers.SUBSCRIPTION_ID + " INTEGER DEFAULT " +
|
||||
ParticipantData.DEFAULT_SELF_SUB_ID + ");";
|
||||
public static final int COLUMN_ID = 4;
|
||||
|
||||
/**
|
||||
* ApnDatabase is initialized asynchronously from the application.onCreate
|
||||
* To ensure that it works in a testing environment it needs to never access the factory context
|
||||
*/
|
||||
public static void initializeAppContext(final Context context) {
|
||||
sContext = context;
|
||||
}
|
||||
|
||||
private ApnDatabase() {
|
||||
super(sContext, APN_DATABASE_NAME, null, DB_VERSION);
|
||||
if (DEBUG) {
|
||||
LogUtil.d(TAG, "ApnDatabase constructor");
|
||||
}
|
||||
}
|
||||
|
||||
public static ApnDatabase getApnDatabase() {
|
||||
if (sApnDatabase == null) {
|
||||
sApnDatabase = new ApnDatabase();
|
||||
}
|
||||
return sApnDatabase;
|
||||
}
|
||||
|
||||
public static boolean doesDatabaseExist() {
|
||||
final File dbFile = sContext.getDatabasePath(APN_DATABASE_NAME);
|
||||
return dbFile.exists();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate(final SQLiteDatabase db) {
|
||||
if (DEBUG) {
|
||||
LogUtil.d(TAG, "ApnDatabase onCreate");
|
||||
}
|
||||
// Build the table using defaults (apn info bundled with the app)
|
||||
rebuildTables(db);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onOpen(final SQLiteDatabase db) {
|
||||
super.onOpen(db);
|
||||
if (DEBUG) {
|
||||
LogUtil.d(TAG, "ApnDatabase onOpen");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() {
|
||||
super.close();
|
||||
if (DEBUG) {
|
||||
LogUtil.d(TAG, "ApnDatabase close");
|
||||
}
|
||||
}
|
||||
|
||||
private void rebuildTables(final SQLiteDatabase db) {
|
||||
if (DEBUG) {
|
||||
LogUtil.d(TAG, "ApnDatabase rebuildTables");
|
||||
}
|
||||
db.execSQL("DROP TABLE IF EXISTS " + APN_TABLE + ";");
|
||||
db.execSQL(APN_TABLE_SQL);
|
||||
loadApnTable(db);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpgrade(final SQLiteDatabase db, final int oldVersion, final int newVersion) {
|
||||
if (DEBUG) {
|
||||
LogUtil.d(TAG, "ApnDatabase onUpgrade");
|
||||
}
|
||||
rebuildTables(db);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDowngrade(final SQLiteDatabase db, final int oldVersion, final int newVersion) {
|
||||
if (DEBUG) {
|
||||
LogUtil.d(TAG, "ApnDatabase onDowngrade");
|
||||
}
|
||||
rebuildTables(db);
|
||||
}
|
||||
|
||||
/**
|
||||
* Load APN table from app resources
|
||||
*/
|
||||
private static void loadApnTable(final SQLiteDatabase db) {
|
||||
LogUtil.v(TAG, "ApnDatabase loadApnTable");
|
||||
final Resources r = sContext.getResources();
|
||||
final XmlResourceParser parser = r.getXml(R.xml.apns);
|
||||
final ApnsXmlProcessor processor = ApnsXmlProcessor.get(parser);
|
||||
processor.setApnHandler(apnValues -> db.insert(APN_TABLE, null/*nullColumnHack*/,
|
||||
apnValues));
|
||||
try {
|
||||
processor.process();
|
||||
} catch (final Exception e) {
|
||||
Log.e(TAG, "Got exception while loading APN database.", e);
|
||||
} finally {
|
||||
parser.close();
|
||||
}
|
||||
}
|
||||
|
||||
public static void forceBuildAndLoadApnTables() {
|
||||
final SQLiteDatabase db = getApnDatabase().getWritableDatabase();
|
||||
db.execSQL("DROP TABLE IF EXISTS " + APN_TABLE);
|
||||
// Table(s) always need for JB MR1 for APN support for MMS because JB MR1 throws
|
||||
// a SecurityException when trying to access the carriers table (which holds the
|
||||
// APNs). Some JB MR2 devices also throw the security exception, so we're building
|
||||
// the table for JB MR2, too.
|
||||
db.execSQL(APN_TABLE_SQL);
|
||||
|
||||
loadApnTable(db);
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Copyright (C) 2015 The Android Open Source Project
|
||||
* Copyright (C) 2024 The LineageOS Project
|
||||
* Copyright (C) 2024-2025 The LineageOS Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -18,18 +18,15 @@
|
||||
package com.android.messaging.sms;
|
||||
|
||||
import android.content.ContentValues;
|
||||
import android.provider.Telephony;
|
||||
|
||||
import com.android.messaging.util.Assert;
|
||||
import com.android.messaging.util.LogUtil;
|
||||
import com.android.messaging.util.PhoneUtils;
|
||||
import com.google.common.collect.Maps;
|
||||
|
||||
import org.xmlpull.v1.XmlPullParser;
|
||||
import org.xmlpull.v1.XmlPullParserException;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Map;
|
||||
|
||||
/*
|
||||
* XML processor for the following files:
|
||||
@@ -37,46 +34,14 @@ import java.util.Map;
|
||||
* 2. res/xml/mms_config.xml (or related overlay files)
|
||||
*/
|
||||
class ApnsXmlProcessor {
|
||||
public interface ApnHandler {
|
||||
void process(ContentValues apnValues);
|
||||
}
|
||||
|
||||
public interface MmsConfigHandler {
|
||||
void process(String mccMnc, String key, String value, String type);
|
||||
}
|
||||
|
||||
private static final String TAG = LogUtil.BUGLE_TAG;
|
||||
|
||||
private static final Map<String, String> APN_ATTRIBUTE_MAP = Maps.newHashMap();
|
||||
static {
|
||||
APN_ATTRIBUTE_MAP.put("mcc", Telephony.Carriers.MCC);
|
||||
APN_ATTRIBUTE_MAP.put("mnc", Telephony.Carriers.MNC);
|
||||
APN_ATTRIBUTE_MAP.put("carrier", Telephony.Carriers.NAME);
|
||||
APN_ATTRIBUTE_MAP.put("apn", Telephony.Carriers.APN);
|
||||
APN_ATTRIBUTE_MAP.put("mmsc", Telephony.Carriers.MMSC);
|
||||
APN_ATTRIBUTE_MAP.put("mmsproxy", Telephony.Carriers.MMSPROXY);
|
||||
APN_ATTRIBUTE_MAP.put("mmsport", Telephony.Carriers.MMSPORT);
|
||||
APN_ATTRIBUTE_MAP.put("type", Telephony.Carriers.TYPE);
|
||||
APN_ATTRIBUTE_MAP.put("user", Telephony.Carriers.USER);
|
||||
APN_ATTRIBUTE_MAP.put("password", Telephony.Carriers.PASSWORD);
|
||||
APN_ATTRIBUTE_MAP.put("authtype", Telephony.Carriers.AUTH_TYPE);
|
||||
APN_ATTRIBUTE_MAP.put("mvno_match_data", Telephony.Carriers.MVNO_MATCH_DATA);
|
||||
APN_ATTRIBUTE_MAP.put("mvno_type", Telephony.Carriers.MVNO_TYPE);
|
||||
APN_ATTRIBUTE_MAP.put("protocol", Telephony.Carriers.PROTOCOL);
|
||||
APN_ATTRIBUTE_MAP.put("bearer", Telephony.Carriers.BEARER);
|
||||
APN_ATTRIBUTE_MAP.put("server", Telephony.Carriers.SERVER);
|
||||
APN_ATTRIBUTE_MAP.put("roaming_protocol", Telephony.Carriers.ROAMING_PROTOCOL);
|
||||
APN_ATTRIBUTE_MAP.put("proxy", Telephony.Carriers.PROXY);
|
||||
APN_ATTRIBUTE_MAP.put("port", Telephony.Carriers.PORT);
|
||||
APN_ATTRIBUTE_MAP.put("carrier_enabled", Telephony.Carriers.CARRIER_ENABLED);
|
||||
}
|
||||
|
||||
private static final String TAG_APNS = "apns";
|
||||
private static final String TAG_APN = "apn";
|
||||
private static final String TAG_MMS_CONFIG = "mms_config";
|
||||
|
||||
// Handler to process one apn
|
||||
private ApnHandler mApnHandler;
|
||||
// Handler to process one mms_config key/value pair
|
||||
private MmsConfigHandler mMmsConfigHandler;
|
||||
|
||||
@@ -86,7 +51,6 @@ class ApnsXmlProcessor {
|
||||
|
||||
private ApnsXmlProcessor(XmlPullParser parser) {
|
||||
mInputParser = parser;
|
||||
mApnHandler = null;
|
||||
mMmsConfigHandler = null;
|
||||
}
|
||||
|
||||
@@ -95,11 +59,6 @@ class ApnsXmlProcessor {
|
||||
return new ApnsXmlProcessor(parser);
|
||||
}
|
||||
|
||||
public ApnsXmlProcessor setApnHandler(ApnHandler handler) {
|
||||
mApnHandler = handler;
|
||||
return this;
|
||||
}
|
||||
|
||||
public ApnsXmlProcessor setMmsConfigHandler(MmsConfigHandler handler) {
|
||||
mMmsConfigHandler = handler;
|
||||
return this;
|
||||
@@ -131,22 +90,8 @@ class ApnsXmlProcessor {
|
||||
// an apn element
|
||||
final ContentValues values = new ContentValues();
|
||||
String tagName = mInputParser.getName();
|
||||
// Top level tag can be "apns" (apns.xml)
|
||||
// or "mms_config" (mms_config.xml)
|
||||
if (TAG_APNS.equals(tagName)) {
|
||||
// For "apns", there could be "apn" or both "apn" and "mms_config"
|
||||
for (;;) {
|
||||
if (advanceToNextEvent(XmlPullParser.START_TAG) != XmlPullParser.START_TAG) {
|
||||
break;
|
||||
}
|
||||
tagName = mInputParser.getName();
|
||||
if (TAG_APN.equals(tagName)) {
|
||||
processApn(values);
|
||||
} else if (TAG_MMS_CONFIG.equals(tagName)) {
|
||||
processMmsConfig();
|
||||
}
|
||||
}
|
||||
} else if (TAG_MMS_CONFIG.equals(tagName)) {
|
||||
// Top level tag can be "mms_config" (mms_config.xml)
|
||||
if (TAG_MMS_CONFIG.equals(tagName)) {
|
||||
// mms_config.xml resource
|
||||
processMmsConfig();
|
||||
}
|
||||
@@ -157,28 +102,6 @@ class ApnsXmlProcessor {
|
||||
}
|
||||
}
|
||||
|
||||
private Integer parseInt(String text, Integer defaultValue, String logHint) {
|
||||
Integer value = defaultValue;
|
||||
try {
|
||||
value = Integer.parseInt(text);
|
||||
} catch (Exception e) {
|
||||
LogUtil.e(TAG,
|
||||
"Invalid value " + text + "for" + logHint + " @" + xmlParserDebugContext());
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
private Boolean parseBoolean(String text, Boolean defaultValue, String logHint) {
|
||||
Boolean value = defaultValue;
|
||||
try {
|
||||
value = Boolean.parseBoolean(text);
|
||||
} catch (Exception e) {
|
||||
LogUtil.e(TAG,
|
||||
"Invalid value " + text + "for" + logHint + " @" + xmlParserDebugContext());
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
private static String xmlParserEventString(int event) {
|
||||
switch (event) {
|
||||
case XmlPullParser.START_DOCUMENT: return "START_DOCUMENT";
|
||||
@@ -219,51 +142,6 @@ class ApnsXmlProcessor {
|
||||
return "Unknown";
|
||||
}
|
||||
|
||||
/**
|
||||
* Process one apn
|
||||
*
|
||||
* @param apnValues Where we store the parsed apn
|
||||
*/
|
||||
private void processApn(ContentValues apnValues) throws IOException, XmlPullParserException {
|
||||
Assert.notNull(apnValues);
|
||||
apnValues.clear();
|
||||
// Collect all the attributes
|
||||
for (int i = 0; i < mInputParser.getAttributeCount(); i++) {
|
||||
final String key = APN_ATTRIBUTE_MAP.get(mInputParser.getAttributeName(i));
|
||||
if (key != null) {
|
||||
apnValues.put(key, mInputParser.getAttributeValue(i));
|
||||
}
|
||||
}
|
||||
// Set numeric to be canonicalized mcc/mnc like "310120", always 6 digits
|
||||
final String canonicalMccMnc = PhoneUtils.canonicalizeMccMnc(
|
||||
apnValues.getAsString(Telephony.Carriers.MCC),
|
||||
apnValues.getAsString(Telephony.Carriers.MNC));
|
||||
apnValues.put(Telephony.Carriers.NUMERIC, canonicalMccMnc);
|
||||
// Some of the values should not be string type, converting them to desired types
|
||||
final String authType = apnValues.getAsString(Telephony.Carriers.AUTH_TYPE);
|
||||
if (authType != null) {
|
||||
apnValues.put(Telephony.Carriers.AUTH_TYPE, parseInt(authType, -1, "apn authtype"));
|
||||
}
|
||||
final String carrierEnabled = apnValues.getAsString(Telephony.Carriers.CARRIER_ENABLED);
|
||||
if (carrierEnabled != null) {
|
||||
apnValues.put(Telephony.Carriers.CARRIER_ENABLED,
|
||||
parseBoolean(carrierEnabled, null, "apn carrierEnabled"));
|
||||
}
|
||||
final String bearer = apnValues.getAsString(Telephony.Carriers.BEARER);
|
||||
if (bearer != null) {
|
||||
apnValues.put(Telephony.Carriers.BEARER, parseInt(bearer, 0, "apn bearer"));
|
||||
}
|
||||
// We are at the end tag
|
||||
if (mInputParser.next() != XmlPullParser.END_TAG) {
|
||||
throw new XmlPullParserException("Apn: expecting end tag @"
|
||||
+ xmlParserDebugContext());
|
||||
}
|
||||
// We are done parsing one APN, call the handler
|
||||
if (mApnHandler != null) {
|
||||
mApnHandler.process(apnValues);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Process one mms_config.
|
||||
*
|
||||
|
||||
@@ -17,10 +17,8 @@
|
||||
|
||||
package com.android.messaging.sms;
|
||||
|
||||
import android.content.ContentValues;
|
||||
import android.content.Context;
|
||||
import android.database.Cursor;
|
||||
import android.database.sqlite.SQLiteDatabase;
|
||||
import android.database.sqlite.SQLiteException;
|
||||
import android.net.Uri;
|
||||
import android.provider.Telephony;
|
||||
@@ -119,151 +117,6 @@ public class BugleApnSettingsLoader implements ApnSettingsLoader {
|
||||
public void setSuccess() {
|
||||
// Do nothing
|
||||
}
|
||||
|
||||
public boolean equals(final BaseApn other) {
|
||||
return TextUtils.equals(mMmsc, other.getMmsc()) &&
|
||||
TextUtils.equals(mMmsProxy, other.getMmsProxy()) &&
|
||||
mMmsProxyPort == other.getMmsProxyPort();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* The APN represented by the local APN table row
|
||||
*/
|
||||
private static class DatabaseApn implements Apn {
|
||||
private static final ContentValues CURRENT_NULL_VALUE;
|
||||
private static final ContentValues CURRENT_SET_VALUE;
|
||||
static {
|
||||
CURRENT_NULL_VALUE = new ContentValues(1);
|
||||
CURRENT_NULL_VALUE.putNull(Telephony.Carriers.CURRENT);
|
||||
CURRENT_SET_VALUE = new ContentValues(1);
|
||||
CURRENT_SET_VALUE.put(Telephony.Carriers.CURRENT, "1"); // 1 for auto selected APN
|
||||
}
|
||||
private static final String CLEAR_UPDATE_SELECTION = Telephony.Carriers.CURRENT + " =?";
|
||||
private static final String[] CLEAR_UPDATE_SELECTION_ARGS = new String[] { "1" };
|
||||
private static final String SET_UPDATE_SELECTION = Telephony.Carriers._ID + " =?";
|
||||
|
||||
/**
|
||||
* Create an APN loaded from local database
|
||||
*
|
||||
* @param apns the in-memory APN list
|
||||
* @param typesIn the APN type field
|
||||
* @param mmscIn the APN mmsc field
|
||||
* @param proxyIn the APN mmsproxy field
|
||||
* @param portIn the APN mmsport field
|
||||
* @param rowId the APN's row ID in database
|
||||
* @param current the value of CURRENT column in database
|
||||
* @return an in-memory APN instance for database APN row, null if parameter invalid
|
||||
*/
|
||||
public static DatabaseApn from(final List<Apn> apns, final String typesIn,
|
||||
final String mmscIn, final String proxyIn, final String portIn,
|
||||
final long rowId, final int current) {
|
||||
if (apns == null) {
|
||||
return null;
|
||||
}
|
||||
final BaseApn base = BaseApn.from(typesIn, mmscIn, proxyIn, portIn);
|
||||
if (base == null) {
|
||||
return null;
|
||||
}
|
||||
for (final ApnSettingsLoader.Apn apn : apns) {
|
||||
if (apn instanceof DatabaseApn && ((DatabaseApn) apn).equals(base)) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
return new DatabaseApn(apns, base, rowId, current);
|
||||
}
|
||||
|
||||
private final List<Apn> mApns;
|
||||
private final BaseApn mBase;
|
||||
private final long mRowId;
|
||||
private int mCurrent;
|
||||
|
||||
public DatabaseApn(final List<Apn> apns, final BaseApn base, final long rowId,
|
||||
final int current) {
|
||||
mApns = apns;
|
||||
mBase = base;
|
||||
mRowId = rowId;
|
||||
mCurrent = current;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMmsc() {
|
||||
return mBase.getMmsc();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMmsProxy() {
|
||||
return mBase.getMmsProxy();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMmsProxyPort() {
|
||||
return mBase.getMmsProxyPort();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSuccess() {
|
||||
moveToListHead();
|
||||
setCurrentInDatabase();
|
||||
}
|
||||
|
||||
/**
|
||||
* Try to move this APN to the head of in-memory list
|
||||
*/
|
||||
private void moveToListHead() {
|
||||
// If this is being marked as a successful APN, move it to the top of the list so
|
||||
// next time it will be tried first
|
||||
boolean moved = false;
|
||||
synchronized (mApns) {
|
||||
if (mApns.get(0) != this) {
|
||||
mApns.remove(this);
|
||||
mApns.add(0, this);
|
||||
moved = true;
|
||||
}
|
||||
}
|
||||
if (moved) {
|
||||
LogUtil.d(LogUtil.BUGLE_TAG, "Set APN ["
|
||||
+ "MMSC=" + getMmsc() + ", "
|
||||
+ "PROXY=" + getMmsProxy() + ", "
|
||||
+ "PORT=" + getMmsProxyPort() + "] to be first");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Try to set the APN to be CURRENT in its database table
|
||||
*/
|
||||
private void setCurrentInDatabase() {
|
||||
synchronized (this) {
|
||||
if (mCurrent > 0) {
|
||||
// Already current
|
||||
return;
|
||||
}
|
||||
mCurrent = 1;
|
||||
}
|
||||
LogUtil.d(LogUtil.BUGLE_TAG, "Set APN @" + mRowId + " to be CURRENT in local db");
|
||||
final SQLiteDatabase database = ApnDatabase.getApnDatabase().getWritableDatabase();
|
||||
database.beginTransaction();
|
||||
try {
|
||||
// clear the previous current=1 apn
|
||||
// we don't clear current=2 apn since it is manually selected by user
|
||||
// and we should not override it.
|
||||
database.update(ApnDatabase.APN_TABLE, CURRENT_NULL_VALUE,
|
||||
CLEAR_UPDATE_SELECTION, CLEAR_UPDATE_SELECTION_ARGS);
|
||||
// set this one to be current (1)
|
||||
database.update(ApnDatabase.APN_TABLE, CURRENT_SET_VALUE, SET_UPDATE_SELECTION,
|
||||
new String[] { Long.toString(mRowId) });
|
||||
database.setTransactionSuccessful();
|
||||
} finally {
|
||||
database.endTransaction();
|
||||
}
|
||||
}
|
||||
|
||||
public boolean equals(final BaseApn other) {
|
||||
if (other == null) {
|
||||
return false;
|
||||
}
|
||||
return mBase.equals(other);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -280,14 +133,7 @@ public class BugleApnSettingsLoader implements ApnSettingsLoader {
|
||||
Telephony.Carriers.MMSPROXY,
|
||||
Telephony.Carriers.MMSPORT,
|
||||
};
|
||||
private static final String[] APN_PROJECTION_LOCAL = {
|
||||
Telephony.Carriers.TYPE,
|
||||
Telephony.Carriers.MMSC,
|
||||
Telephony.Carriers.MMSPROXY,
|
||||
Telephony.Carriers.MMSPORT,
|
||||
Telephony.Carriers.CURRENT,
|
||||
Telephony.Carriers._ID,
|
||||
};
|
||||
|
||||
private static final int COLUMN_TYPE = 0;
|
||||
private static final int COLUMN_MMSC = 1;
|
||||
private static final int COLUMN_MMSPROXY = 2;
|
||||
@@ -297,8 +143,6 @@ public class BugleApnSettingsLoader implements ApnSettingsLoader {
|
||||
|
||||
private static final String SELECTION_APN = Telephony.Carriers.APN + "=?";
|
||||
private static final String SELECTION_CURRENT = Telephony.Carriers.CURRENT + " IS NOT NULL";
|
||||
private static final String SELECTION_NUMERIC = Telephony.Carriers.NUMERIC + "=?";
|
||||
private static final String ORDER_BY = Telephony.Carriers.CURRENT + " DESC";
|
||||
|
||||
private final Context mContext;
|
||||
|
||||
@@ -334,14 +178,6 @@ public class BugleApnSettingsLoader implements ApnSettingsLoader {
|
||||
private void loadLocked(final int subId, final String apnName, final List<Apn> apns) {
|
||||
// Try system APN table
|
||||
loadFromSystem(subId, apnName, apns);
|
||||
if (apns.size() > 0) {
|
||||
return;
|
||||
}
|
||||
// Try local APN table
|
||||
loadFromLocalDatabase(apnName, apns);
|
||||
if (apns.size() <= 0) {
|
||||
LogUtil.w(LogUtil.BUGLE_TAG, "Failed to load any APN");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -455,85 +291,6 @@ public class BugleApnSettingsLoader implements ApnSettingsLoader {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Load matching APNs from local APN table.
|
||||
* We try both using the APN name and not using the APN name.
|
||||
*
|
||||
* @param apnName the APN name
|
||||
* @param apns the list of results to return
|
||||
*/
|
||||
private void loadFromLocalDatabase(final String apnName, final List<Apn> apns) {
|
||||
LogUtil.i(LogUtil.BUGLE_TAG, "Loading APNs from local APN table");
|
||||
final SQLiteDatabase database = ApnDatabase.getApnDatabase().getWritableDatabase();
|
||||
final String mccMnc = PhoneUtils.getMccMncString(PhoneUtils.getDefault().getMccMnc());
|
||||
Cursor cursor;
|
||||
cursor = queryLocalDatabase(database, mccMnc, apnName);
|
||||
if (cursor == null) {
|
||||
cursor = queryLocalDatabase(database, mccMnc, null/*apnName*/);
|
||||
}
|
||||
if (cursor == null) {
|
||||
LogUtil.w(LogUtil.BUGLE_TAG, "Could not find any APN in local table");
|
||||
return;
|
||||
}
|
||||
try {
|
||||
while (cursor.moveToNext()) {
|
||||
final Apn apn = DatabaseApn.from(apns,
|
||||
cursor.getString(COLUMN_TYPE),
|
||||
cursor.getString(COLUMN_MMSC),
|
||||
cursor.getString(COLUMN_MMSPROXY),
|
||||
cursor.getString(COLUMN_MMSPORT),
|
||||
cursor.getLong(COLUMN_ID),
|
||||
cursor.getInt(COLUMN_CURRENT));
|
||||
if (apn != null) {
|
||||
apns.add(apn);
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
cursor.close();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Make a query of local APN table based on MCC/MNC and APN name, sorted by CURRENT
|
||||
* column in descending order
|
||||
*
|
||||
* @param db the local database
|
||||
* @param numeric the MCC/MNC string
|
||||
* @param apnName the optional APN name to match
|
||||
* @return the cursor of the query, null if no result
|
||||
*/
|
||||
private static Cursor queryLocalDatabase(final SQLiteDatabase db, final String numeric,
|
||||
final String apnName) {
|
||||
final String selection;
|
||||
final String[] selectionArgs;
|
||||
if (TextUtils.isEmpty(apnName)) {
|
||||
selection = SELECTION_NUMERIC;
|
||||
selectionArgs = new String[] { numeric };
|
||||
} else {
|
||||
selection = SELECTION_NUMERIC + " AND " + SELECTION_APN;
|
||||
selectionArgs = new String[] { numeric, apnName };
|
||||
}
|
||||
Cursor cursor;
|
||||
try {
|
||||
cursor = db.query(ApnDatabase.APN_TABLE, APN_PROJECTION_LOCAL, selection, selectionArgs,
|
||||
null/*groupBy*/, null/*having*/, ORDER_BY, null/*limit*/);
|
||||
} catch (final SQLiteException e) {
|
||||
LogUtil.w(LogUtil.BUGLE_TAG, "Local APN table does not exist. Try rebuilding.", e);
|
||||
ApnDatabase.forceBuildAndLoadApnTables();
|
||||
cursor = db.query(ApnDatabase.APN_TABLE, APN_PROJECTION_LOCAL, selection, selectionArgs,
|
||||
null/*groupBy*/, null/*having*/, ORDER_BY, null/*limit*/);
|
||||
}
|
||||
if (cursor == null || cursor.getCount() < 1) {
|
||||
if (cursor != null) {
|
||||
cursor.close();
|
||||
}
|
||||
LogUtil.w(LogUtil.BUGLE_TAG, "Query local APNs with apn " + apnName
|
||||
+ " returned empty");
|
||||
return null;
|
||||
}
|
||||
return cursor;
|
||||
}
|
||||
|
||||
private static String trimWithNullCheck(final String value) {
|
||||
return value != null ? value.trim() : null;
|
||||
}
|
||||
|
||||
@@ -52,19 +52,16 @@ import android.text.TextUtils;
|
||||
|
||||
import com.android.messaging.Factory;
|
||||
import com.android.messaging.R;
|
||||
import com.android.messaging.datamodel.MediaScratchFileProvider;
|
||||
import com.android.messaging.datamodel.action.DownloadMmsAction;
|
||||
import com.android.messaging.datamodel.action.SendMessageAction;
|
||||
import com.android.messaging.datamodel.data.MessageData;
|
||||
import com.android.messaging.datamodel.data.MessagePartData;
|
||||
import com.android.messaging.mmslib.SqliteWrapper;
|
||||
import com.android.messaging.mmslib.pdu.PduComposer;
|
||||
import com.android.messaging.mmslib.pdu.PduPersister;
|
||||
import com.android.messaging.sms.SmsSender.SendResult;
|
||||
import com.android.messaging.util.Assert;
|
||||
import com.android.messaging.util.BugleGservicesKeys;
|
||||
import com.android.messaging.util.BuglePrefs;
|
||||
import com.android.messaging.util.DebugUtils;
|
||||
import com.android.messaging.util.EmailAddress;
|
||||
import com.android.messaging.util.ImageUtils;
|
||||
import com.android.messaging.util.ImageUtils.ImageResizer;
|
||||
@@ -73,10 +70,7 @@ import com.android.messaging.util.MediaMetadataRetrieverWrapper;
|
||||
import com.android.messaging.util.PhoneUtils;
|
||||
import com.google.common.base.Joiner;
|
||||
|
||||
import java.io.BufferedOutputStream;
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
@@ -87,7 +81,6 @@ import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* Utils for sending sms/mms messages.
|
||||
@@ -277,10 +270,6 @@ public class MmsUtils {
|
||||
|
||||
private static final String sSmilNonVisualAttachmentsWithText = sSmilTextOnly;
|
||||
|
||||
public static final String MMS_DUMP_PREFIX = "mmsdump-";
|
||||
public static final String SMS_DUMP_PREFIX = "smsdump-";
|
||||
|
||||
public static final int MIN_VIDEO_BYTES_PER_SECOND = 4 * 1024;
|
||||
public static final int MIN_IMAGE_BYTE_SIZE = 16 * 1024;
|
||||
public static final int MAX_VIDEO_ATTACHMENT_COUNT = 1;
|
||||
|
||||
@@ -1396,43 +1385,6 @@ public class MmsUtils {
|
||||
return sHasSmsDateSentColumn;
|
||||
}
|
||||
|
||||
private static final String[] TEST_CARRIERS_PROJECTION =
|
||||
new String[] { Telephony.Carriers.MMSC };
|
||||
private static Boolean sUseSystemApn = null;
|
||||
/**
|
||||
* Check if we can access the APN data in the Telephony provider. Access was restricted in
|
||||
* JB MR1 (and some JB MR2) devices. If we can't access the APN, we have to fall back and use
|
||||
* a private table in our own app.
|
||||
*
|
||||
* @return Whether we can access the system APN table
|
||||
*/
|
||||
public static boolean useSystemApnTable() {
|
||||
if (sUseSystemApn == null) {
|
||||
Cursor cursor = null;
|
||||
try {
|
||||
final Context context = Factory.get().getApplicationContext();
|
||||
final ContentResolver resolver = context.getContentResolver();
|
||||
cursor = SqliteWrapper.query(
|
||||
context,
|
||||
resolver,
|
||||
Telephony.Carriers.CONTENT_URI,
|
||||
TEST_CARRIERS_PROJECTION,
|
||||
null/*selection*/,
|
||||
null/*selectionArgs*/,
|
||||
null);
|
||||
sUseSystemApn = true;
|
||||
} catch (final SecurityException e) {
|
||||
LogUtil.w(TAG, "Can't access system APN, using internal table", e);
|
||||
sUseSystemApn = false;
|
||||
} finally {
|
||||
if (cursor != null) {
|
||||
cursor.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
return sUseSystemApn;
|
||||
}
|
||||
|
||||
public static final Uri MMS_PART_CONTENT_URI = Uri.parse("content://mms/part");
|
||||
|
||||
/**
|
||||
@@ -1818,15 +1770,6 @@ public class MmsUtils {
|
||||
return pdu;
|
||||
}
|
||||
|
||||
private static RetrieveConf receiveFromDumpFile(final byte[] data) throws MmsFailureException {
|
||||
final GenericPdu pdu = parsePduForAnyCarrier(data);
|
||||
if (pdu == null || !(pdu instanceof RetrieveConf)) {
|
||||
LogUtil.e(TAG, "receiveFromDumpFile: Parsing retrieved PDU failure");
|
||||
throw new MmsFailureException(MMS_REQUEST_MANUAL_RETRY, "Failed reading dump file");
|
||||
}
|
||||
return (RetrieveConf) pdu;
|
||||
}
|
||||
|
||||
public static StatusPlusUri sendMmsMessage(final Context context, final int subId,
|
||||
final Uri messageUri, final Bundle extras) {
|
||||
int status = MMS_REQUEST_MANUAL_RETRY;
|
||||
@@ -2241,40 +2184,6 @@ public class MmsUtils {
|
||||
return resolver.delete(messageUri, null /* selection */, null /* selectionArgs */);
|
||||
}
|
||||
|
||||
public static byte[] createDebugNotificationInd(final String fileName) {
|
||||
byte[] pduData = null;
|
||||
try {
|
||||
final Context context = Factory.get().getApplicationContext();
|
||||
// Load the message file
|
||||
final byte[] data = DebugUtils.receiveFromDumpFile(fileName);
|
||||
final RetrieveConf retrieveConf = receiveFromDumpFile(data);
|
||||
// Create the notification
|
||||
final NotificationInd notification = new NotificationInd();
|
||||
final long expiry = System.currentTimeMillis() / 1000 + 600;
|
||||
notification.setTransactionId(fileName.getBytes());
|
||||
notification.setMmsVersion(retrieveConf.getMmsVersion());
|
||||
notification.setFrom(retrieveConf.getFrom());
|
||||
notification.setSubject(retrieveConf.getSubject());
|
||||
notification.setExpiry(expiry);
|
||||
notification.setMessageSize(data.length);
|
||||
notification.setMessageClass(retrieveConf.getMessageClass());
|
||||
|
||||
final Uri.Builder builder = MediaScratchFileProvider.getUriBuilder();
|
||||
builder.appendPath(fileName);
|
||||
final Uri contentLocation = builder.build();
|
||||
notification.setContentLocation(contentLocation.toString().getBytes());
|
||||
|
||||
// Serialize
|
||||
pduData = new PduComposer(context, notification).make();
|
||||
if (pduData == null || pduData.length < 1) {
|
||||
throw new IllegalArgumentException("Empty or zero length PDU data");
|
||||
}
|
||||
} catch (final MmsFailureException | InvalidHeaderValueException e) {
|
||||
// Nothing to do
|
||||
}
|
||||
return pduData;
|
||||
}
|
||||
|
||||
public static int mapRawStatusToErrorResourceId(final int bugleStatus, final int rawStatus) {
|
||||
int stringResId = R.string.message_status_send_failed;
|
||||
switch (rawStatus) {
|
||||
@@ -2304,53 +2213,4 @@ public class MmsUtils {
|
||||
}
|
||||
return stringResId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Dump the raw MMS data into a file
|
||||
*
|
||||
* @param rawPdu The raw pdu data
|
||||
* @param pdu The parsed pdu, used to construct a dump file name
|
||||
*/
|
||||
public static void dumpPdu(final byte[] rawPdu, final GenericPdu pdu) {
|
||||
if (rawPdu == null || rawPdu.length < 1) {
|
||||
return;
|
||||
}
|
||||
final String dumpFileName = MmsUtils.MMS_DUMP_PREFIX + getDumpFileId(pdu);
|
||||
final File dumpFile = DebugUtils.getDebugFile(dumpFileName, true);
|
||||
try {
|
||||
final FileOutputStream fos = new FileOutputStream(dumpFile);
|
||||
try (BufferedOutputStream bos = new BufferedOutputStream(fos)) {
|
||||
bos.write(rawPdu);
|
||||
bos.flush();
|
||||
}
|
||||
DebugUtils.ensureReadable(dumpFile);
|
||||
} catch (final IOException e) {
|
||||
LogUtil.e(TAG, "dumpPdu: " + e, e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the dump file id based on the parsed PDU
|
||||
* 1. Use message id if not empty
|
||||
* 2. Use transaction id if message id is empty
|
||||
* 3. If all above is empty, use random UUID
|
||||
*
|
||||
* @param pdu the parsed PDU
|
||||
* @return the id of the dump file
|
||||
*/
|
||||
private static String getDumpFileId(final GenericPdu pdu) {
|
||||
String fileId = null;
|
||||
if (pdu != null && pdu instanceof RetrieveConf) {
|
||||
final RetrieveConf retrieveConf = (RetrieveConf) pdu;
|
||||
if (retrieveConf.getMessageId() != null) {
|
||||
fileId = new String(retrieveConf.getMessageId());
|
||||
} else if (retrieveConf.getTransactionId() != null) {
|
||||
fileId = new String(retrieveConf.getTransactionId());
|
||||
}
|
||||
}
|
||||
if (TextUtils.isEmpty(fileId)) {
|
||||
fileId = UUID.randomUUID().toString();
|
||||
}
|
||||
return fileId;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,50 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2015 The Android Open Source Project
|
||||
* Copyright (C) 2024 The LineageOS Project
|
||||
*
|
||||
* 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 com.android.messaging.sms;
|
||||
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
/**
|
||||
* Hacky way to call the hidden SystemProperties class API
|
||||
*/
|
||||
class SystemProperties {
|
||||
private static Method sSystemPropertiesGetMethod = null;
|
||||
|
||||
public static String get(final String name) {
|
||||
if (sSystemPropertiesGetMethod == null) {
|
||||
try {
|
||||
final Class systemPropertiesClass = Class.forName("android.os.SystemProperties");
|
||||
if (systemPropertiesClass != null) {
|
||||
sSystemPropertiesGetMethod =
|
||||
systemPropertiesClass.getMethod("get", String.class);
|
||||
}
|
||||
} catch (final ClassNotFoundException | NoSuchMethodException e) {
|
||||
// Nothing to do
|
||||
}
|
||||
}
|
||||
if (sSystemPropertiesGetMethod != null) {
|
||||
try {
|
||||
return (String) sSystemPropertiesGetMethod.invoke(null, name);
|
||||
} catch (final IllegalArgumentException | InvocationTargetException |
|
||||
IllegalAccessException e) {
|
||||
// Nothing to do
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Copyright (C) 2015 The Android Open Source Project
|
||||
* Copyright (C) 2024 The LineageOS Project
|
||||
* Copyright (C) 2024-2025 The LineageOS Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -68,10 +68,6 @@ public class CompositeAdapter extends BaseAdapter {
|
||||
public View getHeaderView(final View convertView, final ViewGroup parentView) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public void close() {
|
||||
// do nothing in base class.
|
||||
}
|
||||
}
|
||||
|
||||
private class Observer extends DataSetObserver {
|
||||
@@ -116,56 +112,6 @@ public class CompositeAdapter extends BaseAdapter {
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
public void removePartition(final int index) {
|
||||
final Partition partition = mPartitions[index];
|
||||
partition.close();
|
||||
System.arraycopy(mPartitions, index + 1, mPartitions, index,
|
||||
mSize - index - 1);
|
||||
mSize--;
|
||||
partition.getAdapter().unregisterDataSetObserver(mObserver);
|
||||
invalidate();
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
public void clearPartitions() {
|
||||
for (int i = 0; i < mSize; i++) {
|
||||
final Partition partition = mPartitions[i];
|
||||
partition.close();
|
||||
partition.getAdapter().unregisterDataSetObserver(mObserver);
|
||||
}
|
||||
invalidate();
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
public Partition getPartition(final int index) {
|
||||
return mPartitions[index];
|
||||
}
|
||||
|
||||
public int getPartitionAtPosition(final int position) {
|
||||
ensureCacheValid();
|
||||
int start = 0;
|
||||
for (int i = 0; i < mSize; i++) {
|
||||
final int end = start + mPartitions[i].getCount();
|
||||
if (position >= start && position < end) {
|
||||
int offset = position - start;
|
||||
if (mPartitions[i].hasHeader() &&
|
||||
(mPartitions[i].getCount() > 0 || mPartitions[i].showIfEmpty())) {
|
||||
offset--;
|
||||
}
|
||||
if (offset == -1) {
|
||||
return -1;
|
||||
}
|
||||
return i;
|
||||
}
|
||||
start = end;
|
||||
}
|
||||
return mSize - 1;
|
||||
}
|
||||
|
||||
public int getPartitionCount() {
|
||||
return mSize;
|
||||
}
|
||||
|
||||
public void invalidate() {
|
||||
mCacheValid = false;
|
||||
}
|
||||
|
||||
@@ -278,14 +278,6 @@ public class ConversationActivity extends BugleActionBarActivity
|
||||
invalidateActionBar();
|
||||
}
|
||||
|
||||
@Override // From ConversationFragmentHost
|
||||
public void onConversationMessagesUpdated(final int numberOfMessages) {
|
||||
}
|
||||
|
||||
@Override // From ConversationFragmentHost
|
||||
public void onConversationParticipantDataLoaded(final int numberOfParticipants) {
|
||||
}
|
||||
|
||||
@Override // From ConversationFragmentHost
|
||||
public boolean isActiveAndFocused() {
|
||||
return !mIsPaused && hasWindowFocus();
|
||||
|
||||
@@ -131,14 +131,11 @@ public class ConversationFragment extends Fragment implements ConversationDataLi
|
||||
ActionMode startActionMode(ActionMode.Callback callback);
|
||||
void dismissActionMode();
|
||||
ActionMode getActionMode();
|
||||
void onConversationMessagesUpdated(int numberOfMessages);
|
||||
void onConversationParticipantDataLoaded(int numberOfParticipants);
|
||||
boolean isActiveAndFocused();
|
||||
}
|
||||
|
||||
public static final String FRAGMENT_TAG = "conversation";
|
||||
|
||||
static final int REQUEST_CHOOSE_ATTACHMENTS = 2;
|
||||
private static final int JUMP_SCROLL_THRESHOLD = 15;
|
||||
// We animate the message from draft to message list, if we the message doesn't show up in the
|
||||
// list within this time limit, then we just do a fade in animation instead
|
||||
@@ -548,7 +545,7 @@ public class ConversationFragment extends Fragment implements ConversationDataLi
|
||||
startRect.top -= view.getPaddingTop();
|
||||
startRect.bottom =
|
||||
composeBubbleRect.bottom;
|
||||
startRect.left += view.getPaddingRight();
|
||||
startRect.left += view.getPaddingEnd();
|
||||
|
||||
view.setAlpha(0);
|
||||
mPopupTransitionAnimation = new PopupTransitionAnimation(startRect, view);
|
||||
@@ -896,8 +893,6 @@ public class ConversationFragment extends Fragment implements ConversationDataLi
|
||||
}
|
||||
|
||||
if (cursor != null) {
|
||||
mHost.onConversationMessagesUpdated(cursor.getCount());
|
||||
|
||||
// Are we coming from a widget click where we're told to scroll to a particular item?
|
||||
final int scrollToPos = getScrollToMessagePosition();
|
||||
if (scrollToPos >= 0) {
|
||||
@@ -1164,8 +1159,6 @@ public class ConversationFragment extends Fragment implements ConversationDataLi
|
||||
mHost.invalidateActionBar();
|
||||
|
||||
mRecyclerView.setVisibility(View.VISIBLE);
|
||||
mHost.onConversationParticipantDataLoaded
|
||||
(mBinding.getData().getNumberOfParticipantsExcludingSelf());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1542,11 +1535,6 @@ public class ConversationFragment extends Fragment implements ConversationDataLi
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void showHideSimSelector(final boolean show) {
|
||||
// no-op for now
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSimSelectorItemLayoutId() {
|
||||
return R.layout.sim_selector_item_view;
|
||||
|
||||
@@ -62,7 +62,6 @@ public class ConversationInputManager implements ConversationInput.ConversationI
|
||||
void onStartComposeMessage();
|
||||
SimSelectorView getSimSelectorView();
|
||||
MediaPicker createMediaPicker();
|
||||
void showHideSimSelector(boolean show);
|
||||
int getSimSelectorItemLayoutId();
|
||||
}
|
||||
|
||||
@@ -493,15 +492,12 @@ public class ConversationInputManager implements ConversationInput.ConversationI
|
||||
@Override
|
||||
public boolean show(boolean animate) {
|
||||
final boolean result = super.show(animate);
|
||||
mHost.showHideSimSelector(true /*show*/);
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hide(boolean animate) {
|
||||
final boolean result = super.hide(animate);
|
||||
mHost.showHideSimSelector(false /*show*/);
|
||||
return result;
|
||||
return super.hide(animate);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Copyright (C) 2015 The Android Open Source Project
|
||||
* Copyright (C) 2024 The LineageOS Project
|
||||
* Copyright (C) 2024-2025 The LineageOS Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -175,7 +175,7 @@ public class ConversationMessageView extends FrameLayout implements View.OnClick
|
||||
// the max leftover space because we want the message bubble to extend no further than the
|
||||
// starting position of the message bubble in the opposite direction.
|
||||
final int maxLeftoverSpace = horizontalSpace - mContactIconView.getMeasuredWidth() * 2
|
||||
- arrowWidth - getPaddingLeft() - getPaddingRight();
|
||||
- arrowWidth - getPaddingStart() - getPaddingEnd();
|
||||
final int messageContentWidthMeasureSpec = MeasureSpec.makeMeasureSpec(maxLeftoverSpace,
|
||||
MeasureSpec.AT_MOST);
|
||||
|
||||
@@ -194,7 +194,7 @@ public class ConversationMessageView extends FrameLayout implements View.OnClick
|
||||
final int iconWidth = mContactIconView.getMeasuredWidth();
|
||||
final int iconHeight = mContactIconView.getMeasuredHeight();
|
||||
final int iconTop = getPaddingTop();
|
||||
final int contentWidth = (right -left) - iconWidth - getPaddingLeft() - getPaddingRight();
|
||||
final int contentWidth = (right -left) - iconWidth - getPaddingStart() - getPaddingEnd();
|
||||
final int contentHeight = mMessageBubble.getMeasuredHeight();
|
||||
final int contentTop = iconTop;
|
||||
|
||||
@@ -202,18 +202,18 @@ public class ConversationMessageView extends FrameLayout implements View.OnClick
|
||||
final int contentLeft;
|
||||
if (mData.getIsIncoming()) {
|
||||
if (isRtl) {
|
||||
iconLeft = (right - left) - getPaddingRight() - iconWidth;
|
||||
iconLeft = (right - left) - getPaddingEnd() - iconWidth;
|
||||
contentLeft = iconLeft - contentWidth;
|
||||
} else {
|
||||
iconLeft = getPaddingLeft();
|
||||
iconLeft = getPaddingStart();
|
||||
contentLeft = iconLeft + iconWidth;
|
||||
}
|
||||
} else {
|
||||
if (isRtl) {
|
||||
iconLeft = getPaddingLeft();
|
||||
iconLeft = getPaddingStart();
|
||||
contentLeft = iconLeft + iconWidth;
|
||||
} else {
|
||||
iconLeft = (right - left) - getPaddingRight() - iconWidth;
|
||||
iconLeft = (right - left) - getPaddingEnd() - iconWidth;
|
||||
contentLeft = iconLeft - contentWidth;
|
||||
}
|
||||
}
|
||||
@@ -755,7 +755,7 @@ public class ConversationMessageView extends FrameLayout implements View.OnClick
|
||||
}
|
||||
|
||||
// Update the message row and message bubble views
|
||||
setPadding(getPaddingLeft(), messageTopPadding, getPaddingRight(), 0);
|
||||
setPadding(getPaddingStart(), messageTopPadding, getPaddingEnd(), 0);
|
||||
mMessageBubble.setGravity(gravity);
|
||||
updateMessageAttachmentsAppearance(gravity);
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Copyright (C) 2015 The Android Open Source Project
|
||||
* Copyright (C) 2025 The LineageOS Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -34,7 +35,7 @@ public class MessageBubbleBackground extends LinearLayout {
|
||||
@Override
|
||||
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
|
||||
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
|
||||
final int widthPadding = getPaddingLeft() + getPaddingRight();
|
||||
final int widthPadding = getPaddingStart() + getPaddingEnd();
|
||||
int bubbleWidth = getMeasuredWidth() - widthPadding;
|
||||
final int maxWidth = MeasureSpec.getSize(widthMeasureSpec) - widthPadding;
|
||||
// Round up to next snapWidthPixels
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Copyright (C) 2015 The Android Open Source Project
|
||||
* Copyright (C) 2024 The LineageOS Project
|
||||
* Copyright (C) 2024-2025 The LineageOS Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -20,25 +20,22 @@ import android.graphics.drawable.ColorDrawable;
|
||||
import android.os.Bundle;
|
||||
import android.view.MenuItem;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.appcompat.app.ActionBar;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
import androidx.fragment.app.FragmentOnAttachListener;
|
||||
|
||||
import com.android.messaging.R;
|
||||
|
||||
public class ArchivedConversationListActivity extends AbstractConversationListActivity
|
||||
implements FragmentOnAttachListener {
|
||||
public class ArchivedConversationListActivity extends AbstractConversationListActivity {
|
||||
|
||||
@Override
|
||||
protected void onCreate(final Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
final ConversationListFragment fragment =
|
||||
mConversationListFragment =
|
||||
ConversationListFragment.createArchivedConversationListFragment();
|
||||
getSupportFragmentManager().addFragmentOnAttachListener(this);
|
||||
getSupportFragmentManager().beginTransaction().add(android.R.id.content, fragment).commit();
|
||||
getSupportFragmentManager()
|
||||
.beginTransaction()
|
||||
.add(android.R.id.content, mConversationListFragment)
|
||||
.commit();
|
||||
invalidateActionBar();
|
||||
}
|
||||
|
||||
@@ -80,13 +77,4 @@ public class ArchivedConversationListActivity extends AbstractConversationListAc
|
||||
public boolean isSwipeAnimatable() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAttachFragment(@NonNull FragmentManager fragmentManager,
|
||||
@NonNull Fragment fragment) {
|
||||
if (fragment instanceof ConversationListFragment) {
|
||||
mConversationListFragment = (ConversationListFragment) fragment;
|
||||
mConversationListFragment.setHost(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Copyright (C) 2015 The Android Open Source Project
|
||||
* Copyright (C) 2024 The LineageOS Project
|
||||
* Copyright (C) 2024-2025 The LineageOS Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -24,22 +24,23 @@ import android.view.MenuItem;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.appcompat.app.ActionBar;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
import androidx.fragment.app.FragmentOnAttachListener;
|
||||
|
||||
import com.android.messaging.R;
|
||||
import com.android.messaging.ui.UIIntents;
|
||||
import com.android.messaging.util.Trace;
|
||||
|
||||
public class ConversationListActivity extends AbstractConversationListActivity implements FragmentOnAttachListener {
|
||||
public class ConversationListActivity extends AbstractConversationListActivity {
|
||||
|
||||
@Override
|
||||
protected void onCreate(final Bundle savedInstanceState) {
|
||||
Trace.beginSection("ConversationListActivity.onCreate");
|
||||
setTheme(R.style.BugleTheme_ConversationListActivity);
|
||||
super.onCreate(savedInstanceState);
|
||||
getSupportFragmentManager().addFragmentOnAttachListener(this);
|
||||
setContentView(R.layout.conversation_list_activity);
|
||||
mConversationListFragment = ConversationListFragment.createConversationListFragment(null);
|
||||
getSupportFragmentManager()
|
||||
.beginTransaction()
|
||||
.add(android.R.id.content, mConversationListFragment)
|
||||
.commit();
|
||||
Trace.endSection();
|
||||
invalidateActionBar();
|
||||
}
|
||||
@@ -131,22 +132,10 @@ public class ConversationListActivity extends AbstractConversationListActivity i
|
||||
@Override
|
||||
public void onWindowFocusChanged(final boolean hasFocus) {
|
||||
super.onWindowFocusChanged(hasFocus);
|
||||
final ConversationListFragment conversationListFragment =
|
||||
(ConversationListFragment) getSupportFragmentManager().findFragmentById(
|
||||
R.id.conversation_list_fragment);
|
||||
// When the screen is turned on, the last used activity gets resumed, but it gets
|
||||
// window focus only after the lock screen is unlocked.
|
||||
if (hasFocus && conversationListFragment != null) {
|
||||
conversationListFragment.setScrolledToNewestConversationIfNeeded();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAttachFragment(@NonNull FragmentManager fragmentManager,
|
||||
@NonNull Fragment fragment) {
|
||||
if (fragment instanceof ConversationListFragment) {
|
||||
mConversationListFragment = (ConversationListFragment) fragment;
|
||||
mConversationListFragment.setHost(this);
|
||||
if (hasFocus && mConversationListFragment != null) {
|
||||
mConversationListFragment.setScrolledToNewestConversationIfNeeded();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,7 +52,6 @@ import com.android.messaging.ui.ListEmptyView;
|
||||
import com.android.messaging.ui.SnackBarInteraction;
|
||||
import com.android.messaging.ui.UIIntents;
|
||||
import com.android.messaging.util.AccessibilityUtil;
|
||||
import com.android.messaging.util.Assert;
|
||||
import com.android.messaging.util.ImeUtil;
|
||||
import com.android.messaging.util.LogUtil;
|
||||
import com.android.messaging.util.UiUtils;
|
||||
@@ -110,9 +109,11 @@ public class ConversationListFragment extends Fragment implements ConversationLi
|
||||
|
||||
public static ConversationListFragment createConversationListFragment(String modeKeyName) {
|
||||
final ConversationListFragment fragment = new ConversationListFragment();
|
||||
final Bundle bundle = new Bundle();
|
||||
bundle.putBoolean(modeKeyName, true);
|
||||
fragment.setArguments(bundle);
|
||||
if (modeKeyName != null) {
|
||||
final Bundle bundle = new Bundle();
|
||||
bundle.putBoolean(modeKeyName, true);
|
||||
fragment.setArguments(bundle);
|
||||
}
|
||||
return fragment;
|
||||
}
|
||||
|
||||
@@ -130,7 +131,7 @@ public class ConversationListFragment extends Fragment implements ConversationLi
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
|
||||
Assert.notNull(mHost);
|
||||
mHost = (ConversationListFragmentHost) getActivity();
|
||||
setScrolledToNewestConversationIfNeeded();
|
||||
|
||||
updateUi();
|
||||
@@ -265,14 +266,6 @@ public class ConversationListFragment extends Fragment implements ConversationLi
|
||||
mListBinding.getData().setScrolledToNewestConversation(false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Call this immediately after attaching the fragment
|
||||
*/
|
||||
public void setHost(final ConversationListFragmentHost host) {
|
||||
Assert.isNull(mHost);
|
||||
mHost = host;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onConversationListCursorUpdated(final ConversationListData data,
|
||||
final Cursor cursor) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Copyright (C) 2015 The Android Open Source Project
|
||||
* Copyright (C) 2024 The LineageOS Project
|
||||
* Copyright (C) 2024-2025 The LineageOS Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -19,11 +19,6 @@ package com.android.messaging.ui.conversationlist;
|
||||
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
import androidx.fragment.app.FragmentOnAttachListener;
|
||||
|
||||
import com.android.messaging.datamodel.data.ConversationListData;
|
||||
import com.android.messaging.datamodel.data.ConversationListItemData;
|
||||
import com.android.messaging.datamodel.data.MessageData;
|
||||
@@ -36,13 +31,12 @@ import com.android.messaging.ui.conversationlist.ConversationListFragment.Conver
|
||||
* conversation list.
|
||||
*/
|
||||
public class ForwardMessageActivity extends BaseBugleActivity
|
||||
implements ConversationListFragmentHost, FragmentOnAttachListener {
|
||||
implements ConversationListFragmentHost {
|
||||
private MessageData mDraftMessage;
|
||||
|
||||
@Override
|
||||
protected void onCreate(final Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
getSupportFragmentManager().addFragmentOnAttachListener(this);
|
||||
final ConversationListFragment fragment =
|
||||
ConversationListFragment.createForwardMessageConversationListFragment();
|
||||
getSupportFragmentManager().beginTransaction().add(android.R.id.content, fragment).commit();
|
||||
@@ -50,15 +44,6 @@ public class ForwardMessageActivity extends BaseBugleActivity
|
||||
MessageData.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAttachFragment(@NonNull FragmentManager fragmentManager,
|
||||
@NonNull Fragment fragment) {
|
||||
if (fragment instanceof ConversationListFragment) {
|
||||
final ConversationListFragment clf = (ConversationListFragment) fragment;
|
||||
clf.setHost(this);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onConversationClick(final ConversationListData listData,
|
||||
final ConversationListItemData conversationListItemData,
|
||||
|
||||
@@ -104,11 +104,6 @@ class CameraMediaChooser extends MediaChooser {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public View destroyView() {
|
||||
return super.destroyView();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected View createView(final ViewGroup container) {
|
||||
final LayoutInflater inflater = getLayoutInflater();
|
||||
|
||||
@@ -107,9 +107,6 @@ abstract class MediaChooser extends BasePagerViewHolder
|
||||
return LayoutInflater.from(getContext());
|
||||
}
|
||||
|
||||
/** Allows the chooser to handle full screen change */
|
||||
void onFullScreenChanged(final boolean fullScreen) {}
|
||||
|
||||
/** Allows the chooser to handle the chooser being opened or closed */
|
||||
void onOpenedChanged(final boolean open) {
|
||||
mOpen = open;
|
||||
@@ -176,9 +173,6 @@ abstract class MediaChooser extends BasePagerViewHolder
|
||||
return false;
|
||||
}
|
||||
|
||||
public void onCreateOptionsMenu(final MenuInflater inflater, final Menu menu) {
|
||||
}
|
||||
|
||||
public boolean onOptionsItemSelected(final MenuItem item) {
|
||||
return false;
|
||||
}
|
||||
@@ -204,5 +198,4 @@ abstract class MediaChooser extends BasePagerViewHolder
|
||||
|
||||
/** Optional activity life-cycle methods to be overridden by subclasses */
|
||||
public void onPause() { }
|
||||
public void onResume() { }
|
||||
}
|
||||
|
||||
@@ -279,15 +279,6 @@ public class MediaPicker extends Fragment implements DraftMessageSubscriptionDat
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
|
||||
for (final MediaChooser chooser : mEnabledChoosers) {
|
||||
chooser.onResume();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
@@ -545,7 +536,6 @@ public class MediaPicker extends Fragment implements DraftMessageSubscriptionDat
|
||||
mListenerHandler.post(() -> mListener.onOpened());
|
||||
}
|
||||
if (mSelectedChooser != null) {
|
||||
mSelectedChooser.onFullScreenChanged(false);
|
||||
mSelectedChooser.onOpenedChanged(true);
|
||||
}
|
||||
}
|
||||
@@ -566,9 +556,6 @@ public class MediaPicker extends Fragment implements DraftMessageSubscriptionDat
|
||||
if (mListener != null) {
|
||||
mListenerHandler.post(() -> mListener.onFullScreenChanged(fullScreen));
|
||||
}
|
||||
if (mSelectedChooser != null) {
|
||||
mSelectedChooser.onFullScreenChanged(fullScreen);
|
||||
}
|
||||
}
|
||||
|
||||
void dispatchItemsSelected(final MessagePartData item, final boolean dismissMediaPicker) {
|
||||
@@ -641,9 +628,6 @@ public class MediaPicker extends Fragment implements DraftMessageSubscriptionDat
|
||||
@Override
|
||||
public void onCreateOptionsMenu(@NonNull final Menu menu,
|
||||
@NonNull final MenuInflater inflater) {
|
||||
if (mSelectedChooser != null) {
|
||||
mSelectedChooser.onCreateOptionsMenu(inflater, menu);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Copyright (C) 2015 The Android Open Source Project
|
||||
* Copyright (C) 2024 The LineageOS Project
|
||||
* Copyright (C) 2024-2025 The LineageOS Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -22,7 +22,6 @@ import android.app.AlertDialog;
|
||||
import android.content.Context;
|
||||
import android.os.UserManager;
|
||||
|
||||
import com.android.messaging.Factory;
|
||||
import com.android.messaging.R;
|
||||
import com.android.messaging.datamodel.DataModel;
|
||||
|
||||
@@ -41,7 +40,6 @@ public class BugleActivityUtil {
|
||||
*/
|
||||
public static boolean onActivityResume(Context context, Activity activity) {
|
||||
DataModel.get().onActivityResume();
|
||||
Factory.get().onActivityResume();
|
||||
|
||||
// Validate all requirements to run are met
|
||||
return checkHasSmsPermissionsForUser(context, activity);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Copyright (C) 2015 The Android Open Source Project
|
||||
* Copyright (C) 2024 The LineageOS Project
|
||||
* Copyright (C) 2024-2025 The LineageOS Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -17,83 +17,7 @@
|
||||
|
||||
package com.android.messaging.util;
|
||||
|
||||
import android.os.Environment;
|
||||
|
||||
import com.google.common.io.ByteStreams;
|
||||
|
||||
import java.io.BufferedInputStream;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
public class DebugUtils {
|
||||
private static final String TAG = "bugle.util.DebugUtils";
|
||||
|
||||
public static File getDebugFile(final String fileName, final boolean create) {
|
||||
final File dir = getDebugFilesDir();
|
||||
final File file = new File(dir, fileName);
|
||||
if (create && file.exists()) {
|
||||
file.delete();
|
||||
}
|
||||
return file;
|
||||
}
|
||||
|
||||
public static File getDebugFilesDir() {
|
||||
final File dir = Environment.getExternalStorageDirectory();
|
||||
return dir;
|
||||
}
|
||||
|
||||
/**
|
||||
* Load MMS/SMS from the dump file
|
||||
*/
|
||||
public static byte[] receiveFromDumpFile(final String dumpFileName) {
|
||||
byte[] data = null;
|
||||
try {
|
||||
final File inputFile = getDebugFile(dumpFileName, false);
|
||||
final FileInputStream fis = new FileInputStream(inputFile);
|
||||
try (BufferedInputStream bis = new BufferedInputStream(fis)) {
|
||||
// dump file
|
||||
data = ByteStreams.toByteArray(bis);
|
||||
if (data == null || data.length < 1) {
|
||||
LogUtil.e(LogUtil.BUGLE_TAG, "receiveFromDumpFile: empty data");
|
||||
}
|
||||
}
|
||||
} catch (final IOException e) {
|
||||
LogUtil.e(LogUtil.BUGLE_TAG, "receiveFromDumpFile: " + e, e);
|
||||
}
|
||||
return data;
|
||||
}
|
||||
|
||||
public static void ensureReadable(final File file) {
|
||||
if (file.exists()){
|
||||
file.setReadable(true, false);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Logs the name of the method that is currently executing, e.g. "MyActivity.onCreate". This is
|
||||
* useful for surgically adding logs for tracing execution while debugging.
|
||||
* <p>
|
||||
* NOTE: This method retrieves the current thread's stack trace, which adds runtime overhead.
|
||||
* However, this method is only executed on eng builds if DEBUG logs are loggable.
|
||||
*/
|
||||
public static void logCurrentMethod(String tag) {
|
||||
if (!LogUtil.isLoggable(tag, LogUtil.DEBUG)) {
|
||||
return;
|
||||
}
|
||||
StackTraceElement caller = getCaller(1);
|
||||
if (caller == null) {
|
||||
return;
|
||||
}
|
||||
String className = caller.getClassName();
|
||||
// Strip off the package name
|
||||
int lastDot = className.lastIndexOf('.');
|
||||
if (lastDot > -1) {
|
||||
className = className.substring(lastDot + 1);
|
||||
}
|
||||
LogUtil.d(tag, className + "." + caller.getMethodName());
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns info about the calling method. The {@code depth} parameter controls how far back to
|
||||
* go. For example, if foo() calls bar(), and bar() calls getCaller(0), it returns info about
|
||||
|
||||
Reference in New Issue
Block a user