History log of /frameworks/base/location/java/android/location/LocationManager.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
f80809ffd7b6ea8eb120ce5ccb343582c2757ea0 04-Apr-2018 Philip P. Moltmann <moltmann@google.com> Expose TestAPIs needed by GtsOsTestCases

Test: atest GtsOsTestCases on pi-dev:taimen and oc-mr1:sailfish
Bug: 77497338
Change-Id: I5de976991a857bfbed2faa943822af542601fa8b
/frameworks/base/location/java/android/location/LocationManager.java
2a9409e91457c175be5ee36d3e676a70dc52bdca 21-Mar-2018 Maggie <yiranwang@google.com> Fix test location provider bug

LocationManager.isProviderEnabled should return true for a test provider if:
1. A test provider is added through LocationManager.addTestProvider
2. The test provider is enabled through LocationManager.setTestProviderEnabled

This fix changes the logic if LocationManager.isProviderEnabled and
LocationManager.setProviderEnabledForUser to allow users get/set test
location provider status.

Bug: 72647543
Bug: 77238940
Test: Manual
Test: run cts --module CtsLocationTestCases -t android.location.cts.LocationManagerTest
Change-Id: Ib241e5b487fd873c1fa0d7ac34b82b8592fc0906
/frameworks/base/location/java/android/location/LocationManager.java
aa8cbab151f4df89e3e2c7f3df36b005e01d8558 22-Mar-2018 Wyatt Riley <wyattriley@google.com> Merge "GNSS Model Name constant string and comment updates" into pi-dev
83e03f55597a69bf1e1f2df2cd24e83e84d21914 16-Mar-2018 Maggie <yiranwang@google.com> Fix location settings bug on non-GPS devices

The old location_mode API hardcoded gps and network location provider when it enables/disables location, without checking whether the providers exist on device.
It causes bugs when used together with the new
LocationManager.setLocationEnabled() APIs.

This fix modified LocationManager.setLocationEnabled() API when user
tries to disable location on device. Besides turning off the providers
from LocationManager.getAllProviders(), it also turns off GPS and
network provider explicitly.

To reduce times of binding to the service and chance of race condition, we also
modified SettingsProvider.updateLocationProvidersAllowedLocked() to
accept a string param with multiple location providers to be
enabled or disalbed at the same time.

Bug: 73261572
Test: Manual on chromebook
Change-Id: I2e59e0d4cf395b98cd481af5d7f3c762274d7826
/frameworks/base/location/java/android/location/LocationManager.java
49097c0b99c0fda9f5343406d28027a726bb94ee 15-Mar-2018 Wyatt Riley <wyattriley@google.com> GNSS Model Name constant string and comment updates

Addressing API review feedback
Removed string, returning Null instead
Updated comments

Bug: 73951626
Test: Runs on device w/GnssLogger
Change-Id: I54d05a7ae000e9ff52ec1f6646f83aed7de81b94
/frameworks/base/location/java/android/location/LocationManager.java
2e17d3f4f8e8775b69cd0495ba4100e8d5e57fee 02-Mar-2018 Maggie <yiranwang@google.com> Remove javadoc for return value

LocationManager#setLocationEnabledForUser has documentation for return value even though it's void. Fix the bug by removing the return javadoc.

Bug: 73751024
Test: Manual
Change-Id: I785e9f08674f472fe0f248972d5cc6055e64412a
/frameworks/base/location/java/android/location/LocationManager.java
98af2e4fec8c417f4a674a99f4b40f6f248d6a83 16-Feb-2018 Jeff Sharkey <jsharkey@android.com> Add RequiresFeature annotation.

Certain APIs require that a device have a specific feature to operate
correctly, so start annotating them.

Test: builds, boots
Bug: 72284763
Change-Id: Ie2f30284bdfdb6acc4067f434eba3b5433837606
Exempt-From-Owner-Approval: simple annotations
/frameworks/base/location/java/android/location/LocationManager.java
9ca162532e879ee8645ba8d4485f4b1badb8f73a 08-Feb-2018 Maggie <yiranwang@google.com> Check for null LOCATION_PROVIDERS_ALLOWED value

After reading LOCATION_PROVIDERS_ALLOWED value from settings provider,
check for null first.

Bug: 72711160
Bug: 72732478
Test: Manual
Change-Id: I813e40f11f078d80c4cc20986f030fdadfe433c6
/frameworks/base/location/java/android/location/LocationManager.java
589f038d63d848b8d131b1888a479957da91b8b8 31-Jan-2018 Maggie <yiranwang@google.com> LocationManager constants for footer injector

Add broadcast actions and metadata names in LocationManager for
injecting footers under Settings -> Security & Location -> Location.

Bug: 70350519
Test: Manual
Change-Id: I4d187a54cd87d8964d84bfef44515ac9ef77db29
/frameworks/base/location/java/android/location/LocationManager.java
7c30c68cc594e4e4d13dca6343b118f998f4eaff 26-Jan-2018 Lifu Tang <lifu@google.com> Move location-related code into client library

These first-party only methods can only be called by privileged
packages, and Settings.Secure already applies strict permission check to
them. Therefore moving the code into client library can save us from
unnecessary binder calls, and can also make checking the caller package
name much easier.

Test: Manual
Change-Id: I76a939a660357f87b01ff4ac07ec3f17093d3c41
/frameworks/base/location/java/android/location/LocationManager.java
aa080f96763a9d38f21fb33de93216cd207a5930 05-Jan-2018 Maggie <yiranwang@google.com> Deprecate location modes

1. Mark public fields as deprecated: LOCATION_MODE, LOCATION_MODE_HIGH_ACCURACY, LOCATION_MODE_SENSORS_ONLY,
LOCATION_MODE_BATTERY_SAVING, LOCATION_MODE_OFF.

