359 Commits

Author SHA1 Message Date
Lifu Tang
e50607efab Fixed the sign error in GnssClock
Bug: 28068514
Change-Id: I71b68acb70d4139f94f3829bd4a280d926e251de
2016-04-08 14:10:42 -07:00
Lifu Tang
e8abe8e5ad Addressed API review comments and updated JavaDoc
Bug: 27274532
Bug: 27948390
Change-Id: I0255d2511deab788dcab9815def9c1287a50b7f9
2016-04-06 17:54:35 -07:00
Lifu Tang
e296ab692a Merge "Returns the correct elevation in GnssStatus" into nyc-dev 2016-03-30 19:52:57 +00:00
Glenn Kasten
0f5e32d8eb Merge "Fix CRLF" into nyc-dev 2016-03-30 19:41:05 +00:00
Lifu Tang
4fb5dc1e4a Returns the correct elevation in GnssStatus
Bug: 27902867
Change-Id: I57ea191e531305268d4a87f9d444425f20ef7f8e
2016-03-29 13:15:02 -07:00
Lifu Tang
a89a392aef Merge "Added missing constants to GnssMeasurement" into nyc-dev 2016-03-28 18:22:28 +00:00
Lifu Tang
047b05ea6e Added missing constants to GnssMeasurement
Bug: 27816668
Change-Id: Ib1638f5ac3941c4b6d9babca0acdc80df498e0af
2016-03-25 12:56:32 -07:00
Lifu Tang
145ff558ad Merge "A few changes to the measurement implementation" into nyc-dev 2016-03-22 23:08:39 +00:00
Lifu Tang
17350f925f A few changes to the measurement implementation
- Fixed the device crashing bug in JNI code
- Fixed a typo ('lock' => 'clock')
- Added hardware clock discontinuity count in toString()

(cherry picked from commit 3a21b02ee2dc8f2c6c879109757d89a2be5d720a)

Change-Id: I6dbda85abda20da0240ac08b22b81729eae7b6f0
2016-03-22 15:29:24 -07:00
Jeff Sharkey
620a28bad2 Merge "Mark more Bundles as being defusable." into nyc-dev 2016-03-18 19:54:52 +00:00
Julius D'souza
77e645123f Merge "CTS: Add @hide annotations to several @IntDef elements" into nyc-dev 2016-03-18 19:53:56 +00:00
Glenn Kasten
ff7c8b9e9d Fix CRLF
Change-Id: I6740b5fefae2f16d0ce247ff78e7cb5a6f3f8642
2016-03-18 12:30:09 -07:00
Julius D'souza
2b67c07d82 CTS: Add @hide annotations to several @IntDef elements
Bug: 27232186

Change-Id: Idd70359e22606a5ff21dfaffd119528cedd08b5a
2016-03-18 12:18:18 -07:00
Jeff Sharkey
a04c7a7c64 Mark more Bundles as being defusable.
They're destined for the system, so they're okay to look inside.

Bug: 27726127
Change-Id: Ic85c308a8efe6f9b8652952717c72b3c663d328a
2016-03-18 12:20:39 -06:00
Lifu Tang
275b4499bc Merge "Removed unused methods from GnssMeasurement" into nyc-dev 2016-03-17 19:23:40 +00:00
Lifu Tang
1778b030f7 Fixed bugs in serialization and object cloning
Bug: 27621461
Change-Id: I52cbf874d506cc5f6dee73d1a14b5dc07f87bd39
2016-03-17 10:40:47 -07:00
Lifu Tang
b9048f88ce Removed unused methods from GnssMeasurement
Bug: 27633183
Change-Id: I6304a431b75aaa338b6f22e6d213cd5f4f10cd60
2016-03-14 01:28:45 -07:00
Lifu Tang
0f1ab04516 Modified the API to make coverage test possible
Bug: 27462840
Change-Id: Idfd2c3c108b25f8be9046fd4bb72dbc57edc24bd
2016-03-09 11:32:43 -08:00
Lifu Tang
76a620f048 Addressed the review comments from API Council
Following are the review comments from API Council:

