Skip to content
This repository has been archived by the owner on Apr 12, 2022. It is now read-only.

Notification using MessagingStyle #2880

Merged
merged 33 commits into from
Mar 18, 2019
Merged

Notification using MessagingStyle #2880

merged 33 commits into from
Mar 18, 2019

Conversation

bmarty
Copy link
Member

@bmarty bmarty commented Jan 17, 2019

We create this WIP pull request to make this work publicly visible
Fixes #2823
Fixes #1016

@bmarty
Copy link
Member Author

bmarty commented Jan 17, 2019

@thelimitbreaker you may be interested to give some feedback on this / new idea, as you were proposing to help us on this subject

@RotBolt
Copy link
Contributor

RotBolt commented Jan 18, 2019

@bmarty yes ! You said once the Notifications channel is done . I would be able to do the part for Notifications . For which I also posted the sample screenshots. In #2823 . It would be good if Riot would implement the notifications in that style since it's chat app

@bmarty
Copy link
Member Author

bmarty commented Jan 21, 2019

@bmarty yes ! You said once the Notifications channel is done . I would be able to do the part for Notifications . For which I also posted the sample screenshots. In #2823 . It would be good if Riot would implement the notifications in that style since it's chat app

Actually this PR implements #2823

@RotBolt
Copy link
Contributor

RotBolt commented Jan 22, 2019

@bmarty ok . So I would also work on this . I thought this just for Channels .
Once I fix my machine dependencies and become free from My Talk . I will start doing work on this . Is that fine ?

@bmarty
Copy link
Member Author

bmarty commented Jan 22, 2019

@thelimitbreaker , yes.
@BillCarsonFr told me that the PR is ready for review, so next step is to review code and test the feature on various devices.
I will be happy to merge the PR quite quickly, to make the code land to develop and get feedbacks from the early adopters downloading the APK from Jenkins
Benoit

@bmarty bmarty changed the title Notification rework - WIP Notification using MessagingStyle Jan 22, 2019
@bmarty bmarty added this to the Sprint 18 milestone Jan 22, 2019
Copy link
Member Author

@bmarty bmarty left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work!
Here is some remarks :)

CHANGES.rst Outdated Show resolved Hide resolved
refreshMessagesNotification();
}
});

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code does nothing then.
Either it should do something, else we can remove it.
BingRules update are managed somewhere else now?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No i think it can be removed. I am not sure it makes sense to reorganize all already recieved notifications when rules have changed.

@@ -233,23 +194,41 @@ public void run() {
private final MXEventListener mEventsListener = new MXEventListener() {
@Override
public void onBingEvent(Event event, RoomState roomState, BingRule bingRule) {
Log.d(LOG_TAG, "%%%%%%%% MXEventListener: the event " + event);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove this log (privacy)

@@ -1667,7 +999,7 @@ else if (null == CallsManager.getSharedInstance().getActiveCall()) {
Notification notification = NotificationUtils.INSTANCE.buildIncomingCallNotification(
EventStreamService.this,
isVideo,
RoomsNotifications.getRoomName(getApplicationContext(), session, room, event),
room.getRoomDisplayName(this)/*RoomsNotifications.getRoomName(getApplicationContext(), session, room, event)*/,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove commented code

PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE);
PowerManager.WakeLock wl = pm.newWakeLock(
WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON | PowerManager.ACQUIRE_CAUSES_WAKEUP,
"riot:MXEventListener");
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rename the tag

@RotBolt
Copy link
Contributor

RotBolt commented Jan 24, 2019

I am afraid , I couldn't couldn't contribute to this one . 😓.

How can I download the apk from Jenkins Benoit. Atleast , I would like to test it . Or is there something else I could do ?

@bmarty
Copy link
Member Author

bmarty commented Jan 24, 2019

I am afraid , I couldn't couldn't contribute to this one . 😓.

How can I download the apk from Jenkins Benoit. Atleast , I would like to test it . Or is there something else I could do ?

You should be able to checkout Valere's branch feature/notification_rework to build and deploy the APK

@RotBolt
Copy link
Contributor

RotBolt commented Jan 27, 2019

I am afraid , I couldn't couldn't contribute to this one . sweat.
How can I download the apk from Jenkins Benoit. Atleast , I would like to test it . Or is there something else I could do ?

You should be able to checkout Valere's branch feature/notification_rework to build and deploy the APK

Cool On to it now .From the past few days machine was broke. Now onto it.

@RotBolt
Copy link
Contributor

RotBolt commented Jan 27, 2019

I am getting this during building

image

Problem is in im/vector/actvity/policies/AccountCreationTermsPolicy

List<LocalizedFlowDataLoginTerms> is used for sending the data through intent but
list of data from intent should be of Parceable Type.

LocalizedFlowDataLoginTerms is defined in matrix sdk. jar. So can't edit this class.

Possible solution :

LocalizedFlowDataLoginTerms contains String members
just make new ParceableLocalizedFlowDataLoginTerms . this version will implement the Parceable and copy the contents of 'LocalizedFlowDataLoginTerms'.

And then we can use this for sending the List from
LoginActvity to AccountCreationTermsPolicy

@bmarty
Copy link
Member Author

bmarty commented Jan 28, 2019

@thelimitbreaker this compilation issue is observed because the Android Matrix SDK library is not up to date until the next release. Please follow instructions here to fix the compilation issue.

@bmarty bmarty modified the milestones: Sprint 18, Sprint 19 Jan 28, 2019
@RotBolt
Copy link
Contributor

RotBolt commented Jan 28, 2019

@bmarty thank you for pointing that. Able to do it

@RotBolt
Copy link
Contributor

RotBolt commented Jan 31, 2019

@bmarty Sorry for the delay
I found App is crashing on opening room settings

Reason is error in inflating in XML files as seen in this

crash-reason

Reason of crash I found is use of ?attr/colors in layout xml. Use of colors mentioned in colors.xml make the app working

Ensure smart reply pending intent have unique action per room
Push with with no data when background sync is off are displayed as simple anonymous notif. After a sync the event can be resolved, and is merged in a messaging style notif but the former simple notif was still on screen
+ put summary line in resources
+ fix after restart sometimes only summary is shown
Messages read on other device or web are now removed from notifications
Code Review
And do not ask battery optimisation for normal (not needed, Firebase high push will whitelist)
@bmarty bmarty merged commit 409cf1e into develop Mar 18, 2019
@bmarty bmarty deleted the feature/notification_rework branch March 18, 2019 09:39
@bmarty bmarty mentioned this pull request Apr 17, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants