From 15f5c8deeeed2f69a95bef30ff3babe673e9ad02 Mon Sep 17 00:00:00 2001 From: Torsten Grote Date: Mon, 17 May 2021 16:37:12 -0300 Subject: [PATCH] Fix hotspot notification on old APIs --- .../android/AndroidNotificationManagerImpl.java | 5 +++-- .../notification_hotspot.xml | 16 ++++++++++++++++ .../res/drawable-hdpi/notification_hotspot.png | Bin 0 -> 493 bytes .../res/drawable-mdpi/notification_hotspot.png | Bin 0 -> 316 bytes .../res/drawable-xhdpi/notification_hotspot.png | Bin 0 -> 621 bytes .../drawable-xxhdpi/notification_hotspot.png | Bin 0 -> 975 bytes 6 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 briar-android/src/main/res/drawable-anydpi-v24/notification_hotspot.xml create mode 100644 briar-android/src/main/res/drawable-hdpi/notification_hotspot.png create mode 100644 briar-android/src/main/res/drawable-mdpi/notification_hotspot.png create mode 100644 briar-android/src/main/res/drawable-xhdpi/notification_hotspot.png create mode 100644 briar-android/src/main/res/drawable-xxhdpi/notification_hotspot.png diff --git a/briar-android/src/main/java/org/briarproject/briar/android/AndroidNotificationManagerImpl.java b/briar-android/src/main/java/org/briarproject/briar/android/AndroidNotificationManagerImpl.java index 1cd973ab8..05135062e 100644 --- a/briar-android/src/main/java/org/briarproject/briar/android/AndroidNotificationManagerImpl.java +++ b/briar-android/src/main/java/org/briarproject/briar/android/AndroidNotificationManagerImpl.java @@ -734,7 +734,7 @@ class AndroidNotificationManagerImpl implements AndroidNotificationManager, } BriarNotificationBuilder b = new BriarNotificationBuilder(appContext, HOTSPOT_CHANNEL_ID); - b.setSmallIcon(R.drawable.ic_wifi_tethering); + b.setSmallIcon(R.drawable.notification_hotspot); b.setColorRes(R.color.briar_brand_green); b.setContentTitle( appContext.getText(R.string.hotspot_notification_title)); @@ -748,7 +748,8 @@ class AndroidNotificationManagerImpl implements AndroidNotificationManager, i.addFlags(FLAG_ACTIVITY_SINGLE_TOP); i.setAction(ACTION_STOP_HOTSPOT); PendingIntent actionIntent = getActivity(appContext, 0, i, 0); - b.addAction(R.drawable.ic_portable_wifi_off, actionTitle, actionIntent); + int icon = SDK_INT >= 21 ? R.drawable.ic_portable_wifi_off : 0; + b.addAction(icon, actionTitle, actionIntent); notificationManager.notify(HOTSPOT_NOTIFICATION_ID, b.build()); } diff --git a/briar-android/src/main/res/drawable-anydpi-v24/notification_hotspot.xml b/briar-android/src/main/res/drawable-anydpi-v24/notification_hotspot.xml new file mode 100644 index 000000000..e1535c8e4 --- /dev/null +++ b/briar-android/src/main/res/drawable-anydpi-v24/notification_hotspot.xml @@ -0,0 +1,16 @@ + + + + + diff --git a/briar-android/src/main/res/drawable-hdpi/notification_hotspot.png b/briar-android/src/main/res/drawable-hdpi/notification_hotspot.png new file mode 100644 index 0000000000000000000000000000000000000000..c46f4f0f0e0b461592f9a7a6000b4f022ca9278f GIT binary patch literal 493 zcmVS^I%QkCF8WxHYUR-4|Ex? zan_l93J;zrYUryucA$|a8_p}yM?>xKc9Cp6iW5uEVdE+jeT)h?&_|;jk8~|d&w(IC zDfl1swPK+Od`thOW*Uc9+|bwI3vp~w*Ru2+HZNY&?`%9X6hd(|!kHls)a2CsHr65_ zrYOHzI{c%RZzFi1&-k8PJ*oqktm28>hW?$)^eKz!KNEM&wME!Cg3hMby*Lu^Hhn?# zC^SJj2NNz#cLP3yoyOVOgI64J>Hy?bQL_je8e)ZgjFkW#^;L{L1sg_F jMZN?s?zz#u@fUmpf$z!pqM8|V00000NkvXXu0mjfU>oOA literal 0 HcmV?d00001 diff --git a/briar-android/src/main/res/drawable-mdpi/notification_hotspot.png b/briar-android/src/main/res/drawable-mdpi/notification_hotspot.png new file mode 100644 index 0000000000000000000000000000000000000000..7b925f098b390109a8ae189606574247c4a369d0 GIT binary patch literal 316 zcmV-C0mJ@@P)M ztak45{#Q`=Vr$T=bAJ(TY!&LA4MCBb9ysN>1>A6y@u+j{WrFQ)bzq2w(A!|By`T3>Z|ka+$K7k(!1*XAQSWmo1ej#5XL6a*@hlk z^v)9!*tE&hxg$`}8G?pq+^h&02N_F)Dx3Zno|V3UhVAoy0NTePKY=&S>(NonZci-$ O0000``X literal 0 HcmV?d00001 diff --git a/briar-android/src/main/res/drawable-xhdpi/notification_hotspot.png b/briar-android/src/main/res/drawable-xhdpi/notification_hotspot.png new file mode 100644 index 0000000000000000000000000000000000000000..59ce89496f38df2e2ea12f634890b0b8e9697b0b GIT binary patch literal 621 zcmV-z0+RiSP)vk${7X18{JafCDN42gLz600-b;FMG+RFWcrCI^2K#&FoC)?b~gd zkG8AT!oori5p8^IeSF2>>y7sPEB=Po$H~W&%5d)F!|M8vL18vJylW*LeR|e>L#J-S zynM7i8Xt!ke9ao?G*0)O1%(?RkDBJ}iC*NSeQ!bGiIGNorWomQ(4H!M;Z8MjDsO!3 zDeRGJ48CT~C@;?zvcr58lux%)xg+FCe5)E9)E#q^P(ICP(AN}ZLc^PQY$JC*)=+a8fK05~V7IYo}4;=F*YB;#Gkz-z{ng3dQAzFRmKJ%WWC&Qh^Qg7W2Z zpkpHoIxpik1}+aC3VbjJ`t-6TD#0?q_s2TGD7sxlDThN8%Ey5;ogJ$|3)PjBhT}bMQAHMX2RbiDI^y8rSAi@Q;~-~2Pp^+jxCs=dS&F$P>J92h$wT>r zI?PR?inAXps`yvd9?JJ%{p<)d{2tBz+oRz}*=SD{H2ksZ-f70(Sc5q2dkb!$8XD~> z!CqDCv}YC+PRE04K86aeiM8n^`w=J{=fN?bVs72S!d!j;6*272JGs~O00000NkvXX Hu0mjf2zDD# literal 0 HcmV?d00001 diff --git a/briar-android/src/main/res/drawable-xxhdpi/notification_hotspot.png b/briar-android/src/main/res/drawable-xxhdpi/notification_hotspot.png new file mode 100644 index 0000000000000000000000000000000000000000..57c39a2e3696d2907c5126b513ba38af6cb860a7 GIT binary patch literal 975 zcmV;=12FuFP)U2m0YDSSeH<@&{L16>owi2j{gcE*?{e}-)N@3dbEp1(oS4)@ z9Q!ich3w;aQ2&1&q~*qBuFW1lwM=8+r#L>x`51;c`Z(U>2zl@`f1~XZ^xbLPRfz%L zB#9Cx{ECV_LrvCRD)LR|tpWpSl7Cq zKWn7O7bd!dl!*Q>SGKwJ++2!0+5%b&G)SJUBXb=~9QL*u&`_{5{vHZZ@#5M}woODe92N zCFsK|ZV=s3HM58gT5(7^M|ZBM9h^PE-?Gi)!_j-Ird3@vu)zKhDW6@D3P6kJF6isk6O!{}B;b)T&>_hVQnl8sqHIu;ZonGwT6Kq7|b>hURIDS_F ztiN9Dp|n>4dvNH|XvIF1_N>{9ro>#dupMc|u3a7FR0SrU4(w9xOMBK_#L;WaN3jR7 z_oclGP7)_U?0QP|V&`dhky4-MXiPnYuTq${J&3&(yE%SgmsW{)C+gMFid_o}rM(Kr z$xiGwn_Y`9X+_(p0M_45?4h(*0lSC1fWHi@O%|ont81jS2fELRKk`KC^EnsP-zr9{+?1JgIgm z^p$-oJJntd`2SCw2&$h8eW=sS_4d^{kc!jJ@tAH@I~V%MzDgL&94xDW@f$}_`%>s@ x4ZpKMdL!ud_wRtTBHppWp|r8Fv9a;r@dsAdjHP%7Qab