Add support for OnePlus' "Alert Slider"
See original GitHub issueIs your feature request related to a problem? Please describe.
When I toggle the do not disturb switch on my OnePlus (7T) phone, it is not being registered by the DnD sensor (because it uses a different ~API~ settings key).
Describe the solution you’d like
DnD should indicate the state of the alert slider on OnePlus devices (with maybe a setting to opt-out of the alert slider, if present)
Describe alternatives you’ve considered, if any
- You could toggle the Android DnD via Assistant, but that defeats the whole purpose of the hardware switch
Additional context
The global setting for the slider is three_Key_mode
with it’s values being:
3 -> Ring == off
2 -> Vibrate == vibrate
(~= priority_only
?)
1 -> Silence == alarms_only
Basic sample:
contentResolver.query(Settings.Global.CONTENT_URI, null, null, null, null).use {
it!!.moveToFirst()
val res = try {
Settings.Global.getInt(
applicationContext.contentResolver,
"three_Key_mode"
)
} catch (e: Settings.SettingNotFoundException) {
findViewById<TextView>(R.id.txt).text = "No alert slider"
return@use
}
findViewById<TextView>(R.id.txt).text = when (res) {
1 -> "alarms_only"
2 -> "vibrate"
3 -> "off"
else -> "unknown"
}
}
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
More Alert Slider Customization? - OnePlus Community
Just got this phone yesterday and loving it so far. My biggest problem with it though is that I can't modify the alert...
Read more >OnePlus Alert Slider Customization now possible with an ...
A new Xposed module for the OnePlus 5 and OnePlus 5T makes customizing the phones' alert sliders a cinch. Here's everything you need...
Read more >The OnePlus 10T won't have a mute switch — here's why
The alert slider has been a staple of OnePlus' flagship phones for years, offering a quick and easy way to put its phones...
Read more >Alert Slider On The Oneplus 6t - YouTube
Check This case out for The OnePlus 6thttps://amzn.to/2uLmzOIn this oneplus 6t user guide, we cover How To Use The Alert Slider On The ......
Read more >OnePlus 10T will ditch the alert slider and Hasselblad tuning ...
Additionally, it will use 15 separate antennas to help improve network reception while holding the phone horizontally. The company would have ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I also don’t have a OnePlus device, but this does sound very similar to the AudioManager.getRingerMode() which is already available as the “Ringer Mode” sensor.
@cromefire Did you check this sensor to see if it responds to the alert slider?
Yes this works indeed, thank you very much.