Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3345103
D8816.id30033.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
4 KB
Referenced Files
None
Subscribers
None
D8816.id30033.diff
View Options
diff --git a/native/android/app/build.gradle b/native/android/app/build.gradle
--- a/native/android/app/build.gradle
+++ b/native/android/app/build.gradle
@@ -384,7 +384,7 @@
def cxxBridgeCommonDir = "${nativeRustLibraryDir}/target/cxxbridge/rust"
task buildNativeRustLibrary(type: Exec) {
- commandLine "cargo", "build", "--manifest-path", nativeRustLibraryManifestPath
+ commandLine "cargo", "build", "--features", "android", "--manifest-path", nativeRustLibraryManifestPath
}
task copyNativeRustLibraryFiles(dependsOn: buildNativeRustLibrary, type: Copy) {
diff --git a/native/native_rust_library/Cargo.toml b/native/native_rust_library/Cargo.toml
--- a/native/native_rust_library/Cargo.toml
+++ b/native/native_rust_library/Cargo.toml
@@ -28,3 +28,6 @@
[lib]
crate-type = ["staticlib"]
+
+[features]
+android = []
diff --git a/native/native_rust_library/src/lib.rs b/native/native_rust_library/src/lib.rs
--- a/native/native_rust_library/src/lib.rs
+++ b/native/native_rust_library/src/lib.rs
@@ -23,6 +23,11 @@
RegistrationStartRequest, WalletLoginRequest,
};
+#[cfg(not(feature = "android"))]
+pub const DEVICE_TYPE: DeviceType = DeviceType::IOs;
+#[cfg(feature = "android")]
+pub const DEVICE_TYPE: DeviceType = DeviceType::Android;
+
lazy_static! {
pub static ref RUNTIME: Arc<Runtime> = Arc::new(
Builder::new_multi_thread()
@@ -231,7 +236,7 @@
}),
onetime_content_prekeys: password_user_info.content_onetime_keys,
onetime_notif_prekeys: password_user_info.notif_onetime_keys,
- device_type: DeviceType::Native.into(),
+ device_type: DEVICE_TYPE.into(),
}),
};
@@ -322,7 +327,7 @@
}),
onetime_content_prekeys: password_user_info.content_onetime_keys,
onetime_notif_prekeys: password_user_info.notif_onetime_keys,
- device_type: DeviceType::Native.into(),
+ device_type: DEVICE_TYPE.into(),
}),
};
diff --git a/services/identity/src/database.rs b/services/identity/src/database.rs
--- a/services/identity/src/database.rs
+++ b/services/identity/src/database.rs
@@ -70,11 +70,16 @@
}
#[derive(Clone, Copy)]
+#[allow(non_camel_case_types)]
pub enum Device {
// Numeric values should match the protobuf definition
Keyserver = 0,
Native,
Web,
+ iOS,
+ Android,
+ Windows,
+ MacOS,
}
impl TryFrom<i32> for Device {
@@ -85,6 +90,10 @@
0 => Ok(Device::Keyserver),
1 => Ok(Device::Native),
2 => Ok(Device::Web),
+ 3 => Ok(Device::iOS),
+ 4 => Ok(Device::Android),
+ 5 => Ok(Device::Windows),
+ 6 => Ok(Device::MacOS),
_ => Err(Error::Attribute(DBItemError {
attribute_name: USERS_TABLE_DEVICES_MAP_DEVICE_TYPE_ATTRIBUTE_NAME
.to_string(),
@@ -101,6 +110,10 @@
Device::Keyserver => write!(f, "keyserver"),
Device::Native => write!(f, "native"),
Device::Web => write!(f, "web"),
+ Device::iOS => write!(f, "ios"),
+ Device::Android => write!(f, "android"),
+ Device::Windows => write!(f, "windows"),
+ Device::MacOS => write!(f, "macos"),
}
}
}
diff --git a/shared/cmake/corrosion-cxx.cmake b/shared/cmake/corrosion-cxx.cmake
--- a/shared/cmake/corrosion-cxx.cmake
+++ b/shared/cmake/corrosion-cxx.cmake
@@ -3,7 +3,7 @@
# <_LIB_PATH_STEM> must match the crate name:
# "path/to/myrustcrate" -> "libmyrustcrate.a"
function(add_library_rust)
- set(value_keywords PATH NAMESPACE CXX_BRIDGE_SOURCE_FILE)
+ set(value_keywords PATH NAMESPACE FEATURES CXX_BRIDGE_SOURCE_FILE)
cmake_parse_arguments(
rust_lib
"${OPTIONS}"
@@ -42,7 +42,10 @@
set(namespace ${rust_lib_NAMESPACE})
set(cxx_bridge_source_file "${rust_lib_SOURCE_FOLDER}/lib.rs")
- corrosion_import_crate(MANIFEST_PATH "${lib_path}/Cargo.toml")
+ corrosion_import_crate(
+ MANIFEST_PATH "${lib_path}/Cargo.toml"
+ FEATURES "${rust_lib_FEATURES}"
+ )
get_filename_component(_LIB_PATH_STEM ${lib_path} NAME)
message(STATUS "Library stem path: ${_LIB_PATH_STEM}")
diff --git a/shared/protos/identity_client.proto b/shared/protos/identity_client.proto
--- a/shared/protos/identity_client.proto
+++ b/shared/protos/identity_client.proto
@@ -110,6 +110,10 @@
Keyserver = 0;
Native = 1;
Web = 2;
+ iOS = 3;
+ Android = 4;
+ Windows = 5;
+ MacOS = 6;
}
// Bundle of information needed for creating an initial message using X3DH
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Nov 23, 5:29 AM (18 h, 16 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2569095
Default Alt Text
D8816.id30033.diff (4 KB)
Attached To
Mode
D8816: [Native] Encode platform type in native_rust_library
Attached
Detach File
Event Timeline
Log In to Comment