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

[Suggestion] Put user-friendly name of device in window name #601

Open
Plandercozeron opened this issue Jun 17, 2019 · 2 comments
Open

[Suggestion] Put user-friendly name of device in window name #601

Plandercozeron opened this issue Jun 17, 2019 · 2 comments

Comments

@Plandercozeron
Copy link

Plandercozeron commented Jun 17, 2019

For testing purpose
shell getprop ro.product.model returns models as SM-G960F (Galaxy S9) for samsung devices.
Things like Motorola return readable user-friendly names, i.e. Motorola E4 Plus.
But sometimes they don't: XT1635-02 (Motorola Z Play).
I remember all models which i work with by heart. But eye catches easily when you have window named Samsung Galaxy S6 Edge+ (SM-G928F)
shell settings get secure bluetooth_name returns almost on every device (Galaxy S4 mini is still GT-9195. But it's initially called like that so doesn't matter) its name if it wasn't changed by user.
How reasonable is getting the name from settings?
It's kind of slow. Or maybe i'm doing that wrong. Because if you make loop which gets info about all connected devices

#!/bin/bash
for serial in $(adb devices | awk 'NR>1{print $1}');
	do
		echo  $(adb -s $serial shell settings get secure bluetooth_name | sed "s/\\r//g")
	done

it would work significantly slower than

#!/bin/bash
for serial in $(adb devices | awk 'NR>1{print $1}');
	do
		echo  $(adb -s $serial shell getprop ro.product.model | sed "s/\\r//g")
	done
@rom1v
Copy link
Collaborator

rom1v commented Jun 17, 2019

In #573 (comment), the "bluetooth name" could be a variable (like %b) in the custom pattern (not implemented yet).

It's kind of slow.

It's just because you execute settings, so you have the same behavior as input: #231 (comment). In scrcpy, it would be retrieved directly by the server via a method call.

@Plandercozeron
Copy link
Author

Plandercozeron commented Jun 18, 2019

Right. Thanks for explanation.
Also

shell settings get global wifi_p2p_device_name

returns device type (Phone, Tablet) on Android 6+

on 0215394544313237:    [Phone]  Galaxy S6 edge+
on 4200c004ecd5b361:    [Phone]  Galaxy J5 Prime
on 4ccd2337:                     Galaxy S4
on 5200b0beb46215cb:    [Phone]  Galaxy J7 Neo
on 7a58571a:            [Phone]  Galaxy A5
on abafba0b:            [Tablet] Galaxy Tab A

But returns null on Blackberry and Motorola. Probably on other non-samsung devices too. So not an option

UPD:
Went through #573. That would be a nice option to use patterns. Way more flexible. And you can consider list of parameters which could be put in window title through patterns (such as IP address or Android version)

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

No branches or pull requests

2 participants