package android.net.wifi;
+import android.Manifest;
import android.annotation.NonNull;
import android.annotation.RequiresPermission;
import android.annotation.SuppressLint;
};
}
+ @RequiresPermission(Manifest.permission.LOCATION_HARDWARE)
public RttCapabilities getRttCapabilities() {
synchronized (mCapabilitiesLock) {
if (mRttCapabilities == null) {
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;
+ }
+ }
+
private boolean rttParamSanity(RttParams params, int index) {
if (mRttCapabilities == null) {
if(getRttCapabilities() == null) {
mAsyncChannel.connectSync(mContext, handler, messenger);
// We cannot use fullyConnectSync because it sends the FULL_CONNECTION message
// synchronously, which causes RttService to receive the wrong replyTo value.
- mAsyncChannel.sendMessage(AsyncChannel.CMD_CHANNEL_FULL_CONNECTION);
+ mAsyncChannel.sendMessage(AsyncChannel.CMD_CHANNEL_FULL_CONNECTION,
+ new RttClient(context.getPackageName()));
mAsyncChannel.sendMessage(CMD_OP_REG_BINDER, key[0]);
}