Skip to content

Commit

Permalink
fix: Use PRODUCT for Pico platform detection
Browse files Browse the repository at this point in the history
  • Loading branch information
curoviyxru committed Feb 1, 2025
1 parent d66be50 commit 9b9d975
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 21 deletions.
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

0 comments on commit 9b9d975

Please sign in to comment.