Skip to content
This repository has been archived by the owner on Sep 6, 2019. It is now read-only.

Commit

Permalink
Added logging to location proxying
Browse files Browse the repository at this point in the history
Refs #2129
  • Loading branch information
M66B committed Feb 1, 2015
1 parent dc9eca7 commit faa745e
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/biz/bokhorst/xprivacy/XLocationManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import android.location.Location;
import android.os.Binder;
import android.os.Bundle;
import android.util.Log;
import android.location.GpsSatellite;
import android.location.GpsStatus;
import android.location.LocationListener;
Expand Down Expand Up @@ -326,16 +327,20 @@ else if (param.args[arg] != null && param.thisObject != null) {
synchronized (mMapProxy) {
// Reuse existing proxy
if (mMapProxy.containsKey(key)) {
Util.log(this, Log.INFO, "Reuse existing proxy uid=" + Binder.getCallingUid());
param.args[arg] = mMapProxy.get(key);
return;
}

// Already proxied
if (mMapProxy.containsValue(key))
if (mMapProxy.containsValue(key)) {
Util.log(this, Log.INFO, "Already proxied uid=" + Binder.getCallingUid());
return;
}
}

// Create proxy
Util.log(this, Log.INFO, "Creating proxy uid=" + Binder.getCallingUid());
Object proxy = new ProxyLocationListener(Binder.getCallingUid(), (LocationListener) param.args[arg]);

// Use proxy
Expand All @@ -355,6 +360,7 @@ else if (param.args[arg] != null) {
Object key = param.args[arg];
synchronized (mMapProxy) {
if (mMapProxy.containsKey(key)) {
Util.log(this, Log.INFO, "Removing proxy uid=" + Binder.getCallingUid());
param.args[arg] = mMapProxy.get(key);
}
}
Expand All @@ -372,6 +378,7 @@ public ProxyLocationListener(int uid, LocationListener listener) {

@Override
public void onLocationChanged(Location location) {
Util.log(null, Log.INFO, "Location changed uid=" + Binder.getCallingUid());
Location fakeLocation = PrivacyManager.getDefacedLocation(mUid, location);
mListener.onLocationChanged(fakeLocation);
}
Expand Down

0 comments on commit faa745e

Please sign in to comment.