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

Commit 7210eaeb authored by Etan Cohen's avatar Etan Cohen Committed by Android (Google) Code Review
Browse files

Merge "[RTT] Remove the legacy RTT service"

parents ea2bc6ff 9accbba1
Loading
Loading
Loading
Loading
+0 −1
Original line number Original line Diff line number Diff line
@@ -578,7 +578,6 @@ java_library {
        "wifi/java/android/net/wifi/rtt/IWifiRttManager.aidl",
        "wifi/java/android/net/wifi/rtt/IWifiRttManager.aidl",
        "wifi/java/android/net/wifi/hotspot2/IProvisioningCallback.aidl",
        "wifi/java/android/net/wifi/hotspot2/IProvisioningCallback.aidl",
        "wifi/java/android/net/wifi/IWifiScanner.aidl",
        "wifi/java/android/net/wifi/IWifiScanner.aidl",
        "wifi/java/android/net/wifi/IRttManager.aidl",
        "packages/services/PacProcessor/com/android/net/IProxyService.aidl",
        "packages/services/PacProcessor/com/android/net/IProxyService.aidl",
        "packages/services/Proxy/com/android/net/IProxyCallback.aidl",
        "packages/services/Proxy/com/android/net/IProxyCallback.aidl",
        "packages/services/Proxy/com/android/net/IProxyPortListener.aidl",
        "packages/services/Proxy/com/android/net/IProxyPortListener.aidl",
+7 −10
Original line number Original line Diff line number Diff line
@@ -38,7 +38,6 @@ import android.content.ClipboardManager;
import android.content.Context;
import android.content.Context;
import android.content.IRestrictionsManager;
import android.content.IRestrictionsManager;
import android.content.RestrictionsManager;
import android.content.RestrictionsManager;
import android.content.pm.ApplicationInfo;
import android.content.pm.CrossProfileApps;
import android.content.pm.CrossProfileApps;
import android.content.pm.ICrossProfileApps;
import android.content.pm.ICrossProfileApps;
import android.content.pm.IShortcutService;
import android.content.pm.IShortcutService;
@@ -90,7 +89,6 @@ import android.net.lowpan.ILowpanManager;
import android.net.lowpan.LowpanManager;
import android.net.lowpan.LowpanManager;
import android.net.nsd.INsdManager;
import android.net.nsd.INsdManager;
import android.net.nsd.NsdManager;
import android.net.nsd.NsdManager;
import android.net.wifi.IRttManager;
import android.net.wifi.IWifiManager;
import android.net.wifi.IWifiManager;
import android.net.wifi.IWifiScanner;
import android.net.wifi.IWifiScanner;
import android.net.wifi.RttManager;
import android.net.wifi.RttManager;
@@ -117,7 +115,6 @@ import android.os.ISystemUpdateManager;
import android.os.IUserManager;
import android.os.IUserManager;
import android.os.IncidentManager;
import android.os.IncidentManager;
import android.os.PowerManager;
import android.os.PowerManager;
import android.os.Process;
import android.os.RecoverySystem;
import android.os.RecoverySystem;
import android.os.ServiceManager;
import android.os.ServiceManager;
import android.os.ServiceManager.ServiceNotFoundException;
import android.os.ServiceManager.ServiceNotFoundException;
@@ -641,10 +638,10 @@ final class SystemServiceRegistry {
                new CachedServiceFetcher<RttManager>() {
                new CachedServiceFetcher<RttManager>() {
                @Override
                @Override
                public RttManager createService(ContextImpl ctx) throws ServiceNotFoundException {
                public RttManager createService(ContextImpl ctx) throws ServiceNotFoundException {
                IBinder b = ServiceManager.getServiceOrThrow(Context.WIFI_RTT_SERVICE);
                    IBinder b = ServiceManager.getServiceOrThrow(Context.WIFI_RTT_RANGING_SERVICE);
                IRttManager service = IRttManager.Stub.asInterface(b);
                    IWifiRttManager service = IWifiRttManager.Stub.asInterface(b);
                return new RttManager(ctx.getOuterContext(), service,
                    return new RttManager(ctx.getOuterContext(),
                        ConnectivityThread.getInstanceLooper());
                            new WifiRttManager(ctx.getOuterContext(), service));
                }});
                }});


        registerService(Context.WIFI_RTT_RANGING_SERVICE, WifiRttManager.class,
        registerService(Context.WIFI_RTT_RANGING_SERVICE, WifiRttManager.class,
+5 −12
Original line number Original line Diff line number Diff line
@@ -724,7 +724,6 @@ public final class SystemServer {
        MmsServiceBroker mmsService = null;
        MmsServiceBroker mmsService = null;
        HardwarePropertiesManagerService hardwarePropertiesService = null;
        HardwarePropertiesManagerService hardwarePropertiesService = null;


        boolean disableRtt = SystemProperties.getBoolean("config.disable_rtt", false);
        boolean disableSystemTextClassifier = SystemProperties.getBoolean(
        boolean disableSystemTextClassifier = SystemProperties.getBoolean(
                "config.disable_systemtextclassifier", false);
                "config.disable_systemtextclassifier", false);
        boolean disableCameraService = SystemProperties.getBoolean("config.disable_cameraservice",
        boolean disableCameraService = SystemProperties.getBoolean("config.disable_cameraservice",
@@ -1105,11 +1104,6 @@ public final class SystemServer {
                traceEnd();
                traceEnd();
            }
            }


            if (!disableRtt) {
                traceBeginAndSlog("StartWifiRtt");
                mSystemServiceManager.startService("com.android.server.wifi.RttService");
                traceEnd();

            if (context.getPackageManager().hasSystemFeature(
            if (context.getPackageManager().hasSystemFeature(
                PackageManager.FEATURE_WIFI_RTT)) {
                PackageManager.FEATURE_WIFI_RTT)) {
                traceBeginAndSlog("StartRttService");
                traceBeginAndSlog("StartRttService");
@@ -1117,7 +1111,6 @@ public final class SystemServer {
                    "com.android.server.wifi.rtt.RttService");
                    "com.android.server.wifi.rtt.RttService");
                traceEnd();
                traceEnd();
            }
            }
            }


            if (context.getPackageManager().hasSystemFeature(
            if (context.getPackageManager().hasSystemFeature(
                PackageManager.FEATURE_WIFI_AWARE)) {
                PackageManager.FEATURE_WIFI_AWARE)) {
+0 −28
Original line number Original line Diff line number Diff line
/*
 * Copyright (C) 2008 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package android.net.wifi;
import android.os.Messenger;
import android.net.wifi.RttManager;

/**
 * {@hide}
 */
interface IRttManager
{
    Messenger getMessenger(in IBinder binder, out int[] key);
    RttManager.RttCapabilities getRttCapabilities();
}
+4 −54
Original line number Original line Diff line number Diff line
@@ -12,7 +12,6 @@ import android.net.wifi.rtt.RangingRequest;
import android.net.wifi.rtt.RangingResult;
import android.net.wifi.rtt.RangingResult;
import android.net.wifi.rtt.RangingResultCallback;
import android.net.wifi.rtt.RangingResultCallback;
import android.net.wifi.rtt.WifiRttManager;
import android.net.wifi.rtt.WifiRttManager;
import android.os.Looper;
import android.os.Parcel;
import android.os.Parcel;
import android.os.Parcelable;
import android.os.Parcelable;
import android.util.Log;
import android.util.Log;
@@ -918,51 +917,6 @@ public class RttManager {
        public void onAborted();
        public void onAborted();
    }
    }


    /**
     * A parcelable that contains rtt client information.
     *
     * @hide
     */
    public static class RttClient implements Parcelable {
        // Package name of RttClient.
        private final String mPackageName;

        public RttClient(String packageName) {
            mPackageName = packageName;
        }

        protected RttClient(Parcel in) {
            mPackageName = in.readString();
        }

        public static final Creator<RttManager.RttClient> CREATOR =
                new Creator<RttManager.RttClient>() {
            @Override
            public RttManager.RttClient createFromParcel(Parcel in) {
                return new RttManager.RttClient(in);
            }

            @Override
            public RttManager.RttClient[] newArray(int size) {
                return new RttManager.RttClient[size];
            }
        };

        @Override
        public int describeContents() {
            return 0;
        }

        @Override
        public void writeToParcel(Parcel parcel, int i) {
            parcel.writeString(mPackageName);
        }

        public String getPackageName() {
            return mPackageName;
        }
    }

    /**
    /**
     * Request to start an RTT ranging
     * Request to start an RTT ranging
     *
     *
@@ -1202,7 +1156,6 @@ public class RttManager {
    /** @hide */
    /** @hide */
    public static final int CMD_OP_REG_BINDER           = BASE + 9;
    public static final int CMD_OP_REG_BINDER           = BASE + 9;


    private final Context mContext;
    private final WifiRttManager mNewService;
    private final WifiRttManager mNewService;
    private RttCapabilities mRttCapabilities;
    private RttCapabilities mRttCapabilities;


@@ -1211,17 +1164,14 @@ public class RttManager {
     * Applications will almost always want to use
     * Applications will almost always want to use
     * {@link android.content.Context#getSystemService Context.getSystemService()} to retrieve
     * {@link android.content.Context#getSystemService Context.getSystemService()} to retrieve
     * the standard {@link android.content.Context#WIFI_RTT_SERVICE Context.WIFI_RTT_SERVICE}.
     * the standard {@link android.content.Context#WIFI_RTT_SERVICE Context.WIFI_RTT_SERVICE}.
     * @param context the application context
     * @param service the new WifiRttManager service
     * @param service the Binder interface
     * @param looper Looper for running the callbacks.
     *
     *
     * @hide
     * @hide
     */
     */
    public RttManager(Context context, IRttManager service, Looper looper) {
    public RttManager(Context context, WifiRttManager service) {
        mContext = context;
        mNewService = service;
        mNewService = (WifiRttManager) mContext.getSystemService(Context.WIFI_RTT_RANGING_SERVICE);


        boolean rttSupported = mContext.getPackageManager().hasSystemFeature(
        boolean rttSupported = context.getPackageManager().hasSystemFeature(
                PackageManager.FEATURE_WIFI_RTT);
                PackageManager.FEATURE_WIFI_RTT);


        mRttCapabilities = new RttCapabilities();
        mRttCapabilities = new RttCapabilities();