Homescreen shortcut to enable/disable mock location app - Android Q&A, Help & Troubleshooting

I want to be able to select a mock location app briefly for testing and then turn it off again when not needed. Going into developer options and selecting the mock location app is quite a process when it has to be repeated often so would really like a way to be able to do that as a single click from the homescreen or nav bar.
The problem though is that the mock location app needs to be selected when enabling the option so not sure if there is any mechanism that would be able to do this as a shortcut.
Does anyone know of a way to do this or if there are any shortcut/widget apps that would be able to create a shortcut for this?
I'm running Android 9 (Havoc 2 treble ROM)

Related

How to 2g/3g toggle on TW 4.3 rom?

This very annoying removal of the quick toggle I am trying to find a workaround, everytime there is a new android version I have to fight with feature removals.
I thought this would be simple using tasker but in tasker the 2g/3g mobile data toggle function is red, marked as unavailable on my device.
It can still be toggled but only manually navigating deep inside the settings menu. It seems tho a quick toggle API function is removed.
Any app/tasker guide to work around this? as I suspect this can still be done via tasker but instead having to make it call the menu function instead.

Access vendor-specific 'screen lock settings' from app

Hey everyone,
we are developing an app and at one step it should open the settings for the screen lock. Normally this is located in the security settings (Settings.ACTION_SECURITY_SETTINGS), but some vendors like LG and I believe Samsung have additional 'screen lock settings' (see screenshot). Is it possible to access them from an app? Or would you need a vendor-specific SDK for that?
http://abload.de/image.php?img=screen_lock_settingsf7pzu.png
Thanks!

can't enable "always on" VPN for OpenVPN in EMUI (but works for other vendors UIs)

can't enable "always on" VPN for OpenVPN in EMUI (but works for other vendors UIs)
In Android 8, 3rd party VPN apps can use the new APIs to show up in Androids VPN list and also offer settings like "always on VPN".
I'm using "OpenVPN for Android". On my LG phone with Android 8 it shows up in that list just as a native VPN and I can edit it by clicking the gear icon on that entry in the list. There I can enable the "always on" feature.
But in EMUI, in that same VPN list, the gear icon is only shown for native VPNs. For my OpenVPN entry, theres an arrow icon instead. By clicking, it enters the OpenVPN app instead of showing an Android settings screen. Inside the OpenVPN app I can't do that system setting for "always on", I think that an app cannot set this setting, it must be done by the user in the Androidsettings.
Am I too stupid or did Huawei implemented the settings screens so strange that it is just not possible to access the needed screen?
Are there apps that let you change Android settings instead of using the proprietary setting pages from LG, Huawei, etc?
WieselDroid said:
Are there apps that let you change Android settings instead of using the proprietary setting pages from LG, Huawei, etc?
Click to expand...
Click to collapse
You can use Nova Launcher, as shown here:
https://forum.xda-developers.com/hu...isable-displaying-apps-huawei-emui-8-t3795342
You could also try installing Settings Database Editor which allows you to manually alter the settings database.
thref23 said:
You can use Nova Launcher, as shown here:
https://forum.xda-developers.com/hu...isable-displaying-apps-huawei-emui-8-t3795342
You could also try installing Settings Database Editor which allows you to manually alter the settings database.
Click to expand...
Click to collapse
Nova Launcher is just for Homescreen (I'm already using it across all devices) but the Settings keep proprietary (or do I miss some settings of Nova?)
But thank you for the hint to Settings Database Editor, I was able to copy the 2 necessary lines from my LG phone.
For anyone interested in this, the settings are in "Secure Table":
"always_on_vpn_app" -> "de.blinkt.openvpn" (adjust if using another client)
"always_on_vpn_lockdown" -> "1"
But it only takes effect after a reboot. It doesn't matter much for me but what would I need to do after adding those system settings to apply the change? Is there some process to restart or a way to reload the config?

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.

Widget triggering mock location

Hello, I have just got a simple question - is there any app or possible way to make a widget on the the home screen that triggers mock location (eventually can choose the app to trigger with)? Thank you.
kouzelnik3 said:
Hello, I have just got a simple question - is there any app or possible way to make a widget on the the home screen that triggers mock location (eventually can choose the app to trigger with)? Thank you.
Click to expand...
Click to collapse
Many apps are available. GIYF ...
IMHO only will be possible if
in APK's 'manifest.xml' using mock location is allowed
Code:
uses-permission android:name="android.permission.ACCESS_MOCK_LOCATION"
in Android's Settings -> Developer Options option 'Select mock location app' is available/selectable.

Categories

Resources