The Settings.Secure value locationPackagePrefixBlacklist and
locationPackagePrefixWhitelist contains comma seperated package-name
prefixes.
Location & geo-fence updates are silently dropped if the receiving
package name has a prefix on the blacklist. Status updates are
not affected. All other API's work as before.
A content observer is used so run-time updates to the blacklist
apply immediately. There is both a blacklist and a whitelist.
The blacklist applies first, and then exemptions are allowed
from the whitelist. In other words, if your package name prefix
matches both the black AND white list, then it is allowed.
Change-Id: I4ea2ad56fa6bd75d32151bc250ac25c26a5777c4
There is a long history in Android, on both GED and non GED devices
of GPS providers ignoring the minTime parameter making location updates
every second. The problem is usually poor GPS drivers that claim to
do scheduling but then do not.
By making the minTime parameter strict (instead of a hint) we can add
a CTS test to ensure that udpates to not occur too frequently. I believe
this is the desired behavior from apps. If apps want to take advantage
of more frequent updates when another application asks for those updates
then it can use the passive provider.
The CTS test for GPS has already been submitted (as part of CTS Verifier).
Bug: 6424983
Change-Id: I163b9e44ea7ab71530b86fc2282614e0150e90f1
-------------------------------------------------------
MCC detection fixes for CountryDetector
- Don't get and cache phone tpe at the initialization time. At this point
TelephonyManager is probably not ready yet.
- Refresh MCC whenever we get the service state changed callback, even when
the state hasn't actually changed, in order to make sure we get refresh
country properly when MCC changes.
- Also remove the initialization of mPhoneStateListener, which prevented us from
registering phone state listener properly.
- Also fix tests which were already failing.
Bug 5670680
-------------------------------------------------------
Add logging to country detector logic
This is for debugging purposes to verify the effects of
change Id45abeba1b1e843053ac2c946861b439ca568de4.
Bug: 5670680
Change-Id: I238d953484e2c8135f7dac70fce8662c8300a286
These log statements were dead code. That isn't much of a problem,
except that the 'e.getMessage()' that was being logged could be null,
and that would cause a real problem.
Change-Id: I8573bc687a7eda73782bd028e8ddc048a1954dc5
Previously external/libphonenumber accepted lower case
country codes (e.g. "us") but now it doesn't for performance reason.
Actually ISO 3166-1 doesn't allow lower cases, so we should not rely
on them.
Need to fix unit tests for PhoneNumberUtils, as it implicitly
relies on the previous behavior.
See also I3a3e6db84ed0d24290b1be19651fa9a82de4cc39
Bug: 4941319
Change-Id: If16f6531f274a0faf5e28724854409ca9b00a669
Added FLAG_AUTO_CANCEL to notification flags in GpsNetInitiatedHandler.java.
This is done to clear consecutive notifications in UI
Change-Id: I84be36af0b556f43ffd7d51ac04ff12300090ca5
Signed-off-by: Anshuman Pandey <anshuman.pandey@stericsson.com>
Signed-off-by: Christian Bejram <christian.bejram@stericsson.com>
* commit 'ce57a7f35344e76689d30f45964d1e37b78280cb':
GpsLocationProvider: Clean up HAL initialization/cleanup sequence
Fixed GSM encoded network initiated position request
Ensuring thread-safe usage of DateFormat.
Fixing infinite loop for zero duration.
Fix for an infinite loop while scrolling lists.
WAPPushManager, WAP Push over SMS message handler
Add --non-constant-id to aapt.
GSM encoded network initiated position requests were previously
not correctly decoded. The GSM encoded string was decoded as
ASCII but not all characters are encoded in the same way for
GSM and ASCII. These characters was not displayed.
Besides that, when the number of characters was evenly divided
by 8 the last character was lost. This is also corrected.
Change-Id: Ic70b7c28bbba1f2936a9cc99e78f8002cc5c8761
Notably, this removes exessive info about resources
from the content package, because it's not a good location
and the info is avilable in the dev guide, but also
added some of the info to the Resources class description.
Change-Id: Ie78af26c9cec66314deb98e53078f48e16c08e70
The strings used by the framework for network initiated position
requests are now string resources that can be properly localized.
Change-Id: If1cba89adb1bfcb9c8fdb59b9c5aa1107b11279e
First part, adding the existing classes in their new library. The old
code will be removed once everything gets switched to using this.
Change-Id: I27b6ad8c75c16f35300090e95f12a7db5608e3a3
Also rename Geocoder.isImplemented() to Geocoder.isPresent()
BUG: 3000738
BUG: 3001413
Change-Id: I56bb4e9a9c59f8b79de585eeb168f74c3ff1a853
Signed-off-by: Mike Lockwood <lockwood@android.com>
This fixes a problem where applications could ask the location
manager to do very heavy-weight things (like... say... update
location every minute), which would get accounted against the
system instead of the application because ultimately it is the
system making the heavy calls (wake locks, etc).
To solve this, we introduce a new class WorkSource representing
the source of some work. Wake locks and Wifi locks allow you
to set the source to use (but only if you are system code and thus
can get the permission to do so), which is what will be reported
to the battery stats until the actual caller.
For the initial implementation, the location manager keeps track
of all clients requesting periodic updates, and tells its providers
about them as a WorkSource param when setting their min update time.
The network location provider uses this to set the source on the
wake and wifi locks it acquires, when doing work because of the
update period.
This should also be used elsewhere, such as in the GPS provider,
but this is a good start.
Change-Id: I2b6ffafad9e90ecf15d7c502e2db675fd52ae3cf
XTRA data downloads are now strictly on demand from the GPS engine.
Also fix typo in handleDownloadXtraData()
Change-Id: Ied1a6e2e62134add4d965326aae909c86f834682
Signed-off-by: Mike Lockwood <lockwood@android.com>
See e.g. http://code.google.com/p/android/issues/detail?id=10042
This is also needed by the power control widget, which has no reliable
way otherwise of staying in-sync.
Change-Id: I8f2b6b79b1843329bae952a25ea56f15e3cf92aa
a. The CountryDetector detects the country the user is in
in order of mobile network, location, sim card or locale.
It will be used by contact and contact provider.
b. All added APIs are hidden at this stage.
Change-Id: I4ba278571ffb6ab6ded0996d4f440a18534f8ed4
if the location provider does not exist. Instead use the same behavior
as if the provider were disabled in settings
(return false for isProviderEnabled and null from getLastKnownLocation).
This eliminates for a lot of exception handling around some simple
queries to the location manager.
BUG: 2841014
Change-Id: I4fbe0c088e915c90969e13083201dd3e7f4029cb
Signed-off-by: Mike Lockwood <lockwood@android.com>
Remove ACCURACY_BEST and only use ACCURACY_MEDIUM for horizontal accuracy.
Remove accuracy priority support, since it be difficult to implement in some cases.
Change-Id: I785a781f8d8f3bf3be6693ad71d077b6eb280c31
Signed-off-by: Mike Lockwood <lockwood@android.com>
The Geocorder interface is not part of the Android core. It
requires a backend service which may or may not be available
on a device. The new isImplemented static method allows
apps to discover whether the Geocorder is in fact available
on the device.
Change-Id: I2b5cf7bcc9cce4766bcbb156e91edf34b01f9296
Criteria.java
LocationManager.java
New APIs for criteria based location requests and single shot support.
GeocoderParams.java
GeocodeProvider.java
LocationProvider.java
APIs for network location unbundling.
Change-Id: I3311fa01ce76fe4cba3537617e5b1c8d1f1d42b7
Signed-off-by: Mike Lockwood <lockwood@android.com>
Use MS-Assisted mode for single shot GPS fixes if it is supported.
Add finer grained control over accuracy to the android.location.Criteria class
and location criteria logic from LocationManager to LocationManagerService
Change-Id: I156b1f6c6a45d255c87ff917cf3e9726a6d7a75b
Signed-off-by: Mike Lockwood <lockwood@android.com>
Merge commit 'b6f0cbdcbb566368ebe0468f61de024f644db6e1' into kraken
* commit 'b6f0cbdcbb566368ebe0468f61de024f644db6e1':
Include the API level 4 fields in the Parcel.
In reportLocation() the new location is now stored before the callback
onGpsStatusChanged(GPS_EVENT_FIRST_FIX) is sent. This will prevent users
from getting a faulty location from LocationManager.getLastKnownLocation()
after receiving onGpsStatusChanged(GPS_EVENT_FIRST_FIX).
Change-Id: I6c654b2acbf2e216c99058a20f068bf4721a1c7a
Otherwise we are left with a race condition that might result in the provider
being called before it is ready.
BUG: 2539392
Change-Id: I05f4a2501c43d5fa95c0e68f5a963015cf9c6e8f
Signed-off-by: Mike Lockwood <lockwood@android.com>
To avoid adding a new thread to the system, we take the functionality that was
in GpsNetworkThread for downloading NTP time and XTRA data and include this in
the new thread as well.
BUG: 2531728
Change-Id: I2a26b7f0aae0c60faceb36dc6bc29c915c039ae6
Signed-off-by: Mike Lockwood <lockwood@android.com>