@Override
public Object call(final Object who, Method method, Object... args) throws Throwable {
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.JELLY_BEAN) {
LocationRequest request = (LocationRequest) args[0];
fixLocationRequest(request);
}
if (isFakeLocationEnable()) {
Object transport = ArrayUtils.getFirst(args, mirror.android.location.LocationManager.ListenerTransport.TYPE);
if (transport != null) {
Object locationManager = mirror.android.location.LocationManager.ListenerTransport.this$0.get(transport);
MockLocationHelper.setGpsStatus(locationManager);
GPSListenerThread.get().addListenerTransport(locationManager);
}
return 0;
}
return super.call(who, method, args);
}
java类android.location.LocationRequest的实例源码
MethodProxies.java 文件源码
项目:TPlayer
阅读 31
收藏 0
点赞 0
评论 0
MethodProxies.java 文件源码
项目:TPlayer
阅读 39
收藏 0
点赞 0
评论 0
@Override
public Object call(Object who, Method method, Object... args) throws Throwable {
if (!(args[0] instanceof String)) {
LocationRequest request = (LocationRequest) args[0];
fixLocationRequest(request);
}
if (isFakeLocationEnable()) {
VLocation loc = VirtualLocationManager.get().getLocation();
if (loc != null) {
return loc.toSysLocation();
} else {
return null;
}
}
return super.call(who, method, args);
}
MethodProxies.java 文件源码
项目:TPlayer
阅读 35
收藏 0
点赞 0
评论 0
private static void fixLocationRequest(LocationRequest request) {
if (request != null) {
if (LocationRequestL.mHideFromAppOps != null) {
LocationRequestL.mHideFromAppOps.set(request, false);
}
if (LocationRequestL.mWorkSource != null) {
LocationRequestL.mWorkSource.set(request, null);
}
}
}
ProviderRequest.java 文件源码
项目:pyneo-wirelesslocation
阅读 32
收藏 0
点赞 0
评论 0
@Override
public ProviderRequest createFromParcel(Parcel in) {
ProviderRequest request = new ProviderRequest();
request.reportLocation = in.readInt() == 1;
request.interval = in.readLong();
int count = in.readInt();
for (int i = 0; i < count; i++) {
request.locationRequests.add(LocationRequest.CREATOR.createFromParcel(in));
}
return request;
}
ProviderRequest.java 文件源码
项目:pyneo-wirelesslocation
阅读 21
收藏 0
点赞 0
评论 0
@Override
public void writeToParcel(Parcel parcel, int flags) {
parcel.writeInt(reportLocation ? 1 : 0);
parcel.writeLong(interval);
parcel.writeInt(locationRequests.size());
for (LocationRequest request : locationRequests) {
request.writeToParcel(parcel, flags);
}
}
ProviderRequestUnbundled.java 文件源码
项目:pyneo-wirelesslocation
阅读 36
收藏 0
点赞 0
评论 0
/**
* Never null.
*/
public List<LocationRequestUnbundled> getLocationRequests() {
List<LocationRequestUnbundled> result = new ArrayList<LocationRequestUnbundled>(
mRequest.locationRequests.size());
for (LocationRequest r : mRequest.locationRequests) {
result.add(new LocationRequestUnbundled(r));
}
return result;
}
LocationRequestUnbundled.java 文件源码
项目:pyneo-wirelesslocation
阅读 78
收藏 0
点赞 0
评论 0
LocationRequestUnbundled(LocationRequest delegate) {
this.delegate = delegate;
}