Use node model state to update the android notification #331

Manually merged
johnny9 merged 1 commit from jni-notifications into main 2023-06-03 22:03:51 +00:00 AGit
johnny9 commented 2023-04-23 17:30:37 +00:00 (Migrated from github.com)

The AndroidNotifier class connects to the NodeModel's state signals and uses JNI to send callbacks to the Android service managing the foreground notification.

Windows
Intel macOS
Apple Silicon macOS
ARM64 Android

The AndroidNotifier class connects to the NodeModel's state signals and uses JNI to send callbacks to the Android service managing the foreground notification. [![Windows](https://img.shields.io/badge/OS-Windows-green)](https://api.cirrus-ci.com/v1/artifact/github/bitcoin-core/gui-qml/win64/unsecure_win_gui.zip?branch=pull/331) [![Intel macOS](https://img.shields.io/badge/OS-Intel%20macOS-green)](https://api.cirrus-ci.com/v1/artifact/github/bitcoin-core/gui-qml/macos/unsecure_mac_gui.zip?branch=pull/331) [![Apple Silicon macOS](https://img.shields.io/badge/OS-Apple%20Silicon%20macOS-green)](https://api.cirrus-ci.com/v1/artifact/github/bitcoin-core/gui-qml/macos_arm64/unsecure_mac_arm64_gui.zip?branch=pull/331) [![ARM64 Android](https://img.shields.io/badge/OS-Android-green)](https://api.cirrus-ci.com/v1/artifact/github/bitcoin-core/gui-qml/android/unsecure_android_apk.zip?branch=pull/331)
johnny9 commented 2023-04-23 23:03:45 +00:00 (Migrated from github.com)

from 6e0d079 to 1ef10e1

  • Fixed lint error
  • Made sure androidnotifier module is only compiled when targeting android using TARGET_ANDROID autotools conditional
from[ 6e0d079 ](https://github.com/bitcoin-core/gui-qml/commit/6e0d079fbb3fdffbcb835b628a52f416b5deb6e5)to 1ef10e1 - Fixed lint error - Made sure androidnotifier module is only compiled when targeting android using TARGET_ANDROID autotools conditional
johnny9 commented 2023-04-24 00:10:33 +00:00 (Migrated from github.com)

paused notif.png

block height notif.png

connecting notif.png

![paused notif.png](https://user-images.githubusercontent.com/985648/233874300-1720cb25-c25d-424d-a74b-1fae5b408f88.png) ![block height notif.png](https://user-images.githubusercontent.com/985648/233874299-6d149317-9e50-41ea-91da-e2bfe13d9646.png) ![connecting notif.png](https://user-images.githubusercontent.com/985648/233874345-b61a7cf4-3dc6-4796-b4a3-96c405395ec6.png)
johnny9 commented 2023-04-24 01:10:44 +00:00 (Migrated from github.com)
https://github.com/BitcoinDesign/Bitcoin-Core-App/issues/53
johnny9 commented 2023-05-08 00:17:39 +00:00 (Migrated from github.com)

from 1ef10e1 to 90d250d

  • rebased with main
from[ 1ef10e1 ](https://github.com/bitcoin-core/gui-qml/commit/1ef10e138486e74586799ecf0d8eef3f9499af78)to 90d250d - rebased with main
hebasto commented 2023-05-30 09:16:38 +00:00 (Migrated from github.com)

Needs rebase.

Needs rebase.
jarolrod (Migrated from github.com) reviewed 2023-05-31 11:42:51 +00:00
jarolrod (Migrated from github.com) commented 2023-05-31 11:41:10 +00:00

Concept ACK, I've been running and testing this for a few days. The only issue I've noticed is that the "Paused" state won't be represented in the Notification if we were syncing before pressing paused. If we were connecting or any other state, it'll show. But not if we were syncing.

Concept ACK, I've been running and testing this for a few days. The only issue I've noticed is that the "Paused" state won't be represented in the Notification if we were syncing before pressing paused. If we were connecting or any other state, it'll show. But not if we were syncing.
jarolrod (Migrated from github.com) commented 2023-05-31 11:42:39 +00:00
https://github.com/BitcoinDesign/Bitcoin-Core-App/issues/53#issuecomment-1570033328
johnny9 commented 2023-05-31 12:58:30 +00:00 (Migrated from github.com)

Update from eb53a46 to acd2d3e:

  • rebased with main
Update from[ eb53a46 ](https://github.com/bitcoin-core/gui-qml/commit/eb53a46f4a7a1043d1b3cbff8d517d6d4ac1b3ba)to acd2d3e: - rebased with main
johnny9 commented 2023-05-31 23:41:28 +00:00 (Migrated from github.com)

update from acd2d3e to b641df4:

  • fixed merge error on previous rebase. (#include qml/nodemodel.h to qml/models/nodemodel.h)
update from[ acd2d3e ](https://github.com/bitcoin-core/gui-qml/commit/acd2d3e0ca55654afc03f1074e4c5d32d0473cfa)to b641df4: - fixed merge error on previous rebase. (#include qml/nodemodel.h to qml/models/nodemodel.h)
jarolrod (Migrated from github.com) reviewed 2023-06-02 19:21:41 +00:00
jarolrod (Migrated from github.com) left a comment

Approach ACK

I've been learning more about what we really need to do here in order to interact with the Android and the JVM, and this code is looking good here.

The androidnotifier.cpp file contains the importance pieces of magic. We're gaining access to the JVM and storing it. Then we're setting up the wiring between nodeModel updates to calls into our BitcoinQt Service to update the notification text.

@johnny9 are you able to reproduce this: https://github.com/bitcoin-core/gui-qml/pull/331/files#r1211573422

Approach ACK I've been learning more about what we really need to do here in order to interact with the Android and the JVM, and this code is looking good here. The androidnotifier.cpp file contains the importance pieces of magic. We're gaining access to the JVM and storing it. Then we're setting up the wiring between nodeModel updates to calls into our BitcoinQt Service to update the notification text. @johnny9 are you able to reproduce this: https://github.com/bitcoin-core/gui-qml/pull/331/files#r1211573422
johnny9 (Migrated from github.com) reviewed 2023-06-03 01:09:43 +00:00
johnny9 (Migrated from github.com) commented 2023-06-03 01:09:43 +00:00

What state does it show? I'm having a hard time reproducing

What state does it show? I'm having a hard time reproducing
jarolrod (Migrated from github.com) reviewed 2023-06-03 01:21:03 +00:00
jarolrod (Migrated from github.com) commented 2023-06-03 01:21:03 +00:00

Well now I also can't reproduce, may have just lagged in showing the update for whatever reason android decided.

Well now I also can't reproduce, may have just lagged in showing the update for whatever reason android decided.
jarolrod (Migrated from github.com) approved these changes 2023-06-03 01:21:20 +00:00
jarolrod (Migrated from github.com) left a comment
ACK b641df470c94eabb4cb2559c831a942b086bd3db
Sign in to join this conversation.
No description provided.