2. Add new public methods to LocationManager:
setLocationEnabled(boolean)
isLocationEnabled()
setLocationProviderEnabled(String, boolean)

3. Remove LOCATION_PREVIOUS_MODE and constant
LOCATION_MODE_PREVIOUS. Refactor code that references
LOCATION_MODE_PREVIOUS to use LocationManager.setLocationEnabled or
LOCATION_MODE_HIGH_ACCURACY.

4. Mark deprecated fields and methods as removed: LOCATION_PROVIDERS_ALLOWED, setLocationProviderEnabled(), isLocationProviderEnabled()

5. Refactor logic in Settings app and Quick Settings to call
LocationManager.setLocationEnabled() instead of setting location mode.

Bug: 70990911
Test: Manual
Change-Id: Ia49b385f8b6a358b62291983eb0146af0ecf8e02
/frameworks/base/location/java/android/location/LocationManager.java
8671feab630c1938691f44502ff7be9c7b03e7c4 09-Dec-2017 Ram Periathiruvadi <ramperry@google.com> Add a hidden API to inject location.

New API allows system clients with LOCATION_HARDWARE and
ACCESS_FINE_LOCATION to inject a location to the Location Manager. This
is useful in products like Auto, where the location needs to be cached
across reboots.

Bug: b/64125396
Test: Foll. were tested:
1. location can be injected when lastLocation is not available
2. location cannot be injected when lastLocation is already available
Also, tested location availability on different devices for sanity.
Change-Id: I1fd060caafed0431074ae64439ac52e99e0d6032
/frameworks/base/location/java/android/location/LocationManager.java
d87cf9176237bd3233edded7dbb9276226d764dc 05-Dec-2017 Wyatt Riley <wyattriley@google.com> Providing GNSS Model Name & Year

GNSS Model Year moves from a TestApi to public
GNSS Model Name is connected from a new .hal to public

Bug: 38003769
Test: Builds, works with CTS & Test App on Pixel 2
Change-Id: I3e0a56c60e1a4d298e120df11ffd37b06ecea050
/frameworks/base/location/java/android/location/LocationManager.java
fab2e2cbaab77d85c708ede54029b46d938f8e66 21-Nov-2017 Maggie <yiranwang@google.com> Send MODE_CHANGING broadcast before location mode change.

When location mode is about to change in Settings app, send
MODE_CHANGING broadcast.

Fixes: 28057031
Test: manual
Test: robotests
Change-Id: Id26325520211a8934c1670dfcd12e8d339766308
/frameworks/base/location/java/android/location/LocationManager.java
7f2cfed525e806efd7a9ba658b54583579f27fe5 28-Jun-2017 Wyatt Riley <wyattriley@google.com> Ensure complete GnssStatus construction

Using volatile reference & final member pattern.

Bug: 37517406
Test: basic GNSS & GPS Status output works
Change-Id: I5650149e0a3f63a52734c8f044d38f3956819921
/frameworks/base/location/java/android/location/LocationManager.java
bfc4fcde9f756337fc8d0867ff04549b08688fff 06-Jun-2017 Jeff Sharkey <jsharkey@android.com> Give Doclava our manifest; more permission docs.

We've seen some @SystemApi methods protected with non-system
permissions, so give Doclava the platform AndroidManifest.xml so it
can parse the actual permission protection levels to look for APIs
that are letting in non-system apps.

Also document more @SystemApi permissions.

This is purely a docs change; no logic changes are being made.

Test: make -j32 update-api
Bug: 62263906
Change-Id: Ie0f0a5fb0033817bcc95060f2183a52ae4ae7b06
/frameworks/base/location/java/android/location/LocationManager.java
d86b8fea43ebb6e5c31691b44d8ceb0d8d3c9072 03-Jun-2017 Jeff Sharkey <jsharkey@android.com> Annotate @SystemApi with required permissions.

Most @SystemApi methods should be protected with system (or higher)
permissions, so annotate common methods with @RequiresPermission to
make automatic verification easier.

Verification is really only relevant when calling into system
services (where permissions checking can happen on the other side of
a Binder call), so annotate managers with the new @SystemService
annotation, which is now automatically documented.

This is purely a docs change; no logic changes are being made.

Test: make -j32 update-api && make -j32 offline-sdk-docs
Bug: 62263906
Change-Id: I2554227202d84465676aa4ab0dd336b5c45fc651
/frameworks/base/location/java/android/location/LocationManager.java
cf879db3666523404ff7e15e77b11434732b4a06 12-Jan-2017 Wyatt Riley <wyattriley@google.com> GNSS Batching - Default Implementation

Connections from .hal layer, through to
Location Manager System APIs

Bug: 31974439
Test: builds, boots, ordinary GNSS & new GNSS batching
basic functional checks on Marlin
Change-Id: If75118c27b5ed34cfc16c9f817b60a3be5485095
/frameworks/base/location/java/android/location/LocationManager.java
4402af6be9de4782d218170203033618f079551d 11-Jan-2017 gomo <gomo@google.com> GNSS O Features according to go/o-gps-hal

Added "Tow Known" as a possible gnss measurement state. As well added Automatic Gain Control (AGC)
to allow jammer detection. Also added the GNSS carrier frequeny to SV status. Also added vertical
GPS position uncertainty, speed uncertainty and bearing uncertainty. Also propagate locaton new
fields to geofence engine.
Test: Existing unit tests still pass.

Change-Id: I472b2fd2516cb7614877dea4bb054a34f50844dc
/frameworks/base/location/java/android/location/LocationManager.java
a2bbfbcf8920ecec5700c1824b0436118cada5be 20-Dec-2016 Wyatt Riley <wyattriley@google.com> Removing @removed methods and constants

Several methods, plus a few hashmaps,
helper classes, and some constants
existed for an early builds
of NYC, and were marked @removed, and are
here finally removed.

Bug: 28208055
Change-Id: If650d83c0dc573e922342d09360ecf9a5bb0c98a
Fixes: 28208055
Test: GMaps, AndroiTS GPS Test, GnssLogger & CtsVerifier
All run fine on a Pixel
/frameworks/base/location/java/android/location/LocationManager.java
4e82fe51207bbd8ceaec356b4215e338ec63a31e 24-Oct-2016 Lifu Tang <lifu@google.com> Fix GNSS status delivery to the callbacks

Bug: 32357457
Change-Id: I8f2b8dae5472cb81313417e85c092dca0aae5bd9
/frameworks/base/location/java/android/location/LocationManager.java
98ad88811c76f7334c285cc970a4107f7a716b5a 01-Jun-2016 Gina Dimino <gdimino@google.com> Docs: Suppress errors in SystemApi Build
Bug: 28427390

Change-Id: Ifea85bf7b1fcdd30a3d7f61bd17d0efba6368aa4
/frameworks/base/location/java/android/location/LocationManager.java
e8abe8e5ad830bd130b258c6801d75f6542200b5 01-Apr-2016 Lifu Tang <lifu@google.com> Addressed API review comments and updated JavaDoc

Bug: 27274532
Bug: 27948390
Change-Id: I0255d2511deab788dcab9815def9c1287a50b7f9
/frameworks/base/location/java/android/location/LocationManager.java
76a620f0482ba54a4921c7c7e7eeb8ea87c12d3e 27-Feb-2016 Lifu Tang <lifu@google.com> 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
/frameworks/base/location/java/android/location/LocationManager.java
f8880561e67e1da246970b49b14285efd4164ab1 26-Feb-2016 Jeff Sharkey <jsharkey@android.com> 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
/frameworks/base/location/java/android/location/LocationManager.java
9363b949a104786c87cd2cd18f206ff3c1957e5e 17-Feb-2016 Lifu Tang <lifu@google.com> Finalized GPS=>GNSS changes with documents

Bug: 27098594
Change-Id: I24529e60d8eb9b48b644cf01e5efc684e6f04839
/frameworks/base/location/java/android/location/LocationManager.java
120480f17ae18bbe8c6fa7ec4854281fdf349b59 08-Feb-2016 Lifu Tang <lifu@google.com> Optimized the memory consumption and renamed PRN

Bug: 27058251
Change-Id: I2309943b1a4e7565868ed0f247b84edc631fbd59
/frameworks/base/location/java/android/location/LocationManager.java
d46d308562b78af6a06d014e17cb67a6e3103b30 03-Feb-2016 Lifu Tang <lifu@google.com> Worked around the crash caused by API renaming

Bug: 26885642
Change-Id: I1f1ad76d18444d5f250397ef491e1dd4858f0a1d
/frameworks/base/location/java/android/location/LocationManager.java
818aa2c2c46addae934fb6cd42f889affc9ef747 01-Feb-2016 Lifu Tang <lifu@google.com> Rename Gps to Gnss for measurement-related APIs

Bug: 26895757
Change-Id: I12d89dc251e356cf976a4bcd3589a8925a8ad745
/frameworks/base/location/java/android/location/LocationManager.java
82f893d6df236d257ab2142dd63e72865a5e4f00 22-Jan-2016 Lifu Tang <lifu@google.com> Added an API to query GPS hardware version info

Change-Id: Ic45357d30da350759f56c9d061e60196acb3255b
/frameworks/base/location/java/android/location/LocationManager.java
a8b7bb5a50d8ad197c6f32eb308919c11b52ce74 26-Jan-2016 Lifu Tang <lifu@google.com> 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
/frameworks/base/location/java/android/location/LocationManager.java
30f95a7d67870c28d2aaa88ee989c099f5670225 08-Jan-2016 Lifu Tang <lifu@google.com> Supported GNSS multi-constellation in frameworks

Change-Id: I82574afd3697c47e806d2cfaedc33756d0353b73
/frameworks/base/location/java/android/location/LocationManager.java
b870dbf86bd47c750d2a5350a83ec245396578ee 22-Jun-2015 David Christie <dnchrist@google.com> 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
/frameworks/base/location/java/android/location/LocationManager.java
f7e9cf4fb48ea80cbc5088204ac3f898109623f7 13-May-2015 Svet Ganov <svetoslavganov@google.com> 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
/frameworks/base/location/java/android/location/LocationManager.java
c347ec6763f621165e1cb3da235d540967a7922a 08-Apr-2015 Tor Norbye <tnorbye@google.com> Add permission annotations on the LocationManager API

Change-Id: I244e8da8a91bba05e5437b9b386caf4e5cf7b125
/frameworks/base/location/java/android/location/LocationManager.java
3546c9a5821fc8a754e05593d314c49cd6bca0d0 07-Nov-2014 destradaa <destradaa@google.com> Merge "Mark Gps Raw related APIs as System APIs. b/16727892" into lmp-mr1-dev
a62050d42c7d76d57ae555ffcb6d8efc5cf79de1 23-Oct-2014 destradaa <destradaa@google.com> Mark Gps Raw related APIs as System APIs.
b/16727892

Change-Id: I29d78d45aef7829c3321ae4e7c26549e46fa39f9
/frameworks/base/location/java/android/location/LocationManager.java
6568d709e78d6ccaf256b7d0e4a19cdfb26deafb 27-Oct-2014 destradaa <destradaa@google.com> Add support for GPS measurement/navigation message capabilities.
b/16727892
b/16815124

