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

feat(adb): add client flavors and autolaunch #2515

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

E1int
Copy link
Contributor

@E1int E1int commented Nov 16, 2024

No description provided.

@@ -24,7 +25,7 @@ impl WiredConnection {
Ok(Self { adb_path })
}

pub fn setup(&self, control_port: u16, stream_port: u16) -> Result<WiredConnectionStatus> {
pub fn setup(&self, control_port: u16, settings: &Settings) -> Result<WiredConnectionStatus> {
Copy link
Member

@zmerp zmerp Nov 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would pass the minimum subset of settings as parameter. This would be ConnectionConfig

Comment on lines +1124 to +1132
#[schema(strings(
help = r#"Wether ALVR should try to automatically launch the client when establishing a wired connection."#
))]
pub client_autolaunch: bool,

#[schema(strings(
help = r#"Which type of client should ALVR look for when establishing a wired connection."#
))]
pub client_flavor: ClientFlavor,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would rename these to wired_client_autolaunch and wired_client_version_check. I would also switch the order of these two settings. The reason is wired_client_autolaunch requires wired_client_version_check

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

version_check makes no sense tho, this isn't about a the v version, which is probably going to confuse people

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right. it's that "flavor" may sound a bit funny. I don't have better ideas so let's use wired_client_flavor_check

Copy link
Collaborator

@The-personified-devil The-personified-devil Nov 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wired_client_type and maybe adjust the help string to "Which type of release of the client ..."

Comment on lines +53 to +67
let process_name = match &settings.connection.client_flavor {
ClientFlavor::Store => if alvr_common::is_stable() {
"alvr.client"
} else {
"alvr.client.dev"
}
.to_owned(),
ClientFlavor::Github => if alvr_common::is_stable() {
"alvr.client.stable"
} else {
"alvr.client.dev"
}
.to_owned(),
ClientFlavor::Custom(name) => name.clone(),
};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is missing the fallbacks.
Store: store -> gh
GitHub: gh -> store
Custom: custom -> store -> gh

Skip store if not stable.

You can implement this by storing a slice to process_names. At this point it would be better to extract the package names to string constants.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants