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
This commit is contained in:
Victoria Lease
2012-10-16 16:08:48 -07:00
parent a4c356cad7
commit 37425c3475
2 changed files with 154 additions and 101 deletions

View File

@@ -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.
*