Recently when debugging GPs, GPS needs to be positioned for a long time to locate, it takes a few minutes to dozens of minutes variable. This is unacceptable to the user. Use Logcat to view debugging information, found that the serial port has the correct positioning information, access to GPS data is not complete, log information as follows: W/locationmanagerservice (2725): Dropping incomplete location : Location[gps 0.000000,0.000000 acc=??? Et=+32s243ms alt=0.0 {bundle[{satellites=0}]}]. This is because the GPS data in Android 4.2 is strictly judged, more iscomplete () function, so in order to be compatible with the 4.0 system, the default can be blocked:
Drop Iscomplete ()-----Force escalation data, the specific code is frameworks/base/services/java/com/android/server/ Locationmanagerservice.java, comment out the following:
/* if (!location.iscomplete ()) {
LOG.W (TAG, "dropping incomplete location:" + location);
Return
}*/
After the system has been recompiled, it can be used normally, but after using 5 or 6 times, it is found to be unable to locate. Finally, the reason is because the previous modified init.rc, revert to the previous settings:
# Set GPS serial and reset GPIO pin
SetProp Ro.kernel.android.gps/dev/athrnmea
SetProp Persist.gps.oacmode @f
Symlink/dev/ttymxc2/dev/gpsdevice
Because the/system/etc/gps/orion.ini has a serial name that sets the receiving data, it needs to be matched. Once you've finished modifying it again, no matter how many times you open it.
Recommend a better article here: http://m.blog.csdn.net/blog/tianruxishui/41514815
android4.3 GPS Positioning problem