Merge "Ensure WorkSource for location blaming has names (b/10378815)" into klp-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
fecd6d49e0
@@ -1235,8 +1235,11 @@ public class LocationManagerService extends ILocationManager.Stub {
|
|||||||
if (UserHandle.getUserId(record.mReceiver.mUid) == mCurrentUserId) {
|
if (UserHandle.getUserId(record.mReceiver.mUid) == mCurrentUserId) {
|
||||||
LocationRequest locationRequest = record.mRequest;
|
LocationRequest locationRequest = record.mRequest;
|
||||||
if (locationRequest.getInterval() <= thresholdInterval) {
|
if (locationRequest.getInterval() <= thresholdInterval) {
|
||||||
if (record.mReceiver.mWorkSource != null) {
|
if (record.mReceiver.mWorkSource != null
|
||||||
|
&& record.mReceiver.mWorkSource.size() > 0
|
||||||
|
&& record.mReceiver.mWorkSource.getName(0) != null) {
|
||||||
// Assign blame to another work source.
|
// Assign blame to another work source.
|
||||||
|
// Can only assign blame if the WorkSource contains names.
|
||||||
worksource.add(record.mReceiver.mWorkSource);
|
worksource.add(record.mReceiver.mWorkSource);
|
||||||
} else {
|
} else {
|
||||||
// Assign blame to caller.
|
// Assign blame to caller.
|
||||||
|
|||||||
Reference in New Issue
Block a user