Bluetooth state in Android 1.5 - How to get it? - G1 Android Development

Hello guys.
At the moment I am trying to get the current bluetooth state in Android 1.5. With 1.1 it was pretty easy because there had been broadcasts that got send after every state change. But with 1.5 that mechanism changed.
In the source code it says:
/** Broadcast when the local Bluetooth device state changes, for example
* when Bluetooth is enabled. Will contain int extra's BLUETOOTH_STATE
and
* BLUETOOTH_PREVIOUS_STATE. */
@SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
public static final String BLUETOOTH_STATE_CHANGED_ACTION =
"android.bluetooth.intent.action.BLUETOOTH_STATE_CHANGED";
Click to expand...
Click to collapse
But when trying this one in my Bluetooth Receiver:
Code:
Log.e(TAG,"Received Bt change. Change action: "+intent.getAction());
int state = intent.getIntExtra("BLUETOOTH_STATE", 404);
int previousState = intent.getIntExtra("BLUETOOTH_PREVIOUS_STATE", 404);
I am always receiving the broadcast for "android.bluetooth.intent.action.BLUETOOTH_STATE_CHANGED" but my code above just gets me the 404 which means that there is no extra saved in the intent.
Could someone tell me if there is a solution to receive the BT state in 1.5?
Thank you very much in advance.
Regards.

If it's of any help, it seems like Useful Switchers suffers from the same problem. If I turn on BT from US and turn it off with Settings, US still reports it as on.
/Mats

Yeah well the way has changed to turn BT on and off. The whole BT stack has changed a lot.

Related

very handy application every ROM must have

hi everyone
by the chance i found this handy program it Called Communication Manager Pro
and i used it now for two days and i dont get any bugs
i want you to try it and if you like it , i wish it will be
on every ROM from now if that possible
here is some screen shot , and its BETA freeware
http://commmgrpro.com/db5/00454/commmgrpro.com/_uimages/vga1.JPG
http://commmgrpro.com/db5/00454/commmgrpro.com/_uimages/vga4.JPG
http://commmgrpro.com/db5/00454/commmgrpro.com/_uimages/pc_capture31.jpg
and you can download it from its main site
http://commmgrpro.com/
and its for
QVGA WM5-WM6
VGA WM5-WM6
SQUARE WM5-WM6
Take full control over:
* Connections.
o Enable and Disable connections.
o Stablish and close connections.
* Band.
o Switch between GPRS, UMTS and auto modes. You can set a time limit (in minutes) so the program will switch back automatically to GPRS when the period expires.
* WIFI.
o Turn on / Turn off Wifi.
* Bluetooth.
o Switch between modes (Off, Connectable and discoverable)
* Phone.
o Switch between Flight mode and On mode.
* Speaker.
o Switch between Normal, Mute and Vibrate modes.
* Manage all the functions and submenus using stylus, finger or jog-dial
* Let the program to close automatically iddle connections. The program will close any connection that hasnt data traffic in X seconds.
* The program includes a Today Plugin where you can check the current state of the device very quickly
* All the duties of BandSwitch are included
Based on your location (GSM Cell ID) you can:
* Create profiles (Home, work, ...) and assign cells to them.
* Create time frames for those profiles (day, night...).
* Execute actions automatically when you enter or exits any LAC, profile or profile-timeframe:
o Set the state of your connections, band, wifi, bluetooth, phone and speaker,...
o Play sounds, songs and open files
o Activate or deactiva call forwarding
o Set CPU mode or turn on/off screen
o Send sms and emails.
o Enable or disable connections.
o ...and much more.
more info and version history
http://commmgrpro.com/_wsn/page2.html
http://commmgrpro.com/
and have a gooood day
wow, looks really great!
jerrry said:
wow, looks really great!
Click to expand...
Click to collapse
thanks , and it's really great
Tested...
Been trying this bit of software today..
My main reason was due to the fact that you can only change the band on the WM6 rom I run via the registry..
This lets you change via a handy little control panel and with a few other good features to boot!!
Problems being, the phone kept switching to flight mode, for no apparent reason & I saw quite a substantial drain on the battery whilst using it...
I know it's in testing mode, but this may (Or may not) be quite handy when it's sorted!!
shlomki was pretty damning when he tried it :
http://forum.xda-developers.com/showthread.php?t=304630&highlight=commmgrpro.com
grayme said:
shlomki was pretty damning when he tried it :
http://forum.xda-developers.com/showthread.php?t=304630&highlight=commmgrpro.com
Click to expand...
Click to collapse
Not had any real network probs since un-install, but now for some reason Windows Messenger refuses to see my wi-fi connection.. Whether that's a coincidence or the fault of the software, I have no idea!!
I will agree that it's a very heavy piece of software and power hungry!!
Though as it's still at testing stage I'll reserve harsh critisicm..
BLCBob said:
Been trying this bit of software today..
My main reason was due to the fact that you can only change the band on the WM6 rom I run via the registry..
This lets you change via a handy little control panel and with a few other good features to boot!!
Problems being, the phone kept switching to flight mode, for no apparent reason & I saw quite a substantial drain on the battery whilst using it...
I know it's in testing mode, but this may (Or may not) be quite handy when it's sorted!!
Click to expand...
Click to collapse
thanks for trying ,
my battery it drain faster but not so fast
but i dont have the flight mode issue

