diff options
| -rw-r--r-- | Android.bp | 1 | ||||
| -rw-r--r-- | core/java/android/app/SystemServiceRegistry.java | 17 | ||||
| -rw-r--r-- | services/java/com/android/server/SystemServer.java | 17 | ||||
| -rw-r--r-- | wifi/java/android/net/wifi/IRttManager.aidl | 28 | ||||
| -rw-r--r-- | wifi/java/android/net/wifi/RttManager.java | 58 |
5 files changed, 16 insertions, 105 deletions
diff --git a/Android.bp b/Android.bp index 3d56254417e1..c5d64fb99f8b 100644 --- a/Android.bp +++ b/Android.bp @@ -578,7 +578,6 @@ java_library { "wifi/java/android/net/wifi/rtt/IWifiRttManager.aidl", "wifi/java/android/net/wifi/hotspot2/IProvisioningCallback.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/Proxy/com/android/net/IProxyCallback.aidl", "packages/services/Proxy/com/android/net/IProxyPortListener.aidl", diff --git a/core/java/android/app/SystemServiceRegistry.java b/core/java/android/app/SystemServiceRegistry.java index 87f32b2613bc..aa52cdef70c6 100644 --- a/core/java/android/app/SystemServiceRegistry.java +++ b/core/java/android/app/SystemServiceRegistry.java @@ -38,7 +38,6 @@ import android.content.ClipboardManager; import android.content.Context; import android.content.IRestrictionsManager; import android.content.RestrictionsManager; -import android.content.pm.ApplicationInfo; import android.content.pm.CrossProfileApps; import android.content.pm.ICrossProfileApps; import android.content.pm.IShortcutService; @@ -90,7 +89,6 @@ import android.net.lowpan.ILowpanManager; import android.net.lowpan.LowpanManager; import android.net.nsd.INsdManager; import android.net.nsd.NsdManager; -import android.net.wifi.IRttManager; import android.net.wifi.IWifiManager; import android.net.wifi.IWifiScanner; import android.net.wifi.RttManager; @@ -117,7 +115,6 @@ import android.os.ISystemUpdateManager; import android.os.IUserManager; import android.os.IncidentManager; import android.os.PowerManager; -import android.os.Process; import android.os.RecoverySystem; import android.os.ServiceManager; import android.os.ServiceManager.ServiceNotFoundException; @@ -639,13 +636,13 @@ final class SystemServiceRegistry { registerService(Context.WIFI_RTT_SERVICE, RttManager.class, new CachedServiceFetcher<RttManager>() { - @Override - public RttManager createService(ContextImpl ctx) throws ServiceNotFoundException { - IBinder b = ServiceManager.getServiceOrThrow(Context.WIFI_RTT_SERVICE); - IRttManager service = IRttManager.Stub.asInterface(b); - return new RttManager(ctx.getOuterContext(), service, - ConnectivityThread.getInstanceLooper()); - }}); + @Override + public RttManager createService(ContextImpl ctx) throws ServiceNotFoundException { + IBinder b = ServiceManager.getServiceOrThrow(Context.WIFI_RTT_RANGING_SERVICE); + IWifiRttManager service = IWifiRttManager.Stub.asInterface(b); + return new RttManager(ctx.getOuterContext(), + new WifiRttManager(ctx.getOuterContext(), service)); + }}); registerService(Context.WIFI_RTT_RANGING_SERVICE, WifiRttManager.class, new CachedServiceFetcher<WifiRttManager>() { diff --git a/services/java/com/android/server/SystemServer.java b/services/java/com/android/server/SystemServer.java index c3614346bbdc..5ea113b801b5 100644 --- a/services/java/com/android/server/SystemServer.java +++ b/services/java/com/android/server/SystemServer.java @@ -724,7 +724,6 @@ public final class SystemServer { MmsServiceBroker mmsService = null; HardwarePropertiesManagerService hardwarePropertiesService = null; - boolean disableRtt = SystemProperties.getBoolean("config.disable_rtt", false); boolean disableSystemTextClassifier = SystemProperties.getBoolean( "config.disable_systemtextclassifier", false); boolean disableCameraService = SystemProperties.getBoolean("config.disable_cameraservice", @@ -1105,18 +1104,12 @@ public final class SystemServer { traceEnd(); } - if (!disableRtt) { - traceBeginAndSlog("StartWifiRtt"); - mSystemServiceManager.startService("com.android.server.wifi.RttService"); + if (context.getPackageManager().hasSystemFeature( + PackageManager.FEATURE_WIFI_RTT)) { + traceBeginAndSlog("StartRttService"); + mSystemServiceManager.startService( + "com.android.server.wifi.rtt.RttService"); traceEnd(); - - if (context.getPackageManager().hasSystemFeature( - PackageManager.FEATURE_WIFI_RTT)) { - traceBeginAndSlog("StartRttService"); - mSystemServiceManager.startService( - "com.android.server.wifi.rtt.RttService"); - traceEnd(); - } } if (context.getPackageManager().hasSystemFeature( diff --git a/wifi/java/android/net/wifi/IRttManager.aidl b/wifi/java/android/net/wifi/IRttManager.aidl deleted file mode 100644 index 383180995b21..000000000000 --- a/wifi/java/android/net/wifi/IRttManager.aidl +++ /dev/null @@ -1,28 +0,0 @@ -/* - * 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(); -} diff --git a/wifi/java/android/net/wifi/RttManager.java b/wifi/java/android/net/wifi/RttManager.java index fe63aa1bf79b..0b81dd2f4c2d 100644 --- a/wifi/java/android/net/wifi/RttManager.java +++ b/wifi/java/android/net/wifi/RttManager.java @@ -12,7 +12,6 @@ import android.net.wifi.rtt.RangingRequest; import android.net.wifi.rtt.RangingResult; import android.net.wifi.rtt.RangingResultCallback; import android.net.wifi.rtt.WifiRttManager; -import android.os.Looper; import android.os.Parcel; import android.os.Parcelable; import android.util.Log; @@ -919,51 +918,6 @@ public class RttManager { } /** - * 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 * * @param params -- RTT request Parameters @@ -1202,7 +1156,6 @@ public class RttManager { /** @hide */ public static final int CMD_OP_REG_BINDER = BASE + 9; - private final Context mContext; private final WifiRttManager mNewService; private RttCapabilities mRttCapabilities; @@ -1211,17 +1164,14 @@ public class RttManager { * Applications will almost always want to use * {@link android.content.Context#getSystemService Context.getSystemService()} to retrieve * the standard {@link android.content.Context#WIFI_RTT_SERVICE Context.WIFI_RTT_SERVICE}. - * @param context the application context - * @param service the Binder interface - * @param looper Looper for running the callbacks. + * @param service the new WifiRttManager service * * @hide */ - public RttManager(Context context, IRttManager service, Looper looper) { - mContext = context; - mNewService = (WifiRttManager) mContext.getSystemService(Context.WIFI_RTT_RANGING_SERVICE); + public RttManager(Context context, WifiRttManager service) { + mNewService = service; - boolean rttSupported = mContext.getPackageManager().hasSystemFeature( + boolean rttSupported = context.getPackageManager().hasSystemFeature( PackageManager.FEATURE_WIFI_RTT); mRttCapabilities = new RttCapabilities(); |