Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b03841f2 authored by Soonil Nagarkar's avatar Soonil Nagarkar Committed by Android (Google) Code Review
Browse files

Merge "Rename ILocationProviderManager method"

parents 5d90c06c d879ec94
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -26,7 +26,7 @@ import com.android.internal.location.ProviderProperties;
 */
interface ILocationProviderManager {

    void onSetFeatureId(String featureId);
    void onSetAttributionTag(String attributionTag);

    @UnsupportedAppUsage
    void onSetAllowed(boolean allowed);
+4 −4
Original line number Diff line number Diff line
@@ -79,7 +79,7 @@ public abstract class LocationProviderBase {
    public static final String FUSED_PROVIDER = LocationManager.FUSED_PROVIDER;

    final String mTag;
    final String mFeatureId;
    final String mAttributionTag;
    final IBinder mBinder;

    /**
@@ -116,7 +116,7 @@ public abstract class LocationProviderBase {
    public LocationProviderBase(Context context, String tag,
            ProviderPropertiesUnbundled properties) {
        mTag = tag;
        mFeatureId = context != null ? context.getFeatureId() : null;
        mAttributionTag = context != null ? context.getAttributionTag() : null;
        mBinder = new Service();

        mLocationManager = ILocationManager.Stub.asInterface(
@@ -332,8 +332,8 @@ public abstract class LocationProviderBase {
        public void setLocationProviderManager(ILocationProviderManager manager) {
            synchronized (mBinder) {
                try {
                    if (mFeatureId != null) {
                        manager.onSetFeatureId(mFeatureId);
                    if (mAttributionTag != null) {
                        manager.onSetAttributionTag(mAttributionTag);
                    }
                    manager.onSetProperties(mProperties);
                    manager.onSetAllowed(mAllowed);
+1 −1
Original line number Diff line number Diff line
@@ -199,7 +199,7 @@ public class FusedLocationServiceTest {
        }

        @Override
        public void onSetFeatureId(String featureId) {
        public void onSetAttributionTag(String attributionTag) {

        }

+8 −10
Original line number Diff line number Diff line
@@ -19,7 +19,6 @@ package com.android.server.location;
import static com.android.internal.util.ConcurrentUtils.DIRECT_EXECUTOR;

import android.annotation.Nullable;
import android.content.ComponentName;
import android.content.Context;
import android.location.Location;
import android.location.util.identity.CallerIdentity;
@@ -136,21 +135,21 @@ public class LocationProviderProxy extends AbstractLocationProvider {

        // executed on binder thread
        @Override
        public void onSetFeatureId(String featureId) {
        public void onSetAttributionTag(String attributionTag) {
            synchronized (mLock) {
                if (mProxy != this) {
                    return;
                }

                ComponentName service = mServiceWatcher.getBoundService().component;
                if (service == null) {
                String packageName = mServiceWatcher.getBoundService().getPackageName();
                if (packageName == null) {
                    return;
                }

                // we don't need to verify the package name because we're getting it straight from
                // the service watcher
                CallerIdentity identity = CallerIdentity.fromBinderUnsafe(mContext,
                        service.getPackageName(), featureId);
                CallerIdentity identity = CallerIdentity.fromBinderUnsafe(mContext, packageName,
                        attributionTag);
                setIdentity(identity);
            }
        }
@@ -165,12 +164,11 @@ public class LocationProviderProxy extends AbstractLocationProvider {

                // if no identity is set yet, set it now
                if (getIdentity() == null) {
                    ComponentName service = mServiceWatcher.getBoundService().component;
                    if (service != null) {
                    String packageName = mServiceWatcher.getBoundService().getPackageName();
                    if (packageName != null) {
                        // we don't need to verify the package name because we're getting it
                        // straight from the service watcher
                        setIdentity(CallerIdentity.fromBinderUnsafe(mContext,
                                service.getPackageName(), null));
                        setIdentity(CallerIdentity.fromBinderUnsafe(mContext, packageName, null));
                    }
                }