General info page
glitch128 opened this issue · 3 comments
Is your feature request related to a problem? Please describe.
N/A
Describe the solution you'd like
A new page with info such as
- Network info(signal strength, speed, name, other connections)
- Battery info(charge percentage)
- Media info and controls(name, author if applicable, progress, app, album, cover image if possible[I don't know if this is])
- Bluetooth connections(currently connected devices, discoverable devices, ability to connect to unpaired device[don't know if this is possible])
Describe alternatives you've considered
N/A
Additional context
For Network, I have found that you can use dumpsys wifi
For Battery, you can use dumpsys battery
For Media, you can use dumpsys media_session
for all info, dumpsys media_session | grep "metadata"
for:
Song, Artist(s), and Album in that order,
while dumpsys media_session | grep "state=PlaybackState"
can get this string of data:
state=PlaybackState {state=PAUSED(2), position=0, buffered position=0, speed=0.0, updated=19086885, actions=3025844, custom actions=[Action:mName='Shuffle on, mIcon=2131232952, mExtras=Bundle[mParcelledData.dataSize=144], Action:mName='Remove from collection, mIcon=2131232911, mExtras=Bundle[mParcelledData.dataSize=144], Action:mName='Start radio, mIcon=2131232956, mExtras=null, Action:mName='Stop repeating one track, mIcon=2131232949, mExtras=Bundle[mParcelledData.dataSize=144]], active item id=23, error=null}
this is what I can understand from this: state=PAUSED(2)
changes to state=PLAYING(3)
when music is playing, position=0
is the progress of the time(?), and custom actions
are the controls that show as buttons. for testing, I used Spotify.
I don't know yet if it is possible to control the audio from adb yet, but I will keep looking.
For Bluetooth connections, you can use dumpsys bluetooth_manager | grep "(Connected)"
to get the currently connected Bluetooth devices, but to get all devices, you can use dumpsys bluetooth_manager | sed -n '/Bonded devices:/,/^$/p'
as with Media Session, I don't know if it's possible to connect devices yet, but I will keep looking.
[UPDATE]
I just found out that you can use input keyevent
to control the media(even though you probably already know this)
from https://gist.github.com/Pulimet/5013acf2cd5b28e55036c82c91bd56d8,
85 --> "KEYCODE_MEDIA_PLAY_PAUSE"
86 --> "KEYCODE_MEDIA_STOP"
87 --> "KEYCODE_MEDIA_NEXT"
88 --> "KEYCODE_MEDIA_PREVIOUS"
these are the keycodes that would be used for the media controls.
Also, on this screen, I just realized that volume controls would probably be helpful.
hello, another feature that I would like to request is Notifications, which you can access by running the command
dumpsys notification
, but app the option --noredact
to get the notification's content, but the output is very long, so try using grep
or sed
to shorten it and only get the notifications.
edit: you can use dumpsys notification --noredact | sed -n '/Notification List/,/^$/p'
to get the notifications only, but the output is still pretty long. I will try to shorten the output further.