From ec45c570db3799bf66048b3aa138cd18b96159bd Mon Sep 17 00:00:00 2001
From: Torsten Grote <t@grobox.de>
Date: Fri, 10 Dec 2021 15:18:50 -0300
Subject: [PATCH] Add proper notification icon for foreground notification

Needs to have raster versions for lower API levels (< 24).
---
 .../android/MailboxNotificationManager.kt        |   2 +-
 .../ic_notification_foreground.xml               |  15 +++++++++++++++
 .../drawable-hdpi/ic_notification_foreground.png | Bin 0 -> 461 bytes
 .../drawable-mdpi/ic_notification_foreground.png | Bin 0 -> 280 bytes
 .../ic_notification_foreground.png               | Bin 0 -> 640 bytes
 .../ic_notification_foreground.png               | Bin 0 -> 931 bytes
 6 files changed, 16 insertions(+), 1 deletion(-)
 create mode 100644 mailbox-android/src/main/res/drawable-anydpi-v24/ic_notification_foreground.xml
 create mode 100644 mailbox-android/src/main/res/drawable-hdpi/ic_notification_foreground.png
 create mode 100644 mailbox-android/src/main/res/drawable-mdpi/ic_notification_foreground.png
 create mode 100644 mailbox-android/src/main/res/drawable-xhdpi/ic_notification_foreground.png
 create mode 100644 mailbox-android/src/main/res/drawable-xxhdpi/ic_notification_foreground.png

