Pull in Messaging notifications fix

Likely solves https://github.com/Divested-Mobile/DivestOS-Build/issues/141

Signed-off-by: Tad <tad@spotco.us>
This commit is contained in:
Tad 2023-11-05 19:09:27 -05:00
parent 548aec9c9d
commit 01a196e055
No known key found for this signature in database
GPG Key ID: B286E9F57A07424B
10 changed files with 114 additions and 23 deletions

View File

@ -0,0 +1,88 @@
From 9864ee18019b89342c979048cae1a20d3f3a09f4 Mon Sep 17 00:00:00 2001
From: nift4 <nift4@protonmail.com>
Date: Sun, 24 Sep 2023 13:06:57 +0200
Subject: [PATCH] Messaging: Add notification channels where missing
Change-Id: I1cb3177704542fc48c42dc18a9e1f4d3118d4193
---
.../messaging/datamodel/MessageNotificationState.java | 7 +++++--
src/com/android/messaging/receiver/SmsReceiver.java | 4 +++-
src/com/android/messaging/sms/SmsStorageStatusManager.java | 4 +++-
3 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/src/com/android/messaging/datamodel/MessageNotificationState.java b/src/com/android/messaging/datamodel/MessageNotificationState.java
index 4a4bfd57b..fd82f745c 100644
--- a/src/com/android/messaging/datamodel/MessageNotificationState.java
+++ b/src/com/android/messaging/datamodel/MessageNotificationState.java
@@ -55,6 +55,7 @@
import com.android.messaging.util.ContentType;
import com.android.messaging.util.ConversationIdSet;
import com.android.messaging.util.LogUtil;
+import com.android.messaging.util.NotificationsUtil;
import com.android.messaging.util.PendingIntentConstants;
import com.android.messaging.util.UriUtil;
import com.google.common.collect.Lists;
@@ -774,7 +775,8 @@ public static Notification buildConversationPageForWearable(final String convers
bigText.append("\n\n").append(statusText);
}
- final NotificationCompat.Builder notifBuilder = new NotificationCompat.Builder(context);
+ final NotificationCompat.Builder notifBuilder = new NotificationCompat.Builder(context,
+ NotificationsUtil.DEFAULT_CHANNEL_ID);
final NotificationCompat.Style notifStyle =
new NotificationCompat.BigTextStyle(notifBuilder).bigText(bigText);
notifBuilder.setStyle(notifStyle);
@@ -1196,7 +1198,8 @@ public static void checkFailedMessages() {
}
if (failedMessages.size() > 0) {
final NotificationCompat.Builder builder =
- new NotificationCompat.Builder(context);
+ new NotificationCompat.Builder(context,
+ NotificationsUtil.DEFAULT_CHANNEL_ID);
CharSequence line1;
CharSequence line2;
diff --git a/src/com/android/messaging/receiver/SmsReceiver.java b/src/com/android/messaging/receiver/SmsReceiver.java
index c36e9ab12..89a3710a9 100644
--- a/src/com/android/messaging/receiver/SmsReceiver.java
+++ b/src/com/android/messaging/receiver/SmsReceiver.java
@@ -48,6 +48,7 @@
import com.android.messaging.util.BugleGservicesKeys;
import com.android.messaging.util.DebugUtils;
import com.android.messaging.util.LogUtil;
+import com.android.messaging.util.NotificationsUtil;
import com.android.messaging.util.OsUtil;
import com.android.messaging.util.PendingIntentConstants;
import com.android.messaging.util.PhoneUtils;
@@ -260,7 +261,8 @@ public static void postNewMessageSecondaryUserNotification() {
final PendingIntent pendingIntent = UIIntents.get()
.getPendingIntentForSecondaryUserNewMessageNotification(context);
- final NotificationCompat.Builder builder = new NotificationCompat.Builder(context);
+ final NotificationCompat.Builder builder = new NotificationCompat.Builder(context,
+ NotificationsUtil.DEFAULT_CHANNEL_ID);
builder.setContentTitle(resources.getString(R.string.secondary_user_new_message_title))
.setTicker(resources.getString(R.string.secondary_user_new_message_ticker))
.setSmallIcon(R.drawable.ic_sms_light)
diff --git a/src/com/android/messaging/sms/SmsStorageStatusManager.java b/src/com/android/messaging/sms/SmsStorageStatusManager.java
index 4f03195c5..6bd68cb95 100644
--- a/src/com/android/messaging/sms/SmsStorageStatusManager.java
+++ b/src/com/android/messaging/sms/SmsStorageStatusManager.java
@@ -25,6 +25,7 @@
import com.android.messaging.Factory;
import com.android.messaging.R;
import com.android.messaging.ui.UIIntents;
+import com.android.messaging.util.NotificationsUtil;
import com.android.messaging.util.PendingIntentConstants;
import com.android.messaging.util.PhoneUtils;
@@ -65,7 +66,8 @@ private static void postStorageLowNotification() {
final PendingIntent pendingIntent = UIIntents.get()
.getPendingIntentForLowStorageNotifications(context);
- final NotificationCompat.Builder builder = new NotificationCompat.Builder(context);
+ final NotificationCompat.Builder builder = new NotificationCompat.Builder(context,
+ NotificationsUtil.DEFAULT_CHANNEL_ID);
builder.setContentTitle(resources.getString(R.string.sms_storage_low_title))
.setTicker(resources.getString(R.string.sms_storage_low_notification_ticker))
.setSmallIcon(R.drawable.ic_failed_light)

View File

@ -1,4 +1,4 @@
From 546fd13c6f1d99cb36ca8db80da2d66b96329f47 Mon Sep 17 00:00:00 2001
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Chirayu Desai <chirayudesai1@gmail.com>
Date: Tue, 26 Sep 2023 19:30:58 +0530
Subject: [PATCH] Put bare minimum metadata in screenshots
@ -12,10 +12,10 @@ Change-Id: I6f38c5cf04539e09b8bfe0102c646bd8faa50f5b
1 file changed, 11 deletions(-)
diff --git a/packages/SystemUI/src/com/android/systemui/screenshot/ImageExporter.java b/packages/SystemUI/src/com/android/systemui/screenshot/ImageExporter.java
index 7cfe2327f992..b991fccf0e84 100644
index 898f58d342d6..d8602685758c 100644
--- a/packages/SystemUI/src/com/android/systemui/screenshot/ImageExporter.java
+++ b/packages/SystemUI/src/com/android/systemui/screenshot/ImageExporter.java
@@ -394,19 +394,8 @@ public class ImageExporter {
@@ -404,19 +404,8 @@ public class ImageExporter {
static void updateExifAttributes(ExifInterface exif, UUID uniqueId, int width, int height,
ZonedDateTime captureTime) {
@ -35,6 +35,3 @@ index 7cfe2327f992..b991fccf0e84 100644
}
static String getMimeType(CompressFormat format) {
--
GitLab

View File

@ -21,7 +21,7 @@ Change-Id: I694c683c9bfde60343f0f6ea8d806bc5e24437e6
2 files changed, 6 insertions(+)
diff --git a/hal/audio_extn/audio_extn.h b/hal/audio_extn/audio_extn.h
index 256382c07f..a4898cf860 100644
index 175715f1e3..b70e24f7e3 100644
--- a/hal/audio_extn/audio_extn.h
+++ b/hal/audio_extn/audio_extn.h
@@ -873,7 +873,11 @@ bool audio_extn_utils_is_dolby_format(audio_format_t format);

View File

@ -1,4 +1,4 @@
From 0ac1c1e654abcb39effc862b49ded02fcdf859e6 Mon Sep 17 00:00:00 2001
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Daniel Micay <danielmicay@gmail.com>
Date: Sun, 13 Feb 2022 00:55:33 -0500
Subject: [PATCH] allow toggling presidential alerts
@ -20,7 +20,7 @@ Date: Sun Mar 19 13:19:18 2023 -0400
7 files changed, 27 insertions(+), 9 deletions(-)
diff --git a/res/values/config.xml b/res/values/config.xml
index c4fd6000f..09ef04845 100644
index c4fd6000..09ef0484 100644
--- a/res/values/config.xml
+++ b/res/values/config.xml
@@ -22,7 +22,7 @@
@ -33,7 +33,7 @@ index c4fd6000f..09ef04845 100644
<bool name="show_extreme_alert_settings">true</bool>
<!-- Whether to show severe alert settings -->
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 66a8a306c..10d43df0a 100644
index 66a8a306..10d43df0 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -392,4 +392,6 @@
@ -44,7 +44,7 @@ index 66a8a306c..10d43df0a 100644
+ <string name="enable_cmas_presidential_alerts_summary_override">National warning messages.</string>
</resources>
diff --git a/res/xml/preferences.xml b/res/xml/preferences.xml
index fc0649e24..08c1ccf30 100644
index fc0649e2..08c1ccf3 100644
--- a/res/xml/preferences.xml
+++ b/res/xml/preferences.xml
@@ -45,9 +45,8 @@
@ -59,10 +59,10 @@ index fc0649e24..08c1ccf30 100644
<!-- Enable CMAS Extreme Threat alerts -->
diff --git a/src/com/android/cellbroadcastreceiver/CellBroadcastAlertService.java b/src/com/android/cellbroadcastreceiver/CellBroadcastAlertService.java
index d8633bb20..70125a08d 100644
index d8633bb2..70125a08 100644
--- a/src/com/android/cellbroadcastreceiver/CellBroadcastAlertService.java
+++ b/src/com/android/cellbroadcastreceiver/CellBroadcastAlertService.java
@@ -522,8 +522,8 @@ && checkAlertConfigEnabled(subId,
@@ -522,8 +522,8 @@ public class CellBroadcastAlertService extends Service {
}
// CMAS warning types
if (resourcesKey == R.array.cmas_presidential_alerts_channels_range_strings) {
@ -74,10 +74,10 @@ index d8633bb20..70125a08d 100644
if (resourcesKey == R.array.cmas_alert_extreme_channels_range_strings) {
return emergencyAlertEnabled && checkAlertConfigEnabled(
diff --git a/src/com/android/cellbroadcastreceiver/CellBroadcastChannelManager.java b/src/com/android/cellbroadcastreceiver/CellBroadcastChannelManager.java
index 973fab896..949cab2af 100644
index 973fab89..949cab2a 100644
--- a/src/com/android/cellbroadcastreceiver/CellBroadcastChannelManager.java
+++ b/src/com/android/cellbroadcastreceiver/CellBroadcastChannelManager.java
@@ -271,9 +271,9 @@ public CellBroadcastChannelRange(Context context, int subId,
@@ -271,9 +271,9 @@ public class CellBroadcastChannelManager {
}
break;
case KEY_ALWAYS_ON:
@ -91,10 +91,10 @@ index 973fab896..949cab2af 100644
case KEY_SCREEN_ON_DURATION:
mScreenOnDuration = Integer.parseInt(value);
diff --git a/src/com/android/cellbroadcastreceiver/CellBroadcastReceiver.java b/src/com/android/cellbroadcastreceiver/CellBroadcastReceiver.java
index 55f19f308..2c141d18d 100644
index 55f19f30..2c141d18 100644
--- a/src/com/android/cellbroadcastreceiver/CellBroadcastReceiver.java
+++ b/src/com/android/cellbroadcastreceiver/CellBroadcastReceiver.java
@@ -579,6 +579,8 @@ public void handleCdmaSmsCbProgramData(ArrayList<CdmaSmsCbProgramData> programDa
@@ -579,6 +579,8 @@ public class CellBroadcastReceiver extends BroadcastReceiver {
break;
case CdmaSmsCbProgramData.OPERATION_CLEAR_CATEGORIES:
@ -103,7 +103,7 @@ index 55f19f308..2c141d18d 100644
tryCdmaSetCategory(mContext,
CdmaSmsCbProgramData.CATEGORY_CMAS_EXTREME_THREAT, false);
tryCdmaSetCategory(mContext,
@@ -606,6 +608,12 @@ public void tryCdmaSetCategory(Context context, int category, boolean enable) {
@@ -606,6 +608,12 @@ public class CellBroadcastReceiver extends BroadcastReceiver {
SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(context);
switch (category) {
@ -117,10 +117,10 @@ index 55f19f308..2c141d18d 100644
sharedPrefs.edit().putBoolean(
CellBroadcastSettings.KEY_ENABLE_CMAS_EXTREME_THREAT_ALERTS, enable)
diff --git a/src/com/android/cellbroadcastreceiver/CellBroadcastSettings.java b/src/com/android/cellbroadcastreceiver/CellBroadcastSettings.java
index f8cdbb7e5..05e8af865 100644
index f8cdbb7e..05e8af86 100644
--- a/src/com/android/cellbroadcastreceiver/CellBroadcastSettings.java
+++ b/src/com/android/cellbroadcastreceiver/CellBroadcastSettings.java
@@ -456,6 +456,9 @@ public boolean onPreferenceChange(Preference pref, Object newValue) {
@@ -456,6 +456,9 @@ public class CellBroadcastSettings extends CollapsingToolbarBaseActivity {
if (mAreaUpdateInfoCheckBox != null) {
mAreaUpdateInfoCheckBox.setOnPreferenceChangeListener(startConfigServiceListener);
}
@ -130,7 +130,7 @@ index f8cdbb7e5..05e8af865 100644
if (mExtremeCheckBox != null) {
mExtremeCheckBox.setOnPreferenceChangeListener(startConfigServiceListener);
}
@@ -561,7 +564,9 @@ private void updatePreferenceVisibility() {
@@ -561,7 +564,9 @@ public class CellBroadcastSettings extends CollapsingToolbarBaseActivity {
if (mPresidentialCheckBox != null) {
mPresidentialCheckBox.setVisible(
@ -141,7 +141,7 @@ index f8cdbb7e5..05e8af865 100644
}
if (mExtremeCheckBox != null) {
@@ -723,6 +728,10 @@ public boolean onPreferenceChange(Preference pref, Object newValue) {
@@ -723,6 +728,10 @@ public class CellBroadcastSettings extends CollapsingToolbarBaseActivity {
private void setAlertsEnabled(boolean alertsEnabled) {

View File

@ -339,6 +339,7 @@ fi;
if enterAndClear "packages/apps/Messaging"; then
applyPatch "$DOS_PATCHES_COMMON/android_packages_apps_Messaging/0001-null-fix.patch"; #Handle null case (GrapheneOS)
applyPatch "$DOS_PATCHES_COMMON/android_packages_apps_Messaging/0002-missing-channels.patch"; #Add notification channels where missing (LineageOS)
fi;
if enterAndClear "packages/apps/PackageInstaller"; then

View File

@ -307,6 +307,7 @@ fi;
if enterAndClear "packages/apps/Messaging"; then
applyPatch "$DOS_PATCHES_COMMON/android_packages_apps_Messaging/0001-null-fix.patch"; #Handle null case (GrapheneOS)
applyPatch "$DOS_PATCHES_COMMON/android_packages_apps_Messaging/0002-missing-channels.patch"; #Add notification channels where missing (LineageOS)
fi;
if enterAndClear "packages/apps/Nfc"; then

View File

@ -314,6 +314,7 @@ fi;
if enterAndClear "packages/apps/Messaging"; then
applyPatch "$DOS_PATCHES_COMMON/android_packages_apps_Messaging/0001-null-fix.patch"; #Handle null case (GrapheneOS)
applyPatch "$DOS_PATCHES_COMMON/android_packages_apps_Messaging/0002-missing-channels.patch"; #Add notification channels where missing (LineageOS)
fi;
if enterAndClear "packages/apps/Nfc"; then

View File

@ -300,6 +300,7 @@ fi;
if enterAndClear "packages/apps/Messaging"; then
applyPatch "$DOS_PATCHES_COMMON/android_packages_apps_Messaging/0001-null-fix.patch"; #Handle null case (GrapheneOS)
applyPatch "$DOS_PATCHES_COMMON/android_packages_apps_Messaging/0002-missing-channels.patch"; #Add notification channels where missing (LineageOS)
fi;
if enterAndClear "packages/apps/Nfc"; then

View File

@ -292,6 +292,7 @@ fi;
if enterAndClear "packages/apps/Messaging"; then
applyPatch "$DOS_PATCHES_COMMON/android_packages_apps_Messaging/0001-null-fix.patch"; #Handle null case (GrapheneOS)
applyPatch "$DOS_PATCHES_COMMON/android_packages_apps_Messaging/0002-missing-channels.patch"; #Add notification channels where missing (LineageOS)
fi;
if enterAndClear "packages/apps/Nfc"; then

View File

@ -277,6 +277,7 @@ fi;
if enterAndClear "packages/apps/CellBroadcastReceiver"; then
applyPatch "$DOS_PATCHES/android_packages_apps_CellBroadcastReceiver/0001-presidential_alert_toggle.patch"; #Allow toggling presidential alertss (GrapheneOS)
fi;
if enterAndClear "packages/apps/Contacts"; then
applyPatch "$DOS_PATCHES_COMMON/android_packages_apps_Contacts/0001-No_Google_Links.patch"; #Remove Privacy Policy and Terms of Service links (GrapheneOS)
@ -597,7 +598,7 @@ awk -i inplace '!/hardware\/google\/pixel\/lineage_health\/device/' device/*/*/*
awk -i inplace '!/vendor.lineage.health-service.default/' device/*/*/*.mk;
#Don't trip rollback protection after October update
sed -i 's/2023-09-05/2023-10-01/' google/redbull/device-common.mk google/sunfish/device-common.mk google/gs201/device.mk google/gs101/device.mk;
sed -i 's/2023-09-05/2023-10-01/' device/google/redbull/device-common.mk device/google/sunfish/device-common.mk device/google/gs201/device.mk device/google/gs101/device.mk;
#
#END OF DEVICE CHANGES