The listeners are changed to receive statuses asynchronously, this is required because GPS HAL,
requires time to be notified of the capabilities it supports.

Change-Id: Ie69fdd629d8680341386a2c736bc851632dd2bda
/frameworks/base/location/java/android/location/LocationManager.java
955d8d69ea6caabce1461dc25b339b9bf9dc61a6 08-Oct-2014 Dianne Hackborn <hackbod@google.com> Put in real "code" (aka marketing) name.

Change-Id: Idb3976edfae37293ed75cb5b869b4b42d8042bbe
/frameworks/base/location/java/android/location/LocationManager.java
61ee1eda0afb78c4ded09ac516f58283191e38df 17-Sep-2014 David Christie <dnchrist@google.com> Merge "Add @SystemApi to LocationManager methods used by GmsCore (with reflection). Bug: 17515515" into lmp-dev
4bd34887324b90478ee89358697c543dca9cf4dc 16-Sep-2014 David Christie <dnchrist@google.com> Add @SystemApi to LocationManager methods used by GmsCore (with reflection).
Bug: 17515515

Change-Id: I005871c721868bc52a3057839949eb342181b7b8
/frameworks/base/location/java/android/location/LocationManager.java
bc3095139e9b8c7640fe6cebb4fc527af916d1be 08-Sep-2014 Tom O'Neill <tomo@google.com> Fix a STOPSHIP

Change-Id: I3714f1645c0a847e912cb79515fe3991960c1698
/frameworks/base/location/java/android/location/LocationManager.java
4b3e3931270f8e406fc806bc7fa1c2788256687d 22-Jul-2014 destradaa <destradaa@google.com> Expose Gps Navigation Messages in the platform.
b/16405976

Change-Id: Ic982ea2467d116585780c20c2fa7e974e50f8345
/frameworks/base/location/java/android/location/LocationManager.java
ea8a8a6076f04360de2d25b3e5853cde8026cd5f 24-Jun-2014 destradaa <destradaa@google.com> Update location framework to accept raw data from GPS HAL.

Change-Id: Ib4feca004b53fa89dcece4299974ab08913455a0
/frameworks/base/location/java/android/location/LocationManager.java
43c9b107d838d2d152d243151f1728d3b39a2821 05-Jul-2014 Nick Kralevich <nnk@google.com> am 812de6f6: am dbed61c8: am ca2df286: Merge "Fix typo in the exception message."

* commit '812de6f6d75f71d1c2fd9cd319a78389c5adb703':
Fix typo in the exception message.
afecea18054c457cbd55d1ed9c023f2c2aa3726b 01-Mar-2014 Tom O'Neill <tomo@google.com> Seeing if a provider is enabled doesn't require special permissions

- Bug: 10696351

Change-Id: I4f1612ce10587728e71277587144fdcb59445b3f
/frameworks/base/location/java/android/location/LocationManager.java
8a985d24ce9a38f40ed88fecbdcd0e75e3a68f44 25-Feb-2014 John Spurlock <jspurlock@google.com> Tabs -> spaces in frameworks/base.

Change-Id: I5a84e8e93ac99b5ed0212b37bf66efa5e53864be
/frameworks/base/location/java/android/location/LocationManager.java
405393cfe33c857e2f430ebc09c891b886c75e73 24-Oct-2013 Masaki Muranaka <monaka@monami-software.com> Fix typo in the exception message.

Change-Id: I5e8c089dfd406af40c4eb3aa76af13398c05b7e6
Signed-off-by: Masaki Muranaka <monaka@monami-software.com>
/frameworks/base/location/java/android/location/LocationManager.java
d5759437eeb3137e4a05471ff0f4681c0254e81a 11-Sep-2013 Tom O'Neill <tomo@google.com> Improve some javadoc related to isProviderEnabled() apis

- LocationManager.isProviderEnabled() no longer throws SecurityException:
the caller could already circumvent the permission check by calling
Secure.isLocationProviderEnabled()

Change-Id: I5abd04264299671ed35ce4594b5be46d86378767
/frameworks/base/location/java/android/location/LocationManager.java
40a86c24d2601df4966c57573a5bf58b30a41990 04-Sep-2013 Tom O'Neill <tomo@google.com> Add LocationManager.MODE_CHANGED_ACTION broadcast

- Currently redundant with PROVIDERS_CHANGED_ACTION, but that may
change in the future

- Part of fix for b/10409275

Change-Id: I12daaf20e6546fd9e9dc71c599967fa0ad95e27f
/frameworks/base/location/java/android/location/LocationManager.java
c750c1fb83fbdec895e236dda7207db4da14ec49 08-Aug-2013 David Christie <dnchrist@google.com> Update gps status icon to be a "high power" location icon.
Move icon to right side of the screen and synchronize status with
AppOpsManager.OP_MONITOR_HIGH_POWER_LOCATION.

Change-Id: Iea2570501cb18be0489669fd4ea240dc63f9567a
/frameworks/base/location/java/android/location/LocationManager.java
54ca7aef2e12b240caa6fb1a1e65abd234bea337 08-Jan-2013 Victoria Lease <violets@google.com> Annotate Locations coming from mock providers

LocationManagerService now annotates incoming Location objects that
have come from mock location providers. The new isFromMockProvider()
method can be called on any Location to determine whether the
provider that supplied the Location was a mock location provider.

Bug: 6813235
Change-Id: Ib5140e93ea427f2e0b0036151047f87a02b4d23a
/frameworks/base/location/java/android/location/LocationManager.java
a06de0f29b58df9246779cc4bfd8f06f7205ddb6 12-Dec-2012 Dianne Hackborn <hackbod@google.com> New "app ops" service.

