Skip to content

Use Build.MODEL for device hostname instead of Build.PRODUCT#209

Open
pappz wants to merge 1 commit into
mainfrom
fix/device-hostname-use-build-model
Open

Use Build.MODEL for device hostname instead of Build.PRODUCT#209
pappz wants to merge 1 commit into
mainfrom
fix/device-hostname-use-build-model

Conversation

@pappz

@pappz pappz commented Jul 1, 2026

Copy link
Copy Markdown
Collaborator

Summary

The Android client uses deviceName() in ChangeServerFragment as the peer hostname reported to the NetBird management server (flows through LoginWithSetupKeyAndSaveConfigsystem.DeviceNameCtxKeyInfo.Hostname).

It previously returned Build.PRODUCT, which is the internal AOSP build product name (e.g. raven, sdk_gphone64_arm64) — not human-readable.

This changes it to Build.MODEL, the user-facing model name (e.g. Pixel 6), giving a more recognizable peer hostname in the NetBird dashboard.

Change

app/src/main/java/io/netbird/client/ui/server/ChangeServerFragment.java

 private String deviceName() {
-    return Build.PRODUCT;
+    return Build.MODEL;
 }

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Improved the device name shown when changing servers by using a more accurate device model identifier.

Build.PRODUCT returns the internal AOSP build product name
(e.g. "raven", "sdk_gphone64_arm64"), which is not human-readable.
Build.MODEL returns the user-facing model name (e.g. "Pixel 6"),
which makes for a more recognizable peer hostname in NetBird.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: af9d63bf-7ed5-4a5b-81bf-0306549451be

📥 Commits

Reviewing files that changed from the base of the PR and between 51e79af and 67713ed.

📒 Files selected for processing (1)
  • app/src/main/java/io/netbird/client/ui/server/ChangeServerFragment.java

📝 Walkthrough

Walkthrough

A single-line change modifies the deviceName() method in ChangeServerFragment.java to return Build.MODEL instead of Build.PRODUCT, altering the device identifier value sent via DEVICE_NAME_KEY.

Changes

Device Identifier Update

Layer / File(s) Summary
Device name source switch
app/src/main/java/io/netbird/client/ui/server/ChangeServerFragment.java
deviceName() now returns Build.MODEL instead of Build.PRODUCT.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Poem

A tiny hop, a single line,
Model now stands where Product did shine,
One rabbit twitch, one field to change,
A small step made, yet nothing strange. 🐇

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change from Build.PRODUCT to Build.MODEL for the device hostname.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/device-hostname-use-build-model

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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.

1 participant