Question Volume slider override - OnePlus Nord 2 5G

Hi to all!
I really like old OnePlus5 slider behavior with DND mode on middle position. I tried to recreate this with Tasker using many guides on XDA bu to no avail. I have rooted Nord 2 DN2103 (TWRP + Magisk), OOS V11.3.
What I have tried:
1) Emulating hardware inputs of slider with getevent/sendevent, but slider actually sends the same event no matter what position it is moved into, so no result
2) Tried to change all custom settings found by Tasker after slider move:
alert_slider_mode
mode_ringer
oplus_mode_ringer
zen_mode_ringer_level
Only result - I can change the icon of slider mode (ring/vibrate/silent) near the slider, but no actual change to audio mode and volume is still locked in vibrate and silent.
3) I have treied several variants of three_key_mode setting - but it is not present in my phone in the same way as in older guides
What I have found: in /proc/tristatekey folder there are 4 files:
tri_state - contains state as old three_key_mode
hall_data - contains actual position of slider in some kind of coordinates
hall_data_calib - contains threshold levels which defines at which coordinates slider state will change
hall_debug_info - ?dunno?
What is interesting, that hall_data is constantly fluctuating a bit, looks like the system is constantly monitoring coordinates of the slider which could make it difficult to override.
I am completely unfamiliar with *nix systems, so I was not able to change any of these files, even after giving them all permissions and running adb shell as SU. My guess is that /proc is not an usual files folder rather than virtual one, mirroring some internal system state in usable/readble format, so changing these files probably won't change system state even if I managed to do it. Logcat from Tasker also don't show any explicit files manipulation like storing tri_state value. I can add log if needed.
Questions:
1) Will changing either tri_state or hall_data force system into overriden slider state?
2) If yes - how could I change files in /proc?
3) If no - any other ideas so far? Maybe use Tasker Java code function to force AudioManager into desired state?
I would appreciate any help or ideas to explore further.

Related

[APP] RandomRingtone (100927.01)

I've written a script called "RandomRingtone". This script allows to automatically change the ringtone after each incoming call. It needs MortScript to run (I'm using 4.3b15) and .NET Compact Framework 3.5. Tested on Benq E72, Windows Mobile 6.5 Standard.
Features:
Various work modes:
Regular - it doesn't change ringtone, little useless, but good if we want to "lock" current ringtone for a while,
Random - allows to select random ringtone,
List - user can specify the order of use.
Exlcusion lists: user can specify which ringtones shouldn't be used by script or which calling numbers shouldn't cause to change the ringtone.
Various notification types: after each incoming call name of actually selected ringtone can be shown as a message, displayed on the homescreen or omitted.
Ignore missed calls: when enabled, only answered call will cause to change the ringtone.
Don't change when meeting profile is active: in this profile no ringtone is used so there is no need to change the ringtone.
Detailed informations:
When work mode is set to "Regular", you still can change ringtones. Just click "Next ringtone", then new random ringtone will be chosen. When work mode is set to "Random", each incoming call will cause to select random ringtone. You can also force the change like previously, clicking "Next ringtone". In this mode, when "Loop" option is enabled, each ringtone will be used only once as long as there are ringtones which have been not used yet. When all ringtones will be used, the cycle starts from the beginning. Even if this option is disabled, next ringtone always is different than actually used. When work mode is set to "List", user can create the list with specified usage order. Clicking on ringtone's name will show context menu with options ("Remove", "Move up", "Move down"). When the list ends, it can be repeated or mode can be changed to random or regular (with given default ringtone). Regardless of chosen work mode, user may select to ignore missed calls - ringtone's change will be done only when call was answered.
User can specify excluded ringtones list. These ringtones will not be used by script, so e.g. these ringtones can be assigned individually to some contacts. Clicking on ringtone's name will display additional context menu. There is also one option which may be useful for that purposes - excluding some contacts. Contacts added to the list will not cause change ringtone when they are calling to us. These options are not connected, but when we assign static ringtone to specified contacts, it would be good if their calls will not cause to change the ringtone .. These options give us ability to do that.
Main script ("RandomRingtone.mscr") is automatically executed after each incoming call through other script, "RandomRingtone_loader.mscr", which is executed by "RandomRingtone_preloader0.mscr" or "RandomRingtone_preloader1.mscr". Those scripts are executed by a small program, "RandomRingtone.exe", which is running in the background and checking for incoming call. User should always run main script, not preloader's application or loader's script. When we want to turn on/off preloader, there is an option in main menu - "Active". To automatically start preloader when system starts, enable "Autorun" option in Settings.
After incoming call script can inform us which ringtone is actually choosen. This can be done in two ways: displaying automatically hiding message with countdown (5 sec.) or through plugin on homescreen. I used "CTestUIPlugin" which is the part of "SlidingPanel" (Bronze plugin), unfortunately I don't know how it looks in other phones. In the attachements I've added modified .xml and .cpr files. User may also supress this notifications selecting proper option.
Strings are stored in file "Language.ini". I've created two files (polish and english, sorry for poor translation, there are probably many linguistic errors, so it will be nice if someone would correct this file...). Error / warning / information messages are part of scripts and are only in english. While normal work you shouldn't even see these messages, but when something going wrong, see if in directory where script is stored exists file "ErrorLog.txt".
Ringtones need to be stored in "\Windows" or directly on "\Storage Card".
Installation:
Unpack archive and run "RandomRingtone.mscr". You need to have MortScript installed (tested on 4.3b15).
If you are using "AppToDate", place "RandomRingtone.xml" into your AppToDate folder (usually "\Application Data\AppToDate").
If you are using "SlidingPanel" (Bronze plugin), you can put "SlidingPanel.home.xml" into "\Application Data\Home" and "SlidingPanel_240x320.cpr" into "\Windows" directory. Standard plugin's icon was changed to "2401;2401" (you can do this manually, key "HKLM\Software\Microsoft\CHome\CTestUIPlugin", value "ICONPATHS").
I've attached polish language file, if you want to use them, change name to "Language.ini" and replace with existing one.
Known bugs:
Please report in this topic any bugs, even small or related with poor english translation...
Code:
1. Actual MortScript beta version (4.3b15) seems to has a problem with ExitSub or If...EndIf section, what causes unexpected behaviour even when ExitSub command is in condition which is not true, so shouldn't be processed. By this reason, there is no "Exit" option when we enter into "Ringtones list" submenu, instead of this we need to use "Cancel" softkey.
2. Probably from this same reason MortScript doesn't serve correctly some strings (in "Choice" window), so some ringtones name or options can be displayed incorrectly.
3. Very short incoming calls can cause to not recognize incoming caller number, so when we are using "Excluded contacts" list, script may change ringtone although user is on the list.
4. Few times when system was very low on memory and caller with unknown ID was calling while "Ignore missed calls" was disabled, my phone changed ringtone to default stored in rom.
5. When system is very busy, message which informs about used ringtone may stay in background and not shown.
Changelog:
Version number describes release date (YYMMDD) and version number released in that day.
Code:
100927.01
- Now small .exe application is responsible for incoming call detection, not script like previously. This application is less power consuming than continously running script, which was draining battery too fast.
100503.01
- User can enter script for meeting profile. When meeting profile is active, script will not change the ringtone.
- Minor bugs fixed.
100502.01
- Initial version.
I like it!
An exceptional piece of work!
is it supporting Inesoft Phone 6 ??
I didn't use Inesoft Phone, but it will be working, script uses system registry entries to detect incoming call, not dialer window's title. I don't know exactly what are the features of Inesoft Phone, so some functions may be overlapping but I don't think this happen.
Hi,
I don't know if u r interested in adding any features, but with all the architecture in your script, you might:
Personal tones for text messages
You could also select contacts by using the Cyclone command line app. This way it would pull up the contact list and then select a contact from their...
Of course you would need to handle the playing of the sound for sms.
Mortscript forever?

How to disable symbols pop-up on long press on GBoard or make the key long-press dela