Initial implementation, tracking use of the vibrator, GPS,
and location reports.

Also includes an update to battery stats to also keep track of
vibrator usage (since I had to be in the vibrator code anyway
to instrument it).

The service itself is only half-done. Currently no API to
retrieve the data (which once there will allow us to show you
which apps are currently causing the GPS to run and who has
recently accessed your location), it doesn't persist its data
like it should, and no way to tell it to reject app requests
for various operations.

But hey, it's a start!

Change-Id: I05b8d76cc4a4f7f37bc758c1701f51f9e0550e15
/frameworks/base/location/java/android/location/LocationManager.java
7ab7f538924371a9dd4be7a27a6ae3b4c04b301c 30-Oct-2012 Laurent Tu <laurentt@google.com> Hide new location APIs and undeprecate old ones

Hide all new location APIs related to LocationRequest/Geofence and
undeprecate all deprecated APIs consequently to the LocationRequest and
Geofence introduction. Also introduce LocationRequestUnbundled for
LocationProviders to use.

Change-Id: I5b116c7d342041f45b341c88a4b6813571118018
/frameworks/base/location/java/android/location/LocationManager.java
8761e143c987fc48d854818988cde44700c9f602 30-Oct-2012 Scott Main <smain@google.com> docs: Clarify the callback mechanisms for LocationRequest
and clarify horizontal geofencing

Change-Id: I8ff264d7a12c8ec3c79854e008aeeb5f922ad459
/frameworks/base/location/java/android/location/LocationManager.java
2291ca47c763d9c292865ada1450d3a094918882 22-Oct-2012 Victoria Lease <violets@google.com> LocationManager javadoc permission fixes

The javadoc mistakenly claimed that GPS and PASSIVE location
providers could be used with ACCESS_COARSE_LOCATION permissions.
That was incorrect, and the javadoc has been amended.

Bug: 7389249
Change-Id: I6f6489bb539679a962c67ae7263857700df33c82
/frameworks/base/location/java/android/location/LocationManager.java
4118012da9a22694b3353040a485f8cdc27e2f17 26-Sep-2012 Philip Milne <pmilne@google.com> Fix for bug: #7173350. elapsedRealtimeNano() -> elapsedRealtimeNanos()

Change-Id: Ie38952bbaace080e81e41e61350cda172951d548
/frameworks/base/location/java/android/location/LocationManager.java
73577888ec48bcb1eb5053f8dc3ba4eb33eb6f1a 25-Sep-2012 Philip Milne <pmilne@google.com> Fix for bug: #7172778. Javadoc errors in LocationManager.

Change-Id: Iaebd4cf00c8a33bcf4fc74eaa1dfec9675032826
/frameworks/base/location/java/android/location/LocationManager.java
4fab68b5324e1f9b6765cdc33e66d1f074623dc2 13-Sep-2012 Victoria Lease <violets@google.com> Require ACCESS_FINE_LOCATION for Geofence use.

Bug: 7153226
Change-Id: I49236379e739fcda66bbc9a31cfdca9a87122aec
/frameworks/base/location/java/android/location/LocationManager.java
4035f5a7c191a68bc9a5912ce44c43c82e9e5dbf 17-Aug-2012 Nick Pelly <npelly@google.com> Port location blacklist code to MR1.

I had to re-do this change for MR1 because LocationManagerService changed
so much. Here is the original change description:

Add package-name-prefix blacklist for location updates.

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.

Bug: 6986553
Change-Id: I1e151e08bd7143e47db005bc3fe9795076398df7
/frameworks/base/location/java/android/location/LocationManager.java
4e31c4fffbc42b4c2b5dca6431cfeef9e078f5b4 14-Aug-2012 Nick Pelly <npelly@google.com> Add javadoc for new location API's.

Change-Id: If15024ee88421c07ba3a174747774fc451fd002e
/frameworks/base/location/java/android/location/LocationManager.java
3914e4b7d12b014f73085cd6e34b6fd69ea26226 11-Aug-2012 Nick Pelly <npelly@google.com> Remove LocationManager#getLastKnownLocation(Criteria).

This was never a public API, so we don't need to follow
an orderly deprecation. And it breaks a CTS test:

cts/tests/tests/location/src/android/location/cts/LocationManagerTest.java:521: reference to getLastKnownLocation is ambiguous, both method getLastKnownLocation(java.lang.String) in android.location.LocationManager and method getLastKnownLocation(android.location.Criteria) in android.location.LocationManager match
mManager.getLastKnownLocation(null);
^

Change-Id: I503267e4fa577ce4bf684239da777f11b0e511f5
/frameworks/base/location/java/android/location/LocationManager.java
6fa9ad4afcd762aea519ff61811386c23d18ddb2 16-Jul-2012 Nick Pelly <npelly@google.com> Location overhaul, major commit.

Themes: Fused Location, Geofencing, LocationRequest.