(Places below that reference "s/foo/bar/" below are suggesting that "foo" be
 replaced with "bar".)

GnssClock
-- Class docs should not refer to "GPS" at the top level
-- s/InNs/Nanos/
-- s/Sec/Second/

GnssMeasurement
-- s/In// for "InUnitname"
-- s/Sec/Second/
-- s/Ms/Millis/
-- s/Deg/Degrees/
-- STATUS_GPS_LOCATION_DISABLED -> STATUS_GNSS_LOCATION_DISABLED

GnssMeasurementsEvent.Callback
-- "returns" -> "reports" in the method docs as the methods return void

LocationManager
-- register/unregisterGnssMeasurementEventCallback ->
   register/unregisterGnssMeasurementsEventCallback (plural)

GnssNavigationMessage
-- MESSAGE_TYPE_ constants -> change to just TYPE_; the "MESSAGE" is redundant
   with the class name
-- is a signed byte/short ok based on the standard here? If not consider using
   int in the public api

GnssStatus
-- Make sure @IntDef exists for the constellation type
-- Please append unit types for values returned to match GnssMeasurement methods

GnssStatusCallback
-- Please document time base/units for the time parameter of onFirstFix

Bug: 27385557
Change-Id: Ifed6a2eca3fd7ba89b3ded6964a70376235af8f4
2016-03-02 16:41:47 -08:00
Jeff Sharkey
f8880561e6 When system server goes down, crash apps more.
Similar to first patch, but now using new "rethrowFromSystemServer()"
method which internally translates DeadObjectException into
DeadSystemException.  New logic over in Log.printlns() now
suppresses the DeadSystemException stack traces, since they're
misleading and just added pressure to the precious log buffer space.

Add some extra RuntimeInit checks to suppress logging-about-logging
when the system server is dead.

Bug: 27364859
Change-Id: I05316b3e8e42416b30a56a76c09cd3113a018123
2016-02-27 17:17:01 -07:00
Lifu Tang
38bce7925c Removed clock type from GnssClock
Bug: 27341583
Change-Id: I5ffd891737c3ddf83d9c6a78aa36c94858591199
2016-02-25 15:46:41 -08:00
Lifu Tang
9363b949a1 Finalized GPS=>GNSS changes with documents
Bug: 27098594
Change-Id: I24529e60d8eb9b48b644cf01e5efc684e6f04839
2016-02-19 16:59:28 -08:00
Lifu Tang
120480f17a Optimized the memory consumption and renamed PRN
Bug: 27058251
Change-Id: I2309943b1a4e7565868ed0f247b84edc631fbd59
2016-02-11 11:29:40 -08:00
Lifu Tang
d46d308562 Worked around the crash caused by API renaming
Bug: 26885642
Change-Id: I1f1ad76d18444d5f250397ef491e1dd4858f0a1d
2016-02-02 17:25:32 -08:00
Lifu Tang
818aa2c2c4 Rename Gps to Gnss for measurement-related APIs
Bug: 26895757
Change-Id: I12d89dc251e356cf976a4bcd3589a8925a8ad745
2016-02-02 16:15:03 -08:00
Lifu Tang
e5a0e21b6f Framework support to read newly added fields
Change-Id: Ie43395addd102656a4dbf9c25111ac50ec9afe41
2016-01-27 18:01:33 -08:00
Lifu Tang
82f893d6df Added an API to query GPS hardware version info
Change-Id: Ic45357d30da350759f56c9d061e60196acb3255b
2016-01-27 17:38:24 -08:00
Lifu Tang
a8b7bb5a50 GPS Measurement and Navigation APIs go public
Those APIs are already used by first-party Apps for a while. We now make them
available to third-party Apps as well.

