182 Commits

Author SHA1 Message Date
Joe Fernandez
3aef8e1d1b docs: Add developer guide cross-references, Project ACRE, round 4
Change-Id: I1b43414aaec8ea217b39a0d780c80a25409d0991
2011-12-22 15:08:23 -08:00
Makoto Onuki
d73b79bb31 Cherry-picking Id45abeba and Ia065dec6 for MR1
-------------------------------------------------------
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
2011-12-13 14:02:32 -08:00
Jesse Wilson
40c5ccfffe Acknowledge that the platform guarantees UTF-8 and UTF-16.
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
2011-07-19 12:10:07 -07:00
Conley Owens
08c34c27b6 am e0009bb0: am 98395483: am 9f2cbf14: am e06749e1: Merge "Add FLAG_AUTO_CANCEL flag for multiple supl notifications."
* commit 'e0009bb0b700dcfeba3ff77f8c33113499674432':
  Add FLAG_AUTO_CANCEL flag for multiple supl notifications.
2011-07-01 07:56:15 -07:00
Conley Owens
e0009bb0b7 am 98395483: am 9f2cbf14: am e06749e1: Merge "Add FLAG_AUTO_CANCEL flag for multiple supl notifications."
* commit '98395483e4309f7b92348136491575861008b3c0':
  Add FLAG_AUTO_CANCEL flag for multiple supl notifications.
2011-06-30 08:25:13 -07:00
Daisuke Miyakawa
3746f2d914 Use upper case country codes in Country.java
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
2011-06-27 15:20:46 -07:00
Anshuman Pandey
fad5445c66 Add FLAG_AUTO_CANCEL flag for multiple supl notifications.
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>
2011-06-15 14:49:53 +02:00
Daisuke Miyakawa
a550bdc84a Use passive provider for location based country detection
Bug: 4345419
Change-Id: Ia3e071b97c6971538ea994fdee6029db928201d6
2011-04-28 16:18:19 -07:00
Amith Yamasani
e590ccfb12 Fix the javadoc for LocationManager.requestSingleUpdate()
It was saying the same thing as requestLocationUpdates(), but it only provides a single update.

Change-Id: I0a0f612104a946b7db96928505bb95673377a335
2011-03-29 11:26:08 -07:00
Amith Yamasani
e23fc8ee13 Fix the javadoc for LocationManager.requestSingleUpdate()
It was saying the same thing as requestLocationUpdates(), but it only provides a single update.

Change-Id: Ib677d40e050a82332df539a823cc677de1fcb4fd
2011-03-28 16:52:44 -07:00
Xavier Ducrohet
b732b7b5e8 am ce57a7f3: am 6504490c: am dff6b8e7: Merge "Add --non-constant-id to aapt."
* 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.
2011-02-28 10:10:38 -08:00
Hakan Gustavsson
6664d989c8 Fixed GSM encoded network initiated position request
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
2011-02-22 14:35:47 +01:00
Scott Main
f4f05b8f24 Update package descriptions with editorial revisions.
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
2011-01-26 14:58:19 -08:00
Jean-Baptiste Queru
65dd62a306 resolved conflicts for merge of ee27dd35 to master
Change-Id: Ia9f4ea86b8554ff04a3aa6b9e065239ae73740e7
2010-12-07 13:17:37 -08:00
Jean-Baptiste Queru
12902d687f resolved conflicts for merge of 78742e01 to stage-korg-master
Change-Id: I0ce429afeb26184f075b4ed326fc4e1c0833e905
2010-12-07 12:51:49 -08:00
Hakan Gustavsson
dea74b0285 Strings for NI position request are moved to resources
The strings used by the framework for network initiated position
requests are now string resources that can be properly localized.

Change-Id: If1cba89adb1bfcb9c8fdb59b9c5aa1107b11279e
2010-12-03 09:47:21 +01:00
Dianne Hackborn
2a32c493ce am cb51c0c7: am 3e94b94f: Merge "Remove old location classes." into gingerbread
Merge commit 'cb51c0c7b155a5141a51fc4d3e57792da7e89cc4'

* commit 'cb51c0c7b155a5141a51fc4d3e57792da7e89cc4':
  Remove old location classes.
2010-09-28 18:24:48 -07:00
Dianne Hackborn
0f5eee0bf8 Remove old location classes.
Change-Id: Ib7e883c64996a8bfaaa755d88b855e17e3442e26
2010-09-28 17:50:50 -07:00
Dianne Hackborn
f72d1e2129 am e5317fbd: am 4f67e1cc: Merge "Add location shared library for location provider APIs." into gingerbread
Merge commit 'e5317fbd48875896e04a34d955edf650f11f9771'

* commit 'e5317fbd48875896e04a34d955edf650f11f9771':
  Add location shared library for location provider APIs.
2010-09-28 17:40:02 -07:00
Dianne Hackborn
63c82c027b Add location shared library for location provider APIs.
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
2010-09-28 15:19:29 -07:00
Mike Lockwood
537ce32c71 am 24956d36: am 307aef01: Merge "LocationManager: Hide location provider and geocode provider APIs." into gingerbread
Merge commit '24956d36f46dd7be0b029a7b2b43c1020ae8a4c5'

* commit '24956d36f46dd7be0b029a7b2b43c1020ae8a4c5':
  LocationManager: Hide location provider and geocode provider APIs.
2010-09-20 19:33:58 -07:00
Mike Lockwood
e15735a9e0 LocationManager: Hide location provider and geocode provider APIs.
Also rename Geocoder.isImplemented() to Geocoder.isPresent()

BUG: 3000738
BUG: 3001413