API changes
o Fused location is always returned when asking for location by Criteria.
o Fused location is never returned as a LocationProvider object, nor returned
as a provider String. This wouldn't make sense because the current API
design assumes that LocationProvider's have fixed properties (accuracy, power
etc).
o The fused location engine will tune itself based on the criteria passed
by applications.
o Deprecate LocationProvider. Apps should use fused location (via Criteria
class), instead of enumerating through LocationProvider objects. It is
also over-engineered: designed for a world with a plethora of location
providers that never materialized.
o The Criteria class is also over-engineered, with many methods that aren't
currently used, but for now we won't deprecate them since they may have
value in the future. It is now used to tune the fused location engine.
o Deprecate getBestProvider() and getProvider().
o Add getLastKnownLocation(Criteria), so we can return last known
fused locations.
o Apps with only ACCESS_COARSE_LOCATION _can_ now use the GPS, but the location
they receive will be fudged to a 1km radius. They can also use NETWORK
and fused locatoins, which are fudged in the same way if necessary.
o Totally deprecate Criteria, in favor of LocationRequest.
Criteria was designed to map QOS to a location provider. What we
really need is to map QOS to _locations_.
The death knell was the conflicting ACCURACY_ constants on
Criteria, with values 1, 2, 3, 1, 2. Yes not a typo.
o Totally deprecate LocationProvider.
o Deprecate test/mock provider support. They require a named provider,
which is a concept we are moving away from. We do not yet have a
replacement, but I think its ok to deprecate since you also
need to have 'allow mock locations' checked in developer settings.
They will continue to work.
o Deprecate event codes associated with provider status. The fused
provider is _always_ available.
o Introduce Geofence data object to provide an easier path fowards
for polygons etc.

Implementation changes
o Fused implementation: incoming (GPS and NLP) location fixes are given
a weight, that exponentially decays with respect to age and accuracy.
The half-life of age is ~60 seconds, and the half-life of accuracy is
~20 meters. The fixes are weighted and combined to output a fused
location.
o Move Fused Location impl into
frameworks/base/packages/FusedLocation
o Refactor Fused Location behind the IProvider AIDL interface. This allow us
to distribute newer versions of Fused Location in a new APK, at run-time.
o Introduce ServiceWatcher.java, to refactor code used for run-time upgrades of
Fused Location, and the NLP.
o Fused Location is by default run in the system server (but can be moved to
any process or pacakge, even at run-time).
o Plumb the Criteria requirements through to the Fused Location provider via
ILocation.sendExtraCommand(). I re-used this interface to avoid modifying the
ILocation interface, which would have broken run-time upgradability of the
NLP.
o Switch the geofence manager to using fused location.
o Clean up 'adb shell dumpsys location' output.
o Introduce config_locationProviderPackageNames and
config_overlay_locationProviderPackageNames to configure the default
and overlay package names for Geocoder, NLP and FLP.
o Lots of misc cleanup.
o Improve location fudging. Apply random vector then quantize.
o Hide internal POJO's from clients of com.android.location.provider.jar
(NLP and FLP). Introduce wrappers ProviderRequestUnbundled and
ProviderPropertiesUnbundled.
o Introduce ProviderProperties to collapse all the provider accuracy/
bearing/altitude/power plumbing (that is deprecated anyway).
o DELETE lots of code: DummyLocationProvider,
o Rename the (internal) LocationProvider to LocationProviderBase.
o Plumb pid, uid and packageName throughout
LocationManagerService#Receiver to support future features.

TODO: The FLP and Geofencer have a lot of room to be more intelligent
TODO: Documentation
TODO: test test test

Change-Id: Iacefd2f176ed40ce1e23b090a164792aa8819c55
/frameworks/base/location/java/android/location/LocationManager.java
2eeeec248a38ff33999c83f4b8d5bab7d50e79d2 18-Jul-2012 Nick Pelly <npelly@google.com> Improve Location object.

Add getElapsedRealtimeNano():

Currently Location just has getTime() and setTime() based on UTC time.
This is entirely unreliable since it is not guaranteed monotonic.
There is a lot of code that compares fix age based on deltas -
and it is all broken in the case of a system clock change. System
clock can change when switching cellular networks (and in some
cases when switching towers).

Document the meaning of getAccuracy():
It is the horizontal, 95% confidence radius.

Make some fields mandatory if they are reported by a LocationProvider:

All Locations returned by a LocationProvider must include at the
minimum a lat, long, timestamps, and accuracy. This is necessary
to perform fused location. There are no public API's for applications
to feed locations into a location provider so this should not cause
any breakage.

If a LocationProvider does not fill in enough fields on a Location
object then it is dropped, and logged.

Bug: 4305998
Change-Id: I7df77125d8a64e174d7bc8c2708661b4f33461ea
/frameworks/base/location/java/android/location/LocationManager.java
e0fd693c6098f59004f9e96ad75c058e26c337b0 11-Jul-2012 Nick Pelly <npelly@google.com> Improve geofencing: throttle location updates with distance to fence.

Previously any geofence (proximity alert) would turn the GPS on at full rate.
Now, we modify the GPS interval with the distance to the nearest geofence.
A speed of 100m/s is assumed to calculate the next GPS update.

Also
o Major refactor of geofencing code, to make it easier to continue to improve.
o Discard proximity alerts when an app is removed.
o Misc cleanup of nearby code. There are other upcoming changes
that make this a good time for some house-keeping.

TODO:
The new geofencing heuristics are much better than before, but still
relatively naive. The next steps could be:
- Improve boundary detection
- Improve update thottling for large geofences
- Consider velocity when throttling

Change-Id: Ie6e23d2cb2b931eba5d2a2fc759543bb96e2f7d0
/frameworks/base/location/java/android/location/LocationManager.java
f1be6861daea57ba0a1595739a899d05229d6d15 15-May-2012 Nick Pelly <npelly@google.com> Enforce the minTime parameter in LocationManager#requestLocationUpdates

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
/frameworks/base/location/java/android/location/LocationManager.java
3aef8e1d1b2f0b87d470bcccf37ba4ebb6560c45 20-Dec-2011 Joe Fernandez <joefernandez@google.com> docs: Add developer guide cross-references, Project ACRE, round 4