Change-Id: I87d9f0dbb04831fc849228d7df03a2686e2eb383
2016-01-27 16:07:09 -08:00
Lifu Tang
30f95a7d67 Supported GNSS multi-constellation in frameworks
Change-Id: I82574afd3697c47e806d2cfaedc33756d0353b73
2016-01-25 15:15:14 -08:00
David Christie
923b260258 Make Location objects take less memory.
-Use bitmask for has*** methods.
-Use ThreadLocal for caching intermediate computations
 rather than preallocating memory in every Location

Change-Id: If2fa17bfd59511ec0b809f4b7d7cd8028360c340
2015-10-27 18:09:53 -07:00
David Christie
5575ddfcc1 Correct range checking for location strings during conversion
Minute values in the range [0, 59] are valid if seconds are
present. If seconds are not present then minute values are
valid in the range [0, <60]

Second values are valid in the range [0, <60]

Examples:
50:59:59.99999 is valid
50:59.99999 is valid
50:59.1:1 is not valid

Patch taken from Motorola: partner gerrit 137210

Bug: 17958582
Change-Id: I0d1265534092157883af564119f723984362d436
Issues: 2667 and 2668
2015-10-27 14:13:03 -07:00
Daniel Estrada Alva
47ee2ecf82 Merge "Disable AR HW when client binder dies." into mnc-dr-dev 2015-08-26 21:09:50 +00:00
destradaa
e1a5144a1d Cherry-pick: Add callback-based support for HW Activity Recognition.
Add a callback-based mechanism for GmsCore to connect to Hardware Activity
Recognition. This allows GmsCore to stop polling to identify if the Android
platform supports the functionality or not.

Bug: 17112184
Change-Id: I8f9459cbd15eecd70f6919c6551e6f7a663c732f
2015-08-24 11:43:27 -07:00
destradaa
614612edb5 Disable AR HW when client binder dies.
Ensure that activities are unregistered from AR HW when the client's
binder dies. This clean up is required to prevent AR HW to keep active
when there are no clients listening for events.

Bug: 19894637
Change-Id: Iccd609cf1d2d4a4453c7a96cb8645b61639c3234
2015-08-24 11:02:52 -07:00
David Christie
b870dbf86b Fix privacy leaks in LocationManager
-Register for listener for permission changes and stop
 request immediately if client loses permission.
-Also remove permission requirement to remove geofences
 and clean up permission annotations.

Bug: 21903866
Change-Id: I7e028b6b2ca5b21f25fcbba5de86dfb55caff872
2015-06-22 12:42:53 -07:00
Jason Monk
b71218aec1 Add way to get the network location provider package
Bug: 21805447
Change-Id: Ie9fd35a69d8808ae4346927b30b77e9fd733b569
2015-06-17 15:16:51 -04:00
Chris Wren
1ce4b6d3c6 remove usage of deprecated method setLatestEventInfo
Bug: 18510449
Change-Id: I56a77991c729990e501f402e007dfa79ee57621e
2015-06-12 10:16:04 -04:00
Makoto Onuki
a4db6473f7 CountryDetector no longer requires location permissions.
Country information is already available elsewhere (MNC/MCC), so there's no
point enforcing these permissions.

It wasn't properly enforcing the permissions anyway, since the code path in
question was sometimes executed on a handler thread.

Bug 20927020

Change-Id: Ia090664917f7b694e80dd55934db442633bab1d8
2015-05-21 16:29:40 -07:00
Svet Ganov
f7e9cf4fb4 Access mock location is no longer a runtime permission - framework
The access mock location is no longer a runtime permission. It is a
signature protected one that apps cannot get but the fact they request
it means they want to inject location into the system. Now the user
gets to choose the current mock location app in developer options from
the apps that request the mock location permission. The access to mock
location is no longer guarded by the permisson but from a new app op
which is off by default and the settiings UI sets it to enabled only
for the currently selected mock location app.

bug:21078873

