Messaging: Implement per conversation channels. Update API level to 28.

* Get rid of in-app settings for notifications, replaced by channels features
* Remove all the notification plumbing and dead code

Test: m, manual

Signed-off-by: Luca Stefani <luca.stefani.ge1@gmail.com>
Signed-off-by: Joey <joey@lineageos.org>
Signed-off-by: Danny Baumann <dannybaumann@web.de>
Signed-off-by: Arne Coucheron <arco68@gmail.com>
Signed-off-by: Lyubo <lyubodzhamov@gmail.com>
Change-Id: Idb39ca32751d40b3376934775d2119dd6cc7e297
This commit is contained in:
Luca Stefani
2024-09-09 05:46:38 +03:00
committed by Michael Bestas
parent 2fa1f81707
commit 4246987beb
66 changed files with 249 additions and 942 deletions
Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 839 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 914 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 820 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 613 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 946 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 880 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

@@ -121,17 +121,6 @@
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@android:color/transparent">
<ImageView
android:id="@+id/conversation_notification_bell"
style="@style/ConversationListNotificationBellPaddingStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_notifications_off_small_light"
android:visibility="gone"
android:importantForAccessibility="no"
android:contentDescription="@null"
android:layout_gravity="center_vertical"
android:background="@android:color/transparent" />
<TextView
android:id="@+id/conversation_name"
style="@style/ConversationListItemViewConversationNameStyle"
-20
View File
@@ -40,25 +40,5 @@
android:ellipsize="end"
style="@style/ParticipantListItem"
android:layout_gravity="center_vertical" />
<TextView
android:id="@+id/subtitle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:singleLine="true"
android:maxLines="1"
android:ellipsize="end"
style="@style/ParticipantListItemDetail"
android:layout_gravity="center_vertical" />
</LinearLayout>
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/switch_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:focusable="false"
android:clickable="false"
android:visibility="gone" />
</com.android.messaging.ui.conversationsettings.PeopleOptionsItemView>
@@ -67,18 +67,6 @@
android:layout_alignParentTop="true"
android:gravity="center_vertical"
android:background="@android:color/transparent">
<ImageView
android:id="@+id/conversation_notification_bell"
style="@style/ConversationListNotificationBellPaddingStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_notifications_off_small_light"
android:visibility="gone"
android:importantForAccessibility="no"
android:contentDescription="@null"
android:layout_gravity="center_vertical"
android:background="@android:color/transparent" />
<TextView android:id="@+id/from"
style="@style/WidgetConversationListItemFrom"
android:layout_width="0dp"
@@ -36,18 +36,6 @@
android:orderInCategory="60"
android:title="@string/action_delete"
appcompat:showAsAction="collapseActionView|always"/>
<item
android:id="@+id/action_notification_off"
android:icon="@drawable/ic_notifications_off_dark"
android:orderInCategory="70"
android:title="@string/action_notification_off"
appcompat:showAsAction="collapseActionView|always"/>
<item
android:id="@+id/action_notification_on"
android:icon="@drawable/ic_notifications_on_dark"
android:orderInCategory="80"
android:title="@string/action_notification_on"
appcompat:showAsAction="collapseActionView|always"/>
<item
android:id="@+id/action_add_contact"
android:icon="@drawable/ic_person_add_dark"
-4
View File
@@ -74,10 +74,6 @@
<item name="android:textColor">@color/conversation_list_name</item>
</style>
<style name="ConversationListNotificationBellPaddingStyle">
<item name="android:paddingEnd">@dimen/conversation_list_notification_bell_padding</item>
</style>
<style name="ComposeMessageViewFrameLayoutStyle">
<item name="android:paddingEnd">@dimen/compose_message_send_button_padding_right</item>
</style>
-1
View File
@@ -122,7 +122,6 @@
<color name="notification_subject_color">#99aaaaaa</color>
<color name="participant_list_text_primary">#4d4d4d</color>
<color name="participant_list_text_secondary">#6d6d6d</color>
<color name="people_and_options_header_text">#6d6d6d</color>
<color name="people_and_options_list_divider">#cccccc</color>
+1 -2
View File
@@ -21,8 +21,7 @@
<string name="notifications_category_pref_key" translatable="false">notifications_category</string>
<string name="mms_messaging_category_pref_key" translatable="false">mms_messaging_category</string>
<string name="advanced_category_pref_key" translatable="false">advanced_category</string>
<string name="notifications_enabled_pref_key" translatable="false">notifications_enabled</string>
<bool name="notifications_enabled_pref_default" translatable="false">true</bool>
<string name="notifications_pref_key" translatable="false">notifications_enabled</string>
<string name="notification_sound_pref_key" translatable="false">notification_sound</string>
<string name="notification_vibration_pref_key" translatable="false">notification_vibration</string>
<bool name="notification_vibration_pref_default" translatable="false">true</bool>
-2
View File
@@ -34,7 +34,6 @@
<dimen name="conversation_list_contact_icon_size">56dp</dimen>
<dimen name="conversation_message_contact_icon_size">42dp</dimen>
<dimen name="conversation_message_photo_min_size">96dp</dimen>
<dimen name="conversation_list_notification_bell_padding">4dp</dimen>
<dimen name="conversation_list_empty_text_bottom_margin">30dp</dimen>
<dimen name="blocked_participant_list_item_view_padding">16dp</dimen>
@@ -109,7 +108,6 @@
<dimen name="progress_indicator_default_stroke_width">2dp</dimen>
<dimen name="progress_indicator_default_radius">12dp</dimen>
<dimen name="participant_list_text_size">18sp</dimen>
<dimen name="participant_list_detail_text_size">14sp</dimen>
<dimen name="people_and_options_header_text_size">16sp</dimen>
<dimen name="image_attachment_fallback_width">240dp</dimen>
<dimen name="image_attachment_fallback_height">240dp</dimen>
+4 -9
View File
@@ -257,10 +257,6 @@
<string name="action_archive">Archive</string>
<!-- Action menu title for unarchiving selected conversations in conversation list -->
<string name="action_unarchive">Unarchive</string>
<!-- Action menu title for turning off notification for the selected conversations in conversation list -->
<string name="action_notification_off">Turn off notifications</string>
<!-- Action menu title for turning on notification for the selected conversations in conversation list -->
<string name="action_notification_on">Turn on notifications</string>
<!-- Action menu title for adding the contacts for the selected conversations in conversation list -->
<string name="action_add_contact">Add contact</string>
<!-- Action menu title for downloading failed message selected in conversation -->
@@ -440,13 +436,9 @@
<!-- Preference category: Debug -->
<string name="debug_category_pref_title">Debug</string>
<!-- Title for the preference for whether or to notify the user of new messages -->
<string name="notifications_enabled_pref_title">Notifications</string>
<string name="notifications_pref_title">Notifications</string>
<!-- Title for the notification sound preference -->
<string name="notification_sound_pref_title">Sound</string>
<!-- What to display in the settings screen for Ringtone when the user chooses "silent" [CHAR LIMIT=100]-->
<string name="silent_ringtone">Silent</string>
<!-- Title for the preference for whether or not to vibrate with notifications -->
<string name="notification_vibrate_pref_title">Vibrate</string>
<string name="blocked_pref_title">Blocked</string>
<!-- Title for the preference for whether or not to request/show delivery reports for SMS -->
<string name="delivery_reports_pref_title">SMS delivery reports</string>
@@ -982,4 +974,7 @@
<!-- When making a call to emergency numbers, show this toast -->
<string name="disallow_emergency_call">Can\'t make a voice call to emergency services here.</string>
<!-- Notification channel -->
<string name="notification_channel_messages_title">Messages</string>
</resources>
-10
View File
@@ -291,10 +291,6 @@
<item name="android:textColor">@color/conversation_list_name</item>
</style>
<style name="ConversationListNotificationBellPaddingStyle">
<item name="android:paddingRight">@dimen/conversation_list_notification_bell_padding</item>
</style>
<style name="ComposeMessageViewFrameLayoutStyle">
<item name="android:paddingRight">@dimen/compose_message_send_button_padding_right</item>
</style>
@@ -347,12 +343,6 @@
<item name="android:paddingRight">@dimen/copy_contact_dialog_right_padding</item>
</style>
<style name="ParticipantListItemDetail">
<item name="android:textSize">@dimen/participant_list_detail_text_size</item>
<item name="android:textColor">@color/participant_list_text_secondary</item>
<item name="android:background">@null</item>
</style>
<style name="PeopleListItemViewStyle">
<item name="android:paddingLeft">16dp</item>
</style>
+4 -23
View File
@@ -42,29 +42,10 @@
android:defaultValue="@bool/send_sound_pref_default"
android:persistent="true" />
<SwitchPreference
android:key="@string/notifications_enabled_pref_key"
android:title="@string/notifications_enabled_pref_title"
android:defaultValue="@bool/notifications_enabled_pref_default"
android:persistent="true"
android:disableDependentsState="false" />
<RingtonePreference
android:key="@string/notification_sound_pref_key"
android:title="@string/notification_sound_pref_title"
android:ringtoneType="notification"
android:showSilent="true"
android:showDefault="true"
android:persistent="true"
android:defaultValue=""
android:dependency="@string/notifications_enabled_pref_key" />
<SwitchPreference
android:key="@string/notification_vibration_pref_key"
android:title="@string/notification_vibrate_pref_title"
android:defaultValue="@bool/notification_vibration_pref_default"
android:persistent="true"
android:dependency="@string/notifications_enabled_pref_key" />
<Preference
android:key="@string/notifications_pref_key"
android:title="@string/notifications_pref_title"
android:persistent="true" />
<SwitchPreference
android:key="@string/swipe_right_deletes_conversation_key"
+4 -23
View File
@@ -43,29 +43,10 @@
android:defaultValue="@bool/send_sound_pref_default"
android:persistent="true" />
<SwitchPreference
android:key="@string/notifications_enabled_pref_key"
android:title="@string/notifications_enabled_pref_title"
android:defaultValue="@bool/notifications_enabled_pref_default"
android:persistent="true"
android:disableDependentsState="false" />
<RingtonePreference
android:key="@string/notification_sound_pref_key"
android:title="@string/notification_sound_pref_title"
android:ringtoneType="notification"
android:showSilent="true"
android:showDefault="true"
android:persistent="true"
android:defaultValue=""
android:dependency="@string/notifications_enabled_pref_key" />
<SwitchPreference
android:key="@string/notification_vibration_pref_key"
android:title="@string/notification_vibrate_pref_title"
android:defaultValue="@bool/notification_vibration_pref_default"
android:persistent="true"
android:dependency="@string/notifications_enabled_pref_key" />
<Preference
android:key="@string/notifications_pref_key"
android:title="@string/notifications_pref_title"
android:persistent="true" />
<SwitchPreference
android:key="@string/swipe_right_deletes_conversation_key"
+4 -23
View File
@@ -42,29 +42,10 @@
android:defaultValue="@bool/send_sound_pref_default"
android:persistent="true" />
<CheckBoxPreference
android:key="@string/notifications_enabled_pref_key"
android:title="@string/notifications_enabled_pref_title"
android:defaultValue="@bool/notifications_enabled_pref_default"
android:persistent="true"
android:disableDependentsState="false" />
<RingtonePreference
android:key="@string/notification_sound_pref_key"
android:title="@string/notification_sound_pref_title"
android:ringtoneType="notification"
android:showSilent="true"
android:showDefault="true"
android:persistent="true"
android:defaultValue=""
android:dependency="@string/notifications_enabled_pref_key" />
<CheckBoxPreference
android:key="@string/notification_vibration_pref_key"
android:title="@string/notification_vibrate_pref_title"
android:defaultValue="@bool/notification_vibration_pref_default"
android:persistent="true"
android:dependency="@string/notifications_enabled_pref_key" />
<Preference
android:key="@string/notifications_pref_key"
android:title="@string/notifications_pref_title"
android:persistent="true" />
<SwitchPreference
android:key="@string/swipe_right_deletes_conversation_key"