diff --git a/mailbox-android/src/main/java/org/briarproject/mailbox/android/MailboxNotificationManager.kt b/mailbox-android/src/main/java/org/briarproject/mailbox/android/MailboxNotificationManager.kt
index a259a302..fa67a900 100644
--- a/mailbox-android/src/main/java/org/briarproject/mailbox/android/MailboxNotificationManager.kt
+++ b/mailbox-android/src/main/java/org/briarproject/mailbox/android/MailboxNotificationManager.kt
@@ -74,7 +74,7 @@ class MailboxNotificationManager @Inject constructor(
             return NotificationCompat.Builder(ctx, CHANNEL_ID)
                 .setContentTitle(ctx.getString(R.string.notification_mailbox_title))
                 .setContentText(ctx.getString(R.string.notification_mailbox_content))
-                .setSmallIcon(R.drawable.ic_launcher_foreground)
+                .setSmallIcon(R.drawable.ic_notification_foreground)
                 .setContentIntent(pendingIntent)
                 .setPriority(PRIORITY_MIN)
                 .build()
diff --git a/mailbox-android/src/main/res/drawable-anydpi-v24/ic_notification_foreground.xml b/mailbox-android/src/main/res/drawable-anydpi-v24/ic_notification_foreground.xml
new file mode 100644
index 00000000..e6104ddb
--- /dev/null
+++ b/mailbox-android/src/main/res/drawable-anydpi-v24/ic_notification_foreground.xml
@@ -0,0 +1,15 @@
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+	android:width="24dp"
+	android:height="24dp"
+	android:viewportWidth="24"
+	android:viewportHeight="24">
+	<group
+		android:scaleX="0.64941174"
+		android:scaleY="0.64941174"
+		android:translateX="2.2588236"
+		android:translateY="0.96">
+		<path
+			android:fillColor="#ffffff"
+			android:pathData="M3.334,0C2.4499,-0 1.6017,0.3579 0.9766,0.9941C0.3514,1.6304 0,2.4928 0,3.3926L0,25.1055C0,26.0053 0.3514,26.8696 0.9766,27.5059C1.6017,28.1421 2.4499,28.498 3.334,28.498L21.4902,28.498L27.5391,33.6426C28.5157,34.4732 30,33.766 30,32.4707L30,3.3926C30,2.4928 29.6485,1.6304 29.0234,0.9941C28.3983,0.3579 27.55,0 26.666,0L3.334,0zM5.334,5.4277L24.666,5.4277L24.666,15.0332L17.9121,15.0332L17.9121,18.3555L20.3828,18.3555C20.8283,18.3555 21.0512,18.904 20.7363,19.2246L15.4102,24.6445C15.2149,24.8432 14.8984,24.8432 14.7031,24.6445L9.377,19.2246C9.062,18.904 9.285,18.3555 9.7305,18.3555L12.2012,18.3555L12.2012,15.0332L5.334,15.0332L5.334,5.4277z" />
+	</group>
+</vector>
diff --git a/mailbox-android/src/main/res/drawable-hdpi/ic_notification_foreground.png b/mailbox-android/src/main/res/drawable-hdpi/ic_notification_foreground.png
new file mode 100644
index 0000000000000000000000000000000000000000..3a8fb15ba1a045dd1d4d6bbf356103eae1bd8d11
GIT binary patch
literal 461
zcmeAS@N?(olHy`uVBq!ia0vp^Dj>|k1|%Oc%$UKzz&ORz#WAEJ?(K}+TqZ{m*NF{N
zybdr<ZD5i4V!4nniqj%PRbe4t-t)A}nlf$MtvPi}UV1*e{&&XdG+~bJqwx-xcFmbC
zJ>T?wZcvZ)+2eiR=LhgetED9zmYu4^cGp<oPT)q5?>sE!Av%|0Ev9VVf64O2oCkef
zuDhnPS`~_)p87R<Np$1_;qr|!k^8AASltr3IN9|w$3c))?h&R||Je6t@3@kF^F@T*
z%iv#4vZCE3=05_GJ-Q!NC+~1H2nV{7)y+Ngm;b|rZAlZ~wRA5wsqNu>rY-hT?qSZ9
zU&m%xoSUC8@g3)tz*q9gOvZIU^)5D9r?~GZ?N|&{FUj$4g~-QF5N)wgV&3VWNw3;i
z%uOzS*b)|Q5&e|q{XR=6yE{vl%Y8ZD)D}2DW^pyIk<`A5@BGFu+KnE4&A2e_SL}rk
j*ZbptJp2Ce@CV+VU%ivBX5|V1qlv-O)z4*}Q$iB}=uFSk

literal 0
HcmV?d00001

diff --git a/mailbox-android/src/main/res/drawable-mdpi/ic_notification_foreground.png b/mailbox-android/src/main/res/drawable-mdpi/ic_notification_foreground.png
new file mode 100644
index 0000000000000000000000000000000000000000..e2db859527dabf48159265d869503331ecf819a1
GIT binary patch
literal 280
zcmV+z0q6dSP)<h;3K|Lk000e1NJLTq000;O000;W1^@s6;CDUv0002rNkl<ZcwWVo
zT@k`C5QHnCQgA>eAR!WvfCMB|0us&v7Lb60BRi03y2)gL@bk^wLnq(uK6KI!!>@4n
zG0xfhLB`1WD45yoVCH-j7+W0}=X1d&&f&$uPC^!xf<W#|K_K^~Adve~5XgNg2;@Eq
zxGY<m)#ZuL6P@Rm)N(g1<OMY*@>^K$riH&1?AcA=jO7Q$ZmR%<iXT|YF!oge2$|ao
z2eu?HOR4}MScQYP3!bG~uw$!(vH-+`jhCNcH76tz#@StX`8PCny7BePH$MLee*ZpQ
e;~e?yYuo^xo2SEf{O%|K0000<MNUMnLSTYUL3pMB

literal 0
HcmV?d00001

diff --git a/mailbox-android/src/main/res/drawable-xhdpi/ic_notification_foreground.png b/mailbox-android/src/main/res/drawable-xhdpi/ic_notification_foreground.png
new file mode 100644
index 0000000000000000000000000000000000000000..c85b6626b9e7726309dbbad7f83c7c388ff987c9
GIT binary patch
literal 640
zcmeAS@N?(olHy`uVBq!ia0vp^1|ZDA1|-9oezr3(Fu8lWIEGZjy}kM0_jZ8D(L%R`
zmYxfOMoh{TEqND=nHHBYODvSWz<Y}~ul7~MuD@~Y&u1=w_V=KB71Pn@|2FU_3i0#L
zXA>3l|6JMqyL$F{;qTSgV+<Ca<WPIJGm~##gyjU`@4C+}gop8_Jlc0uMrbvg(z|Gj
zBdZ!aev9#K%u;x?uhn^t*O8k1c?TDE&d`@h3RQYm{h5c)_ejk{fz?8W_h+XUWGFr3
zZjYGS@$;Tdv$L>aJW#vKneWdeWoC8!Jfs+=nzYaS{DTWFXT<q7Y6*VcTgle0mb9;+
zBeZkI`?JOtCW4>Ivf@dq-Tkt2owniowoQCq+4=g&JfJaIC28lUt~b2n@g@@J3b*uc
zF+Zga_hONf-T(aataIWZ`AzF`6~F1oBwg)G|F$D^%Xy({5x$MD*o1$->3o{`Cuy;4
z(tMyV?q(#d&wg~{liD{eU?4Pi{?+Ky&rjM9lrjB~RK5R*`*ib->A)b7%DvYTzdPnP
z$HsghkMGBGwLgEKZtV|>DxK}T#_Gj;-x$CCr@nW#1O3k|_+2;Y%zxfBM{2t*zev2T
zfAn9x@V>9%yI_Ixy;{@!`|c;NS+4l5vV7y86aOA83-9>q-0@WH&zA2UTb*Z$*E~C>
zaE(X(UOltmXXmb`yeY5GI-lXwp4P8mU&t(6?A-ly`tPrs_UyMa`uy_VKL$CDdG?2=
S9w-H-ECx?kKbLh*2~7YvmNJL{

literal 0
HcmV?d00001

diff --git a/mailbox-android/src/main/res/drawable-xxhdpi/ic_notification_foreground.png b/mailbox-android/src/main/res/drawable-xxhdpi/ic_notification_foreground.png
new file mode 100644
index 0000000000000000000000000000000000000000..170f1d5ab39b5b45aeede7f546287831ffb6d294
GIT binary patch
literal 931
zcmeAS@N?(olHy`uVBq!ia0vp^9w5xY1|&n@Zgyv2V9xS%aSW-5dwcs~;pG5<BOj+s
z5DIegx*?>YIM+orz{#qS&x3s#^NR-;l+qOH-&miV^k-7~|FkcyiQn(q@|;t7_U_%Y
zXUn#B?2w=T{G;WO<K+_b)8AEWo1ypo_HE-`59Yqx`CduyNAQ)^rPEE?*v-l^9^BjP
zD*yjk2;ZIRX@)-zEbFr^_<u=4DB4QxU3^i8uB`BPeaj=$`Z|A4mr3$Ie&nw=-$vDs
zLYJqrynk8Q`4hrdd=~xLN5)9;8Ax(ia~{e+tc(0%^YKjZvHQO(RN`&D>r(XQMFIm#
zTDszy=Enazk7la2-`KRVF@2uU@AFEeNgcYbd|vpxjq0*;!)JeUTx~W#5r{tb<<z^i
zJ$L6<-k5ph-6ZFn$cGdEW*`0X@c{EV%jq{jQKbE+gI8a3+y6I9D%?&gZd<eEr0UUc
z(~}=rf*jHqI$h*<OkZdERGFmHZs&F_x$(Zp$7VgyV6!bRCMDfJZTRsF(A1kZ)_8aQ
z)jxiu7#M}A>@QW1rs^F(vKhotch}d{E4Nge2eQk$s@Sve=4r#fn}68=<<j>9<?1aV
zNk#mDx77!6eTO^yMJ~^OwpHN!{8XNQDZ$H++)eLHl|T0H1c>o+zf0`l)gE_hw;BG?
z{Iy@D@V)D!_uFl%Ro~T2oAK||&$smz>E~~S@7R$Yo>bLZ|NI(v$K1P}FSS2}=h;oZ
zaee6wy_c=G&nuLb>Q4J_;qm6hy&YeK^A#1Jt#1<VuY6yS^eyYi7ryYnk9D7|^SbiB
zfd5R)Qj33l+i$0{+bya1J#~A0=>J;#KhK^$OR8hk*g17y+VlTHz|6<s>FVdQ&MBb@
E0M~cGe*gdg

literal 0
HcmV?d00001

-- 
GitLab