From 37425c3475877f2fdadb78f669ec57fecf82dca7 Mon Sep 17 00:00:00 2001 From: Victoria Lease Date: Tue, 16 Oct 2012 16:08:48 -0700 Subject: LocationManager permissions cleanup This commit is the result of a comprehensive permissions review for MR1 release. It addresses a number of deviations from spec and from MR0's behavior, bringing MR1 into sync with both. It also cleans up the concept of "location resolution permission", representing it internally as an enumerated access level to reduce reliance on cumbersome string manipulation. There's a function to convert the enum int into a permission string where needed, too. Additionally, this confines caller-identity-sensitive calls to the hopefully-obviously-named "getCallerAllowedResolutionLevel()". This should make it much easier to prove correctness with respect to accidentally calling functions that depend upon the caller's identity after identity has already been shed by Binder.clearCallingIdentity(). Change-Id: I446169aee8fb2fde26ac6d04b479b40253782acb --- location/java/android/location/LocationRequest.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'location') diff --git a/location/java/android/location/LocationRequest.java b/location/java/android/location/LocationRequest.java index cb291ea..6871ee2 100644 --- a/location/java/android/location/LocationRequest.java +++ b/location/java/android/location/LocationRequest.java @@ -221,6 +221,18 @@ public final class LocationRequest implements Parcelable { /** @hide */ public LocationRequest() { } + /** @hide */ + public LocationRequest(LocationRequest src) { + mQuality = src.mQuality; + mInterval = src.mInterval; + mFastestInterval = src.mFastestInterval; + mExplicitFastestInterval = src.mExplicitFastestInterval; + mExpireAt = src.mExpireAt; + mNumUpdates = src.mNumUpdates; + mSmallestDisplacement = src.mSmallestDisplacement; + mProvider = src.mProvider; + } + /** * Set the quality of the request. * -- cgit v1.1