if (p == null) return;
ArrayList<UpdateRecord> records = (provider);
WorkSource worksource = new WorkSource();
ProviderRequest providerRequest = new ProviderRequest();
ContentResolver resolver = ContentResolver();
#默认后台的刷新时间是30分钟
long backgroundThrottleInterval = Long(
resolver,
Settings.Global.LOCATION_BACKGROUND_THROTTLE_INTERVAL_MS,
DEFAULT_BACKGROUND_THROTTLE_INTERVAL_MS);
// initialize the low power mode to true and set to false if any of the records requires
providerRequest.lowPowerMode = true;
if (records != null) {
for (UpdateRecord record : records) {
if (UserId(record.mReceiver.mIdentity.mUid))) {                    if (checkLocationAccess(
record.mReceiver.mIdentity.mPid,
record.mReceiver.mIdentity.mUid,
record.mReceiver.mIdentity.mPackageName,
record.mReceiver.mAllowedResolutionLevel)) {
LocationRequest locationRequest = record.mRealRequest;
long interval = Interval();
#系统和⽩名单的应⽤那么不会受到后台刷新时间的限制
if (!isThrottlingExemptLocked(record.mReceiver.mIdentity)) {
if (!record.mIsForegroundUid) {
interval = Math.max(interval, backgroundThrottleInterval);
扩展器
}
if (interval != Interval()) {
locationRequest = new LocationRequest(locationRequest);
locationRequest.setInterval(interval);
position和location的区别
}
}
record.mRequest = locationRequest;
providerRequest.locationRequests.add(locationRequest);
if (!locationRequest.isLowPowerMode()) {
providerRequest.lowPowerMode = false;
}
if (interval < providerRequest.interval) {
providerRequest.interval = interval;
}
}
}
}
if (portLocation) {
/
/ calculate who to blame for power
// This is somewhat arbitrary. We pick a threshold interval
html文件可以在手机上打开吗// that is slightly higher that the minimum interval, and
// spread the blame across all applications with a request
// under that threshold.
long thresholdInterval = (providerRequest.interval + 1000) * 3 / 2;
for (UpdateRecord record : records) {
if (UserId(record.mReceiver.mIdentity.mUid))) {                        LocationRequest locationRequest = record.mRequest;
// Don't assign battery blame for update records whose
// client has no permission to receive location data.
if (!ains(locationRequest)) {mockingbird 知更鸟
输出重定向continue;
}
if (Interval() <= thresholdInterval) {
if (record.mReceiver.mWorkSource != null
&& isValidWorkSource(record.mReceiver.mWorkSource)) {
worksource.add(record.mReceiver.mWorkSource);
} else {
// Assign blame to caller if there's no WorkSource associated with
// the request or if it's invalid.
worksource.add(
免费ppt模板下载到手机

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。