Skip to content

Commit

Permalink
Implement missing notify_new_access_method_event function for `JniE…
Browse files Browse the repository at this point in the history
…ventListener`
  • Loading branch information
MarkusPettersson98 committed Dec 20, 2023
1 parent 4444640 commit f78b40e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
4 changes: 2 additions & 2 deletions mullvad-daemon/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,7 @@ pub trait EventListener {
fn notify_remove_device_event(&self, event: RemoveDeviceEvent);

/// Notify that the api access method changed.
fn notify_new_access_method(&self, new_access_method: AccessMethodSetting);
fn notify_new_access_method_event(&self, new_access_method: AccessMethodSetting);
}

pub struct Daemon<L: EventListener> {
Expand Down Expand Up @@ -1253,7 +1253,7 @@ where
endpoint: api_endpoint,
} => {
let _ = update_fw(api_endpoint).await;
self.event_listener.notify_new_access_method(settings);
self.event_listener.notify_new_access_method_event(settings);
}
AccessMethodEvent::Testing {
endpoint: api_endpoint,
Expand Down
2 changes: 1 addition & 1 deletion mullvad-daemon/src/management_interface.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1021,7 +1021,7 @@ impl EventListener for ManagementInterfaceEventBroadcaster {
})
}

fn notify_new_access_method(
fn notify_new_access_method_event(
&self,
new_access_method: mullvad_types::access_method::AccessMethodSetting,
) {
Expand Down
6 changes: 6 additions & 0 deletions mullvad-jni/src/jni_event_listener.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use jnix::{
};
use mullvad_daemon::EventListener;
use mullvad_types::{
access_method::AccessMethodSetting,
device::{DeviceEvent, RemoveDeviceEvent},
relay_list::RelayList,
settings::Settings,
Expand Down Expand Up @@ -71,6 +72,11 @@ impl EventListener for JniEventListener {
fn notify_remove_device_event(&self, event: RemoveDeviceEvent) {
let _ = self.0.send(Event::RemoveDeviceEvent(event));
}

// TODO: Implement this function when API access methods is implemented in
// the Android app.
#[allow(dead_code, unused_variables)]
fn notify_new_access_method_event(&self, access_method: AccessMethodSetting) {}
}

struct JniEventHandler<'env> {
Expand Down

0 comments on commit f78b40e

Please sign in to comment.