From dd3f1d31a8abdc7966e1c32664714866021a4644 Mon Sep 17 00:00:00 2001 From: dan <64416644+brittle-bones@users.noreply.github.com> Date: Fri, 10 Oct 2025 22:08:30 +0100 Subject: [PATCH 1/7] Support material you. --- AndroidManifest.xml | 86 ++++---- app/build.gradle.kts | 1 + .../add_contacts_confirmation_dialog_body.xml | 2 +- .../blocked_participant_list_item_view.xml | 2 +- res/layout/compose_message_view.xml | 2 +- res/layout/contact_list_item_view.xml | 12 +- res/layout/conversation_list_item_view.xml | 26 +-- res/layout/conversation_message_view.xml | 2 +- res/layout/person_item_view.xml | 2 +- res/layout/sim_selector_item_view.xml | 2 +- res/values-v31/colors.xml | 185 ++++++++++++++++++ res/values/attrs.xml | 2 +- res/values/dimens.xml | 3 + res/values/themes.xml | 8 + .../android/messaging/BugleApplication.java | 22 ++- .../android/messaging/ui/ContactIconView.java | 2 +- 16 files changed, 279 insertions(+), 80 deletions(-) create mode 100644 res/values-v31/colors.xml create mode 100644 res/values/themes.xml diff --git a/AndroidManifest.xml b/AndroidManifest.xml index a1698f89..c914d565 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -67,7 +67,7 @@ android:roundIcon="@mipmap/ic_launcher_round" android:appCategory="social" android:label="@string/app_name" - android:theme="@style/BugleTheme" + android:theme="@style/BugleThemeMaterial3" android:supportsRtl="true"> @@ -159,7 +159,7 @@ android:configChanges="orientation|screenSize|keyboardHidden" android:screenOrientation="user" android:theme="@style/BuglePhotoViewTheme" - /> + /> - + + android:authorities="${applicationId}.datamodel.MessagingContentProvider" + android:exported="false" > + android:authorities="${applicationId}.datamodel.MmsFileProvider" + android:grantUriPermissions="true" + android:exported="false" /> + android:authorities="${applicationId}.datamodel.MediaScratchFileProvider" + android:grantUriPermissions="true" + android:exported="false" /> + android:permission="android.permission.BIND_JOB_SERVICE" + android:exported="true"/> + android:permission="android.permission.BIND_JOB_SERVICE" + android:exported="true"/> + android:enabled="false" + android:exported="true" + android:permission="android.permission.BROADCAST_SMS"> @@ -356,23 +356,23 @@ + android:exported="true" + android:permission="android.permission.BROADCAST_WAP_PUSH"> + android:exported="true" + android:permission="android.permission.BROADCAST_SMS"> + android:exported="false"> @@ -391,8 +391,8 @@ + android:permission="android.permission.SEND_RESPOND_VIA_MESSAGE" + android:exported="true" > @@ -404,17 +404,17 @@ + android:configChanges="orientation|screenSize|keyboardHidden" + android:screenOrientation="user" + android:label="@string/class_0_message_activity" + android:theme="@style/BugleTheme.DialogActivity" + android:launchMode="singleTask" + android:excludeFromRecents="true"> + android:theme="@style/Translucent" + android:configChanges="orientation|screenSize|keyboardHidden" /> @@ -462,33 +462,33 @@ + android:exported="false" + android:label="@string/widget_conversation_name"> + android:resource="@xml/widget_conversation_list" /> + android:exported="false" + android:label="@string/widget_conversation_name"> + android:resource="@xml/widget_conversation" /> + android:permission="android.permission.BIND_REMOTEVIEWS" + android:exported="false" /> + android:permission="android.permission.BIND_REMOTEVIEWS" + android:exported="false" /> diff --git a/res/layout/blocked_participant_list_item_view.xml b/res/layout/blocked_participant_list_item_view.xml index 7ac0ec92..4a21e637 100644 --- a/res/layout/blocked_participant_list_item_view.xml +++ b/res/layout/blocked_participant_list_item_view.xml @@ -26,7 +26,7 @@ android:layout_width="@dimen/contact_list_icon_size" android:layout_height="@dimen/contact_list_icon_size" android:importantForAccessibility="no" - app:iconSize="normal" + app:iconSize="@dimen/icon_normal_size" android:layout_gravity="center_vertical"/> + android:contentDescription="@null"/> @@ -64,10 +64,10 @@ android:layout_height="wrap_content" android:layout_gravity="center_vertical" > - + + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_weight="1" + android:background="@android:color/transparent"> + android:id="@+id/work_profile_icon" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="right" + android:background="@android:color/transparent" + android:scaleType="center" + android:src="@drawable/ic_work_profile" + android:visibility="gone"/> diff --git a/res/layout/person_item_view.xml b/res/layout/person_item_view.xml index 9645024a..05327903 100644 --- a/res/layout/person_item_view.xml +++ b/res/layout/person_item_view.xml @@ -26,7 +26,7 @@ android:layout_width="@dimen/contact_list_icon_size" android:layout_height="@dimen/contact_list_icon_size" android:importantForAccessibility="no" - app:iconSize="normal" + app:iconSize="@dimen/icon_normal_size" android:layout_gravity="center_vertical" /> + app:iconSize="@dimen/icon_normal_size" /> diff --git a/res/values-v31/colors.xml b/res/values-v31/colors.xml new file mode 100644 index 00000000..951dd8fa --- /dev/null +++ b/res/values-v31/colors.xml @@ -0,0 +1,185 @@ + + + + @color/material_dynamic_primary40 + @color/material_dynamic_secondary40 + @color/material_dynamic_neutral40 + @color/material_dynamic_tertiary40 + + @color/material_dynamic_primary50 + @color/material_dynamic_secondary50 + @color/material_dynamic_neutral20 + @color/material_dynamic_tertiary50 + + @color/background_color_dark + + + #ffffff + @color/primary_color + @color/primary_color_dark + #ffffff + @color/background_color + @color/background_color_dark + + + #636363 + #323232 + #F05A24 + #DE000000 + #8A000000 + + #44000000 + + #000000 + #99323232 + #99ffffff + #99ff0000 + #000000 + + #ff323232 + #000000 + #99ffffff + #6a6a6a + #007fce + #99ff0000 + #ffffffff + #99ffffff + #ffffffff + + @android:color/transparent + #670099cc + #cc0099cc + #6733b5e5 + + #ffffffff + #ffffffff + #6a6a6a + #ff323232 + #eeeeee + #9d9d9d + @color/primary_color + #999999 + #ffffffff + #e2e2e2 + #ffffffff + #8BC34A + #80689F38 + #ff808080 + + + #ff0000 + + + #7f040000 + + #d2d2d2 + #40000000 + #4d4d4d + #999999 + + @android:color/white + #a0ffffff + #44000000 + #ddffffff + @android:color/white + @color/primary_color + #ffffff + #4285f4 + #ededed + #33000000 + @android:color/white + + #80000000 + + #80ffffff + + #eeeeee + #6733b5e5 + #44000000 + + #ffffff + + #29000000 + #30000000 + #40000000 + #323232 + #323232 + @color/primary_color + + #40000000 + + #DE000000 + #8A000000 + #8A000000 + #a2a2a2 + @color/primary_color + #ff0000 + #DE000000 + + #4d4d4d + #6d6d6d + #6d6d6d + #cccccc + + @color/primary_color + #3ea4dc + #40ffffff + + #555555 + #8BC34A + #6d6d6d + #ff000000 + @color/primary_color + #40000000 + @color/primary_color + + #4d4d4d + #999999 + #cceeeeee + #ffeeeeee + #ffffff + #323232 + + #80689F38 + #b0dddddd + + #03a9f4 + #4d4d4d + + #4d4d4d + #6d6d6d + #333333 + #000000 + + @color/primary_color + + #424242 + @android:color/white + #424242 + #ffffff + #40000000 + #FFFFFF + + #eeeeee + #eeeeee + + #1e000000 + #42000000 + #ffffff + + #F1F1F1 + diff --git a/res/values/attrs.xml b/res/values/attrs.xml index d02cfab0..2888e21c 100644 --- a/res/values/attrs.xml +++ b/res/values/attrs.xml @@ -16,7 +16,7 @@ --> - + diff --git a/res/values/dimens.xml b/res/values/dimens.xml index 59a4148f..a6f988a2 100644 --- a/res/values/dimens.xml +++ b/res/values/dimens.xml @@ -16,6 +16,9 @@ --> + 42dp + 56dp + 12dp 56dp 8dp 20sp diff --git a/res/values/themes.xml b/res/values/themes.xml new file mode 100644 index 00000000..efff4341 --- /dev/null +++ b/res/values/themes.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/src/com/android/messaging/BugleApplication.java b/src/com/android/messaging/BugleApplication.java index 8470ca19..de9c7cb8 100644 --- a/src/com/android/messaging/BugleApplication.java +++ b/src/com/android/messaging/BugleApplication.java @@ -26,6 +26,7 @@ import android.os.Looper; import android.telephony.CarrierConfigManager; +import com.google.android.material.color.DynamicColors; import com.android.messaging.datamodel.DataModel; import com.android.messaging.receiver.SmsReceiver; import com.android.messaging.sms.BugleUserAgentInfoLoader; @@ -71,6 +72,7 @@ public static boolean isRunningTests() { @Override public void onCreate() { Trace.beginSection("app.onCreate"); + DynamicColors.applyToActivitiesIfAvailable(this); super.onCreate(); // Note onCreate is called in both test and real application environments @@ -124,17 +126,17 @@ public void initializeSync(final Factory factory) { private static void registerCarrierConfigChangeReceiver(final Context context) { context.registerReceiver(new BroadcastReceiver() { - @Override - public void onReceive(Context context, Intent intent) { - LogUtil.i(TAG, "Carrier config changed. Reloading MMS config."); - MmsConfig.loadAsync(); - } - }, new IntentFilter(CarrierConfigManager.ACTION_CARRIER_CONFIG_CHANGED), - Context.RECEIVER_EXPORTED/*UNAUDITED*/); + @Override + public void onReceive(Context context, Intent intent) { + LogUtil.i(TAG, "Carrier config changed. Reloading MMS config."); + MmsConfig.loadAsync(); + } + }, new IntentFilter(CarrierConfigManager.ACTION_CARRIER_CONFIG_CHANGED), + Context.RECEIVER_EXPORTED/*UNAUDITED*/); } private static void initMmsLib(final Context context, final BugleGservices bugleGservices, - final CarrierConfigValuesLoader carrierConfigValuesLoader) { + final CarrierConfigValuesLoader carrierConfigValuesLoader) { MmsManager.setCarrierConfigValuesLoader(carrierConfigValuesLoader); MmsManager.setUserAgentInfoLoader(new BugleUserAgentInfoLoader(context)); } @@ -195,14 +197,14 @@ private void maybeStartProfiling() { if (file != null) { android.os.Debug.startMethodTracing(file.getAbsolutePath(), 160 * 1024 * 1024); new Handler(Looper.getMainLooper()).postDelayed( - new Runnable() { + new Runnable() { @Override public void run() { android.os.Debug.stopMethodTracing(); // Allow world to see trace file DebugUtils.ensureReadable(file); LogUtil.d(LogUtil.PROFILE_TAG, "Tracing complete - " - + file.getAbsolutePath()); + + file.getAbsolutePath()); } }, 30000); } diff --git a/src/com/android/messaging/ui/ContactIconView.java b/src/com/android/messaging/ui/ContactIconView.java index 44983ab5..64fd3ddc 100644 --- a/src/com/android/messaging/ui/ContactIconView.java +++ b/src/com/android/messaging/ui/ContactIconView.java @@ -57,7 +57,7 @@ public ContactIconView(final Context context, final AttributeSet attrs) { final Resources resources = context.getResources(); final TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.ContactIconView); - final int iconSizeId = a.getInt(R.styleable.ContactIconView_iconSize, 0); + final int iconSizeId = a.getInt(R.styleable.ContactIconView_contactIconSize, 0); switch (iconSizeId) { case NORMAL_ICON_SIZE_ID: mIconSize = (int) resources.getDimension( From 9edb70f86db28dd5533801d497aef4845a69fc13 Mon Sep 17 00:00:00 2001 From: dan <64416644+brittle-bones@users.noreply.github.com> Date: Sun, 19 Oct 2025 14:51:18 +0100 Subject: [PATCH 2/7] Adjust colours. Remove unused v31/styles.xml. --- AndroidManifest.xml | 2 +- res/values-v31/colors.xml | 26 +++++++++++++------------- res/values/themes.xml | 8 -------- 3 files changed, 14 insertions(+), 22 deletions(-) delete mode 100644 res/values/themes.xml diff --git a/AndroidManifest.xml b/AndroidManifest.xml index c914d565..39d6bdcd 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -67,7 +67,7 @@ android:roundIcon="@mipmap/ic_launcher_round" android:appCategory="social" android:label="@string/app_name" - android:theme="@style/BugleThemeMaterial3" + android:theme="@style/BugleTheme" android:supportsRtl="true"> diff --git a/res/values-v31/colors.xml b/res/values-v31/colors.xml index 951dd8fa..929392e0 100644 --- a/res/values-v31/colors.xml +++ b/res/values-v31/colors.xml @@ -20,17 +20,17 @@ @color/material_dynamic_neutral40 @color/material_dynamic_tertiary40 - @color/material_dynamic_primary50 - @color/material_dynamic_secondary50 - @color/material_dynamic_neutral20 - @color/material_dynamic_tertiary50 + @color/material_dynamic_primary30 + @color/material_dynamic_secondary30 + @color/material_dynamic_neutral30 + @color/material_dynamic_tertiary30 @color/background_color_dark #ffffff @color/primary_color - @color/primary_color_dark + @color/primary_color #ffffff @color/background_color @color/background_color_dark @@ -76,8 +76,8 @@ #ffffffff #e2e2e2 #ffffffff - #8BC34A - #80689F38 + @color/primary_color_dark + @color/primary_color_dark #ff808080 @@ -135,15 +135,15 @@ #6d6d6d #cccccc - @color/primary_color - #3ea4dc - #40ffffff + @color/tertiary_color + @color/tertiary_color_dark + @color/background_color #555555 - #8BC34A + @color/tertiary_color #6d6d6d #ff000000 - @color/primary_color + @color/tertiary_color #40000000 @color/primary_color @@ -154,7 +154,7 @@ #ffffff #323232 - #80689F38 + @color/tertiary_color_dark #b0dddddd #03a9f4 diff --git a/res/values/themes.xml b/res/values/themes.xml deleted file mode 100644 index efff4341..00000000 --- a/res/values/themes.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - \ No newline at end of file From 9f11e4ee09d5d9acf72183572fcc4b402c883ff4 Mon Sep 17 00:00:00 2001 From: dan <64416644+brittle-bones@users.noreply.github.com> Date: Sun, 19 Oct 2025 14:58:03 +0100 Subject: [PATCH 3/7] Revert indentation. --- AndroidManifest.xml | 83 +++++++++++++++++++++++---------------------- 1 file changed, 42 insertions(+), 41 deletions(-) diff --git a/AndroidManifest.xml b/AndroidManifest.xml index 39d6bdcd..ec0c2a9c 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -159,7 +159,7 @@ android:configChanges="orientation|screenSize|keyboardHidden" android:screenOrientation="user" android:theme="@style/BuglePhotoViewTheme" - /> + /> + android:authorities="${applicationId}.datamodel.MessagingContentProvider" + android:exported="false" > + android:authorities="${applicationId}.datamodel.MmsFileProvider" + android:grantUriPermissions="true" + android:exported="false" /> + android:authorities="${applicationId}.datamodel.MediaScratchFileProvider" + android:grantUriPermissions="true" + android:exported="false" /> + android:permission="android.permission.BIND_JOB_SERVICE" + android:exported="true"/> + android:permission="android.permission.BIND_JOB_SERVICE" + android:exported="true"/> + android:enabled="false" + android:exported="true" + android:permission="android.permission.BROADCAST_SMS"> @@ -356,23 +356,23 @@ + android:exported="true" + android:permission="android.permission.BROADCAST_WAP_PUSH"> + android:exported="true" + android:permission="android.permission.BROADCAST_SMS"> + android:exported="false"> @@ -391,8 +391,8 @@ + android:permission="android.permission.SEND_RESPOND_VIA_MESSAGE" + android:exported="true" > @@ -404,17 +404,17 @@ + android:configChanges="orientation|screenSize|keyboardHidden" + android:screenOrientation="user" + android:label="@string/class_0_message_activity" + android:theme="@style/BugleTheme.DialogActivity" + android:launchMode="singleTask" + android:excludeFromRecents="true"> + android:theme="@style/Translucent" + android:configChanges="orientation|screenSize|keyboardHidden" /> @@ -462,33 +462,33 @@ + android:exported="false" + android:label="@string/widget_conversation_name"> + android:resource="@xml/widget_conversation_list" /> + android:exported="false" + android:label="@string/widget_conversation_name"> + android:resource="@xml/widget_conversation" /> + android:permission="android.permission.BIND_REMOTEVIEWS" + android:exported="false" /> + android:permission="android.permission.BIND_REMOTEVIEWS" + android:exported="false" /> + From a2e68d9151becb497e0ad553c6e3a5a422d4f955 Mon Sep 17 00:00:00 2001 From: dan <64416644+brittle-bones@users.noreply.github.com> Date: Sun, 19 Oct 2025 14:58:42 +0100 Subject: [PATCH 4/7] rm newline. --- AndroidManifest.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/AndroidManifest.xml b/AndroidManifest.xml index ec0c2a9c..56557fb6 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -500,4 +500,3 @@ - From ce22490af557be0ce7f40325fb747b9faa69be13 Mon Sep 17 00:00:00 2001 From: dan <64416644+brittle-bones@users.noreply.github.com> Date: Sun, 19 Oct 2025 15:05:26 +0100 Subject: [PATCH 5/7] Revert some styling. --- .../android/messaging/BugleApplication.java | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/com/android/messaging/BugleApplication.java b/src/com/android/messaging/BugleApplication.java index de9c7cb8..848066ce 100644 --- a/src/com/android/messaging/BugleApplication.java +++ b/src/com/android/messaging/BugleApplication.java @@ -126,17 +126,17 @@ public void initializeSync(final Factory factory) { private static void registerCarrierConfigChangeReceiver(final Context context) { context.registerReceiver(new BroadcastReceiver() { - @Override - public void onReceive(Context context, Intent intent) { - LogUtil.i(TAG, "Carrier config changed. Reloading MMS config."); - MmsConfig.loadAsync(); - } - }, new IntentFilter(CarrierConfigManager.ACTION_CARRIER_CONFIG_CHANGED), - Context.RECEIVER_EXPORTED/*UNAUDITED*/); + @Override + public void onReceive(Context context, Intent intent) { + LogUtil.i(TAG, "Carrier config changed. Reloading MMS config."); + MmsConfig.loadAsync(); + } + }, new IntentFilter(CarrierConfigManager.ACTION_CARRIER_CONFIG_CHANGED), + Context.RECEIVER_EXPORTED/*UNAUDITED*/); } private static void initMmsLib(final Context context, final BugleGservices bugleGservices, - final CarrierConfigValuesLoader carrierConfigValuesLoader) { + final CarrierConfigValuesLoader carrierConfigValuesLoader) { MmsManager.setCarrierConfigValuesLoader(carrierConfigValuesLoader); MmsManager.setUserAgentInfoLoader(new BugleUserAgentInfoLoader(context)); } @@ -204,7 +204,7 @@ public void run() { // Allow world to see trace file DebugUtils.ensureReadable(file); LogUtil.d(LogUtil.PROFILE_TAG, "Tracing complete - " - + file.getAbsolutePath()); + + file.getAbsolutePath()); } }, 30000); } From 68a109b23b1b0c568aa6a8dbcb0b80062f2ce6e2 Mon Sep 17 00:00:00 2001 From: dan <64416644+brittle-bones@users.noreply.github.com> Date: Sun, 19 Oct 2025 15:18:50 +0100 Subject: [PATCH 6/7] Change permission check activity background to primary color. --- res/values-v31/colors.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/res/values-v31/colors.xml b/res/values-v31/colors.xml index 929392e0..53e3ae62 100644 --- a/res/values-v31/colors.xml +++ b/res/values-v31/colors.xml @@ -25,7 +25,7 @@ @color/material_dynamic_neutral30 @color/material_dynamic_tertiary30 - @color/background_color_dark + @color/primary_color #ffffff From 25d4ba126e8d2249127cc8d046af6ab4dee9e74b Mon Sep 17 00:00:00 2001 From: dan <64416644+brittle-bones@users.noreply.github.com> Date: Sun, 19 Oct 2025 15:58:24 +0100 Subject: [PATCH 7/7] Add hashes for new deps. --- gradle/verification-metadata.xml | 138 +++++++++++++++++++++++++++++++ 1 file changed, 138 insertions(+) diff --git a/gradle/verification-metadata.xml b/gradle/verification-metadata.xml index c2473f57..16cb1d05 100644 --- a/gradle/verification-metadata.xml +++ b/gradle/verification-metadata.xml @@ -52,6 +52,11 @@ + + + + + @@ -60,6 +65,14 @@ + + + + + + + + @@ -137,6 +150,14 @@ + + + + + + + + @@ -154,6 +175,9 @@ + + + @@ -192,6 +216,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + @@ -290,6 +338,22 @@ + + + + + + + + + + + + + + + + @@ -348,6 +412,22 @@ + + + + + + + + + + + + + + + + @@ -439,6 +519,11 @@ + + + + + @@ -626,6 +711,14 @@ + + + + + + + + @@ -658,6 +751,22 @@ + + + + + + + + + + + + + + + + @@ -1215,6 +1324,14 @@ + + + + + + + + @@ -2614,6 +2731,11 @@ + + + + + @@ -2942,6 +3064,14 @@ + + + + + + + + @@ -2974,6 +3104,14 @@ + + + + + + + +