Change-Id: I19e3f9dc7c7de82eab46b30fec1abfbca54a0e59
2015-05-13 15:37:21 -07:00
destradaa
cbba357159 am 2c160c1a: am bdf9ffdd: am c0667853: Merge "Add SystemApis in GpsMeasurements APIs to reflect changes in GPS HAL. b/19938206" into mnc-dev
* commit '2c160c1a64a696dcb6261311ca0a406a07231d33':
  Add SystemApis in GpsMeasurements APIs to reflect changes in GPS HAL. b/19938206
2015-04-29 18:34:18 +00:00
destradaa
d593bf272d Add SystemApis in GpsMeasurements APIs to reflect changes in GPS HAL.
b/19938206

Change-Id: I91fd65b29e091b600ee4982a16321308e4d55aef
2015-04-28 12:49:20 -07:00
Tor Norbye
c347ec6763 Add permission annotations on the LocationManager API
Change-Id: I244e8da8a91bba05e5437b9b386caf4e5cf7b125
2015-04-23 16:45:04 -07:00
destradaa
5e72118f19 Update GpsMeasurements APIs to reflect changes in GPS HAL.
b/19938206

All new introduced APIs are hidden.

GpsMeasurement#isPseudorangeRateCorrected() is need to properly identify different types
of data provided by different partners. Given the nature of each GPS engine, this change is
required to accomodate the data that can be provided by many partners.
GpsNavigationMessage#getStatus() is required to ensure that the Location process is aware
if the state of the messages, and can act depending on it.

Change-Id: Ie34b1e69bf26a1bde86931ce61168421429bf8f8
2015-04-15 12:57:17 -07:00
David Christie
cfc9b6d6ab Add versioning to FLP HAL.
Retain compatibility with implementations compiled
against old headers or left unchanged from LMP.

Change-Id: I3f7cfaaf0cba8697c312940a805b053c6040caa6
2015-04-14 12:14:03 -07:00
David Christie
fff30439ca Add ability to flush FLP HAL batched locations buffer.
Currently GmsCore has to guess how many locations to retrieve
based on requested frequency and then demux the output looking
for timestamps (that aren't monotonically increasing).  This
capability gives GmsCore a more graceful solution.

Change-Id: Ie1d71615f699bc0d3c63f8b80aa7b40b9971cf96
2015-04-13 19:13:52 -07:00
David Christie
15003f19e5 Add a status callback for location batching in FLP HAL
-Allows GmsCore to know when location is unsuccessful so
 it can switch to a SW solution.

Change-Id: I3d1df7b828f7fb189446881eea87d9a952310614
2015-04-13 17:25:27 -07:00
David Christie
ffca45a2cd Add capability callback for FLP HAL.
Let HAL implementation tell if geofencing/batching is
supported and which technologies (GNNS, wifi, etc)
can be used.

Still todo: Add ability for GmsCore geofencing to
tell which technologies are supported (instead of
just using it to update monitoring).  This requires
SystemApi change + approval so will do in separate CL.

Note that the classes in the lib are not copied
directly into GmsCore.  The instance will always
be whatever is in the platform.  This is why
the callback is backwards compatible as long as
their is a default implementation (but not if
it's abstract).

Change-Id: I7d6adeb049b89935bc4443785df5d7ef4c730e5d
2015-04-12 16:22:03 -07:00
David Christie
295a93b99f Add smallest displacement field to FLP HAL
Change-Id: I4d857256c035c65185be3be8401bec8d45091aaf
2015-04-08 17:33:38 -07:00
Alan Viverette
4a357cd2e5 Replace usages of deprecated Resources.getColor() and getColorStateList()
Change-Id: I8f64fe6c4c44a92ff6d07250223ba590a1d691b0
2015-03-18 18:37:18 -07:00
John Spurlock
08c7116ab9 Remove unused imports in frameworks/base.
Change-Id: I031443de83f93eb57a98863001826671b18f3b17
2015-02-28 14:47:49 -05:00