I am trying to disable the symbol pop-up on long-press on GBoard in Android. My device is rooted. The link here ( https://www.xda-developers.com/gboard-tweaks-height-sensitivity/ ) shows how to increase GBoard height above the highest level by changing the preferences file at /data/data/com.google.android.inputmethod.latin/shared_prefs/ . However, I could fine no such setting for disabling the symbol pop-up. Another way to do this would be to increase the long-press duration to 2-3s instead of the deafult max of 700ms. However, there is again no setting in the preferences file related to this. Any suggestions if this is doable by modifying the system files in a rooted device or by any other method?

My Essential Tasker Mod Pack

Hi guys,
I cooked up some tasker mods to address some of the graciously few problems I have with the software of the mate 20x. I thought they might be useful to some of you guys so I figured I'd share. The plugins used are AutoInput, AutoLaunch, AutoNotifications, and AutoTools.
Mod List:
1. Fixed Auto-rotate Lock: uses the quick tile to auto-rotate or lock to any orientation
2. Swipe Recent Apps Switcher: cycle through previous apps by swiping on the bottom of the screen ala iPhone
3. Auto-disable Eye comfort: pop-up prompt when activating chosen apps that automatically disables eye comfort mode
4. Automatic Screen Filter: activates the free app Night Screen when brightness is set to minimum and disables it when brightness is raised
1. Fix Auto-rotate Lock
There are two versions of this mod, one which uses the system quick tile and one which uses an AutoNotifications quick tile. The AutoNotifications quick tile is more reliable and allows you to seamlessly lock orientation in landscape or inverted. The system quick tile is more clunky and you cannot lock in inverted, but it's a bit faster. If anyone knows where to find the system quick tile icons please tell!
Simply import the profiles to Tasker and turn them on. Choose "Rotate On" for the system qt or "AltRotate On" for the AutoNotifications qt.
2. Swipe Recent Apps Switcher
This mod will track all activated apps in an array so they can be systematically called back. It also offers swipe gestures at the bottom of the screen which can be used to cycle through them. Swipe left or right to go back and forth through your recent apps. After settling on an app, the app list will be updated to bring your active app to the front.
To install, import and turn on all profiles and run the swipe task. The Swipe task must be ran to provide gestures. The overlay providing gestures is at the very bottom of the screen, so just swipe your finger along the screen edge. Modify your settings and profiles to make sure that Swipe, AutoTools, and Tasker stay on with full permissions. This mod requires that tasker monitoring use accessibility. In the no root version some apps will refresh their state when activated (es explorer). This is because apps are 'launched' and not 'brought to foreground'. In the root version this is not an issue.
3. Auto-disable Eye comfort
This will provide a discrete pop-up in the corner of your screen when you activate the selected apps. I set up the profile with the apps I use for photo and video editing. When you click the pop up it will automatically open the drawer and disable the eye comfort quick tile. The pop up will go away in 5 seconds if not clicked, or can be swiped away.
To install, place the "bubble" folder in your AutoTools webscreen folder. The file paths should match up, but you may need to modify them. Import and turn on. The no root plugin uses AutoInput to press the fourth quick tile. If you have eye comfort on another quick tile you will need to change the touch coordinates. The root option will, if prompted, automatically switch eye comfort on and off as you switch between monitored apps. If you dismiss the prompt it will not ask again until eye comfort is toggled.
4. Automatic Screen Filter
When brightness is lowered to the minimum level, this mod will launch the app Night Screen to lower the brightness with a screen filter. When the brightness is raised above minimum it will turn night screen off.
You can change the app used, but it must have a toggle or on/off activity to be launched by secure settings. I found Night Screen to be the best for me. Import and turn on profiles.
There may be some bugs due to inconsistent Tasker monitoring and the system messing with things. Unfortunately there is little I can do about this.
ps. the zip is NOT installable
Sorry I'm stumped about how to embed youtube videos. Here's links.
https://youtu.be/KZBQJX3Fges
https://youtu.be/AnVLVCdWC8U
https://youtu.be/SsVjmW-9KwI
I vastly improved the app switcher to function much more intuitively and more like a native function. It's works pretty much exactly like on the iPhone, accept the animations are going the wrong way. I'll test it out a bit then update the post.
You sir are incredible
Post has been updated with a new app switcher, a root app switcher which fixes the launching problem, and a root eye comfort prompt which modifies the setting directly and has enhanced functionality. Also now none of the mods are dependent on the Secure Settings plugin
cobram3 said:
You sir are incredible
Click to expand...
Click to collapse
glad somebody likes it :good:
Allan can I pay you to help/tutor me on creating Tasker apps for my own use?
Please message me
---------- Post added at 02:14 AM ---------- Previous post was at 02:13 AM ----------
AllanRSS said:
glad somebody likes it :good:
Click to expand...
Click to collapse
Such as:
Auto speakerphone when call connects by default
When I get in the car, show a list of media players as a popup (bc bt connected)
$60 via PayPal thx
I really appreciate the offer, but thats not how xda works. This is where people help people, and I've benefited far too much through the days on the generosity of others to be greedy now.
I took a quick look and it and there is a State profile called "BT Connected". You should be able to check your bluetooth settings for the exact name of your car and insert that into the Name field. Then you would make a Scene containing buttons corrosponding to your desired media player. This should be reletively straightforward. When the BT is connected, show the scene with the buttons then launch your choice. This can be done with the AutoLaunch plugin or by android intent by running code 'am start --activity-reorder-to-front PACKAGE_NAME/MAIN_ACTIVITY'. The main activity intent is easily found through terminal if you're rooted but I dont remember how to find it if you're not rooted.
For the call I would use the State profile "Call". I am not sure if this will activate after the call is connected or while the phone is ringing for incoming calls. If its when the phone is ringing I would then set up a loop with "AutoInput Query" to check whether the call was connected. Run a couple tests with the query to see what the variable values are when the call is connected and check for those values to escape the loop. When the call is connected, use auto input to click on the speakerphone button automaticly. You can use the auto option to configure this or you can go into developer mode on your phone and enable show pointer location to get the coordinates. Coordinates are faster that text matching, but you might have to add a wait for 500ms to avoid it touching too early.
That should be it, pretty straightforward. You've inspired me to update this list with my new rotate toolbar and fixes. Happy tinkering!
That being said, I would be willing to do it for you if you would rather pay for a finished solution. However, I greatly encourage you to give it a go yourself, the possibilities are endless once you get comfortable with Tasker.

In which directory does SystemUI Tuner store data/user preferences?

Thought I would post my question to this general Q&A thread, as the Pixel 3a community is pretty small and my specific question isn't necessary device/ROM specific.
Background: I'm on a Pixel 3a running the January update (QQ1A.200105.002). Unlocked, stock, rooted with Magisk v20.2. Only using 3 Magisk modules (systemless hosts enabled for ad blocking, YouTube Vanced, and a custom font).
What happened: While cleaning my screen with a microfiber after work a few nights ago, I accidentally launched the SystemUI Tuner. I had created a gesture within Nova Launcher to access the SystemUI Tuner. It launched and toggled the "plugins" setting on & off. I then navigated to the homescreen. My wallpaper was gone and the background on my homescreen was black. Also, my 2 button gesture navigation was not present and my status bar was gone. I rebooted. This is when I found myself in a bootloop at the "Pixel is starting..." screen (a screen I had never seen prior to this).
Attempts to fix: Through a tip from another user I was able to get back into the phone by disabling my PIN screen lock security via adb. I did this by launching Settings via abd with:
Code:
adb shell am start -a android.settings.SETTINGS
After disabling screen lock security, my phone would boot, sort of. Many SystemUI elements are not operational (e.g, no gesture navigation, status bar, notification panel, or wallpaper, etc.) . It's unusable as a daily, but I really don't want to wipe and set up all over again if possible. Does anyone know where in /system the settings data for the System UI Tuner is stored? Another user suggested I look for: data/data/com.android.sytstemui.tuner. That directory does not exist, unfortunately. This user experienced this same series of events (i.e., toggled SystemUI Tuner "plugins" and ended up with no wallpaper at the "Pixel is starting" loop). The user tried sideloading the corresponding OTA image, flashing a full system image with "-w" removed to save data, safe mode. Nothing seemed to help. Before I spend hours setting up my phone after a clean install, does anyone have any thoughts or suggestions?
TL;DR: Does anyone know where the system saves setting preferences configured via the SystemUI Tuner?

Bring back nfc QS tile.

ADB is needed.
Run
Code:
adb shell "settings get secure sysui_qs_tiles"
Save output of previous command
Prepare next command like this
Code:
adb shell "settings put secure sysui_qs_tiles '${previous command's output},nfc'"
Of course don't add ${}. It should look like this example:
Code:
adb shell "settings put secure sysui_qs_tiles 'wifi,bt,cell,rotation,airplane,dnd,location,custom(com.google.android.gms/.nearby.sharing.SharingTileService),flashlight,battery,hotspot,screenrecord,custom(com.dolby.daxappui/.DaxTileService),nfc'"
Now old AOSP NFC tile should be added to QS panel, but it may or may not work right now. It will appear in an unaccessible state and clicking on it may do nothing, but long pressing will open nfc settings.
We can sort of fix it. We need to open QS panel and move to the page with a newly added nfc tile. Then we run this command
Code:
adb shell "cmd statusbar click-tile nfc"
The SystemUI will crash and restart, but after that our nfc tile is usable. It still appears in an unaccessible state, but clicking on it will now successfully turn on nfc, and turn it off, depending on the situation. This UI bug is the only inconvenience. QS tile also reflects changes when nfc was enabled in settings or through Gpay right away, without any delay, so this tile works much better than any 3rd part one that relies on write_secure_setting permission.
After reboot, system_update etc. this tile may stop working, but if it doesn't disappear completely from QS panel, then redoing point 6 is necessary. If it is entirely gone, then the whole procedure must be repeated.
Bonus for future:
Sony have added it's custom nfc tile and also one for lte and sound in xperia 1 II (and as it turns out also 5 ii), that were used in other sony devices, for example xperia 5 with android 11 and a lot of older models. Sadly, event though they can be added using the same method, they can't be used, because they don't show up in QS panel, but they are saved in sysui_qs_tiles and are recognized by the system (behave like a ghost). Maybe Sony will do something about it in future update, since as it seems they were aware of the issue and started fixing it. I found about it from a one smart guy on 4pda here an here.
Maybe someone smarter than me, could hack up an app, that hooks up to those sony's custom services for enabling nfc, and make our own nfc tile, that actually works. I don't know if it is even possible. Porting com.sonyericsson.settings from xperia 5's android 11 firmware may also be some way out, but for sure out of the scope of my abilities.
They (sony) could also fix this built-in AOSP NFC QS tile. The code for it is literally publicly available, because it was fixed in GrapheneOS. If anyone from sony is reading this, please fix it ASAP, since it isn't anything difficult, but annoys every single time.

Categories

Resources