summaryrefslogtreecommitdiff
path: root/location/java
diff options
context:
space:
mode:
author Soonil Nagarkar <sooniln@google.com> 2020-06-22 13:55:45 -0700
committer Soonil Nagarkar <sooniln@google.com> 2020-06-22 13:55:45 -0700
commitc25f4f1d0ee5e62cc69d02bcf8c96fc876cd436b (patch)
tree1eb12befc50abd409cb8a89e4b8b288ef5288fd4 /location/java
parentfe81cee5e83bd172e812d1ffe72b2323e66d0216 (diff)
Various small fixes
Test: manual Change-Id: Id9874dd034aae96d540fac7c580c6689e25f44e8
Diffstat (limited to 'location/java')
-rw-r--r--location/java/android/location/ILocationManager.aidl7
-rw-r--r--location/java/android/location/LocationManager.java7
-rw-r--r--location/java/android/location/util/identity/CallerIdentity.java11
-rw-r--r--location/java/com/android/internal/location/ProviderRequest.java3
4 files changed, 17 insertions, 11 deletions
diff --git a/location/java/android/location/ILocationManager.aidl b/location/java/android/location/ILocationManager.aidl
index 6d848c912d95..1f7b69f8840e 100644
--- a/location/java/android/location/ILocationManager.aidl
+++ b/location/java/android/location/ILocationManager.aidl
@@ -76,6 +76,7 @@ interface ILocationManager
void addGnssMeasurementsListener(in GnssRequest request, in IGnssMeasurementsListener listener, String packageName, String attributionTag);
void removeGnssMeasurementsListener(in IGnssMeasurementsListener listener);
+ void injectGnssMeasurementCorrections(in GnssMeasurementCorrections corrections);
void addGnssAntennaInfoListener(in IGnssAntennaInfoListener listener, String packageName, String attributionTag);
void removeGnssAntennaInfoListener(in IGnssAntennaInfoListener listener);
@@ -83,13 +84,11 @@ interface ILocationManager
void addGnssNavigationMessageListener(in IGnssNavigationMessageListener listener, String packageName, String attributionTag);
void removeGnssNavigationMessageListener(in IGnssNavigationMessageListener listener);
- void injectGnssMeasurementCorrections(in GnssMeasurementCorrections corrections, String packageName);
-
- int getGnssBatchSize(String packageName);
+ int getGnssBatchSize();
void setGnssBatchingCallback(in IBatchedLocationCallback callback, String packageName, String attributionTag);
void removeGnssBatchingCallback();
void startGnssBatch(long periodNanos, boolean wakeOnFifoFull, String packageName, String attributionTag);
- void flushGnssBatch(String packageName);
+ void flushGnssBatch();
void stopGnssBatch();
void injectLocation(in Location location);
diff --git a/location/java/android/location/LocationManager.java b/location/java/android/location/LocationManager.java
index 2c6f0c91ee7d..401a5a137327 100644
--- a/location/java/android/location/LocationManager.java
+++ b/location/java/android/location/LocationManager.java
@@ -2157,8 +2157,7 @@ public class LocationManager {
@NonNull GnssMeasurementCorrections measurementCorrections) {
Preconditions.checkArgument(measurementCorrections != null);
try {
- mService.injectGnssMeasurementCorrections(
- measurementCorrections, mContext.getPackageName());
+ mService.injectGnssMeasurementCorrections(measurementCorrections);
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
}
@@ -2302,7 +2301,7 @@ public class LocationManager {
@RequiresPermission(Manifest.permission.LOCATION_HARDWARE)
public int getGnssBatchSize() {
try {
- return mService.getGnssBatchSize(mContext.getPackageName());
+ return mService.getGnssBatchSize();
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
}
@@ -2365,7 +2364,7 @@ public class LocationManager {
@RequiresPermission(Manifest.permission.LOCATION_HARDWARE)
public void flushGnssBatch() {
try {
- mService.flushGnssBatch(mContext.getPackageName());
+ mService.flushGnssBatch();
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
}
diff --git a/location/java/android/location/util/identity/CallerIdentity.java b/location/java/android/location/util/identity/CallerIdentity.java
index 9876a1b4df19..c32970f1bb04 100644
--- a/location/java/android/location/util/identity/CallerIdentity.java
+++ b/location/java/android/location/util/identity/CallerIdentity.java
@@ -25,6 +25,7 @@ import android.os.WorkSource;
import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.util.ArrayUtils;
+import com.android.internal.util.HexDump;
import java.util.Objects;
@@ -170,7 +171,7 @@ public final class CallerIdentity {
}
StringBuilder builder = new StringBuilder(length);
- builder.append(mPid).append("/").append(mPackageName);
+ builder.append(mUid).append("/").append(mPackageName);
if (mAttributionTag != null) {
builder.append("[");
if (mAttributionTag.startsWith(mPackageName)) {
@@ -180,6 +181,9 @@ public final class CallerIdentity {
}
builder.append("]");
}
+ if (mListenerId != null) {
+ builder.append("/").append(HexDump.toHexString(mListenerId.hashCode()));
+ }
return builder.toString();
}
@@ -192,10 +196,11 @@ public final class CallerIdentity {
return false;
}
CallerIdentity that = (CallerIdentity) o;
- return getUid() == that.getUid()
+ return mUid == that.mUid
&& mPid == that.mPid
&& mPackageName.equals(that.mPackageName)
- && Objects.equals(mAttributionTag, that.mAttributionTag);
+ && Objects.equals(mAttributionTag, that.mAttributionTag)
+ && Objects.equals(mListenerId, that.mListenerId);
}
@Override
diff --git a/location/java/com/android/internal/location/ProviderRequest.java b/location/java/com/android/internal/location/ProviderRequest.java
index a81ddfed8194..5d072f838055 100644
--- a/location/java/com/android/internal/location/ProviderRequest.java
+++ b/location/java/com/android/internal/location/ProviderRequest.java
@@ -126,6 +126,9 @@ public final class ProviderRequest implements Parcelable {
if (locationSettingsIgnored) {
s.append(", locationSettingsIgnored");
}
+ if (!workSource.isEmpty()) {
+ s.append(", ").append(workSource);
+ }
} else {
s.append("OFF");
}