Change-Id: I1b43414aaec8ea217b39a0d780c80a25409d0991
/frameworks/base/location/java/android/location/LocationManager.java
a550bdc84af70babb48091197bfb1b93d3671664 27-Apr-2011 Daisuke Miyakawa <dmiyakawa@google.com> Use passive provider for location based country detection

Bug: 4345419
Change-Id: Ia3e071b97c6971538ea994fdee6029db928201d6
/frameworks/base/location/java/android/location/LocationManager.java
e23fc8ee13605dace4a7abcdf85caec639407786 29-Mar-2011 Amith Yamasani <yamasani@google.com> Fix the javadoc for LocationManager.requestSingleUpdate()

It was saying the same thing as requestLocationUpdates(), but it only provides a single update.

Change-Id: Ib677d40e050a82332df539a823cc677de1fcb4fd
/frameworks/base/location/java/android/location/LocationManager.java
0c5a04014d3833c9a82772a832d3bc6410fc52ac 27-Aug-2010 Brad Fitzpatrick <bradfitz@android.com> 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
/frameworks/base/location/java/android/location/LocationManager.java
f4d207b1c2212d6e9adc3e7954a8d14c6b9abc51 17-Jul-2010 Mike Lockwood <lockwood@android.com> 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>
/frameworks/base/location/java/android/location/LocationManager.java
71677f84e7705aa48b04829538b954a13cd11dec 21-May-2010 Mike Lockwood <lockwood@android.com> 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>
/frameworks/base/location/java/android/location/LocationManager.java
03ca216ac19ea4e7afcb183c20c7c780f0d97756 01-Apr-2010 Mike Lockwood <lockwood@android.com> 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>
/frameworks/base/location/java/android/location/LocationManager.java
00b74270c9f136a8727c5f6cda0997a3a905f385 26-Mar-2010 Mike Lockwood <lockwood@android.com> Move files internal to LocationManagerService from framework.jar to services.jar

Change-Id: Iebbfc49b8300ab59730733efdf489ec87ea45a25
Signed-off-by: Mike Lockwood <lockwood@android.com>
/frameworks/base/location/java/android/location/LocationManager.java
689e449b244703335a27b076133377a192d6e36d 03-Mar-2010 Mike Lockwood <lockwood@android.com> Check for null provider in LocationManager.getProviders()

Change-Id: I294ce0b1f364cfdf956ac55260f9d40f0704b5f7
BUG: 2485977

Signed-off-by: Mike Lockwood <lockwood@android.com>
/frameworks/base/location/java/android/location/LocationManager.java
a4903f254b4711c8fc0ac5f7e3d605f4dce34f35 17-Feb-2010 Mike Lockwood <lockwood@android.com> Add passive location provider.

The passive location provider allows receiving location updates without
actually triggering them. This allows an application to receive location
updates that are being generated due to other clients of the location manager.

Change-Id: Ibf7a96b089c56875d4f62d3210252ae8d9f32768
Signed-off-by: Mike Lockwood <lockwood@android.com>
/frameworks/base/location/java/android/location/LocationManager.java
628fd6d9c11ed9806abebf34bc986247c106328f 26-Jan-2010 Mike Lockwood <lockwood@android.com> Network Location unbundling:

The network location and geocode provider services are now started on demand
and their interfaces are now retrieved via bindService().

Remove obsolete LocationManager installLocationProvider() and installGeocodeProvider() methods.

Add abstract class android.location.provider.GeocodeProvider to provide a public wrapper to
the IGeocodeProvider Binder interface. Replaces the LocationManager.GeocodeProvider interface.

Rename LocationProviderImpl to android.location.provider.LocationProvider.

Move LocationManager.reportLocation() to android.location.provider.LocationProvider,
so all methods related to external location providers are now all in one class.

Avoid calling from the Location Manager Service into providers that are disabled so we
do not start the network location service unnecessarily.

Change-Id: If3ed2d5d62b83ba508006711d575cad09f4a0007
Signed-off-by: Mike Lockwood <lockwood@android.com>
/frameworks/base/location/java/android/location/LocationManager.java
52eab1c7601862d94c90366878088e072b1c6017 11-Jan-2010 Mike Lockwood <lockwood@android.com> Unhide LocationManager APIs needed for unbundled location providers.

Signed-off-by: Mike Lockwood <lockwood@android.com>
/frameworks/base/location/java/android/location/LocationManager.java
f5d95cbc1a6974afeb4d3155bdaa8dae55722a39 08-Jan-2010 Joe Onorato <joeo@android.com> less log spew
/frameworks/base/location/java/android/location/LocationManager.java
9d2f7a7d66d1802f2f25ad6a556063ea9340f8c8 06-Jan-2010 Mike Lockwood <lockwood@android.com> Add LocationManagerImpl class to act as a public wrapper for the ILocationProvider interface

Location providers implemented outside of the core android platform (like network location)
can subclass LocationManagerImpl to implement the location provider interface
without being bound too tightly to the location manager internals.

Change-Id: Id193d4d09f9a14bea13e81af03c914074cd37cb9
/frameworks/base/location/java/android/location/LocationManager.java
34901409a404c8c66914c5a8ad0f29b1bcde0e78 04-Jan-2010 Mike Lockwood <lockwood@android.com> Cleanup and add public wrapper for IGeocodeProvider interface to prepare for network location unbundling.

Change-Id: I6523d115b56dbf450121e73d48e151f200827eb4
Signed-off-by: Mike Lockwood <lockwood@android.com>
/frameworks/base/location/java/android/location/LocationManager.java
9aa1fa2d3612d1d8ffeae6552d65669f4ca194d9 01-Sep-2009 Mike Lockwood <lockwood@android.com> LocationManagerService: Remove caching of last known locations to flash.