Disable Exchange Server Policy for Card Encryption

My company's exchange server enforces a policy that enables card encryption, and the normal setting to deselect this option is greyed out. I know I can edit the registry value at [HKEY_LOCAL_MACHINE\System\StorageManager\Filters\ENCFilt] 'EncryptByDefault'=dword:1 and change it to 0, but the exchange server toggles this back to enabled after a couple of synchronizations.
Is there any hack or program to disable storage card encryption permanently, kind of like Zenyee Stay Unlock hacks the password timeout settings enforced by an exchange server?
Thanks.
Verizon HTC Touch Pro 2 with stock ROM (WM 6.1)
No responses yet? Is this because I haven't provided enough info, or because nobody has a solution?
I've searched for many hours and haven't found the fix for this.
Appreciate any help.
I too have been trying to find a method to disable exchange server encryption policy. Once the device becomes encrypted a lot of manila tweaks no longer work unless cooked into the rom and none of the exchange security policy diabling methods work to uncheck the requirement for a pin on unlock.
Anyone have input on how to solve this? Not getting much input on this thread.
Thanks.
I've tried with the following mortscript and it might work for you. The script will undo the Server Policy by resetting the registry entry and then send you a notification by SMS. I'm still testing it and once confirm working you might want to move that over to the startup directory.
SMSCallbackNumber = "<your phone number>"
While (1)
ActiveSync = Connected()
If (ActiveSync)
Encrypted = RegRead ("HKLM", "System\StorageManager\Filters\ENcfilt","EncryptByDefault")
If (Encrypted)
RegWriteDword ("HKLM", "System\StorageManager\Filters\ENcfilt","EncryptByDefault",0)
MsgAlarmMsg = "Decrypted: " & FormatTime( "h:i:s a Y/m/d", TimeStamp() + 86400 ) & "^NL^"
Run ("\windows\tmail.exe", "-service ""SMS"" -to """ & SMSCallbackNumber & """ -body """ & MsgAlarmMsg & "" )
WaitFor( FriendlyName, -1 )
sendspecial(112)
# WriteFile("\Storage Card\Decrypt.log", Msg, TRUE)
EndIf
EndIf
Sleep (10000)
EndWhile
JV4567,
Thanks for the input. I'm on the road for a few days, but will try as soon as I can. Please let me know how your testing goes, and if it seems stable.
Have been testing it for a few days and seems stable. You can put that script in the startup directory after inserting your phone number there in the first line. Let me know how things are working.
jv4567, you're a star! I've tested for a couple of days now, and it seems to be working. Will let it run a few more days before I'll be able to confirm absolutely that it's working consistently, but so far, it looks very promising.
I'll post my results at the end of the week to confirm either way.
Thanks again!
Tested for a week, and all is good. Rarely, still a file here and there will get encrypted, but I'm sure this is just timing of when the exchange server turns on encryption and when the Mortscript disables encryption.
All in all, this works as well as I could have ever expected.
Thanks again, jv4567.
I'm glad it works... This is just a stop-gap solution and I'm indeed waiting for some expert in this forum to come up with a program which can
a) startup as a service or being triggered when Exchange security policy kicks in
b) reset all the side-effect of 'device locking' and 'encrypting' of what we're struggling now
Something like an extended feature of "Zenyee Stay Unlock". Let me know if you find anything of that kind.

