Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions aw-server/src/android/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ pub mod android {
use std::path::PathBuf;
use std::sync::Mutex;

use crate::config::AWConfig;
use crate::endpoints;
use crate::endpoints::ServerState;
use aw_client_rust::blocking::AwClient;
Expand Down Expand Up @@ -127,7 +126,7 @@ pub mod android {
};
info!("Using server_state:: device_id: {}", server_state.device_id);

let mut server_config: AWConfig = AWConfig::default();
let mut server_config = crate::config::create_config(false, None);
server_config.port = 5600;

endpoints::build_rocket(server_state, server_config)
Expand Down
2 changes: 1 addition & 1 deletion aw-server/src/device_id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use crate::dirs;

/// Retrieves the device ID, if none exists it generates one (using UUID v4)
pub fn get_device_id() -> String {
// I chose get_data_dir over get_config_dir since the latter isn't yet supported on Android.
// Device IDs are mutable app data, so they live next to the datastore rather than config.
let mut path = dirs::get_data_dir().unwrap();
path.push("device_id");
if path.exists() {
Expand Down
2 changes: 1 addition & 1 deletion aw-server/src/dirs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ pub fn get_config_dir() -> Result<PathBuf, ()> {

#[cfg(target_os = "android")]
pub fn get_config_dir() -> Result<PathBuf, ()> {
panic!("not implemented on Android");
Ok(ANDROID_DATA_DIR.lock().unwrap().to_path_buf())
}

#[cfg(not(target_os = "android"))]
Expand Down
Loading