Hello,
I would like to clear all WiFi configurations from an app (programmatically) but not found any solution.
What I tried and it doesn't work.
WifiManager.removeNetwork
I try to use WifiManager.removeNetwork and found that it doesn't work on Android M+
then I try to set WIFI_DEVICE_OWNER_CONFIGS_LOCKDOWN to 0 with the command:
Code:
settings put global wifi_device_owner_configs_lockdown 0
and then try to WifiManager.removeNetwork again but it still doesn't work.
Remove configurations from /data/misc/wifi/wpa_supplicant.conf
Turn off WiFi then modify /data/misc/wifi/wpa_supplicant.conf and re-enable WiFi again. This method work properly on Galaxy S8 but doesn't work on Sony X Performance (my customer's main device)
WifiManager.factoryReset
This method used by Network Settings Reset (in Settings) but it is hidden and requires system privilege.
Use service call wifi <code>
To call WifiManager.factoryReset from a shell, you can use service call wifi <code> however the code depends on the Android version and the Manufacturer modifications. I found that code of factoryReset method is 63 on Android 7.0 and 7.1.1 but it doesn't work on my devices.
Device Owner
found that Device Owner App can make system setting modification, however to make an app as Device Owner requires to remove all account from device. (after make app as device owner, I can use WifiManager.removeNetwork to remove any Aps)
http://florent-dupont.blogspot.fr/2015/01/android-shell-command-dpm-device-policy.html
Can you please suggest me other solutions? (ROOT is acceptable but not a system app)
Thank you.
The "service call wifi" is soo much depending on the Android version.
On Android 9 the call for resetting wifi to factory default is:
adb shell service call wifi 59 s16 wlan0
The proper call number can be found in the IWifiManager function. Like for Android 9:
android/android-9.0.0_r35 : android/net/wifi/IWifiManager.java
Count "case TRANSACTION_" from first to last. That gives you the call number. Pretty basic but it works!
To remove stored wifi networks:
cmd netpolicy list wifi-networks #to get list, index 0...
To remove network:
service call wifi 16 i32 1 #remove the second network in the list
(note 3rd doesn't become 2nd after this command!)
No root needed.
Remember this is for Android 9! Other versions may have other call numbers.
Edit: latest wifimanager here
Cheers
Related
I have recently been trying to flash and root my NEXUS 6 device to try and get VoLTE to work on it ; The instructions I received (at a high level) involved flashing the device with a custom ROM (I have tried LMY47D, LMY47M and LYZ28K) , rooting It, updating the qcril.db (to include my MCC/MNC) , updating the apns-conf.xml (to add my IMS APN) and finally modifying the framework-res.apk to enable the 'config_carrier_volte_available' flag for my MCC/MNC.
After doing all the above, I can confirm that I am now seeing the extra option in SETTINGS->MORE->MOBILE NETWORKS called 'Enhanced 4G LTE Mode' which I have enable along with the extra config that can be done from the *#*#4636#*#* menu.......Unfortunately , my device does not try to REGISTER with the IMS network nor do I see any extra settings on the phone (like IMS calling) to configure IMS specific settings. I have checked the android logs and can see the UE is successfully loading the IMPI,IMPU,DOMAIN and P-CSCF from the ISIM Module however nothing seems to happen.
My one observation is that my added APN (in the apns-xml file) does not show up in APN settings and I have to manually add the IMS APN., so my suspicion is that perhaps I am either not setting this properly or perhaps there is more to all this....Therefore I would like to present this challenge to the clever brains in this forum and would appreciate any guidance that I can get,
I have been trying to find a way of having LTE display as my network connection instead of 4g+/4g (I know that there's no technical difference, but aesthetically it does make a difference and it's easier to see when you're not on an LTE network).
The closest that I have found to making this happen is the following thread here on XDA: [Guide] Enable LTE Icon on Unrooted Mate 9
I already had a call with AT&T to verify that I am connecting to their LTE network with my device so I know that from a technical backend perspective - I'm good to go.
I was able to obtain the list of current MCC/MNC codes currently configured for my phone using the 'get system hw_show_lte' ADB command. However I'm a bit confused as to how I am supposed to add the MNC/MCC values for my carrier (I'm on AT&T). the MCC code is 310, but there are more than one MNC code (according to this site here: http://www.mcc-mnc.com/)
I don't want to mess anything up as I clearly don't know what I'm doing. Is there a magisk module that can make this change (I searched for LTE and only came up with the VoEnabler module)?
Is there a system file that can be modified via a text editor (so that I can make a backup before making any changes)?
Thanks for the help/guidance in advanced.
Thanks for the link.
I tried the command adb shell settings get system hw_show_lte and I got "null"
Then I used the command adb shell settings put system hw_show_lte "310" and it is showing me the LTE icon with T-Mobile.
Maybe after an OTA I will lose the icon, but at least it is really easy to change it again.
I have a Samsung A10, IMEI has been patched, and due to a bug in the OS (which I cannot do anything since I'm overseas on an army base without access to a computer) I noticed I run out of space every few hours and I got to reboot my phone, I dial *#9900# and delete dumpstate to recover space.
How can I stop my Android from logging logcat/dumpstate and most important network? Because if the phone stays in air plane mode it doesnt run out of space.
Any app i could install to disable network loggin?
In phone's SysDump menu set Debug Level is Disabled/LOW and Silent Log is turned Off
BTW: Whether LogCat service should run or not is defined in Android's system file named build.prop. Phone's Android must be rooted in order to edit this file.
Recently I had some bad experiences with bad reception.
At the place of my new girlfriend is very bad GSM and LTE reception. At her place of residence I could not be reached with my OP3T and I could not make outgoing calls. When I called her from home, our conversations were interrupted every few minutes.
Neither with T-Mobile (company card) nor with my Netzclub+ Sponsored card could I make any real phone calls. When I recently gave her a Oneplus 3 I decided to make both devices (+my OP3T) fit for VoWifi and VoLTE.
The goal was that it should work with Lineage 17 for microg.
I have seen here some instructions that helped. There was always just a little something missing to make it work.
Below are the steps necessary to get VoWIFI and VoLTE for T-Mobile up and running:
No root solution required, no bootloader unlock required.
Ony TWRP needs to be installed.
1. Install QPST, (have used 2.7.460)
2. Install Quallcomm Diag Driver, i used 1.1 (have used 10037.3)
3. Extract modem firmware via TWRP (system/etc/firmware, or use mine from download link)
4. Enable adb root in developer settings
5. Enable USB Debugging and connect to device via adb
adb devices (check if device is shown)
adb root
adb shell
setprop sys.usb.config diag,serial_smd,rmnet_ipa,adb
6. Open PDC from QPST with admin rights and choose phone
7. Rightclick on "Overseas..." and deactivate for Sub0 and Sub1
8. Remove the "Overseas..." completely (select it and click remove)
9. Rightclick on "H3G Denmark Commercial" and set config for Sub0 and Sub1
10. Rightclick on the profile again (currently pending state) and select activate a few times until Sub0 and Sub1 are active
11. Modify Build.prop (system/build.prop)
Extract with TWRP and modify locally and add this new block underneath
block #VENDOR_EDIT
[...]
#VOLTE
persist.dbg.ims_volte_enable=1
persist.dbg.volte_avail_ovr=1
persist.dbg.vt_avail_ovr=1
persist.dbg.wfc_avail_ovr=1
persist.radio.rat_on=combine
persist.radio.data_ltd_sys_ind=1
persist.radio.data_con_rprt=1
persist.radio.calls.on.ims=1
persist.sys.cust.lte_config=true
ro.radio_gpri=1
ro.amrwb_gpri=1
persist.data.iwlan=1
#end
[...]
Overwrite the original build.prop with your new one and chmod 0644 (both using
using TWRP File Manager) the file.
12. Put VoWIFI + VoLTE simcard into Slot 1 of sim tray.
13. In Lineage enable VoLTE and Wifi Calling (enable prefer wifi)
To check:
After step 13 wait 20 seconds until sip registration with provider completed, then dial USSD code *#*#4636#*#* to open Field test
Open "Phone information" and check ims registration state
Ims registration=registered means you had success
The provider profile change is done at the EFS partition and stay there until you restore this one via twrp.
If Wifi is off VoLTE is used automatically, sadly Lineage OS 17.1 does not have a VoLTE indicator. But you notice that LTE stays on during call and that there is no delay now.
Without VoLTE there was a 3 seconds delay to switch from LTE to 3G/2G to make the call.
If you call via VoWIFI a new Wifi Icon is displayed in Call window.
Sometimes VoLTE gets preferred over VoWifi, although in wifi call you have set wifi call is prio.
Not sure yet what triggers this.
If you use Volte OpenMarket Commercial profile VoLTE + IMS Video call works, but not VoWIFI. So for us Denmark profile is perfect.
VoLTE also works with Netzclub (O2) card in slot one, but not VoWIFI. Could work with switching to o2 IMS apn (not tested yet since i only plan to use it for telekom currently).
I read that only slot 1 supports VoLTE and VoWIFI (chipset related) which may not be true since during the process i had a condition with VoLTE working in both sim slots (+ ims registred for both). This happened when i loaded the "Idea..." profile for testing purposes. Somehow it triggered a connection crash and did not change the profile but enabled VoLTE for both cards (this time t-mobile volte working in slot 2, netzclub+ volte working in slot 1). But since VoWIFI did not work i loaded Denmark once again and now only slot 1 worked again.
Now it is even possible to activate airplane mode and to call with T-Mobile number via Wifi.
Really cool.
https://mega.nz/file/NUcUxYRR#V2sWJuHSYxHJOuh0vAK-j5777mpT3c6sMyNr24JEwjM
Edit 2020-Oct-03:
Temporary magisk installation no longer required with latest lineage os 17.1 / lineage os 17.1 microg.
Just enable adb root in developer option, and in adb shell type "adb root"
Also attached mbn files only work for 3t, will update download link soon to contain 3 files, too
Can confirm, works on NOS 11 without using *#*#4636#*#*#. No VoLTE logo on the Status Bar, but it has the HD Sign when calling on Google Phone. Thanks for the guide!
thes3usa said:
Can confirm, works on NOS 11 without using *#*#4636#*#*#. No VoLTE logo on the Status Bar, but it has the HD Sign when calling on Google Phone. Thanks for the guide!
Click to expand...
Click to collapse
Would you tell which provider u use? also t-mobile germany?
zezinho7 said:
Would you tell which provider u use? also t-mobile germany?
Click to expand...
Click to collapse
Nope, I'm from Sri Lanka and I use the only provider that gives VoLTE. I had to google which option works with my Carrier, which was "VoLTE_OpenMKT....". Basically works with any carrier that provides VoLTE, a google search is needed to find which description to enable and if you can't, you need to test which ones are required for VoLTE.
Just me dropping by saying this was super helpful!
Running an OP3 on LOS 18.1. Wanted to avoid going back to OOS 9.0.6.
Enabled VoLTE on jaMobil! (T-Mobile Germany Network). I used the "Volte_OpenMkt-Commercial-CMCC" profile.
My profiles were fairly empty - not a single European Country name in the profiles. But worked Thanks again.
EDIT: Since I used the OpenMkt Profile I got everything but VoWifi working. But I don't have any country-specific profiles. Can I load yours somehow?
Ive had this issue and ive found just changing the build.prop locally on the device - Using TWRP
# Debug Options
persist.dbg.ims_volte_enable=1
persist.dbg.volte_avail_ovr=1
persist.dbg.vt_avail_ovr=1
persist.dbg.wfc_avail_ovr=1
# Radio Options
persist.radio.rat_on=combine
persist.radio.data_ltd_sys_ind=1
persist.radio.data_con_rprt=1
persist.radio.calls.on.ims=1
Does the trick
Hallo, I have a problem with the device profiles for the modem. In the firmware there are the mbn-files in /system/etc/firmware/mbn_ota in two directories: mcfg_sw and mcfg_sw_NoCDMA. In QPST I can see the profiles from mcfg_sw, but not the ones from mcfg_sw_NoCDMA which are needed to use the op3 with the german telekom. What am I doing wrong? Trying to install the files via QPST also doesn't work, by using the load button I can choose a file, but the profile does not appear in the profiles.
Would perhaps sombody here who could explain the complete mechanism depending the mbn files in the firmware directory and the profiles shown in QPST?
Thank you very much in advance!
PS: VoLTE worked for a couple of days with the profile CMCC_Volte_OpenMkt-Commercial, but unfortunately the german telekom changed something, so it doesn't work anymore.
felixchris said:
Just me dropping by saying this was super helpful!
Running an OP3 on LOS 18.1. Wanted to avoid going back to OOS 9.0.6.
Enabled VoLTE on jaMobil! (T-Mobile Germany Network). I used the "Volte_OpenMkt-Commercial-CMCC" profile.
My profiles were fairly empty - not a single European Country name in the profiles. But worked Thanks again.
EDIT: Since I used the OpenMkt Profile I got everything but VoWifi working. But I don't have any country-specific profiles. Can I load yours somehow?
Click to expand...
Click to collapse
were you succesful enabling volte/vowifi in the meantime? I'm not able to make it working ...
accuphase said:
were you succesful enabling volte/vowifi in the meantime? I'm not able to make it working ...
Click to expand...
Click to collapse
Switched to a OP 9 Pro in the meantime. But as i have said. VoLTE worked vor me. VoWifi not.
Good news for anyone having the Wing fall Back to 3G when making a call. You can activate VoLTE using a mix of the two following guides:
Guide:-How To Activate VoLTE,ViLTE,VoWIFI&ViWIFI LG Devices-LG Velvet 5G
Hi Guys Am Baljeet From India There Is A Path To Force Enable VoLTE On The"LG Velvet 5G LM-G900" Specifically Your Version Which Is The "LM-G900". By Default This Feature Is Disabled On This Model. Follow These Steps Given Below: A). Go To The...
forum.xda-developers.com
and
Lg g8x,g8,v60 Volte enable for all carriers, unlisted countries also
I will try to keep this post as small as possible. This will enable Volte for Phone ranging from Lg g8x, g8 and V60 without root or modifying the system files. Many have posted ways to get it, Iam only trying to help out the small bits missing...
forum.xda-developers.com
To make it as short as possible:
1) Create an empty directory named "enable_ue" in the root of the phone's main storage, using you prefered file explorer (like for exemple Cx Explorer or ).
2) From the LG Phone dialpad and with your SIM card inserted, type #*462633*#100# (for european LG Wing - LM-F100EMW) to get into the Hidden Menu. From there enter Field Test, then Universal Enabler -> Create New Config. Click on the four last check boxes VoLTE, ViLTE, VoWIFI and ViWIFI to enable these options. You won't be able to enter this setting if you haven't created the empty directory under point 1).
Go back to Field Test and enter Modem Setting to enable 5G if you haven't already -> RAT Selection -> SIM 1 Mode - > select GSM/WCDMA/LTE/5G or whatever you need + 5G. Go back and do the same with SIM 2 after, if you use it. Network mode in the network settings will then not show "5G prefered", but a number, like "26" in my case.
3) Go back to Field Test menu and enter IMS Stting. If you have Slot - 0 : OPEN / EU and Slot - 1 : OPEN / EU (or something else on each side of the / ), then you did everything right to this point. Exit the Hidden Menu and get your SIM out of the phone.
4) Enter th Hidden Menu again without the SIM inserted. Go back to IMS Setting and click on Slot - 0.
Under Subscriber enable IMS,ISIM & USIM.
Under Xcap\Ut. -> General, enable UT & USSD Over IMS
Under ETC, enable Check IMS Registration, Use rule-ID from responsem& Query on bootup
Under GPRI VoLTE/VoWIFi, enable VoLTE, ViLTE, VoWIFI & VIWIFI
Under Test, Preference Operator can be set as OPEN (what I did), or your carrier short name, or your County. Apparently does not make difference for some operator but some do require it to same name as theirs.
Preference Country this is important as this decides if VoLTE gets enabled, Find your country short code example USA is US , India is IN. Europe is EU. Find and try different short codes, I put EU.
Enable Support Volte AT command, VoNR, UAC Enabled & VoLTE Setting Enabled
You can now exit the Hidden Menu & insert your SIM back in. If everything went well, you should see the VoLTE icon showing up on the left of the network in the task bar, on the (my) Wing it's a small lifted phone headset with wave coming out of it. If you don't have it, check under the phone network settings - Mobile networks, if you got the VoLTE option and if it's activated. You might have to repeat some of the steps above with the SIM card inserted (as I had to) to make it work. Don't forget to check the settings for both SIMs if you use two. Not sure if all setting are kept if you reboot or reset the phone. You might have to repeat the preocess or part of it on each reboot, as for enabeling the 5G option.
Was tested on Android 12, as my phone didn't get Android 13 yet. But it's also working on my Velvet 5G that is on A13.
Many thanks to Baljeet Khairwal and johndaniel for their guides + all other persons who helped in the two threads.