Skip to content

Commit 37425c3

Browse files
author
Victoria Lease
committed
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
1 parent a4c356c commit 37425c3

File tree

2 files changed

+154
-101
lines changed

2 files changed

+154
-101
lines changed

location/java/android/location/LocationRequest.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,18 @@ public static LocationRequest createFromDeprecatedCriteria(Criteria criteria, lo
221221
/** @hide */
222222
public LocationRequest() { }
223223

224+
/** @hide */
225+
public LocationRequest(LocationRequest src) {
226+
mQuality = src.mQuality;
227+
mInterval = src.mInterval;
228+
mFastestInterval = src.mFastestInterval;
229+
mExplicitFastestInterval = src.mExplicitFastestInterval;
230+
mExpireAt = src.mExpireAt;
231+
mNumUpdates = src.mNumUpdates;
232+
mSmallestDisplacement = src.mSmallestDisplacement;
233+
mProvider = src.mProvider;
234+
}
235+
224236
/**
225237
* Set the quality of the request.
226238
*

0 commit comments

Comments
 (0)