Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Use PRODUCT for Pico platform detection #2681

Merged
merged 1 commit into from
Feb 1, 2025
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
4 changes: 4 additions & 0 deletions alvr/system_info/src/android.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ pub fn manufacturer_name() -> String {
build_string("MANUFACTURER")
}

pub fn product_name() -> String {
build_string("PRODUCT")
}

fn get_system_service<'a>(env: &mut JNIEnv<'a>, service_name: &str) -> JObject<'a> {
let service_str = env.new_string(service_name).unwrap();

Expand Down
50 changes: 29 additions & 21 deletions alvr/system_info/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,29 +115,37 @@ pub fn platform() -> Platform {
let manufacturer = android::manufacturer_name();
let model = android::model_name();
let device = android::device_name();
let product = android::product_name();

alvr_common::info!("manufacturer: {manufacturer}, model: {model}, device: {device}");
alvr_common::info!(
"manufacturer: {manufacturer}, model: {model}, device: {device}, product: {product}"
);

match (manufacturer.as_str(), model.as_str(), device.as_str()) {
("Oculus", _, "monterey") => Platform::Quest1,
("Oculus", _, "hollywood") => Platform::Quest2,
("Oculus", _, "eureka") => Platform::Quest3,
("Oculus", _, "panther") => Platform::Quest3S,
("Oculus", _, "seacliff") => Platform::QuestPro,
("Oculus", _, _) => Platform::QuestUnknown,
("Pico", "Pico Neo 3" | "Pico Neo3 Link", _) => Platform::PicoNeo3,
("Pico", "A8A10", _) => Platform::Pico4Pro,
("Pico", "A8E50", _) => Platform::Pico4Enterprise,
("Pico", "A8110", _) => Platform::Pico4,
("Pico", "A9210", _) => Platform::Pico4Ultra,
("Pico", "A7Q10", _) => Platform::PicoG3,
("Pico", _, _) => Platform::PicoUnknown,
("HTC", "VIVE Focus 3", _) => Platform::Focus3,
("HTC", "VIVE Focus Vision", _) => Platform::FocusVision,
("HTC", "VIVE XR Series", _) => Platform::XRElite,
("HTC", _, _) => Platform::ViveUnknown,
("YVR", _, _) => Platform::Yvr,
("Lynx Mixed Reality", _, _) => Platform::Lynx,
match (
manufacturer.as_str(),
model.as_str(),
device.as_str(),
product.as_str(),
) {
("Oculus", _, "monterey", _) => Platform::Quest1,
("Oculus", _, "hollywood", _) => Platform::Quest2,
("Oculus", _, "eureka", _) => Platform::Quest3,
("Oculus", _, "panther", _) => Platform::Quest3S,
("Oculus", _, "seacliff", _) => Platform::QuestPro,
("Oculus", _, _, _) => Platform::QuestUnknown,
("Pico", "Pico Neo 3" | "Pico Neo3 Link", _, _) => Platform::PicoNeo3,
("Pico", _, _, "PICO 4 Pro") => Platform::Pico4Pro,
("Pico", _, _, "PICO 4 Enterprise") => Platform::Pico4Enterprise,
("Pico", _, _, "PICO 4") => Platform::Pico4,
("Pico", _, _, "PICO 4 Ultra") => Platform::Pico4Ultra,
("Pico", _, _, "PICO G3") => Platform::PicoG3,
("Pico", _, _, _) => Platform::PicoUnknown,
("HTC", "VIVE Focus 3", _, _) => Platform::Focus3,
("HTC", "VIVE Focus Vision", _, _) => Platform::FocusVision,
("HTC", "VIVE XR Series", _, _) => Platform::XRElite,
("HTC", _, _, _) => Platform::ViveUnknown,
("YVR", _, _, _) => Platform::Yvr,
("Lynx Mixed Reality", _, _, _) => Platform::Lynx,
_ => Platform::AndroidUnknown,
}
}
Expand Down
Loading