Change-Id: Ibbab20a7c48823fb74c2e175824f55248f25bf8a
Signed-off-by: Mike Lockwood <lockwood@android.com>
/frameworks/base/location/java/android/location/LocationManager.java
22d1f9fb23015471de6af1a70e40fb5c82ecb665 19-Aug-2009 Danke Xie <dankex@qualcomm.com> gps: Network initiated SUPL

Initial contribution from Qualcomm.

Signed-off-by: Mike Lockwood <lockwood@android.com>
/frameworks/base/location/java/android/location/LocationManager.java
640992dec96fa88f0bbd42c6a02902640a000b35 06-Aug-2009 Mike Lockwood <lockwood@android.com> gps: Unhide GpsStatus.NmeaListener interface for receiving NMEA sentences

Signed-off-by: Mike Lockwood <lockwood@android.com>
/frameworks/base/location/java/android/location/LocationManager.java
b16e7800be4f879135f239f1f8f586f3712df01e 06-Aug-2009 Mike Lockwood <lockwood@android.com> gps: Add GpsStatus.NmeaListener interface for receiving NMEA sentences.

NMEA sentences are passed from the GPS engine to the GpsLocationProvider.
They are then sent via the IGpsStatusListener binder interface to clients
using the same path as the other GPS status information.

Signed-off-by: Mike Lockwood <lockwood@android.com>
/frameworks/base/location/java/android/location/LocationManager.java
55ed4914de69f30c1067bf1894b193f89dfd53b3 09-Jun-2009 Kenny Root <kenny@the-b.org> Fix typo in Javadoc for LocationManager.GPS_PROVIDER
/frameworks/base/location/java/android/location/LocationManager.java
fd6e5f0dda50e113db4ccc55338b6c4f09da37a4 21-May-2009 Mike Lockwood <lockwood@android.com> location: Replace ILocationCollector interface with new ILocationProvider method

This change replaces ILocationCollector with a more general mechanism that
passes locations received from a provider to all other providers.
The network location provider now uses this to implement the location collector.
In the future, this could be used to inject network locations to the GPS
as aiding data.

This change also removes the now obsolete permission INSTALL_LOCATION_COLLECTOR.

Signed-off-by: Mike Lockwood <lockwood@android.com>
/frameworks/base/location/java/android/location/LocationManager.java
2677d0da34acad93cd7f164d587ccc30c46facc6 12-May-2009 Mike Lockwood <lockwood@android.com> LocationManager: Fix a Javadoc comment.

Signed-off-by: Mike Lockwood <lockwood@android.com>
/frameworks/base/location/java/android/location/LocationManager.java
275555c8eb3fb5df6e7320873b88b77cdde85a9e 01-May-2009 Mike Lockwood <lockwood@android.com> location: Add support for location providers outside of the system process.

Also added new permissions android.permission.INSTALL_LOCATION_PROVIDER
and android.permission.INSTALL_LOCATION_COLLECTOR to the public API.

Signed-off-by: Mike Lockwood <lockwood@android.com>
/frameworks/base/location/java/android/location/LocationManager.java
b8adcad61d9225ecdabde1a01b73455f484cbed7 28-Apr-2009 Mike Lockwood <lockwood@android.com> location: Remove obsolete fake provider support.

Now that we have GPS support in the emulator and public APIs for mock providers,
the fake provider support is no longer needed.

Signed-off-by: Mike Lockwood <lockwood@android.com>
/frameworks/base/location/java/android/location/LocationManager.java
79762a3ee34eb8be5549bcb183af844b6f19c266 28-Apr-2009 Mike Lockwood <lockwood@android.com> location: Move DummyLocationProvider.java and LocationProviderImpl.java to the internal package.

Signed-off-by: Mike Lockwood <lockwood@android.com>
/frameworks/base/location/java/android/location/LocationManager.java
48f17518223a2917fd82195004fbb206cb9a05a3 23-Apr-2009 Mike Lockwood <lockwood@android.com> location: Location Manager wakelock cleanup, phase 2

Remove two second timeout for wakelock when broadcasting events to
location listeners. Instead, hold wakelock until receipt of the event
is acknowledged, either via a Binder call or the
PendingIntent.OnFinished interface.

Signed-off-by: Mike Lockwood <lockwood@android.com>
/frameworks/base/location/java/android/location/LocationManager.java
9637d474899d9725da8a41fdf92b9bd1a15d301e 03-Apr-2009 Mike Lockwood <> AI 144372: Cleanup Settings support for enabling and disabling location providers:
LocationManagerService now listens for changes to settings,
making LocationManager.updateProviders() unnecessary.
Removed LocationManager.updateProviders()
Added Settings.Secure.setLocationProviderEnabled(), which is a thread-safe way
of enabling or disabling a single location provider.
This is safer than reading, modifying and writing the LOCATION_PROVIDERS_ALLOWED directly.
BUG=1729031

Automated import of CL 144372
/frameworks/base/location/java/android/location/LocationManager.java
9066cfe9886ac131c34d59ed0e2d287b0e3c0087 04-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@135843
/frameworks/base/location/java/android/location/LocationManager.java
d83a98f4ce9cfa908f5c54bbd70f03eec07e7553 04-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@135843
/frameworks/base/location/java/android/location/LocationManager.java
f013e1afd1e68af5e3b868c26a653bbfb39538f8 18-Dec-2008 The Android Open Source Project <initial-contribution@android.com> Code drop from //branches/cupcake/...@124589
/frameworks/base/location/java/android/location/LocationManager.java
54b6cfa9a9e5b861a9930af873580d6dc20f773c 21-Oct-2008 The Android Open Source Project <initial-contribution@android.com> Initial Contribution
/frameworks/base/location/java/android/location/LocationManager.java