Change-Id: I56bb4e9a9c59f8b79de585eeb168f74c3ff1a853
Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-09-20 20:14:34 -04:00
Dianne Hackborn
e746f03c6c resolved conflicts for merge of 53686433 to master
Change-Id: I27004dc464f5771d3205ae5757c6eccc5b16854d
2010-09-13 16:56:10 -07:00
Dianne Hackborn
7e9f4eb260 Track client requests through location manager.
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
2010-09-13 14:20:48 -07:00
Mike Lockwood
b445946dea GPS: Initialize XTRA support when GPS is enabled
BUG: 2923148

Change-Id: If9a643e385c6c567b30f47d4caa35fa812a2ba43
Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-08-30 19:42:26 -04:00
Mike Lockwood
3e34d135f7 GPS: Don't set XTRA download pending flag at boot time.
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>
2010-08-30 19:38:45 -04:00
Brad Fitzpatrick
59e6135480 am d71021cb: am 0c731f99: Merge "Send broadcast intent when configured location providers change." into gingerbread
Merge commit 'd71021cb30bd20dabd6783f4235d5f245a7bd1a3'

* commit 'd71021cb30bd20dabd6783f4235d5f245a7bd1a3':
  Send broadcast intent when configured location providers change.
2010-08-27 18:10:38 -07:00
Brad Fitzpatrick
0c5a04014d Send broadcast intent when configured location providers change.
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
2010-08-27 14:01:23 -07:00
Bai Tao
a58a8751b4 Add new system service CountryDetector
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
2010-07-28 09:45:57 +08:00
Mike Lockwood
f4d207b1c2 Don't throw an exception from isProviderEnabled and getLastKnownLocation
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>
2010-07-17 08:21:33 -04:00
Mike Lockwood
8900c32986 andriod.location.Criteria: Simplify new location criteria APIs a bit.
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>
2010-06-23 14:34:03 -04:00
Mike Lockwood
1e11e95f61 Merge "Add Geocorder.isImplemented()" into kraken 2010-05-24 12:59:27 -07:00
Mark Vandevoorde
01ac80b715 Add Geocorder.isImplemented()
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
2010-05-21 15:43:26 -07:00
Mike Lockwood
965b3d2b84 Fix broken Javadoc links
Change-Id: I6896d6ec16b522e9e63776c0992ef55a6db82d50
Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-05-21 15:19:42 -04:00
Mike Lockwood
71677f84e7 Unhide new location manager APIs:
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>
2010-05-21 14:03:45 -04:00
Mike Lockwood
03ca216ac1 New Location Manager APIs for Criteria based requests and single shot mode.
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>
2010-05-21 11:47:19 -04:00
The Android Open Source Project
e88ae544e3 am b6f0cbdc: merge from open-source master
Merge commit 'b6f0cbdcbb566368ebe0468f61de024f644db6e1' into kraken

* commit 'b6f0cbdcbb566368ebe0468f61de024f644db6e1':
  Include the API level 4 fields in the Parcel.
2010-05-10 13:50:32 -07:00
The Android Open Source Project
b6f0cbdcbb merge from open-source master
Change-Id: Ia4cbea9d94b2ff34fc8ce97c1fe35ca5898d6c1c
2010-05-10 13:48:37 -07:00
Jean-Baptiste Queru
855a9e6d12 Merge "Include the API level 4 fields in the Parcel." 2010-05-10 11:14:01 -07:00
The Android Open Source Project
f4dffd8a45 merge from open-source master
Change-Id: I4c28751bd84b41259b12b0f3e3307e11234c8b64
2010-05-06 15:18:59 -07:00
Hakan Gustavsson
fa94ff074d GpsLocationProvider: Store new Location before onGpsStatusChanged is sent
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
2010-04-19 16:16:23 -07:00
Mike Lockwood
a3d2d76983 GpsStatus: Bounds check PRN to avoid array indexing exceptions.
Change-Id: Iea8b525dd8681f32cb7ce7415dad0ec665d9016d
Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-04-14 19:38:26 -04:00
Mike Lockwood
00b74270c9 Move files internal to LocationManagerService from framework.jar to services.jar
Change-Id: Iebbfc49b8300ab59730733efdf489ec87ea45a25
Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-04-04 18:44:05 -04:00
Mike Lockwood
5b53244a4e GpsNetInitiatedHandler: whitespace cleanup
Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-04-04 18:44:05 -04:00
Mike Lockwood
79e642e8ed Call LocationManager.sendNiResponse() instead of calling directly to GpsLocationProvider
Change-Id: I6a5b47abb0519f5228d29bc3340bb2490564803e
Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-04-04 18:44:05 -04:00
Mike Lockwood
8909631710 Wait until GpsLocationProvider is fully initialized before returning from the constructor.
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>
2010-03-24 12:38:42 -04:00
Mike Lockwood
62a8fc159a GpsLocationProvider: Do our work in a Handler running in a separate thread.
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>
2010-03-22 15:14:31 -04:00
Mike Lockwood
69d63446d8 Remove unused file NmeaParser.java
Change-Id: I8027b98ccf1271870243ced8a7ccc61d25a224b2
Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-03-17 22:36:15 -04:00
Fred Fettinger
3c8fbdf5dd location: dump LocationProvider internal state
For each location provider, call getInternalState() to see if it has any
state information to include in a bugreport. If the returned string is not
null, then print a header with the provided name followed by the returned
string.

Change-Id: I0a388d7fba14ac8cadcb80eda0a0ceb95032410b
Signed-off-by: Fred Fettinger <fred.fettinger@motorola.com>
Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-03-07 09:29:15 -05:00
Mike Lockwood
689e449b24 Check for null provider in LocationManager.getProviders()
Change-Id: I294ce0b1f364cfdf956ac55260f9d40f0704b5f7
BUG: 2485977

Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-03-03 15:35:13 -05:00