Understanding WiFi Performance

There has been a lot of reports of WiFi not performing as well with the current crop of ICS ROMs as compared to GB ROMs. There certainly is a difference in the reported signal strength between them; that is not debated. The question is if there is a performance difference between ICS ROMs and GB ROMs.
This thread discusses how WiFi works under Android, some opinions about what is "different" between GB and current ICS ROMs, and provides tools that allow one to perform tests about the actual performance of the WiFi of a specific configuration, as well as the reported RSSI.
Brief summary:
The important measure of WiFi performance is throughput.
The RSSI is the "Reported Signal Strength Indication" -- not a measurement of actual field strength. The RSSI is provided mainly as an indication of signal strength and is subject to "calibration" at several points; it does not measure performance. The link speed reported also does not measure performance; in fact, it has been shown that higher link speeds can result in lower throughput as the modulation and error correction schemes are different.
The throughput of WiFI connections have been tested comparing "stock" (with AntonX kernel) GB to an early stable build of AOKP. Testing was done under controlled conditions using strong and weak signals, from three APs; a WRT-54g with "rubber duckie" antennas in a cross-pol configuration, a WRT-54g with a cross-pol flat-panel gain antenna, and one WNDR3700 with its internal antenna. All APs were running OpenWRT and interconnected using GigE trunking through Netgear GS108T and Netgear GS724Tv2 switches. The power output of these were all controlled and adjusted from their maximum transmit power to the level at which the throughput dropped below 1 Mbps. At least five measurements were made for every configuration and power level.
No significant difference in throughput was seen between GB and ICS. In some cases, the ICS test performed slightly better than the GB test. Differences were less than 10%.
The RSSI from the supplicant appeared to be in dB; a 10 dB reduction in transmit power reduced the RSSI by approximately 10 on both GB and ICS configurations. However the reference point for them were very different; GB reporting positive numbers over 200 and ICS reporting negative numbers roughly in the -50 to -100 range.
As the throughput performance is comparable on both ROMs, it is believed that the "issues" being seen are related to the "calibration" of the RSSI. Lower levels than Android code expects have two primary impacts:
The UI represents the same actual signal strength with fewer bars
Android will not display or connect to certain APs as their RSSI is lower than its fixed threshold
In depth:
A basic understanding of how WiFi works in general, as well as in Linux is valuable.
The Broadcom BCM4329 data sheet has a block diagram that may be useful in understanding the chip's functions. I'll go through the recieve end of things, since that is where the "signal strength" information comes from. The transmit side is similar.
There is an antenna in the phone that converts radio-frequency (RF) electrical signals to radio waves and vice versa. This has a "gain" that relates the strength of the electrical signal and the strength of the radio wave.
Inside the chip, the RF signal is converted to a "baseband" signal using an analog-to-digital converted (ADC) and sent to an internal processor. The processor uses microcode to know how to demodulate the signal (extract the "bits" from the shape of the RF waves). Based on the numbers from the ADC, a number roughly representing "signal strength" is computed. For example, "32768" from the demodulated signal may mean "100" for signal strength. This reference point is picked by the chip manufacturer and might mean something in terms of physical signal strength (dbM, for example), when using the chip manufacturer's reference board. If you change the antenna, for example, it is no longer "calibrated" to anything. This demodulation process uses microcode that is downloaded into the chip on initialization by the driver. The chip also handles the low-level WiFi protocol; how to change channels, how to "associate" with a given access point (AP), how to scan available APs, how to do encryption, etc. This microcode is proprietary and generally supplied by the chip manufacturer.
There is a driver in the Linux kernel that is responsible for how to communicate with the chip and access its low-level functions in a "device independent" way. Think of it as someone that brings another person into the room with you, tells you who they are, then translates their Urdu to English and vice versa so you can have a conversation. This is open source in the kernel.
In most devices, from dedicated WiFi devices, through our phones and just about any computer running Linux, the next "person" in the chain is the "supplicant" -- It handles high-level commands and responses, including:
* Providing a list of available APs
* Connecting to a specific AP
* Managing lists of passwords for APs
* Providing the "Reported Signal Strength Indication" or RSSI
This is open source code in the Linux distribution
One thing to remember here is that RSSI is just that, reported and an indication of the signal strength. There is no guarantee what the numbers mean! By the time you get here, you've got an unknown antenna gain, a ADC-counts-to-strength conversion in the chip, and potentially another conversion in the driver.
Many phones and other devices have that factor in a "calibration file" that makes the output of the RSSI "look good" on the device's UI, or to other code in the device. This generally comes from the device manufacturer and it proprietary. In some cases, this has been reverse-engineered or supplied by the vendor. Other devices may have a /proc/calibration device, which can be used to send calibration information to the driver. This includes the bcm4329 driver in use by the "ICS" kernels:
Code:
config BCM4329_NVRAM_PATH
depends on BCM4329
string "NVRAM path"
default "/proc/calibration"
---help---
Path to the calibration file.
Code:
CONFIG_WLAN=y
CONFIG_BCM4329_PURE_ANDROID=y
CONFIG_BCM4329=m
CONFIG_BCM4329_FW_PATH="/system/vendor/firmware/fw_bcm4329.bin"
CONFIG_BCM4329_NVRAM_PATH="/system/vendor/firmware/nvram_net.txt"
That file contains some "magic incantations" including
Code:
# 11g rssi params
rssismf2g=0xa,0xa,0xa
rssismc2g=0xb,0xb,0xa
rssisav2g=0x3,0x3,0x3
From there, we go to the Android level. Java code communicates with the supplicant and gets lists of APs, their RSSI, and supplies passwords, when needed. With the information it has on RSSI, it converts it to "bars" using something equally arbitrary. You can look at the source in frameworks/base/wifi/java/android/net/wifi/
In WifiManager.java you can see how Android views WiFi and how it handles things. You can even see how to "fix" the issue at the Android level from this (the commented-out MIN_RSSI and MAX_RSSI are "stock" -- the numbers there are ones that are based on the throughput measurements I made).
Code:
/** Anything worse than or equal to this will show 0 bars. */
// private static final int MIN_RSSI = -100;
private static final int MIN_RSSI = -95;
/** Anything better than or equal to this will show the max bars. */
// private static final int MAX_RSSI = -55;
private static final int MAX_RSSI = -65;
Code:
/**
* Calculates the level of the signal. This should be used any time a signal
* is being shown.
*
* @param rssi The power of the signal measured in RSSI.
* @param numLevels The number of levels to consider in the calculated
* level.
* @return A level of the signal, given in the range of 0 to numLevels-1
* (both inclusive).
*/
public static int calculateSignalLevel(int rssi, int numLevels) {
if (rssi <= MIN_RSSI) {
return 0;
} else if (rssi >= MAX_RSSI) {
return numLevels - 1;
} else {
float inputRange = (MAX_RSSI - MIN_RSSI);
float outputRange = (numLevels - 1);
return (int)((float)(rssi - MIN_RSSI) * outputRange / inputRange);
}
}
If you're not Java-saavy, what is basically happening there is that Android says there are numLevel "bars" and they lie evenly between the MIN_RSSI and MAX_RSSI values. Other code reveals that anything below MIN_RSSI isn't shown to the user and isn't a candidate for a connection.
So, where does this leave us?
Changing your ROM shouldn't change the antenna on the device. So that's out.
The microcode is supplied by Broadcom and they'd have sales problems if it was bad, so I'll rule that one out too.
There is the possibility that the calibration in the driver has changed. Given the way that the display of the RSSI was bouncing around when those GB leaks were coming out, this seems like a strong possibility. (If anyone has those leaks still available, please let me know. I'd like to look at them and most were hosted on now-FBI-ified websites).
There are proprietary drivers from Broadcom, as well as three open-source versions in the Linux distribution. These include microcode. "We" are using one of the open-source ones. If it were "bad" then the SGS4G wouldn't be the only thing out there with an issue. I doubt this is the problem. The same goes for the supplicant; it is too widely used to have a significant issue.
So, this basically leaves "calibration" of the numbers reported by the chip to numbers that work well with Android.
How to test it yourself:
First, realize that anything, metal, plastic, wood, a glass of water, your mouse, your body, even your hand, within about two feet of your phone or the AP can dramatically change how it receives and sends the 2.4 GHz radio waves. Differences in position of about a centimeter are significant compared to the ~12.5 cm wavelength. For my test, I had a corner of my desk with a ridge so I could very accurately place the phone into the exact same place. I also taped down my USB cable (for adb), so it would be in the same place each time.
I ran two kinds of tests. The first is using netperf, which measures the throughput of the connection. This is really what matters -- not what some number of bars say, but how fast can I reliably send data over the link. I used TCP so that the impact of packet loss was included. You'll need a machine that can run netperf, as well as a binary for your phone. I've attached a binary built from source using the AOSP build tools. You can also use the Android NDK.
The second is to look at the average RSSI reported by the supplicant. The attached Perl script assumes that have adb running, then polls the supplicant every second for the BSSID (AP name) you specify in the code. It provides the read RSSI, as well as exponential averages over 10, 100, and 1000 samples.
I'm having trouble using Wifi tether. When ever I try to connect I get an error that says "WTF!! Your phone is automatically shutting off the connection" lol it was pretty funny first time I saw it. The wifi tether signal still shows up on the devices I connect to but they don't register it. Is there any work around or fix? I used the roms codename and beam for this btw.
Sent from my SGH-T959V using xda app-developers app
Very informative post like usual, thanks jeff.
Although the wifi signal is the same as gingerbread, it seems to disconnect in places where gingerbread wouldn't. For example, in my room I have no wifi signal bars in ics (it still shows the wifi icon though) and it tends to disconnect every now and then (this only happens when the signal isn't good. On gingerbread it always stays at 1 or 2 bars and never disconnects.
Is it possible to keep the wifi from disconnecting?
Sent from my SGH-T959V using xda app-developers app
pisherthefisher said:
[The WiFi] seems to disconnect in places where gingerbread wouldn't. For example, in my room I have no wifi signal bars in ics (it still shows the wifi icon though) and it tends to disconnect every now and then (this only happens when the signal isn't good. On gingerbread it always stays at 1 or 2 bars and never disconnects.
Is it possible to keep the wifi from disconnecting?
Click to expand...
Click to collapse
You should be able to "hack in 10 more" -- I haven't taken the time yet to determine if the kernel/driver is the best place to do it, or if it is in calculateSignalLevel() as shown above, or somewhere else.
For me, I find that if the signal level is that low, I have better throughput with T-Mobile, at least here in the San Francisco Bay Area. I realize others have different needs than I do and I'll be looking at it again with the "Aries" kernel for the SGS4G.
jeffsf said:
There has been a lot of reports of WiFi not performing as well with the current crop of ICS ROMs as compared to GB ROMs. There certainly is a difference in the reported signal strength between them; that is not debated. The question is if there is a performance difference between ICS ROMs and GB ROMs.
Click to expand...
Click to collapse
Thanks for this thread.

ROM Devs: fix GPS for all users by pointing NTP to localhost

To all the Note 3 rom devs/maintainers out there, there still seems to be a lot of people suffering from GPS lock failures.
There are in fact two unrelated issues -
1. Maps API does not properly trigger the hardware GPS (or causes it to reset during navigation) (issue resolved by Google as of mid-2017)
2. GPS sees satellites but never locks
Issue #1 has been present for over a year and after pouring through the LocationService and GPS code, I've got nothing. It seems to have something to do with either the voting process to keep the GPS hardware powered up, or concurrent access causing a reset when play services get involved. Still working on it. GPS Locker is an effective workaround, and would be a worthwhile include if the author allows it.
Issue #2, however, is an easy one to fix. It's due a bug in the GPS firmware. Someone at Samsung or Qualcomm clearly didn't understand how GPS works when they wrote the AGPS implementation, and included an option to specify an NTP server. NTP servers are redundant on a smartphone GPS. They are not accurate enough for GPS positioning (GPS time signal is required for a lock), and the system clock is more than accurate enough to utilize GPS assistance data.
The issue arises when distant NTP servers are specified (possibly timezone related), and it is enough to break the GPS implementation.
It turns out that if you point the NTP client to localhost (with no ntpd running), the AGPS implementation falls back on the system clock. This eliminates the need to use FasterGPS to specify a local time server.
I've attached a gps.conf file (zipped) that will always work reliably, anywhere in the world. Assisted locks take 5-10 seconds.
It would be great if we can put at least this issue to rest once and for all.
*edit* for anyone else who wants to use this file, simply mount /system rw, deploy the unzipped gps.conf to /system/etc (mode 644), and reboot. If you're not sure how to do this, hang tight until someone creates a flashable .zip or it (hopefully) makes its way into various ROMs.
How to use this file
Thanks
Sent from my SM-N930F using Tapatalk
casperusm said:
How to use this file
Thanks
Sent from my SM-N930F using Tapatalk
Click to expand...
Click to collapse
Updated the main post.
Unzip the file, mount /system read-write, deploy into /system/etc, and reboot.
lambgx02 said:
To all the Note 3 rom devs/maintainers out there, there still seems to be a lot of people suffering from GPS lock failures.
Click to expand...
Click to collapse
Hey bro thank you for this, i will implement this for sure :good::good::good: cheers
https://youtu.be/ejigMwj2Krw
I use your file but i found a same problem
Envoyé de mon SM-G935F en utilisant Tapatalk
fanion said:
https://youtu.be/ejigMwj2Krw
I use your file but i found a same problem
Envoyé de mon SM-G935F en utilisant Tapatalk
Click to expand...
Click to collapse
This is something else interfering with the GPS. Can you try forcefully stopping Play Services just before you launch this utility?
lambgx02 said:
This is something else interfering with the GPS. Can you try forcefully stopping Play Services just before you launch this utility?
Click to expand...
Click to collapse
I try force stopping play services and launching gps utility and see same problem
Envoyé de mon SM-G935F en utilisant Tapatalk
lambgx02 said:
Updated the main post.
Unzip the file, mount /system read-write, deploy into /system/etc, and reboot.
Click to expand...
Click to collapse
What does mount/system means?
Envoyé de mon SM-N930F en utilisant Tapatalk
fanion said:
I try force stopping play services and launching gps utility and see same problem
Envoyé de mon SM-G935F en utilisant Tapatalk
Click to expand...
Click to collapse
I have seen similar behavior in the past, but I've got no idea what's causing it. It's as though something else is forming bogus NMEA strings and interfering with the hardware GPS.
But, I believe the checkmarks that appear briefly are indicating a GPS fix on the hardware side. It's just a question of killing off whatever else is interfering.
You don't have any location faking apps running by any chance?
Modify your gps.conf for your country.
Works for me like a charm.
Instructions here: CLICK
moonryder said:
Modify your gps.conf for your country.
Works for me like a charm.
Instructions here: CLICK
Click to expand...
Click to collapse
This is one option, but honestly it offers no advantage over simply disabling NTP entirely. NTP is redundant for AGPS on a smartphone equipped with an accurate system clock (as we have).
Country-localized NTP for AGPS also has the huge disadvantage of failing when we need it the most: while travelling.
Hi,
I applied the fix based on the step by step instruction and I still have the Issue#2.
I use GPS Status from Play store for checking the GPS status. It shows that 0 fixed from 23 satellites.
Do you have any idea?
ecsagsp said:
Hi,
I applied the fix based on the step by step instruction and I still have the Issue#2.
I use GPS Status from Play store for checking the GPS status. It shows that 0 fixed from 23 satellites.
Do you have any idea?
Click to expand...
Click to collapse
Hey buddy! I suffered a lot with GPS and the only file the worked for me was the one bellow. Just change Brazil for your country, restart your phone, download a GPS again and let your phone at open space for five minutes to see if works. If not, is time to look for another modem and bootloader. Give a feedback!
#Uncommenting these urls would only enable
#the power up auto injection and force injection(test case).
XTRA_SERVER_1=http://xtra1.gpsonextra.net/xtra2.bin
#XTRA_SERVER_2=http://xtra2.gpsonextra.net/xtra2.bin
#XTRA_SERVER_3=http://xtra3.gpsonextra.net/xtra2.bin
# Error Estimate
# _SET = 1
# _CLEAR = 0
ERR_ESTIMATE=0
#Test
# NTP_SERVER=time.gpsonextra.net
#Brazil
# NTP_SERVER=br.pool.ntp.org
#South America
# NTP_SERVER=south-america.pool.ntp.org
#North America
# NTP_SERVER=north-america.pool.ntp.org
#Europe
# NTP_SERVER=europe.pool.ntp.org
# DEBUG LEVELS: 0 - none, 1 - Error, 2 - Warning, 3 - Info
# 4 - Debug, 5 - Verbose
#DEBUG_LEVEL = 3
#DEBUG_LEVEL = 5
# Intermediate position report, 1=enable, 0=disable
INTERMEDIATE_POS=1
# supl version 1.0
# SUPL_VER=0x10000
# supl version 2.0
# SUPL_VER=0x20000
# GPS Capabilities bit mask
# SCHEDULING = 0x01
# MSB = 0x02
# MSA = 0x04
# ON_DEMAND_TIME = 0x10
# GEOFENCE = 0x20
# default = ON_DEMAND_TIME | MSA | MSB | SCHEDULING | GEOFENCE
CAPABILITIES=0x17
# Accuracy threshold for intermediate positions
# less accurate positions are ignored, 0 for passing all positions
ACCURACY_THRES=5000
################################
##### AGPS server settings #####
################################
# FOR SUPL SUPPORT, set the following
# SUPL_HOST=supl.google.com
# SUPL_PORT=7276
# SUPL_HOST=lbs.geo.t-mobile.com
# SUPL_PORT=7275
# FOR C2K PDE SUPPORT, set the following
# C2K_HOST=c2k.pde.com or IP
# C2K_PORT=1234
####################################
# LTE Positioning Profile Settings
####################################
# 0: Enable RRLP on LTE(Default)
# 1: Enable LPP_User_Plane on LTE
# 2: Enable LPP_Control_Plane
# 3: Enable both LPP_User_Plane and LPP_Control_Plane
LPP_PROFILE = 3
################################
# EXTRA SETTINGS
################################
# NMEA provider (1=Modem Processor, 0=Application Processor)
NMEA_PROVIDER=0
# NMEA_PROVIDER=1
##################################################
# Select Positioning Protocol on A-GLONASS system
##################################################
# 0x1: RRC CPlane
# 0x2: RRLP UPlane
# 0x4: LLP Uplane
A_GLONASS_POS_PROTOCOL_SELECT = 0x4
################################
# LGE EXTRA SETTINGS
################################
VENDOR=TMO
#LGE_TLS_MODE=1
LGE_GPS_POSITION_MODE=1
AgpsUse=1
AgpsServerType=1
AgpsServerIp=3232235555
AgpsMtConf=0
AgpsMtResponseType=1
CURRENT_CARRIER=common
PHONE_TYPE=UMTS
Hi Master,
I applied your config, rebooted the device.
I will get back to you once I can go outdoor with my phone.
ecsagsp said:
Hi,
I applied the fix based on the step by step instruction and I still have the Issue#2.
I use GPS Status from Play store for checking the GPS status. It shows that 0 fixed from 23 satellites.
Do you have any idea?
Click to expand...
Click to collapse
Oh - if you're still having issues with gps.conf pointing NTP to 127.0.0.1, try refreshing your AGPS data; it could be a stale cache.
From GPS Status & Toolkit, hit Menu->Manage A-GPS state->Download.
Alternatively, Menu->Manage A-GPS state->Reset will allow you to try for a cold start, which could take up to 15 minutes to lock.
Hi All,
sauliiin: GPS is working now using your config with limitation (not as good as it should be). Waze or any other navigation software seemingly work fine. But if you test the GPS with GPS Status software you can see that the number of FIX satellites periodically changes between 0 and X(X depends on the visibility of the sky). It means that in one moment you have for example 9 fixed sats while the other few moments this number is 0(of course I was in a steady position, without clouds in the sky). I do not know wheter it is related to your config or GPS status software cannot handle your config.
lambgx02: I tried everything with your config without any success.
Once more a big thank to Sauliiin for his hard work to find a working solution.
ecsagsp said:
Hi All,
sauliiin: GPS is working now using your config with limitation (not as good as it should be). Waze or any other navigation software seemingly work fine. But if you test the GPS with GPS Status software you can see that the number of FIX satellites periodically changes between 0 and X(X depends on the visibility of the sky). It means that in one moment you have for example 9 fixed sats while the other few moments this number is 0(of course I was in a steady position, without clouds in the sky). I do not know wheter it is related to your config or GPS status software cannot handle your config.
lambgx02: I tried everything with your config without any success.
Once more a big thank to Sauliiin for his hard work to find a working solution.
Click to expand...
Click to collapse
Actually, that's quite fascinating.
I do see the same behavior on occasion; a perfect, steady fix, periodically interrupted once per second. I'd really like to know what it's all about. Maybe LocationServices injecting bogus position data into the HAL GPS stream.
Interesting that you aren't having success without NTP. Is your system clock calibrated against the cellular network?
Yes, my system is calibrated.
There might be other solution suggested in another thread: changing of my modem version to older one might solve the GPS issue.
At the moment I cannot confirm that.
I will test it during the weekend.
i lose 3d lock after my accuracy improves beyond 150m once GPS test is loaded. Anything higher, 3d locks. I get quick lock blips below 150m. Anyone?
Just want to add something! My GPS was a crap for a long time... Since I dont remember. Tryed lots of gps.conf and the most I could do is make a little better.
So, if you are facing the same. Is time to try a new modem! It will be a pain in the ass and sometimes the modem fromyour region or even the latest one wont work good for you... So, what I reccomend is download some of the latest versions and try and try.
Just for example: I tryed the lates brazilian modem and got no fix. Tryed the last modem I found, got a fix, but it keep fixind and losing for last than a second. What I found was the best for me as Phone_N9005XXUGBPF1
Hope I helped... If you have a crap GPS! Probably ther is a fix, just dig! Here, in this topic we have at least 3 good gps.config, now it time to try modems!

Apps slowly loading or disconnecting in custom roms

My device is redmi note 8 pro, and I have flashed corvus, havoc, and evolution x. All three load app which depend on internet slow to load and/or even disconnecting. Especially for call of duty mobile, was the app that loads longer, reconnects and even disconnects (leading to me having to restart and login again). I'm comparing this to stock miui 12 rom, global version. I'm not sure is it related to kernel, but all roms have different kernels and all have this problem. Maybe its a related to mediatek chips? Or is there some thing i can install that improves connectivity? Hope someone can shed light on this. Thank you
Try to increase the time between Wi-Fi network scans
By default, Android scans for nearby Wi-Fi networks every 15 seconds when you have Wi-Fi enabled. This helps when you're moving around between multiple access points, but for the most part, the high interval only serves to drain your battery and slow down over-all performance. If you'd rather have your phone or tablet wait for 5 minutes before it looks for nearby Wi-Fi networks again, add the following line to the end of your Android's system file called build.prop:
Code:
wifi.supplicant_scan_interval=300
Try to increase system's TCP buffers size
That can help increase the speed of a slow Internet connection, especially when using mobile networks. You do so by adding these lines to build.prop file:
Code:
net.tcp.buffersize.default = 4096,87380,256960,4096,16384,256960
net.tcp.buffersize.wifi = 4096.87380,256960,4096,16384,256960
net.tcp.buffersize.umts = 4096,87380,256960,4096,16384,256960
net.tcp.buffersize.gprs = 4096.87380,256960,4096,16384,256960
net.tcp.buffersize.edge = 4096,87380,256960,4096,16384,256960
Also, prescribing Cloudflare’s DNS servers in some cases reduces the ping time. You again alter build.prop accordingly:
Code:
net.rmnet0.dns1 = 1.1.1.1
net.rmnet0.dns2 = 1.0.0.1
net.dns1 = 1.1.1.1
net.dns2 = 1.0.0.1
Wow a reply! Thanks a lot! Wells I'm back on my stock rom now, but basing on your recommendations, are you saying custom roms have settings that are slow/standard? I'm still new to the custom rom thing and a noob at entering codes... But yea I used call of duty mobile as my benchmark since thats my go to game. For miui stock I'd say loads the game in 30 seconds, where as custom roms loads it in 1min plus... I'm using home internet all by myself and speed is good.
Also one more point is that when I turn off the screen, then when turn it back on again (in like a few minutes) and re enter the app, on custom roms, its like its completely disconnected from the internet, it cannot load anymore unless i restart the app... but on miui it loads for around 5 seconds and its reconnected. I think I'm repeating myself here. but yea. thanks!

Categories

Resources